/* contact.html only — do not link on index.html.
   Index #contact band: css/home/home-light.css (info cards, no form). */
html:has(body.page-contact) {
    height: 100%;
    overflow: hidden;
    background-color: var(--navy, #050a14);
}

body.page-contact {
    --contact-header-offset: var(--rc-header-home-row-h, 68px);
    margin: 0;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--navy, #050a14);
    background-image: url('../../assets/images/backgrounds/contact-form.jpeg');
    background-size: cover;
    background-position: 18% center;
    background-repeat: no-repeat;
}

body.page-contact::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(
        90deg,
        rgba(5, 10, 20, 0.05) 0%,
        rgba(5, 10, 20, 0.12) 32%,
        rgba(5, 10, 20, 0.45) 58%,
        rgba(5, 10, 20, 0.78) 100%
    );
    z-index: 0;
}

body.page-contact #siteHeader {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.contact-page-wrapper {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
    padding: calc(var(--contact-header-offset) + clamp(8px, 1.5vh, 16px))
        clamp(16px, 4vw, 48px)
        clamp(10px, 2vh, 20px)
        clamp(16px, 3vw, 32px);
    overflow: hidden;
}

.glass-panel {
    background: rgba(14, 22, 38, 0.38);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 217, 194, 0.25);
    border-radius: 24px;
    padding: clamp(24px, 3.5vh, 40px) clamp(22px, 3.5vw, 44px);
    width: 100%;
    max-width: min(1040px, 58vw);
    max-height: 100%;
    box-sizing: border-box;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    display: grid;
    grid-template-columns: minmax(min(100%, 22.5rem), 1.38fr) minmax(15.5rem, 0.78fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "head head"
        "offices form"
        "comms form";
    gap: clamp(16px, 2.2vh, 24px) clamp(24px, 3.5vw, 40px);
    align-content: start;
    overflow: hidden;
}

.glass-head {
    grid-area: head;
}

.data-card--offices {
    grid-area: offices;
    min-height: 0;
}

.data-card--comms {
    grid-area: comms;
    min-height: 0;
    min-width: 0;
}

.form-column {
    grid-area: form;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 0;
    min-width: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    padding-left: clamp(20px, 2.5vw, 36px);
}

.glass-head h1 {
    font-size: clamp(26px, 3.8vw, 36px);
    color: #fff;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
    line-height: 1.12;
}

.glass-head p {
    font-size: clamp(14px, 1.05rem, 16px);
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.5;
    max-width: 42em;
}

.data-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: clamp(16px, 2.2vh, 24px) clamp(16px, 2.5vw, 28px);
    transition: border-color 0.3s ease, background 0.3s ease;
    min-width: 0;
}

.data-card:hover {
    border-color: rgba(0, 217, 194, 0.3);
    background: rgba(0, 217, 194, 0.03);
}

.data-label {
    font-family: var(--font-mono);
    color: var(--cyan-primary);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: clamp(10px, 1.4vh, 16px);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 217, 194, 0.15);
}

.data-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.data-card--comms .data-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.data-card--comms .contact-item {
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
    width: max-content;
    max-width: 100%;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: clamp(13px, 0.9rem, 14.5px);
    text-decoration: none;
    line-height: 1.45;
    transition: color 0.3s;
}

a.contact-item:hover {
    color: var(--cyan-primary);
}

.contact-item.dim {
    color: rgba(255, 255, 255, 0.65);
}

.contact-item.link-accent {
    color: var(--cyan-primary);
}

.contact-item svg {
    width: 18px;
    height: 18px;
    color: var(--cyan-primary);
    flex-shrink: 0;
    margin-top: 1px;
}

.office-locations {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(14px, 2vh, 18px);
}

.office-location {
    min-width: 0;
}

.office-location + .office-location {
    margin-top: 0;
    padding-top: clamp(12px, 1.6vh, 14px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.office-location-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cyan-primary);
}

.office-location-head svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}

.office-address {
    margin: 0;
    padding-left: 27px;
    font-size: clamp(12.5px, 0.85rem, 14px);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
    overflow-wrap: break-word;
    word-break: normal;
    text-wrap: pretty;
    hanging-punctuation: first last;
}

.form-note-title {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: clamp(12px, 1.6vh, 18px);
    font-style: italic;
}

/* Shared form primitives (contact page) */
.contact-form {
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 11.5px;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-weight: 500;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-fine);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 13.5px;
    background: rgba(2, 4, 7, 0.4);
    color: var(--text-main);
    transition: 0.3s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--cyan-primary);
    box-shadow: 0 0 0 3px var(--ion-dim);
    background: rgba(2, 4, 7, 0.7);
}

.field textarea {
    resize: vertical;
    min-height: 80px;
}

