/* ==========================================================================
   HDFilmizle — Cinematic Premium Light
   Reversible presentation layer loaded after the legacy theme stylesheet.
   ========================================================================== */

:root {
    --tf-canvas: #f4f6fb;
    --tf-surface: #ffffff;
    --tf-surface-soft: #f8fafc;
    --tf-ink: #101828;
    --tf-copy: #475467;
    --tf-muted: #667085;
    --tf-line: #e4e7ec;
    --tf-brand: #f5224f;
    --tf-brand-strong: #d9143d;
    --tf-brand-soft: #fff0f3;
    --tf-success: #16a36a;
    --tf-warning: #f4b740;
    --tf-radius-sm: 10px;
    --tf-radius-md: 16px;
    --tf-radius-lg: 22px;
    --tf-radius-xl: 28px;
    --tf-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 12px rgba(16, 24, 40, 0.04);
    --tf-shadow-md: 0 14px 36px -20px rgba(16, 24, 40, 0.3);
    --tf-shadow-lg: 0 28px 70px -34px rgba(16, 24, 40, 0.42);
    --tf-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html {
    scroll-padding-top: 96px;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% -10%, rgba(245, 34, 79, 0.08), transparent 28rem),
        linear-gradient(180deg, #fff 0, var(--tf-canvas) 30rem);
    color: var(--tf-copy);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

body.sidebar-open {
    overscroll-behavior: contain;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

.screen-reader-text:focus {
    top: 8px;
    left: 8px;
    z-index: 100000;
    width: auto;
    height: auto;
    margin: 0;
    padding: 12px 16px;
    overflow: visible;
    clip: auto;
    clip-path: none;
    border-radius: 8px;
    background: #fff;
    color: var(--tf-ink);
    white-space: normal;
}

/* ==========================================================================
   Global header and search
   ========================================================================== */

.site-header {
    min-height: 78px;
    height: auto;
    border-bottom: 1px solid rgba(228, 231, 236, 0.86);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 30px -28px rgba(16, 24, 40, 0.8);
}

@supports (backdrop-filter: blur(1px)) {
    .site-header {
        backdrop-filter: saturate(150%) blur(18px);
    }
}

.site-header__inner {
    max-width: 1480px;
    min-height: 78px;
    gap: clamp(18px, 3vw, 48px);
    padding-inline: clamp(16px, 3vw, 32px);
}

.site-brand {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 11px;
    letter-spacing: -0.025em;
}

.site-brand .site-brand__mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, var(--tf-brand), var(--tf-brand-strong));
    box-shadow: 0 12px 26px -14px rgba(245, 34, 79, 0.9);
    color: #fff;
    font-size: 1.05rem;
}

.site-brand__copy {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.site-brand__copy strong {
    color: var(--tf-ink);
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    font-weight: 900;
}

.site-brand__copy strong span {
    color: var(--tf-brand);
}

.site-brand__copy small {
    margin-top: 5px;
    color: var(--tf-muted);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-search {
    width: min(100%, 620px);
    margin-left: auto;
}

.site-search .search-box {
    max-width: none;
    margin: 0;
}

.site-search .search-box > i {
    left: 18px;
    z-index: 2;
    color: #98a2b3;
}

.site-search .search-box input {
    min-height: 48px;
    padding: 11px 58px 11px 48px;
    border: 1px solid var(--tf-line);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: var(--tf-ink);
    font-size: 0.92rem;
}

.site-search .search-box input::placeholder {
    color: #98a2b3;
}

.site-search .search-box input:focus {
    border-color: rgba(245, 34, 79, 0.55);
    outline: 0;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(245, 34, 79, 0.1), var(--tf-shadow-sm);
}

.site-search__submit {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    transform: translateY(-50%);
    place-items: center;
    border: 0;
    border-radius: 11px;
    background: var(--tf-ink);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.site-search__submit:hover {
    background: var(--tf-brand);
    transform: translateY(-50%) scale(1.03);
}

.site-header .header-toggle-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--tf-line);
    background: #fff;
    box-shadow: var(--tf-shadow-sm);
}

/* ==========================================================================
   Homepage shell and featured rail
   ========================================================================== */

.home .featured-section {
    max-width: 1480px;
    margin: clamp(22px, 4vw, 42px) auto 24px;
    padding-inline: clamp(16px, 3vw, 32px);
}

.home .featured-header,
.home .movie-premium-header {
    min-height: 58px;
    margin-bottom: 16px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--tf-ink);
}

.section-heading__icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(245, 34, 79, 0.14);
    border-radius: 13px;
    background: var(--tf-brand-soft);
    color: var(--tf-brand);
}

