/* UAFilm — стилі. Шрифти: Unbounded (заголовки), Manrope (текст). Постери — головний колір сторінки, решта тиха. */
:root {
	--bg: #12151c; --bg-2: #1a1f29; --bg-3: #242b38; --line: #2b3240;
	--text: #eef0f4; --muted: #98a2b3; --accent: #f2b63d; --accent-ink: #1b1300;
	--wrap: 1240px; --gutter: 16px; --radius: 8px; --radius-s: 5px;
	--font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-display: "Unbounded", "Manrope", system-ui, sans-serif;
	--card: 168px;
	color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 1rem; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h2 { font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
h3 { font-family: var(--font-body); font-weight: 600; }
h2 a { color: inherit; }
p { margin: 0 0 1em; }
small { font-size: .85em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 8px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px; z-index: 10; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Шапка */
.site-header { position: sticky; top: 0; z-index: 5; background: rgba(18, 21, 28, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; min-height: 60px; padding-top: 8px; padding-bottom: 8px; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: .01em; }
.logo:hover { text-decoration: none; color: var(--accent); }
.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 20px; }
.menu a { color: var(--text); font-weight: 500; }
/* Випадаючий каталог у шапці: <details>, без JS; на десктопі відкривається панеллю, на мобільному — списком */
.nav-dd { position: relative; }
.nav-dd summary { list-style: none; cursor: pointer; font-weight: 500; }
.nav-dd summary::-webkit-details-marker { display: none; }
.nav-dd summary::after { content: ""; display: inline-block; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: 0 0 3px 7px; }
.nav-dd details[open] summary { color: var(--accent); }
.nav-dd__panel { position: absolute; left: -16px; top: calc(100% + 14px); z-index: 20; display: flex; gap: 32px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; box-shadow: 0 16px 40px rgba(0,0,0,.45); min-width: 560px; }
.nav-dd__col ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 20px; }
.nav-dd__col li { padding: 2px 0; break-inside: avoid; }
.nav-dd__col a { color: var(--text); font-size: .92rem; white-space: nowrap; }
.nav-dd__col a:hover { color: var(--accent); text-decoration: none; }
.nav-dd__title { display: block; font-family: var(--font-display); font-size: .85rem; margin-bottom: 8px; color: var(--muted) !important; }
.nav-dd__col:nth-child(2) ul, .nav-dd__col:nth-child(3) ul { columns: 1; }

/* Компактні фільтри: кнопки-списки */
.filters { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 22px; }
.fdd { position: relative; }
.fdd summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .9rem; font-weight: 500; color: var(--text); white-space: nowrap; }
.fdd summary::-webkit-details-marker { display: none; }
.fdd summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin: -3px 0 0 2px; opacity: .7; }
.fdd summary b { font-weight: 600; color: var(--accent); }
.fdd summary b::before { content: ": "; color: var(--muted); font-weight: 400; }
.fdd summary:hover, .fdd[open] summary { border-color: var(--muted); }
.fdd[open] summary { background: var(--bg-3); }
.fdd__panel { position: absolute; left: 0; top: calc(100% + 6px); z-index: 15; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 16px 40px rgba(0,0,0,.45); max-height: 60vh; overflow: auto; }
.fdd__panel ul { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 18px; }
.fdd--2 .fdd__panel ul { columns: 2; }
.fdd--3 .fdd__panel { min-width: 440px; }
.fdd--2 .fdd__panel { min-width: 320px; }
.fdd__panel li { break-inside: avoid; }
.fdd__panel li a { display: block; color: var(--text); font-size: .9rem; padding: 3px 8px; border-radius: 5px; white-space: nowrap; }
.fdd__panel li a:hover { background: var(--bg-3); text-decoration: none; }
.fdd__panel li a.is-active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.fdd__panel small { color: var(--muted); margin-left: 2px; }
.fdd__panel li a.is-active small { color: inherit; opacity: .7; }
.fdd__all { display: inline-block; margin: 10px 8px 0; font-size: .85rem; color: var(--muted); }
.filters__reset { color: var(--muted); font-size: .85rem; margin-left: 4px; }
.filters--home .filters { margin: -8px 0 32px; }

