:root{
  --main-color:#7F1734;
}

/* ==============================
   Layout général
   ============================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.evenement{
  background-color:var(--main-color);
  color:white;
}

.text-primary,
.btn-primary,
.btn-outline-primary {
    color:var(--main-color) !important;
    border-color:var(--main-color) !important;
}
.btn-outline-primary:hover{
    background-color:var(--main-color) !important;
}
.btn:hover{
    color:white !important;
}
.note-legend {
    max-width: 180px;
}

.legend-list li {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-align:left;
}

.color-box {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 5px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid #ccc;
    vertical-align: middle;
}

/* État coché */
.color-box.checked {
    border: 2px solid #000;
}

#note-legend .legend-list li span.text-label {
    flex: 1;                /* prend le reste de la ligne */
    margin: 5px;
}

/* =======================
   Navbar / Offcanvas
======================= */

/* Navbar couleur fond desktop */
.navbar-pink {
    background-color: var(--main-color);
    list-style: none;
}

/* Texte navbar desktop */
.navbar .nav-link {
    color: white;
    font-weight: 500;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: rgba(255,255,255,0.85);
}

/* Dropdown menu (desktop) */
.navbar .dropdown-menu {
    background-color: var(--main-color);
    border: none;
}
.navbar .dropdown-item {
    color: white;
}
.navbar .dropdown-item:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Hamburger blanc */
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='white' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Offcanvas (mobile menu) */
.offcanvas {
    background-color: var(--main-color);
    color: white;
}
.offcanvas .nav-link,
.offcanvas .dropdown-item {
    color: white;
    text-align: left;
}
.offcanvas .nav-link:hover,
.offcanvas .dropdown-item:hover {
    background-color: rgba(255,255,255,0.1);
}
.offcanvas .btn-close {
    filter: invert(1);
}

/* Dropdowns dans offcanvas */ .offcanvas .dropdown-menu {
.offcanvas {
  position: fixed !important;
  z-index: 1055 !important;
  top: 0;
  left: 0;
  height: 100%;
}
.offcanvas-backdrop {
  z-index: 1050 !important;
}
    display: none;
    position: static;
    background-color: var(--main-color);
    border: none;
    box-shadow: none;
}
.offcanvas .dropdown.show > .dropdown-menu {
    display: block;
}

/* Espacements (desktop) */
.nav-margin {
    margin-left: 0;
    margin-right: 0;
}
@media (min-width: 992px) and (max-width: 1299px) {
    .nav-margin {
        margin-left: .5rem !important; 
        margin-right: .5rem !important;
    }
}
@media (min-width: 1300px) {
    .nav-margin {
        margin-left: 1.5rem !important;
        margin-right: 1.5rem !important;
    }
}

