/* ==========================================================================
   Acephal — acephal.eu home page (ecosystem)
   Loaded after the shared design system copied from acephal.fr. Only adds the
   six-site card grid (mockup 5cd48308) and the .fr card tones.
   ========================================================================== */

/* .fr is not in the sample palette: cyan family (tokens in variables.css). */
.eco-card--fr {
    --accent: var(--eco-fr-accent);
    --accent-strong: var(--eco-fr-strong);
    --accent-on-image: var(--eco-fr-on-image);
}

/* ---- Hero: brand wording (two-line title, tagline, two paragraphs) -------- */

.hero-home__tagline {
    margin-top: var(--space-5);
    font-size: clamp(1.05rem, 1.4vw, 1.3rem);
    font-weight: var(--weight-semibold);
    line-height: 1.4;
    color: var(--acephal-white);
}

.hero-home__tagline + .hero-home__lead {
    margin-top: var(--space-4);
}

.hero-home__lead + .hero-home__lead {
    margin-top: var(--space-3);
}

@media (min-width: 1024px) {
    .hero-home__lead {
        max-width: 36rem;
    }
}

/* ---- Ecosystem section ---------------------------------------------------- */
/* "Notre écosystème" closer to the hero: half the usual section top space. */
.ecosystem--eu {
    padding-top: calc(var(--space-8) / 2);
}

.ecosystem__intro {
    margin-bottom: var(--space-6);
}

/* Title 25 % smaller than the other section titles (home.css: clamp(1.75rem, 7vw, 3rem)). */
.ecosystem__intro .section-title {
    font-size: clamp(1.3125rem, 5.25vw, 2.25rem);
}

/* Second paragraph right under the first one (no blank line). */
.ecosystem__intro .section-text + .section-text {
    margin-top: 0;
}

/* Full-width titles and texts on computers, compact footer bar, constellation glows,
   section titles in text columns: shared rules, now in home.css (from acephal.fr). */
@media (min-width: 1024px) {
    /* Value pages: the round icon sits to the left of the introduction, not above it. */
    .value-head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: var(--space-5);
        align-items: start;
    }

    .value-head .value__icon {
        grid-row: 1 / span 4;
        margin-bottom: 0;
    }

    /* Every text block in the second column, however many paragraphs. */
    .value-head > :not(.value__icon) {
        grid-column: 2;
    }
}

/* Accessibility (Lighthouse, 2026-10-04): white text on the bright brand blue #1E90FF is
   below the 4.5:1 contrast ratio. Buttons of the content sections use the deeper brand
   blue (#1565E0, about 5:1); the dark hero and call-to-action band keep their look. */
.section .button {
    --button-bg: var(--eco-eu-strong);
}

/* "Nos valeurs": each value links to its page (/idees/, /cooperation/, …). Same look as
   before; hover / focus only tint the round icon and the name. */
.values__list a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-1);
    border-radius: var(--radius-card);
    color: inherit;
    text-decoration: none;
}

.values__list .value__icon,
.values__list strong {
    transition: border-color var(--duration) var(--ease), background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.values__list a:hover .value__icon,
.values__list a:focus-visible .value__icon {
    border-color: var(--accent-on-light);
    background-color: color-mix(in srgb, var(--accent-on-light) 8%, var(--surface-white));
}

.values__list a:hover strong,
.values__list a:focus-visible strong {
    color: var(--accent-on-light);
}

.values__list a:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

@media (prefers-reduced-motion: reduce) {
    .values__list .value__icon,
    .values__list strong {
        transition: none;
    }
}

/* Value pages: round icon above the introduction, step numbers, the other four values. */
.value-head .value__icon {
    margin-bottom: var(--space-4);
}

/* ---- Domain logos (page /ecosysteme/) ------------------------------------
   The "A" mark drawn in two parts: night-blue summit, base in the domain colour
   (same tones as the domain cards of the home page). */
.dmark--eu { --dmark: var(--eco-eu-accent); }
.dmark--fr { --dmark: var(--eco-fr-accent); }
.dmark--cloud { --dmark: var(--eco-cloud-accent); }
.dmark--app { --dmark: var(--eco-app-accent); }
.dmark--website { --dmark: var(--eco-website-accent); }
.dmark--pro { --dmark: var(--eco-pro-accent); }

.dmark__base { fill: var(--dmark); }
.dmark__top { fill: var(--acephal-night); }

.dlogos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-1);
    margin: var(--space-6) 0 0;
    padding: var(--space-2);
    border: 1px solid var(--line-light);
    border-radius: var(--radius-panel);
    background: var(--surface-white);
    list-style: none;
}

.dlogo {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
    column-gap: 0.6rem;
    height: 100%;
    padding: var(--space-3) var(--space-2);
    border-radius: var(--radius-card);
    color: var(--text-strong);
    text-decoration: none;
    transition: background-color var(--duration) var(--ease);
}

.dlogo:hover {
    background: color-mix(in srgb, var(--dmark) 8%, transparent);
}

.dlogo:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.dlogo__mark {
    grid-row: 1 / span 2;
    width: 2.2rem;
    height: auto;
}

.dlogo__name {
    font-size: 1.05rem;
    font-weight: var(--weight-bold);
    letter-spacing: 0.02em;
    line-height: 1.15;
}

.dlogo__ext {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-body);
    font-size: 0.85rem;
    font-weight: var(--weight-semibold);
}

.dlogo__ext::before {
    content: "";
    width: 1rem;
    height: 0.3rem;
    border-radius: 2px;
    background: var(--dmark);
}

