
/* ========================================================================
   FICHIER : css/jeansam.css
   PROJET : Refonte jeansamracine.ch (Mobile First, Flexbox, Slicknav)
   DERNIÈRE MÀJ : Session de refonte complète
   ======================================================================== */

/* ========================================================================
   1. VARIABLES & RESET
   ======================================================================== */
:root {
    --font-main: 'Roboto', sans-serif;
    --font-title: 'Oswald', sans-serif;
    --font-hand: 'Amatic SC', cursive;
    
    --color-bg: #000000;
    --color-content-bg: #f4f4f4d8;
    --color-text: #333333;
    --color-white: #ffffff;
    --color-accent: #FDCB68;
    --color-link: #777777;
    --color-menumot: #b5b5b5;
    --color-link-hover: #000000;
    
    --border-frame: 10px solid transparent;
    --spacing-unit: 1rem;
}

/* Reset basique */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    background-color: var(--color-bg);
    font-family: var(--font-main);
    color: var(--color-text);
    line-height: 1.6;
    
    /* Image de fond gérée uniquement en Desktop (voir Media Queries) */
    background-image: none; 
    background-repeat: no-repeat;
    background-position: left top;
    background-size: contain;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease, background-color 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================================================
   2. TYPOGRAPHIE GLOBALE
   ======================================================================== */
h1, h2, h3 {
    margin-bottom: 0.5em;
    line-height: 1.2;
}

h1 {
    font-family: var(--font-title);
    font-weight: normal;
    text-transform: uppercase;
}

h2 {
    font-family: var(--font-main);
    font-weight: bold;
}

/* ========================================================================
   3. HEADER & NAVIGATION (DESKTOP PAR DÉFAUT)
   ======================================================================== */
#main-header {
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 1rem 0;
    width: 100%;
    position: relative;
    z-index: 100;
}

.header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Logo : Caché sur mobile par défaut, affiché via Media Query Desktop */
#main-header #logo-area {
    display: none;
}

#logo-area h1 {
    font-family: var(--font-title);
    font-variant-caps: petite-caps;
    font-size: 2.5rem;
    color: #fff;
    margin: 0;
    line-height: 1.1;
    text-transform: none;
}

#logo-area h2 {
    font-family: var(--font-hand);
    font-size: 1.2rem;
    color: #ccc;
    margin: 0.5rem 0 1rem 0;
}

/* Navigation Principale (Menu Horizontal) */
#main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

#main-nav a {
    font-family: var(--font-title);
    text-transform: uppercase;
    font-size: 1rem;
    color: #fff;
    letter-spacing: 1px;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
}

#main-nav a:hover, 
#main-nav a.active {
    border-bottom-color: var(--color-accent);
    color: var(--color-accent);
}

/* ========================================================================
   4. LAYOUT GÉNÉRAL (#page)
   ======================================================================== */
#page {
    max-width: 1300px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

#body-layout {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
}

/* ========================================================================
   5. SIDEBAR (Mots-clés & Recherche)
   ======================================================================== */
#sidebar-keywords {
    width: 100%;
    flex-shrink: 0;
}

#menu-mots-cles {
    list-style: none;
    padding: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#menu-mots-cles li {
    margin: 0;
    line-height: 1em;
}

#menu-mots-cles a {
    font-family: var(--font-title);
    text-transform: capitalize;
    font-size: 1em;
    color: var(--color-menumot);
}

#menu-mots-cles a:hover, 
#menu-mots-cles a.menuActif, 
#menu-mots-cles a.menuActifDetail {
    background: var(--color-accent);
    color: #000;
}

#menu-mots-cles form {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* Champs de recherche (Spécificité augmentée pour écraser natives.css) */
#menu-mots-cles form .inputnav,
input.inputnav {
    width: 80%;
    height: 36px;
    font-family: var(--font-hand);
    font-size: 1.5em;
    color: #AAA;
    text-align: center;
    background-color: #F1E8F9;
    box-shadow: 0 0 0 0px #333 inset;
    border: solid 2px #AF87BC;
    border-radius: 5px;
    padding: 0 5px; 
}

#menu-mots-cles form .submitnav,
input.submitnav {
    width: 15%;
    height: 36px;
    font-family: var(--font-hand);
    background-color: #FFFFFF;
    border: solid 2px #AAA;
    border-radius: 5px;
    color: #333;
    font-size: 1.5em;
    padding: 0;
    cursor: pointer;
}