.search { margin-left: auto; display: flex; gap: 6px; }
.search input { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; min-width: 220px; font: inherit; }
.search input::placeholder { color: var(--muted); }
.search button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; }

.site-main { padding: 28px var(--gutter) 56px; }
.section { margin: 0 0 40px; }
.section__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 14px; }
.section__head h2 { margin: 0; }
.section__lead { color: var(--muted); margin: 0; font-size: .95rem; }
.section__more { margin-left: auto; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.section__more:hover { color: var(--accent); }
.page-header { margin-bottom: 20px; }
.page-header p { color: var(--muted); max-width: 70ch; }

/* Герой головної */
.hero { position: relative; margin: -28px calc(-1 * var(--gutter)) 28px; padding: 0; overflow: hidden; background: var(--bg-2); }
.hero__bg { position: absolute; inset: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; opacity: .55; }
.hero__bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(18,21,28,.96) 0%, rgba(18,21,28,.82) 45%, rgba(18,21,28,.35) 100%), linear-gradient(180deg, rgba(18,21,28,.1) 0%, rgba(18,21,28,.2) 60%, var(--bg) 100%); }
.hero__inner { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 56px var(--gutter) 36px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end; }
.hero h1 { font-size: clamp(1.5rem, 3.4vw, 2.6rem); max-width: 16ch; margin-bottom: .5em; }
.hero__lead { color: var(--text); opacity: .85; max-width: 52ch; font-size: clamp(1rem, 1.3vw, 1.1rem); margin: 0; }
.hero__feature { display: flex; gap: 14px; align-items: center; background: rgba(26, 31, 41, .75); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 10px 10px; max-width: 360px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.hero__feature img { width: 64px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: var(--radius-s); flex: none; }
.hero__feature .kicker { color: var(--accent); font-size: .8rem; font-weight: 600; margin: 0 0 2px; }
.hero__feature .title { font-family: var(--font-display); font-weight: 600; font-size: .95rem; margin: 0 0 2px; line-height: 1.25; }
.hero__feature .title a { color: var(--text); }
.hero__feature .facts { font-size: .8rem; }

/* Стрічка «Сьогодні» */
.today { display: flex; align-items: center; gap: 0 18px; overflow-x: auto; scrollbar-width: none; margin: -8px calc(-1 * var(--gutter)) 36px; padding: 10px var(--gutter); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .9rem; white-space: nowrap; }
.today::-webkit-scrollbar { display: none; }
.today__date { font-family: var(--font-display); font-weight: 600; color: var(--accent); font-size: .8rem; padding-right: 18px; border-right: 1px solid var(--line); flex: none; }
.today__item { color: var(--text); flex: none; }
.today__item a { color: var(--text); }
.today__item small { color: var(--muted); margin-left: 6px; }
.today__item--ep::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }

