/* ==========================================================================
   "Mot du directeur" page — letter layout
   Portrait composition comes from estc_components.css
   ========================================================================== */

/* The legacy theme sets overflow:hidden on .page, which makes it the scroll container
   and stops position:sticky from sticking to the window. clip crops the same way. */
.page:has(.estc-director) {
    overflow: clip;
}

.estc-director {
    position: relative;
    overflow: hidden;      /* fallback */
    overflow: clip;        /* clips the decor without breaking the sticky portrait */
    padding: 88px 0 112px;
    background:
        radial-gradient(900px 480px at 100% 0%, rgba(0, 75, 130, .05), transparent 65%),
        #fbfbfc;
}

/* Faint zellige patch behind the portrait column */
.estc-director::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 46%;
    height: 900px;
    background: url('../../images/patterns/pattern_05.png') repeat;
    background-size: 150px;
    opacity: .05;
    -webkit-mask-image: radial-gradient(farthest-side at 0 20%, #000 25%, transparent);
    mask-image: radial-gradient(farthest-side at 0 20%, #000 25%, transparent);
    pointer-events: none;
}

.estc-director__layout {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 88px;
    align-items: start;
}

/* The column stretches to the letter's height so the portrait can stay in view while reading */
.estc-director__aside {
    align-self: stretch;
}

.estc-director__aside-inner {
    position: sticky;
    top: calc(var(--estc-header-h-compact) + 40px);
    padding-top: 22px;
}

/* Section links under the portrait */
.estc-director__more {
    margin-top: 40px;
    padding: 26px 28px 14px;
    background: #fff;
    border-top: 3px solid var(--estc-primary);
    box-shadow: 0 18px 40px -30px rgba(11, 31, 51, .4);
}

.estc-director__more-title {
    margin: 0 0 8px;
    font-family: var(--estc-font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--estc-muted);
}

.estc-director__more ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.estc-director__more li + li {
    border-top: 1px solid var(--estc-line);
}

.estc-director__more a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 0;
    font-family: var(--estc-font-heading);
    font-size: 18px;
    color: var(--estc-heading);
    transition: color .25s, padding .25s;
}

.estc-director__more a i {
    font-size: 12px;
    color: #c9a227;
    transition: transform .25s;
}

.estc-director__more a:hover,
.estc-director__more a:focus-visible {
    padding-left: 6px;
    color: var(--estc-primary);
}

.estc-director__more a:hover i {
    transform: translateX(4px);
}

/* ---- Letter ---- */
.estc-director__letter {
    max-width: 720px;
}

.estc-director__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 18px;
    font-family: var(--estc-font-body);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--estc-primary);
}

.estc-director__eyebrow::before {
    content: '';
    width: 40px;
    height: 2px;
    background: #c9a227;
}

.estc-director__heading {
    margin: 0 0 44px;
    font-family: var(--estc-font-heading);
    font-size: 44px;
    font-weight: 500;
    line-height: 1.18;
    letter-spacing: -.3px;
    color: var(--estc-heading);
}

.estc-director__quote {
    position: relative;
    margin: 0 0 48px;
    padding: 30px 34px 30px 40px;
    background: #fff;
    border: 0;
    border-left: 3px solid #c9a227;
    border-top-right-radius: 28px;
    box-shadow: 0 18px 40px -28px rgba(11, 31, 51, .35);
}

.estc-director__quote::before {
    content: '\201C';
    position: absolute;
    right: 26px;
    top: -18px;
    font-family: var(--estc-font-heading);
    font-size: 120px;
    line-height: 1;
    color: #c9a227;
    opacity: .3;
}

.estc-director__quote p {
    position: relative;
    margin: 0;
    font-family: var(--estc-font-heading);
    font-size: 25px;
    font-style: italic;
    line-height: 1.5;
    color: var(--estc-primary-dark);
}

.estc-director__body p {
    margin: 0 0 24px;
    font-size: 17px;
    line-height: 1.95;
    color: var(--estc-text);
}

/* Drop cap on the opening paragraph */
.estc-director__body .estc-director__lead {
    font-size: 18.5px;
    color: var(--estc-heading);
}

