/* Reset CSS pour une présentation uniforme à travers différents navigateurs */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Styles généraux pour le corps de la page */
body {
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #333;
    background-color: #fefefe;
    line-height: 1.6;
}

/* ===============================================
   HEADER ET NAVIGATION
   =============================================== */

/* Header institutionnel */
.header {
    background: #2d4a3a;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
}

/* Navigation principale */
.nav-main {
    background: #2d4a3a;
    padding: 0;
    width: 100%;
    order: 2;
}

.nav-links {
    display: flex;
    list-style: none;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    flex-direction: row;
}

.nav-links li {
    border-right: 1px solid #4a7c59;
    padding: 0;
    margin: 0;
    position: relative;
}

.nav-links li:last-child {
    border-right: none;
}

.nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: #4a7c59;
}

/* Menu déroulant */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #2d4a3a;
    min-width: 220px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1001;
    top: 100%;
    left: 0;
    border-top: 2px solid #4a7c59;
}

.dropdown-content a {
    color: #ecf0f1;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-weight: normal;
    border-bottom: 1px solid #4a7c59;
    font-size: 0.9rem;
}

.dropdown-content a:hover {
    background-color: #4a7c59;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Indicateur de menu déroulant */
.dropdown > a::after {
    content: ' ▾';
    font-size: 0.8em;
    margin-left: 5px;
}

/* Hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 30px;
    cursor: pointer;
    padding: 1rem;
    order: 1;
}

/* Lien utilitaires */
.util-link {
    position: absolute;
    top: 5px;
    right: 10px;
    color: #8fa8a3;
    text-decoration: none;
    font-size: 1.5em;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    z-index: 101;
}

.util-link:hover {
    opacity: 1;
    color: #b8d1cc;
}

/* ===============================================
   HERO SECTION
   =============================================== */

.hero-patrimoine {
    position: relative;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)),
                url('https://moulin.bazoncourt.net/images/moulin_2_maisons_avant.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    color: #FEFEFE;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    opacity: 0.9;
    text-align: center;
}

.hero-subtitle p {
    text-align: center;
}

.hero-period {
    font-size: 1.1rem;
    opacity: 0.8;
    font-style: italic;
    text-align: center;
}

/* ===============================================
   CONTENU PRINCIPAL
   =============================================== */

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.content-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.article-main {
    background: white;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-left: 4px solid #4a7c59;
}

.article-title {
    font-size: 1.8rem;
    color: #2d4a3a;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 0.5rem;
}