.contact-form .btn-primary {
    margin-top: 8px;
    background: linear-gradient(135deg, var(--blue-deep) 0%, var(--cyan-primary) 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    padding: 12px;
    font-size: 13.5px;
    box-shadow: 0 10px 25px rgba(0, 144, 255, 0.4);
    transition: 0.2s;
}

.contact-form .btn-primary:hover {
    background: linear-gradient(135deg, var(--blue-deep) 0%, var(--cyan-primary) 100%);
    box-shadow: 0 15px 35px rgba(0, 217, 194, 0.5);
    transform: translateY(-2px);
}

.contact-form--page {
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}

.contact-form--page .field {
    margin-bottom: clamp(10px, 1.4vh, 14px);
}

.contact-form--page .field:last-of-type {
    margin-bottom: clamp(12px, 1.8vh, 18px);
}

.contact-form--page .field input,
.contact-form--page .field textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: clamp(11px, 1.4vh, 14px) 16px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.contact-form--page .field textarea {
    min-height: clamp(56px, 10vh, 88px);
    resize: none;
    max-height: clamp(56px, 10vh, 88px);
    line-height: 1.5;
}

.contact-form--page .btn-primary {
    width: 100%;
    justify-content: center;
    margin-top: 0;
    padding: clamp(12px, 1.6vh, 14px);
    font-size: 14px;
}

/* Narrow desktop / short viewports */
@media (max-width: 1280px) {
    .glass-panel {
        max-width: min(920px, 72vw);
    }
}

@media (max-height: 760px) {
    .glass-panel {
        padding: 14px 18px;
        gap: 10px 18px;
    }

    .data-card {
        padding: 10px 12px;
    }

    .office-address {
        padding-left: 0;
    }

    .office-location-head {
        margin-bottom: 2px;
    }

    .contact-form--page .field textarea {
        min-height: var(--rc-header-home-row-h, 68px);
    }
}

/* Match site header breakpoints (burger menu) */
@media (max-width: 1120px) {
    body.page-contact {
        --contact-header-offset: var(--rc-header-mobile-row-h, 64px);
    }

    body.page-contact #siteHeader {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
    }
}

/* Stacked layout — tablet & mobile */
@media (max-width: 1024px) {
    .contact-page-wrapper {
        flex: 1;
        min-height: 0;
        align-items: center;
        justify-content: flex-start;
        padding: calc(var(--contact-header-offset) + 8px) 12px
            max(12px, env(safe-area-inset-bottom, 0px));
        overflow: hidden;
    }

    body.page-contact::before {
        background: linear-gradient(
            180deg,
            rgba(5, 10, 20, 0.35) 0%,
            rgba(5, 10, 20, 0.55) 100%
        );
    }

    .glass-panel {
        max-width: min(640px, 100%);
        max-height: 100%;
        margin-inline: auto;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        grid-template-areas:
            "head"
            "offices"
            "comms"
            "form";
        gap: clamp(8px, 1.2vh, 12px);
        align-content: start;
        overflow: hidden;
        padding: clamp(14px, 2vh, 20px) clamp(14px, 3vw, 18px);
    }

    .glass-head h1 {
        font-size: clamp(1.35rem, 4.5vw, 1.65rem);
        margin-bottom: 4px;
    }

    .glass-head p {
        font-size: clamp(12px, 0.85rem, 14px);
        line-height: 1.35;
    }

    .data-card {
        padding: clamp(10px, 1.5vh, 14px) clamp(12px, 2vw, 16px);
    }

    .data-label {
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .contact-form--page .field {
        margin-bottom: clamp(6px, 1vh, 10px);
    }

    .contact-form--page .field textarea {
        min-height: clamp(48px, 8vh, 64px);
        max-height: clamp(48px, 8vh, 64px);
    }

    .data-card--comms .contact-item {
        white-space: normal;
        width: auto;
        font-size: clamp(12px, 0.8rem, 13px);
    }

    .form-column {
        border-left: none;
        padding-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-top: 16px;
    }

    .office-locations {
        grid-template-columns: 1fr;
    }

    .office-location + .office-location {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .office-address {
        padding-left: 0;
    }

    .data-card--comms .data-content {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }
}

@media (max-width: 1024px) and (max-height: 700px) {
    .office-address {
        font-size: 12px;
        line-height: 1.45;
    }

    .office-location + .office-location {
        margin-top: 6px;
        padding-top: 6px;
    }

    .form-column {
        padding-top: 10px;
    }

    .form-note-title {
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .glass-panel {
        padding: 20px 16px;
        border-radius: 18px;
    }

    .glass-head h1 {
        font-size: 1.65rem;
    }

    .contact-page-wrapper {
        padding-left: 12px;
        padding-right: 12px;
    }
}
