/* ============================================================
   HOME — "BROADCAST BLOCK"
   The front page of a printed TV guide: hard-ruled hero with a
   flat rising sun behind the listings card, espresso ticker,
   block programme cards, the full-bleed amber Sabbath band,
   serif mission quote, espresso prayer band, newsletter form.
   ============================================================ */

/* ---------- 1. HERO ---------- */

.home-hero {
    position: relative;
    overflow: hidden;
}

.home-hero-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1.05fr 0.85fr;
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: center;
    padding-block: clamp(3.5rem, 9vh, 6.5rem);
}

/* flat rising sun — a poster, not a decoration: oversized, rising
   behind the headline itself. The ticker's top rule is the horizon. */
.home-sun {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0; /* arcs rest on the hero's bottom rule — the horizon */
    width: clamp(560px, 76vw, 1060px);
    aspect-ratio: 2 / 1;
    pointer-events: none;
}

.home-sun span {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border: var(--bw) solid var(--ink);
    border-bottom: none;
    border-radius: 999px 999px 0 0;
}

.home-sun span:nth-child(1) {
    width: 100%;
    height: 50%;
    background: var(--amber-wash);
}

.home-sun span:nth-child(2) {
    width: 66%;
    height: 33%;
    background: var(--amber-soft);
}

.home-sun span:nth-child(3) {
    width: 34%;
    height: 17%;
    background: var(--amber);
}

/* dawn on arrival — the arcs climb over the horizon, inner last */
@keyframes sun-rise {
    from { transform: translate(-50%, 85%); }
    to   { transform: translate(-50%, 0); }
}

.home-sun span { animation: sun-rise 1s var(--ease-out) backwards; }
.home-sun span:nth-child(1) { animation-delay: 0.05s; }
.home-sun span:nth-child(2) { animation-delay: 0.22s; }
.home-sun span:nth-child(3) { animation-delay: 0.42s; }

@media (prefers-reduced-motion: reduce) {
    .home-sun span { animation: none; }
}

.home-hero-copy { position: relative; z-index: 1; }

.home-hero-title {
    font-size: clamp(2.5rem, 6.2vw, 4.5rem);
    margin-top: 1.2rem;
}

.home-title-serif {
    font-size: 1.06em;
}

.home-hero-lede {
    margin-top: 1.4rem;
    font-size: 1.05rem;
    color: var(--ink-mid);
    max-width: 33rem;
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin-top: 2rem;
}

.home-hero-spec {
    margin-top: 2.4rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.26em;
    color: var(--ink-low);
}

/* ---------- EPG listings card ---------- */

.home-epg-wrap {
    position: relative;
    z-index: 1;
    /* drop-shadow (not box-shadow) so the hard offset follows the torn silhouette */
    filter: drop-shadow(7px 7px 0 var(--ink));
}

/* a listing torn straight out of the printed guide:
   ragged top + bottom edges, straight column rules left and right */
.home-epg {
    background: var(--card);
    border-inline: var(--bw) solid var(--ink);
    transform: rotate(-0.55deg);
    clip-path: polygon(
        0 7px, 4% 2px, 9% 10px, 15% 4px, 22% 11px, 28% 3px, 35% 9px,
        41% 2px, 49% 10px, 56% 4px, 63% 11px, 70% 3px, 78% 9px,
        85% 2px, 92% 10px, 97% 4px, 100% 8px,
        100% calc(100% - 9px), 95% calc(100% - 3px), 89% calc(100% - 12px),
        83% calc(100% - 4px), 76% calc(100% - 13px), 69% calc(100% - 5px),
        61% calc(100% - 14px), 54% calc(100% - 4px), 47% calc(100% - 12px),
        40% calc(100% - 3px), 33% calc(100% - 13px), 26% calc(100% - 5px),
        19% calc(100% - 11px), 12% calc(100% - 3px), 6% calc(100% - 13px),
        2% calc(100% - 5px), 0 calc(100% - 9px)
    );
}

.home-epg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: calc(0.75rem + 9px) 1rem 0.75rem; /* clear the torn top edge */
    background: var(--amber);
    border-bottom: var(--bw) solid var(--ink);
}