#menu-mots-cles form .submitnav:hover {
    background-color: #AF87BC;
    color: #FFF;
}

/* ========================================================================
   6. CONTENU PRINCIPAL & FOOTER
   ======================================================================== */
#content-area {
    flex: 1;
    min-width: 0;
}

#contenucadre {
    background-color: var(--color-content-bg);
    border: var(--border-frame);
    border-image-source: url('../galeries/cadre.png');
    border-image-slice: 20;
    border-image-repeat: repeat;
    padding: 0.5rem;
    min-height: 60vh;
}

#main-footer {
    background: #111;
    color: #777;
    text-align: center;
    padding: 2rem 1rem;
    font-size: 0.9rem;
    border-top: 3px solid var(--color-accent);
}

#main-footer a {
    color: #aaa;
    margin: 0 0.5rem;
}

#main-footer a:hover {
    color: #fff;
}

/* ========================================================================
   7. COMPOSANTS : LISTE PROJETS (Chronologie)
   ======================================================================== */
.recherche {
    margin-bottom: 2rem;
}

.recherche-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

/* --- Bannière Mobile/Tablette (Background Image) --- */
.img_baniere {
    display: block;
    width: 100%;
    height: 90px; /* Hauteur Mobile par défaut */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    flex-shrink: 0;
    border: none;
    margin: 10px 0;
}

/* Cadre décoratif extérieur (Pseudo-élément) */
.img_baniere::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 10px solid transparent;
    border-image-source: url('../galeries/cadre.png');
    border-image-slice: 20;
    border-image-repeat: repeat;
    z-index: 1;
    pointer-events: none;
}

/* Image Classique (Desktop uniquement) */
.img_projet {
    display: none;
    width: 250px;
    height: auto;
    object-fit: cover;
    border: var(--border-frame);
    border-image-source: url('../galeries/cadre.png');
    border-image-slice: 20;
    border-image-repeat: repeat;
    flex-shrink: 0;
}

/* Titres */
.recherche-titres {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recherche h1 {
    font-size: 1.5rem;
    color: var(--color-text);
    text-transform: none;
    font-family: var(--font-title);
    font-weight: normal;
    margin: 0;
}

.recherche h2 {
    font-size: 1rem;
    margin: 0.5rem 0 0 0;
    font-family: var(--font-main);
    color: var(--color-text);
    opacity: 0.8;
    font-weight: bold;
    text-transform: none;
}

.recherche .debut {
    text-align: justify;
    font-size: 0.95rem;
}

a.lienrecherche:hover .recherche h1 {
    color: var(--color-white);
    text-shadow: 1px 1px 3px #000;
}

/* Pagination */
.nobasdepage {
    text-align: center;
    margin-top: 2rem;
    font-size: 1.1rem;
}

.nobasdepage a {
    color: var(--color-link);
    margin: 0 0.2rem;
    padding: 0.2rem 0.5rem;
}

.nobasdepage a:hover {
    background-color: var(--color-accent);
    color: var(--color-link-hover);
}

.nobasdepage a.nopage {
    font-weight: bold;
    color: #000;
}

/* ========================================================================
   8. COMPOSANTS : DÉTAIL, GALERIE & CONTACT
   ======================================================================== */
.imgtexte {
    margin: 1rem 0;
    text-align: center;
}

.imgtexte img {
    cursor: zoom-in;
    border: var(--border-frame);
    border-image-source: url('../galeries/cadre.png');
    border-image-slice: 20;
    border-image-repeat: repeat;
    max-width: 100%;
}

.legendeimg {
    text-align: center;
    font-style: italic;
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.5rem;
}

.iframing {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin: 1rem 0;
}

.iframing iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: var(--border-frame);
    border-image-source: url('../galeries/cadre.png');
    border-image-slice: 20;
    border-image-repeat: repeat;
}

/* Zoom Lightbox */
.view_image_body {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.9);
    z-index: 9999;
    display: none;
}
.view_image_body.active {
    display: block;
}

.view_image {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.view_image_img {
    max-width: 95%;
    max-height: 95%;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

/* Formulaire de Contact */
#contact label {
    font-family: var(--font-hand);
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

#contact input, 
#contact textarea {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 2px solid #aaa;
    border-radius: 4px;
    background-color: transparent;
    font-family: var(--font-main);
}

#contact textarea {
    height: 200px;
    resize: vertical;
}

