/* ==========================================================================
   Filière page — frame from formation/labo/css/labs.css, department colour
   and filière cards from formation/departements/departement.css
   ========================================================================== */

/* ---- Hero: text only (no visual tile) ---- */
.estc-filpage .estc-labhero__grid {
    grid-template-columns: 1fr;
}

/* Text + department link: flow as one line that wraps naturally */
.estc-filpage .estc-labhero__id .estc-labs__eyebrow {
    display: block;
    line-height: 1.9;
}

.estc-filpage .estc-labhero__id .estc-labs__eyebrow::before {
    display: inline-block;
    margin-right: 14px;
    vertical-align: middle;
}

.estc-filpage .estc-labs__eyebrow a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(0, 0, 0, .2);
    text-underline-offset: 4px;
}

.estc-filpage .estc-labs__eyebrow a:hover {
    color: var(--c2);
}

.estc-filpage .estc-deptpage__title {
    font-size: 38px;
    line-height: 1.2;
}

.estc-filpage__diploma-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 12px 0 0;
    font-size: 16px;
    color: var(--estc-muted);
}

.estc-filpage__code {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--estc-primary-light);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--ink);
}

.estc-filpage .estc-labhero__actions {
    align-items: center;
}

.estc-filpage .estc-labhero__actions .estc-btn:not(.estc-labhero__back) {
    background: var(--c1);
    border-color: var(--c1);
}

.estc-filpage .estc-labhero__actions .estc-btn:not(.estc-labhero__back):hover {
    background: var(--c2);
    border-color: var(--c2);
}

.estc-filpage .estc-labhero__actions .estc-labhero__back {
    border-color: var(--c1);
    color: var(--ink);
}

.estc-filpage .estc-labhero__actions .estc-labhero__back:hover {
    background: var(--c1);
    color: #fff;
}

.estc-filpage__dept-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--estc-muted);
}

.estc-filpage__dept-link:hover {
    color: var(--ink);
}

/* pattern_05 in the department colour, tucked into the rounded bottom-right corner */
.estc-filpage .estc-labhero__card::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 150px;
    height: 150px;
    background:
        url('../../mysite/images/patterns/pattern_05.png') repeat,
        linear-gradient(150deg, var(--c1), var(--c2));
    background-size: 75px, auto;
    background-blend-mode: soft-light;
    -webkit-mask-image: radial-gradient(circle at 100% 100%, #000 35%, transparent 72%);
    mask-image: radial-gradient(circle at 100% 100%, #000 35%, transparent 72%);
    pointer-events: none;
}

.estc-filpage .estc-labhero__grid {
    position: relative;
    z-index: 1;
    padding-right: 150px;
}

@media (max-width: 1100px) {
    .estc-filpage .estc-labhero__card::after {
        width: 110px;
        height: 110px;
    }

    .estc-filpage .estc-labhero__grid {
        padding-right: 110px;
    }
}

/* Small screens: a thin patterned band along the bottom instead */
@media (max-width: 860px) {
    .estc-filpage .estc-labhero__card::after {
        left: 0;
        width: auto;
        height: 14px;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .estc-filpage .estc-labhero__grid {
        padding-right: 22px;
        padding-bottom: 46px;
    }
}

/* ---- Sections ---- */
.estc-filpage__blocks {
    display: grid;
    gap: 28px;
}

.estc-filpage__block {
    padding: 26px 28px 10px;
    background: #fafbfc;
    border: 1px solid var(--estc-line);
    border-bottom-right-radius: 22px;
}

.estc-filpage__block .estc-labsec__sub {
    margin-top: 0;
}

/* Imported rich text often has one <p> per line: tighten it */
.estc-filpage .estc-prose p {
    margin-bottom: 8px;
}

/* Admission call to action */
.estc-filpage__cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px 28px;
    margin-top: 32px;
    padding: 24px 28px;
    border-left: 4px solid var(--c1);
    background:
        radial-gradient(500px 200px at 100% 0%, rgba(255, 255, 255, .6), transparent 70%),
        var(--estc-primary-light);
    border-bottom-right-radius: 22px;
}

.estc-filpage__price {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 28px;
    border-right: 1px solid rgba(0, 0, 0, .08);
}

.estc-filpage__price span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--estc-muted);
}

.estc-filpage__price strong {
    font-family: var(--estc-font-heading);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--ink);
    white-space: nowrap;
}

.estc-filpage__cta-text {
    display: flex;
    flex: 1 1 220px;
    flex-direction: column;
    gap: 4px;
    font-size: 15px;
    color: var(--estc-text);
}

.estc-filpage__cta-text strong {
    color: var(--estc-heading);
}

.estc-filpage__cta .estc-btn {
    gap: 10px;
    padding: 13px 24px;
    font-size: 15px;
    background: var(--c1);
    border-color: var(--c1);
}

.estc-filpage__cta .estc-btn:hover {
    background: var(--c2);
    border-color: var(--c2);
}

/* Pre-registration closed (toggled on the formation page) */
.estc-filpage .estc-btn.estc-btn--closed,
.estc-filpage .estc-btn.estc-btn--closed:hover,
.estc-filpage .estc-labhero__actions .estc-btn.estc-btn--closed:not(.estc-labhero__back) {
    background: #e9edf2;
    border-color: #e9edf2;
    color: #5b6675;
    cursor: not-allowed;
}