.estc-director__body .estc-director__lead::first-letter {
    float: left;
    margin: 8px 14px 0 0;
    font-family: var(--estc-font-heading);
    font-size: 74px;
    line-height: .8;
    color: var(--estc-primary);
}

/* Facts strip set into the letter */
.estc-director__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin: 40px 0 44px;
    padding: 0;
    list-style: none;
    background:
        url('../../images/patterns/pattern_05.png') repeat,
        var(--estc-secondary);
    background-size: 110px, auto;
    background-blend-mode: soft-light;
    border-bottom-right-radius: 32px;
}

.estc-director__facts li {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 26px 28px;
}

.estc-director__facts li + li {
    border-left: 1px solid rgba(255, 255, 255, .14);
}

.estc-director__facts strong {
    font-family: var(--estc-font-heading);
    font-size: 40px;
    font-weight: 500;
    line-height: 1;
    color: #fff;
}

.estc-director__facts span {
    font-family: var(--estc-font-body);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #e2c46a;
}

/* ---- Sign-off ---- */
.estc-director__signoff {
    margin-top: 44px;
    padding-top: 36px;
    border-top: 1px solid var(--estc-border);
}

.estc-director__closing {
    margin: 0 0 30px;
    font-family: var(--estc-font-heading);
    font-size: 26px;
    font-style: italic;
    line-height: 1.4;
    color: var(--estc-heading);
}

.estc-director__signature {
    display: flex;
    align-items: center;
    gap: 20px;
}

.estc-director__signature strong {
    display: block;
    font-family: var(--estc-font-heading);
    font-size: 24px;
    font-weight: 500;
    color: var(--estc-heading);
}

.estc-director__signature span {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: var(--estc-muted);
}

/* Small interlaced star (as on the Moroccan flag) beside the signature */
.estc-director__mark {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
}

.estc-director__mark path {
    fill: none;
    stroke: #c9a227;
    stroke-width: 2;
    stroke-linejoin: miter;
}

.estc-director__mark circle {
    fill: var(--estc-primary);
}

/* ---- Responsive ---- */
/* Short laptop screens: keep portrait + links within the window while they stick */
@media (min-width: 861px) and (max-height: 940px) {
    .estc-director__aside-inner {
        top: calc(var(--estc-header-h-compact) + 24px);
    }

    .estc-director__more {
        margin-top: 28px;
        padding: 18px 24px 8px;
    }

    .estc-director__more a {
        padding: 9px 0;
        font-size: 16px;
    }

    .estc-director .estc-portrait__frame img {
        max-height: 280px;
    }
}

@media (max-width: 1100px) {
    .estc-director__layout {
        gap: 56px;
    }

    .estc-director__heading {
        font-size: 36px;
    }
}

@media (max-width: 860px) {
    .estc-director {
        padding: 56px 0 80px;
    }

    .estc-director__layout {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .estc-director__aside-inner {
        position: static;
        max-width: 520px;
        padding-top: 12px;
    }

    /* Single column: the links would sit between portrait and letter, so they are dropped */
    .estc-director__more {
        display: none;
    }
}

@media (max-width: 640px) {
    .estc-director__heading {
        margin-bottom: 32px;
        font-size: 29px;
    }

    .estc-director__quote {
        margin-bottom: 36px;
        padding: 22px 22px 22px 24px;
    }

    .estc-director__quote p {
        font-size: 20px;
    }

    .estc-director__body p {
        font-size: 16px;
        line-height: 1.85;
    }

    .estc-director__body .estc-director__lead {
        font-size: 17px;
    }

    .estc-director__body .estc-director__lead::first-letter {
        font-size: 60px;
    }

    .estc-director__quote::before {
        right: 14px;
        top: -30px;
        font-size: 80px;
    }

    .estc-director__facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .estc-director__facts li {
        padding: 18px 12px 18px 16px;
    }

    .estc-director__facts strong {
        font-size: 27px;
    }

    .estc-director__facts span {
        font-size: 9.5px;
        letter-spacing: .1em;
        line-height: 1.4;
    }

    .estc-director__closing {
        font-size: 21px;
    }

    .estc-director__signature strong {
        font-size: 20px;
    }
}
