/* ══════════════════════════════════════════════════════════════════
   Featured Hero — driven by Ghost's "Feature this post" toggle on
   posts tagged main-news (see home.hbs).

   Every selector here is scoped under the fh- prefix and nested under
   .fh-hero so it can never match unrelated markup (.featured-article,
   .side-article, .news-card, .latest-report-section .live-dot, etc.
   are untouched). When no post is Featured, home.hbs renders the
   original .featured-article/.featured-overlay markup instead and
   none of these rules apply at all.
   ══════════════════════════════════════════════════════════════════ */

.fh-hero {
    position: relative;
    min-height: 450px;
}

/* ---- slides (one per featured post, cross-fade between them) ---- */
.fh-hero .fh-slide {
    display: block;
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .6s ease;
    z-index: 1;
}

.fh-hero .fh-slide.fh-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

.fh-hero .fh-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    background: linear-gradient(transparent 15%, rgba(120, 40, 10, .5) 58%, rgba(35, 10, 0, .9));
    padding: 2.5rem;
}

.fh-hero .fh-title {
    font-size: 2rem;
    font-weight: 500;
    font-family: var(--font-serif);
    margin: 0 0 .9rem;
    line-height: 1.3;
    color: #ffffff;
    border-left: 3px solid #ff9142;
    padding-left: 14px;
}

.fh-hero .fh-excerpt {
    opacity: 1;
    font-size: 1.4rem;
    color: #e2e2e2cb;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/* ---- corner ribbon — reuses the site's existing "breaking" red so it
   reads as part of the same visual language, just meaning "top story" ---- */
.fh-hero > .fh-ribbon {
    position: absolute;
    top: 14px;
    left: -2px;
    z-index: 3;
    overflow: hidden;
    background: linear-gradient(100deg, #e74c3c 0%, #ff8a3d 50%, #e74c3c 100%);
    background-size: 220% 100%;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 6px 16px 6px 14px;
    border-radius: 0 6px 6px 0;
    box-shadow: 0 2px 10px rgba(231, 76, 60, .4);
    animation: fhShimmer 2.8s ease-in-out infinite;
}

@keyframes fhShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -40% 0; }
}

/* ---- live indicator — only revealed once a 2nd dot exists, i.e. 2+
   posts are actually in rotation. Pure-CSS gate, no JS/Handlebars
   count logic needed; degrades to "always hidden" on browsers without
   :has(), which only affects this decorative badge, not the rotation. ---- */
.fh-hero > .fh-live {
    display: none;
    align-items: center;
    gap: 6px;
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(4px);
    border-radius: 20px;
    padding: 5px 12px 5px 8px;
}

.fh-hero:has(.fh-dots i:nth-child(2)) > .fh-live {
    display: flex;
}

.fh-hero .fh-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff5a3c;
    position: relative;
    flex-shrink: 0;
}

.fh-hero .fh-live-dot::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1.5px solid #ff5a3c;
    animation: fhLiveRing 1.6s ease-out infinite;
}

@keyframes fhLiveRing {
    0% { transform: scale(.5); opacity: .8; }
    100% { transform: scale(1.8); opacity: 0; }
}

.fh-hero .fh-live-text {
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    font-variant-numeric: tabular-nums;
}

/* ---- rotation dots (same pure-CSS gate as .fh-live) ---- */
.fh-hero > .fh-dots {
    display: none;
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    gap: 6px;
}

.fh-hero:has(.fh-dots i:nth-child(2)) > .fh-dots {
    display: flex;
}

.fh-hero .fh-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .55);
    display: block;
    transition: width .3s ease, background .3s ease;
}

.fh-hero .fh-dots i.fh-active {
    background: #ff9142;
    width: 16px;
    border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .fh-hero > .fh-ribbon { animation: none; background-position: 0 0; }
    .fh-hero .fh-live-dot::before { animation: none; opacity: .4; }
    .fh-hero .fh-slide { transition: none; }
}

/* ---- mobile — mirrors the existing .featured-article breakpoint
   (768px, set in built/screen.css) so the hero shrinks in lockstep
   with the rest of the card instead of leaving empty space. ---- */
@media (max-width: 768px) {
    .fh-hero { min-height: 250px; }
    .fh-hero .fh-overlay { padding: 1.25rem; }
    .fh-hero .fh-title { font-size: 1.6rem; padding-left: 10px; }
    .fh-hero .fh-excerpt { font-size: 1.2rem; }
    .fh-hero > .fh-ribbon { font-size: 11px; padding: 5px 12px 5px 10px; }
    .fh-hero > .fh-live { top: 10px; right: 10px; padding: 4px 10px 4px 7px; }
    .fh-hero > .fh-dots { bottom: 10px; }
}
