/*
Theme Name: Doofree247
Description: A cinematic hybrid WordPress theme for vertical short dramas, with Gutenberg patterns and classic PHP templates.
Version: 1.1.0
Text Domain: doofree247
*/

:root {
	--df-canvas: oklch(0.075 0 0);
	--df-deep: oklch(0.115 0 0);
	--df-surface: oklch(0.16 0 0);
	--df-surface-raised: oklch(0.22 0 0);
	--df-ink: oklch(0.97 0 0);
	--df-muted: oklch(0.72 0 0);
	--df-line: oklch(0.31 0 0);
	--df-gold: oklch(0.68 0.14 79.8);
	--df-gold-bright: oklch(0.78 0.144 79.8);
	--df-night: oklch(0.22 0.06 255);
	--df-radius: 8px;
	--df-page: min(1440px, calc(100% - clamp(32px, 7vw, 112px)));
}

* { box-sizing: border-box; }
html { background: var(--df-canvas); scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--df-canvas);
	color: var(--df-ink);
	font-family: "Helvetica Neue", "Noto Sans Thai", "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.55;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { z-index: 100000; top: 12px; left: 12px; width: auto; height: auto; clip: auto; padding: 10px 14px; color: var(--df-canvas); background: var(--df-gold-bright); border-radius: 4px; font-weight: 700; }
.df-shell { overflow: hidden; }

.df-site-header { position: relative; z-index: 20; background: color-mix(in oklch, var(--df-canvas) 94%, transparent); border-bottom: 1px solid var(--df-line); }
.home .df-site-header { position: absolute; inset: 0 0 auto; background: linear-gradient(180deg, oklch(0.03 0 0 / .88), transparent); border-bottom: 0; }
.admin-bar.home .df-site-header { top: 32px; }
.df-site-header__inner { position: relative; display: flex; align-items: center; gap: clamp(16px, 2.5vw, 34px); width: var(--df-page); min-height: 86px; margin: 0 auto; }
.df-site-branding { flex: 0 0 auto; }
.custom-logo-link { display: block; line-height: 0; }
.custom-logo { width: auto; max-width: min(210px, 42vw); max-height: 48px; }
.df-primary-navigation { min-width: 0; margin-right: auto; }
.df-menu { display: flex; align-items: center; gap: clamp(14px, 2vw, 24px); margin: 0; padding: 0; list-style: none; }
.df-menu li { position: relative; }
.df-menu a { display: block; padding: 10px 0; color: oklch(0.88 0 0); font-size: 14px; }
.df-menu a:hover, .df-menu a:focus-visible, .df-menu .current-menu-item > a, .df-menu .current_page_item > a { color: var(--df-gold-bright); }
.df-menu .sub-menu { position: absolute; top: 100%; left: -14px; min-width: 210px; margin: 0; padding: 10px 14px; visibility: hidden; opacity: 0; list-style: none; background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius); transform: translateY(6px); transition: opacity 160ms ease, transform 160ms ease; }
.df-menu li:hover > .sub-menu, .df-menu li:focus-within > .sub-menu { visibility: visible; opacity: 1; transform: translateY(0); }

.df-nav {
	position: absolute; inset: 0 0 auto; z-index: 3;
	display: flex; align-items: center; gap: 32px;
	width: var(--df-page); margin: 0 auto; padding: 26px 0;
}
.df-brand { display: inline-flex; align-items: baseline; gap: 5px; font-size: 24px; font-weight: 850; letter-spacing: -0.055em; }
.df-brand__mark { color: var(--df-gold-bright); }
.df-brand__number { font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--df-muted); }
.df-nav__links { display: flex; gap: 22px; margin-right: auto; color: oklch(0.88 0 0); font-size: 14px; }
.df-nav__links a:hover, .df-nav__links a:focus-visible { color: var(--df-gold-bright); }
.df-icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; color: var(--df-ink); background: transparent; border: 1px solid transparent; border-radius: var(--df-radius); }
.df-icon-button:hover { background: color-mix(in oklch, var(--df-ink) 9%, transparent); }
.df-icon-button:focus-visible, a:focus-visible, .df-button:focus-visible, .df-poster:focus-visible { outline: 2px solid var(--df-gold-bright); outline-offset: 3px; }
.df-search { display: none; position: absolute; right: 0; top: 76px; width: min(320px, 90vw); padding: 12px; background: var(--df-surface); border: 1px solid var(--df-line); border-radius: var(--df-radius); }
.df-search.is-open { display: block; }
.df-search input { width: 100%; padding: 12px; color: var(--df-ink); background: var(--df-deep); border: 1px solid var(--df-line); border-radius: 4px; }

