/* Series cards and grids (series list, home page) + site-wide content width. */

:root {
    --tf-ink: #2b2326;
    --tf-muted: #7c7377;
    --tf-line: #e6e3e4;
    --tf-surface: #f6f4f5;
    --tf-accent: #fe505a;
    --tf-gold: #ffd564;
}

/* Wider content on large screens, less empty space at the sides */
@media (min-width: 1200px) {
    .wrapper > section.container,
    .wrapper .search-wrapper > .container,
    .footer-wrapper > section.container {
        width: auto;
        max-width: 1440px;
        padding-left: 40px;
        padding-right: 40px;
    }
}

/* Less space above page headings */
.page-heading {
    margin-top: 36px;
    margin-bottom: 22px;
}

/* Grid: 4 / 3 / 2 per row */
.series-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 36px 24px;
}
@media (max-width: 991px) {
    .series-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .series-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
}

.series-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    color: var(--tf-ink);
}
.series-card__poster {
    position: relative;
    display: block;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: var(--tf-surface);
}
.series-card__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.series-card__poster:hover img,
.series-card__poster:focus img {
    transform: scale(1.04);
}
.series-card__rating {
    position: absolute;
    top: 0;
    left: 12px;
    padding: 8px 7px 6px;
    background: var(--tf-gold);
    color: var(--tf-ink);
    font-weight: bold;
    font-size: 13px;
    line-height: 1;
    border-radius: 0 0 4px 4px;
}
.series-card__play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    border-radius: 50%;
    background: rgba(43, 35, 38, 0.72);
    color: #fff;
    font-size: 20px;
    line-height: 56px;
    text-align: center;
    padding-left: 4px;
}
.series-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding-top: 14px;
}
.series-card__continue {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: bold;
    color: var(--tf-accent);
}
.series-card__continue:hover {
    color: var(--tf-accent);
}
.series-card__title {
    margin: 0 0 6px;
    font: 19px/1.25 'aleobold', Georgia, serif;
}
.series-card__title a {
    color: var(--tf-ink);
}
.series-card__title a:hover {
    color: var(--tf-accent);
    text-decoration: none;
}
.series-card__meta {
    display: flex;
    justify-content: space-between;
    margin: 0 0 6px;
    font-size: 13px;
    color: var(--tf-muted);
}
.series-card__comments {
    color: var(--tf-muted);
}
.series-card__comments:hover {
    color: var(--tf-accent);
    text-decoration: none;
}
.series-card__details {
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--tf-muted);
}
.series-card__details span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.series-card__watchlist {
    margin-top: auto;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--tf-line);
    border-radius: 4px;
    background: #fff;
    color: var(--tf-ink);
    font-size: 13px;
    transition: border-color 0.15s, color 0.15s;
}
.series-card__watchlist:hover {
    border-color: var(--tf-accent);
    color: var(--tf-accent);
}
.series-card a:focus-visible,
.series-card button:focus-visible {
    outline: 2px solid var(--tf-accent);
    outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
    .series-card__poster img { transition: none; }
    .series-card__poster:hover img { transform: none; }
}

/* Home page sections */
.home-section {
    padding-top: 44px;
}
.home-section + .home-section {
    margin-top: 12px;
}
.home-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--tf-line);
}
.home-section__title {
    margin: 0;
    font: 24px/1.2 'aleobold', Georgia, serif;
    color: var(--tf-ink);
}
.home-section__note {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--tf-muted);
}
.home-section__more {
    flex: 0 0 auto;
    font-size: 14px;
    color: var(--tf-accent);
}
.home-section__more:hover {
    color: var(--tf-accent);
}
.home-section__footer {
    margin-top: 32px;
    text-align: center;
}

/* Menu (and search bar on larger screens) stay at the top while scrolling.
   The theme's overflow: hidden on .wrapper would break position: sticky, clip does the same clipping without it. */
.wrapper {
    overflow: clip;
}
.header-wrapper,
.header-wrapper--home {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.2s;
}
@media (min-width: 768px) {
    .search-wrapper {
        position: -webkit-sticky;
        position: sticky;
        top: var(--tf-header-h, 55px);
        z-index: 990;
        transition: box-shadow 0.2s;
    }
}
body.is-scrolled .header-wrapper {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
@media (min-width: 768px) {
    body.is-scrolled .search-wrapper {
        box-shadow: 0 4px 12px rgba(43, 35, 38, 0.15);
    }
}
/* Links to #comments etc. do not end up under the pinned bars */
html {
    scroll-padding-top: calc(var(--tf-sticky-h, 0px) + 16px);
}

/* Phones: logo on the left, Series / Logout next to the ☰ button (Contact and Help are in the ☰ menu).
   The theme centres this bar under 480px, which made it run into the logo. */
@media (max-width: 767px) {
    .header-wrapper .control-panel {
        top: 12px !important;
        right: 56px !important;
        margin-right: 0 !important;
    }
    .control-panel .control-panel__extra {
        display: none;
    }
    .control-panel .btn--sign {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Search suggestions (js/search-suggest.js) */
.search-suggest {
    position: absolute;
    z-index: 1100;
    max-height: 420px;
    overflow-y: auto;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--tf-line);
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(43, 35, 38, 0.18);
    text-align: left;
}
.search-suggest[hidden] {
    display: none;
}
.search-suggest a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    color: var(--tf-ink);
}
.search-suggest a:hover,
.search-suggest .is-active a {
    background: var(--tf-surface);
    text-decoration: none;
    color: var(--tf-ink);
}
.search-suggest img {
    flex: 0 0 34px;
    width: 34px;
    height: 51px;
    object-fit: cover;
    border-radius: 3px;
    background: var(--tf-surface);
}
.search-suggest__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.search-suggest__title {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-suggest__title mark {
    padding: 0;
    background: none;
    color: var(--tf-accent);
    font-weight: bold;
}
.search-suggest__meta {
    font-size: 12px;
    color: var(--tf-muted);
}
.search-suggest__empty {
    padding: 10px 14px;
    font-size: 13px;
    color: var(--tf-muted);
}
