/* ==========================================================================
   FICHIER : assets/css/style.css
   Projet  : restaurant-river-s.fr — Phase 2bis (refonte front, fond clair)
   Design system Rivers — CSS custom properties, aucune dépendance externe.
   ========================================================================== */

:root {
    --rivers-fond:          #F5F0E8;
    --rivers-fond-carte:    #EAD9C0;
    --rivers-fond-header:   #1E1A16;
    --rivers-fond-contact:  #EDE6D8;
    --rivers-texte:         #1A1510;
    --rivers-texte-doux:    #6B5D4F;
    --rivers-texte-clair:   #F5F0E8;
    --rivers-terracotta:    #C4622D;
    --rivers-safran:        #D4900A;
    --rivers-creme:         #F2EBE0;
    --rivers-vert-cevennes: #4A6741;
    --rivers-rouge-vin:     #8B1A1A;
    --rivers-sable:         #C4A882;
    --rivers-bois:          #8B6347;
    --rivers-bordure:       #DDD5C8;
    --rivers-filet:         #E8DFD0;
    --font-titre:           'Playfair Display', serif;
    --font-section:         'Cormorant Garamond', serif;
    --font-body:            'Lato', sans-serif;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;
    --header-h: 68px;
}

/* ==========================================================================
   1. Reset + base
   ========================================================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-h);
}

body {
    background: var(--rivers-fond);
    color: var(--rivers-texte);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--rivers-terracotta);
    text-decoration: none;
    transition: color 0.2s ease;
}

ul {
    list-style: none;
}

/* ==========================================================================
   2. Header / Navigation
   ========================================================================== */

#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--rivers-fond-header);
    transition: box-shadow 0.3s ease;
}

#header.nav-scrolled {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
}

#header nav {
    max-width: 1200px;
    margin: 0 auto;
    min-height: var(--header-h);
    padding: 0 var(--space-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-titre);
    color: var(--rivers-sable);
    font-size: 1.4rem;
    letter-spacing: 0.12em;
}

.nav-logo:hover { color: var(--rivers-texte-clair); }

.nav-links {
    display: flex;
    gap: var(--space-md);
}

.nav-links a {
    color: var(--rivers-sable);
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
}

.nav-links a:hover { color: var(--rivers-terracotta); }

/* Hamburger — visible mobile uniquement */
#nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

#nav-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--rivers-sable);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#header.nav-open #nav-toggle span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
#header.nav-open #nav-toggle span:nth-child(2) { opacity: 0; }
#header.nav-open #nav-toggle span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ==========================================================================
   3. Section #hero
   ========================================================================== */

#hero {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 0;
}

.hero-slide.active { opacity: 1; z-index: 1; }

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.50);
    z-index: 1;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    text-align: center;
    z-index: 2;
}