.df-hero { position: relative; min-height: min(780px, 100svh); display: flex; align-items: flex-end; isolation: isolate; background: var(--df-canvas); }
.df-hero__art { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.df-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, oklch(0.055 0 0 / .96) 0%, oklch(0.055 0 0 / .80) 35%, oklch(0.055 0 0 / .18) 73%), linear-gradient(0deg, var(--df-canvas) 0%, transparent 34%); }
.df-hero__content { width: var(--df-page); margin: 0 auto; padding: clamp(160px, 21vw, 290px) 0 clamp(70px, 9vw, 126px); }
.df-kicker { margin: 0 0 14px; color: var(--df-gold-bright); font-size: 12px; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }
.df-hero h1 { max-width: 650px; margin: 0; font-size: clamp(48px, 6.3vw, 92px); font-weight: 900; letter-spacing: -0.04em; line-height: .98; text-wrap: balance; }
.df-hero__meta { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 24px 0 14px; color: oklch(0.88 0 0); font-size: 14px; }
.df-rating { color: var(--df-gold-bright); font-weight: 700; }
.df-hero__copy { max-width: 540px; margin: 0; color: oklch(0.83 0 0); font-size: clamp(16px, 1.6vw, 18px); text-wrap: pretty; }
.df-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.df-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 10px 20px; border: 0; border-radius: var(--df-radius); font-weight: 700; transition: transform 180ms ease, background-color 180ms ease; }
.df-button:hover { transform: translateY(-2px); }
.df-button--primary { color: oklch(0.12 0 0); background: var(--df-gold-bright); }
.df-button--secondary { color: var(--df-ink); background: oklch(0.24 0 0 / .86); backdrop-filter: blur(8px); }

.df-main { width: var(--df-page); margin: 0 auto; padding-bottom: 96px; }
.df-section { margin-top: clamp(54px, 7vw, 92px); }
.df-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.df-section__title { margin: 0; font-size: clamp(21px, 2.2vw, 29px); font-weight: 650; letter-spacing: -0.03em; }
.df-section__link { color: var(--df-gold-bright); font-size: 14px; font-weight: 700; }

.df-trending { position: relative; padding: clamp(28px, 5vw, 64px); margin-inline: clamp(-16px, -4vw, -56px); overflow: hidden; border-radius: var(--df-radius); background: linear-gradient(112deg, var(--df-night), oklch(0.15 0.045 22) 58%, oklch(0.23 0.07 34)); }
.df-trending::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 80% 15%, oklch(0.68 0.14 79.8 / .14), transparent 24%); }
.df-rail { position: relative; z-index: 1; display: grid; grid-auto-flow: column; grid-auto-columns: clamp(158px, 14vw, 202px); gap: clamp(15px, 2vw, 28px); overflow-x: auto; padding: 7px 2px 14px; scrollbar-color: var(--df-gold) transparent; }
.df-poster { position: relative; display: block; aspect-ratio: .68; overflow: visible; border: 0; border-radius: var(--df-radius); background: var(--df-surface-raised); box-shadow: 0 10px 30px oklch(0.03 0 0 / .42); transition: transform 220ms cubic-bezier(.22, 1, .36, 1); }
.df-poster:hover { transform: translateY(-8px) scale(1.025); }
.df-poster__image { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; background-image: var(--poster); background-size: cover; background-position: var(--pos, 50% 50%); filter: saturate(.92) contrast(1.08); }
.df-poster__image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, oklch(0.05 0 0 / .86)); }
.df-poster__rank { position: absolute; left: -20px; bottom: -24px; z-index: -1; color: transparent; font-size: 110px; font-weight: 900; letter-spacing: -.12em; line-height: .8; -webkit-text-stroke: 2px oklch(0.9 0 0); opacity: .9; }
.df-poster__title { position: absolute; left: 14px; right: 12px; bottom: 15px; margin: 0; font-size: 16px; font-weight: 750; line-height: 1.12; text-wrap: balance; }
.df-poster__tag { position: absolute; top: 12px; left: 12px; padding: 4px 7px; color: oklch(0.12 0 0); background: var(--df-gold-bright); border-radius: 4px; font-size: 10px; font-weight: 800; }

