/* CAREP — Modern site design system */

:root {
    --carep: #C00D0E;
    --carep-dark: #6B0809;
    --carep-light: #fde8e8;
    --carep-header-bg: linear-gradient(90deg, #8A0A0B 0%, #C00D0E 55%, #A00B0C 100%);
    --clay: #c9922e;
    --ink: #1e293b;
    --sand: #f6f7f9;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1.5rem;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-body {
    font-family: Tajawal, sans-serif;
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(192, 13, 14, 0.06), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(201, 146, 46, 0.04), transparent),
        var(--sand);
}

.site-container {
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
    padding-inline: 1rem;
}

@media (min-width: 768px) {
    .site-container {
        padding-inline: 1.5rem;
    }
}

/* Top bar */
.site-topbar {
    background: var(--carep-header-bg);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.social-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transition: var(--transition);
}

.social-pill:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.lang-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    transition: var(--transition);
}

.lang-pill:hover,
.lang-pill.is-active {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}

/* Header — couleur logo CAREP */
.site-header {
    background: var(--carep-header-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    transition: box-shadow var(--transition), background var(--transition);
}

.site-header.is-scrolled {
    background: var(--carep-header-bg);
    box-shadow: 0 10px 28px -12px rgba(107, 8, 9, 0.55);
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.site-header-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* FR/EN : logo à gauche, menu à droite */
html[dir="ltr"] .site-header-bar {
    direction: ltr;
    justify-content: space-between;
}

html[dir="ltr"] .site-header-bar .site-brand {
    order: 1;
}

html[dir="ltr"] .site-header-bar .site-main-menu {
    order: 2;
    direction: ltr;
    margin-inline-start: auto;
}

html[dir="ltr"] .site-header-bar .site-menu-toggle {
    order: 3;
}

/* AR : logo à droite + menu à droite (à côté du logo) */
html[dir="rtl"] .site-header-bar {
    direction: rtl;
    justify-content: flex-start;
}

html[dir="rtl"] .site-header-bar .site-brand {
    order: 1;
}

html[dir="rtl"] .site-header-bar .site-main-menu {
    order: 2;
    direction: rtl;
    margin-inline-start: 0;
}

html[dir="rtl"] .site-header-bar .site-menu-toggle {
    order: 3;
    margin-inline-start: auto;
}

.site-brand-logo {
    height: 3.25rem;
    width: auto;
    transition: transform var(--transition);
    background: #fff;
    border-radius: 0.65rem;
    padding: 0.2rem 0.35rem;
}

.site-brand:hover .site-brand-logo {
    transform: scale(1.02);
}

.site-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    transition: var(--transition);
}

.site-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
}

.site-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    transition: var(--transition);
}

.site-nav-link:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.site-nav-link.is-active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.site-dropdown {
    inset-inline-end: 0;
    left: auto;
    right: auto;
    top: calc(100% - 0.25rem);
    min-width: 17rem;
    z-index: 60;
    padding-top: 0.75rem;
    margin-top: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.98);
    transform-origin: top center;
    transition:
        opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-dropdown::before {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 0.75rem;
}

.site-dropdown-panel {
    position: relative;
    border-radius: 1rem;
    border: 1px solid rgba(192, 13, 14, 0.1);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.45rem;
    box-shadow:
        0 4px 6px -2px rgba(15, 23, 42, 0.06),
        0 22px 48px -18px rgba(107, 8, 9, 0.28);
    max-height: min(75vh, 34rem);
    overflow: visible;
}

.site-dropdown-panel::before {
    content: '';
    position: absolute;
    top: -5px;
    inset-inline-end: 1.35rem;
    width: 10px;
    height: 10px;
    background: #fff;
    border-top: 1px solid rgba(192, 13, 14, 0.1);
    border-inline-end: 1px solid rgba(192, 13, 14, 0.1);
    transform: rotate(-45deg);
}

