/* ==========================================================================
   ESTC homepage — layout modelled on uca.ma (tokens live in estc_theme.css)
   ========================================================================== */

/* The legacy theme styles every <article> as a padded white card; reset it here
   (zero-specificity :where so the component rules below still apply) */
:where(.template-homepage main) article {
    margin: 0;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
}

/* Makes a whole card clickable from its title link */
.estc-stretched::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.estc-date--light {
    color: #fff;
}

/* ----------------------------------------------------------------------
   Hero
   ---------------------------------------------------------------------- */

.estc-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: clamp(640px, 100vh, 960px);
    overflow: hidden;
    background: var(--estc-secondary);
}

.estc-hero__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
}

/* Narrow screens crop the photo's sides: the ESTC sign sits at ~52% of its width,
   so shift slightly right of centre to keep the sign in the middle of the screen */
@media (max-width: 991px) {
    .estc-hero__bg {
        object-position: 53.5% 35%;
    }
}

.estc-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 20, 38, .55) 0%, rgba(0, 20, 38, .62) 50%, rgba(0, 20, 38, .72) 100%);
}

.estc-hero__inner {
    position: relative;
    z-index: 1;
    padding-top: calc(var(--estc-topbar-h) + var(--estc-header-h) + 72px);
    padding-bottom: 64px;
}

.estc-hero__track {
    height: 470px;
}

.estc-hero__track .flickity-viewport {
    height: 100% !important;
}

.estc-hero__slide {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 32px;
}

.estc-hero__card {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 406px;
    min-width: 0;
}

/* The card wraps the flyer exactly (landscape or portrait): no white backdrop, the image carries the frame */
.estc-hero__card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}

.estc-hero__text {
    color: #fff;
}

.estc-hero__title {
    margin: 0;
    font-family: var(--estc-font-heading);
    font-size: 38px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.estc-hero__title a,
.estc-hero__title a:hover {
    color: #fff;
}

.estc-hero__text hr {
    margin: 28px 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .6);
}

/* Slide timer: the divider doubles as a progress bar until the next slide */
.estc-hero {
    --estc-hero-delay: 6s;
}

.estc-hero__timer {
    position: relative;
    height: 3px;
    margin: 28px 0;
    background: rgba(255, 255, 255, .25);
    border-radius: 3px;
    overflow: hidden;
}

.estc-hero__timer span {
    position: absolute;
    inset: 0;
    background: #fff;
    border-radius: inherit;
    transform: scaleX(0);
    transform-origin: left;
}

.estc-hero__slide.is-selected .estc-hero__timer span {
    animation: estcHeroTimer var(--estc-hero-delay) linear forwards;
}

/* Hovering or focusing the slider pauses the bar, and therefore the slide change */
.estc-hero__track:hover .estc-hero__timer span,
.estc-hero__track:focus-within .estc-hero__timer span {
    animation-play-state: paused;
}