.df-genre-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.df-genre { position: relative; min-height: 150px; display: flex; align-items: flex-end; overflow: hidden; padding: 18px; border: 1px solid var(--df-line); border-radius: var(--df-radius); background: var(--genre); font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.df-genre::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, oklch(0.06 0 0 / .85), transparent 70%); }
.df-genre span { position: relative; }
.df-genre:hover span { color: var(--df-gold-bright); }

.df-update-list { border-top: 1px solid var(--df-line); }
.df-update { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--df-line); }
.df-update__episode { color: var(--df-gold-bright); font-size: 13px; font-weight: 800; }
.df-update h3 { margin: 0; font-size: 18px; line-height: 1.25; }
.df-update p { margin: 5px 0 0; color: var(--df-muted); font-size: 14px; }
.df-update a { color: var(--df-ink); font-size: 14px; font-weight: 700; }
.df-update a:hover { color: var(--df-gold-bright); }

.df-guide { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: clamp(32px, 6vw, 88px); align-items: start; padding-block: clamp(12px, 3vw, 36px); }
.df-guide__content h2, .df-about h2 { margin: 0 0 20px; font-size: clamp(28px, 3.5vw, 46px); letter-spacing: -.04em; line-height: 1.1; text-wrap: balance; }
.df-guide__content p, .df-about > div > p { max-width: 68ch; color: oklch(0.83 0 0); text-wrap: pretty; }
.df-facts { overflow-x: auto; border-radius: var(--df-radius); background: var(--df-surface); }
.df-facts table { width: 100%; border-collapse: collapse; }
.df-facts caption { padding: 18px 20px; color: var(--df-ink); font-size: 17px; font-weight: 750; text-align: left; }
.df-facts th, .df-facts td { padding: 14px 20px; border-top: 1px solid var(--df-line); text-align: left; vertical-align: top; }
.df-facts th { width: 45%; color: var(--df-muted); font-size: 13px; font-weight: 600; }
.df-facts td { color: var(--df-ink); font-size: 14px; }

.df-about { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); gap: clamp(32px, 6vw, 90px); align-items: start; }
.df-about a { color: var(--df-gold-bright); text-decoration: underline; text-underline-offset: .18em; }
.df-author { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 16px; padding: 24px; background: var(--df-surface); border-radius: var(--df-radius); }
.df-author__avatar { display: grid; place-items: center; width: 58px; height: 58px; color: oklch(0.12 0 0); background: var(--df-gold-bright); border-radius: var(--df-radius); font-size: 12px; font-weight: 900; }
.df-author__label { margin: 0 0 4px; color: var(--df-muted); font-size: 12px; }
.df-author h2 { margin: 0 0 8px; font-size: 18px; letter-spacing: -.02em; }
.df-author p { margin: 0; color: oklch(0.83 0 0); font-size: 14px; }
.df-author .df-author__date { margin-top: 14px; color: var(--df-muted); font-size: 12px; }