/* Domain cards of /ecosysteme/: the coloured "A" in a tile of the domain colour. */
.card__icon[class*="dmark--"] {
    background: color-mix(in srgb, var(--dmark) 12%, transparent);
}

.card__mark {
    width: 1.5rem;
    height: auto;
}

@media (min-width: 600px) {
    .dlogos {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .dlogos {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 0;
    }

    .dlogos li + li {
        border-left: 1px solid var(--line-light);
    }
}

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

/* Bulleted list in a dark aside box (page /communaute/). */
ul.aside-box__list {
    gap: var(--space-1);
    list-style: disc;
}

/* 1.2rem bold = "large text" for WCAG contrast (blue on its light tile is 4.47:1). */
.card__num {
    font-size: 1.2rem;
    font-weight: var(--weight-bold);
}

/* Computers: "Découvrir nos autres valeurs" on one row, title on the left, icons on the right. */
@media (min-width: 1024px) {
    .container:has(> .values__list--others) {
        display: grid;
        grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
        gap: var(--space-6);
        align-items: center;
    }

    .container:has(> .values__list--others) .section-head {
        margin-bottom: 0;
    }

    .values__list--others {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* "Deux façons d'avancer": the button sits at the bottom right of each panel,
   aligned between the two panels (grid items stretch to the same height). */
#deux-facons .cycle {
    display: flex;
    flex-direction: column;
}

#deux-facons .cycle .actions {
    justify-content: flex-end;
    margin-top: auto;
    padding-top: var(--space-5);
}

#deux-facons .cycle .actions .button {
    flex: 0 0 auto;
}

/* Six cards in a horizontal carousel (scroll-snap, works without JavaScript):
   1 card + a peek of the next on phones, 2 on tablets, 3 on desktop. js/eu.js adds
   the dots and the automatic, endless rotation. Overrides the 5-card placement of the
   sample (responsive.css). */
.eco-grid.eco-grid--six {
    --eco-gap: var(--space-4);
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 86%;
    gap: var(--eco-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    /* Room for the hover lift and shadow, which overflow would clip. */
    padding-block: 0.5rem 2.75rem;
    margin-block: -0.5rem -2.75rem;
}

.eco-grid.eco-grid--six::-webkit-scrollbar {
    display: none;
}

.eco-grid.eco-grid--six > li:nth-child(n) {
    grid-column: auto;
    scroll-snap-align: start;
}

/* Compact header: brand on the left, tagline top right on the same line. The visual
   fills the whole width and sticks to the bottom: only its top is cropped
   (decision 2026-10-03). */
.eco-grid--six .eco-card__media {
    aspect-ratio: 2 / 1;
}

.eco-grid--six .eco-card__media img {
    object-fit: cover;
    object-position: center bottom;
}

.eco-grid--six .eco-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 1rem 1.25rem 0 1.5rem;
}

.eco-grid--six .eco-card__subtitle {
    margin-top: 0.3rem;
    text-align: right;
}

/* Whole card clickable: the "Découvrir …" link is stretched over the card (one link per
   card for screen readers). The card is the positioned ancestor (components.css). */
.eco-grid--six .eco-card__cta::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.eco-grid--six .eco-card {
    cursor: pointer;
}

/* Hovering anywhere on the card highlights its button, as if pointing at it.
   No `filter` here: a filter makes the button the containing block of its stretched
   ::after, which then shrinks to the button and the rest of the card stops being
   clickable (bug fixed 2026-10-04). The background is lightened instead. */
.eco-grid--six .eco-card:hover .eco-card__cta,
.eco-grid--six .eco-card__cta:hover {
    filter: none;
    background: color-mix(in srgb, var(--button-bg, var(--acephal-blue)) 88%, var(--acephal-white));
    box-shadow: 0 10px 24px -10px var(--button-bg, var(--acephal-blue));
}

.eco-grid--six .eco-card:hover .eco-card__cta .icon {
    transform: translateX(3px);
}

/* Feature list on two columns (icon + label), filled row by row. */
.eco-grid--six .eco-card__features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem var(--space-4);
    margin-block: 1.1rem 1.4rem;
}

.eco-grid--six .eco-card__features li {
    gap: 0.6rem;
    font-size: 0.84rem;
    line-height: 1.3;
}

.eco-grid--six .eco-card__features .icon {
    flex: none;
    width: 1.35rem;
    height: 1.35rem;
}

/* Carousel controls (created by js/eu.js). */
.eco-carousel__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    position: relative;   /* above the track's bottom padding (shadow room) */
    margin-top: var(--space-4);
}

.eco-carousel__nav[hidden] {
    display: none;
}

.eco-carousel__dots {
    display: flex;
    gap: 0.35rem;
}

/* 24 px touch target around an 8 px dot. */
.eco-carousel__dot {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.eco-carousel__dot::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--acephal-blue) 30%, transparent);
    transition: width 0.2s ease, background-color 0.2s ease;
}

.eco-carousel__dot[aria-current="true"]::before {
    width: 1.25rem;
    border-radius: 0.25rem;
    background: var(--acephal-blue);
}

.eco-carousel__dot:focus-visible {
    outline: 2px solid var(--acephal-blue);
    outline-offset: 2px;
}

@media (min-width: 600px) {
    .eco-grid.eco-grid--six {
        grid-auto-columns: calc((100% - var(--eco-gap)) / 2);
    }
}

@media (min-width: 1024px) {
    .eco-grid.eco-grid--six {
        --eco-gap: var(--space-5);
        grid-auto-columns: calc((100% - 2 * var(--eco-gap)) / 3);
    }
}

@media (prefers-reduced-motion: reduce) {
    .eco-grid.eco-grid--six {
        scroll-behavior: auto;
    }
}
