/* ============================================================
   CATEGORY PAGE — Pages communes / catégories
   ============================================================ */

/* ---- Hero Banner ---- */
.cat-hero {
    position: relative;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.cat-hero__video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    z-index: 0;
}

.cat-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.65) 100%);
    z-index: 1;
}

.cat-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1228px;
    margin: 0 auto;
    padding: 40px 16px 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.cat-hero__text {
    flex: 1 1 400px;
    min-width: 0;
}

.cat-hero__badge {
    display: inline-block;
    background: #ba1d41;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 4px;
    margin-bottom: 14px;
    letter-spacing: .03em;
}

.cat-hero__title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.15;
}

.cat-hero__desc {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.4rem;
    color: rgba(255,255,255,.85);
    margin: 0;
    line-height: 1.5;
    max-width: 520px;
}

/* Info card */
.cat-hero__infocard {
    flex: 0 0 auto;
    width: 380px;
    background: rgba(30, 30, 30, .92);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
}

.cat-hero__infocard-pin {
    margin-bottom: 8px;
}

.cat-hero__infocard-title {
    display: block;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.cat-hero__infocard-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.25rem;
    line-height: 1.7;
}

.cat-hero__infocard-list li::before {
    content: '✓';
    margin-right: 8px;
    color: rgba(255,255,255,.6);
}

.cat-hero__infocard-list a {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s;
}

.cat-hero__infocard-list a:hover {
    color: #bbb;
}

/* ---- Content layout ---- */
.cat-content {
    max-width: 1228px;
    margin: 0 auto;
    padding: 32px 16px 48px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

/* ---- Section headings ---- */
.cat-section__heading {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #202020;
    margin: 0 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e4ee;
    display: flex;
    align-items: center;
}

.cat-section + .cat-section {
    margin-top: 36px;
}

/* ---- Featured article (À la une) ---- */
.cat-featured {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
}

.cat-featured__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.cat-featured__image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.cat-featured__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cat-featured__image-meta {
    position: absolute;
    bottom: 12px;
    left: 14px;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(4px);
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.1rem;
    padding: 4px 10px;
    border-radius: 6px;
}

.cat-featured__body {
    padding: 20px 22px 24px;
}

.cat-featured__title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    color: #202020;
    margin: 0 0 10px;
}

.cat-featured__link:hover .cat-featured__title {
    color: #ba1d41;
}

.cat-featured__excerpt {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.3rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Articles grid ---- */
.cat-articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.cat-card {
    position: relative;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    transition: box-shadow .2s;
}

.cat-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
}

.cat-card .bookmark-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
}

.cat-card__link {
    display: block;
    text-decoration: none;
}

.cat-card__feat {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.cat-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.cat-card:hover .cat-card__img {
    transform: scale(1.04);
}

/* Video preview overlay */
.cat-card__video-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0;
    transition: opacity .4s;
}
.cat-card__video-preview.is-playing {
    opacity: 1;
}

/* Play button overlay */
.cat-card__play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 52px; height: 52px;
    z-index: 2;
    pointer-events: none;
    opacity: .85;
    transition: opacity .25s, transform .25s;
}
.cat-featured .cat-card__play {
    width: 72px; height: 72px;
}
.cat-card:hover .cat-card__play,
.cat-featured:hover .cat-card__play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}
.cat-card__video-preview.is-playing ~ .cat-card__play {
    opacity: 0;
}
}

.cat-card__img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f1f5;
    color: #b0b4c8;
}

.cat-card__img--placeholder svg {
    width: 36px;
    height: 36px;
}

.cat-card__categories {
    padding: 10px 14px 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cat-card__cat {
    display: inline-block;
    background: var(--g-color, #ba1d41);
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: .02em;
}

.cat-card__title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
    color: #202020;
    margin: 0;
    padding: 8px 14px 0;
}

.cat-card__title a {
    color: inherit;
    text-decoration: none;
}

.cat-card:hover .cat-card__title a {
    color: #ba1d41;
}

.cat-card__excerpt {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.35rem;
    line-height: 150%;
    color: #555;
    margin: 8px 0 0;
    padding: 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-card__meta {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    padding: 8px 14px 14px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.1rem;
    color: #8b8fa0;
}

.cat-card__meta svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.cat-card__comments {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 6px;
}

.cat-card__comments svg {
    width: 14px;
    height: 14px;
}

/* ---- "Voir plus" button ---- */
.cat-more {
    text-align: center;
    margin-top: 24px;
}

.cat-more__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #202020;
    background: #fff;
    border: 1px solid #d0d3de;
    border-radius: 8px;
    padding: 10px 22px;
    text-decoration: none;
    transition: background .2s, border-color .2s;
}

.cat-more__btn:hover {
    background: #f5f6fa;
    border-color: #b0b4c8;
}

/* ---- SIDEBAR ---- */
.cat-sidebar__block {
    background: #f0f1f5;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(0,0,0,.06);
    padding: 20px;
    margin-bottom: 20px;
}

.cat-sidebar__block-title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #202020;
    margin: 0 0 16px;
}