.df-continue { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); overflow: hidden; border: 1px solid var(--df-line); border-radius: var(--df-radius); background: var(--df-surface); }
.df-continue__image { min-height: 270px; background: linear-gradient(90deg, transparent 50%, var(--df-surface)), url('assets/images/night-cinema-hero.png') 70% 62% / cover; }
.df-continue__content { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 4vw, 54px); }
.df-continue__content p { margin: 0 0 8px; color: var(--df-muted); font-size: 14px; }
.df-continue__content h2 { margin: 0; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.04em; line-height: 1.06; }
.df-progress { height: 3px; margin: 24px 0 13px; overflow: hidden; background: var(--df-line); border-radius: 3px; }
.df-progress span { display: block; width: 38%; height: 100%; background: var(--df-gold-bright); }

.df-footer { width: var(--df-page); margin: 0 auto; padding: 34px 0 48px; border-top: 1px solid var(--df-line); color: var(--df-muted); font-size: 13px; }
.df-footer p { margin: 0; }
.df-footer__widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; padding-bottom: 34px; }
.df-footer-widget__title { margin: 0 0 12px; color: var(--df-ink); font-size: 16px; }
.df-footer-widget ul { margin: 0; padding: 0; list-style: none; }
.df-footer-widget li + li { margin-top: 8px; }
.df-footer-widget a:hover { color: var(--df-gold-bright); }
.df-footer__bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.df-footer-menu { display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; list-style: none; }

/* WordPress content system */
.df-content, .df-block-home { min-height: 60svh; padding-block: clamp(72px, 9vw, 128px); }
.df-block-home { padding-block: 0; }
.df-content > *, .entry-content > * { width: min(760px, calc(100% - 32px)); margin-inline: auto; }
.df-content > .df-entry { width: 100%; max-width: none; }
.df-entry > .df-page-header { width: min(760px, calc(100% - 32px)); margin-inline: auto; }
.df-entry > .df-featured-image { width: var(--df-page); max-width: 1280px; margin-inline: auto; }
.df-content > .alignwide, .entry-content > .alignwide { width: var(--df-page); max-width: 1280px; }
.df-content > .alignfull, .entry-content > .alignfull { width: 100%; max-width: none; }
.entry-content > * + * { margin-block-start: 1.5rem; }
.entry-content > .wp-block-group + .wp-block-group, .entry-content > .wp-block-cover + .wp-block-group { margin-block-start: 0; }
.entry-content a:not(.wp-element-button) { color: var(--df-gold-bright); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.entry-content h2 { margin-top: clamp(42px, 7vw, 76px); font-size: clamp(28px, 4vw, 48px); letter-spacing: -.04em; line-height: 1.1; }
.entry-content h3 { margin-top: 36px; font-size: clamp(21px, 2.5vw, 28px); line-height: 1.2; }
.entry-content p, .entry-content li { color: oklch(0.84 0 0); }
.entry-content .wp-block-cover { overflow: hidden; border-radius: var(--df-radius); }
.df-block-home .entry-content > .wp-block-cover.alignfull { border-radius: 0; }
.entry-content .wp-block-image img, .df-featured-image img { display: block; border-radius: var(--df-radius); }
.entry-content .wp-block-button__link { min-height: 48px; display: inline-flex; align-items: center; }
.entry-content .is-style-outline > .wp-block-button__link { color: var(--df-ink); border-color: var(--df-line); }
.wp-block-separator { border-color: var(--df-line); }
.df-page-header { margin-bottom: clamp(32px, 5vw, 62px); }
.df-page-header h1 { max-width: 900px; margin: 0; font-size: clamp(42px, 7vw, 82px); font-weight: 900; letter-spacing: -.045em; line-height: 1; text-wrap: balance; }
.df-page-header > p, .df-archive-description { max-width: 68ch; margin-top: 18px; color: var(--df-muted); }
.df-entry-kicker { margin: 0 0 12px; color: var(--df-gold-bright); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.df-featured-image { margin-block: 0 clamp(36px, 6vw, 72px); }
.df-featured-image img { width: 100%; max-height: 720px; object-fit: cover; }

.df-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 3vw, 32px); }
.df-content-card { overflow: hidden; background: var(--df-surface); border-radius: var(--df-radius); }
.df-content-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--df-night); }
.df-content-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 240ms cubic-bezier(.22, 1, .36, 1); }
.df-content-card:hover .df-content-card__media img { transform: scale(1.035); }
.df-content-card__placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--df-night), var(--df-surface-raised)); }
.df-content-card__body { padding: 20px; }
.df-content-card h2 { margin: 0; font-size: 21px; letter-spacing: -.025em; line-height: 1.2; }
.df-content-card__excerpt { margin-top: 10px; color: var(--df-muted); font-size: 14px; }
.df-content-card__excerpt p { margin: 0; }
.navigation.pagination { width: var(--df-page); margin: 48px auto 0; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; background: var(--df-surface); border-radius: 6px; }
.page-numbers.current { color: var(--df-canvas); background: var(--df-gold-bright); }
.df-empty-state { padding: clamp(34px, 6vw, 72px); background: var(--df-surface); border-radius: var(--df-radius); }
.search-form { display: flex; gap: 8px; }
.search-form label { flex: 1; }
.search-field { width: 100%; min-height: 46px; padding: 10px 13px; color: var(--df-ink); background: var(--df-deep); border: 1px solid var(--df-line); border-radius: 6px; }
.search-submit { min-height: 46px; padding: 10px 16px; color: var(--df-canvas); background: var(--df-gold-bright); border: 0; border-radius: 6px; font-weight: 700; }
.df-post-navigation { width: min(760px, calc(100% - 32px)); margin: 64px auto 0; padding-top: 24px; border-top: 1px solid var(--df-line); }
.post-navigation .nav-links { justify-content: space-between; }
.df-error-page { width: var(--df-page); display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(32px, 8vw, 110px); margin: 0 auto; }
.df-error-code { color: transparent; font-size: clamp(150px, 28vw, 420px); font-weight: 900; letter-spacing: -.12em; line-height: .75; -webkit-text-stroke: 2px var(--df-line); }
.df-error-copy h1 { margin: 0; font-size: clamp(38px, 6vw, 72px); line-height: 1; letter-spacing: -.045em; }
.df-error-copy > p { color: var(--df-muted); }
.df-error-copy .search-form { margin-block: 28px 16px; }

