/* =============================================================
   Haven Core — Public CSS
   One clean, cohesive stylesheet. No duplicate stacked patches.
   Brand variables (--haven-primary, --haven-accent, --haven-font)
   are injected per-site by haven-core.php.
   ============================================================= */

:root {
    --haven-primary: #E0A52F;
    --haven-accent:  #FFD76A;
    --haven-font:    'Playfair Display', Georgia, serif;
    --haven-ink:     #0d0d0d;
    --haven-ink-2:   #1a1612;
    --haven-paper:   #ffffff;
    --haven-muted:   rgba(0,0,0,.55);
    --haven-line:    rgba(0,0,0,.08);
}

/* ─────────────────────────────────────────────────────────────
   HERO SECTION
   Title sits INSIDE the card on a gradient overlay — never
   floats above siblings, never overlaps the next block.
   ───────────────────────────────────────────────────────────── */

.haven-hero {
    background: var(--haven-ink);
    padding: 28px 0 36px;
}

.haven-hero__grid {
    display: grid;
    gap: 16px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Card — single source of truth for layout, no absolute positioning */
.haven-hero-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 6px;
    aspect-ratio: 16 / 10;
    background: #1a1a1a;
    text-decoration: none;
    color: #fff;
    transition: transform .3s ease;
    isolation: isolate;
}

.haven-hero-card:hover { transform: translateY(-2px); }

.haven-hero-card__media {
    position: absolute;
    inset: 0;
    overflow: hidden;
}
.haven-hero-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s ease;
}
.haven-hero-card:hover .haven-hero-card__media img { transform: scale(1.04); }

/* Gradient shade — dark at the BOTTOM only, so titles read clearly */
.haven-hero-card__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0)   0%,
        rgba(0,0,0,0)   40%,
        rgba(0,0,0,.6)  72%,
        rgba(0,0,0,.92) 100%
    );
    pointer-events: none;
}

.haven-hero-card__body {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 18px 20px 20px;
    z-index: 2;
}

.haven-hero-card__title {
    font-family: var(--haven-font);
    color: #fff;
    margin: 0;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.015em;
    text-shadow: 0 2px 16px rgba(0,0,0,.6);
}

.haven-hero-card--lead .haven-hero-card__title  { font-size: clamp(22px, 3.4vw, 40px); }
.haven-hero-card--small .haven-hero-card__title { font-size: clamp(16px, 1.6vw, 22px); }

.haven-hero-card__excerpt {
    margin: 8px 0 0;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255,255,255,.85);
    max-width: 56ch;
}

/* Desktop layouts */
@media (min-width: 900px) {
    .haven-hero--desktop-one-plus-two .haven-hero__grid {
        grid-template-columns: 2fr 1fr;
        grid-auto-rows: minmax(0, 1fr);
    }
    .haven-hero--desktop-one-plus-two .haven-hero-card--lead {
        grid-row: span 2;
        aspect-ratio: 16 / 11;
    }
    .haven-hero--desktop-one-plus-two .haven-hero-card--small {
        aspect-ratio: 16 / 9;
    }

    .haven-hero--desktop-three-card .haven-hero__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .haven-hero--desktop-carousel .haven-hero__grid {
        grid-auto-flow: column;
        grid-auto-columns: minmax(320px, 1fr);
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .haven-hero--desktop-carousel .haven-hero-card { scroll-snap-align: start; }

    .haven-hero--desktop-disabled { display: none; }
}

/* Mobile layouts (under 900px) */
@media (max-width: 899px) {
    .haven-hero--mobile-stack .haven-hero__grid {
        grid-template-columns: 1fr;
    }
    .haven-hero--mobile-stack .haven-hero-card {
        aspect-ratio: 16 / 10;
    }

    .haven-hero--mobile-carousel .haven-hero__grid {
        grid-auto-flow: column;
        grid-auto-columns: 88%;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px;
    }
    .haven-hero--mobile-carousel .haven-hero-card { scroll-snap-align: start; }

    .haven-hero--mobile-disabled { display: none; }
}

/* ─────────────────────────────────────────────────────────────
   TRENDING TAGS BAR
   One horizontal swipe row on mobile, no wrap unless opted in.
   ───────────────────────────────────────────────────────────── */

.haven-trending {
    background: #f7f5ef;
    border-top: 1px solid var(--haven-line);
    border-bottom: 1px solid var(--haven-line);
}

.haven-trending__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 10px 20px;
}

.haven-trending__label {
    flex-shrink: 0;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--haven-primary);
    border-right: 1px solid var(--haven-line);
    padding-right: 14px;
}

.haven-trending__track {
    display: flex;
    gap: 8px;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1;
}
.haven-trending__track::-webkit-scrollbar { display: none; }

.haven-trending__chip {
    flex-shrink: 0;
    display: inline-block;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--haven-line);
    border-radius: 999px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--haven-ink);
    text-decoration: none;
    white-space: nowrap;
    transition: all .15s ease;
}

.haven-trending__chip:hover {
    background: var(--haven-primary);
    color: #fff;
    border-color: var(--haven-primary);
}

/* Mobile: one-row swipe by default */
@media (max-width: 768px) {
    .haven-trending--mobile-swipe .haven-trending__track {
        flex-wrap: nowrap;
    }
    .haven-trending--mobile-wrap .haven-trending__track {
        flex-wrap: wrap;
        overflow: visible;
    }
}

/* ─────────────────────────────────────────────────────────────
   PARENT-THEME OVERLAY KILL SWITCH
   If a parent theme injects an additional title overlay over the
   hero (the duplicate red headline bug), neutralize it.
   ───────────────────────────────────────────────────────────── */

.haven-hero .entry-title-overlay,
.haven-hero .post-title-overlay,
.haven-hero .feat-overlay-title,
.haven-hero .above-entry-meta {
    display: none !important;
}