.hero-titre {
    font-family: var(--font-titre);
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: #fff;
    letter-spacing: 0.15em;
    line-height: 1.1;
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

.hero-sous-titre {
    font-family: var(--font-section);
    color: var(--rivers-safran);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-style: italic;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-top: var(--space-sm);
}

.hero-cta {
    display: inline-block;
    margin-top: var(--space-md);
    background: var(--rivers-terracotta);
    color: #fff;
    font-family: var(--font-body);
    padding: 0.85rem 2.5rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.hero-cta:hover { background: var(--rivers-safran); color: #fff; }

.hero-dots {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.dot.active { background: var(--rivers-sable); transform: scale(1.25); }

/* ==========================================================================
   4. Sections générales
   ========================================================================== */

.section { padding: var(--space-xl) var(--space-md); }
.section-fond-clair { background: var(--rivers-fond); }

.container { max-width: 1200px; margin: 0 auto; }

.section-titre {
    font-family: var(--font-section);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--rivers-texte);
    text-align: center;
    margin-bottom: var(--space-lg);
}

.section-titre::after {
    content: "";
    display: block;
    width: 60px;
    height: 2px;
    background: var(--rivers-terracotta);
    margin: 0.8rem auto 0;
}

/* ==========================================================================
   5. Section #carte
   ========================================================================== */

/* Bandeau d'annonce (titre + texte optionnel) */
.bandeau-annonce {
    background: var(--rivers-terracotta);
    color: #fff;
    text-align: center;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
    border-radius: 4px;
}
.bandeau-titre {
    font-family: var(--font-titre);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}
.bandeau-texte {
    font-size: 1rem;
    margin: 0;
    opacity: 0.92;
}

/* Message d'accueil — sous le bandeau, au-dessus des colonnes */
.message-accueil {
    text-align: center;
    font-family: var(--font-section);
    font-size: 1.25rem;
    font-style: italic;
    color: var(--rivers-texte-doux);
    margin: 0 0 2rem;
}

/* Grille des catégories */
.carte-grille {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    align-items: start;
}

.carte-colonne {
    background: #fff;
    border-radius: 4px;
    padding: var(--space-md);
    border: 1px solid var(--rivers-bordure);
    transition: box-shadow 0.2s ease;
}

.carte-colonne:hover { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); }

.categorie-titre-badge {
    display: inline-block;
    border: 1.5px solid var(--rivers-terracotta);
    color: var(--rivers-terracotta);
    font-family: var(--font-section);
    font-size: 2rem;
    padding: 0.3rem 1.2rem;
    text-align: center;
    margin-bottom: var(--space-md);
}

/* Carte plat (avec ou sans photo) */
.carte-plat {
    background: transparent;
    margin-bottom: var(--space-sm);
    border-bottom: 1px solid var(--rivers-filet);
    padding-bottom: var(--space-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.carte-plat:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.plat-photo {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 3px;
    margin-bottom: var(--space-xs);
}

.plat-photo-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--rivers-filet);
    border: 1px solid var(--rivers-bordure);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-xs);
}

.plat-photo-placeholder svg {
    width: 40px;
    height: 40px;
    color: var(--rivers-sable);
    opacity: 0.4;
}

.plat-ligne-prix {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-xs);
}

.plat-nom {
    font-family: var(--font-titre);
    font-size: 1.05rem;
    color: var(--rivers-texte);
}

.plat-prix {
    color: var(--rivers-safran);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
}

.plat-description {
    color: var(--rivers-texte-doux);
    font-size: 0.82rem;
    line-height: 1.5;
    margin-top: 0.25rem;
}

.plat-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0.4rem;
}

.badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 2px;
    background: rgba(74, 103, 65, 0.1);
    color: var(--rivers-vert-cevennes);
    border: 1px solid rgba(74, 103, 65, 0.3);
}

/* Plat indisponible */
.plat-indisponible { opacity: 0.4; pointer-events: none; }

.badge-indispo {
    background: rgba(139, 26, 26, 0.1);
    color: var(--rivers-rouge-vin);
    border-color: rgba(139, 26, 26, 0.25);
}

/* Boissons — liste horizontale sous la grille */
.boissons-liste {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--rivers-bordure);
    margin-top: var(--space-md);
}

.boisson-item {
    color: var(--rivers-texte-doux);
    font-size: 0.9rem;
}

.boisson-item:not(:last-child)::after {
    content: "·";
    margin-left: var(--space-sm);
    color: var(--rivers-sable);
}

/* Tabs mobile (#carte) — masqués sur desktop */
.carte-tabs { display: none; }

.carte-tab {
    flex: 1;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    background: var(--rivers-fond-carte);
    color: var(--rivers-texte-doux);
    border: none;
    border-right: 1px solid var(--rivers-bordure);
    transition: background 0.2s, color 0.2s;
}

.carte-tab:last-child {
    border-right: none;
}

.carte-tab.active {
    background: var(--rivers-terracotta);
    color: #fff;
}

.carte-tab:not(.active):hover {
    background: var(--rivers-filet);
    color: var(--rivers-texte);
}

/* ==========================================================================
   6. Section #histoire
   ========================================================================== */

/* Fond photo plein cadre avec overlay sombre (parallaxe léger sur desktop) */
#histoire {
    background-image: url("../../images/hero/01-terrasse.jpg");
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    position: relative;
    color: var(--rivers-creme);
}
#histoire::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 10, 5, 0.72);
    z-index: 0;
}
#histoire > * {
    position: relative;
    z-index: 1;
}

.histoire-contenu {
    max-width: 700px;
    margin: 0 auto;
    font-family: var(--font-section);
    line-height: 1.9;
}

.histoire-contenu h2 {
    font-family: var(--font-titre);
    color: var(--rivers-creme);
    font-size: clamp(2rem, 3.5vw, 2.6rem);
    text-align: center;
    margin-bottom: var(--space-md);
}

