/* Minimal responsive refresh layered over the original MDC design. */
:root {
    --mdc-blue: #1769aa;
    --mdc-blue-dark: #0d4f86;
    --mdc-sky: #eaf4fc;
    --mdc-text: #263746;
    --mdc-muted: #6a7b88;
    --mdc-line: #dbe5ec;
    --mdc-surface: #ffffff;
    --mdc-shadow: 0 18px 48px rgba(20, 55, 78, .12);
}

html {
    min-width: 0;
    background: #eef3f6;
}

body {
    min-width: 0;
    color: var(--mdc-text);
    background: linear-gradient(180deg, #eaf2f7 0, #f7f9fa 360px, #f7f9fa 100%);
}

a {
    color: var(--mdc-blue);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:focus,
button:focus,
input:focus {
    outline: 3px solid rgba(23, 105, 170, .28);
    outline-offset: 2px;
}

#wrapper {
    width: min(980px, 100%);
    box-shadow: var(--mdc-shadow);
}

#header {
    min-height: 80px;
    background: rgba(255, 255, 255, .97);
}

html[lang="uk"] .lang-en-only,
html[lang="en"] .lang-ua-only {
    display: none !important;
}

#header .menu-top li a {
    border-radius: 999px;
    transition: color .2s ease, background-color .2s ease;
}

#header .menu-top li.active a,
#header .menu-top li a:hover {
    color: var(--mdc-blue-dark);
    background-color: var(--mdc-sky);
}

#header .languages li a {
    min-width: 32px;
    box-sizing: border-box;
    text-align: center;
    border-radius: 999px;
    transition: background-color .2s ease, color .2s ease;
}

#header .languages li.active a {
    background: var(--mdc-blue);
}

#menu {
    height: auto;
    overflow: visible;
    border-top: 1px solid rgba(23, 105, 170, .08);
    border-bottom: 1px solid var(--mdc-line);
    background: #173a52;
}

#menu.modern-nav > ul {
    display: flex;
    align-items: stretch;
    width: auto;
    min-height: 52px;
    margin: 0;
    padding: 0 14px;
}

#menu.modern-nav li {
    float: none;
    flex: 1 1 auto;
    background: none;
}

#menu.modern-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 52px;
    box-sizing: border-box;
    padding: 0 10px;
    color: #fff;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition: background-color .2s ease;
}

#menu.modern-nav a:hover,
#menu.modern-nav a:focus {
    background: rgba(255, 255, 255, .13);
}

#middle {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    box-sizing: border-box;
    padding: 28px 20px 100px;
}

#container {
    float: none;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    overflow: visible;
}

#middle #container {
    width: 100%;
}

#content {
    padding: 0;
    overflow-wrap: anywhere;
}

#content h1 {
    color: #173a52;
    letter-spacing: .025em;
}

#content h2,
#content h2 a {
    color: var(--mdc-blue-dark);
}

#content p {
    font-size: 14px;
    line-height: 1.65;
}

#content td {
    font-size: 12px;
    line-height: 1.5;
}

#content img,
#sidebar img {
    max-width: 100%;
    height: auto;
}

#content iframe {
    max-width: 100%;
}

#content .projects,
#content .news,
#content .galleries,
#content .propositions,
#content .projects-view {
    border-top-color: var(--mdc-line);
}

#content .projects li,
#content .news li,
#content .galleries li,
#content .propositions li {
    border: 1px solid var(--mdc-line);
    border-radius: 10px;
    margin: 0 0 12px;
    padding: 14px;
    background: var(--mdc-surface);
    box-sizing: border-box;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

#content .projects li:hover,
#content .news li:hover,
#content .galleries li:hover,
#content .propositions li:hover {
    border-color: #afcadc;
    box-shadow: 0 10px 24px rgba(20, 75, 110, .09);
    transform: translateY(-1px);
}

#content .projects img,
#content .news img,
#content .galleries img,
#content .propositions img,
#content .projects-view img {
    border-color: var(--mdc-line);
    border-radius: 6px;
    background: #fff;
}

#content .show,
#content .archive,
#content .types,
#content .setfilter {
    border-color: var(--mdc-line);
    border-radius: 8px;
    background: #f3f7fa;
}

#content .projects-view td.dt,
#content .projects-view td.dt-bottom {
    background: #edf3f7;
}

