/*
 * Ossature des pages publiques : en-tête, tiroir mobile, bandeau
 * « En continu » et pied de page — templates/partials/_header.html.twig,
 * _ticker.html.twig et _footer.html.twig.
 */

/* ---------- Logo (version noire en clair, blanche en sombre) ---------- */
.bb-logo {
    display: inline-flex;
    flex: none;
    align-items: center;
}

.bb-logo-img {
    display: block;
    width: auto;
    height: 44px;
}

.bb-logo-img--dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .bb-site .bb-logo-img--light {
        display: none;
    }

    html:not([data-theme="light"]) .bb-site .bb-logo-img--dark {
        display: block;
    }
}

html[data-theme="dark"] .bb-site .bb-logo-img--light {
    display: none;
}

html[data-theme="dark"] .bb-site .bb-logo-img--dark {
    display: block;
}

/* ---------- En-tête ---------- */
.bb-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bb-surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid color-mix(in srgb, var(--bb-line) 60%, transparent);
}

.bb-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 80px;
    padding-block: 12px;
}

.bb-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    padding: 5px;
    border-radius: var(--bb-r-pill);
    background: var(--bb-nav-bg);
    font-size: 14px;
    font-weight: 700;
}

.bb-nav-link {
    padding: 10px 14px;
    border-radius: var(--bb-r-pill);
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}

.bb-nav-link:hover {
    color: var(--bb-hover);
}

.bb-nav-link.is-active {
    background: var(--bb-nav-active-bg);
    color: var(--bb-nav-active-ink);
}

.bb-header-actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 10px;
}

.bb-icon-btn {
    display: grid;
    flex: none;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--bb-line);
    border-radius: 50%;
    background: transparent;
    color: var(--bb-ink);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.bb-icon-btn:hover {
    border-color: var(--bb-ink);
}

.bb-menu-toggle {
    display: none;
    border-color: transparent;
    background: var(--bb-cta-bg);
    color: var(--bb-cta-ink);
}

.bb-menu-toggle:hover {
    border-color: transparent;
}

.bb-header-cta {
    min-height: 48px;
    padding: 12px 20px;
    font-size: 14px;
}

/* Icône du bouton de thème : la lune propose le sombre, le soleil le clair. */
.bb-theme-icon--sun,
.bb-theme-toggle[data-theme-current="dark"] .bb-theme-icon--moon {
    display: none;
}

.bb-theme-toggle[data-theme-current="dark"] .bb-theme-icon--sun {
    display: block;
}

@media (max-width: 1180px) {
    .bb-nav {
        display: none;
    }

    .bb-menu-toggle {
        display: grid;
    }
}

@media (max-width: 640px) {
    .bb-header-inner {
        min-height: 68px;
        padding-block: 10px;
    }

    .bb-logo-img {
        height: 36px;
    }

    .bb-header-cta {
        display: none;
    }

    .bb-icon-btn {
        width: 44px;
        height: 44px;
    }
}

/* ---------- Tiroir mobile ---------- */
.bb-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(17, 27, 20, .7);
    opacity: 0;
    transition: opacity .3s ease;
}

.bb-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 61;
    display: flex;
    flex-direction: column;
    width: min(360px, 88vw);
    padding: 24px;
    overflow-y: auto;
    background: var(--bb-surface);
    color: var(--bb-ink);
    box-shadow: -20px 0 40px -20px rgba(0, 0, 0, .4);
    transform: translateX(100%);
    transition: transform .3s ease-in-out;
}

/* Fermé, le tiroir est vraiment retiré (sinon, décalé hors écran, il
   élargirait la page et créerait un défilement horizontal). */
.bb-drawer[hidden],
.bb-drawer-overlay[hidden] {
    display: none;
}

.bb-drawer-open .bb-drawer-overlay {
    opacity: 1;
}

.bb-drawer-open .bb-drawer {
    transform: translateX(0);
    transition-duration: .45s;
}

.bb-drawer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
}

.bb-drawer-nav {
    display: flex;
    flex-direction: column;
    margin-top: 56px;
}

.bb-drawer-label {
    margin: 22px 0 6px;
}

.bb-drawer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--bb-line);
    font-family: var(--bb-font-display);
    font-size: 24px;
    line-height: 1.1;
    text-transform: uppercase;
}

.bb-drawer-link:hover,
.bb-drawer-link.is-active {
    color: var(--bb-green-text);
}

.bb-drawer-footer {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 28px;
}

/* ---------- Bandeau « En continu » (bande diagonale verte de la charte) ---------- */
.bb-ticker {
    overflow: hidden;
    padding: 14px 0 6px;
}

