/*
 * The Þættir pages (templates/shows/, loaded by shows/base.html): what a card says besides its name (watched or heard,
 * subscribers', when), the front page's rows (swiped on a phone), what the reader began, the quiet shows' covers, a
 * show's tools (seasons, pictures or a list, more), and the grey pills of the site's controls: follow, share.
 * Colours from the text's (currentColor), so the same on the dark headers and the light page, in either theme.
 */
.tc-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 2.25rem;
    padding: 0.375rem 0.875rem;
    border: 0;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 10%, transparent);
    color: inherit;
    font-family: var(--h-font-sans, "sanomattextsans_web", system-ui, sans-serif);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.tc-pill:hover,
.tc-pill:focus-visible {
    background: color-mix(in srgb, currentColor 18%, transparent);
    color: inherit;
    text-decoration: none;
}

/* No browser's ring on a click; one of the text's colour for the keyboard (as the audio bar's). */
.tc-pill:focus,
.tc-switch__b:focus,
.tc-share__item:focus {
    outline: none;
}

.tc-pill:focus-visible,
.tc-switch__b:focus-visible,
.tc-share__item:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.tc-pill--wide {
    padding: 0.625rem 1.5rem;
    font-size: 0.9375rem;
}

/* A card: watched or heard, on its picture (in place of the bare triangle); subscribers'; its date in the line above its name */
.tc:not(.mediaentry-item--fp_featured) .mediaentry-item__image:before {
    display: none;
}

.tc-mark,
.tc-lock {
    position: absolute;
    z-index: 120;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3125rem 0.625rem;
    border-radius: 999px;
    font-family: var(--h-font-sans, "sanomattextsans_web", system-ui, sans-serif);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.01em;
    pointer-events: none;
}

.tc-mark {
    left: 0.75rem;
    bottom: 0.75rem;
    padding-left: 0.4375rem;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    transition: background 0.15s;
}

.tc-mark svg {
    width: 0.875rem;
    height: 0.875rem;
    fill: currentColor;
}

.mediaentry-item:hover .tc-mark {
    background: rgba(0, 0, 0, 0.82);
}

.tc-lock {
    left: 0.75rem;
    top: 0.75rem;
    background: #fff;
    color: #111;
}

.tc-date {
    white-space: nowrap;
}

/* The front page's rows: four across on a computer; on a phone one row each, swiped, the next card showing at the edge */
@media (max-width: 767.98px) {
    .tc-row {
        flex-wrap: nowrap;
        gap: 0.75rem;
        margin-left: -16px;
        margin-right: -16px;
        padding: 0 16px 0.25rem;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scroll-snap-type: x mandatory;
        scroll-padding: 0 16px;
        scrollbar-width: none;
    }

    .tc-row::-webkit-scrollbar {
        display: none;
    }

    .tc-row > [class*="col-"] {
        flex: 0 0 78%;
        max-width: 78%;
        padding: 0;
        scroll-snap-align: start;
    }

    .tc-row .mediaentry-item--medium {
        margin-bottom: 1.5rem;
    }
}

/* What the reader began and didn't finish (thaettir.js, from their browser) */
.tc-continue[hidden] {
    display: none;
}

.tc-progress {
    position: absolute;
    z-index: 120;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.35);
}

.tc-progress > span {
    display: block;
    height: 100%;
    background: var(--h-red, #d60000);
}

/* Shows with nothing new for a year: their covers, small */
.tc-quiet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 1.5rem 1.25rem;
    margin: 0 0 3rem;
    padding: 0;
    list-style: none;
}

.tc-quiet__item a {
    display: block;
    color: inherit;
    text-decoration: none;
}

.tc-quiet__item img,
.tc-quiet__blank {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    margin-bottom: 0.5rem;
    border-radius: 7px;
    object-fit: cover;
    background: color-mix(in srgb, currentColor 8%, transparent);
}

.tc-quiet__name {
    display: block;
    font-family: var(--h-font-sans, "sanomattextsans_web", system-ui, sans-serif);
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.25;
}

.tc-quiet__count {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.8125rem;
    opacity: 0.65;
}

.tc-quiet__item a:hover .tc-quiet__name {
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .tc-quiet {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem 0.75rem;
    }

    .tc-quiet__name {
        font-size: 0.8125rem;
    }
}

/* Follow a show, share an episode */
.tc-follow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tc-follow__label {
    margin-right: 0.25rem;
    font-family: var(--h-font-sans, "sanomattextsans_web", system-ui, sans-serif);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.7;
}

.series-follow .tc-follow__label {
    flex-basis: 100%;
}

.tc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    margin-top: 1rem;
}

.tc-share {
    position: relative;
}

.tc-share__menu {
    position: absolute;
    z-index: 600;
    top: calc(100% + 0.375rem);
    left: 0;
    min-width: 15rem;
    padding: 0.375rem;
    border-radius: 12px;
    background: #fff;
    color: #111;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), 0 12px 36px rgba(0, 0, 0, 0.22);
    font-family: var(--h-font-sans, "sanomattextsans_web", system-ui, sans-serif);
    font-size: 0.9375rem;
}

.tc-share__menu[hidden] {
    display: none;
}