@keyframes estcHeroTimer {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.estc-hero__excerpt {
    margin: 0 0 32px;
    font-size: 17px;
    line-height: 1.8;
    color: rgba(255, 255, 255, .95);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Static fallback hero (no slider configured) */
.estc-hero--static .estc-hero__text {
    max-width: 640px;
}

/* Entrance animation on the current slide (uca.ma uses WOW + animate.css) */
@keyframes estcFadeInLeft {
    from { opacity: 0; transform: translate3d(-40px, 0, 0); }
    to { opacity: 1; transform: none; }
}

@keyframes estcFadeInUp {
    from { opacity: 0; transform: translate3d(0, 30px, 0); }
    to { opacity: 1; transform: none; }
}

.estc-hero__slide.is-selected .estc-hero__card {
    animation: estcFadeInLeft .8s ease both;
}

.estc-hero__slide.is-selected .estc-hero__title,
.estc-hero__slide.is-selected .estc-hero__timer,
.estc-hero__slide.is-selected .estc-hero__excerpt,
.estc-hero__slide.is-selected .estc-btn {
    animation: estcFadeInUp .8s ease both;
}

.estc-hero__slide.is-selected .estc-hero__timer { animation-delay: .15s; }
.estc-hero__slide.is-selected .estc-hero__excerpt { animation-delay: .25s; }
.estc-hero__slide.is-selected .estc-btn { animation-delay: .35s; }

/* Dots */
.estc-hero {
    --estc-dot-w: 34px;        /* dot width + horizontal margins */
    --estc-dots-mid: 43px;     /* distance from the track's bottom to the dots' centre line */
    --estc-arrow-size: 40px;
}

.estc-hero .flickity-page-dots {
    bottom: -52px;
}

/* Arrows: flank the dots, on the same line (--estc-hero-count is set on the track) */
.estc-hero .flickity-button {
    top: calc(100% + var(--estc-dots-mid) - var(--estc-arrow-size) / 2);
    width: var(--estc-arrow-size);
    height: var(--estc-arrow-size);
    padding: 0;
    border: 1.5px solid rgba(255, 255, 255, .7);
    background: transparent;
    color: #fff;
    transform: none;
    transition: background .2s, color .2s, border-color .2s;
}

.estc-hero .flickity-button:hover,
.estc-hero .flickity-button:focus-visible {
    background: #fff;
    border-color: #fff;
    color: var(--estc-secondary);
}

.estc-hero .flickity-button:focus {
    box-shadow: none;
}

.estc-hero .flickity-button-icon {
    position: absolute;
    top: 25%;
    left: 25%;
    width: 50%;
    height: 50%;
    fill: currentColor;
}

.estc-hero .flickity-prev-next-button.previous {
    left: calc(50% - var(--estc-hero-count, 5) * var(--estc-dot-w) / 2 - var(--estc-arrow-size) - 14px);
}

.estc-hero .flickity-prev-next-button.next {
    left: calc(50% + var(--estc-hero-count, 5) * var(--estc-dot-w) / 2 + 14px);
    right: auto;
}

.estc-hero .flickity-page-dots .dot {
    width: 18px;
    height: 18px;
    margin: 0 8px;
    background: rgba(255, 255, 255, .7);
    opacity: 1;
    transition: background .2s;
}

.estc-hero .flickity-page-dots .dot.is-selected {
    background: var(--estc-primary);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .7);
}

/* ----------------------------------------------------------------------
   Director's message + key figures
   ---------------------------------------------------------------------- */

.estc-welcome {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1200px 500px at 85% 0%, rgba(0, 75, 130, .05), transparent 60%),
        #fbfbfc;
}

/* Faint zellige patch fading in from the left, as in the "offer" section */
.estc-welcome::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 34%;
    height: 720px;
    background: url('../../images/patterns/pattern_05.png') repeat;
    background-size: 150px;
    opacity: .05;
    -webkit-mask-image: radial-gradient(farthest-side at 0 30%, #000 20%, transparent);
    mask-image: radial-gradient(farthest-side at 0 30%, #000 20%, transparent);
    pointer-events: none;
}

.estc-welcome > .estc-container {
    position: relative;
}

.estc-welcome__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 72px;
    align-items: center;
}

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

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

.estc-welcome__content .estc-title {
    margin-bottom: 40px;
}

/* Pull quote: the director's own line, set large in the heading face */
.estc-welcome__quote {
    position: relative;
    margin: 0 0 36px;
    padding: 58px 0 0 32px;
    border: 0;
}

/* The mark sits in the padding above the text, so it never runs into the first line */
.estc-welcome__quote::before {
    content: '\201C';
    position: absolute;
    left: -6px;
    top: -18px;
    font-family: var(--estc-font-heading);
    font-size: 150px;
    line-height: 1;
    color: #c9a227;
    opacity: .35;
    pointer-events: none;
}

.estc-welcome__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);
}