.bb-ticker-band {
    display: flex;
    align-items: center;
    margin: 0 -24px;
    padding: 12px 0;
    background: var(--bb-forest);
    color: var(--bb-white);
    transform: rotate(-1.5deg);
}

.bb-ticker-label {
    position: relative;
    z-index: 1;
    flex: none;
    margin-left: calc(24px + var(--bb-gutter));
    padding: 2px 10px;
    background: var(--bb-gold);
    color: var(--bb-black);
    font-family: var(--bb-font-display);
    font-size: clamp(18px, 2vw, 26px);
    line-height: 1.15;
    text-transform: uppercase;
    box-shadow: 18px 0 18px var(--bb-forest);
}

.bb-ticker-viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.bb-ticker-track {
    display: flex;
    width: max-content;
    animation: bb-ticker 60s linear infinite;
}

.bb-ticker:hover .bb-ticker-track,
.bb-ticker:focus-within .bb-ticker-track {
    animation-play-state: paused;
}

.bb-ticker-list {
    display: flex;
    flex: none;
    align-items: center;
    list-style: none;
    font-family: var(--bb-font-display);
    font-size: clamp(18px, 2vw, 26px);
    line-height: 1.15;
    text-transform: uppercase;
    white-space: nowrap;
}

.bb-ticker-list li {
    display: flex;
    align-items: center;
}

.bb-ticker-list li::before {
    content: "●";
    margin: 0 22px;
    color: var(--bb-gold);
    font-size: .6em;
}

.bb-ticker-list a:hover {
    color: var(--bb-gold);
}

@keyframes bb-ticker {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .bb-ticker-viewport {
        overflow-x: auto;
    }

    .bb-ticker-track {
        animation: none;
    }

    .bb-ticker-list[aria-hidden="true"] {
        display: none;
    }
}

/* ---------- Pied de page ---------- */
.bb-footer {
    margin-top: var(--bb-section);
    padding-top: 48px;
    overflow: hidden;
    border-top: var(--bb-footer-rule);
    color: var(--bb-ink);
}

.bb-footer-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px 32px;
    padding-bottom: 36px;
    border-bottom: 1px solid var(--bb-line);
}

.bb-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 26px;
    font-size: 14px;
    font-weight: 700;
    color: var(--bb-ink-muted);
}

.bb-footer-links a:hover {
    color: var(--bb-hover);
}

.bb-footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px 48px;
    padding: 40px 0;
}

.bb-footer-title {
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--bb-label);
}

.bb-footer-text,
.bb-footer-contact {
    max-width: 440px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--bb-ink-muted);
}

.bb-footer-contact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    list-style: none;
}

.bb-footer-contact a:hover {
    color: var(--bb-hover);
}

.bb-newsletter-form {
    display: flex;
    gap: 8px;
    max-width: 480px;
    margin-top: 16px;
}

.bb-newsletter-input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 0 20px;
    border: 1px solid var(--bb-line);
    border-radius: var(--bb-r-pill);
    background: var(--bb-input-bg);
    color: var(--bb-ink);
    font: inherit;
    font-size: 15px;
}

.bb-newsletter-input::placeholder {
    color: var(--bb-ink-muted);
}

.bb-newsletter-input:focus {
    outline: none;
    border-color: var(--bb-focus);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bb-focus) 25%, transparent);
}

.bb-newsletter-feedback {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--bb-success);
}

.bb-newsletter-feedback.is-error {
    color: var(--bb-danger);
}

.bb-footer-outro {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px 32px;
    padding-top: 16px;
}

.bb-footer-motto {
    font-size: clamp(52px, 10vw, 150px);
    line-height: .88;
}

.bb-footer-logo .bb-logo-img {
    height: clamp(40px, 5vw, 64px);
}

.bb-footer-copy {
    padding: 28px 0 24px;
    font-size: 13px;
    color: var(--bb-ink-muted);
}

.bb-stripe {
    display: flex;
    height: 14px;
}

.bb-stripe span {
    flex: 1;
}

.bb-stripe span:nth-child(1) {
    background: var(--bb-forest);
}

.bb-stripe span:nth-child(2) {
    background: var(--bb-gold);
}

.bb-stripe span:nth-child(3) {
    background: var(--bb-tomato);
}

.bb-stripe span:nth-child(4) {
    background: var(--bb-petrol);
}

@media (max-width: 900px) {
    .bb-footer-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 480px) {
    .bb-newsletter-form {
        flex-direction: column;
    }
}
