/* ============================================================
   de-grid37 — Head of Mission section (10×3 Golden Grid)
   Файл: frontend/web/css/de-grid37.css
   НЕ редагувати inline стилі у _*_team_head.php — єдине джерело стилів тут.
   ============================================================ */

.de-grid37 {
    position: relative;
    max-width: 1320px;
    margin: 0 auto;
    --pad: clamp(16px, 2vw, 24px);
    --title-size: clamp(2rem, 2.3vw + 0.4rem, 2.7rem);
    --pad-y: clamp(28px, 12vw, 132px);
    --band-gap: clamp(22px, 5vw, 40px);
    --content-x: clamp(32px, 7vw, 72px);
    --band-pad-y: clamp(14px, 2.8vw, 24px);
    --row-size: clamp(120px, 11vw, 220px);
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: var(--row-size) minmax(var(--row-size), auto) var(--row-size);
    gap: 0;
    padding: var(--pad);
    overflow: hidden;
}

.de-grid37::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--pad) + ((100% - 2 * var(--pad)) / 3) * 0.8);
    height: calc(((100% - 2 * var(--pad)) / 3) * 1.4);
    background: #173750;
    z-index: 1;
}

.de-grid37__cell {
    position: relative;
    z-index: 0;
    pointer-events: none;
}

.de-grid37__cell--row1,
.de-grid37__cell--row2,
.de-grid37__cell--row3 {
    background: transparent;
}

/* --- Photo --- */
.de-grid37__photo {
    grid-column: 1 / span 3;
    grid-row: 1 / span 3;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(12px, 1.4vw, 18px);
}

.de-grid37__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 14px 32px rgba(23, 55, 80, 0.18);
}

/* --- Title (row 1, cols 4-10) --- */
.de-grid37__title {
    grid-column: 4 / -1;
    grid-row: 1;
    align-self: end;
    padding: var(--band-pad-y) var(--content-x) calc(var(--pad-y) * 0.4);
    text-align: left;
    z-index: 2;
}

.de-grid37__title h3 {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: var(--title-size);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #173750;
}

/* --- Blue band (row 2) --- */
.de-grid37__band {
    grid-column: 4 / -1;
    grid-row: 2;
    z-index: 2;
    display: grid;
    grid-auto-rows: min-content;
    gap: calc(var(--band-gap) * 2.2);
    align-content: center;
    justify-items: start;
    padding: var(--band-pad-y) var(--content-x);
    color: #ffffff;
}

.de-grid37__band-inner {
    padding-block: clamp(6px, 1.1vw, 12px);
    width: 100%;
    display: grid;
    gap: clamp(10px, 1.2vw, 18px);
    justify-items: start;
}

/* --- Footer / social row (row 3, sits below the blue stripe on white) --- */
.de-grid37__footer {
    grid-column: 4 / -1;
    grid-row: 3;
    z-index: 2;
    display: grid;
    grid-auto-flow: column;
    justify-content: start;
    align-items: center;
    gap: clamp(12px, 2.2vw, 24px);
    padding: var(--band-pad-y) var(--content-x) clamp(4px, 1vw, 10px);
}

/* --- Text elements --- */
.de-grid37__position {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.05rem, 1.1vw, 1.22rem);
    line-height: 1.6;
}

.de-grid37__certificate {
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: clamp(1.1rem, 1.4vw, 1.4rem);
    letter-spacing: 0.08em;
    color: #f8ef67;
}

/* --- Social icons --- */
.de-grid37__icons {
    display: inline-flex;
    gap: 16px;
    align-items: center;
}

.de-grid37__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(23, 55, 80, 0.45);
    color: #173750;
    background: transparent;
    transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

.de-grid37__icon:hover {
    transform: translateY(-2px);
    background: #173750;
    color: #ffffff;
    border-color: #173750;
}

.de-grid37__icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

/* --- Link --- */
.de-grid37__link {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}

