/* Wormatia TV page ([wormatia_tv]): newest "Wormatia aktuell!" episode and video tiles. */

/* Featured episode */
.wm-tv-featured {
    display: grid;
    gap: 1rem 1.75rem;
    padding: clamp(1rem, 2.5vw, 1.75rem);
    border: 1px solid var(--wm-line);
    border-top: 4px solid var(--wm-red);
    border-radius: var(--wm-radius);
    background: var(--wm-surface-2);
    box-shadow: var(--wm-shadow);
}
@media (min-width: 900px) {
    .wm-tv-featured { grid-template-columns: 3fr 2fr; align-items: start; }
}
.wm-theme .entry-content .wm-tv-featured :is(h3, p) { max-width: none; }

/* Player: local thumbnail behind the consent placeholder until YouTube is allowed */
.wm-tv-player {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: var(--wm-radius-sm);
    background: var(--wm-night) var(--wm-tv-poster, none) center / cover no-repeat;
}
.wm-tv-player .wc-video,
.wm-tv-player .wc-video iframe { width: 100%; height: 100%; margin: 0; }
.wm-tv-player .wc-video iframe { aspect-ratio: auto; border: 0; }
.wm-theme .wm-tv-player .wc-placeholder {
    position: absolute;
    inset: auto .75rem .75rem;
    margin: 0;
    padding: .9rem 1rem;
    border: 0;
    border-radius: var(--wm-radius-sm);
    background: rgb(255 255 255 / 92%);
    color: #242424;
    font-size: var(--wm-step--1);
    box-shadow: 0 6px 24px rgb(0 0 0 / 35%);
}
.wm-theme .wm-tv-player .wc-placeholder p { margin: 0 0 .5em; }
@media (max-width: 599px) {
    /* Too little room on the image: show the placeholder below it */
    .wm-tv-player:has(.wc-placeholder:not([hidden])) { aspect-ratio: auto; background-size: 100% auto; background-position: top; padding-top: 56.25%; }
    .wm-theme .wm-tv-player .wc-placeholder { position: static; border-radius: 0; box-shadow: none; }
}

.wm-theme .entry-content .wm-tv-badge {
    display: inline-block;
    margin: 0 0 .5em;
    padding: .15em .7em;
    border-radius: 999px;
    background: var(--wm-red);
    color: #fff;
    font-size: var(--wm-step--1);
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.wm-theme .entry-content .wm-tv-title { margin: 0 0 .25em; text-transform: none; }
.wm-theme .entry-content .wm-tv-date { margin: 0 0 .75em; color: var(--wm-text-muted); font-size: var(--wm-step--1); }
.wm-theme .entry-content .wm-tv-description p { overflow-wrap: anywhere; }
.wm-theme .entry-content .wm-tv-description p:last-child { margin-bottom: 0; }

/* Video tiles */
.wm-theme .entry-content .wm-tv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: 1.25rem;
    max-width: none;
    margin: 0 0 1.25em;
    padding: 0;
    list-style: none;
}
@media (min-width: 900px) {
    .wm-theme .entry-content .wm-tv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.wm-theme .entry-content .wm-tv-grid > li { margin: 0; padding: 0; }
.wm-theme .entry-content .wm-tv-grid > li::before { content: none; }
.wm-tv-tile {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    height: 100%;
    color: var(--wm-text) !important;
    text-decoration: none !important;
}
.wm-tv-thumb {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    margin-bottom: .25rem;
    border-radius: var(--wm-radius-sm);
    background: var(--wm-surface-3);
}
.wm-tv-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.wm-tv-thumb svg {
    position: absolute;
    inset: auto auto .5rem .5rem;
    width: 2.25rem;
    height: 2.25rem;
    padding: .5rem .4rem .5rem .6rem;
    border-radius: 50%;
    background: rgb(226 0 26 / 92%);
    fill: #fff;
    box-shadow: 0 2px 8px rgb(0 0 0 / 35%);
}
.wm-tv-tile:hover .wm-tv-thumb img { transform: scale(1.04); }
.wm-tv-tile:focus-visible { outline: 3px solid var(--wm-focus); outline-offset: 3px; border-radius: var(--wm-radius-sm); }
.wm-tv-tile-title { font-weight: 700; line-height: 1.3; }
.wm-tv-tile:hover .wm-tv-tile-title { color: var(--wm-link); }
.wm-tv-tile .wm-tv-date { margin: 0; }
@media (prefers-reduced-motion: reduce) {
    .wm-tv-thumb img { transition: none; }
}
.wm-theme .entry-content .wm-tv-more { margin-top: .5em; font-weight: 600; }

/* Podcast teaser */
.wm-tv-podcast-card {
    display: grid;
    grid-template-columns: 6rem 1fr;
    gap: 1rem;
    align-items: center;
    max-width: 40rem;
    padding: .75rem;
    border: 1px solid var(--wm-line);
    border-radius: var(--wm-radius);
    background: var(--wm-surface-2);
    color: var(--wm-text) !important;
    text-decoration: none !important;
}
.wm-tv-podcast-card:hover { border-color: var(--wm-line-strong); background: var(--wm-surface-3); }
.wm-tv-podcast-card:focus-visible { outline: 3px solid var(--wm-focus); outline-offset: 3px; }
.wm-tv-podcast-card img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--wm-radius-sm); }
.wm-tv-podcast-text { display: flex; flex-direction: column; gap: .2rem; }
.wm-tv-podcast-name { font-weight: 700; }
.wm-tv-podcast-episode { color: var(--wm-text-muted); font-size: var(--wm-step--1); }
.wm-tv-podcast-link { color: var(--wm-link); font-weight: 600; }
.wm-tv-podcast-link::after { content: " →"; }