/* Centrer les items navbar desktop */
@media (min-width: 992px) {
    .navbar-nav {
        display: flex;
        justify-content: center; /* centre tous les li horizontalement */
        align-items: center;     /* centre verticalement */
    }

    .navbar-nav .nav-item {
        text-align: center;
        margin-left: 1rem;       /* espace entre les menus */
        margin-right: 1rem;
    }

    /* Centrer le dropdown sous le parent */
    .navbar-nav .dropdown-menu {
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}


/* ==============================
   Page header
   ============================== */
.page-title{
    color: var(--main-color);
    font-variant-caps: small-caps;
    font-weight: bold;
    font-size: 2em;
    text-align: center;
}

.page-subtitle{
    color: var(--main-color);
    font-weight: bold;
    font-size: 1.7em;
    text-align: center;
}

.container-header {
    top: .6em;
    right: .6em;
}

.image-header {
    align-content: center;
    margin: auto;
}

.legend-header{
    font-size: 0.5em;
    color: grey;
    text-align: center;
    font-style: italic;
}

.legend {
    text-align: center;
    color: grey;
    font-size: .8em;
    font-style: italic;
}

/* ==============================
   TEI text + notes
   ============================== */
.tei-row {
    display: flex;
    font-family: Arial, Helvetica, sans-serif;
    flex-direction: row;
    align-items: flex-start;
    margin-bottom: 1em;
}

.tei-text {
    flex: 1 1 50%;
    padding-right: 1rem;
    text-align:justify;
}

.tei-notes {
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
}

.note-item {
    text-align: right;
    padding: 0.2em 0.4em;
    margin-bottom: 0.5em;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.85em;
}

.note-ref {
    vertical-align:super;
    font-size: 0.75em;
    display:inline;
}

/* Couleurs texte par type */
.tei-text span.italic { font-style: italic; }

.color-CR { background-color: #ffb3b3; }
.color-NT { background-color: #b3f0e6; }
.color-NH { background-color: #D4f4a1; }
.color-TD { background-color: #c0c0c0; }
.color-TP { background-color: #fff1b3; }
.color-TR { background-color: #a3c7ff; }
.color-RS { background-color: #ffcc99; }
.color-XX { background-color: #d9b3ff; }

/* Survol texte et notes - texte toujours noir */
.tei-text span.show-highlight.CR { background-color: #ffb3b3; color: #000 !important; }   /* rose clair */
.tei-text span.show-highlight.NT { background-color: #b3f0e6; color: #000 !important; }   /* vert-bleu clair */
.tei-text span.show-highlight.NH { background-color: #d4f4a1; color: #000 !important; }   /* vert clair */
.tei-text span.show-highlight.TD { background-color: #c0c0c0; color: #000 !important; }   /* gris clair */
.tei-text span.show-highlight.RH { background-color: #ffe699; color: #000 !important; }   /* jaune clair */
.tei-text span.show-highlight.TR { background-color: #a3c7ff; color: #000 !important; }   /* bleu clair */
.tei-text span.show-highlight.RS { background-color: #ffcc99; color: #000 !important; }   /* orange clair */
.tei-text span.show-highlight.XX { background-color: #d9b3ff; color: #000 !important; }   /* violet clair */
.tei-text span.show-highlight.TP { background-color: #fff1b3; color: #000 !important; }   /* jaune doré clair */

/* Notes dans la marge */
.note-item.highlight.CR { background-color: #ffb3b3; color: #000; }
.note-item.highlight.NT { background-color: #b3f0e6; color: #000; }
.note-item.highlight.NH { background-color: #d4f4a1; color: #000; }
.note-item.highlight.TD { background-color: #c0c0c0; color: #000; }
.note-item.highlight.RH { background-color: #ffe699; color: #000; }
.note-item.highlight.TR { background-color: #a3c7ff; color: #000; }
.note-item.highlight.RS { background-color: #ffcc99; color: #000; }
.note-item.highlight.XX { background-color: #d9b3ff; color: #000; }
.note-item.highlight.TP { background-color: #fff1b3; color: #000; }

/* Sticky legend */
.note-legend {
    position: sticky;
    top: 1rem;
    background: #fff;
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ddd;
    text-align: center;
    z-index: 1020;
}

.note-legend label {
    display: block;
    margin-bottom: 0.5em;
    cursor: pointer;
}

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

/* ==============================
   Responsive mobile
   ============================== */
@media (max-width: 768px) {
    .tei-row {
        flex-direction: column;
    }
    .tei-text, .tei-notes {
        flex: 1 1 100%;
        padding-right: 0;
    }
    .tei-notes {
        margin-top: 0.5em;
    }
    .note-legend {
        position: relative;
        top: auto;
        margin-top: 1rem;
    }
}

/* ==============================
   Liens généraux
   ============================== */
a {
    color: var(--main-color);
}

/* ==============================
   Carousel Savonarole
   ============================== */
#carouselSavonarole .carousel-caption {
    background: rgba(0,0,0,0.5);
    border-radius: 10px;
    padding: 10px 15px;
    bottom: 40px;
}

#carouselSavonarole .carousel-caption h5 {
    font-size: 1.1rem;
    font-weight: 600;
}

#carouselSavonarole .carousel-caption p {
    font-size: 0.85rem;
    margin-bottom: 0;
    font-style: italic;
}

#carouselSavonarole .carousel-caption a {
    color: #f8f9fa;
    text-decoration: underline;
}

#carouselSavonarole .carousel-caption a:hover {
    color: #ddd;
}

/* Indicateurs plats */
#carouselSavonarole .carousel-indicators [data-bs-target] {
    background-color: var(--main-color);
    opacity: 0.4;
    width: 30px;
    height: 4px;
    border: none;
    transition: opacity 0.3s ease;
}

#carouselSavonarole .carousel-indicators .active {
    opacity: 1;
}

/* Flèches recolorées */
#carouselSavonarole .carousel-control-prev-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%237F1734' viewBox='0 0 16 16'%3e%3cpath d='M11.354 1.646a.5.5 0 0 1 0 .708L5.707 8l5.647 5.646a.5.5 0 0 1-.708.708l-6-6a.5.5 0 0 1 0-.708l6-6a.5.5 0 0 1 .708 0z'/%3e%3c/svg%3e");
}

#carouselSavonarole .carousel-control-next-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='%237F1734' viewBox='0 0 16 16'%3e%3cpath d='M4.646 1.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1 0 .708l-6 6a.5.5 0 0 1-.708-.708L10.293 8 4.646 2.354a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Effet sur flèches */
#carouselSavonarole .carousel-control-prev:hover .carousel-control-prev-icon,
#carouselSavonarole .carousel-control-next:hover .carousel-control-next-icon {
    filter: brightness(1.3);
}

/*============
  CHRONOLOGIE
  ============*/
        .timeline::before {
            content: '';
            position: absolute;
            top: 0;
            bottom: 0;
            left: 50%;
            width: 4px;
            background: var(--main-color);
            transform: translateX(-50%);
        }
        .timeline-item {
            position: relative;
            margin-bottom: 3rem;
        }
        .timeline-icon {
            position: absolute;
            top: 0;
            left: 50%;
            transform: translate(-50%, -50%);
            background-color: #fff;
            border: 3px solid var(--main-color);
            border-radius: 50%;
            width: 20px;
            height: 20px;
            z-index: 1;
        }
.text-primary {
    color: var(--main-color);
}
        @media (max-width: 768px) {
            .timeline::before {
                left: 8px;
            }
            .timeline-icon {
                left: 8px;
                transform: translateY(-50%);
            }
        }