/* Message: blue lead segment on a hairline */
.estc-welcome__text {
    position: relative;
    padding-left: 32px;
}

.estc-welcome__text::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(var(--estc-primary) 0 88px, var(--estc-border) 88px);
}

.estc-welcome__text p {
    margin: 0 0 22px;
    font-size: 16px;
    line-height: 1.9;
    text-align: justify;
    color: var(--estc-text);
}

.estc-welcome__text .estc-welcome__closing {
    margin-bottom: 34px;
    font-family: var(--estc-font-heading);
    font-size: 18px;
    font-style: italic;
    text-align: left;
    color: var(--estc-heading);
}

.estc-figures {
    margin-top: 88px;
}

.estc-figures__list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin: 0;
    padding: 0;
    list-style: none;
}

.estc-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 12px 32px;
    border-right: 1px solid var(--estc-border);
    text-align: center;
}

.estc-figure:nth-child(5n + 1) {
    border-left: 1px solid var(--estc-border);
}

.estc-figure--extra {
    display: none;
}

.estc-figures.is-expanded .estc-figure--extra {
    display: flex;
    animation: estcFadeInUp .5s ease both;
}

.estc-figure__value {
    font-family: var(--estc-font-heading);
    font-size: 54px;
    font-weight: 400;
    line-height: 1;
    color: var(--estc-primary);
}

.estc-figure__label {
    font-size: 16px;
    line-height: 1.4;
    color: var(--estc-heading);
}

.estc-figures__toggle {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.estc-figures.is-expanded .estc-figures__toggle .estc-arrow {
    transform: rotate(-135deg);
}

/* ----------------------------------------------------------------------
   Admissions
   ---------------------------------------------------------------------- */

/* Dark navy band, same layout as the agenda (intro left, content right), with the
   zellige pattern fading in from the right */
.estc-admissions-section {
    overflow: hidden;
    background: var(--estc-secondary);
}

.estc-admissions-section::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 60%;
    background: url('../../images/patterns/pattern_05.png') repeat;
    background-size: 140px;
    opacity: .06;
    -webkit-mask-image: linear-gradient(270deg, #000 20%, transparent);
    mask-image: linear-gradient(270deg, #000 20%, transparent);
}

.estc-admissions-grid {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) 2fr;
    gap: 48px 88px;
    align-items: center;
}

.estc-admissions-intro .estc-bar {
    margin-bottom: 28px;
    background: #c9a227;
}

.estc-admissions-intro p {
    margin: 26px 0 0;
    font-size: 17px;
    line-height: 1.85;
    color: rgba(255, 255, 255, .78);
}

/* One row per open registration, on hairlines; a gold rule draws across the top on hover */
.estc-admission {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 20px 48px;
    padding: 32px 0;
    border-top: 1px solid rgba(255, 255, 255, .16);
}

.estc-admission:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.estc-admission::before {
    content: '';
    position: absolute;
    left: 0;
    top: -1px;
    width: 0;
    height: 1px;
    background: #c9a227;
    transition: width .6s cubic-bezier(.16, 1, .3, 1);
}

.estc-admission:hover::before,
.estc-admission:focus-within::before {
    width: 100%;
}

.estc-admission__title {
    margin: 0;
    font-size: 25px;
    font-weight: 500;
    line-height: 1.3;
    color: #fff;
}

.estc-admission__subtitle,
.estc-admission__desc p {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .65);
}

.estc-admission__cta {
    font-size: 16px;
    padding: 14px 24px;
    white-space: nowrap;
}

/* ----------------------------------------------------------------------
   Actualités
   ---------------------------------------------------------------------- */

.estc-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 34px;
}