.de-grid37__link:hover {
    color: rgba(255, 255, 255, 0.82);
}

/* --- Mobile band (hidden on desktop) --- */
.de-grid37__mobile-band {
    display: none;
}

/* --- Accessibility --- */
.de-grid37 .nl-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   Mobile: 6-column stacked layout
   ============================================================ */
@media (max-width: 768px) {
    .de-grid37 {
        --mobile-pad: clamp(14px, 9vw, 32px);
        padding: var(--mobile-pad);
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        grid-template-rows: repeat(9, minmax(0, auto));
        grid-auto-rows: minmax(0, auto);
        min-height: calc((100vw - 2 * var(--mobile-pad)) * 2.4);
        border-radius: 18px;
        box-shadow: none;
        overflow: hidden;
        background:
            linear-gradient(
                to right,
                rgba(23, 55, 80, 0) 6%,
                #173750 6%,
                #173750 94%,
                rgba(23, 55, 80, 0) 94%
            ),
            #ffffff;
    }

    .de-grid37::after {
        display: none;
    }

    .de-grid37__mobile-band {
        display: block;
        grid-column: 1 / span 6;
        grid-row: 5 / span 5;
        background:
            linear-gradient(
                to right,
                rgba(23, 55, 80, 0) 6%,
                #173750 6%,
                #173750 94%,
                rgba(23, 55, 80, 0) 94%
            );
        border-radius: 28px 28px 0 0;
        z-index: 1;
    }

    .de-grid37__photo {
        grid-column: 1 / span 6;
        grid-row: 1 / span 5;
        padding: 0;
        z-index: 3;
        display: flex;
        align-items: stretch;
        justify-content: center;
        margin: 0 calc(-1 * var(--mobile-pad));
        width: calc(100% + 2 * var(--mobile-pad));
        background: transparent;
        border-radius: 18px 18px 0 0;
    }

    .de-grid37__photo img {
        border-radius: 14px;
        box-shadow: none;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
    }

    .de-grid37__title {
        grid-column: 1 / span 6;
        grid-row: 6;
        padding: clamp(12px, 4vw, 18px) clamp(10px, 5vw, 18px) clamp(6px, 3vw, 10px);
        align-self: start;
        text-align: center;
        color: #ffffff;
        z-index: 3;
    }

    .de-grid37__title h3 {
        color: #ffffff;
        letter-spacing: 0.1em;
        font-size: clamp(2rem, 10vw, 2.6rem);
    }

    .de-grid37__band {
        grid-column: 1 / span 6;
        grid-row: 7 / span 2;
        padding: clamp(8px, 3vw, 16px) clamp(10px, 5vw, 18px);
        width: 100%;
        justify-items: center;
        align-content: start;
        gap: clamp(12px, 4vw, 20px);
        color: #ffffff;
        text-align: center;
        z-index: 3;
    }

    .de-grid37__band-inner {
        width: 100%;
        padding: 0;
        display: grid;
        gap: clamp(10px, 4vw, 18px);
        justify-items: center;
    }

    .de-grid37__position,
    .de-grid37__certificate,
    .de-grid37__link {
        color: #ffffff;
    }

    .de-grid37__certificate {
        letter-spacing: 0.18em;
        color: #f5d84c;
    }

    .de-grid37__link {
        text-decoration: underline;
        text-underline-offset: 5px;
    }

    .de-grid37__footer {
        grid-column: 1 / span 6;
        grid-row: 9;
        padding: clamp(12px, 4vw, 18px) clamp(10px, 5vw, 18px) clamp(6px, 3vw, 10px);
        justify-content: center;
        gap: clamp(12px, 4vw, 20px);
        align-self: end;
        z-index: 3;
    }

    .de-grid37__icon {
        border-color: rgba(255, 255, 255, 0.85);
        color: rgba(255, 255, 255, 0.95);
    }

    .de-grid37__icon:hover {
        background: rgba(255, 255, 255, 0.2);
        color: #ffffff;
    }
}
