/*
Theme Name: Tharu Ahasa
Theme URI: https://tharulk.com
Author: Digital Solutions Lanka
Author URI: https://dsolk.com
Description: තරු අහස — Sinhala / English / Tamil astronomy magazine theme. Dark & light mode, mega menu, hero slider, tonight's sky (with Tharu Auto Articles), object hub pages, glossary tooltips, quiz, learning series, ads only on chosen languages, Singlish search, PWA.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: tharu
*/

/* ------------------------------------------------------------------ */
/* Tokens                                                              */
/* ------------------------------------------------------------------ */
:root {
	--bg: #F6F7FA;
	--surface: #FFFFFF;
	--surface2: #EEF1F7;
	--line: #D8DEE9;
	--text: #111827;
	--muted: #4B5563;
	--accent: #A8520A;
	--on-accent: #FFFFFF;
	--ph: #DCE2EE;
	--ph-dot: #FFFFFFCC;
	--shadow: 0 24px 60px rgba(17, 24, 39, .18);
	--hero-ink: #E8ECF5;
	--radius: 16px;
	--wrap: 1240px;
	--font: 'Noto Sans Sinhala', 'Noto Sans Tamil', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--serif: 'Noto Serif Sinhala', 'Noto Sans Tamil', Georgia, serif;
	--fs-article: 18px;
	color-scheme: light;
}
:root[data-theme="dark"] {
	--bg: #0A0F1E;
	--surface: #121A2E;
	--surface2: #0E1528;
	--line: #24304D;
	--text: #E8ECF5;
	--muted: #9AA6C2;
	--accent: #F4B860;
	--on-accent: #0A0F1E;
	--ph: #131B33;
	--ph-dot: #FFFFFF55;
	--shadow: 0 24px 60px rgba(0, 0, 0, .55);
	color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--bg: #0A0F1E;
		--surface: #121A2E;
		--surface2: #0E1528;
		--line: #24304D;
		--text: #E8ECF5;
		--muted: #9AA6C2;
		--accent: #F4B860;
		--on-accent: #0A0F1E;
		--ph: #131B33;
		--ph-dot: #FFFFFF55;
		--shadow: 0 24px 60px rgba(0, 0, 0, .55);
		color-scheme: dark;
	}
}
html[lang^="ta"] { --font: 'Noto Sans Tamil', 'Noto Sans Sinhala', system-ui, sans-serif; --serif: 'Noto Sans Tamil', 'Noto Serif Sinhala', serif; }
html[lang^="en"] { --serif: 'Noto Serif Sinhala', Georgia, serif; }