/* Ряди карток і сітки */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card), 1fr)); gap: 22px 16px; }
.grid--teasers { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: var(--card); gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); padding-bottom: 6px; margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); scrollbar-width: thin; scrollbar-color: var(--bg-3) transparent; }
.rail > * { scroll-snap-align: start; }
.card { min-width: 0; }
.card__poster { position: relative; display: block; aspect-ratio: 2 / 3; background: var(--bg-2); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }
.card__poster img, .poster { width: 100%; height: 100%; object-fit: cover; }
.card__poster:hover img { opacity: .9; }
.poster--empty { display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; color: var(--muted); font-size: .85rem; background: var(--bg-2); aspect-ratio: 2 / 3; border-radius: var(--radius); }
.card__badge { position: absolute; left: 8px; bottom: 8px; max-width: calc(100% - 16px); background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 700; line-height: 1.2; padding: 4px 7px; border-radius: var(--radius-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__badge--muted { background: rgba(18, 21, 28, .85); color: var(--text); font-weight: 600; }
.card__title { font-size: .92rem; margin: 9px 0 2px; line-height: 1.3; }
.card__title a { color: var(--text); }
.facts { color: var(--muted); font-size: .82rem; margin: 0; }
.facts a { color: var(--muted); }
.rating { color: var(--accent); font-weight: 600; }
.dot { opacity: .5; }
.empty { color: var(--muted); }

/* Жанри / роки */
.terms-list { list-style: none; padding: 0; margin: 0; columns: 3; column-gap: 24px; }
.terms-list li { padding: 4px 0; border-bottom: 1px solid var(--line); break-inside: avoid; }
.terms-list small { color: var(--muted); }
.terms-list--inline { columns: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.terms-list--inline li { background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .88rem; }
.terms-list--inline li:hover { border-color: var(--muted); }
.terms-list--inline a { color: var(--text); }
.terms-list--inline a:hover { text-decoration: none; }
.section--terms { margin-bottom: 28px; }

/* Картка фільму / серіалу / персони */
.movie, .person { position: relative; }
.movie__backdrop { position: absolute; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter)); top: -28px; height: 420px; overflow: hidden; z-index: -1; }
.movie__backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; opacity: .28; }
.movie__backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18,21,28,.25) 0%, rgba(18,21,28,.7) 55%, var(--bg) 100%); }
.movie__head { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 32px; margin-bottom: 36px; }
.movie__poster .poster { border-radius: var(--radius); aspect-ratio: 2 / 3; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.movie__info { min-width: 0; }
.movie__info h1 { margin-bottom: .2em; }
.year { color: var(--muted); font-weight: 400; margin-left: .25em; }
.original { color: var(--muted); margin: 0 0 .7em; }
.movie__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; color: var(--muted); margin: 0 0 .8em; font-size: .95rem; }
.rating--big { font-family: var(--font-display); font-size: 1.05rem; color: var(--accent); }
.cert { border: 1px solid var(--muted); border-radius: 4px; padding: 0 6px; font-size: .78rem; font-weight: 600; color: var(--text); line-height: 1.5; }
.label { color: var(--muted); }
.terms { margin: .2em 0; }
.tagline { font-style: italic; color: var(--muted); margin: 0 0 .8em; }
.next-episode { background: var(--bg-2); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-s) var(--radius-s) 0; padding: 8px 12px; margin: 0 0 1em; }
.next-episode .label { margin-right: 6px; }
.next-episode small { color: var(--muted); }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 24px; margin: 0 0 1.2em; max-width: 640px; }
.facts-grid > div { border-top: 1px solid var(--line); padding-top: 6px; }
.facts-grid dt { color: var(--muted); font-size: .82rem; }
.facts-grid dd { margin: 0; }
.facts-grid small { color: var(--muted); }
.movie__body { max-width: 820px; }
.movie__body section { margin-bottom: 32px; }
.description p { font-size: 1.05rem; }
.note { color: var(--muted); font-size: .85rem; }
.person .description { margin-top: 1.2em; max-width: 70ch; }
.person .description h2 { font-size: 1rem; }

/* Де дивитись легально */
.providers { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; max-width: 640px; }
.providers h2 { font-size: .95rem; margin-bottom: .6em; }
.providers p { margin: 0; color: var(--muted); font-size: .95rem; }
.providers strong { color: var(--text); font-weight: 600; }
.providers--ok { border-color: rgba(242, 182, 61, .45); }
.providers--cinema h2::before, .providers--soon h2::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: 1px; }
.providers__list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 12px; }
.providers__list li { display: flex; align-items: center; gap: 8px; background: var(--bg-3); border-radius: var(--radius-s); padding: 6px 10px; }
.providers__list img { width: 24px; height: 24px; border-radius: 5px; }
.providers__list a { color: var(--text); font-weight: 600; }
.providers__list small { color: var(--muted); }

/* Люди */
.rail--people { grid-auto-columns: 128px; }
.pcard { display: block; color: var(--text); }
.pcard:hover { text-decoration: none; }
.pcard:hover .pcard__name { color: var(--accent); }
.pcard__photo { display: block; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); margin-bottom: 8px; }
.pcard__photo img { width: 100%; height: 100%; object-fit: cover; }
.pcard__empty { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 2rem; color: var(--muted); }
.pcard__name { display: block; font-weight: 600; font-size: .88rem; line-height: 1.3; }
.pcard__sub { display: block; color: var(--muted); font-size: .8rem; line-height: 1.3; }

