/* --------------------------------------------------------------
   spip-override.css
   Surcharge des styles SPIP pour s'harmoniser avec le thème
-------------------------------------------------------------- */

/* Listes SPIP - adapter aux styles du thème */
ul.spip,
ol.spip {
    margin-left: 2rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

ul.spip {
    list-style-type: disc;
}

ol.spip {
    list-style-type: decimal;
}

ul.spip li,
ol.spip li {
    margin-bottom: 0.5rem;
    color: var(--rs-text-primary);
}

/* Tableaux SPIP - style thème */
table.spip {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

table.spip th {
    background-color: var(--rs-theme-red);
    color: #fff;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

table.spip td {
    padding: 12px 15px;
    border-bottom: 1px solid #e4e4e4;
    color: var(--rs-text-primary);
}

table.spip tr:hover {
    background-color: #f8f9fa;
}

/* Images et documents SPIP */
.spip_documents {
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.spip_documents img,
.spip_document img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Espacement supplémentaire pour les images flottantes */
.spip_documents_left img,
.spip_document_left img {
    display: block;
}

.spip_documents_right img,
.spip_document_right img {
    display: block;
}

/* Clearfix pour les conteneurs avec images flottantes */
.rs-about-wrapper::after,
.rs-postbox-details-wrapper::after {
    content: "";
    display: table;
    clear: both;
}

.spip_documents_center {
    text-align: center;
}

.spip_documents_left,
.spip_document_left {
    float: left;
    margin-right: 2rem;
    margin-bottom: 1.5rem;
    max-width: 50%;
}

.spip_documents_right,
.spip_document_right {
    float: right;
    margin-left: 2rem;
    margin-bottom: 1.5rem;
    max-width: 50%;
}

.spip_doc_titre {
    font-size: 14px;
    font-weight: 600;
    color: var(--rs-title-primary);
    margin-top: 0.5rem;
}

.spip_doc_descriptif {
    font-size: 13px;
    color: var(--rs-text-secondary);
    margin-top: 0.25rem;
}

/* Code et blocs de code */
.spip_code,
.spip_cadre {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #d63384;
}

.spip_code_block,
.spip_cadre_block {
    display: block;
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
}

/* Logos SPIP */
.spip_logo {
    border-radius: 8px;
    max-width: 100%;
}

/* Citations */
blockquote,
.spip_quote {
    border-left: 4px solid var(--rs-theme-red);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: var(--rs-text-secondary);
}

/* Paragraphes dans le contenu SPIP */
.rs-about-wrapper p,
.rs-postbox-details-wrapper p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--rs-text-primary);
}

/* Titres dans le contenu SPIP */
.rs-about-wrapper h1,
.rs-about-wrapper h2,
.rs-about-wrapper h3,
.rs-about-wrapper h4,
.rs-about-wrapper h5,
.rs-about-wrapper h6,
.rs-postbox-details-wrapper h1,
.rs-postbox-details-wrapper h2,
.rs-postbox-details-wrapper h3,
.rs-postbox-details-wrapper h4,
.rs-postbox-details-wrapper h5,
.rs-postbox-details-wrapper h6 {
    margin-top: 2rem;
}

.rs-about-wrapper h1,
.rs-postbox-details-wrapper h1 {
    margin-bottom: 2rem;
}

.rs-about-wrapper h2,
.rs-postbox-details-wrapper h2 {
    margin-bottom: 1.75rem;
}

.rs-about-wrapper h3,
.rs-postbox-details-wrapper h3 {
    margin-bottom: 1.5rem;
}

.rs-about-wrapper h4,
.rs-postbox-details-wrapper h4 {
    margin-bottom: 1.25rem;
}

.rs-about-wrapper h5,
.rs-postbox-details-wrapper h5,
.rs-about-wrapper h6,
.rs-postbox-details-wrapper h6 {
    margin-bottom: 1rem;
}

/* Premier titre sans marge top */
.rs-about-wrapper > h1:first-child,
.rs-about-wrapper > h2:first-child,
.rs-about-wrapper > h3:first-child,
.rs-about-wrapper > h4:first-child,
.rs-about-wrapper > h5:first-child,
.rs-about-wrapper > h6:first-child,
.rs-postbox-details-wrapper > h1:first-child,
.rs-postbox-details-wrapper > h2:first-child,
.rs-postbox-details-wrapper > h3:first-child,
.rs-postbox-details-wrapper > h4:first-child,
.rs-postbox-details-wrapper > h5:first-child,
.rs-postbox-details-wrapper > h6:first-child {
    margin-top: 0;
}

/* Liens dans le contenu SPIP */
.rs-about-wrapper a,
.rs-postbox-details-wrapper a {
    color: var(--rs-theme-red);
    text-decoration: none;
    transition: color 0.3s ease;
}

.rs-about-wrapper a:hover,
.rs-postbox-details-wrapper a:hover {
    color: var(--rs-theme-yellow);
    text-decoration: underline;
}

/* Liens globaux - survol en jaune */
/* Menu principal */
.main-menu ul li a:hover,
.multipage-menu li a:hover {
    color: var(--rs-theme-yellow) !important;
}

/* Titres avec liens */
.rs-blog-title a:hover,
.rs-program-title a:hover,
.rs-team-title a:hover,
.sidebar-blog-title a:hover,
.rs-event-title a:hover,
.rs-course-title a:hover {
    color: var(--rs-theme-yellow) !important;
}

/* Liens du footer */
.footer-widget ul li a:hover {
    color: var(--rs-theme-yellow) !important;
}

/* Breadcrumb */
.rs-breadcrumb-menu a:hover {
    color: var(--rs-theme-yellow) !important;
}

/* Limiter le fil d'Ariane à un écran */
.rs-breadcrumb-menu nav {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.rs-breadcrumb-menu nav ul {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    margin: 0;
    padding: 0;
}

.rs-breadcrumb-menu nav ul li {
    flex-shrink: 0;
}

/* Scrollbar personnalisée pour le breadcrumb */
.rs-breadcrumb-menu nav::-webkit-scrollbar {
    height: 4px;
}

.rs-breadcrumb-menu nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.rs-breadcrumb-menu nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.rs-breadcrumb-menu nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Tous les autres liens généraux */
body a:hover:not(.rs-btn):not(.popup-image) {
    color: var(--rs-theme-yellow);
}

/* Transitions pour tous les liens du menu */
.main-menu ul li a,
.mean-container .mean-nav ul li a {
    transition: all 0.3s ease;
}

/* Liens actifs dans le menu - forcer le jaune avec design */
.rs-header-area.has-theme-red .main-menu ul li.active > a,
.rs-header-area.has-theme-red .main-menu ul li a.active,
.rs-header-area.has-theme-green .main-menu ul li.active > a,
.rs-header-area.has-theme-green .main-menu ul li a.active,
.rs-header-area.has-theme-green-two .main-menu ul li.active > a,
.rs-header-area.has-theme-green-two .main-menu ul li a.active {
    color: var(--rs-theme-yellow) !important;
    font-weight: 600 !important;
    position: relative;
}


.rs-header-area.has-theme-red .main-menu ul li ul.submenu li.active > a::before,
.rs-header-area.has-theme-green .main-menu ul li ul.submenu li.active > a::before,
.rs-header-area.has-theme-green-two .main-menu ul li ul.submenu li.active > a::before {
    background: var(--rs-theme-yellow) !important;
}

.rs-header-area.has-theme-red .main-menu ul li ul.submenu li a.active,
.rs-header-area.has-theme-red .main-menu .submenu li a.active,
.rs-header-area.has-theme-green .main-menu ul li ul.submenu li a.active,
.rs-header-area.has-theme-green .main-menu .submenu li a.active,
.rs-header-area.has-theme-green-two .main-menu ul li ul.submenu li a.active,
.rs-header-area.has-theme-green-two .main-menu .submenu li a.active {
    color: var(--rs-theme-yellow) !important;
    font-weight: 600 !important;
    background: rgba(253, 199, 47, 0.1);
    border-radius: 4px;
}

/* Menu mobile offcanvas */
.offcanvas-area.has-theme-red .mean-container .mean-nav ul li.active > a,
.offcanvas-area.has-theme-red .mean-container .mean-nav ul li a.active,
.offcanvas-area.has-theme-green .mean-container .mean-nav ul li.active > a,
.offcanvas-area.has-theme-green .mean-container .mean-nav ul li a.active,
.offcanvas-area.has-theme-green-two .mean-container .mean-nav ul li.active > a,
.offcanvas-area.has-theme-green-two .mean-container .mean-nav ul li a.active {
    color: var(--rs-theme-yellow) !important;
    font-weight: 600 !important;
    background: rgba(253, 199, 47, 0.15) !important;
    padding-left: 25px !important;
    border-left: 4px solid var(--rs-theme-yellow) !important;
    border-radius: 0 4px 4px 0;
}

/* Menu header interne (pages article) */
.rs-header-one .main-menu ul li.active > a,
.rs-header-one .main-menu ul li a.active {
    color: var(--rs-theme-yellow) !important;
    font-weight: 600 !important;
}


/* Badge "actif" pour une meilleure visibilité */
.main-menu > ul > li.active > a::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -10px;
    width: 6px;
    height: 6px;
    background: var(--rs-theme-yellow);
    border-radius: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.8;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) scale(1.2);
    }
}

/* Ajustement position logo header desktop uniquement */
@media (min-width: 1200px) {
    .rs-header-area .header-logo-wrapper .header-logo {
        position: relative;
        top: 25px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    ul.spip,
    ol.spip {
        margin-left: 1rem;
    }

    .spip_documents_left,
    .spip_documents_right,
    .spip_document_left,
    .spip_document_right {
        float: none;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 1rem;
    }

    table.spip {
        font-size: 14px;
    }

    table.spip th,
    table.spip td {
        padding: 8px 10px;
    }
}