.home-epg-live {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.home-epg-station {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.2em;
}

@media (max-width: 480px) {
    .home-epg-station { display: none; }
}

.home-epg-rows { display: flex; flex-direction: column; }

.home-epg-row {
    display: grid;
    grid-template-columns: 3.6rem 1fr auto;
    align-items: center;
    gap: 0.9rem;
    padding: 0.72rem 1rem;
    border-bottom: 1px solid var(--hairline);
    transition: background var(--t-fast) linear;
}

/* running a finger down the listings */
.home-epg-row:not(.prime):hover { background: var(--amber-wash); }

.home-epg-time {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
}

.home-epg-title {
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-epg-tag {
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    border: 1.5px solid var(--ink);
    padding: 0.2em 0.5em;
    background: var(--paper);
}

/* prime time = the espresso row */
.home-epg-row.prime {
    background: var(--ink);
    color: var(--on-dark);
    border-bottom-color: var(--ink);
}

.home-epg-row.prime .home-epg-time { color: var(--amber); }

.home-epg-row.prime .home-epg-tag {
    background: var(--amber);
    color: var(--ink);
    border-color: var(--amber);
}

.home-epg-note {
    padding: 0.7rem 1rem calc(0.7rem + 11px); /* clear the torn bottom edge */
    font-family: var(--font-mono);
    font-size: 0.64rem;
    color: var(--ink-low);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-epg-note a {
    color: var(--ink);
    font-weight: 700;
    text-decoration-color: var(--amber);
    text-decoration-thickness: 2px;
}

/* ---------- Ticker strip ---------- */

.home-ticker {
    position: relative; /* paint above the horizon sun */
    display: flex;
    align-items: stretch;
    border-block: var(--bw) solid var(--ink);
    background: var(--ink);
    color: var(--on-dark);
}

.home-ticker-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    flex: none;
    padding: 0.55rem 1.1rem;
    background: var(--amber);
    color: var(--ink);
    border-right: var(--bw) solid var(--ink);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2em;
}

.home-ticker-clip {
    overflow: hidden;
    display: flex;
    align-items: center;
    flex: 1;
}

.home-ticker-track {
    display: inline-flex;
    align-items: center;
    gap: 1.6rem;
    padding-inline: 1.6rem;
    white-space: nowrap;
    animation: ticker-scroll 32s linear infinite;
}

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

.home-ticker-item {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.home-ticker-sep {
    color: var(--amber);
    font-size: 0.5rem;
}

/* ---------- 2. PROGRAMMES ---------- */

.home-prog-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 2rem;
    max-width: none;
}

.home-prog-head .sec-sub {
    text-align: right;
    margin-top: 0;
    padding-bottom: 0.4rem;
}

@media (max-width: 760px) {
    .home-prog-head { flex-direction: column; align-items: flex-start; }
    .home-prog-head .sec-sub { text-align: left; }
}

.home-prog-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.4rem;
}

@media (max-width: 1024px) { .home-prog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .home-prog-grid { grid-template-columns: 1fr; } }

.home-prog-card {
    display: flex;
    flex-direction: column;
}

.home-prog-art {
    position: relative;
    background: var(--paper-deep);
    border-bottom: var(--bw) solid var(--ink);
    padding: 1.8rem 1.4rem 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 7.5rem;
    transition: background var(--t-fast) linear;
}

.home-prog-art img {
    max-height: 5rem;
    width: auto;
    transition: transform var(--t-fast) var(--ease-snap);
}

.home-prog-card:hover .home-prog-art { background: var(--amber-wash); }
.home-prog-card:hover .home-prog-art img { transform: translateY(-4px); }

.home-prog-num {
    position: absolute;
    top: 0.7rem;
    left: 0.7rem;
    font-size: 0.72rem;
}

.home-prog-body {
    padding: 1.1rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.home-prog-name {
    font-size: 0.98rem;
    line-height: 1.2;
}

.home-prog-desc {
    margin-top: 0.6rem;
    font-size: 0.86rem;
    color: var(--ink-mid);
    flex: 1;
}

.home-prog-meta {
    margin-top: 1rem;
    padding-top: 0.7rem;
    border-top: 1.5px solid var(--ink);
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--amber-ink);
}

.home-prog-more {
    margin-top: 2.4rem;
    text-align: center;
}

/* ---------- 3. SABBATH: THE AMBER BLOCK ---------- */

.home-sabbath {
    background: var(--amber);
    border-block: var(--bw) solid var(--ink);
}

/* section+section already draws a top rule; avoid doubling */
.section + .home-sabbath { border-top-width: var(--bw); }

.home-sabbath .kicker { color: var(--ink); }
.home-sabbath .kicker::before { background: var(--ink); }

.home-sabbath-title {
    font-size: clamp(2rem, 4.6vw, 3.4rem);
    line-height: 1.06;
    margin-top: 1rem;
    max-width: 16em;
}

/* "prime time." flips espresso — the same move as the EPG prime row */
.home-sabbath-hl {
    background: var(--ink);
    color: var(--amber);
    padding: 0.04em 0.18em;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.home-sabbath-grid {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: center;
    margin-top: clamp(2rem, 5vh, 3.4rem);
}

@media (max-width: 900px) {
    .home-sabbath-grid { grid-template-columns: 1fr; }
}

.home-sabbath-copy {
    margin-bottom: 1.8rem;
    color: rgba(24, 16, 8, 0.78);
    max-width: 30rem;
}

.home-sabbath-slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.1rem;
}

@media (max-width: 480px) {
    .home-sabbath-slots { grid-template-columns: 1fr; }
}

.home-slot {
    background: var(--card);
    border: var(--bw) solid var(--ink);
    box-shadow: var(--drop);
    padding: 1rem 1.1rem;
    transition: transform var(--t-fast) var(--ease-snap),
                box-shadow var(--t-fast) var(--ease-snap);
}

.home-slot:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--ink);
}