#content .projects-view td.dd {
    color: #4d606d;
}

#sidebar {
    float: none;
    flex: 0 0 300px;
    width: 300px;
    margin: 0;
}

#sidebar .search {
    border: 1px solid #c9ddea;
    background: var(--mdc-sky);
}

#sidebar dl dd {
    border-color: var(--mdc-line);
    border-radius: 0 0 8px 8px;
    background: #fff;
}

#footer {
    width: min(980px, 100%);
    box-sizing: border-box;
    background-color: #fff;
}

#footer .email a,
#footer .privacy-link a {
    color: var(--mdc-blue-dark);
    font-size: 12px;
}

#footer .privacy-link {
    margin-top: 8px;
}

.sticky-project-cta {
    position: fixed;
    z-index: 1000;
    right: 24px;
    bottom: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    color: #fff;
    background: var(--mdc-blue);
    box-shadow: 0 12px 30px rgba(13, 79, 134, .28);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.sticky-project-cta:hover,
.sticky-project-cta:focus {
    color: #fff;
    background: var(--mdc-blue-dark);
}

.mdc-hero {
    position: relative;
    min-height: 430px;
    margin: -28px -20px 42px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background-color: #15384f;
    background-position: left 42%;
    background-size: 118% auto;
    background-repeat: no-repeat;
}

.mdc-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(7, 28, 43, .82), rgba(7, 28, 43, .2));
}

.mdc-hero::after {
    display: none;
}

.mdc-hero__content {
    position: relative;
    z-index: 2;
    max-width: 650px;
    padding: 48px;
    color: #fff;
}

#content .mdc-hero h1 {
    margin: 0 0 14px;
    color: #fff;
    font-size: 40px;
    line-height: 1.1;
    text-transform: none;
}

#content .mdc-hero p {
    margin: 0;
    color: #fff;
    font-size: 20px;
}

.current-projects {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 24px 0 36px;
}

.current-project-card {
    overflow: hidden;
    border: 1px solid var(--mdc-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 26px rgba(20, 75, 110, .08);
}

.current-project-card img {
    display: block;
    width: 100%;
    height: 210px !important;
    object-fit: cover;
}

.current-project-card__body {
    padding: 18px;
}

#content .current-project-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.mdc-section-intro {
    max-width: 760px;
    margin-bottom: 26px;
    color: var(--mdc-muted);
}

.contact-layout,
.certificate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.contact-card,
.certificate-card {
    padding: 20px;
    border: 1px solid var(--mdc-line);
    border-radius: 10px;
    background: #fff;
}

.contact-form-frame {
    width: 100%;
    min-height: 650px;
    border: 0;
}

@media (max-width: 980px) {
    #header a.logo {
        width: calc(100% - 40px);
        max-width: 875px;
        background-size: contain;
    }

    #menu {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    #menu.modern-nav > ul {
        width: max-content;
        min-width: 100%;
    }

    #menu.modern-nav li {
        min-width: 132px;
    }

    #footer {
        height: auto;
        min-height: 110px;
        background-size: cover;
    }

    #footer .left,
    #footer .center,
    #footer .right {
        box-sizing: border-box;
        width: 33.333%;
    }
}