.estc-tab {
    padding: 8px 16px;
    border: 1px solid var(--estc-line);
    background: #fff;
    font-family: var(--estc-font-body);
    font-size: 15px;
    font-weight: 500;
    color: var(--estc-heading);
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

.estc-tab:hover {
    border-color: var(--estc-primary);
    color: var(--estc-primary);
}

.estc-tab.is-active {
    background: var(--estc-primary);
    border-color: var(--estc-primary);
    color: #fff;
}

/* Headlines on the left, a preview of the pointed headline's flyer on the right */
.estc-news__panel {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 40px;
    animation: estcFadeInUp .45s ease both;
}

.estc-news__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--estc-border);
}

.estc-news__list li {
    border-bottom: 1px solid var(--estc-border);
}

.estc-news__row {
    position: relative;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    padding: 24px 28px 24px 22px;
    color: var(--estc-heading);
    transition: background-color .35s ease;
}

/* Blue edge marking the headline shown in the preview */
.estc-news__row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--estc-primary);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform .45s cubic-bezier(.16, 1, .3, 1);
}

.estc-news__row.is-active {
    background: #fff;
}

.estc-news__row.is-active::before {
    transform: scaleY(1);
}

/* On screen, the active edge fills as a timer before the next headline takes over
   (script in news.html); pointing at or focusing the list holds the current one */
.estc-news__panel.is-cycling .estc-news__row.is-active::before {
    animation: estcNewsTimer 5s linear both;
}

.estc-news__panel.is-cycling:hover .estc-news__row.is-active::before,
.estc-news__panel.is-cycling:focus-within .estc-news__row.is-active::before {
    animation: none;
}

@keyframes estcNewsTimer {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

/* Date as a calendar leaf */
.estc-news__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 26px;
    border-right: 1px solid var(--estc-border);
}

.estc-news__day {
    font-family: var(--estc-font-heading);
    font-size: 46px;
    line-height: 1;
    color: var(--estc-primary);
}

.estc-news__month {
    margin-top: 8px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--estc-muted);
}

.estc-news__headline {
    font-family: var(--estc-font-heading);
    font-size: 20px;
    font-weight: 500;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .3s;
}

.estc-news__row.is-active .estc-news__headline {
    color: var(--estc-primary);
}

.estc-news__row .estc-arrow {
    color: var(--estc-primary);
    opacity: 0;
    transform: translateX(-10px) rotate(-45deg);
    transition: opacity .3s, transform .45s cubic-bezier(.16, 1, .3, 1);
}

.estc-news__row.is-active .estc-arrow {
    opacity: 1;
    transform: none;
}

/* Preview: light panel with the zellige pattern drawn in blue lines, flyer shown whole */
.estc-news__preview {
    position: relative;
    min-height: 400px;
    overflow: hidden;
    background: var(--estc-primary-light);
    border-bottom-right-radius: 48px;
}

.estc-news__preview::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--estc-primary);
    opacity: .3;
    -webkit-mask: url('../../images/patterns/pattern_05.png') 0 0 / 110px repeat;
    mask: url('../../images/patterns/pattern_05.png') 0 0 / 110px repeat;
}

.estc-news__shot {
    position: absolute;
    inset: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(16px) scale(.97);
    pointer-events: none;
    transition: opacity .45s ease, transform .7s cubic-bezier(.16, 1, .3, 1);
}

.estc-news__shot.is-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.estc-news__shot img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 26px 46px -22px rgba(11, 31, 51, .45);
}

/* ----------------------------------------------------------------------
   Agenda
   ---------------------------------------------------------------------- */

.estc-agenda {
    position: relative;
    padding: 128px 0 72px;
    overflow: hidden;
    background: #1a1a1a url('../../images/estc_campus.jpg') center / cover no-repeat;
}

.estc-agenda::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 20, .78);
    backdrop-filter: grayscale(1);
    -webkit-backdrop-filter: grayscale(1);
}

.estc-agenda > * {
    position: relative;
}

.estc-agenda__grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 2fr;
    gap: 36px;
    align-items: center;
}

.estc-agenda__intro p {
    margin: 26px 0 40px;
    font-size: 17px;
    line-height: 1.85;
    color: rgba(255, 255, 255, .9);
}