/* ------------------------------------------------------------------ */
/* Base                                                                */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.6; }
img, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; }
p { margin: 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; padding: 10px 16px; background: var(--accent); color: var(--on-accent); border-radius: 8px; }
.th-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.th-serif { font-family: var(--serif); }
.th-muted { color: var(--muted); }
.th-accent { color: var(--accent); }
.th-kicker { font-size: 13px; letter-spacing: .08em; color: var(--accent); font-weight: 600; }
.th-cat { font-size: 12px; color: var(--accent); font-weight: 600; }
.th-meta { font-size: 13px; color: var(--muted); }
.th-section { display: flex; flex-direction: column; gap: 20px; }
.th-section-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: baseline; }
.th-h2 { font-family: var(--serif); font-size: 28px; }
.th-more { color: var(--accent); font-weight: 600; font-size: 15px; }
.th-box { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.th-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 22px; background: var(--accent); color: var(--on-accent); font-weight: 700; border: 0; }
.th-btn:hover { text-decoration: none; filter: brightness(1.06); }
.th-btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.th-iconbtn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: transparent; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.th-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); font-size: 14px; }
.th-chip:hover { text-decoration: none; border-color: var(--accent); }
.th-ph { background-color: var(--ph); background-image: radial-gradient(var(--ph-dot) 1px, transparent 1.2px); background-size: 23px 23px; }
.th-img { position: relative; overflow: hidden; border-radius: 12px; display: block; }
.th-img img { width: 100%; height: 100%; object-fit: cover; }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px 24px; }
.th-split { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.th-split > .th-main { flex: 999 1 600px; min-width: 0; }
.th-split > .th-side { flex: 1 1 300px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
main.th-page { padding: 8px 0 64px; }
main.th-page > .th-wrap { display: flex; flex-direction: column; gap: 56px; }

/* ------------------------------------------------------------------ */
/* Top bar + header                                                    */
/* ------------------------------------------------------------------ */
.th-topbar { border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.th-topbar .th-wrap { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: center; padding-top: 6px; padding-bottom: 6px; }
.th-topbar-r { display: flex; gap: 10px; align-items: center; }
.th-langs { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.th-langs a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px; border-radius: 6px; color: var(--text); }
.th-langs a:hover { text-decoration: none; background: var(--surface2); }
.th-langs a[aria-current="true"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.th-langs a.is-missing { opacity: .55; }
.th-mode { min-height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.th-mode .i-sun { display: none; }
:root[data-theme="dark"] .th-mode .i-sun { display: inline; }
:root[data-theme="dark"] .th-mode .i-moon { display: none; }
.th-mode .l-dark { display: inline; } .th-mode .l-light { display: none; }
:root[data-theme="dark"] .th-mode .l-dark { display: none; }
:root[data-theme="dark"] .th-mode .l-light { display: inline; }

.th-headwrap { position: relative; z-index: 40; background: var(--bg); }
.th-header .th-wrap { display: flex; flex-wrap: wrap; gap: 16px 20px; align-items: center; justify-content: space-between; padding-top: 16px; padding-bottom: 16px; }
.th-logo { display: flex; align-items: center; gap: 12px; }
.th-logo:hover { text-decoration: none; }
.th-logo img { max-height: 48px; width: auto; }
.th-logo-t { display: flex; flex-direction: column; line-height: 1.15; }
.th-logo-t b { font-family: var(--serif); font-size: 26px; font-weight: 700; }
.th-logo-t span { font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.th-head-r { display: flex; gap: 8px; align-items: center; }
.th-burger { display: none; }

/* Primary nav + mega menu */
.th-nav ul { list-style: none; margin: 0; padding: 0; }
.th-nav > ul { display: flex; flex-wrap: wrap; gap: 2px 4px; font-size: 15px; font-weight: 500; }
.th-nav > ul > li > a, .th-nav > ul > li > button { min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; color: var(--text); }
.th-nav > ul > li > a:hover { text-decoration: none; background: var(--surface2); }
.th-nav > ul > li.is-open > button, .th-nav > ul > li > button:hover { background: var(--surface2); color: var(--accent); }
.th-nav > ul > li.current-menu-item > a, .th-nav > ul > li.current-menu-ancestor > a, .th-nav > ul > li.current-menu-ancestor > button { color: var(--accent); }
.th-nav .chev { transition: transform .15s; }
.th-nav li.is-open > button .chev { transform: rotate(180deg); }
.th-mega { position: absolute; left: 0; right: 0; top: 100%; padding: 0 24px; display: none; }
.th-nav li.is-open > .th-mega { display: block; }
.th-mega-in { max-width: calc(var(--wrap) - 48px); margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-wrap: wrap; overflow: hidden; }
.th-mega-subs { flex: 1 1 220px; background: var(--surface2); padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--line); }
.th-mega-subs .th-kicker { padding: 0 12px 8px; }
.th-mega-subs button { text-align: left; min-height: 42px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: 15px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text); }
.th-mega-subs button[aria-pressed="true"] { background: var(--surface); color: var(--accent); }
.th-mega-posts { flex: 999 1 600px; min-width: 0; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.th-mega-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; min-height: 220px; }
.th-mega-grid.is-loading { opacity: .5; }
.th-mega-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; font-size: 14px; }
.th-sub { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; }
.th-nav > ul > li { position: relative; }
.th-nav > ul > li.th-has-mega { position: static; }
.th-nav li.is-open > .th-sub { display: block; }
.th-sub a { display: block; padding: 10px 12px; border-radius: 8px; }
.th-sub a:hover { background: var(--surface2); text-decoration: none; }

/* Search overlay */
.th-search { position: fixed; inset: 0; z-index: 100; background: rgba(5, 8, 16, .72); display: none; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.th-search.is-open { display: flex; }
.th-search form { width: 100%; max-width: 720px; background: var(--surface); border-radius: var(--radius); padding: 18px; display: flex; gap: 10px; box-shadow: var(--shadow); }
.th-search input[type="search"] { flex: 1; min-height: 52px; font: inherit; font-size: 18px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.th-search .hint { color: #C9D2E6; font-size: 13px; margin-top: 10px; text-align: center; }

/* ------------------------------------------------------------------ */
/* Cards                                                               */
/* ------------------------------------------------------------------ */
.th-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.th-card:hover { text-decoration: none; }
.th-card:hover .th-card-t { text-decoration: underline; text-underline-offset: 4px; }
.th-card .th-img { aspect-ratio: 3 / 2; }
.th-card-t { font-size: 17px; font-weight: 600; line-height: 1.55; }
.th-card--sm .th-img { aspect-ratio: 16 / 10; border-radius: 10px; }
.th-card--sm .th-card-t { font-size: 15px; line-height: 1.5; }
.th-row { display: flex; gap: 14px; align-items: center; }
.th-row .th-img { width: 104px; aspect-ratio: 4 / 3; flex-shrink: 0; border-radius: 8px; }
.th-row .th-card-t { font-size: 16px; }

/* ------------------------------------------------------------------ */
/* Hero slider                                                         */
/* ------------------------------------------------------------------ */
.th-hero { display: flex; flex-direction: column; gap: 14px; }
.th-hero-stage { position: relative; min-height: 500px; border-radius: 18px; overflow: hidden; background: var(--ph); }
.th-slide { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; opacity: 0; visibility: hidden; transition: opacity .45s ease; }
.th-slide.is-active { opacity: 1; visibility: visible; }
.th-slide > img, .th-slide > .th-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.th-slide-body { position: relative; padding: 36px; background: rgba(10, 15, 30, .86); color: var(--hero-ink); display: flex; flex-direction: column; gap: 12px; max-width: 860px; border-top-right-radius: 18px; }
.th-slide-body h1, .th-slide-body h2 { font-family: var(--serif); font-size: 38px; line-height: 1.35; }
.th-slide-body p { font-size: 17px; line-height: 1.7; color: #C9D2E6; }
.th-slide-body .th-meta { color: #9AA6C2; }
.th-badge { align-self: flex-start; font-size: 13px; font-weight: 600; color: #0A0F1E; background: #F4B860; padding: 3px 10px; border-radius: 4px; }
.th-badge--line { background: transparent; color: #F4B860; border: 1px solid #F4B860; font-size: 12px; padding: 2px 8px; }
.th-hero-nav { position: absolute; top: 16px; right: 16px; display: flex; gap: 8px; z-index: 2; }
.th-hero-nav button { width: 44px; height: 44px; border-radius: 22px; border: 0; background: rgba(10, 15, 30, .8); color: #fff; display: flex; align-items: center; justify-content: center; }
.th-hero-thumbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.th-hero-thumbs button { text-align: left; padding: 10px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); display: flex; gap: 10px; align-items: center; min-height: 72px; }
.th-hero-thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.th-hero-thumbs .th-img { width: 56px; height: 52px; border-radius: 8px; flex-shrink: 0; }
.th-hero-thumbs span.t { font-size: 13px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------------------------------------------ */
/* Tonight / monthly sky                                               */
/* ------------------------------------------------------------------ */
.th-tonight { border-radius: 18px; border: 1px solid var(--line); background: var(--surface2); padding: 30px; display: flex; flex-direction: column; gap: 22px; }
.th-tonight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.th-tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.th-tile .k { font-size: 13px; color: var(--muted); }
.th-tile .row { display: flex; justify-content: space-between; gap: 10px; }
.th-tile .row b { font-weight: 600; }
.th-tile--moon { flex-direction: row; align-items: center; gap: 16px; }
.th-tile--accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.th-tile--accent .k { color: inherit; font-weight: 600; }
.th-tile--accent a { text-decoration: underline; font-weight: 700; }
.th-planet-ok { color: var(--accent); font-weight: 600; text-align: right; }
.th-monthly { border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; align-items: center; }
.th-date-big { display: flex; gap: 14px; align-items: center; }
.th-date-big .d { font-family: var(--serif); font-size: 34px; color: var(--accent); min-width: 44px; }
.th-date-big .m { font-size: 13px; color: var(--muted); }
.th-date-big .e { font-size: 17px; font-weight: 600; line-height: 1.45; }

/* Ad slots */
.th-ad { display: flex; justify-content: center; align-items: center; min-height: 90px; }
.th-ad ins { display: block; width: 100%; }
.th-ad--article { margin: 8px 0 30px; }
.th-ad--side { min-height: 250px; }
.th-ad-ph { border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: 13px; text-align: center; padding: 12px; }

/* Most read */
.th-popular { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.th-popular ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 16px; }
.th-popular li { display: flex; gap: 14px; align-items: baseline; }
.th-popular .n { font-family: var(--serif); font-size: 28px; color: var(--accent); width: 26px; flex-shrink: 0; }
.th-popular a { font-size: 16px; font-weight: 600; line-height: 1.5; }
.th-history { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.th-history .y { font-family: var(--serif); font-size: 22px; color: var(--accent); }

/* Tabs */
.th-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.th-tabs button { min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid var(--line); background: transparent; font-size: 14px; font-weight: 600; color: var(--text); }
.th-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.th-tabpanel[hidden] { display: none; }

/* Learn */
.th-learn { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.th-learn a { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 8px; min-height: 130px; }
.th-learn a:hover { text-decoration: none; border-color: var(--accent); }
.th-learn .n { font-family: var(--serif); font-size: 22px; color: var(--accent); }
.th-learn .t { font-size: 18px; font-weight: 600; line-height: 1.45; }

/* YouTube */
.th-yt { border-radius: 18px; border: 1px solid var(--line); background: var(--surface2); padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.th-yt .th-img { aspect-ratio: 16 / 9; }
.th-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }

/* Telegram band */
.th-band { border-radius: 18px; padding: 30px; background: var(--accent); color: var(--on-accent); display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.th-band h2 { font-family: var(--serif); font-size: 26px; }
.th-band .th-btn { background: var(--on-accent); color: var(--accent); }

/* ------------------------------------------------------------------ */
/* Article                                                             */
/* ------------------------------------------------------------------ */
.th-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent); z-index: 200; }
.th-crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.th-crumbs li + li::before { content: '›'; margin-right: 8px; }
.th-art-head { max-width: 860px; display: flex; flex-direction: column; gap: 16px; padding-top: 24px; }
.th-art-head h1 { font-family: var(--serif); font-size: 44px; line-height: 1.35; }
.th-lead { font-size: 19px; line-height: 1.7; color: var(--muted); }
.th-art-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; font-size: 14px; color: var(--muted); }
.th-art-meta a.l { color: var(--accent); font-weight: 600; }
.th-fs { display: inline-flex; gap: 4px; }
.th-fs button { min-width: 36px; min-height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 700; }
.th-figure { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.th-figure .th-img { aspect-ratio: 21 / 9; border-radius: var(--radius); }
.th-figure figcaption { font-size: 13px; color: var(--muted); }
.th-article { flex: 999 1 560px; min-width: 0; max-width: 760px; font-size: var(--fs-article); line-height: 1.95; }
.th-content > * { margin: 0 0 22px; }
.th-content h2 { font-family: var(--serif); font-size: 1.55em; margin: 36px 0 14px; }
.th-content h3 { font-size: 1.25em; margin: 28px 0 12px; }
.th-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.th-content img { border-radius: 12px; }
.th-content figure { margin: 28px 0; }
.th-content figcaption, .th-content .wp-caption-text { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.th-content .wp-caption { max-width: 100%; }
.th-content blockquote { margin: 28px 0; padding: 20px 24px; background: var(--surface2); border-radius: 12px; font-family: var(--serif); font-size: 1.2em; line-height: 1.6; }
.th-content ul, .th-content ol { padding-left: 1.4em; }
.th-content iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 12px; }
.th-content table { width: 100%; border-collapse: collapse; font-size: .9em; display: block; overflow-x: auto; }
.th-content th, .th-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.th-content hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0 16px; }
.th-content .taa-source { font-size: 14px; line-height: 1.7; color: var(--muted); }
.th-content .alignleft { float: left; margin: 6px 20px 12px 0; }
.th-content .alignright { float: right; margin: 6px 0 12px 20px; }
.th-content .aligncenter { margin-left: auto; margin-right: auto; }
.th-facts { margin: 0 0 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.th-facts div { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.th-facts span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.th-facts b { font-size: 15px; font-weight: 600; line-height: 1.5; }
.th-see { margin: 36px 0; border: 1px solid var(--accent); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.th-see h2 { font-family: var(--serif); font-size: 24px; margin: 0; display: flex; gap: 10px; align-items: center; }
.th-see-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; font-size: 16px; line-height: 1.6; }
.th-see-grid div { display: flex; flex-direction: column; gap: 2px; }
.th-see-grid span { font-size: 13px; color: var(--muted); }
.th-datacard { overflow: hidden; }
.th-datacard-top { height: 150px; display: flex; align-items: flex-end; padding: 14px 18px; position: relative; color: #E8ECF5; }
.th-datacard-top img, .th-datacard-top .th-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.th-datacard-top b { position: relative; font-family: var(--serif); font-size: 22px; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); }
.th-datacard dl { margin: 0; padding: 6px 18px 10px; }
.th-datacard dl div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.th-datacard dt { font-size: 14px; color: var(--muted); }
.th-datacard dd { margin: 0; font-size: 14px; font-weight: 600; text-align: right; line-height: 1.5; }
.th-datacard .src { padding: 0 18px 16px; font-size: 12px; color: var(--muted); }
.th-datacard .more { display: block; padding: 0 18px 18px; color: var(--accent); font-weight: 600; font-size: 14px; }
.th-sidebox { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.th-sidebox h2 { font-size: 14px; letter-spacing: .08em; color: var(--accent); }
.th-share { display: flex; gap: 8px; flex-wrap: wrap; }
.th-share a, .th-share button { min-height: 40px; padding: 0 14px; border-radius: 20px; background: var(--surface2); border: 0; font-size: 14px; display: inline-flex; align-items: center; }
.th-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.th-tags a { font-size: 13px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--text); }
.th-series { margin: 32px 0; padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.th-series ol { margin: 0; padding-left: 1.3em; font-size: 16px; line-height: 1.7; }
.th-series li.is-current { font-weight: 700; color: var(--accent); }
.th-series-nav { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }
.th-author { padding: 22px; display: flex; gap: 16px; align-items: flex-start; margin-top: 32px; }
.th-author img { border-radius: 50%; flex-shrink: 0; }
.th-author p { font-size: 15px; line-height: 1.7; color: var(--muted); }

/* Glossary tooltip */
.th-term { border-bottom: 1px dashed var(--accent); cursor: help; position: relative; }
.th-tip { position: absolute; z-index: 150; max-width: 320px; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; font-size: 15px; line-height: 1.6; font-family: var(--font); }
.th-tip b { display: block; font-size: 15px; margin-bottom: 4px; color: var(--accent); }
.th-tip a { color: var(--accent); font-size: 13px; font-weight: 600; display: inline-block; margin-top: 6px; }

/* Quiz */
.th-quiz { margin: 36px 0; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.th-quiz h2 { font-family: var(--serif); font-size: 24px; margin: 0; }
.th-q { display: flex; flex-direction: column; gap: 10px; }
.th-q p { font-weight: 600; font-size: 17px; line-height: 1.6; margin: 0; }
.th-q .opts { display: grid; gap: 8px; }
.th-q button { text-align: left; min-height: 48px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 16px; line-height: 1.5; color: var(--text); }
.th-q button.ok { border-color: #2E8B57; background: rgba(46, 139, 87, .14); }
.th-q button.no { border-color: #C0392B; background: rgba(192, 57, 43, .12); }
.th-q .why { font-size: 15px; color: var(--muted); line-height: 1.7; margin: 0; }
.th-quiz .score { font-weight: 700; color: var(--accent); }

/* Comments */
.th-comments { margin-top: 40px; display: flex; flex-direction: column; gap: 20px; }
.th-comments ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.th-comments ol ol { padding-left: 24px; margin-top: 16px; }
.th-comment { padding: 18px; }
.th-comment-h { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.th-comment-h img { border-radius: 50%; }
.th-comment-h b { color: var(--text); }
.th-form { display: flex; flex-direction: column; gap: 12px; }
.th-form label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 4px; }
.th-form input[type="text"], .th-form input[type="email"], .th-form input[type="url"], .th-form textarea, .comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; font: inherit; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.comment-form p { margin: 0 0 12px; }
.comment-form .submit, .th-form button[type="submit"] { min-height: 46px; padding: 0 22px; border-radius: 23px; border: 0; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.th-hp { position: absolute !important; left: -9999px !important; }

/* Archive / hub */
.th-archive-head { padding-top: 28px; display: flex; flex-direction: column; gap: 12px; max-width: 860px; }
.th-archive-head h1 { font-family: var(--serif); font-size: 40px; }
.th-archive-head .desc { font-size: 17px; color: var(--muted); line-height: 1.7; }
.th-pager { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.th-pager .page-numbers { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 22px; border: 1px solid var(--line); padding: 0 14px; }
.th-pager .current { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.th-hub { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.th-hub > .th-main { flex: 999 1 560px; min-width: 0; }
.th-hub > .th-side { flex: 1 1 320px; }
.th-objects { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
.th-objects a { display: flex; flex-direction: column; gap: 8px; }
.th-objects .th-img { aspect-ratio: 1 / 1; }
.th-calendar { display: flex; flex-direction: column; gap: 28px; }
.th-cal-month h2 { font-family: var(--serif); font-size: 26px; margin-bottom: 12px; }
.th-cal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.th-cal-list li { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; padding: 16px 18px; }
.th-cal-list .d { font-family: var(--serif); font-size: 26px; color: var(--accent); min-width: 52px; }
.th-cal-list .b { flex: 1 1 260px; display: flex; flex-direction: column; gap: 2px; }
.th-cal-list .b b { font-size: 17px; }
.th-cal-list .b span { font-size: 14px; color: var(--muted); }
.th-glossary { display: flex; flex-direction: column; gap: 14px; }
.th-glossary dl { margin: 0; display: grid; gap: 12px; }
.th-glossary dl > div { padding: 18px; }
.th-glossary dt { font-weight: 700; font-size: 18px; color: var(--accent); }
.th-glossary dd { margin: 4px 0 0; line-height: 1.7; }
.th-az { display: flex; flex-wrap: wrap; gap: 6px; }

/* Footer */
.th-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.th-footer .th-wrap { padding-top: 32px; padding-bottom: 32px; display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; font-size: 14px; color: var(--muted); }
.th-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.th-footer a { color: var(--text); }
.th-social { display: flex; gap: 8px; }
.th-social a { width: 40px; height: 40px; border-radius: 20px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; }

/* ------------------------------------------------------------------ */
/* Mobile                                                              */
/* ------------------------------------------------------------------ */
@media (max-width: 1000px) {
	.th-burger { display: inline-flex; }
	.th-nav { display: none; width: 100%; order: 10; }
	.th-nav.is-open { display: block; }
	.th-nav > ul { flex-direction: column; gap: 0; border-top: 1px solid var(--line); padding-top: 8px; }
	.th-nav > ul > li > a, .th-nav > ul > li > button { width: 100%; justify-content: space-between; min-height: 48px; }
	.th-mega, .th-sub { position: static; padding: 0; box-shadow: none; }
	.th-mega-in { border-radius: 12px; }
	.th-mega-posts { display: none; }
	.th-mega-subs { border-right: 0; }
	.th-sub { border: 0; padding: 0 0 8px 12px; }
}
@media (max-width: 720px) {
	.th-wrap { padding: 0 16px; }
	main.th-page > .th-wrap { gap: 40px; }
	.th-hero-stage { min-height: 440px; }
	.th-slide-body { padding: 22px; }
	.th-slide-body h1, .th-slide-body h2 { font-size: 26px; }
	.th-slide-body p { display: none; }
	.th-hero-thumbs { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; }
	.th-hero-thumbs button { min-width: 200px; scroll-snap-align: start; }
	.th-art-head h1 { font-size: 30px; }
	.th-archive-head h1 { font-size: 30px; }
	.th-h2 { font-size: 24px; }
	.th-tonight, .th-monthly, .th-yt, .th-band { padding: 20px; }
	.th-logo-t b { font-size: 22px; }
	.th-mode .lbl { display: none; }
}
@media print {
	.th-topbar, .th-headwrap, .th-footer, .th-side, .th-ad, .th-share, .th-quiz, .th-comments, .th-progress { display: none !important; }
	body { background: #fff; color: #000; }
}
.comment-form { padding: 22px; }
.th-hp input { width: 1px; }