.tc-share__item {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.tc-share__item:hover,
.tc-share__item:focus-visible {
    background: #f1f1ee;
    color: inherit;
    text-decoration: none;
}

.tc-share__url {
    display: block;
    font-size: 0.8125rem;
    opacity: 0.6;
}

[data-theme="dark"] .tc-share__menu {
    background: #1f1f1d;
    color: #f1f1ee;
    box-shadow: 0 0 0 1px #34342f, 0 12px 36px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .tc-share__item:hover,
[data-theme="dark"] .tc-share__item:focus-visible {
    background: #2b2b28;
}

/* A show's tools: its seasons, pictures or a list */
.tc-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.tc-tools .series-season-title {
    margin: 0;
}

.tc-seasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tc-switch {
    display: inline-flex;
    margin-left: auto;
    padding: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 8%, transparent);
    font-family: var(--h-font-sans, "sanomattextsans_web", system-ui, sans-serif);
}

.tc-switch[hidden] {
    display: none;
}

.tc-switch__b {
    padding: 0.3125rem 0.875rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.7;
    cursor: pointer;
}

.tc-switch__b[aria-pressed="true"] {
    background: var(--base-bg, #fff);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    opacity: 1;
}

[data-theme="dark"] .tc-switch__b[aria-pressed="true"] {
    background: #2b2b28;
}

/* The list: a small picture, the name and its line, one under another */
.tc-episodes.is-list .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
}

.tc-episodes.is-list .mediaentry-item {
    display: grid;
    grid-template-columns: 10rem minmax(0, 1fr);
    gap: 1.25rem;
    align-items: center;
    margin-bottom: 0;
    padding: 0.875rem 0;
    border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.tc-episodes.is-list .mediaentry-item__image {
    margin: 0;
}

.tc-episodes.is-list .mediaentry-item__headline {
    margin-bottom: 0;
}

.tc-episodes.is-list .tc-mark {
    left: 0.5rem;
    bottom: 0.5rem;
    font-size: 0.75rem;
}

.tc-episodes.is-list .tc-lock {
    left: 0.5rem;
    top: 0.5rem;
    font-size: 0.75rem;
}

@media (max-width: 575.98px) {
    .tc-episodes.is-list .mediaentry-item {
        grid-template-columns: 7rem minmax(0, 1fr);
        gap: 0.875rem;
    }

    .tc-episodes.is-list .tc-mark {
        display: none;
    }
}

/* More of a long show, into its list */
.tc-more {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0 2.5rem;
}

.tc-more__count {
    font-size: 0.8125rem;
    opacity: 0.6;
}

.tc-pages.is-replaced {
    display: none;
}

/* A copied link says so, in the button's place, for a moment */
.tc-said {
    font-weight: 700;
}

/* An upright video's page (shows/mediaentry_detail.html is_portrait): the player as tall as the screen lets it on the
   video's own still, blurred and darkened; its words beside it on a computer, under it on a phone. Dark in either theme. */
.tp-stage {
    position: relative;
    overflow: hidden;
    background: #0d0d0d;
    color: #f1f1ee;
}

.tp-backdrop {
    position: absolute;
    inset: -3rem;
    background-position: center;
    background-size: cover;
    filter: blur(36px) brightness(0.36) saturate(1.15);
    transform: scale(1.08);
}

.tp-inner {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem 16px 2.25rem;
}

.mediaentry__figure--portrait {
    display: block;
    margin: 0;
    background: transparent !important;
}

/* (the site's rules make every episode frame 16:9 and at least 480 high: undone) */
.mediaentry__figure--portrait > iframe {
    display: block;
    aspect-ratio: 9 / 16 !important;
    width: auto !important;
    /* (the screen less the site's header and some room: its controls in view) */
    height: min(calc(100vh - 13rem), 50rem);
    height: min(calc(100svh - 13rem), 50rem);
    max-width: none !important;
    min-height: 0 !important;
    border-radius: 12px;
    background: #000;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.tp-info.mediaentry__header {
    max-width: 38rem;
    padding: 0;
    background: transparent;
    color: inherit;
}

.tp-info .mediaentry__headline {
    color: inherit;
}

@media (max-width: 991.98px) {
    .tp-inner {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.25rem;
        padding: 0 0 1.75rem;
    }

    /* (as wide as the phone, but short enough that the episode's name shows under it) */
    .mediaentry__figure--portrait > iframe {
        width: min(100%, calc((100svh - 15rem) * 9 / 16)) !important;
        height: auto;
        margin: 0 auto;
        border-radius: 0;
        box-shadow: none;
    }

    .tp-info.mediaentry__header {
        max-width: none;
        padding: 0 16px;
    }
}

@media (min-width: 576px) and (max-width: 991.98px) {
    .tp-inner {
        padding-top: 1.25rem;
    }

    .mediaentry__figure--portrait > iframe {
        border-radius: 12px;
    }
}

/* Upright cards (an upright show's row and page, shows/views.py row_upright / upright_show): the video's own still as tall
   as it is, its length on it; on a phone two across and a third showing at the edge. */
.tc--upright .mediaentry-item__image .image {
    aspect-ratio: 9 / 16;
}

.tc--upright .mediaentry-item__image img {
    height: 100%;
    object-fit: cover;
}

.tc--upright .mediaentry-item__headline {
    font-size: 0.9375rem;
    line-height: 1.25;
}

/* (a narrow card's line wraps rather than run past it) */
.tc--upright .mediaentry-item__meta {
    flex-wrap: wrap;
}

.tc--upright .tc-date {
    white-space: normal;
}

.tc-mark__time {
    font-weight: 600;
    opacity: 0.9;
}

@media (max-width: 767.98px) {
    .tc-row--upright > [class*="col-"] {
        flex: 0 0 44%;
        max-width: 44%;
    }

    .tc-grid--upright > [class*="col-"] {
        padding-left: 6px;
        padding-right: 6px;
    }
}

/* (the list view keeps a small upright picture) */
.tc-episodes.is-list .tc--upright {
    grid-template-columns: 4.5rem minmax(0, 1fr);
}
