/* ═══════════════════════════════════════════════════
   TDN MAGAZINE — HOMEPAGE LAYOUT v1.3
═══════════════════════════════════════════════════ */

/* ─── Hero ───────────────────────────────────────── */
.tdn-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--tdn-black);
}
.tdn-hero-img-link { display: block; }
.tdn-hero-img {
    width: 100%;
    height: 540px;
    object-fit: cover;
    display: block;
    opacity: .82;
    transition: opacity .5s ease;
    transform: scale(1.01); /* tiny scale prevents edge flash on hover */
    transition: opacity .5s ease, transform .6s ease;
}
.tdn-hero:hover .tdn-hero-img { opacity: .72; transform: scale(1.03); }
.tdn-hero-content {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,.95) 0%,
        rgba(0,0,0,.72) 45%,
        rgba(0,0,0,.2) 80%,
        transparent 100%
    );
    padding: 72px var(--gutter) 40px;
}
.tdn-hero-inner { max-width: var(--container); margin: 0 auto; }
.tdn-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.tdn-hero-date {
    font-size: .8rem;
    color: rgba(255,255,255,.55);
    font-weight: 500;
    letter-spacing: .3px;
}
.tdn-hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.85rem, 3.6vw, 2.75rem);
    font-weight: 700;
    line-height: 1.18;
    color: var(--tdn-white);
    margin-bottom: 16px;
    max-width: 800px;
    letter-spacing: -.025em;
}
.tdn-hero-title a { color: inherit; text-decoration: none; }
.tdn-hero-title a:hover { color: rgba(255,255,255,.88); }
.tdn-hero-excerpt {
    font-size: .95rem;
    color: rgba(255,255,255,.72);
    line-height: 1.68;
    max-width: 620px;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tdn-hero-byline {
    font-size: .82rem;
    color: rgba(255,255,255,.48);
    display: flex;
    align-items: center;
    gap: 8px;
}
.tdn-hero-byline::before {
    content: '';
    width: 20px;
    height: 1.5px;
    background: var(--tdn-red);
    display: inline-block;
    flex-shrink: 0;
}
.tdn-hero-byline .tdn-author { color: rgba(255,255,255,.78); }

/* ─── Mag container ──────────────────────────────── */
.tdn-mag-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--gutter);
}
.tdn-mag-section { margin-bottom: 52px; }

/* ─── Spotlight (3-col featured) ─────────────────── */
.tdn-spotlight-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
.tdn-spotlight-card { display: flex; flex-direction: column; }
.tdn-spotlight-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    aspect-ratio: 16/9;
    background: var(--tdn-bg-soft);
    margin-bottom: 14px;
}
.tdn-spotlight-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.tdn-spotlight-thumb:hover .tdn-spotlight-img { transform: scale(1.04); }
.tdn-spotlight-thumb .tdn-badge {
    position: absolute;
    top: 10px; left: 10px;
    z-index: 1;
}
.tdn-spotlight-body { display: flex; flex-direction: column; gap: 8px; }
.tdn-spotlight-headline {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--tdn-black);
}
.tdn-spotlight-headline a { color: inherit; text-decoration: none; }
.tdn-spotlight-headline a:hover { color: var(--tdn-red); }
.tdn-spotlight-excerpt {
    font-size: .875rem;
    color: var(--tdn-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── News River ──────────────────────────────────── */
.tdn-river-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 28px;
}
.tdn-river-item {
    display: flex;
    gap: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tdn-border-lt);
}
.tdn-river-thumb {
    display: block;
    width: 100px;
    min-width: 100px;
    height: 70px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--tdn-bg-soft);
    flex-shrink: 0;
}
.tdn-river-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s;
}
.tdn-river-thumb:hover .tdn-river-img { transform: scale(1.06); }
.tdn-river-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.tdn-river-top { display: flex; align-items: center; gap: 8px; }
.tdn-river-headline {
    font-family: var(--font-display);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--tdn-black);
    flex: 1;
}
.tdn-river-headline a { color: inherit; text-decoration: none; }
.tdn-river-headline a:hover { color: var(--tdn-red); }
.tdn-river-excerpt {
    font-size: .8rem;
    color: var(--tdn-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
}

/* ─── Trending ───────────────────────────────────── */
.tdn-section-title--trending {
    display: flex;
    align-items: center;
    gap: 8px;
}
.tdn-trending-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--tdn-red);
    display: inline-block;
    animation: tdnPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}