#contact .submit {
    background-color: #990000;
    color: #fff;
    width: 100%;
    padding: 1rem;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#contact .submit:hover {
    background-color: #0A4366;
}

#captcha {
    background-color: #FDCB68;
    border: 2px solid #EFA003;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    background-image: url('images/robot.png');
    background-repeat: no-repeat;
    background-position: right center;
}

/* Style pour le lecteur audio */
.audioplayer audio {
    width: 100%;
    max-width: 400px;
    border: 2px solid #333;
    border-radius: 4px;
    background: #000;
}
/* Personnalisation Webkit (Chrome/Safari) si tu veux aller plus loin */
.audioplayer audio::-webkit-media-controls-panel {
    background-color: #f4f4f4;
}

/* Conteneur responsive pour les vidéos (16:9) */
.video-wrapper {
    position: relative;
    width: 100%;
    /* Ratio 16/9 = 56.25% */
    padding-bottom: 56.25%; 
    height: 0;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: #000;
    border-radius: 4px;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Support moderne pour les navigateurs récents (aspect-ratio) */
@supports (aspect-ratio: 16 / 9) {
    .video-wrapper {
        padding-bottom: 0;
        aspect-ratio: 16 / 9;
        height: auto;
    }
}

/* ========================================================================
   9. GESTION DU MENU MOBILE (SLICKNAV)
   ======================================================================== */

/* --- A. CONFIGURATION GLOBALE & CONTENEURS --- */

/* Sur Mobile : On cache le menu Desktop natif et la sidebar */
@media (max-width: 767px) {
    #main-nav {
        display: none;
    }
    #sidebar-keywords {
        display: none;
    }
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Conteneur principal Slicknav */
.slicknav_menu {
    font-size: 20px;
    background: transparent;
    padding: 0;
    display: block;
}

/* Le Menu Déroulant (Fond noir) */
.slicknav_nav {
    background: rgba(0, 0, 0, 0.95);
    border-radius: 0 0 8px 8px;
    margin-top: 0;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #333;
}

/* --- B. LE BOUTON BURGER (LOGO + ICÔNE) --- */

/* Conteneur du bouton : Flexbox pour aligner Logo (gauche) et Burger (droite) */
.slicknav_btn {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center;
    width: 100%;
    background-color: transparent;
    padding: 10px 15px;
    margin: 0;
    border: none;
    position: relative;
}

/* Le Label (Logo intégré dans le bouton) */
.slicknav_menu .slicknav_menutxt {
    width: 90%; /* Laisse de la place pour l'icône */
}

.slicknav_menu .slicknav_menutxt h1 {
    display: block;
    font-family: var(--font-title);
    font-variant-caps: petite-caps;
    font-size: 2.5rem;
    color: #fff;
    margin: 0;
    line-height: 1.1;
    text-transform: none;
    text-align: left;
}

.slicknav_menu .slicknav_menutxt h2 {
    font-family: var(--font-hand);
    font-size: 1.2rem;
    color: #ccc;
    margin: 0.5rem 0 0 0;
    display: block;
}

/* L'icône Burger (Les 3 barres) */
.slicknav_menu .slicknav_icon {
    position: static !important;
    display: block;
    width: 30px;
    height: 20px;
    margin: 12px;
    padding: 0;
    background: transparent;
    flex-shrink: 0;
}

.slicknav_menu .slicknav_icon::before {
    position: static !important;
    display: block;
    content: "";
    width: 100%;
    height: 100%;
    background: transparent;
    margin: -18px 0; /* Ajustement spécifique selon ta config */
}

.slicknav_menu .slicknav_icon-bar {
    display: block !important;
    width: 100% !important;
    height: 3px !important;
    background-color: #fff !important;
    margin: 4px 0 !important;
    border-radius: 2px;
    position: static !important;
    box-shadow: none;
}

/* --- C. CONTENU DU MENU (LIENS & FLECHES) --- */

/* Liens du menu */
.slicknav_nav a {
    font-family: var(--font-title);
    text-transform: uppercase;
    color: #fff;
    padding: 12px 20px;
    border-bottom: 1px solid #333;
    font-size: 1rem;
}

/* Sous-menu (Mots-clés) */
.slicknav_nav .slicknav_nested {
    background: rgba(255, 255, 255, 0.05);
    padding-left: 10px;
}

