:root {
    --primary-color: #2c3e50;
    --secondary-color: #e67e22;
    --bg-color: #fcfcfc;
    --text-color: #333333;
    --card-bg: #ffffff;
    --border-radius: 12px;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0 1rem;
}

p {
    margin-bottom: 0;
}

.navbar {
    background-color: var(--card-bg) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 1.2rem 0;
    backdrop-filter: blur(10px);
    transition: padding 0.3s ease, box-shadow 0.3s ease;
}

.navbar.navbar-scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
}

.navbar-logo {
    height: 44px;
    width: auto;
    transition: height 0.3s ease;
}

.navbar-scrolled .navbar-logo {
    height: 32px;
}

.hero-section {
    padding: 100px 0 80px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.7)),
        url('../img/hero-fenouillet.webp') center/cover no-repeat;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--primary-color);
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: #666;
    font-weight: 500;
    max-width: 800px;
    margin: 0 auto;
}

.article-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    height: 100%;
    overflow: hidden;
}

.article-card:hover {
    filter: brightness(0.8) sepia(0.3) contrast(1.1);
}

.article-card .card-body {
    padding: 2.5rem;
}

.article-date {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
}

.article-card .card-title {
    font-size: 1.5rem;
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-card .card-text {
    color: #555;
    margin-bottom: 25px;
}

.btn-read-more {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-read-more:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: scale(1.05);
}

.content-section {
    padding: 80px 0;
}

.article-content {
    background: var(--card-bg);
    padding: 4rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
}

.article-header {
    margin-bottom: 3rem;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 2rem;
}

.article-header h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.section-title {
    font-size: 2.2rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

.document-meta,
.article-content blockquote {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.transcription-box {
    font-family: 'Georgia', serif;
    background: #fffdf5;
    padding: 2rem;
    border: 1px solid #f0e6d2;
    border-radius: 8px;
    margin: 2rem 0;
    line-height: 1.8;
    color: #2c2c2c;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
}

.footer {
    background-color: var(--primary-color);
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0;
    text-align: center;
    margin-top: 4rem;
}

.footer a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer a:hover {
    color: var(--secondary-color);
}

/* Markdown Content Elements */
#markdown-content table {
    width: 100%;
    margin-bottom: 2rem;
    color: var(--text-color);
    border-collapse: collapse;
}

#markdown-content th,
#markdown-content td {
    padding: 1rem;
    vertical-align: top;
    border-top: 1px solid #dee2e6;
}

#markdown-content thead th {
    vertical-align: bottom;
    border-bottom: 2px solid #dee2e6;
    background-color: #f8f9fa;
    font-family: 'Outfit', sans-serif;
    color: var(--primary-color);
}

#markdown-content blockquote {
    background: #f8f9fa;
    padding: 1.5rem 1.5rem 1.5rem 2.5rem;
    border-radius: 0 8px 8px 0;
    border-left: 5px solid var(--secondary-color);
    margin: 2rem 0;
    font-style: italic;
    color: #555;
    position: relative;
}

#markdown-content blockquote::before {
    content: '"';
    position: absolute;
    left: 10px;
    top: -5px;
    font-size: 4rem;
    color: rgba(230, 126, 34, 0.2);
    font-family: Georgia, serif;
    line-height: 1;
}

#markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

/* Paragraphes de corps d'article : aérer les suites de paragraphes narratifs.
   Cible uniquement les enfants directs, pour ne pas toucher les blocs bilingues
   et les encadrés qui gèrent leurs propres marges. */
#markdown-content>p {
    margin-bottom: 1.15rem;
}

/* --- Frise chronologique --------------------------------------------------- */

.frise {
    --frise-puce: 16px;
    /* diamètre des puces */
    --frise-axe: 10px;
    /* abscisse du centre de l'axe et des puces */
    --frise-tete: 1.7rem;
    /* hauteur de la ligne date + titre */
    --frise-ecart: 2.6rem;
    /* espace vertical entre deux étapes */
    list-style: none;
    position: relative;
    margin: 2.5rem 0 3rem;
    padding: 0;
}

.frise-etape {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding-left: 2.6rem;
    margin-bottom: var(--frise-ecart);
}

.frise-etape:last-child {
    margin-bottom: 0;
}

/* Puce : centrée sur l'axe et sur la ligne du titre. */
.frise-etape::before {
    content: '';
    position: absolute;
    left: calc(var(--frise-axe) - var(--frise-puce) / 2);
    top: calc((var(--frise-tete) - var(--frise-puce)) / 2);
    width: var(--frise-puce);
    height: var(--frise-puce);
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--primary-color);
    box-sizing: border-box;
    z-index: 1;
}

/* Axe : un segment par étape, d'un centre de puce au suivant. */
.frise-etape::after {
    content: '';
    position: absolute;
    left: calc(var(--frise-axe) - 1px);
    top: calc(var(--frise-tete) / 2);
    width: 2px;
    height: calc(100% + var(--frise-ecart));
    background: #e9e4da;
}

.frise-etape:last-child::after {
    display: none;
}

.frise-niv-acte::before {
    background: var(--primary-color);
}

.frise-niv-source::before {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
}

.frise-niv-hypothese::before {
    border-color: #b0a99c;
    background: var(--card-bg);
}

.frise-texte {
    flex: 1 1 0;
    min-width: 0;
}

/* Date et titre sur la même ligne. */
.frise-tete {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.7rem;
    line-height: var(--frise-tete);
    margin: 0 0 0.45rem;
}

.frise-date {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--secondary-color);
    white-space: nowrap;
}

.frise-titre {
    font-size: 1.18rem;
    color: var(--primary-color);
}