/* Populaire en ce moment — style tendance */
.cat-sidebar__block--trend {
    padding: 0;
}

.cat-sidebar__block--trend .cat-sidebar__block-title {
    padding: 14px 16px 0;
    margin-bottom: 0;
}

.cat-sidebar__block--trend .cat-sidebar__popular {
    display: flex;
    flex-direction: column;
}

.cat-trend {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #e2e4ee;
    transition: background .15s ease;
}

.cat-trend:last-child {
    border-bottom: none;
}

.cat-trend:hover {
    background: rgba(0,0,0,.03);
}

.cat-trend:hover .cat-trend__title {
    text-decoration: underline;
    text-underline-position: under;
}

.cat-trend__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-trend__source {
    display: inline-block;
    background: var(--g-color, #ba1d41);
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.4;
    align-self: flex-start;
}

.cat-trend__title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 140%;
    color: #202020;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-trend__time {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.05rem;
    color: #a0a4b8;
    line-height: 1;
}

.cat-trend__thumb {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    margin: 0;
}

.cat-trend__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sidebar item wrapper and hover preview */
.cat-sidebar__item-wrap {
    position: relative;
}

.cat-sidebar__preview {
    display: none;
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    width: 300px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.08);
    z-index: 100;
    pointer-events: none;
    border: 1px solid #e2e4ee;
}

.cat-sidebar__preview::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -7px;
    transform: translateY(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: #fff;
    border-right: 1px solid #e2e4ee;
    border-top: 1px solid #e2e4ee;
    z-index: 1;
}

.cat-sidebar__item-wrap:hover .cat-sidebar__preview {
    display: block;
    animation: cat-sidebar-preview-in .2s ease both;
}

@keyframes cat-sidebar-preview-in {
    from { opacity: 0; transform: translateY(-50%) translateX(6px); }
    to   { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.cat-sidebar__preview-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.cat-sidebar__preview-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-sidebar__preview-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-sidebar__preview-cat {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--g-color, #ba1d41);
    letter-spacing: 0.03em;
    line-height: 1;
}

.cat-sidebar__preview-title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 140%;
    color: #202020;
    margin: 0;
}

.cat-sidebar__preview-excerpt {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.2rem;
    line-height: 150%;
    color: #555;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-sidebar__preview-time {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.05rem;
    color: #a0a4b8;
    line-height: 1;
}

/* Derniers articles */
.cat-latest {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 12px 0;
    border-bottom: 1px solid #f0f1f5;
}

.cat-latest:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.cat-latest:first-child {
    padding-top: 0;
}

.cat-latest__thumb {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    margin: 0;
    border-radius: 6px;
    overflow: hidden;
}

.cat-latest__img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    display: block;
}

.cat-latest__body {
    flex: 1;
    min-width: 0;
}

.cat-latest__title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    color: #202020;
    margin: 0 0 4px;
}

.cat-latest:hover .cat-latest__title {
    color: #ba1d41;
}

.cat-latest__body .cat-trend__source {
    margin-bottom: 5px;
}

.cat-latest__meta {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.05rem;
    color: #8b8fa0;
}

/* Communes voisines */
.cat-neighbors {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cat-neighbors__item {
    border-bottom: 1px solid #f0f1f5;
}

.cat-neighbors__item:last-child {
    border-bottom: none;
}

.cat-neighbors__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    text-decoration: none;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #202020;
    transition: color .2s;
}

.cat-neighbors__link:hover {
    color: #ba1d41;
}