@media (max-width: 760px) {
    #header {
        height: 132px;
    }

    #header a.logo {
        top: 18px;
        height: 44px;
    }

    #header .menu-top {
        position: absolute;
        left: 12px;
        right: 12px;
        bottom: 10px;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        font-size: 1.25em;
    }

    #header .menu-top li,
    #header .menu-top li a {
        float: none;
    }

    #header .menu-top li a {
        height: auto;
        margin: 0;
        padding: 6px 9px;
        background: none;
    }

    #header .languages {
        top: 18px;
        right: 12px;
    }

    #middle {
        flex-direction: column;
        gap: 28px;
        padding: 24px 16px 56px;
    }

    .mdc-hero {
        min-height: 380px;
        margin: -24px -16px 34px;
        background-position: center;
        background-size: cover;
    }

    .mdc-hero__content {
        padding: 34px 24px;
    }

    .mdc-hero::after { display: none; }

    #content .mdc-hero h1 {
        font-size: 32px;
    }

    .current-projects,
    .contact-layout,
    .certificate-grid {
        grid-template-columns: 1fr;
    }

    #sidebar {
        width: 100%;
        flex-basis: auto;
    }

    #sidebar .search .round {
        box-sizing: border-box;
        width: calc(100% - 70px);
    }

    #sidebar .search .round input {
        box-sizing: border-box;
        width: 100%;
    }

    #content .types li.first,
    #content .types li.second,
    #content .types li.third {
        width: 100%;
        margin-bottom: 14px;
    }

    #content .setfilter input.submit_ua,
    #content .setfilter input.submit_en {
        display: block;
        margin: 0 auto;
    }

    #content .projects-view dl {
        clear: both;
        padding: 14px 0 0;
    }

    #content .projects-view table.param {
        width: 100%;
        height: auto;
    }

    #content .tabs {
        height: auto;
        overflow-x: auto;
        white-space: nowrap;
    }

    #footer ul {
        display: flex;
        flex-direction: column;
        gap: 12px;
        padding: 28px 16px;
    }

    #footer .left,
    #footer .center,
    #footer .right {
        float: none;
        width: 100%;
        height: auto;
        padding: 0;
        background: none;
        text-align: center;
    }

    #footer .left img {
        float: none;
        display: inline-block;
        vertical-align: middle;
    }

    #footer .right {
        text-align: center;
    }
}

@media (max-width: 520px) {
    #content h1 {
        font-size: 1.8em;
    }

    .sticky-project-cta {
        right: 12px;
        bottom: 12px;
        min-height: 42px;
        padding: 0 16px;
    }

    #content .mdc-hero h1 {
        font-size: 28px;
    }

    #content .mdc-hero p {
        font-size: 17px;
    }

    #content .projects img,
    #content .news img,
    #content .galleries img,
    #content .propositions img {
        float: none;
        margin: 0 0 12px;
    }

    #content .projects h2,
    #content .projects dl,
    #content .news h2,
    #content .news p,
    #content .news dl,
    #content .galleries h2,
    #content .galleries dl,
    #content .propositions h2,
    #content .propositions dl {
        padding-left: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

#header a.logo {
    display: flex;
    align-items: center;
    width: 190px;
    height: 68px;
    top: 6px;
    background: none;
}

#header a.logo img {
    display: block;
    width: 190px;
    height: auto;
}

.certificate-card > img {
    display: block;
    width: 100%;
    height: 220px !important;
    object-fit: contain;
    margin-bottom: 16px;
}

/* Modern project index and project detail pages */
#content .mdc-project-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 32px 0 50px;
}

#content .projects-section-heading {
    grid-column: 1 / -1;
    margin: 22px 0 0;
    color: #17384e;
    font-size: 32px;
}

#content .projects-section-heading:first-child {
    margin-top: 0;
}

#content .projects-section-heading--history {
    margin-top: 42px;
}

#content .mdc-project-card {
    overflow: hidden;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(23, 56, 78, .07);
}

#content .mdc-project-card__image,
#content .mdc-project-card__image img {
    display: block;
    width: 100%;
}

#content .mdc-project-card__image img {
    height: 300px;
    object-fit: cover;
}

#content .mdc-project-card__body {
    padding: 24px 26px 28px;
}

#content .mdc-project-card__body h2 {
    margin: 8px 0 12px;
    font-size: 24px;
    line-height: 1.18;
}

#content .mdc-project-card__body p {
    margin: 5px 0;
    color: #6a7b88;
}

#content .mdc-project-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e7f3fb;
    color: #1b6fae;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

#content .mdc-text-link {
    display: inline-block;
    margin-top: 14px;
    color: #1b6fae;
    font-weight: 700;
}

#content .mdc-project-view__hero {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    overflow: hidden;
    margin: 22px 0 42px;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: #fff;
}

#content .mdc-project-view__hero > img {
    width: 100%;
    height: 100%;
    min-height: 430px;
    object-fit: cover;
}

#content .mdc-project-view__hero > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 42px;
}

#content .mdc-project-view__hero h1 {
    margin: 14px 0 18px;
    color: #17384e;
    font-size: 42px;
    line-height: 1.08;
}

#content .mdc-project-view__description {
    max-width: 900px;
    margin: 0 auto 60px;
    color: #415463;
    font-size: 16px;
}

#content .mdc-project-view__description h3 {
    margin: 34px 0 10px;
    color: #17384e;
    font-size: 25px;
}