#histoire p {
    color: var(--rivers-creme);
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.9;
    margin-bottom: 1.2rem;
}

/* Filet terracotta sur le premier paragraphe */
.histoire-contenu p:first-of-type {
    border-left: 3px solid var(--rivers-terracotta);
    padding-left: var(--space-md);
}

.histoire-citation {
    border-left: 3px solid var(--rivers-terracotta);
    padding-left: var(--space-md);
    font-style: italic;
    color: var(--rivers-bois);
    font-size: 1.25rem;
    margin: var(--space-md) 0;
}

.histoire-horaires {
    margin-top: var(--space-md);
    text-align: center;
    color: var(--rivers-safran);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Horaires mis en valeur dans la section contact */
.horaires-info {
    font-size: 1.1rem;
    color: var(--rivers-safran);
    font-weight: 600;
}

/* ==========================================================================
   7. Section #contact
   ========================================================================== */

#contact {
    background-color: transparent;
    background-image: url("../../images/ambiance/comptoir_bar.jpeg");
    background-size: cover;
    background-position: center;
    position: relative;
}
#contact::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(15, 10, 5, 0.72);
    z-index: 0;
}
#contact > * {
    position: relative;
    z-index: 1;
    color: var(--rivers-texte-clair);
}
/* Titre et liens lisibles sur le fond sombre */
#contact .section-titre { color: var(--rivers-creme); }
#contact a { color: var(--rivers-safran); }

.contact-grille {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

.contact-infos p { margin-bottom: 0.8rem; color: var(--rivers-creme); }
.contact-infos .libelle {
    display: block;
    font-weight: 700;
    color: var(--rivers-safran);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.78rem;
    margin-bottom: 0.15rem;
}

.contact-form { display: flex; flex-direction: column; gap: var(--space-sm); }
.contact-form label { color: var(--rivers-creme); font-size: 0.85rem; font-weight: 700; }

.contact-form input,
.contact-form textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--rivers-creme);
    padding: 0.85rem 1rem;
    border-radius: 3px;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.contact-form input:focus,
.contact-form textarea:focus { border-color: var(--rivers-terracotta); outline: none; }
.contact-form textarea { resize: vertical; min-height: 140px; }

