/**
 * Homepage section rhythm.
 *
 * Every rail on the front page (Trending, Premium Categories, Picked for you,
 * Because you watched, Recently Uploaded) used to carry its own inline padding
 * and its own heading level, so the sections drifted out of alignment with the
 * card grids underneath them. `.tdtv-section-head` is the shared treatment:
 * flush-left title (so it lines up with the first card), an optional subtitle
 * and action link, a hairline rule and a short accent underline.
 *
 * Scoped to the class rather than to `.trending` / `.trending1` themselves so
 * archive, search and single pages keep their existing headings untouched.
 */

/* --------------------------------------------------------------------------
   Section head
   -------------------------------------------------------------------------- */

.tdtv-section-head {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    clear: both;
    margin: 34px 0 18px;
    /* Flush left: the heading lines up with the first card of the grid below. */
    padding: 0 0 12px;
    border-bottom: 1px solid var(--tdtv-border, rgba(255, 255, 255, .07));
}

/* Short accent rule riding on the hairline. */
.tdtv-section-head::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 64px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--tdtv-accent, #ffdd95), rgba(255, 221, 149, 0));
}

.tdtv-section-head > h1,
.tdtv-section-head > h4 {
    order: 1;
    margin: 0;
    padding: 0;
    font-size: 24px;
    line-height: 1.15;
}

.tdtv-section-head > .tdtv-icon {
    order: 1;
    color: var(--tdtv-accent, #ffdd95);
    line-height: 0;
}

.tdtv-section-sub {
    order: 3;
    /* Own line, under the title and the action link. */
    flex: 0 0 100%;
    margin: 2px 0 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--tdtv-muted, #9aa0ac);
}

.tdtv-section-link {
    order: 2;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--tdtv-muted, #9aa0ac);
    text-decoration: none !important;
    transition: color .18s var(--tdtv-ease, ease), background .18s var(--tdtv-ease, ease), border-color .18s var(--tdtv-ease, ease);
}

.tdtv-section-link::after {
    content: '\2192';
    font-size: 14px;
    line-height: 1;
    transition: transform .18s var(--tdtv-ease, ease);
}

.tdtv-section-link:hover,
.tdtv-section-link:focus-visible {
    color: var(--tdtv-accent, #ffdd95);
    background: rgba(255, 221, 149, .08);
    border-color: rgba(255, 221, 149, .32);
}

.tdtv-section-link:hover::after {
    transform: translateX(3px);
}

/* Hero head — the first section on the page carries a wider accent. */
.tdtv-section-head--hero {
    margin-top: 18px;
}

.tdtv-section-head--hero::after {
    width: 104px;
    height: 3px;
}

@media (prefers-reduced-motion: no-preference) {
    .tdtv-section-head--hero .tdtv-icon--flame {
        transform-origin: 50% 80%;
        animation: tdtv-flame 3.2s ease-in-out infinite;
    }
}

@keyframes tdtv-flame {
    0%,
    100% {
        opacity: .72;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.14);
    }
}

/* --------------------------------------------------------------------------
   Premium categories — a panel instead of loose centred text
   -------------------------------------------------------------------------- */

#premium-categories {
    clear: both;
}

#premium-categories .category-cloud {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 18px 16px;
    background: var(--tdtv-surface, #16171c);
    border: 1px solid var(--tdtv-border, rgba(255, 255, 255, .07));
    border-radius: var(--tdtv-radius, 14px);
}

/* The flex gap replaces the pills' own margins. */
#premium-categories .category-cloud .premium-tag {
    margin: 0;
}

/* --------------------------------------------------------------------------
   Scroll reveal
   Class is added by assets/js/main.js, and only to sections that start below
   the fold — with no JS, or above the fold, content renders as normal.
   -------------------------------------------------------------------------- */

.tdtv-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .5s var(--tdtv-ease, ease), transform .5s var(--tdtv-ease, ease);
}

.tdtv-reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (max-width: 768px) {
    .tdtv-section-head {
        margin: 24px 0 14px;
        padding-bottom: 10px;
        gap: 2px 8px;
    }

    /* .new-font2/.new-font3 pin 24px with !important, so shrink the spans
       themselves — otherwise the title crowds out the action link. */
    .tdtv-section-head > h1,
    .tdtv-section-head > h4,
    .tdtv-section-head > h1 .new-font2,
    .tdtv-section-head > h1 .new-font3,
    .tdtv-section-head > h4 .new-font2,
    .tdtv-section-head > h4 .new-font3 {
        font-size: 20px !important;
    }

    .tdtv-section-sub {
        font-size: 12px;
    }

    .tdtv-section-link {
        padding: 4px 9px;
        font-size: 11px;
    }

    #premium-categories .category-cloud {
        gap: 8px;
        padding: 14px 12px;
    }
}

/* --------------------------------------------------------------------------
   2026 homepage direction — editorial structure around the existing cards
   -------------------------------------------------------------------------- */

body.home #wrap,
body.front-page #wrap,
body.tdtv-explore #wrap {
    width: min(100%, 1480px);
    padding: 22px clamp(14px, 2.4vw, 34px) 44px;
    box-sizing: border-box;
}