.tdn-trending-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}
.tdn-trending-card { display: flex; gap: 20px; }
.tdn-trending-thumb {
    position: relative;
    display: block;
    width: 200px;
    min-width: 200px;
    aspect-ratio: 16/9;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--tdn-bg-soft);
    flex-shrink: 0;
}
.tdn-trending-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.tdn-trending-thumb:hover .tdn-trending-img { transform: scale(1.05); }
.tdn-trending-rank {
    position: absolute;
    top: 8px; left: 8px;
    background: var(--tdn-red);
    color: var(--tdn-white);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.tdn-trending-body { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.tdn-cat-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--tdn-red);
    text-decoration: none;
}
.tdn-cat-badge:hover { color: var(--tdn-red-dark); }
.tdn-trending-headline {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--tdn-black);
}
.tdn-trending-headline a { color: inherit; text-decoration: none; }
.tdn-trending-headline a:hover { color: var(--tdn-red); }

/* ─── Category sections (TV / Film / Music) ──────── */
.tdn-cat-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}

/* Lead article */
.tdn-cat-lead-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    aspect-ratio: 16/9;
    background: var(--tdn-bg-soft);
    margin-bottom: 14px;
}
.tdn-cat-lead-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .4s;
}
.tdn-cat-lead-thumb:hover .tdn-cat-lead-img { transform: scale(1.04); }
.tdn-cat-lead-thumb .tdn-badge {
    position: absolute;
    top: 10px; left: 10px;
}
.tdn-cat-lead-body { display: flex; flex-direction: column; gap: 8px; }
.tdn-cat-lead-headline {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--tdn-black);
}
.tdn-cat-lead-headline a { color: inherit; text-decoration: none; }
.tdn-cat-lead-headline a:hover { color: var(--tdn-red); }
.tdn-cat-lead-excerpt {
    font-size: .9rem;
    color: var(--tdn-muted);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sidebar sub-articles */
.tdn-cat-sidebar { display: flex; flex-direction: column; gap: 0; }
.tdn-cat-sub {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--tdn-border-lt);
}
.tdn-cat-sub:first-child { padding-top: 0; }
.tdn-cat-sub:last-child { border-bottom: none; }
.tdn-cat-sub-thumb {
    display: block;
    width: 80px; min-width: 80px;
    height: 60px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--tdn-bg-soft);
    flex-shrink: 0;
}
.tdn-cat-sub-img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .35s;
}
.tdn-cat-sub-thumb:hover .tdn-cat-sub-img { transform: scale(1.06); }
.tdn-cat-sub-body { flex: 1; min-width: 0; }
.tdn-cat-sub-headline {
    font-family: var(--font-display);
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--tdn-black);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tdn-cat-sub-headline a { color: inherit; text-decoration: none; }
.tdn-cat-sub-headline a:hover { color: var(--tdn-red); }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
    .tdn-spotlight-grid { grid-template-columns: repeat(2, 1fr); }
    .tdn-river-grid { grid-template-columns: repeat(2, 1fr); }
    .tdn-cat-layout { grid-template-columns: 1fr; }
    .tdn-cat-sidebar { 
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
    .tdn-cat-sub { flex-direction: column; padding: 0; }
    .tdn-cat-sub-thumb { width: 100%; height: 120px; }
}

@media (max-width: 768px) {
    .tdn-spotlight-grid { grid-template-columns: 1fr; }
    .tdn-river-grid { grid-template-columns: 1fr; }
    .tdn-trending-grid { grid-template-columns: 1fr; }
    .tdn-cat-sidebar { grid-template-columns: 1fr; }
    .tdn-cat-sub { flex-direction: row; padding: 14px 0; }
    .tdn-cat-sub-thumb { width: 80px; height: 60px; }

    /* ── Hero: stacked layout on mobile ── */
    /* Remove fixed height so image scales naturally */
    .tdn-hero-img {
        height: auto;
        max-height: 56vw; /* ~16:9 ratio */
        width: 100%;
        object-fit: cover;
        opacity: 1; /* Full opacity — content is below, not on top */
    }
    .tdn-hero:hover .tdn-hero-img { opacity: 1; }

    /* Detach content from absolute overlay → flow below the image */
    .tdn-hero-content {
        position: static;
        background: var(--tdn-black);
        padding: 20px 16px 24px;
    }

    /* Lighten gradient — not needed when stacked, but keep for 1-px seam */
    .tdn-hero-content::before {
        display: none;
    }

    .tdn-hero-title {
        font-size: 1.35rem;
        margin-bottom: 10px;
    }

    .tdn-hero-excerpt {
        font-size: .9rem;
        -webkit-line-clamp: 3;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .tdn-hero-img {
        max-height: 58vw;
    }
    .tdn-hero-title { font-size: 1.25rem; }
    .tdn-trending-card { flex-direction: column; }
    .tdn-trending-thumb { width: 100%; min-width: unset; }
}