.section-heading__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.section-heading__eyebrow {
    color: var(--tf-brand);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.section-heading h1,
.section-heading h2 {
    margin: 0;
    color: var(--tf-ink);
    font-size: clamp(1.15rem, 2vw, 1.55rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.home .slider-nav {
    gap: 10px;
}

.home .slider-nav .nav-btn {
    width: 42px;
    height: 42px;
    border-color: var(--tf-line);
    border-radius: 13px;
    box-shadow: var(--tf-shadow-sm);
}

.home .slider-nav .nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.home .slider-viewport {
    padding: 8px 2px 18px;
}

.home .slider-track {
    gap: 0;
}

.home .slider-item {
    flex: 0 0 16.6667%;
    max-width: 16.6667%;
    padding-inline: 8px;
}

.home .slider-item .poster-box.mini {
    width: 100%;
    max-width: none;
    margin: 0;
    border: 1px solid rgba(228, 231, 236, 0.9);
    border-radius: 17px;
    box-shadow: var(--tf-shadow-md);
}

.home .slider-item .mini-info {
    max-width: none;
    margin: 11px 3px 0;
    text-align: left;
}

.home .slider-item .mini-info h3 {
    margin: 0 0 3px;
    color: var(--tf-ink);
    font-size: 0.82rem;
    font-weight: 800;
}

.home .slider-item .mini-info span {
    color: var(--tf-muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.home .home-layout {
    max-width: 1480px;
    grid-template-columns: 286px minmax(0, 1fr);
    gap: clamp(24px, 3vw, 42px);
    margin: 0 auto 70px;
    padding-inline: clamp(16px, 3vw, 32px);
}

.home-content {
    min-width: 0;
}

/* ==========================================================================
   Sidebar and navigation widgets
   ========================================================================== */

.home .site-sidebar {
    position: sticky;
    top: 98px;
    align-self: start;
    margin: 0;
}

.home .site-sidebar .widget {
    overflow: hidden;
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid rgba(228, 231, 236, 0.9);
    border-radius: var(--tf-radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--tf-shadow-sm);
}

.home .site-sidebar .widget-h {
    margin-bottom: 16px;
    padding: 0;
    border: 0;
    color: var(--tf-ink);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.home .site-sidebar .widget-h::after {
    display: block;
    width: 34px;
    height: 3px;
    margin-top: 9px;
    border-radius: 99px;
    background: var(--tf-brand);
    content: "";
}

.home .site-sidebar .p-nav-list {
    gap: 8px;
}

.home .site-sidebar .p-nav-list li a {
    min-height: 50px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: var(--tf-surface-soft);
}

.home .site-sidebar .p-nav-list li a:hover,
.home .site-sidebar .p-nav-list li a:focus-visible {
    border-color: rgba(245, 34, 79, 0.2);
    background: #fff;
    box-shadow: 0 10px 24px -18px rgba(245, 34, 79, 0.65);
    transform: translateX(3px);
}

.nav-icon--views {
    background: rgba(244, 183, 64, 0.14);
    color: #c88100;
}

.nav-icon--imdb {
    background: rgba(168, 85, 247, 0.12);
    color: #8b3dd1;
}

.nav-icon--archive {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.nav-icon--blog {
    background: rgba(20, 184, 166, 0.12);
    color: #0f8f83;
}

.home .site-sidebar .tag-list {
    gap: 8px;
}

.home .site-sidebar .tag-list a {
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--tf-line);
    background: #fff;
    color: var(--tf-copy);
}

/* ==========================================================================
   Movie catalogue cards
   ========================================================================== */

.home .movie-premium-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.home .movie-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 24px);
}

.home .movie-card {
    overflow: visible;
    border-radius: var(--tf-radius-md);
}

.movie-card__link {
    display: block;
    border-radius: inherit;
}

.home .movie-card .poster-box {
    overflow: hidden;
    border: 1px solid rgba(228, 231, 236, 0.95);
    border-radius: 18px;
    background: #e9edf3;
    box-shadow: var(--tf-shadow-md);
    transition: transform 0.28s var(--tf-ease), box-shadow 0.28s var(--tf-ease);
}

.home .movie-card:hover .poster-box,
.home .movie-card__link:focus-visible .poster-box {
    transform: translateY(-5px);
    box-shadow: var(--tf-shadow-lg);
}

.home .movie-card .poster-box img,
.home .slider-item .poster-box img {
    transition: transform 0.45s var(--tf-ease), filter 0.35s ease;
}

.home .movie-card:hover .poster-box img,
.home .slider-item:hover .poster-box img {
    transform: scale(1.035);
    filter: saturate(1.05) contrast(1.02);
}

.home .movie-card .card-overlay {
    background: linear-gradient(180deg, transparent 42%, rgba(8, 12, 20, 0.76));
    opacity: 0;
}

.home .movie-card:hover .card-overlay,
.home .movie-card__link:focus-visible .card-overlay {
    opacity: 1;
}

.card-overlay__play {
    display: grid;
    width: 52px;
    height: 52px;
    transform: translateY(8px) scale(0.94);
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 30px rgba(8, 12, 20, 0.28);
    color: var(--tf-brand);
    font-size: 1.15rem;
    opacity: 0;
    transition: transform 0.25s var(--tf-ease), opacity 0.2s ease;
}

.home .movie-card:hover .card-overlay__play,
.home .movie-card__link:focus-visible .card-overlay__play {
    transform: none;
    opacity: 1;
}

.home .badge-imdb,
.home .badge-quality {
    top: 10px;
    min-height: 26px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 9px;
    box-shadow: 0 6px 18px -10px rgba(8, 12, 20, 0.8);
    backdrop-filter: blur(8px);
}

.home .badge-imdb {
    left: 10px;
    background: rgba(15, 23, 42, 0.86);
    color: #ffd45c;
}

.home .badge-quality {
    right: 10px;
    background: rgba(22, 163, 106, 0.92);
}

.home .movie-info {
    margin: 12px 3px 0;
}

.home .movie-info h3 {
    margin: 0 0 4px;
    color: var(--tf-ink);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.35;
}

.home .movie-info span {
    color: var(--tf-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

/* ==========================================================================
   Pagination and editorial SEO panel
   ========================================================================== */

.home .pagination-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 42px;
}

.home .pagination-area .page-numbers {
    display: grid;
    min-width: 44px;
    height: 44px;
    padding-inline: 12px;
    place-items: center;
    border: 1px solid var(--tf-line);
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--tf-shadow-sm);
    color: var(--tf-copy);
    font-size: 0.82rem;
    font-weight: 800;
}

.home .pagination-area .current,
.home .pagination-area a:hover {
    border-color: var(--tf-brand);
    background: var(--tf-brand);
    color: #fff;
}

.home .seo-section {
    margin: 54px 0 0;
    padding: 0;
}

.home .seo-box {
    grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.5fr);
    gap: clamp(24px, 4vw, 52px);
    overflow: hidden;
    padding: clamp(24px, 4vw, 44px);
    border-color: rgba(228, 231, 236, 0.9);
    border-radius: var(--tf-radius-xl);
    background: linear-gradient(145deg, #fff, #fafbff);
    box-shadow: var(--tf-shadow-md);
}

.home .seo-image {
    overflow: hidden;
    aspect-ratio: 16 / 10;
    border-radius: 20px;
    background: #e9edf3;
}

.home .seo-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home .seo-text h1 {
    font-size: clamp(1.45rem, 3vw, 2.2rem);
    letter-spacing: -0.045em;
}

.home .seo-text p {
    margin: 0;
    color: var(--tf-copy);
    font-size: 0.94rem;
    line-height: 1.85;
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer.site-footer {
    margin-top: 0;
    padding: 58px 0 24px;
    border-top: 1px solid var(--tf-line);
    background: #fff;
}

.site-footer .footer-inner {
    max-width: 1480px;
    padding-inline: clamp(16px, 3vw, 32px);
}

.site-footer .footer-top {
    gap: 28px;
    padding-bottom: 34px;
}

.site-footer .f-nav {
    flex-wrap: wrap;
    justify-content: center;
}

.site-footer .f-nav a {
    position: relative;
    padding-block: 8px;
    color: var(--tf-copy);
    font-size: 0.82rem;
    font-weight: 700;
}

.site-footer .f-nav a:hover {
    color: var(--tf-brand);
}

.site-footer .f-social a {
    width: 42px;
    height: 42px;
    border-color: var(--tf-line);
    background: var(--tf-surface-soft);
}

.site-footer .footer-bottom {
    gap: 16px;
    color: var(--tf-muted);
}

.site-footer .dmca-badge img {
    width: 100px;
    height: auto;
}

/* ==========================================================================
   Responsive behavior
   ========================================================================== */

@media (max-width: 1260px) {
    .home .slider-item {
        flex-basis: 20%;
        max-width: 20%;
    }

    .home .movie-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .site-header__inner {
        gap: 14px;
    }

    .site-search {
        margin-left: 0;
    }

    .home .home-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .home .site-sidebar {
        position: fixed;
        top: 0;
        margin: 0;
    }

    .home .slider-item {
        flex-basis: 25%;
        max-width: 25%;
    }
}

@media (max-width: 760px) {
    .site-header {
        min-height: 70px;
    }

    .site-header__inner {
        min-height: 70px;
    }

    .site-brand__mark {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .site-brand__copy small {
        display: none;
    }

    .site-search {
        display: none;
    }

    .home .featured-section {
        margin-top: 22px;
    }

    .home .slider-item {
        flex-basis: 33.3333%;
        max-width: 33.3333%;
        padding-inline: 5px;
    }

    .home .movie-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px 10px;
    }

    .home .seo-box {
        grid-template-columns: 1fr;
    }

    .site-footer .footer-top,
    .site-footer .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .home .slider-item {
        flex-basis: 50%;
        max-width: 50%;
    }

    .home .movie-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home .movie-info h3 {
        font-size: 0.8rem;
    }

    .home .movie-premium-header {
        align-items: flex-start;
    }

    .section-heading__icon {
        width: 34px;
        height: 34px;
    }

    .site-footer .f-nav {
        gap: 8px 18px;
    }
}

@media (hover: none) {
    .home .movie-card .card-overlay {
        opacity: 1;
        background: linear-gradient(180deg, transparent 62%, rgba(8, 12, 20, 0.5));
    }

    .home .movie-card .card-overlay__play {
        position: absolute;
        right: 10px;
        bottom: 10px;
        left: auto;
        width: 40px;
        height: 40px;
        transform: none;
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home .movie-card .poster-box,
    .home .movie-card .poster-box img,
    .home .slider-item .poster-box img,
    .card-overlay__play,
    .site-search__submit {
        transition: none;
    }
}

/* ==========================================================================
   Grid-blowout fix — homepage movie listing
   Root cause: the legacy stylesheet defines `.movie-grid` desktop/tablet
   breakpoints as bare `repeat(N, 1fr)` with `!important`. CSS Grid tracks
   default to `min-width: auto`, so a track can never shrink below the
   intrinsic minimum width of its content (a long title, a badge). Once a
   card's content is wider than its fair-share column, that column — and the
   whole grid — grows past the container, pushing posters out past the right
   edge on common desktop/laptop widths (992–1200px in particular).
   `minmax(0, 1fr)` removes that auto-minimum so columns always share space
   evenly and never overflow. Matches legacy specificity + !important at
   every breakpoint so it wins deterministically regardless of load order.
   ========================================================================== */
@media (min-width: 1201px) {
    .movie-grid,
    .featured-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 1200px) {
    .movie-grid,
    .featured-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .movie-grid,
    .featured-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 600px) {
    .movie-grid,
    .featured-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Belt-and-suspenders: even if a track still tried to grow, grid items and
   their poster art must never claim more width than their own cell. */
.movie-grid > .movie-card,
.movie-grid-system > .movie-card-item,
.featured-grid > * {
    min-width: 0;
    max-width: 100%;
}

.movie-grid .poster-box,
.movie-grid .poster-box img,
.movie-grid-system .poster-wrap,
.movie-grid-system .poster-wrap img {
    max-width: 100%;
}

.home-layout,
.home-content,
.movie-grid,
.movie-grid-system {
    overflow-x: hidden;
}