.tdtv-home-intro {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin: 4px 0 22px;
    padding: clamp(24px, 4vw, 52px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 22px;
    background:
        linear-gradient(115deg, rgba(255, 221, 149, .1), transparent 42%),
        linear-gradient(145deg, #1c1d22 0%, #121318 74%);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .3);
}

.tdtv-home-intro::after {
    content: '';
    position: absolute;
    width: 260px;
    height: 260px;
    right: -105px;
    top: -135px;
    border: 1px solid rgba(255, 221, 149, .2);
    border-radius: 50%;
    box-shadow: 0 0 0 40px rgba(255, 221, 149, .025), 0 0 0 80px rgba(255, 221, 149, .018);
    pointer-events: none;
}

.tdtv-home-intro__copy {
    position: relative;
    z-index: 1;
    max-width: 780px;
}

.tdtv-home-eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--tdtv-accent, #ffdd95);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    line-height: 1.2;
    text-transform: uppercase;
}

.tdtv-home-intro h1 {
    margin: 0;
    max-width: 720px;
    color: var(--tdtv-text, #f5f6f8);
    font-size: clamp(30px, 4.5vw, 58px);
    font-weight: 700;
    letter-spacing: -.045em;
    line-height: 1.02;
}

.tdtv-home-intro p {
    max-width: 680px;
    margin: 18px 0 0;
    color: #b2b6c0;
    font-size: clamp(14px, 1.4vw, 17px);
    line-height: 1.65;
}

.tdtv-home-primary-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid rgba(255, 221, 149, .36);
    border-radius: 10px;
    background: var(--tdtv-accent, #ffdd95);
    color: #17130b !important;
    font-size: 13px;
    font-weight: 750;
    letter-spacing: .01em;
    text-decoration: none !important;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.tdtv-home-primary-link:hover,
.tdtv-home-primary-link:focus-visible {
    background: #ffe6ad;
    box-shadow: 0 10px 28px rgba(255, 221, 149, .15);
    transform: translateY(-2px);
}

.tdtv-home-primary-link .tdtv-icon {
    width: 17px;
    height: 17px;
}

body.home .tdtv-section-head,
body.front-page .tdtv-section-head,
body.tdtv-explore .tdtv-section-head {
    margin-top: 48px;
}

body.home .tdtv-section-head > h4,
body.front-page .tdtv-section-head > h4,
body.tdtv-explore .tdtv-section-head > h4 {
    color: var(--tdtv-text, #f5f6f8);
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.025em;
}

#premium-categories .category-cloud {
    justify-content: flex-start;
    gap: 9px;
    padding: 18px;
    border-color: rgba(255, 255, 255, .08);
    background: linear-gradient(145deg, #17181d, #121318);
}

#premium-categories .premium-tag {
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 8px;
    background: #202126;
    box-shadow: none;
    color: #d9dbe1;
    font-size: 13px;
}

#premium-categories .premium-tag:hover,
#premium-categories .premium-tag:focus-visible {
    border-color: rgba(255, 221, 149, .45);
    background: rgba(255, 221, 149, .1);
    box-shadow: none;
    color: var(--tdtv-accent, #ffdd95) !important;
    transform: translateY(-1px);
}

.homepage-about {
    margin: 58px 0 12px;
    padding: clamp(22px, 3vw, 34px);
    border-left: 3px solid var(--tdtv-accent, #ffdd95);
    border-radius: 0 14px 14px 0;
    background: rgba(255, 255, 255, .025);
    text-align: left;
}

.homepage-about h2 {
    margin: 0 0 10px;
    color: var(--tdtv-text, #f5f6f8);
    font-size: clamp(20px, 2.4vw, 28px);
    font-weight: 700;
    letter-spacing: -.025em;
}

.homepage-about p {
    max-width: 860px;
    margin: 0;
    color: var(--tdtv-muted, #9aa0ac);
    font-size: 14px;
    line-height: 1.75;
}

.homepage-about p + p {
    margin-top: 10px;
}

.tdtv-section-head--archive {
    margin-top: 12px !important;
    padding: clamp(22px, 3vw, 34px) 0 18px;
}

.tdtv-section-head--archive > h4,
.tdtv-section-head--archive > h4 span {
    font-size: clamp(27px, 3.5vw, 42px) !important;
    letter-spacing: -.04em;
}

@media (max-width: 768px) {
    body.home #wrap,
    body.front-page #wrap,
    body.tdtv-explore #wrap {
        padding: 14px 12px 34px;
    }

    .tdtv-home-intro {
        align-items: flex-start;
        flex-direction: column;
        gap: 22px;
        padding: 24px 20px;
        border-radius: 16px;
    }

    .tdtv-home-intro h1 {
        font-size: clamp(29px, 10vw, 42px);
    }

    .tdtv-home-primary-link {
        width: 100%;
        box-sizing: border-box;
    }

    body.home .tdtv-section-head,
    body.front-page .tdtv-section-head,
    body.tdtv-explore .tdtv-section-head {
        margin-top: 34px;
    }

    #premium-categories .category-cloud {
        padding: 14px;
    }

    .homepage-about {
        margin-top: 42px;
    }
}