.home-slot dt {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--amber-ink);
}

.home-slot dd {
    margin-top: 0.35rem;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Vespers is the prime slot — it flips espresso, like the EPG prime row */
.home-slot-prime {
    background: var(--ink);
    color: var(--on-dark);
}

.home-slot-prime dt { color: var(--amber); }

/* ---------- 4. MISSION ---------- */

.home-mission-inner {
    max-width: 52rem;
    text-align: center;
}

.home-mission-quote .serif-grad {
    font-size: clamp(1.5rem, 3.4vw, 2.3rem);
    line-height: 1.35;
    display: inline;
    /* the amber underline is swept on like a marker as the quote reveals */
    background-size: 0% 0.28em;
    transition: background-size 1.1s var(--ease-out) 0.35s;
}

.home-mission-quote.is-visible .serif-grad { background-size: 100% 0.28em; }

@media (prefers-reduced-motion: reduce) {
    .home-mission-quote .serif-grad {
        background-size: 100% 0.28em;
        transition: none;
    }
}

.home-mission-quote cite {
    display: block;
    margin-top: 1.2rem;
    font-family: var(--font-mono);
    font-style: normal;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    color: var(--ink-low);
}

.home-mission-copy {
    margin-top: 2rem;
    color: var(--ink-mid);
    max-width: 40rem;
    margin-inline: auto;
}

.home-mission-values {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.1rem;
    margin-top: 2.4rem;
    text-align: left;
}

@media (max-width: 820px) {
    .home-mission-values { grid-template-columns: 1fr; }
}

.home-mission-values li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1.05rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: var(--drop-sm);
}

/* ---------- 5. PRAYER: ESPRESSO BAND ---------- */

.home-prayer { text-align: center; }

.home-prayer-inner { max-width: 46rem; }

.home-prayer .kicker { justify-content: center; }

.home-prayer-title {
    font-size: clamp(1.9rem, 4.2vw, 3rem);
    margin-top: 1rem;
    color: var(--on-dark);
}

.home-prayer-copy {
    margin-top: 1.2rem;
    margin-bottom: 2rem;
    color: var(--on-dark-mid);
    max-width: 36rem;
    margin-inline: auto;
}

/* ---------- 6. NEWSLETTER ---------- */

.home-newsletter { background: var(--paper-deep); }

.home-newsletter-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(2rem, 6vw, 4.5rem);
    align-items: center;
}

@media (max-width: 860px) {
    .home-newsletter-inner { grid-template-columns: 1fr; }
}

.home-newsletter-title {
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    margin-top: 0.9rem;
    margin-bottom: 0.7rem;
}

.home-newsletter-copy p:last-child {
    color: var(--ink-mid);
    font-size: 0.95rem;
}

.home-newsletter-form {
    display: flex;
    gap: 0;
    border: var(--bw) solid var(--ink);
    background: var(--card);
    box-shadow: var(--drop);
}

.home-newsletter-form input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--ink);
    padding: 0.85em 1em;
}

.home-newsletter-form input::placeholder { color: var(--ink-low); }

.home-newsletter-form .btn {
    border: none;
    border-left: var(--bw) solid var(--ink);
    box-shadow: none;
}

.home-newsletter-form .btn:hover { transform: none; }

.home-subscribe-note {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-top: 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--olive);
}

.home-privacy-note {
    margin-top: 0.7rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-low);
}

/* ---------- Responsive hero ---------- */

@media (max-width: 1024px) {
    .home-hero-grid { grid-template-columns: 1fr; }
    .home-sun { width: min(92vw, 640px); }
}

@media (max-width: 640px) {
    .home-hero-actions .btn { width: 100%; }
    .home-ticker-label { padding-inline: 0.8rem; }
    .home-sun { display: none; }
}