/* Ouverture desktop : survol OU focus OU classe JS */
.site-nav-item:hover > .site-dropdown,
.site-nav-item:focus-within > .site-dropdown,
.site-nav-item.is-open > .site-dropdown {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.site-nav-parent {
    cursor: pointer;
    user-select: none;
}

.site-nav-link.site-nav-parent {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.site-nav-link.site-nav-parent .fa-chevron-down {
    font-size: 0.65rem;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-nav-item:hover > .site-nav-parent .fa-chevron-down,
.site-nav-item:focus-within > .site-nav-parent .fa-chevron-down,
.site-nav-item.is-open > .site-nav-parent .fa-chevron-down {
    transform: rotate(180deg);
}

.site-dropdown-link {
    display: block;
    padding: 0.6rem 0.8rem;
    border-radius: 0.7rem;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--ink);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.site-dropdown-link br,
.site-mobile-sublink br,
.site-mobile-link br {
    display: block;
    content: '';
}

.site-dropdown-link:hover,
.site-dropdown-link.is-active {
    background: linear-gradient(90deg, rgba(253, 232, 232, 0.95), rgba(254, 247, 247, 0.7));
    color: var(--carep-dark);
}

html[dir="ltr"] .site-dropdown-link:hover,
html[dir="ltr"] .site-dropdown-link.is-active {
    background: linear-gradient(270deg, rgba(253, 232, 232, 0.95), rgba(254, 247, 247, 0.7));
}

.site-dropdown-item {
    position: relative;
}

.site-dropdown-parent {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
}

.site-dropdown-chevron {
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    opacity: 0.55;
}

.site-dropdown-item:hover > .site-dropdown-parent .site-dropdown-chevron,
.site-dropdown-item:focus-within > .site-dropdown-parent .site-dropdown-chevron,
.site-dropdown-item.is-open > .site-dropdown-parent .site-dropdown-chevron {
    transform: rotate(-90deg);
    opacity: 1;
    color: var(--carep);
}

html[dir="rtl"] .site-dropdown-item:hover > .site-dropdown-parent .site-dropdown-chevron,
html[dir="rtl"] .site-dropdown-item:focus-within > .site-dropdown-parent .site-dropdown-chevron,
html[dir="rtl"] .site-dropdown-item.is-open > .site-dropdown-parent .site-dropdown-chevron {
    transform: rotate(90deg);
}

.site-dropdown-submenu {
    position: absolute;
    top: -0.2rem;
    inset-inline-start: calc(100% + 0.2rem);
    min-width: 14rem;
    z-index: 70;
    margin: 0;
    padding: 0.4rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(192, 13, 14, 0.1);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 4px 6px -2px rgba(15, 23, 42, 0.06),
        0 18px 40px -16px rgba(107, 8, 9, 0.28);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px) scale(0.98);
    transform-origin: inline-start top;
    transition:
        opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        visibility 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

html[dir="rtl"] .site-dropdown-submenu {
    transform: translateX(8px) scale(0.98);
}

.site-dropdown-submenu::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-end: 100%;
    width: 0.55rem;
}

.site-dropdown-item:hover > .site-dropdown-submenu,
.site-dropdown-item:focus-within > .site-dropdown-submenu,
.site-dropdown-item.is-open > .site-dropdown-submenu {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(1);
}

.site-dropdown-submenu .site-dropdown-link {
    font-size: 0.82rem;
    font-weight: 500;
}

.site-dropdown-item.submenu-flip > .site-dropdown-submenu {
    inset-inline-start: auto;
    inset-inline-end: calc(100% + 0.2rem);
    transform-origin: inline-end top;
}

.site-dropdown-item.submenu-flip > .site-dropdown-submenu::before {
    inset-inline-end: auto;
    inset-inline-start: 100%;
}

/* —— Menu mobile moderne (accordéon) —— */
.site-menu-toggle [data-icon="close"].hidden,
.site-menu-toggle [data-icon="open"].hidden {
    display: none;
}

.site-mobile-nav {
    padding: 0.55rem;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid rgba(192, 13, 14, 0.1);
    box-shadow: 0 18px 48px -20px rgba(15, 23, 42, 0.28);
    max-height: min(78vh, 36rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    animation: carepMobileNavIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes carepMobileNavIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-mobile-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    font-weight: 700;
    color: #334155;
    background: transparent;
    border: 0;
    text-align: inherit;
    transition: background 0.18s ease, color 0.18s ease;
}

.site-mobile-link:hover {
    background: #f8fafc;
}

.site-mobile-link.is-active {
    background: #fef7f7;
    color: #8A0A0B;
}

.site-mobile-accordion {
    cursor: pointer;
}

.site-mobile-accordion-icon {
    font-size: 0.7rem;
    opacity: 0.55;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-mobile-group.is-open > .site-mobile-accordion .site-mobile-accordion-icon {
    transform: rotate(180deg);
    opacity: 1;
    color: var(--carep);
}

.site-mobile-group > .site-mobile-sub {
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    transition:
        grid-template-rows 0.3s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.22s ease,
        margin 0.22s ease;
    margin: 0;
    overflow: hidden;
}

.site-mobile-group.is-open > .site-mobile-sub {
    grid-template-rows: 1fr;
    opacity: 1;
    margin: 0.15rem 0 0.35rem;
}

.site-mobile-sub {
    margin-inline-end: 0.35rem;
    padding-inline-end: 0.35rem;
    border-inline-end: 2px solid #fde8e8;
}

.site-mobile-sub-inner {
    min-height: 0;
    overflow: hidden;
}

.site-mobile-group.is-open > .site-mobile-sub > .site-mobile-sub-inner {
    overflow: visible;
}

.site-mobile-sublink {
    display: block;
    padding: 0.55rem 0.9rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 0.6rem;
    transition: background 0.18s ease, color 0.18s ease;
}

.site-mobile-sublink.is-active,
.site-mobile-sublink:hover {
    background: #fef7f7;
    color: #8A0A0B;
}

/* Sections & typography */
.section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.section-title {
    position: relative;
    padding-bottom: 0.65rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 3.5rem;
    height: 3px;
    border-radius: 9999px;
    background: linear-gradient(90deg, var(--carep), var(--clay));
}

.section-title-text {
    font-family: Amiri, serif;
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 700;
    color: #8A0A0B;
    line-height: 1.2;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #C00D0E, #8A0A0B);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 8px 24px -8px rgba(192, 13, 14, 0.45);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px -8px rgba(192, 13, 14, 0.55);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(192, 13, 14, 0.2);
    background: #fff;
    color: #8A0A0B;
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
}

.btn-outline:hover {
    background: #fef7f7;
    border-color: rgba(192, 13, 14, 0.35);
}

/* Cards */
.carep-card {
    overflow: hidden;
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(192, 13, 14, 0.08);
    background: #fff;
    box-shadow: var(--shadow-card, 0 4px 24px -4px rgba(15, 23, 42, 0.08));
    transition: transform var(--transition), box-shadow var(--transition);
}

.carep-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -20px rgba(192, 13, 14, 0.15);
}

.carep-card-media {
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: transparent;
}

.carep-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    transition: transform 0.5s ease;
}

.carep-card:hover .carep-card-media img {
    transform: scale(1.03);
}

.carep-card-body {
    padding: 1.15rem 1.25rem;
    text-align: right;
}

html[dir="ltr"] .carep-card-body {
    text-align: left;
}

/* Bandeau image (فعاليات قادمة) */
.carep-card-media-inline {
    display: block;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 5.5rem;
    max-height: 7.5rem;
    background: #f8fafc;
}

.carep-card-media-inline img {
    width: 100%;
    height: 100%;
    max-height: 7.5rem;
    object-fit: cover;
    object-position: center center;
}

.carep-feature-card,
.org-member-card {
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(192, 13, 14, 0.1);
    background: #fff;
    box-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.08);
    transition: transform var(--transition), box-shadow var(--transition);
}

.carep-feature-card:hover,
.org-member-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px -20px rgba(192, 13, 14, 0.15);
}