.cat-neighbors__icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* ---- Responsive ---- */
@media (min-width: 880px) {
    .cat-hero {
        min-height: 380px;
    }

    .cat-hero__inner {
        padding: 48px 32px 36px;
    }

    .cat-hero__title {
        font-size: 3.4rem;
    }

    .cat-hero__desc {
        font-size: 1.5rem;
    }

    .cat-content {
        padding: 36px 32px 56px;
        grid-template-columns: 1fr 300px;
        gap: 40px;
    }

    .cat-articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .cat-hero {
        min-height: 420px;
    }

    .cat-hero__inner {
        padding: 56px 0 40px;
    }

    .cat-hero__title {
        font-size: 3.8rem;
    }

    .cat-content {
        padding: 40px 0 64px;
        grid-template-columns: 1fr 320px;
        gap: 48px;
    }

    .cat-articles-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* ---- Calendrier Événements Sidebar ---- */
.cat-evt-calendar {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 16px;
    font-size: 0.9rem;
}

.cat-evt-calendar__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cat-evt-cal-nav {
    background: none;
    border: 1px solid #d7dbe2;
    color: #333;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s;
}

.cat-evt-cal-nav:hover {
    border-color: #ba1d41;
    color: #ba1d41;
}

.cat-evt-calendar__month {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

.cat-evt-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.cat-evt-cal-head {
    text-align: center;
    font-weight: 600;
    font-size: 0.75rem;
    color: #666;
    padding: 4px 0;
    text-transform: uppercase;
}

.cat-evt-calendar__days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.cat-evt-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #e0e0e0;
    font-size: 0.8rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-evt-cal-day:hover {
    border-color: #ba1d41;
    background: #fff5f7;
}

.cat-evt-cal-day--other-month {
    color: #ccc;
    background: #fafafa;
    cursor: default;
}

.cat-evt-cal-day--other-month:hover {
    border-color: #e0e0e0;
    background: #fafafa;
}

.cat-evt-cal-day--today {
    background: #ba1d41;
    color: #fff;
    font-weight: 600;
    border-color: #ba1d41;
}

.cat-evt-cal-day--has-events {
    font-weight: 600;
}

.cat-evt-cal-day__num {
    display: block;
}

.cat-evt-cal-day__dot {
    position: absolute;
    bottom: 2px;
    width: 4px;
    height: 4px;
    background: #ba1d41;
    border-radius: 50%;
}

.cat-evt-cal-day--today .cat-evt-cal-day__dot {
    background: #fff;
}

.cat-evt-more-link {
    display: inline-block;
    color: #ba1d41;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.cat-evt-more-link:hover {
    color: #8b1635;
}

/* ============================================================
   AF-EVENTS — Bloc agenda compact (category sidebar)
   ============================================================ */

@media (max-width: 1180px) {
    .af-events__preview {
        display: none !important;
    }
}
}

@media (max-width: 559px) {
    .cat-articles-grid {
        grid-template-columns: 1fr;
    }

    .cat-hero__infocard {
        width: 100%;
    }

    .cat-hero__title {
        font-size: 2.2rem;
    }
}

@media (max-width: 1100px) {
    .cat-sidebar__preview {
        display: none !important;
    }
}

/* ============================================================
   EMPTY STATE (no articles in category)
   ============================================================ */
.cat-empty {
    max-width: 600px;
    margin: 60px auto 80px;
    text-align: center;
    padding: 0 20px;
}

.cat-empty__inner {
    background: #f9f9fb;
    border-radius: 16px;
    padding: 48px 32px 40px;
}

.cat-empty__icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
}

.cat-empty__icon svg {
    width: 100%;
    height: 100%;
}

.cat-empty__title {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #202020;
    margin-bottom: 10px;
}

.cat-empty__text {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.5rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 20px;
}

.cat-empty__text strong {
    color: #ba1d41;
}

.cat-empty__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 28px;
}

.cat-empty__dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ba1d41;
    opacity: .3;
    animation: catEmptyPulse 1.4s ease-in-out infinite;
}

.cat-empty__dots span:nth-child(2) {
    animation-delay: .2s;
}

.cat-empty__dots span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes catEmptyPulse {
    0%, 100% { opacity: .2; transform: scale(.85); }
    50%      { opacity: .6; transform: scale(1.1); }
}

.cat-empty__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    background: #ba1d41;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    transition: background .2s, transform .15s;
}

.cat-empty__btn:hover {
    background: #a01838;
    transform: translateY(-1px);
}

.cat-empty__btn svg {
    transition: transform .2s;
}

.cat-empty__btn:hover svg {
    transform: translateX(3px);
}