.estc-agenda__nav {
    display: flex;
    gap: 12px;
}

.estc-round-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 1px solid #fff;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: var(--estc-transition);
}

.estc-round-btn:hover,
.estc-round-btn:focus-visible {
    background: #fff;
    color: var(--estc-primary);
}

.estc-agenda__track {
    min-width: 0;
}

.estc-agenda__track .flickity-viewport {
    overflow: hidden;
}

.estc-event {
    position: relative;
    display: flex;
    flex-direction: column;
    width: calc(50% - 15px);
    margin: 10px 30px 36px 0;     /* room for the hover lift and shadow inside the viewport */
    overflow: hidden;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .55);
    transition: transform .4s ease, box-shadow .4s ease;
}

/* Equal-height cards (Flickity sizes the viewport to the tallest cell) */
.estc-agenda__track.flickity-resize .estc-event {
    min-height: calc(100% - 46px);
}

.estc-event:hover {
    transform: translateY(-6px);
    box-shadow: 0 32px 56px -24px rgba(0, 0, 0, .7);
}

/* Flyer frame: the whole poster is shown, centred on a blurred copy of itself */
.estc-event__media {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 10;
    padding: 18px 18px 22px;
    overflow: hidden;
    background: var(--estc-secondary);
}

.estc-event__backdrop {
    position: absolute;
    inset: -24px;
    background: center / cover no-repeat;
    filter: blur(18px) brightness(.55) saturate(1.2);
    transform: scale(1.1);
}

.estc-event__media img {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 3px;
    box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .6);
    transition: transform .6s ease;
}

.estc-event:hover .estc-event__media img {
    transform: scale(1.03);
}

.estc-event__badge {
    position: absolute;
    left: 22px;
    bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 64px;
    padding: 10px 10px 8px;
    border-radius: 4px 4px 0 0;
    background: var(--estc-primary);
    color: #fff;
    line-height: 1;
    text-transform: uppercase;
}

.estc-event__badge strong {
    font-family: var(--estc-font-heading);
    font-size: 28px;
    font-weight: 600;
}

.estc-event__badge span {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .12em;
}

.estc-event__chip {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #fff;
    color: var(--estc-primary);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .4);
}

.estc-event__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px 24px 24px;
    border-top: 3px solid var(--estc-primary);
}

.estc-event__when {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--estc-primary);
    font-size: 14px;
    font-weight: 600;
}

.estc-event__body h3 {
    margin: 12px 0 18px;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.estc-event__body h3 a {
    color: var(--estc-heading);
}

.estc-event:hover h3 a {
    color: var(--estc-primary);
}

.estc-event__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--estc-line);
    color: var(--estc-muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    transition: color .3s ease;
}

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

.estc-event:hover .estc-event__cta {
    color: var(--estc-primary);
}

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

.estc-agenda__footer {
    margin-top: 56px;
    text-align: right;
    padding-right: max(24px, calc((100% - 1344px) / 2 + 24px));
}

/* ----------------------------------------------------------------------
   Offre de formation
   ---------------------------------------------------------------------- */

.estc-offer {
    position: relative;
    overflow: hidden;
    padding: 128px 0;
    background: #fff;
}

/* Light Moroccan pattern on the left, solid blue panel with pattern on the right */
.estc-offer::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 36%;
    background: url('../../images/patterns/pattern_05.png') repeat;
    background-size: 150px;
    opacity: .07;
    -webkit-mask-image: linear-gradient(90deg, #000 30%, transparent);
    mask-image: linear-gradient(90deg, #000 30%, transparent);
}

.estc-offer::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 36%;
    background:
        url('../../images/patterns/pattern_05.png') repeat,
        var(--estc-primary);
    background-size: 120px, auto;
    background-blend-mode: soft-light;
    border-bottom-left-radius: 40px;
}