/* —— آخر الاصدارات : grille centrée selon le nombre de livres —— */
.books-shelf {
    margin-inline: auto;
    width: 100%;
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(192, 13, 14, 0.1);
    background: linear-gradient(180deg, #ffffff 0%, #faf7f5 100%);
    box-shadow: 0 8px 32px -12px rgba(15, 23, 42, 0.12);
    padding: 1.5rem 1.25rem 1.75rem;
}

.books-shelf--grid {
    max-width: 56rem;
}

.books-shelf[data-count="1"] {
    max-width: 18rem;
}

.books-shelf[data-count="2"] {
    max-width: 28rem;
}

.books-shelf[data-count="3"] {
    max-width: 40rem;
}

.books-shelf[data-count="4"] {
    max-width: 52rem;
}

.books-shelf--carousel {
    max-width: 100%;
    overflow: hidden;
    padding-inline: 1rem;
}

.books-track {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 1.25rem;
}

.books-shelf--carousel .books-track {
    flex-wrap: nowrap;
    justify-content: flex-start;
    transition: transform 0.5s ease-out;
    will-change: transform;
}

.book-card {
    flex: 0 0 auto;
    width: min(11.5rem, 42vw);
}

.books-shelf[data-count="1"] .book-card {
    width: min(14rem, 70vw);
}

.books-shelf[data-count="2"] .book-card {
    width: min(12rem, 40vw);
}

.books-shelf--carousel .book-card {
    width: calc((100% - 3.75rem) / 4);
    min-width: 9.5rem;
}

@media (max-width: 1023px) {
    .books-shelf--carousel .book-card {
        width: calc((100% - 1.25rem) / 2);
    }
}

@media (max-width: 767px) {
    .books-shelf--carousel .book-card {
        width: 72%;
        max-width: 14rem;
    }

    .books-shelf--grid .book-card {
        width: min(10.5rem, 44vw);
    }
}

.book-card-frame {
    position: relative;
    overflow: hidden;
    border-radius: 0.85rem;
    border: 1px solid rgba(192, 13, 14, 0.12);
    background:
        linear-gradient(145deg, #f8fafc 0%, #f1ebe6 100%);
    box-shadow:
        0 10px 28px -14px rgba(74, 6, 7, 0.35),
        inset 0 0 0 1px rgba(255, 255, 255, 0.55);
    aspect-ratio: 2 / 3;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.book-card:hover .book-card-frame {
    transform: translateY(-6px) scale(1.02);
    box-shadow:
        0 18px 40px -16px rgba(74, 6, 7, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.book-card-link {
    display: block;
    height: 100%;
}

.book-card-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.books-subsection-title {
    font-family: var(--font-display, Georgia, serif);
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
    font-weight: 700;
    color: #8a0a0b;
    letter-spacing: 0.02em;
}

.books-cta-wrap {
    padding-top: 0.25rem;
}

.books-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-width: min(100%, 18rem);
    padding: 0.95rem 1.75rem;
    border-radius: 999px;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #4a0607 0%, #8a0a0b 45%, #c00d0e 100%);
    box-shadow:
        0 14px 34px -12px rgba(192, 13, 14, 0.55),
        0 0 0 4px rgba(192, 13, 14, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.books-cta-btn:hover {
    transform: translateY(-3px) scale(1.02);
    filter: brightness(1.05);
    box-shadow:
        0 20px 40px -14px rgba(192, 13, 14, 0.6),
        0 0 0 5px rgba(192, 13, 14, 0.16);
    color: #fff;
}

.books-cta-btn i {
    font-size: 0.95rem;
    opacity: 0.95;
}

.home-page .carep-card-body {
    text-align: center;
}

.carep-page-hero {
    background: var(--carep-header-bg) !important;
}

.carep-page-hero--podcast {
    background:
        radial-gradient(ellipse at 80% 20%, rgba(201, 146, 46, 0.22) 0, transparent 45%),
        radial-gradient(circle at 12% 80%, rgba(255, 255, 255, 0.08) 0, transparent 40%),
        linear-gradient(135deg, #4a0607 0%, #8a0a0b 48%, #c00d0e 100%) !important;
}

.carep-page-hero--podcast::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.18;
    background-image:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
}

.glass-panel {
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(192, 13, 14, 0.08);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 20px 50px -20px rgba(192, 13, 14, 0.12);
}

/* Hero */
.hero-wrap {
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12) 0, transparent 40%),
        linear-gradient(125deg, #4A0607 0%, #8A0A0B 45%, #A00B0C 100%);
    padding: 2.5rem 0 3rem;
}

@media (min-width: 768px) {
    .hero-wrap {
        padding: 3rem 0 3.5rem;
    }
}

#hero-slider {
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    box-shadow: 0 25px 60px -20px rgba(0, 0, 0, 0.45);
    background: #1a0505;
}

/* Cadre au ratio recommandé 1920×800 — photo entière visible (pas de crop agressif) */
.hero-slide-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #1a0505;
}

@media (min-width: 640px) {
    .hero-slide-media {
        aspect-ratio: 2 / 1;
    }
}

@media (min-width: 768px) {
    .hero-slide-media {
        aspect-ratio: 12 / 5; /* ≈ 1920×800 */
    }
}

.hero-slide-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain; /* photo complète sur mobile / tablette */
    object-position: center center;
    transition: transform 8s ease;
}

@media (min-width: 1024px) {
    .hero-slide-img {
        object-fit: cover; /* plein cadre desktop si image au bon ratio */
    }
}

.hero-slide.is-active .hero-slide-img {
    transform: none; /* éviter le zoom qui coupe l’image */
}

.hero-slide-shade {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 45%, transparent 72%);
    pointer-events: none;
}

.hero-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.92);
    color: #8A0A0B;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-nav-btn:hover {
    background: #fff;
}

