/* ==========================================================================
   Department page — frame (hero card, switcher, tabbed panel) comes from
   formation/labo/css/labs.css; this file adds the department colour and the
   filière cards. Colour variables (--c1, --c2, --ink) come from the
   .estc-dept--<theme> classes in mysite/css/specific/estc_components.css.
   ========================================================================== */

/* ---- Hero: department colour ---- */
.estc-deptpage .estc-labhero__card::before {
    background: linear-gradient(90deg, #c9a227 0 120px, var(--c1) 120px, var(--c2));
}

.estc-deptpage__visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    overflow: hidden;
    border-bottom-right-radius: 32px;
    background:
        radial-gradient(120% 90% at 20% 0%, var(--c1), transparent 70%),
        linear-gradient(150deg, var(--c1), var(--c2));
    color: #fff;
}

/* pattern_05 as white lines fading to the bottom-right, like the department cards */
.estc-deptpage__visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .16);
    -webkit-mask:
        url('../../mysite/images/patterns/pattern_05.png') center / 96px repeat,
        linear-gradient(160deg, #000 20%, transparent 85%);
    -webkit-mask-composite: source-in;
    mask:
        url('../../mysite/images/patterns/pattern_05.png') center / 96px repeat,
        linear-gradient(160deg, #000 20%, transparent 85%);
    mask-composite: intersect;
}

.estc-deptpage__watermark {
    position: absolute;
    right: -18px;
    bottom: -22px;
    font-size: 150px;
    opacity: .12;
}

.estc-deptpage__badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 28px;
    background: rgba(255, 255, 255, .12);
    font-size: 40px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.estc-deptpage .estc-labs__eyebrow {
    color: var(--ink);
}

.estc-deptpage__title {
    margin: 0;
    font-family: var(--estc-font-heading);
    font-size: 44px;
    font-weight: 500;
    line-height: 1.15;
    color: var(--estc-heading);
}

.estc-deptpage__lead {
    max-width: 620px;
    margin: 16px 0 0;
    font-size: 16.5px;
    line-height: 1.75;
    color: var(--estc-text);
}

.estc-deptpage .estc-labhero__facts {
    background:
        url('../../mysite/images/patterns/pattern_05.png') repeat,
        linear-gradient(120deg, var(--c2), var(--estc-secondary));
    background-size: 110px, auto;
    background-blend-mode: soft-light;
}

/* Switcher shows full names: keep them readable */
.estc-deptpage .estc-labswitch a {
    letter-spacing: .02em;
}

.estc-deptpage .estc-labswitch a::after,
.estc-deptpage .estc-labtoc a.is-active::before {
    background: var(--c1);
}

.estc-deptpage .estc-labswitch a[aria-current],
.estc-deptpage .estc-labswitch a:hover {
    color: var(--ink);
}

/* ---- Panel accents ---- */
.estc-deptpage .estc-labtoc a.is-active,
.estc-deptpage .estc-labtoc a:hover {
    color: var(--ink);
}

.estc-deptpage .estc-labtoc a i,
.estc-deptpage .estc-labsec__title i {
    color: var(--ink);
}

.estc-deptpage .estc-labtoc a.is-active i {
    background: var(--c1);
    color: #fff;
}

.estc-deptpage .estc-labtoc a em {
    color: var(--ink);
}

.estc-deptpage .estc-labsec__sub {
    color: var(--ink);
}

.estc-deptpage__sechead {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 28px;
}

.estc-deptpage__sechead .estc-labsec__title {
    margin: 0;
}

.estc-deptpage__more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink);
}

.estc-deptpage__more i {
    transition: transform .3s ease;
}

.estc-deptpage__more:hover {
    color: var(--c2);
}

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

.estc-deptpage .estc-labsec__sub + .estc-filieres {
    margin-bottom: 36px;
}

.estc-deptpage .estc-filieres:last-child {
    margin-bottom: 0;
}

/* ---- Filière cards ---- */
.estc-filieres {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.estc-filieres > li {
    display: flex;
}

.estc-filiere {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;                /* the legacy theme gives every <article> a bottom margin */
    padding: 22px 22px 18px;
    background: #fafbfc;
    border: 1px solid var(--estc-line);
    border-bottom-right-radius: 22px;
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease, background-color .35s ease;
}

.estc-filiere::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 18px;
    width: 3px;
    height: 28px;
    border-radius: 3px;
    background: var(--c1);
    transition: height .35s ease;
}

.estc-filiere:hover,
.estc-filiere:focus-within {
    transform: translateY(-4px);
    border-color: transparent;
    background: #fff;
    box-shadow: 0 22px 44px -26px var(--c2);
}

.estc-filiere:hover::before {
    height: calc(100% - 36px);
}

.estc-filiere__top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.estc-filiere__diploma {
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--c1);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
}

.estc-filiere__code {
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--estc-muted);
}

.estc-filiere__name {
    margin: 14px 0 0;
    font-family: var(--estc-font-heading);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.4;
}

.estc-filiere__link {
    color: var(--estc-heading);
}

/* The whole card opens the filière page */
.estc-filiere__link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.estc-filiere:hover .estc-filiere__link {
    color: var(--ink);
}

.estc-filiere__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 0;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    color: var(--estc-text);
}

.estc-filiere__meta i {
    color: var(--ink);
}

.estc-filiere__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 18px;
}

.estc-filiere__go {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--estc-muted);
    transition: color .3s ease;
}

.estc-filiere__go i {
    transition: transform .3s ease;
}

.estc-filiere:hover .estc-filiere__go {
    color: var(--ink);
}

.estc-filiere:hover .estc-filiere__go i {
    transform: translateX(4px);
}

/* Sits above the card-wide link */
.estc-filiere__apply {
    position: relative;
    z-index: 2;
    padding: 6px 12px;
    border: 1px solid var(--c1);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink);
    transition: background-color .3s ease, color .3s ease;
}

.estc-filiere__apply:hover,
.estc-filiere__apply:focus-visible {
    background: var(--c1);
    color: #fff;
}

.estc-filiere__apply--closed,
.estc-filiere__apply--closed:hover {
    border-color: #d5dbe3;
    background: #f1f4f7;
    color: #5b6675;
    cursor: default;
}

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

@media (max-width: 860px) {
    .estc-deptpage__visual {
        width: 120px;
        border-bottom-right-radius: 22px;
    }

    .estc-deptpage__badge {
        width: 64px;
        height: 64px;
        font-size: 26px;
        border-radius: 18px;
    }

    .estc-deptpage__watermark {
        font-size: 90px;
    }

    .estc-deptpage__title {
        font-size: 30px;
    }

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

@media (prefers-reduced-motion: reduce) {
    .estc-filiere,
    .estc-filiere::before,
    .estc-filiere__go i,
    .estc-deptpage__more i {
        transition: none;
    }

    .estc-filiere:hover {
        transform: none;
    }
}