@media (max-width: 760px) {
	.admin-bar.home .df-site-header { top: 46px; }
	.df-site-header__inner { min-height: 72px; flex-wrap: wrap; padding-block: 12px; }
	.df-primary-navigation { order: 3; width: 100%; overflow-x: auto; }
	.df-menu { width: max-content; }
	.df-menu .sub-menu { display: none; }
	.df-site-header .df-icon-button { margin-left: auto; }
	.df-search { top: 62px; }
	.df-hero { min-height: 720px; }
	.df-hero__art { object-position: 59% center; }
	.df-hero::before { background: linear-gradient(90deg, oklch(0.055 0 0 / .93), oklch(0.055 0 0 / .52)), linear-gradient(0deg, var(--df-canvas) 0%, transparent 38%); }
	.df-genre-grid { grid-template-columns: repeat(2, 1fr); }
	.df-genre { min-height: 112px; }
	.df-update { grid-template-columns: 68px minmax(0, 1fr); }
	.df-update a { grid-column: 2; }
	.df-guide, .df-about { grid-template-columns: 1fr; }
	.df-continue { grid-template-columns: 1fr; }
	.df-continue__image { min-height: 180px; background: url('assets/images/night-cinema-hero.png') 70% 62% / cover; }
	.df-card-grid { grid-template-columns: 1fr; }
	.df-footer__bar { align-items: flex-start; flex-direction: column; }
	.df-error-page { grid-template-columns: 1fr; }
	.df-error-code { font-size: 42vw; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