.slicknav_nav .mobile-keyword-item a {
    font-family: var(--font-main);
    text-transform: capitalize;
    font-size: 0.95rem;
    color: var(--color-menumot);
    border-bottom: 1px dashed #444;
}

/* États Actifs et Survol */
.slicknav_nav a:hover,
.slicknav_nav .slicknav_row:hover {
    background: #333;
    color: var(--color-accent);
}

.slicknav_nav a.menuActif,
.slicknav_nav a.menuActifDetail {
    background: var(--color-accent);
    color: #000;
    font-weight: bold;
}

/* Gestion des flèches d'ouverture (Ajustements pour éviter l'écrasement) */
.slicknav_nav .slicknav_row {
    line-height: 1.5 !important;
    min-height: 2.5em;
    display: flex;
    align-items: center;
}

.slicknav_arrow {
    color: var(--color-accent);
    font-size: 1.8em !important;
    margin: 0 0 0 1.4em !important;
    display: inline-block !important;
    line-height: 2rem !important;
    vertical-align: middle;
    height: auto !important;
    transform: none !important;
}

.slicknav_nav .slicknav_parent > a, 
.slicknav_nav .slicknav_parent .slicknav_row {
    padding-right: 10px;
}

/* ========================================================================
   10. MEDIA QUERIES (TABLETTE, DESKTOP & GRAND ÉCRAN)
   ======================================================================== */

/* --- TABLETTE & DESKTOP (≥ 768px) --- */
@media (min-width: 768px) {
    
    /* 1. Fond d'écran */
    html, body {
        background-image: url('images/background-1920.jpg');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: left 150px;
        background-attachment: fixed;
    }

    /* 2. Header & Logo */
    #main-header #logo-area {
        display: block !important; /* Réaffiche le logo original */
    }
    
    .header-inner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    
    #logo-area { text-align: left; }
    #logo-area h1 { font-size: 4rem; }
    #logo-area h2 { font-size: 1.8rem; margin: 0; }
    
    /* 3. Navigation Desktop */
    #main-nav { display: block; }
    
    /* 4. Cacher Slicknav et éléments mobiles */
    .slicknav_menu {
        display: none !important;
    }
    .slicknav-mobile-only {
        display: none;
    }

    /* 5. Layout Sidebar */
    #body-layout {
        flex-direction: row;
        align-items: flex-start;
    }
    #sidebar-keywords {
        width: 280px;
        position: sticky;
        top: 1rem;
        display: block; /* Réaffiche la sidebar */
    }
    #menu-mots-cles {
        flex-direction: row;
        flex-wrap: wrap;
    }
    #menu-mots-cles form {
        flex-direction: row;
    }

    /* 6. Ajustement Bannière (Hauteur intermédiaire) */
    .img_baniere {
        height: 140px;
    }
    .recherche h1 { font-size: 2rem; }
    .recherche h2 { font-size: 1rem; }
}

/* --- DESKTOP LARGE (≥ 1024px) --- */
@media (min-width: 1024px) {
    #logo-area h1 { font-size: 4rem; }
    #contenucadre { padding: 1rem; }

    /* Layout Projets : Image classique à gauche */
    .recherche-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.5rem;
    }

    /* Bascule d'affichage : On cache la bannière, on montre l'image */
    .img_baniere {
        display: none;
    }
    .img_projet {
        display: block;
        width: 250px;
        height: auto;
        margin: 0;
    }

    .recherche-titres {
        padding-top: 0.5rem;
    }
    .recherche h1 { font-size: 2.5em; }
    .recherche h2 { font-size: 1.2rem; }
    
    .recherche .debut {
        width: 100%;
        text-align: justify;
        margin-top: 1rem;
        clear: both;
    }
}

/* --- GRAND ÉCRAN & 4K (≥ 1920px) --- */
@media (min-width: 1920px) {
    html, body {
        background-size: cover;
        background-position: center top;
        background-attachment: fixed;
    }
    #page {
        max-width: 1600px;
    }
}

/* ========================================================================
   11. UTILITAIRES
   ======================================================================== */
.clear {
    clear: both;
}

.uppercase {
    text-transform: uppercase;
}

.imgGauche { float: left; margin-right: 1rem; }
.imgDroit { float: right; margin-left: 1rem; }