/* =============================================================================
   MAIN — Auguste Majeux
   Styles globaux : header, footer, nav, composants partagés
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Header
   ----------------------------------------------------------------------------- */

.site-header {
    position:   fixed;
    top:        0;
    left:       0;
    width:      100%;
    z-index:    var(--z-sticky);
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}

/* Compenser le header fixe sur toutes les pages sauf la home (hero s'étend sous le header) */
.site-main {
    padding-top: var(--header-height);
}
body.home .site-main {
    padding-top: 0;
}

/* État scrollé */
.site-header.is-scrolled {
    background:          rgba(255,255,255,0.97);
    backdrop-filter:     saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    border-bottom-color: var(--color-border);
    box-shadow:          0 1px 8px rgba(0,0,0,0.06);
}

.header__inner {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    height:          var(--header-height);
    gap:             var(--space-m);
}

/* --- Groupe logos (Cogestim + sep + AM) --- */
.header__brands {
    display:     flex;
    align-items: center;
    flex-shrink: 0;
}

/* Logo partenaire (Cogestim) */
.brand-partner {
    display:     inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.header__partner-logo {
    height:     44px;
    width:      auto;
    max-width:  150px;
    filter:     none;
    opacity:    1;
    transition: filter .3s ease, opacity .3s ease;
}

/* Pages avec hero : logo partenaire en blanc au top */
.has-transparent-header .site-header:not(.is-scrolled) .header__partner-logo {
    filter:  brightness(0) invert(1);
    opacity: 0.9;
}

/* Séparateur vertical entre les deux logos */
.brand__sep {
    width:       1px;
    height:      44px;
    background:  var(--color-border);
    margin:      0 14px;
    flex-shrink: 0;
    transition:  background .3s ease;
}

/* Pages avec hero : séparateur blanc au top */
.has-transparent-header .site-header:not(.is-scrolled) .brand__sep {
    background: rgba(255,255,255,0.35);
}

/* --- Logo (brand) : deux versions superposées --- */
.brand {
    display:     inline-flex;
    align-items: center;
    flex-shrink: 0;
    color:       var(--color-primary);
}

.brand__logos {
    position: relative;
    display:  inline-flex;
    height:   70px;
}

.header__logo-img {
    height:     70px;
    width:      auto;
    max-width:  220px;
    transition: opacity .25s ease;
}

/* Défaut (pages sans hero) : logo couleur visible, logo blanc masqué */
.header__logo-img--white { opacity: 0; }
.header__logo-img--color { position: absolute; inset: 0; opacity: 1; }

/* Pages avec hero : logo blanc au top, logo couleur au scroll */
.has-transparent-header .header__logo-img--white { opacity: 1; }
.has-transparent-header .header__logo-img--color { opacity: 0; }
.has-transparent-header .site-header.is-scrolled .header__logo-img--white { opacity: 0; }
.has-transparent-header .site-header.is-scrolled .header__logo-img--color { opacity: 1; }

/* --- Nav links --- */
.nav__links {
    display:     flex;
    align-items: center;
    gap:         36px;
    list-style:  none;
    margin:      0;
    padding:     0;
}

.nav__links a {
    color:       var(--color-text);
    font-size:   15px;
    font-weight: 400;
    transition:  color var(--transition-fast);
    white-space: nowrap;
}

.nav__links a:hover,
.nav__links .current-menu-item a {
    color: var(--color-primary);
}

/* Nav transparente — uniquement sur les pages avec hero */
.has-transparent-header .site-header:not(.is-scrolled) .nav__links a {
    color: rgba(255,255,255,0.92);
}
.has-transparent-header .site-header:not(.is-scrolled) .nav__links a:hover,
.has-transparent-header .site-header:not(.is-scrolled) .nav__links .current-menu-item a {
    color: #fff;
}
.has-transparent-header .site-header:not(.is-scrolled) .nav__burger {
    color: #fff;
}
.has-transparent-header .site-header:not(.is-scrolled) .nav__cta .btn--primary {
    background-color: transparent;
    border-color:     rgba(255,255,255,0.85);
    color:            #fff;
}
.has-transparent-header .site-header:not(.is-scrolled) .nav__cta .btn--primary:hover {
    background-color: rgba(255,255,255,0.15);
}

/* --- CTA header --- */
.nav__cta {
    flex-shrink: 0;
}

/* --- CTA header --- */
.header__cta {
    flex-shrink: 0;
    height:      40px;
    padding:     0 20px;
    font-size:   15px;
}

/* --- Hamburger mobile (nav__burger) --- */
.nav__burger {
    display:         none;
    width:           40px;
    height:          40px;
    align-items:     center;
    justify-content: center;
    border-radius:   6px;
    color:           var(--color-strong);
    flex-shrink:     0;
}

.nav__burger svg {
    width:  22px;
    height: 22px;
}

/* Mobile drawer */
.mobile-drawer {
    position:         fixed;
    inset:            0;
    background:       var(--color-secondary); /* opaque : rien ne transparaît du hero */
    z-index:          var(--z-overlay);
    padding:          80px 24px 24px;
    display:          none;
    flex-direction:   column;
    gap:              8px;
}

.mobile-drawer.open {
    display: flex;
}

.mobile-drawer__links {
    display: flex;
    flex-direction: column;
}

.mobile-drawer__links a {
    display:       block;
    padding:       14px 0;
    border-bottom: 1px solid var(--border-light);
    color:         var(--color-strong);
    font-size:     17px;
}

.mobile-drawer .btn {
    margin-top: 16px;
    width:      100%;
}

.mobile-drawer__close {
    position:        absolute;
    top:             18px;
    right:           18px;
    width:           40px;
    height:          40px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    color:           var(--color-strong);
}

/* -----------------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------------- */

.site-footer {
    background-color: var(--surface-footer);
    color:            rgba(255,255,255,0.75);
    font-size:        14px;
    margin-top:       auto;
}

.footer__main {
    padding-top: 64px;
}

.footer__grid {
    display:               grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap:                   56px;
    padding-bottom:        40px;
    border-bottom:         1px solid rgba(255,255,255,0.08);
}

.footer__logos {
    display:       flex;
    align-items:   center;
    gap:           20px;
    margin-bottom: 20px;
}

.footer__logos-sep {
    width:      1px;
    height:     70px;
    background: rgba(255,255,255,0.2);
    flex-shrink: 0;
}

.footer__logo-partner img {
    max-height: 60px;
    height:     auto;
    width:      auto;
    max-width:  140px;
    display:    block;
    filter:     brightness(0) invert(1);
    opacity:    0.85;
    transition: opacity .2s, filter .2s;
}

.footer__logo-partner:hover img {
    opacity: 0.55;
}

.footer__logo {
    display: inline-block;
}

.footer__logo img {
    height:    70px;
    width:     auto;
    max-width: 220px;
    filter:     brightness(0) invert(1);
    opacity:    0.85;
    transition: opacity .2s, filter .2s;
}

.footer__logo:hover img {
    opacity: 0.55;
}

.footer__brand-desc {
    max-width:   380px;
    margin-bottom: 16px;
    color:       rgba(255,255,255,0.7);
    line-height: 1.6;
    font-size:   14px;
}

.footer__address {
    font-style:  normal;
    font-size:   13.5px;
    color:       rgba(255, 255, 255, .7);
    line-height: 1.6;
}

.footer__address p {
    max-width: none;
}

.footer__heading {
    font-family:    var(--font-body);
    font-size:      14px;
    font-weight:    500;
    letter-spacing: normal;
    text-transform: none;
    color:          #fff;
    margin-bottom:  18px;
}

.footer__nav-list,
.footer__contact-list {
    display:        flex;
    flex-direction: column;
    gap:            var(--space-xs);
}

.footer__contact-list li {
    display:     flex;
    align-items: center;
    gap:         10px;
}

.footer__contact-list svg { opacity: .7; flex-shrink: 0; }

.footer__nav-link,
.footer__contact-link {
    font-size:  var(--text-sm);
    color:      rgba(255, 255, 255, .75);
    transition: color var(--transition-fast);
}

.footer__nav-link:hover,
.footer__contact-link:hover {
    color: #ffffff;
}

.footer__social {
    display:    flex;
    gap:        var(--space-s);
    margin-top: var(--space-m);
}

.footer__social-link {
    display:          flex;
    align-items:      center;
    justify-content:  center;
    width:            36px;
    height:           36px;
    border-radius:    50%;
    border:           1px solid rgba(255, 255, 255, .3);
    color:            rgba(255, 255, 255, .75);
    transition:       background-color var(--transition-fast),
                      border-color var(--transition-fast),
                      color var(--transition-fast);
}

.footer__social-link:hover {
    background-color: rgba(255, 255, 255, .1);
    border-color:     rgba(255, 255, 255, .6);
    color:            #ffffff;
}

.footer__social-icon {
    width:  18px;
    height: 18px;
    fill:   currentColor;
}

/* Barre copyright */
.footer__bar {
    padding: 24px 0;
}

.footer__bar-inner {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             var(--space-m);
    flex-wrap:       wrap;
}

.footer__copyright {
    font-size:  13px;
    color:      rgba(255, 255, 255, .55);
    max-width:  none;
}

.footer__legal-list {
    display: flex;
    gap:     var(--space-m);
}

.footer__legal-link {
    font-size:  13px;
    color:      rgba(255, 255, 255, .55);
    transition: color var(--transition-fast);
}

.footer__legal-link:hover {
    color: rgba(255, 255, 255, .85);
}

/* Le lien « Préférences cookies » est un <button> : on neutralise le style natif */
.footer__cookie-prefs {
    padding:     0;
    border:      0;
    background:  none;
    font-family: inherit;
    cursor:      pointer;
}

/* -----------------------------------------------------------------------------
   Offset contenu principal (hauteur header fixe)
   ----------------------------------------------------------------------------- */

.site-main {
    min-height: 60vh;
    display:    flex;
    flex-direction: column;
}

/* -----------------------------------------------------------------------------
   Breadcrumb
   ----------------------------------------------------------------------------- */

.breadcrumb {
    padding-block: var(--space-s);
}

.breadcrumb__list {
    display:  flex;
    flex-wrap: wrap;
    gap:      0.375rem;
    align-items: center;
}

.breadcrumb__item {
    display:     flex;
    align-items: center;
    gap:         0.375rem;
    font-size:   var(--text-sm);
    color:       var(--color-text);
}

.breadcrumb__link {
    color: var(--color-text);
    transition: color var(--transition-fast);
}

.breadcrumb__link:hover {
    color: var(--color-primary);
}

.breadcrumb__sep {
    color:       rgba(0, 0, 0, .3);
    font-size:   var(--text-xs);
}

.breadcrumb__current {
    color: var(--color-primary);
    font-weight: 500;
}

/* -----------------------------------------------------------------------------
   Composants généraux
   ----------------------------------------------------------------------------- */

/* Card de base */
.card {
    background-color: #ffffff;
    border-radius:    var(--radius-md);
    overflow:         hidden;
    box-shadow:       var(--shadow-sm);
    transition:       box-shadow var(--transition), transform var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform:  translateY(-2px);
}

/* Section intro avec label + titre */
.section-intro {
    text-align:    center;
    max-width:     680px;
    margin-inline: auto;
    margin-bottom: var(--space-xl);
}

.section-intro .section-label {
    display: block;
}

.section-intro p {
    margin-top: var(--space-s);
    color:      var(--color-text);
    max-width:  none;
}

/* Ligne décorative sous titre de section */
.section-title-line {
    display:          block;
    width:            48px;
    height:           3px;
    background-color: var(--color-accent);
    border-radius:    var(--radius-pill);
    margin-top:       var(--space-s);
}

.section-intro .section-title-line {
    margin-inline: auto;
}

/* Grilles génériques */
.grid-2 {
    display:               grid;
    grid-template-columns: repeat(2, 1fr);
    gap:                   var(--space-m);
}

.grid-3 {
    display:               grid;
    grid-template-columns: repeat(3, 1fr);
    gap:                   var(--space-m);
}

.grid-4 {
    display:               grid;
    grid-template-columns: repeat(4, 1fr);
    gap:                   var(--space-m);
}

/* Image ratio */
.aspect-ratio-16-9 {
    aspect-ratio: 16 / 9;
    overflow:     hidden;
}

.aspect-ratio-4-3 {
    aspect-ratio: 4 / 3;
    overflow:     hidden;
}

.aspect-ratio-16-9 img,
.aspect-ratio-4-3  img {
    width:      100%;
    height:     100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.card:hover .aspect-ratio-16-9 img,
.card:hover .aspect-ratio-4-3  img {
    transform: scale(1.04);
}

/* Icône + label (cadre de vie) */
.feature-item {
    display:     flex;
    align-items: flex-start;
    gap:         var(--space-s);
}

.feature-item__icon {
    flex-shrink: 0;
    width:       80px;
    height:      80px;
    display:     flex;
    align-items: center;
    justify-content: center;
}

.feature-item__icon svg {
    width:  80px;
    height: 80px;
}

.feature-item__text {
    flex: 1;
}

.feature-item__label {
    font-weight: 600;
    font-size:   var(--text-sm);
    color:       var(--color-strong);
    line-height: 1.4;
}

.feature-item__desc {
    font-size:   var(--text-xs);
    color:       var(--color-text);
    margin-top:  2px;
    max-width:   none;
    line-height: 1.5;
}

/* Métrique circulaire */
.metric-item {
    text-align: center;
    padding:    var(--space-m);
}

.metric-item__value {
    font-family: var(--font-display);
    font-size:   3rem;
    font-weight: 700;
    color:       var(--color-primary);
    line-height: 1;
}

.metric-item__unit {
    font-size:   var(--text-h5);
    font-weight: 500;
    color:       var(--color-accent);
    margin-left: 4px;
}

.metric-item__label {
    font-size:   var(--text-sm);
    color:       var(--color-text);
    margin-top:  var(--space-xs);
    max-width:   none;
}

/* Timeline */
.timeline {
    position:  relative;
    padding-left: var(--space-l);
}

.timeline::before {
    content:          '';
    position:         absolute;
    left:             8px;
    top:              8px;
    bottom:           8px;
    width:            2px;
    background-color: var(--color-border);
}

.timeline__item {
    position:    relative;
    padding-bottom: var(--space-m);
}

.timeline__item:last-child {
    padding-bottom: 0;
}

.timeline__dot {
    position:         absolute;
    left:             calc(-1 * var(--space-l) + 1px);
    top:              4px;
    width:            14px;
    height:           14px;
    border-radius:    50%;
    background-color: var(--color-border);
    border:           3px solid #ffffff;
    box-shadow:       0 0 0 2px var(--color-border);
    transform:        translateX(-50%);
}

.timeline__item.is-done .timeline__dot {
    background-color: var(--color-primary);
    box-shadow:       0 0 0 2px var(--color-primary);
}

.timeline__item.is-current .timeline__dot {
    background-color: var(--color-accent);
    box-shadow:       0 0 0 2px var(--color-accent);
}

.timeline__date {
    font-size:   var(--text-sm);
    font-weight: 600;
    color:       var(--color-accent);
    margin-bottom: 2px;
}

.timeline__label {
    font-size:  var(--text-body);
    color:      var(--color-text);
    max-width:  none;
}

/* FAQ accordion */
.faq__item {
    border-bottom: 1px solid var(--color-border);
}

.faq__question {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    gap:             var(--space-s);
    width:           100%;
    padding-block:   var(--space-m);
    text-align:      left;
    font-size:       var(--text-body);
    font-weight:     600;
    color:           var(--color-strong);
    cursor:          pointer;
    background:      none;
    border:          none;
    transition:      color var(--transition-fast);
}

.faq__question:hover {
    color: var(--color-primary);
}

.faq__icon {
    flex-shrink: 0;
    width:       20px;
    height:      20px;
    position:    relative;
    color:       var(--color-accent);
}

.faq__icon::before,
.faq__icon::after {
    content:          '';
    position:         absolute;
    top:              50%;
    left:             50%;
    background-color: currentColor;
    border-radius:    1px;
    transition:       transform var(--transition);
}

.faq__icon::before {
    width:     12px;
    height:    2px;
    transform: translate(-50%, -50%);
}

.faq__icon::after {
    width:     2px;
    height:    12px;
    transform: translate(-50%, -50%);
}

.faq__item.is-open .faq__icon::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.faq__answer {
    display:        none;
    padding-bottom: var(--space-m);
    color:          var(--color-text);
    line-height:    1.7;
}

.faq__answer p {
    max-width: none;
}

.faq__item.is-open .faq__answer {
    display: block;
}

/* -----------------------------------------------------------------------------
   Page générique
   ----------------------------------------------------------------------------- */

.page-content {
    padding-block: var(--space-xl);
}

.page-content__header {
    margin-bottom: var(--space-l);
}

.page-content__header h1 {
    margin-bottom: var(--space-s);
}

.page-content__body {
    max-width: 780px;
}

.page-content__body p {
    max-width: none;
}

.page-content__body h2 {
    font-size:   var(--text-h3);
    margin-top:  var(--space-l);
    margin-bottom: var(--space-s);
}

.page-content__body h3 {
    font-size:   var(--text-h4);
    margin-top:  var(--space-m);
    margin-bottom: var(--space-xs);
}

.page-content__body ul,
.page-content__body ol {
    list-style: disc;
    padding-left: var(--space-m);
    margin-block: var(--space-s);
}

.page-content__body li {
    margin-bottom: var(--space-xs);
    line-height: 1.7;
}

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

@media (max-width: 960px) {
    /* Header : nav + CTA masqués, burger affiché (le drawer reprend les liens).
       Sous ~900 px la rangée logos + nav + CTA ne tient plus dans la largeur. */
    #primary-nav,
    .nav__cta     { display: none; }
    .nav__burger  { display: inline-flex; }

    .footer__grid {
        grid-template-columns: repeat(2, 1fr);
        gap:                   20px;
    }

    .footer__col--brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .footer__grid {
        grid-template-columns: 1fr;
    }

    .footer__bar-inner {
        flex-direction: column;
        text-align:     center;
    }
}