.estc-offer__grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.estc-offer__intro .estc-bar {
    margin-bottom: 28px;
}

.estc-offer__intro p {
    margin: 30px 0 34px;
    font-size: 16.5px;
    line-height: 1.85;
    text-align: justify;
    color: var(--estc-heading);
}

.estc-offer__cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.estc-offer__card {
    padding: 44px 50px;
    background: #fff;
    border: 1px solid var(--estc-border);
    transition: var(--estc-transition);
}

.estc-offer__card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, .14);
}

.estc-offer__card h3 {
    margin: 0 0 14px;
    font-size: 30px;
    font-weight: 400;
}

.estc-offer__card h3 a {
    color: var(--estc-heading);
}

.estc-offer__card h3 a:hover {
    color: var(--estc-primary);
}

.estc-offer__count {
    margin: 0 0 14px;
    font-size: 16px;
    color: var(--estc-muted);
}

.estc-offer__count strong {
    font-family: var(--estc-font-heading);
    font-size: 22px;
    font-weight: 600;
    color: var(--estc-primary);
}

.estc-offer__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

.estc-offer__list li {
    padding: 5px 12px;
    background: var(--estc-primary-light);
    font-size: 13.5px;
    color: var(--estc-primary-dark);
}

.estc-offer__card .estc-more {
    font-size: 17px;
}

/* ----------------------------------------------------------------------
   Départements
   ---------------------------------------------------------------------- */

.estc-departments .estc-bar--below {
    margin-top: 24px;
}

.estc-departments__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ----------------------------------------------------------------------
   Recherche
   ---------------------------------------------------------------------- */

.estc-research__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin: 64px 0 0;
    padding: 0;
    list-style: none;
}

.estc-lab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 34px 28px 30px;
    text-align: center;
    border: 1px solid var(--estc-line);
    transition: var(--estc-transition);
}

.estc-lab:hover {
    border-color: transparent;
    box-shadow: var(--estc-shadow);
}

.estc-lab__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 130px;
    margin-bottom: 24px;
    color: var(--estc-primary);
    font-size: 54px;
}

.estc-lab__logo img {
    max-width: 220px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform .4s ease;
}

.estc-lab:hover .estc-lab__logo img {
    transform: scale(1.05);
}

.estc-lab__name {
    font-family: var(--estc-font-heading);
    font-size: 19px;
    line-height: 1.45;
    color: var(--estc-text);
}

.estc-lab:hover .estc-lab__name {
    color: var(--estc-primary);
}

/* ----------------------------------------------------------------------
   Other CMS blocks
   ---------------------------------------------------------------------- */

.estc-home-block {
    padding: 0 0 var(--estc-section-pad);
}

/* ----------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .estc-hero__inner {
        padding-top: calc(var(--estc-topbar-h) + var(--estc-header-h) + 48px);
    }

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

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

    .estc-offer::after {
        top: auto;
        width: 100%;
        height: 58%;
        border-bottom-left-radius: 0;
        border-top-left-radius: 40px;
    }

    .estc-agenda__grid,
    .estc-admissions-grid {
        grid-template-columns: 1fr;
    }

    .estc-agenda__footer {
        text-align: left;
        padding-left: 24px;
    }

    .estc-departments__grid,
    .estc-research__grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .estc-figure:nth-child(5n + 1) {
        border-left: 0;
    }

    .estc-figure:nth-child(3n + 1) {
        border-left: 1px solid var(--estc-border);
    }
}

@media (max-width: 860px) {
    .estc-hero {
        min-height: 0;
    }

    .estc-hero__track {
        height: 640px;
    }

    .estc-hero__slide {
        grid-template-columns: 1fr;
        grid-template-rows: 280px 1fr;
        gap: 24px;
        align-items: start;
    }

    .estc-hero__card {
        height: 280px;
    }

    .estc-hero__text hr,
    .estc-hero__timer {
        margin: 18px 0;
    }

    .estc-hero__excerpt {
        margin-bottom: 22px;
    }

    .estc-hero .flickity-page-dots {
        bottom: -36px;
    }

    .estc-hero {
        --estc-dots-mid: 27px;
    }

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

    .estc-welcome__grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .estc-event {
        width: 78%;
    }

    /* Touch screens: the preview sits above the list and shows the latest flyer */
    .estc-news__panel {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .estc-news__preview {
        order: -1;
        min-height: 340px;
    }
}