/* ---- Programme: one column per semester ---- */
.estc-semesters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
    align-items: start;
}

.estc-semester {
    overflow: hidden;
    background: #fafbfc;
    border: 1px solid var(--estc-line);
    border-bottom-right-radius: 22px;
}

.estc-semester__head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 16px 20px;
    background: #fff;
    border-bottom: 1px solid var(--estc-line);
    font-size: 15px;
    font-weight: 600;
    color: var(--estc-heading);
}

.estc-semester__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 12px;
    background: linear-gradient(150deg, var(--c1), var(--c2));
    font-family: var(--estc-font-heading);
    font-size: 16px;
    color: #fff;
}

.estc-semester__head em {
    margin-left: auto;
    font-size: 12.5px;
    font-style: normal;
    font-weight: 500;
    color: var(--estc-muted);
}

.estc-modules {
    margin: 0;
    padding: 8px 20px 12px;
    list-style: none;
}

.estc-module {
    display: flex;
    gap: 14px;
    padding: 12px 0;
}

.estc-module + .estc-module {
    border-top: 1px dashed var(--estc-line);
}

.estc-module__code {
    flex: none;
    min-width: 42px;
    padding: 2px 0;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .04em;
    color: var(--ink);
}

.estc-module__name {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--estc-heading);
}

.estc-module__subjects {
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.estc-module__subjects li {
    position: relative;
    padding: 3px 0 3px 16px;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--estc-muted);
}

.estc-module__subjects li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: .85em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1.5px solid var(--c1);
}

/* ---- Brochure ---- */
.estc-filpage__brochure {
    position: relative;
    display: block;
    max-width: 560px;
    margin: 0 auto;
    overflow: hidden;
    background: #fafbfc;
    border: 1px solid var(--estc-line);
    border-bottom-right-radius: 26px;
    box-shadow: 0 24px 48px -30px rgba(11, 31, 51, .45);
}

.estc-filpage__brochure img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform .6s ease;
}

.estc-filpage__brochure:hover img {
    transform: scale(1.02);
}

.estc-filpage__brochure-hint {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(11, 31, 51, .78);
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

/* ---- Planning files ---- */
.estc-filpage__files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.estc-filpage__files a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: #fafbfc;
    border: 1px solid var(--estc-line);
    border-bottom-right-radius: 18px;
    color: var(--estc-heading);
}

.estc-filpage__files a:hover {
    border-color: var(--c1);
    background: #fff;
}

.estc-filpage__files i {
    font-size: 20px;
    color: var(--ink);
}

.estc-filpage__files span {
    display: flex;
    flex-direction: column;
}

.estc-filpage__files small {
    font-size: 12.5px;
    color: var(--estc-muted);
}

/* ---- Contact cards ---- */
.estc-filpage__contacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.estc-filpage__person {
    display: flex;
    gap: 18px;
    padding: 24px;
    background: #fafbfc;
    border: 1px solid var(--estc-line);
    border-bottom-right-radius: 22px;
}

.estc-filpage__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: 50%;
    background: linear-gradient(150deg, var(--c1), var(--c2));
    font-family: var(--estc-font-heading);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: .04em;
    color: #fff;
    text-transform: uppercase;
}

.estc-filpage__avatar--icon {
    background: var(--estc-primary-light);
    font-size: 20px;
    color: var(--ink);
}

.estc-contact-label {
    margin: 2px 0 4px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--estc-muted);
}

.estc-filpage__person-name {
    margin: 0;
    font-family: var(--estc-font-heading);
    font-size: 20px;
    font-weight: 500;
    color: var(--estc-heading);
}

.estc-filpage__lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--estc-text);
}

.estc-filpage__lines li {
    display: flex;
    gap: 10px;
}

.estc-filpage__lines i {
    width: 16px;
    margin-top: 4px;
    flex: none;
    font-size: 13px;
    color: var(--ink);
}

.estc-filpage__lines a {
    color: var(--estc-heading);
    word-break: break-word;
}

.estc-filpage__lines a:hover {
    color: var(--ink);
}

/* ---- Related programmes ---- */
.estc-filpage__related {
    padding-bottom: 112px;
}

.estc-filpage__related-title {
    margin: 0 0 28px;
    font-family: var(--estc-font-heading);
    font-size: 32px;
    font-weight: 500;
    color: var(--estc-heading);
}

/* The tabbed panel already has its own bottom spacing */
.estc-filpage .estc-labbody {
    padding-bottom: 80px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 860px) {
    .estc-filpage .estc-deptpage__title {
        font-size: 28px;
    }

    .estc-filpage__dept-link {
        margin: 6px 0 0;
    }

    .estc-filpage__block {
        padding: 20px 18px 6px;
    }

    .estc-filpage__cta {
        padding: 20px;
    }

    .estc-filpage__price {
        padding-right: 0;
        border-right: 0;
    }

    .estc-filpage__cta .estc-btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .estc-semesters {
        grid-template-columns: 1fr;
    }

    .estc-filpage__person {
        padding: 20px 18px;
    }

    .estc-filpage__related {
        padding-bottom: 72px;
    }

    .estc-filpage__related-title {
        font-size: 26px;
    }

    .estc-filpage .estc-labbody {
        padding-bottom: 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .estc-filpage__brochure img {
        transition: none;
    }

    .estc-filpage__brochure:hover img {
        transform: none;
    }
}
