/* ==========================================================================
   La Ressource - Feuille de style principale
   v2 - 2026 : refonte mobile (navigation, typographie fluide, grilles photos)
   ========================================================================== */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 100%; /* 16px : ne jamais réduire sous 16px (zoom auto iOS) */
    line-height: 1.6;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Lato', 'Quicksand', sans-serif;
    color: #2c2c2c;
    background: #ffffff;
    min-height: 100vh;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Logo-based Color Palette */
:root {
    --primary-brown: #8a5a30;           /* Brun du logo, assombri pour le contraste AA */
    --primary-brown-light: #A47044;     /* Brun d'origine, usages décoratifs */
    --secondary-blue: #4a7ba7;          /* Bleu complémentaire, contraste AA sur blanc */
    --text-dark: #2c2c2c;
    --text-white: #ffffff;
    --bg-white: #ffffff;
    --bg-light: #fafafa;
    --bg-warm: #f8f6f4;
    --border-light: #e8e8e8;
    --shadow: rgba(164, 112, 68, 0.1);
    --tap-target: 2.75rem;              /* 44px : cible tactile minimale */
    --call-bar-height: 0rem;            /* surchargé sur mobile */
}

/* Typography - fluide, sans point de rupture brutal */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary-brown);
    font-family: 'Segoe UI', 'Roboto', 'Lato', sans-serif;
}

h1 { font-size: clamp(1.75rem, 1.35rem + 2vw, 2.25rem); font-weight: 700; }
h2 {
    font-size: clamp(1.375rem, 1.15rem + 1.1vw, 1.875rem);
    border-bottom: 2px solid var(--primary-brown);
    padding-bottom: 0.5rem;
}
h3 { font-size: clamp(1.2rem, 1.1rem + 0.5vw, 1.5rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1.25rem;
    line-height: 1.7;
    color: var(--text-dark);
}

ul, ol { padding-left: 1.25rem; }
li { margin-bottom: 0.5rem; }

/* Links */
a {
    color: var(--primary-brown);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

a:hover, a:focus {
    color: var(--secondary-blue);
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary-brown);
    outline-offset: 2px;
}

/* Container and Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    background: var(--bg-white);
    box-shadow: 0 2px 8px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border-light);
}

.logo {
    text-align: center;
    padding: 1.5rem 0;
    background: var(--bg-warm);
}

.logo img {
    max-width: 100%;
    height: auto;
    max-height: 100px;
}

/* ==========================================================================
   Navigation
   .nav est positionné : c'est lui qui sert de référence au bouton burger.
   ========================================================================== */
.nav {
    position: relative;
    background: var(--primary-brown);
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.nav-item {
    position: relative;
    margin: 0;
}

.nav-link {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.active {
    background: var(--secondary-blue);
    color: var(--text-white);
    text-decoration: none;
}

/* Bouton burger - masqué au-dessus de 768px */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    min-height: var(--tap-target);
    background: none;
    border: none;
    color: var(--text-white);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 0;
    cursor: pointer;
}

.mobile-menu-toggle .burger-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.mobile-menu-toggle[aria-expanded="true"] .burger-icon::before { content: "\2715"; }
.mobile-menu-toggle[aria-expanded="false"] .burger-icon::before { content: "\2630"; }

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb {
    background: var(--bg-white);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;        /* évite le débordement horizontal sur petit écran */
    align-items: center;
    margin: 0;
    padding: 0;
}

.breadcrumb li {
    font-size: 0.9rem;
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 0;
}

.breadcrumb li:not(:last-child)::after {
    content: "\2192";
    margin: 0 0.75rem;
    color: var(--primary-brown);
    font-weight: bold;
}

.breadcrumb a { color: var(--primary-brown); font-weight: 600; }
.breadcrumb a:hover { color: var(--secondary-blue); }
.breadcrumb li[aria-current="page"] { color: var(--text-dark); font-weight: 600; }

/* ==========================================================================
   Main content
   ========================================================================== */
.main {
    min-height: 60vh;
    min-height: 60dvh;      /* dvh : tient compte de la barre d'URL mobile */
    padding: 2rem 0;
    background: var(--bg-white);
}

.content {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px var(--shadow);
    border: 1px solid var(--border-light);
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.img-center { display: block; margin: 1.5rem auto; }
.img-responsive { width: 100%; height: auto; }

figure { margin-bottom: 1.5rem; }

/* Grille photos - manquait entièrement en v1 */
.photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
    gap: 1.25rem;
    align-items: start;
}

.photos-grid figure { margin-bottom: 0; }

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 8px;
    box-shadow: 0 3px 10px var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.card-header { padding: 1.5rem; background: var(--primary-brown); color: var(--text-white); }
.card-header h3 { color: var(--text-white); margin-bottom: 0; font-size: 1.2rem; font-weight: 600; }
.card-body { padding: 1.5rem; color: var(--text-dark); }
.card-footer { padding: 1rem 1.5rem; background: var(--bg-light); border-top: 1px solid var(--border-light); color: var(--text-dark); }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-info {
    background: var(--bg-warm);
    color: var(--text-dark);
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
    border: 2px solid var(--primary-brown);
    text-align: center;
}

.contact-info h3 { color: var(--primary-brown); margin-bottom: 1.5rem; }
.contact-info p { color: var(--text-dark); font-weight: 500; }
.contact-info a { color: var(--primary-brown); font-weight: 600; }

.phone-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tap-target);
    background: var(--primary-brown) !important;
    color: var(--text-white) !important;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    margin: 0.5rem;
    white-space: nowrap;
    transition: background-color 0.2s ease;
    text-decoration: none !important;
    border-bottom: none !important;
}