@media (max-width: 640px) {
    .estc-hero__track {
        height: 600px;
    }

    .estc-hero__slide {
        grid-template-rows: 230px 1fr;
    }

    .estc-hero__card {
        height: 230px;
    }

    .estc-hero__title {
        font-size: 23px;
        -webkit-line-clamp: 4;
    }

    .estc-hero__excerpt {
        font-size: 15px;
    }

    .estc-hero .flickity-page-dots .dot {
        width: 12px;
        height: 12px;
        margin: 0 5px;
    }

    .estc-hero {
        --estc-dot-w: 22px;
        --estc-dots-mid: 30px;
        --estc-arrow-size: 32px;
    }

    .estc-figures {
        margin-top: 56px;
    }

    .estc-figures__list {
        grid-template-columns: repeat(2, 1fr);
    }

    .estc-figure,
    .estc-figure:nth-child(3n + 1),
    .estc-figure:nth-child(5n + 1) {
        border-left: 0;
        border-right: 0;
        border-bottom: 1px solid var(--estc-border);
    }

    .estc-figure__value {
        font-size: 42px;
    }

    .estc-news__preview {
        min-height: 260px;
        border-bottom-right-radius: 32px;
    }

    .estc-news__shot {
        inset: 22px;
    }

    .estc-news__row {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 16px;
        padding: 18px 12px 18px 14px;
    }

    .estc-news__row .estc-arrow {
        display: none;
    }

    .estc-news__date {
        padding-right: 16px;
    }

    .estc-news__day {
        font-size: 32px;
    }

    .estc-news__month {
        font-size: 10px;
        letter-spacing: .08em;
    }

    .estc-news__headline {
        font-size: 17px;
        -webkit-line-clamp: 3;
    }

    .estc-agenda {
        padding: 72px 0 56px;
    }

    .estc-event {
        width: 88%;
        margin-right: 16px;
    }

    .estc-offer {
        padding: 72px 0;
    }

    .estc-offer__card {
        padding: 30px 26px;
    }

    .estc-admission {
        grid-template-columns: 1fr;
        padding: 28px 0;
    }

    .estc-admission__title {
        font-size: 22px;
    }

    .estc-admission__cta {
        justify-self: start;
        white-space: normal;
    }

    .estc-offer__card h3 {
        font-size: 25px;
    }

    .estc-departments__grid,
    .estc-research__grid {
        grid-template-columns: 1fr;
    }


    .estc-welcome__text {
        padding-left: 20px;
    }

    .estc-welcome__quote {
        padding: 44px 0 0 20px;
    }

    .estc-welcome__quote p {
        font-size: 21px;
    }

    .estc-welcome__quote::before {
        font-size: 110px;
        top: -14px;
    }


    .estc-welcome__text p {
        text-align: left;
    }

    .estc-offer__intro p {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .estc-hero__slide.is-selected *,
    .estc-news__panel,
    .estc-news__panel.is-cycling .estc-news__row.is-active::before,
    .estc-figures.is-expanded .estc-figure--extra {
        animation: none !important;
    }

    .estc-admission::before,
    .estc-dept,
    .estc-dept *,
    .estc-dept__visual::before,
    .estc-news__row::before,
    .estc-news__row .estc-arrow,
    .estc-news__shot,
    .estc-event,
    .estc-event__media img,
    .estc-event__cta i,
    .estc-lab__logo img {
        transition: none;
    }
}
