/* ═══════════════════════════════════════════════════════════
   TDN MAGAZINE — Homepage Widgets CSS
   Styles for: Trailer of the Week, Upcoming Releases,
               This Week in Entertainment
═══════════════════════════════════════════════════════════ */

/* ── Shared: widget container & header ───────────────────── */
.tdn-widget-trailer,
.tdn-widget-upcoming,
.tdn-widget-this-week {
    background: #fff;
    border: 1px solid var(--tdn-border, #e5e5e5);
    border-radius: 4px;
    overflow: hidden;
}

.tdn-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px 10px;
    border-bottom: 2px solid var(--tdn-red, #e51a3e);
    background: var(--tdn-black, #121212);
}

.tdn-widget-label {
    font-family: var(--font-headline, 'Barlow Condensed', 'Arial Narrow', sans-serif);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: #fff;
}


/* ════════════════════════════════════════════════════════
   WIDGET 1 — TRAILER OF THE WEEK
════════════════════════════════════════════════════════ */

/* ── Video player area ──────────────────────────────────── */
.tdn-widget-trailer-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    display: block;
    cursor: pointer;
}

.tdn-widget-trailer-player .tdn-lazy-video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease, opacity .2s;
}
.tdn-widget-trailer-player:hover .tdn-lazy-video-thumb {
    transform: scale(1.03);
    opacity: .85;
}

/* Play button — centred over thumbnail */
.tdn-widget-trailer-player .tdn-lazy-video-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform .15s;
}
.tdn-widget-trailer-player .tdn-lazy-video-btn:hover {
    transform: scale(1.08);
}
.tdn-widget-trailer-player .tdn-lazy-video-btn svg {
    width: 64px;
    height: 45px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.5));
}

/* Active: replace thumbnail with iframe */
.tdn-widget-trailer-player.is-playing .tdn-lazy-video-thumb,
.tdn-widget-trailer-player.is-playing .tdn-lazy-video-btn {
    display: none;
}
.tdn-widget-trailer-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Text body beneath video ────────────────────────────── */
.tdn-widget-trailer-body {
    padding: 14px 16px 16px;
}

.tdn-widget-trailer-cat {
    display: inline-block;
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--tdn-red, #e51a3e);
    text-decoration: none;
    margin-bottom: 6px;
}
.tdn-widget-trailer-cat:hover { text-decoration: underline; }

.tdn-widget-trailer-title {
    font-family: var(--font-display, 'DM Serif Display', Georgia, serif);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px;
}
.tdn-widget-trailer-title a {
    color: var(--tdn-text, #1a1a1a);
    text-decoration: none;
}
.tdn-widget-trailer-title a:hover { color: var(--tdn-red, #e51a3e); }

.tdn-widget-trailer-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--tdn-muted, #777);
}
.tdn-widget-trailer-link {
    font-weight: 600;
    color: var(--tdn-red, #e51a3e);
    text-decoration: none;
    font-size: 11px;
    letter-spacing: .3px;
}
.tdn-widget-trailer-link:hover { text-decoration: underline; }


/* ════════════════════════════════════════════════════════
   WIDGET 2 — UPCOMING RELEASES
════════════════════════════════════════════════════════ */

.tdn-widget-upcoming-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tdn-widget-upcoming-item {
    border-bottom: 1px solid var(--tdn-border, #ebebeb);
}
.tdn-widget-upcoming-item:last-child { border-bottom: none; }

.tdn-widget-upcoming-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--tdn-text, #1a1a1a);
    transition: background .12s;
}
.tdn-widget-upcoming-link:hover {
    background: var(--tdn-bg-soft, #f8f8f8);
}

/* Date badge — two-line calendar block */
.tdn-widget-upcoming-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    width: 40px;
    height: 46px;
    background: var(--tdn-red, #e51a3e);
    border-radius: 3px;
    flex-shrink: 0;
    color: #fff;
    line-height: 1;
}
.tdn-widget-upcoming-month {
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: .9;
    margin-bottom: 2px;
}
.tdn-widget-upcoming-day {
    font-family: var(--font-headline, 'Barlow Condensed', 'Arial Narrow', sans-serif);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.5px;
}

/* Body text */
.tdn-widget-upcoming-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.tdn-widget-upcoming-cat {
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--tdn-muted, #888);
}
.tdn-widget-upcoming-title {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--tdn-text, #1a1a1a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tdn-widget-upcoming-link:hover .tdn-widget-upcoming-title {
    color: var(--tdn-red, #e51a3e);
}
.tdn-widget-upcoming-countdown {
    font-size: 10px;
    color: var(--tdn-muted, #999);
    font-style: italic;
}


/* ════════════════════════════════════════════════════════
   WIDGET 3 — THIS WEEK IN ENTERTAINMENT
════════════════════════════════════════════════════════ */

.tdn-widget-this-week-period {
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,.55);
    letter-spacing: .4px;
}

.tdn-widget-this-week-list {
    list-style: none;
    margin: 0;
    padding: 0;
    counter-reset: tdn-week;
}

.tdn-widget-this-week-item {
    border-bottom: 1px solid var(--tdn-border, #ebebeb);
}
.tdn-widget-this-week-item:last-child { border-bottom: none; }

.tdn-widget-this-week-link {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 13px 16px;
    text-decoration: none;
    color: var(--tdn-text, #1a1a1a);
    transition: background .12s;
}
.tdn-widget-this-week-link:hover {
    background: var(--tdn-bg-soft, #f8f8f8);
}

/* Large editorial rank number */
.tdn-widget-this-week-rank {
    font-family: var(--font-headline, 'Barlow Condensed', 'Arial Narrow', sans-serif);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    color: var(--tdn-border, #ddd);
    min-width: 24px;
    text-align: center;
    flex-shrink: 0;
    user-select: none;
    padding-top: 2px;
}
.tdn-widget-this-week-item:first-child .tdn-widget-this-week-rank {
    color: var(--tdn-red, #e51a3e);
}

.tdn-widget-this-week-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.tdn-widget-this-week-cat {
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--tdn-muted, #888);
}
.tdn-widget-this-week-title {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--tdn-text, #1a1a1a);
}
.tdn-widget-this-week-link:hover .tdn-widget-this-week-title {
    color: var(--tdn-red, #e51a3e);
}

.tdn-widget-this-week-footer {
    padding: 10px 16px;
    font-size: 10px;
    color: var(--tdn-muted, #aaa);
    font-style: italic;
    text-align: right;
    margin: 0;
    border-top: 1px solid var(--tdn-border, #ebebeb);
    background: var(--tdn-bg-soft, #fafafa);
}


/* ── Responsive: stack widgets in a 3-col grid when side-by-side ── */
@media ( min-width: 900px ) {
    .tdn-homepage-widgets {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
        align-items: start;
    }
    .tdn-homepage-widget {
        margin-bottom: 0;
        padding: 0;
        background: none;
        border: none;
    }
}