.filmo__list { list-style: none; padding: 0; margin: 0; max-width: 760px; }
.filmo__row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.filmo__thumb { display: block; width: 46px; aspect-ratio: 2 / 3; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.filmo__thumb img { width: 100%; height: 100%; object-fit: cover; }
.filmo__title { color: var(--text); font-weight: 600; }
.filmo__sub { display: block; color: var(--muted); font-size: .85rem; }
.filmo__year { color: var(--muted); font-variant-numeric: tabular-nums; }
.filmo__rating { font-size: .9rem; }

.trailer .yt-lazy { position: relative; display: block; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #000; border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.trailer .yt-lazy img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.trailer .play { position: absolute; inset: 0; margin: auto; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); }
.trailer .play::after { content: ""; position: absolute; left: 25px; top: 19px; border-left: 20px solid var(--accent-ink); border-top: 13px solid transparent; border-bottom: 13px solid transparent; }
.trailer iframe { width: 100%; max-width: 640px; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius); }

/* Статті */
.entry { max-width: 760px; }
.entry__meta { color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.entry__back { margin-top: 32px; }
.entry__links { color: var(--muted); margin-top: 16px; }
.entry__content { font-size: 1.05rem; }
.entry__content img { border-radius: var(--radius); }
.teaser { display: flex; flex-direction: column; gap: 6px; }
.teaser__img img { border-radius: var(--radius); }
.teaser time { color: var(--muted); font-size: .85rem; }
.teaser p { color: var(--muted); font-size: .95rem; margin: 0; }

.pagination { margin-top: 28px; }
.pagination .nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.pagination .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pagination .dots { border: 0; }

.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; padding: 28px 0 44px; }
.site-footer .menu { margin-bottom: 12px; }
.site-footer .menu a { color: var(--muted); }
.site-footer .copy { max-width: 70ch; margin: 0; }

/* Pagefind */
.pagefind-ui { --pagefind-ui-primary: var(--accent); --pagefind-ui-text: var(--text); --pagefind-ui-background: var(--bg-2); --pagefind-ui-border: var(--line); --pagefind-ui-tag: var(--bg); --pagefind-ui-border-radius: 8px; --pagefind-ui-font: inherit; }

@media (max-width: 900px) {
	.hero__inner { grid-template-columns: 1fr; gap: 20px; padding-top: 40px; }
	.terms-list { columns: 2; }
}
@media (max-width: 640px) {
	:root { --card: 136px; }
	.site-header .wrap { gap: 8px 16px; }
	.site-header .wrap { position: relative; }
	.nav-dd { position: static; }
	.nav-dd__panel { left: var(--gutter); right: var(--gutter); top: 100%; min-width: 0; flex-direction: column; gap: 14px; padding: 14px; max-height: 70vh; overflow: auto; }
	.nav-dd__col ul, .nav-dd__col:nth-child(2) ul, .nav-dd__col:nth-child(3) ul { columns: 2; }
	.fdd { position: static; }
	.fdd__panel, .fdd--3 .fdd__panel, .fdd--2 .fdd__panel { left: 0; right: 0; min-width: 0; max-height: 55vh; }
	.fdd__panel ul, .fdd--2 .fdd__panel ul { columns: 2; }
	.fdd__panel li a { white-space: normal; }
	.search { width: 100%; margin-left: 0; }
	.search input { flex: 1; min-width: 0; }
	.movie__head { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.movie__poster { max-width: 200px; }
	.movie__backdrop { height: 300px; }
	.rail--people { grid-auto-columns: 110px; }
	.filmo__row { grid-template-columns: 40px minmax(0, 1fr) auto; }
	.filmo__row > .filmo__rating { display: none; }
	.grid { gap: 16px 10px; }
	.hero__inner { padding: 32px var(--gutter) 24px; }
	.hero__feature { max-width: none; }
	.terms-list { columns: 1; }
}
@media (prefers-reduced-motion: no-preference) {
	.card__poster img { transition: opacity .15s ease; }
}