.phone-link:hover,
.phone-link:focus {
    background: var(--secondary-blue) !important;
    color: var(--text-white) !important;
    text-decoration: none !important;
}

/* Barre d'appel fixe - visible uniquement sur mobile */
.call-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: var(--primary-brown);
    padding: 0.5rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.call-bar-inner {
    display: flex;
    gap: 0.5rem;
    max-width: 30rem;
    margin: 0 auto;
}

.call-bar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: var(--tap-target);
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    background: var(--bg-white);
    color: var(--primary-brown);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
    text-decoration: none;
}

.call-bar a .call-bar-name {
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0.8;
}

/* Quote */
.quote {
    font-style: italic;
    font-size: 1.1rem;
    color: var(--primary-brown);
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--bg-warm);
    border-left: 4px solid var(--primary-brown);
    border-radius: 0 8px 8px 0;
}

.quote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 600;
    font-style: normal;
}

/* Footer */
.footer {
    background: var(--primary-brown);
    color: var(--text-white);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    padding-bottom: calc(2rem + var(--call-bar-height));
}

.footer p { color: var(--text-white); margin-bottom: 0.5rem; }
.footer a { color: var(--text-white); font-weight: 500; }
.footer a:hover { color: var(--text-white); text-decoration: underline; }

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 6px;
    background: var(--primary-brown);
    color: var(--text-white);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1200;
    font-weight: 600;
}

.skip-link:focus { top: 6px; }

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --primary-brown: #6b3f18;
        --secondary-blue: #14406b;
        --text-dark: #000000;
        --bg-white: #ffffff;
        --border-light: #000000;
    }
    .content { border: 2px solid #000000; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
}

/* ==========================================================================
   Responsive - jusqu'à 768px
   ========================================================================== */
@media (max-width: 768px) {
    :root { --call-bar-height: 3.75rem; }

    .container { padding: 0 1rem; }

    /* Le header ne colle plus : il mangeait un tiers de l'écran sur mobile */
    .header { position: static; }

    .logo { padding: 1rem 0; }
    .logo img { max-height: 64px; }

    /* Le burger occupe toute la barre brune : elle reste visible menu fermé */
    .mobile-menu-toggle { display: flex; }

    .nav-list {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.25);
    }

    .nav-list.active { display: flex; }

    .nav-link {
        min-height: var(--tap-target);
        display: flex;
        align-items: center;
        padding: 0.875rem 0.5rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    }

    .nav-item:last-child .nav-link { border-bottom: none; }

    .content { padding: 1.5rem; }
    .contact-info { padding: 1.25rem; margin: 1.5rem 0; }
    .quote { padding: 1.25rem; font-size: 1.05rem; }

    .phone-link { display: flex; margin: 0.5rem 0; }

    .call-bar { display: block; }

    /* espace pour ne pas masquer la fin de page sous la barre d'appel */
    body { padding-bottom: var(--call-bar-height); }

    .breadcrumb li:not(:last-child)::after { margin: 0 0.5rem; }
}

/* ==========================================================================
   Responsive - jusqu'à 480px
   ========================================================================== */
@media (max-width: 480px) {
    .container { padding: 0 0.75rem; }
    .content { padding: 1.25rem; }
    .logo img { max-height: 56px; }
    .photos-grid { gap: 1rem; }
}

/* Print Styles */
@media print {
    .nav,
    .mobile-menu-toggle,
    .breadcrumb,
    .call-bar,
    .skip-link {
        display: none !important;
    }

    .header { position: static; }
    .content { box-shadow: none; border: 1px solid #ddd; }
    .footer { background: none; color: #000; padding-bottom: 2rem; }
    a { color: #000; text-decoration: underline; }
}