.frise-corps p {
    margin-bottom: 0.7rem;
}

.frise-corps p:last-child {
    margin-bottom: 0;
}

.frise-lien {
    margin: 0.6rem 0 0;
    font-size: 0.95rem;
}

.frise-lien a::before {
    content: '→ ';
}

/* Illustration : la bannière de l'article, à droite de l'étape. */
.frise-illustration {
    flex: 0 0 200px;
    display: block;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e9e4da;
    line-height: 0;
    transition: box-shadow 0.2s ease;
}

a.frise-illustration:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

/* Sélecteur d'ID pour neutraliser la mise en forme des images d'article
   (#markdown-content img : marges, ombre et arrondi propres aux figures). */
#markdown-content .frise-illustration img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}

/* Mention de cote et de lieu de conservation, quand le dépôt l'exige.
   Le conteneur a line-height:0 pour coller l'image : on la rétablit ici. */
.frise-credit {
    display: block;
    padding: 0.35rem 0.5rem;
    background: #faf8f4;
    border-top: 1px solid #e9e4da;
    font-size: 0.7rem;
    line-height: 1.35;
    color: #7a7368;
}

/* Apparat critique : replié par défaut. */
.frise-ref {
    margin: 0.7rem 0 0;
    font-size: 0.85rem;
    color: #7a7368;
}

.frise-ref>summary {
    cursor: pointer;
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    color: #9a9287;
    list-style: none;
}

.frise-ref>summary::-webkit-details-marker {
    display: none;
}

.frise-ref>summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 0.3rem;
    transition: transform 0.15s ease;
}

.frise-ref[open]>summary::before {
    transform: rotate(90deg);
}

.frise-ref>summary:hover {
    color: var(--secondary-color);
}

.frise-ref>p {
    margin: 0.4rem 0 0;
}

.frise-badge {
    display: inline-block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    margin-right: 0.4rem;
    white-space: nowrap;
}

.frise-badge-acte {
    background: var(--primary-color);
    color: #fff;
}

.frise-badge-source {
    background: var(--secondary-color);
    color: #fff;
}

.frise-badge-hypothese {
    background: #efece6;
    color: #6b645a;
    border: 1px dashed #b0a99c;
}

.frise-legende {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.4rem;
    font-size: 0.82rem;
    color: #9a9287;
    margin: 0 0 2rem;
}

.frise-legende-titre {
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.72rem;
}

.frise-legende-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.frise-legende-item .frise-puce {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-sizing: border-box;
    background: var(--card-bg);
    border: 3px solid var(--primary-color);
}

.frise-legende-item.frise-niv-acte .frise-puce {
    background: var(--primary-color);
}

.frise-legende-item.frise-niv-source .frise-puce {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
}

.frise-legende-item.frise-niv-hypothese .frise-puce {
    border-color: #b0a99c;
}

@media (max-width: 767.98px) {
    .frise-etape {
        flex-wrap: wrap;
        gap: 0.9rem;
    }

    .frise-illustration {
        flex-basis: 100%;
    }
}

@media (max-width: 575.98px) {
    .frise-etape {
        padding-left: 2rem;
    }
}


@media (max-width: 767.98px) {
    .navbar-logo {
        height: 30px;
    }

    .navbar-brand {
        font-size: 1.15rem;
    }

    .article-content {
        padding: 1.5rem 1rem;
    }

    .article-card .card-body {
        padding: 1.5rem;
    }

    .content-section {
        padding: 40px 0;
    }
}

@media (max-width: 360px) {
    .navbar-logo {
        height: 26px;
        margin-right: 0.4rem !important;
    }

    .navbar-brand {
        font-size: 0.95rem;
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

.delay-5 {
    animation-delay: 0.5s;
}

.delay-6 {
    animation-delay: 0.6s;
}

/* ==========================================
   Filter bar
   ========================================== */
.filter-bar {
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
    padding: 0.7rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.filter-label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    white-space: nowrap;
}

.filter-btn {
    background: transparent;
    border: 1.5px solid #d8d8d8;
    color: #666;
    padding: 4px 16px;
    border-radius: 20px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.18s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1.6;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(44, 62, 80, 0.04);
}

.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* ==========================================
   Catalog sections — filtrage
   ========================================== */
.catalog-section {
    transition: opacity 0.2s ease;
}

.section-hidden {
    display: none !important;
}

/* ==========================================
   Resource compact cards
   ========================================== */
.resource-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: box-shadow 0.22s ease, transform 0.22s ease;
    border: 1px solid #e6e0d6 !important;
    background: #fffdf9;
}

.resource-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}

.resource-thumb-wrap {
    width: 96px;
    min-height: 120px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0ebe0;
}

.resource-thumb-img {
    width: 96px;
    min-height: 120px;
    height: 100%;
    object-fit: cover;
    display: block;
}

.resource-thumb-placeholder {
    width: 96px;
    min-height: 120px;
    background: linear-gradient(160deg, #f5f0e5 0%, #e5dac5 100%);
}

.resource-icon {
    font-size: 2rem;
    opacity: 0.28;
}

.resource-date-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    display: block;
}

.resource-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.3;
}

.resource-desc {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================
   Search input
   ========================================== */
.catalog-search-wrap {
    flex: 0 1 240px;
}

.catalog-search-input {
    width: 100%;
    border: 1.5px solid #d8d8d8;
    border-radius: 20px;
    padding: 4px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--text-color);
    background: #fafafa;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    line-height: 1.6;
}

.catalog-search-input::placeholder {
    color: #bbb;
}

.catalog-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.08);
    background: #fff;
}