.article-text {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* ===============================================
   SIDEBAR
   =============================================== */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.info-box {
    background: white;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.info-box-header {
    background: #2d4a3a;
    color: white;
    padding: 1rem;
    font-weight: bold;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-box-content {
    padding: 1.5rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.info-label {
    font-weight: bold;
    color: #666;
}

.info-value {
    color: #4a7c59;
    font-weight: bold;
}

/* ===============================================
   GALERIE ET IMAGES
   =============================================== */

.main-image {
    margin: 2rem 0;
    text-align: center;
}

.main-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.image-caption {
    background: #f8f8f8;
    padding: 1rem;
    font-style: italic;
    color: #666;
    border: 1px solid #ddd;
    border-top: none;
    font-size: 0.9rem;
}

.heritage-gallery {
    margin-top: 3rem;
}

.gallery-title {
    font-size: 1.5rem;
    color: #2d4a3a;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #4a7c59;
    padding-bottom: 0.5rem;
}

.gallery-grid,
.especes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.especes {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.gallery-item,
.espece {
    background: white;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover,
.espece:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.gallery-item img,
.espece img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-bottom: 1px solid #e0e0e0;
}

.espece,
.espece img {
    min-width: 200px;
    max-width: 200px;
}

.gallery-item-content {
    padding: 1rem;
}

.gallery-item-title {
    font-weight: bold;
    color: #2d4a3a;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.gallery-item-desc {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Galerie traditionnelle */
.gallery {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
}

.gallery div {
    display: flex;
    flex-direction: column;
    margin: 10px;
}

.gallery img {
    border: solid 1px;
    margin: 0;
    padding: 0;
}

.gallery img:hover {
    opacity: 0.8;
}

/* Images cliquables pour diaporama */
img[id^="img-"] {
    cursor: pointer;
}

/* ===============================================
   ÉLÉMENTS FLOTTANTS
   =============================================== */

.float-l,
.float-r {
    clear: both;
    line-height: 1;
    width: 400px;
    margin-bottom: 15px;
    padding: 0;
}

div.float-l,
div.float-r {
    margin-bottom: 10px;
    margin-top: 10px;
}

.float-l img,
.float-r img {
    border: solid 1px;
    margin: 0;
    padding: 0;
}

.float-l {
    float: left;
    margin-right: 15px;
    margin-left: 30px;
}

.float-r {
    float: right;
    margin-left: 15px;
}

.legende {
    margin: 0;
    padding: 0;
    font-style: italic;
    width: 100%;
    text-align: center;
    overflow: hidden;
    background-color: rgba(233, 233, 233, 0.7);
    border: solid 1px;
    border-top: 0;
    font-size: 0.8em;
    position: relative;
    top: -3px;
}

/* Classes de largeur et hauteur */
.w100 {width: 100px;}
.w120 {width: 120px;}
.w130 {width: 130px;}
.w140 {width: 140px;}
.w150 {width: 150px;}
.w200 {width: 200px;}
.w250 {width: 250px;}
.w300 {width: 300px;}
.w350 {width: 350px;}
.w400 {width: 400px;}
.w450 {width: 450px;}
.w500 {width: 500px;}
.w550 {width: 550px;}
.w600 {width: 600px;}
.w650 {width: 650px;}
.w700 {width: 700px;}

.h100 {height: 100px;}
.h150 {height: 150px;}
.h200 {height: 200px;}
.h250 {height: 250px;}
.h300 {height: 300px;}
.h350 {height: 350px;}
.h400 {height: 400px;}
.h450 {height: 450px;}
.h500 {height: 500px;}
.h550 {height: 550px;}
.h600 {height: 600px;}
.h650 {height: 650px;}
.h700 {height: 700px;}

/* ===============================================
   TYPOGRAPHIE ET TITRES
   =============================================== */

h1 {
    color: #35424a;
    margin-bottom: 1rem;
}

.header h1 {
    margin: 0;
}

h2,
h3 {
    color: #35424a;
}

h2 {
    border-bottom: 3px solid #35424a;
    padding-bottom: 5px;
    margin-bottom: 20px;
}

h3 {
    margin-top: 30px;
    margin-bottom: 10px;
}

ol {
    margin: 10px 0 10px 40px;
}

ul {
    list-style-type: disc;
    margin: 10px 0 10px 20px;
}

li {
    margin-bottom: 10px;
}

p {
    margin-bottom: 20px;
    margin-left: 30px;
    text-align: justify;
    hyphens: auto;
    line-height: 1.6;
}

a {
    text-decoration: none;
}

/* ===============================================
   LIENS EXTERNES
   =============================================== */

a.external-link {
    position: relative;
    text-decoration: none;
    color: #0056b3;
    font-weight: bold;
    font-style: italic;
}

a.external-link::after {
    content: '\2197';
    display: inline-block;
    margin-left: 5px;
    color: #FFA500;
    font-size: 1em;
}

a.external-link:hover {
    color: #FFA500;
}

/* ===============================================
   BOUTONS
   =============================================== */

.btn-patrimoine {
    display: inline-block;
    background: #4a7c59;
    color: white;
    padding: 0.8rem 2rem;
    text-decoration: none;
    font-weight: bold;
    border-radius: 3px;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.btn-patrimoine:hover {
    background: #2d4a3a;
}

.btn-secondary {
    background: #2d4a3a;
}

.btn-secondary:hover {
    background: #1a2e22;
}

.btn-period {
    display: inline-block;
    background: #4A7C59;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.btn-period:hover {
    background: #35424a;
}

button {
    background-color: #ddd6cd;
    color: #593d2b;
    border: none;
    cursor: pointer;
    padding: 10px;
    text-align: center;
    width: 100%;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #c6bfb6;
    text-decoration: none;
}

/* ===============================================
   TABLEAUX
   =============================================== */

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border: 1px solid black;
    padding: 2px;
    text-align: left;
}

th {
    background-color: #555;
    color: white;
}

tr:nth-child(even) {
    background-color: #f4f4f4;
}

tr:nth-child(odd) {
    background-color: white;
}

.t-meunier {
    width: 600px;
}

.t-meunier,
.t-meunier tr,
.t-meunier td {
    padding: 2px 20px;
    margin-top: 0px;
}

/* ===============================================
   ÉLÉMENTS DÉPLIANTS
   =============================================== */

.store {
    display: flex;
    flex-direction: column;
    margin: 10px 0 5px 30px;
    border: 2px solid #806b58;
    box-shadow: 0px 4px 8px rgba(0,0,0,0.15);
    background-color: #faf8f0;
}

.store .content {
    position: relative;
    font-size: 16px;
    line-height: 1.2;
    max-height: 120px;
    overflow: hidden;
    padding: 20px 20px 40px 20px;
    transition: max-height 0.5s ease;
    background-image: url('https://moulin.bazoncourt.net/histoire/images/vieux_papier.jpg');
    color: #604e44;
}

.store .content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #faf8f0 100%);
}

.store .content.show {
    max-height: 500px;
}

.store .content.show::after {
    display: none;
}

.proprio {
    margin: 10px 30px;
    background-color: #f8f8f8;
    padding: 6px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    display: inline-block;
    width: auto;
}

.proprio p {
    margin-bottom: 0;
}

/* ===============================================
   SOURCES ET RÉFÉRENCES
   =============================================== */

.sources {
    font-size: 0.9em;
    margin-top: 0px;
    font-style: italic;
}

references {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
}

reference {
    line-height: 1.2;
    background-color: #f4f4f4;
    margin: 5px 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-width: 260px;
    max-width: 260px;
}

reference.full-width {
    min-width: 100%;
    max-width: 100%;
    flex-basis: 100%;
}

titre {
    font-weight: bold;
    margin-right: 10px;
    font-size: 1em;
}

auteur {
    margin-left: 10px;
    color: #ac4419;
    font-weight: bold;
}

nom,
asso {
    margin-right: 10px;
    text-transform: uppercase;
}

date {
    margin-right: 10px;
    font-size: 1em;
    color: cadetblue;
    min-width: 90px;
}

date::after {
    content: ')';
    display: inline-block;
    margin-right: 5px;
}

date::before {
    content: '(';
    display: inline-block;
    margin-left: 5px;
}

info {
    font-size: 0.8em;
    font-style: italic;
    overflow: hidden;
    white-space: pre-wrap;
}

/* ===============================================
   PAGES D'HISTOIRE
   =============================================== */

.periods-navigation {
    margin: 3rem 0;
}

.period-card {
    background: white;
    margin: 2rem 0;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.period-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.period-card.medieval {
    border-left: 6px solid #8B4513;
}

.period-card.modern {
    border-left: 6px solid #4A7C59;
}

.period-card.contemporary {
    border-left: 6px solid #35424a;
}

.period-image img {
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.period-content {
    margin-left: 0;
}

.period-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.period-content h3 a {
    color: #35424a;
    text-decoration: none;
}

.period-content h3 a:hover {
    color: #4A7C59;
}

.period-summary {
    line-height: 1.6;
}

.period-summary p {
    margin-left: 0;
}

.period-summary ul {
    margin-left: 1.5rem;
}

.period-summary li {
    margin-bottom: 0.5rem;
}

.highlight {
    background: #fff3cd;
    padding: 0.8rem;
    border-left: 4px solid #ffc107;
    margin: 1rem 0;
    font-style: italic;
}
/* ===============================================
   DIAPORAMA
   =============================================== */

#monDiaporama {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#conteneurImageDiaporama {
    display: flex;
    max-width: 90%;
    max-height: 99%;
    min-width: 90%;
    min-height: 99%;
    margin-left: 70px;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.45);
    text-align: center;
    justify-content: center;
    z-index: 9999;
}

#imageDiaporama {
    height: auto;
    object-fit: contain;
}

.navigation {
    position: absolute;
    top: 250px;
    width: 98%;
    display: flex;
    justify-content: space-between;
    z-index: 10000;
    padding: 0 20px;
    transform: translateY(-50%);
}

.fermer {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 30px;
    color: white;
    cursor: pointer;
    z-index: 10001;
}

.precedent,
.suivant {
    font-size: 40px;
    color: white;
    cursor: pointer;
    background-color: transparent;
    border: none;
    padding: 10px;
    font-weight: bold;
    max-width: 60px;
}

.precedent:hover,
.suivant:hover,
.fermer:hover {
    opacity: 1;
    color: #f00;
    background-color: transparent;
}

.zoom-controls {
    position: absolute;
    top: 90px;
    right: 3px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgb(143 143 143 / 70%);
    padding: 10px;
    border-radius: 5px;
    z-index: 10000;
}

.zoom-in,
.zoom-out {
    color: white;
    font-size: 24px;
    cursor: pointer;
    background: transparent;
    border: none;
    outline: none;
    padding: 5px;
}

.zoom-in:hover,
.zoom-out:hover {
    color: #f00;
}

/* ===============================================
   FOOTER
   =============================================== */

.footer {
    background: #2d4a3a;
    color: #ecf0f1;
    margin-top: 4rem;
    padding: 2rem 0 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-links {
    margin-bottom: 1rem;
}

.footer-links a {
    color: #ecf0f1;
    text-decoration: none;
    margin: 0 1rem;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #4a7c59;
}

.footer-copyright {
    font-size: 0.85rem;
    opacity: 0.8;
    border-top: 1px solid #4a7c59;
    padding-top: 1rem;
    margin-top: 1rem;
}

footer p {
    background-color: #f1f1f1;
    padding: 10px 0;
    text-align: center;
    border-top: 1px solid #ccc;
    font-size: 0.8em;
    color: #666;
}

/* ===============================================
   SECTIONS GÉNÉRALES
   =============================================== */

main {
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin: 20px;
}

section {
    margin: 20px;
    clear: both;
}

.content-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
}

.paragraphe {
    flex: 3 1 60%;
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

@media (max-width: 600px) {
    main {
        padding: 2px;
        margin: 2px;
    }
    
    .content-wrapper {
        flex-direction: column;
    }
    
    .store,
    .proprio {
        width: 100%;
        margin: 0 auto;
        padding: 5px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    p {
        margin: 0;
    }
}

@media (min-width: 601px) {
    .paragraphe {
        order: 2;
    }
}

@media (max-width: 768px) {
    .header {
        justify-content: flex-start;
        align-items: center;
        padding: 10px 0;
        position: relative;
        min-height: 60px;
        flex-direction: row;
    }
    
    .hamburger {
        display: block;
        position: relative;
        order: 1;
        margin-left: 15px;
        margin-right: 0;
        padding: 8px;
        z-index: 1001;
        flex-shrink: 0;
    }
    
    .nav-main {
        width: 100%;
        order: 2;
        position: absolute;
        top: 100%;
        left: 0;
        background: #2d4a3a;
        z-index: 1000;
    }
    
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: #2d4a3a;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 0;
        margin: 0;
        max-width: none;
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .nav-links li {
        border-right: none;
        border-bottom: 1px solid #4a7c59;
        text-align: center;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .nav-links a {
        display: block;
        padding: 1rem;
        width: 100%;
        text-align: center;
        font-size: 0.95rem;
        color: #ecf0f1;
        text-decoration: none;
    }
    
    .nav-links a:hover {
        background-color: #4a7c59;
    }

    .util-link {
        top: 3px;
        right: 5px;
        font-size: 1.2em;
    }

    /* Dropdown mobile */
    .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
        background-color: #1a2e22;
        border-top: none;
        min-width: auto;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .dropdown > a::after {
        content: ' +';
    }

    .dropdown.active > a::after {
        content: ' -';
    }
}