.btn-envoyer {
    background: var(--rivers-terracotta);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.85rem 2rem;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-envoyer:hover { background: var(--rivers-safran); }

.message-succes,
.message-erreur {
    padding: var(--space-sm);
    border-radius: 3px;
    margin-bottom: var(--space-md);
}

.message-succes {
    background: rgba(74, 103, 65, 0.1);
    border: 1px solid var(--rivers-vert-cevennes);
    color: var(--rivers-texte);
}

.message-erreur {
    background: rgba(139, 26, 26, 0.1);
    border: 1px solid var(--rivers-rouge-vin);
    color: var(--rivers-texte);
}

/* ==========================================================================
   8. Footer
   ========================================================================== */

footer {
    background-color: var(--rivers-fond-header);
    background-image: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    position: relative;
    padding: var(--space-md);
    text-align: center;
    color: #A89880;
    font-size: 0.82rem;
}
footer::before {
    display: none;
}
footer, footer * {
    color: #A89880;
}

footer p { margin-bottom: 0.4rem; }
footer a { color: var(--rivers-sable); }
footer a:hover { color: var(--rivers-terracotta); }

/* Téléphone du footer : bouton d'appel direct, visible (surtout sur mobile) */
.footer-tel {
    display: inline-block;
    background: var(--rivers-terracotta);
    color: #fff;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
}
.footer-tel::before { content: "📞 "; }
.footer-tel:hover { background: var(--rivers-safran); color: #fff; }

/* ==========================================================================
   8b. Sous-menu « Carte » du menu burger (mobile uniquement)
   ========================================================================== */

/* Inerte sur desktop : seul le lien « La carte » s'affiche (voir media query). */
.nav-carte-mobile { display: none; }

.nav-section-titre {
    display: block;
    padding: 0.75rem 1.5rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rivers-sable);
    opacity: 0.7;
    cursor: default;
}

.nav-sous-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Scopé .nav-links pour l'emporter sur « .nav-links a » (spécificité). */
.nav-links .nav-sous-lien {
    display: block;
    padding: 0.6rem 1.5rem 0.6rem 2.5rem;
    color: var(--rivers-texte-clair);
    font-size: 1rem;
    text-decoration: none;
    border-left: 2px solid var(--rivers-terracotta);
    margin-left: 1.5rem;
}

.nav-links .nav-sous-lien:hover {
    color: var(--rivers-terracotta);
}

/* ==========================================================================
   9. Media queries
   ========================================================================== */

/* Mobile : nav hamburger, 1 colonne, tabs visibles */
@media (max-width: 767px) {
    #nav-toggle { display: flex; }

    .nav-links {
        position: absolute;
        top: var(--header-h);
        left: 0;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background: var(--rivers-fond-header);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    #header.nav-open .nav-links { max-height: 460px; }
    .nav-links li { border-top: 1px solid rgba(196, 168, 130, 0.15); }
    .nav-links a { display: block; padding: 1rem var(--space-md); }

    /* Bascule « Carte » : lien simple masqué, sous-menu affiché */
    .nav-carte-desktop { display: none; }
    .nav-carte-mobile { display: block; }
    .nav-sous-menu li { border-top: none; }

    .carte-tabs {
        display: flex;
        gap: 0;
        margin-bottom: 1.5rem;
        border-radius: 6px;
        overflow: hidden;
        border: 1px solid var(--rivers-bordure);
    }

    .carte-grille { grid-template-columns: 1fr; }
    .carte-colonne { display: none; }
    .carte-colonne.tab-active { display: block; }

    .contact-grille { grid-template-columns: 1fr; }

    /* Parallaxe désactivée sur mobile (background-attachment: fixed instable) */
    #histoire { background-attachment: scroll; }
}

/* Tablette : 2 colonnes */
@media (min-width: 768px) and (max-width: 1023px) {
    .carte-grille { grid-template-columns: repeat(2, 1fr); }
    .contact-grille { grid-template-columns: 1fr 1fr; }
}

/* Desktop : 3 colonnes */
@media (min-width: 1024px) {
    .carte-grille { grid-template-columns: repeat(3, 1fr); }
    .contact-grille { grid-template-columns: 1fr 1fr; }
}

/* Accessibilité : mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition-duration: 0s !important;
        animation-duration: 0s !important;
        scroll-behavior: auto !important;
    }
}

/* ── Bouton Partager sur les cartes plats ────────── */

.btn-partager {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: var(--space-xs);
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-family: var(--font-body);
    color: var(--rivers-texte-doux);
    background: transparent;
    border: 1px solid var(--rivers-bordure);
    border-radius: 3px;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.btn-partager:hover {
    color: var(--rivers-terracotta);
    border-color: var(--rivers-terracotta);
}

/* ── Modale partage RS ───────────────────────────── */

.modale-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 13, 11, 0.75);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modale-overlay[hidden] {
    display: none;
}

.modale-contenu {
    background: var(--rivers-fond-carte, #FFFCF8);
    border-radius: 6px;
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.modale-titre {
    font-family: var(--font-section);
    font-size: 1.4rem;
    color: var(--rivers-texte);
    margin-bottom: 1.2rem;
}

.modale-spinner {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--rivers-texte-doux);
    font-size: 0.9rem;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--rivers-bordure);
    border-top-color: var(--rivers-terracotta);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 0.4rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modale-textarea {
    width: 100%;
    padding: 0.85rem;
    border: 1px solid var(--rivers-bordure);
    border-radius: 3px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--rivers-texte);
    background: #fff;
    resize: vertical;
    line-height: 1.6;
}

.modale-textarea:focus {
    outline: none;
    border-color: var(--rivers-terracotta);
}

.modale-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn-share {
    flex: 1;
    padding: 0.75rem 1.2rem;
    background: var(--rivers-terracotta);
    color: #fff;
    border: none;
    border-radius: 3px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-share:hover {
    background: var(--rivers-safran);
}

.btn-copier {
    flex: 1;
    padding: 0.75rem 1.2rem;
    background: transparent;
    color: var(--rivers-texte);
    border: 1px solid var(--rivers-bordure);
    border-radius: 3px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.btn-copier:hover {
    border-color: var(--rivers-terracotta);
    color: var(--rivers-terracotta);
}

.modale-fermer {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    color: var(--rivers-texte-doux);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    transition: color 0.15s ease;
}

.modale-fermer:hover {
    color: var(--rivers-terracotta);
}

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