@media (max-width: 639px) {
    .hero-nav-btn {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 0.85rem;
    }
}

/* News ticker */
.news-ticker {
    border-radius: var(--radius-xl);
    border: 1px solid rgba(192, 13, 14, 0.1);
    background: linear-gradient(90deg, #fff 0%, #fef7f7 100%);
    overflow: hidden;
}

.news-ticker-label {
    background: linear-gradient(135deg, #C00D0E, #6B0809);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.85rem 1.25rem;
    white-space: nowrap;
}

.news-ticker-track {
    animation: ticker-scroll 36s linear infinite;
    will-change: transform;
}

.news-ticker:hover .news-ticker-track {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* Page hero */
.page-hero {
    position: relative;
    overflow: hidden;
    padding: 3.5rem 0;
    color: #fff;
    background: var(--carep-header-bg);
}

.page-hero::before {
    content: none;
}

.page-hero .site-container {
    position: relative;
    z-index: 1;
}

.page-hero-title {
    font-family: Amiri, serif;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.15;
}

.page-hero-sub {
    margin-top: 0.85rem;
    max-width: 42rem;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.7;
}

/* Article */
.article-shell {
    margin-inline: auto;
    max-width: 52rem;
    padding: 1.75rem 1rem 3rem;
}

@media (min-width: 768px) {
    .article-shell {
        padding: 2.5rem 1.5rem 3.5rem;
    }
}

.article-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.article-prose {
    margin-top: 1.5rem;
    border-radius: var(--radius-2xl);
    background: #fff;
    padding: 1.25rem 1.15rem;
    line-height: 1.9;
    box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.1);
    border: 1px solid rgba(192, 13, 14, 0.06);
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (min-width: 768px) {
    .article-prose {
        padding: 1.75rem 2rem;
    }
}

.article-prose h2,
.article-prose h3 {
    font-family: Amiri, serif;
    color: #8A0A0B;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-prose p {
    margin-bottom: 1rem;
    color: #334155;
}

/* Tailwind Preflight retire list-style — rétablir puces / numéros */
.article-prose ul,
.article-prose ol {
    margin: 0 0 1rem;
    padding-inline-start: 1.75rem;
    color: #334155;
}

.article-prose ul {
    list-style-type: disc;
}

.article-prose ol {
    list-style-type: decimal;
}

.article-prose ul ul {
    list-style-type: circle;
    margin-bottom: 0.35rem;
    margin-top: 0.35rem;
}

.article-prose ol ol {
    list-style-type: lower-alpha;
    margin-bottom: 0.35rem;
    margin-top: 0.35rem;
}

.article-prose li {
    display: list-item;
    margin-bottom: 0.4rem;
    padding-inline-start: 0.25rem;
    line-height: 1.75;
}

.article-prose li::marker {
    color: #C00D0E;
}

.article-prose a {
    color: #C00D0E;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-prose img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
    border-radius: var(--radius-lg);
}

.article-prose iframe,
.article-prose video,
.article-prose table {
    max-width: 100%;
}

.article-prose table {
    display: block;
    overflow-x: auto;
}

.article-featured {
    margin-top: 1.25rem;
    width: 100%;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    aspect-ratio: 16 / 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 768px) {
    .article-featured {
        aspect-ratio: 16 / 9;
        max-height: 32rem;
    }
}

.article-featured-img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Topbar mobile */
@media (max-width: 639px) {
    .site-topbar-text {
        display: none;
    }

    .site-topbar .site-container {
        justify-content: flex-end;
    }
}

/* Footer — même rouge que le logo / header */
.site-footer {
    background: var(--carep-header-bg);
    color: #fff;
    margin-top: 2rem;
}

.site-footer-inner {
    display: grid;
    gap: 2rem;
    padding-block: 2.5rem 1.5rem;
}

@media (min-width: 640px) {
    .site-footer-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem 1.5rem;
    }
}

@media (min-width: 1024px) {
    .site-footer-inner {
        grid-template-columns: 1.35fr 0.95fr 1.1fr;
        gap: 2rem 1.75rem;
        padding-block: 3rem 1.75rem;
    }
}

.footer-brand-col {
    grid-column: 1 / -1;
}

@media (min-width: 1024px) {
    .footer-brand-col {
        grid-column: auto;
    }
}

.footer-sitemap-row {
    grid-column: 1 / -1;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-sitemap-row .site-footer-title {
    margin-bottom: 1rem;
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
}

.footer-logo {
    height: 3.5rem;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.footer-brand-name {
    font-family: Amiri, serif;
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    max-width: 16rem;
}

.footer-about {
    margin-top: 1rem;
    max-width: 28rem;
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.92rem;
}

.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 1.15rem;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: var(--transition);
}

.footer-social-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.footer-col {
    min-width: 0;
}

.site-footer-title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(201, 146, 46, 0.45);
}

.site-footer-link {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.45rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.88rem;
    line-height: 1.5;
    transition: var(--transition);
}

.site-footer-link-strong {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}

.site-footer-link:hover {
    color: #fff;
}

.footer-sitemap-columns {
    display: grid;
    gap: 1.25rem 1.5rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .footer-sitemap-columns {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .footer-sitemap-columns {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem 2rem;
    }
}

.footer-sitemap-list {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.footer-sitemap-sub {
    margin-top: 0.35rem;
    padding-inline-start: 0.85rem;
    border-inline-start: 1px solid rgba(255, 255, 255, 0.15);
    display: grid;
    gap: 0.3rem;
}

.footer-sitemap-sub .site-footer-link {
    font-size: 0.82rem;
}

.footer-contact-list {
    display: grid;
    gap: 0.65rem;
}

.footer-newsletter-lead {
    font-size: 0.86rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 0.85rem;
}

.footer-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

@media (min-width: 480px) {
    .footer-newsletter-form {
        flex-direction: row;
        align-items: stretch;
    }
}

.footer-newsletter-input {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-radius: 0.75rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.footer-newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.footer-newsletter-input:focus {
    border-color: rgba(201, 146, 46, 0.65);
    background: rgba(255, 255, 255, 0.12);
}

.footer-newsletter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: none;
    border-radius: 0.75rem;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, #c9922e, #a6741f);
    color: #fff;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.footer-newsletter-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.footer-newsletter-msg {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
    margin-bottom: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
}

.footer-newsletter-msg.is-success {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
}

.footer-newsletter-msg.is-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

.site-footer-bottom {
    grid-column: 1 / -1;
    margin-top: 0.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

@media (min-width: 768px) {
    .site-footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: start;
    }
}

.site-footer-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1rem;
}

.site-footer-legal-link {
    color: rgba(255, 255, 255, 0.72);
    transition: var(--transition);
}

.site-footer-legal-link:hover {
    color: #fff;
}

/* Mobile header touch targets */
@media (max-width: 767px) {
    .site-nav-link,
    .site-mobile-link,
    .site-mobile-sublink {
        min-height: 2.75rem;
        display: flex;
        align-items: center;
    }
}

.site-back-top {
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 40;
    align-items: center;
    justify-content: center;
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #C00D0E, #6B0809);
    color: #fff;
    box-shadow: 0 12px 32px -8px rgba(192, 13, 14, 0.5);
    transition: var(--transition);
}

.site-back-top:hover {
    transform: translateY(-2px);
}

/* Reveal animation — visible without JS so a script error never blanks the site */
.reveal {
    opacity: 1;
    transform: none;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

html.js .reveal:not(.is-visible) {
    opacity: 0;
    transform: translateY(16px);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stats (page.php) */
.carep-stat-card {
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.carep-stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 36px rgba(192, 13, 14, 0.12);
}

.carep-stat-icon {
    background: linear-gradient(135deg, #C00D0E 0%, #6B0809 100%);
}

.carep-stat-value {
    background: linear-gradient(135deg, #C00D0E, #8A0A0B);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Calendar widget */
.cal-widget-header {
    background: linear-gradient(125deg, #6B0809, #C00D0E);
    color: #fff;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

/* Objective band */
.objective-band {
    background: linear-gradient(90deg, rgba(253, 232, 232, 0.7), rgba(255, 255, 255, 0.9), rgba(253, 232, 232, 0.5));
    border-block: 1px solid rgba(192, 13, 14, 0.08);
}

/* Hero slider */
.hero-slide {
    transition: opacity 0.45s ease;
}

.hero-slide.is-active {
    display: block;
}

.hero-pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    backdrop-filter: blur(6px);
}

.hero-pagination-current {
    min-width: 1.25rem;
    text-align: center;
}

.events-cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.events-cat-tab {
    border-radius: 9999px;
    border: 2px solid rgba(192, 13, 14, 0.18);
    background: #fff;
    color: #8A0A0B;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.45rem 1rem;
    transition: var(--transition);
}

.events-cat-tab:hover,
.events-cat-tab.is-active {
    background: #C00D0E;
    border-color: #C00D0E;
    color: #fff;
}

.library-playlist-nav {
    position: sticky;
    top: 5.5rem;
    z-index: 20;
    padding: 1rem;
    border: 1px solid rgba(192, 13, 14, 0.12);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(8px);
}

.library-playlist-nav-track {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.library-playlist-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border-radius: 9999px;
    border: 2px solid rgba(192, 13, 14, 0.16);
    background: #fff;
    color: #8A0A0B;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.5rem 0.95rem;
    transition: var(--transition);
}

.library-playlist-nav-link em {
    font-style: normal;
    min-width: 1.4rem;
    height: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: rgba(192, 13, 14, 0.1);
    font-size: 0.75rem;
}

.library-playlist-nav-link:hover {
    background: #C00D0E;
    border-color: #C00D0E;
    color: #fff;
}

.library-playlist-nav-link:hover em {
    background: rgba(255, 255, 255, 0.2);
}

.library-playlist-block {
    padding: 1.25rem;
    border: 1px solid rgba(192, 13, 14, 0.1);
    border-radius: 1.25rem;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.library-playlist-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(192, 13, 14, 0.08);
}

.library-playlist-kicker {
    margin: 0 0 0.35rem;
    color: #C00D0E;
    font-size: 0.8rem;
    font-weight: 700;
}

.library-playlist-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
}

.library-playlist-count {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    background: rgba(192, 13, 14, 0.08);
    color: #8A0A0B;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
}

.library-playlist-yt-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: #C00D0E;
    font-size: 0.85rem;
    font-weight: 700;
}

.library-playlist-yt-link:hover {
    color: #8A0A0B;
}
