/* ==========================================================================
   HN News Carousel – style.css
   ========================================================================== */

/* ── Reset local ─────────────────────────────────────────────────────────── */
.hn-section,
.hn-section *,
.hn-section *::before,
.hn-section *::after {
    box-sizing: border-box;
}
.hn-section ul,
.hn-section li {
    list-style: none;
    margin:  0;
    padding: 0;
}

/* ── Section wrapper ─────────────────────────────────────────────────────── */
.hn-section {
    background-color: #F5A623;  /* override via shortcode bg_color */
    padding: 32px 0 28px;
    overflow: hidden;
    font-family: inherit;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.hn-header {
    padding: 0 20px;
    margin-bottom: 22px;
}

.hn-heading {
    font-size: clamp(26px, 7vw, 36px);
    font-weight: 900;
    color: #1a1a1a;
    line-height: 1.1;
    margin: 0;
    letter-spacing: -0.02em;
}

.hn-heading__sub {
    display: block;
    color: #ffffff;
    font-weight: 700;
    font-size: clamp(22px, 6vw, 30px);
}

/* ── Swiper overrides ────────────────────────────────────────────────────── */
.hn-swiper {
    padding: 4px 20px 16px !important;   /* espace pour box-shadow */
    overflow: visible !important;
}

/* ── Slides ──────────────────────────────────────────────────────────────── */
.hn-slide {
    width: 78vw   !important;
    max-width: 300px;
    height: auto  !important;
}

@media (min-width: 480px) {
    .hn-slide { width: 260px !important; max-width: 260px; }
}
@media (min-width: 768px) {
    .hn-slide { width: 280px !important; max-width: 280px; }
}
@media (min-width: 1024px) {
    .hn-slide { width: 300px !important; max-width: 300px; }
}

/* ── Card ────────────────────────────────────────────────────────────────── */
.hn-card {
    background: #ffffff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.13);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.hn-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    transform: translateY(-2px);
}

/* ── Card image ──────────────────────────────────────────────────────────── */
.hn-card__img-wrap {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    flex-shrink: 0;
}

.hn-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.hn-card:hover .hn-card__img {
    transform: scale(1.06);
}

/* ── Card body ───────────────────────────────────────────────────────────── */
.hn-card__body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

/* ── Catégorie ───────────────────────────────────────────────────────────── */
.hn-card__cat {
    display: inline-block;
    color: #F5A623;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1;
}

/* ── Titre ───────────────────────────────────────────────────────────────── */
.hn-card__title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.35;
    margin: 0;
    /* Clamp à 2 lignes */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.hn-card__title a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Extrait ─────────────────────────────────────────────────────────────── */
.hn-card__excerpt {
    font-size: 13px;
    color: #666666;
    line-height: 1.55;
    margin: 0;
    /* Clamp à 3 lignes */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.hn-btn {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 100px;
    transition: background 0.22s ease, color 0.22s ease;
    cursor: pointer;
}

/* Bouton "LIRE PLUS" */
.hn-btn--read {
    align-self: flex-start;
    padding: 9px 20px;
    background: #f2f2f2;
    color: #1a1a1a;
    margin-top: 4px;
}

.hn-btn--read:hover {
    background: #F5A623;
    color: #ffffff;
}

/* Bouton "VOIR TOUTE L'ACTUALITÉ" */
.hn-btn--all {
    display: block;
    text-align: center;
    padding: 15px 28px;
    background: #ffffff;
    color: #1a1a1a;
    border-radius: 100px;
    font-size: 13px;
}

.hn-btn--all:hover {
    background: rgba(255, 255, 255, 0.80);
    color: #1a1a1a;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.hn-footer {
    padding: 8px 20px 4px;
}

/* ── État vide ───────────────────────────────────────────────────────────── */
.hn-empty {
    padding: 20px;
    color: #fff;
    font-style: italic;
}

/* ── Accessibilité : focus visible ──────────────────────────────────────── */
.hn-card__title a:focus-visible,
.hn-btn:focus-visible {
    outline: 3px solid #1a1a1a;
    outline-offset: 3px;
    border-radius: 4px;
}

/* ── Respect du mouvement réduit ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .hn-card,
    .hn-card__img,
    .hn-btn {
        transition: none;
    }
}
