/* =============================================================
   STYLE.CSS — AMSS13
   Feuille de style globale (navbar, footer, hero, responsive)
   ============================================================= */


/* -------------------------------------------------------------
   1. RESET & BASE
   ------------------------------------------------------------- */

html, body {
    display:        flex;
    flex-direction: column;
    min-height:     100vh;
    margin:         0;
    padding:        0;
}

main {
    flex: 1; /* Pousse le footer en bas quand le contenu est court */
}

main.container {
    min-height: 60vh;
}


/* -------------------------------------------------------------
   2. NAVBAR
   ------------------------------------------------------------- */

.custom-navbar {
    background:    linear-gradient(180deg, #041229 0%, #08182b 100%);
    border-bottom: 1px solid rgba(255, 215, 154, 0.25);
    padding-top:   6px;
    padding-bottom:6px;
    z-index:       1030;
    /* sticky-top Bootstrap gère le positionnement — pas de position: absolute ici */
}

.custom-navbar .navbar-brand img {
    display: block;
    width:   96px;
    height:  96px;
}

/* Ordinateur : menu compact dès que la page défile (classe posée par site.js).
   Sans cela, le menu fixe de 120 px couvre le haut de la page, et sur une page
   courte le titre reste coupé en deux en bas de défilement. */
@media (min-width: 992px) {
    .custom-navbar .navbar-brand img {
        transition: width 0.2s ease, height 0.2s ease;
    }

    .custom-navbar.is-compact .navbar-brand img {
        width:  44px;
        height: 44px;
    }
}

@media (min-width: 992px) and (prefers-reduced-motion: reduce) {
    .custom-navbar .navbar-brand img {
        transition: none;
    }
}

.custom-navbar .nav-link {
    color:       rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
}

.custom-navbar .nav-link:hover {
    color: #ffd79a !important;
}

/* Icône « hamburger » en blanc plein (celle de navbar-dark est à 55 %
   d'opacité). L'ancien filtre invert() la rendait noire, donc quasi
   invisible sur le fond bleu nuit. */
.custom-navbar {
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23fff' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-collapse .nav-item .nav-link {
    padding-top:    0.4rem;
    padding-bottom: 0.4rem;
}

.navbar-toggler span.ms-2 {
    color:       #ffffff;
    font-weight: 600;
}

/* Dans le menu mobile replié, le dropdown devient un bloc statique
   dans le flux de la page (plus un panneau flottant comme sur
   desktop) : le "white-space: nowrap" par défaut de Bootstrap force
   alors les items longs ("Brevet National de Sécurité et de
   Sauvetage Aquatique"...) à pousser toute la page plus large que
   l'écran au lieu de passer à la ligne.
   Limité à < 992px (seuil de navbar-expand-lg) : .navbar-collapse
   est le nom de la classe en permanence, sur desktop aussi — sans
   ce media query la règle casserait aussi le dropdown flottant
   desktop, qui n'a pas ce problème de largeur. */
@media (max-width: 991.98px) {
    .navbar-collapse .dropdown-item {
        white-space: normal;
    }
}


/* -------------------------------------------------------------
   3. HERO (page d'accueil)
   ------------------------------------------------------------- */

/* Le voile (.hero-overlay) est dans le flux et remplit la section : si le
   texte est plus haut que min-height (téléphone, petit écran), la section
   s'agrandit au lieu de laisser le texte déborder sous le menu et hors de
   la photo, comme avec l'ancien position: absolute. */
/* Hauteur du menu (en haut de page) selon l'écran : le bandeau d'accueil occupe
   tout l'écran visible sous le menu. */
:root {
    --nav-h: 119px;
}

@media (max-width: 991.98px) {
    :root { --nav-h: 95px; }
}

@media (max-width: 575.98px) {
    :root { --nav-h: 75px; }
}

.hero-slide {
    position:   relative;
    width:      100%;
    /* Plein écran sous le menu. svh = hauteur visible sur mobile barre d'adresse
       comprise : pas de saut quand elle se replie (vh en secours) */
    min-height: calc(100vh - var(--nav-h));
    min-height: calc(100svh - var(--nav-h));
    display:    flex;
    /* Cadrage un peu bas : l'équipe reste entière quand l'écran rogne la photo */
    background: url('../img/background/amss-orangevelodrome-2022-02.jpg') center 70% / cover no-repeat;
}

/* Flèche « découvrir la suite » en bas du bandeau */
.hero-scroll {
    position:        absolute;
    left:            50%;
    bottom:          1.25rem;
    width:           44px;
    height:          44px;
    display:         flex;
    align-items:     center;
    justify-content: center;
    border-radius:   50%;
    border:          1px solid rgba(255, 255, 255, 0.35);
    background:      rgba(4, 18, 41, 0.45);
    color:           #fff;
    font-size:       1.4rem;
    text-decoration: none;
    transform:       translateX(-50%);
    animation:       hero-bounce 2.2s ease-in-out infinite;
}

.hero-scroll:hover,
.hero-scroll:focus-visible {
    background: rgba(4, 18, 41, 0.8);
    color:      #ffd79a;
}

@keyframes hero-bounce {
    0%, 100% { transform: translate(-50%, 0); }
    50%      { transform: translate(-50%, 6px); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-scroll { animation: none; }
}

.hero-overlay {
    flex:            1;
    padding:         3rem 0 5rem;
    background:      rgba(4, 10, 20, 0.35);
    display:         flex;
    align-items:     center;
    justify-content: center;
}

.hero-content {
    max-width: 1200px;
    margin:    0 auto;
    padding:   0 1rem;
}

/* Tailles fluides : elles suivent la largeur de l'écran entre un minimum
   (téléphone) et un maximum (ordinateur), sans paliers de media queries. */
.hero-title {
    font-size:   clamp(1.6rem, 6.5vw, 2.8rem);
    line-height: 1.1;
    letter-spacing: 0.01em;
    text-shadow: 1px 2px 8px rgba(0, 0, 0, 0.25);
}

.hero-desc {
    font-size:   clamp(1rem, 2.4vw, 1.6rem);
    font-weight: 400;
    line-height: 1.3;
    max-width:   900px;
    margin:      0 auto;
    text-shadow: 1px 2px 8px rgba(0, 0, 0, 0.18);
}

/* Écran très bas (téléphone à l'horizontale…) : sans flèche ni paragraphe (repris
   juste en dessous), titre et boutons tiennent dans la hauteur de l'écran.
   Placé après les règles de base du bandeau pour bien les remplacer. */
@media (max-height: 560px) {
    .hero-scroll  { display: none; }
    .hero-desc    { display: none; }
    .hero-overlay { padding: 1.5rem 0; }
    .hero-title   { font-size: clamp(1.4rem, 4vw, 2rem); }
}


/* -------------------------------------------------------------
   4. EN-TÊTE DE PAGE (pages internes)
   ------------------------------------------------------------- */

/* Teinte un peu plus claire que le menu, avec un halo doré : on distingue nettement
   le menu et le bandeau, au lieu d'un même aplat bleu nuit coupé par un filet.
   Liseré doré en bas pour une fin nette. */
.page-header {
    background:
        radial-gradient(ellipse at 12% 0%, rgba(255, 215, 154, 0.16), transparent 55%),
        linear-gradient(135deg, #0b2347 0%, #0a1c36 55%, #08182b 100%);
    border-bottom: 3px solid #ffd79a;
}


/* -------------------------------------------------------------
   5. FOOTER
   ------------------------------------------------------------- */

footer.footer {
    background:  #08182b;
    color:       #fff;
    width:       100%;
    z-index:     100;
    border-top:  1px solid #2b3b56;
    /* Pas de fixed-bottom : le footer suit le flux normal du document */
}

/* Sur mobile, les liens passent sur plusieurs lignes : on les centre. */
.footer-links {
    text-align: center;
}

/* Icônes, copyright et chaque lien ne se coupent jamais : sur tablette, ce sont
   les liens entiers qui passent à la ligne quand la place manque. */
footer.footer .container {
    column-gap: 1.5rem;
}

.footer-social,
.footer-info {
    flex-shrink: 0;
    white-space: nowrap;
}

.footer-link {
    display:     inline-block;
    white-space: nowrap;
}

.footer-link {
    color:           #fff;
    text-decoration: none;
    margin-right:    1rem;
    font-size:       1rem;
}

.footer-link:hover {
    text-decoration: underline;
    color:           #ffd79a;
}

.footer-icon {
    color:           #fff;
    font-size:       1.7rem;
    transition:      color 0.2s;
    vertical-align:  middle;
}

.footer-icon:hover {
    color: #0d6efd;
}

.footer-svg {
    filter:     brightness(0) invert(1);
    transition: filter 0.2s;
}

.footer-svg:hover {
    filter: brightness(0) invert(0.6) sepia(1) hue-rotate(180deg) saturate(4);
}


/* -------------------------------------------------------------
   6. ICÔNES RÉSEAUX SOCIAUX
   ------------------------------------------------------------- */

.socials {
    fill:    white;
    display: inline-flex;
}


/* -------------------------------------------------------------
   7. RESPONSIVE — Tablette et mobile (< 992px)
      (tailles du hero : voir les clamp() de la section 3)
   ------------------------------------------------------------- */

@media (max-width: 991.98px) {

    .custom-navbar .navbar-brand img {
        width:  72px;
        height: 72px;
    }

    .custom-navbar .nav-link {
        padding-left:  0.5rem;
        padding-right: 0.5rem;
    }
}

/* Téléphone : menu fixe plus compact pour laisser la place au contenu */
@media (max-width: 575.98px) {
    .custom-navbar .navbar-brand img {
        width:  52px;
        height: 52px;
    }
}


/* -------------------------------------------------------------
   8. PAGE D'ACCUEIL — SECTIONS DE CONTENU
   ------------------------------------------------------------- */

.home-section {
    padding-top:       4rem;
    padding-bottom:    4rem;
    scroll-margin-top: 120px; /* ancre (#nos-formations) pas masquée par le menu fixe */
}

.home-section-title {
    font-weight:      700;
    border-left:      4px solid #ffd79a;
    padding-left:     .75rem;
    margin-bottom:    .5rem;
}

.home-section-lead {
    color:      #5a6472;
    max-width:  720px;
    margin-bottom: 2.5rem;
}

/* Bandeau chiffres clés */
.stats-band {
    background: linear-gradient(180deg, #041229 0%, #08182b 100%);
    color:      #fff;
}

.stat-item {
    text-align: center;
    padding:    1rem;
}

.stat-item i {
    font-size:     2rem;
    color:         #ffd79a;
    margin-bottom: .5rem;
    display:       block;
}

.stat-number {
    font-size:   2.4rem;
    font-weight: 700;
    line-height: 1.1;
}

.stat-label {
    color:     rgba(255, 255, 255, 0.7);
    font-size: .95rem;
}

/* Cartes "Nos formations" */
.formation-card {
    border:        none;
    border-radius: 14px;
    box-shadow:    0 4px 18px rgba(0, 0, 0, 0.07);
    transition:    transform .2s ease, box-shadow .2s ease;
    height:        100%;
}

.formation-card:hover {
    transform:  translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.formation-card .formation-icon,
.qsn-mission .formation-icon {
    width:           56px;
    height:          56px;
    border-radius:   14px;
    background:      #041229;
    color:           #ffd79a;
    display:         flex;
    align-items:     center;
    justify-content: center;
    font-size:       1.5rem;
    margin-bottom:   1rem;
}

.card-link {
    color:           #041229;
    font-weight:     600;
    text-decoration: none;
}

.card-link:hover {
    color: #0d6efd;
}

/* Bandeau "Nos interventions" */
.intervention-badge {
    background:  #f4f6f8;
    border-left: 3px solid #041229;
    color:       #041229;
    font-weight: 500;
    padding:     .5rem 1rem;
    border-radius: .375rem;
}

/* Bandeau d'appel à l'action */
.cta-band {
    background:    linear-gradient(180deg, #041229 0%, #08182b 100%);
    color:         #fff;
    border-radius: 18px;
}

@media (max-width: 767.98px) {
    .home-section {
        padding-top:    2.5rem;
        padding-bottom: 2.5rem;
    }
}


/* -------------------------------------------------------------
   9. BANDEAU COOKIES (créé par site.js)
   ------------------------------------------------------------- */

.cookie-banner {
    position:   fixed;
    left:       0;
    right:      0;
    bottom:     0;
    z-index:    1040;
    background: #08182b;
    color:      #fff;
    border-top: 2px solid #ffd79a;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.25);
}

.cookie-banner a {
    color: #ffd79a;
}

/* Même style pour « Refuser » et « Accepter » (exigence CNIL) */
.cookie-banner .cookie-btn {
    background:  #ffd79a;
    color:       #041229;
    font-weight: 600;
    min-width:   7rem;
}

.cookie-banner .cookie-btn:hover,
.cookie-banner .cookie-btn:focus-visible {
    background: #fff;
    color:      #041229;
}


/* -------------------------------------------------------------
   10. PAGE « QUI SOMMES-NOUS ? »
       (réutilise aussi .home-section, .stats-band, .formation-card,
       .intervention-badge et .cta-band de la page d'accueil)
   ------------------------------------------------------------- */

.btn-gold {
    background:  #ffd79a;
    color:       #041229;
    font-weight: 600;
    border:      0;
}

.btn-gold:hover,
.btn-gold:focus-visible {
    background: #ffe6bd;
    color:      #041229;
}

.qsn-mission {
    display:       flex;
    align-items:   flex-start;
    gap:           1rem;
    margin-bottom: 1.5rem;
}

.qsn-mission:last-child {
    margin-bottom: 0;
}

.qsn-mission .formation-icon {
    flex-shrink:   0;
    margin-bottom: 0;
}

.qsn-photo {
    display:       block;
    width:         100%;
    aspect-ratio:  4 / 3;
    object-fit:    cover;
    border-radius: 1rem;
    box-shadow:    0 10px 30px rgba(4, 18, 41, 0.15);
}

.stats-band h2 {
    color: #fff;
}

.qsn-moyen {
    align-items: center;
    text-align:  center;
}

.qsn-ffss {
    border-radius: 1rem;
    border-top:    4px solid #ffd79a !important;
    box-shadow:    0 4px 18px rgba(0, 0, 0, 0.07);
}

.qsn-ffss-logo {
    border-radius: 1rem;
    box-shadow:    0 2px 12px rgba(0, 0, 0, 0.08);
}

.qsn-chiffre {
    height:        100%;
    padding:       1rem 0.75rem;
    text-align:    center;
    border-radius: 0.75rem;
    background:    #f4f6f8;
}

.qsn-chiffre strong {
    display:     block;
    font-size:   1.6rem;
    font-weight: 700;
    line-height: 1.15;
    color:       #041229;
}

.qsn-chiffre span {
    font-size: 0.85rem;
    color:     #5a6472;
}