#content .mdc-project-view__description img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 24px 0;
    border-radius: 10px;
}

@media (max-width: 760px) {
    #content .mdc-project-list,
    #content .mdc-project-view__hero {
        grid-template-columns: 1fr;
    }

    #content .mdc-project-card__image img {
        height: 245px;
    }

    #content .mdc-project-view__hero > img {
        min-height: 300px;
        max-height: 430px;
    }

    #content .mdc-project-view__hero > div {
        padding: 28px 24px;
    }

    #content .mdc-project-view__hero h1 {
        font-size: 32px;
    }
}

/* Engineering heritage on the homepage */
#content .mdc-legacy {
    margin: 72px -34px -34px;
    padding: 72px 34px;
    background: #eaf1f5;
}

#content .mdc-kicker {
    margin: 0 0 12px;
    color: #1b6fae;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .14em;
}

#content .mdc-timeline,
#content .mdc-history-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 34px 0;
}

#content .mdc-timeline article,
#content .mdc-history-strip article {
    padding: 22px;
    border-radius: 10px;
    background: #fff;
}

#content .mdc-timeline strong {
    display: block;
    margin-bottom: 10px;
    color: #1b6fae;
    font-size: 22px;
}

#content .mdc-timeline span,
#content .mdc-history-strip p {
    color: #617481;
}

#content .mdc-history-strip article {
    overflow: hidden;
    padding: 0 0 20px;
}

#content .mdc-history-strip img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

#content .mdc-history-strip h3,
#content .mdc-history-strip p {
    margin-right: 20px;
    margin-left: 20px;
}

#content .mdc-history-strip h3 {
    margin-top: 17px;
    margin-bottom: 7px;
    color: #17384e;
}

#content .mdc-history-link {
    color: #1b6fae;
    font-weight: 800;
}

/* Responsive project videos */
#project-enquiry {
    scroll-margin-top: 78px;
}

#content .mdc-video-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin: 34px 0 58px;
}

#content .mdc-video-card {
    overflow: hidden;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(23, 56, 78, .07);
}

#content .mdc-video-card video,
#content .mdc-video-card iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #102c40;
    object-fit: cover;
}

#content .mdc-video-card > div {
    padding: 24px 26px 28px;
}

#content .mdc-video-card h2 {
    margin: 0 0 10px;
    color: #17384e;
    font-size: 25px;
}

#content .mdc-video-card p {
    color: #617481;
}

#content .mdc-video-card--featured {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    #content .mdc-timeline,
    #content .mdc-history-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    #content .mdc-video-grid,
    #content .mdc-timeline,
    #content .mdc-history-strip {
        grid-template-columns: 1fr;
    }
    #content .mdc-video-card--featured {
        grid-column: auto;
    }
}

/* Project photo galleries restored from the historical catalogue */
#content .mdc-project-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 30px 0 8px;
}
#content .mdc-project-gallery img {
    display: block;
    width: 100%;
    height: 260px;
    border-radius: 10px;
    object-fit: cover;
    background: #eef3f6;
}

/* The home hero already contains the page heading; suppress the legacy duplicate. */
#content.mdc-home-content > #breadcrumbs,
#content.mdc-home-content > h1 {
    display: none;
}
@media (max-width: 700px) {
    #content .mdc-project-gallery { grid-template-columns: 1fr; }
    #content .mdc-project-gallery img { height: auto; }
}

/* Collapsible mobile navigation */
#menu .menu-toggle {
    display: none;
}

@media (max-width: 760px) {
    #menu { overflow: visible; }
    #menu .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 52px;
        padding: 0 18px;
        border: 0;
        color: #fff;
        background: #173a52;
        font: inherit;
        font-weight: 700;
        cursor: pointer;
    }
    #menu .menu-toggle span[aria-hidden="true"] { font-size: 22px; }
    #menu.modern-nav > ul {
        display: none;
        width: 100%;
        min-width: 0;
        padding: 0;
    }
    #menu.modern-nav.is-open > ul { display: block; }
    #menu.modern-nav li { width: 100%; min-width: 0; }
    #menu.modern-nav a {
        justify-content: flex-start;
        padding: 0 18px;
        border-top: 1px solid rgba(255, 255, 255, .12);
        text-align: left;
    }
}
