/*
Theme Name: Askiw Video
Theme URI: https://askiw.com/
Author: Askiw
Description: Video-first theme for Askiw: science videos with a big question search on the home page, plus programming guides and the blog. Includes Tools → Askiw setup to restructure the site in one click.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 7.4
License: GPLv2 or later
Text Domain: askiw
*/

/* ---------- Fonts (SIL OFL, bundled) ---------- */
@font-face { font-family: "Geologica"; font-style: normal; font-display: swap; font-weight: 100 900;
	src: url(assets/fonts/geologica-latin-full-normal.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geologica"; font-style: normal; font-display: swap; font-weight: 100 900;
	src: url(assets/fonts/geologica-cyrillic-full-normal.woff2) format("woff2");
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 400;
	src: url(assets/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2");
	unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 400;
	src: url(assets/fonts/jetbrains-mono-cyrillic-400-normal.woff2) format("woff2");
	unicode-range: U+0400-045F; }

/* ---------- Tokens ---------- */
:root {
	--paper: #EEF2F3;      /* glacier paper */
	--surface: #F8FAFA;
	--ink: #14232D;        /* deep water */
	--muted: #556972;
	--line: #C9D5D9;
	--melt: #1B6A8E;       /* meltwater blue: links */
	--signal: #E2601A;     /* survey orange: the question mark, focus */
	--on-signal: #fff;
	--font: "Geologica", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--wrap: 1240px;
	--text: 70ch;
	--pad: clamp(1rem, 4vw, 2.5rem);
	--r-media: 10px;
	--r-ctl: 999px;
	--step--1: .8rem; --step-0: 1rem; --step-1: 1.25rem; --step-2: 1.563rem; --step-3: 1.953rem; --step-4: 2.441rem;
	color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
	:root { --paper: #0E1A21; --surface: #13232C; --ink: #E3ECEF; --muted: #8FA4AE; --line: #24363F; --melt: #72BCDD; --signal: #F27A35; --on-signal: #14232D; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--step-0)/1.6 var(--font); font-variation-settings: "SHRP" 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--melt); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.15; font-weight: 650; letter-spacing: -.015em; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: clamp(var(--step-3), 4.5vw, 3.2rem); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .6rem 1rem; z-index: 99; }
.skip:focus { left: 1rem; top: 1rem; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.wrap--text { max-width: calc(var(--text) + 2 * var(--pad)); }
.wrap--player { max-width: 1160px; padding-top: 1.5rem; }
main { min-height: 60vh; }

/* ---------- Buttons ---------- */
.btn, .sub-btn, .search-inline button { display: inline-flex; align-items: center; gap: .5rem; border: 1px solid var(--ink); border-radius: var(--r-ctl); padding: .55rem 1.1rem; font: 550 .95rem/1 var(--font); color: var(--ink); background: transparent; text-decoration: none; cursor: pointer; }
.btn:hover, .search-inline button:hover { background: var(--ink); color: var(--paper); }
.btn--signal, .sub-btn { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.btn--signal:hover, .sub-btn:hover { filter: brightness(1.08); color: var(--on-signal); }

/* ---------- Header ---------- */
.site-head { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 20; }
.site-head__in { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.brand { display: inline-flex; align-items: baseline; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.55rem; letter-spacing: -.04em; gap: .02em; }
.brand__logo { width: 32px; height: 32px; margin-right: .5rem; align-self: center; border-radius: 6px; }
.brand__mark { color: var(--signal); font-variation-settings: "SHRP" 100; font-weight: 850; }
.site-nav .menu { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.site-nav li { position: relative; }
.site-nav a { display: block; padding: .5rem .75rem; color: var(--ink); text-decoration: none; font-weight: 500; border-radius: 6px; }
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current-menu-ancestor > a { color: var(--melt); }
.site-nav .sub-menu { list-style: none; margin: 0; padding: .4rem; position: absolute; left: 0; top: 100%; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: none; }
.site-nav li:hover > .sub-menu, .site-nav li:focus-within > .sub-menu { display: block; }
.head-search { margin-left: auto; }
.head-search input { width: 15rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-ctl); padding: .5rem 1rem; font: inherit; font-size: .95rem; }
.site-head .sub-btn { margin-left: auto; }
.head-search + .sub-btn { margin-left: 0; }
.menu-btn { display: none; }

/* ---------- The question (home hero) ---------- */
.ask { padding-top: clamp(2.5rem, 9vw, 6.5rem); padding-bottom: clamp(1.5rem, 4vw, 3rem); }
.ask__form { position: relative; }
.ask__label { display: block; font-size: var(--step-1); color: var(--muted); margin-bottom: .75rem; }
.ask__field { display: flex; align-items: flex-end; border-bottom: 3px solid var(--ink); }
.ask__input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); padding: 0 0 .1em; font: 600 clamp(2.1rem, 6.6vw, 5.4rem)/1.1 var(--font); letter-spacing: -.035em; font-variation-settings: "SHRP" 40; }
.ask__input::placeholder { color: var(--ink); opacity: .28; }
.ask__input:focus { outline: none; }
.ask__input::-webkit-search-cancel-button { display: none; }
.ask__field:focus-within { border-bottom-color: var(--signal); }
.ask__go { border: 0; background: none; color: var(--signal); cursor: pointer; padding: 0 0 .02em .1em; font: 850 clamp(3rem, 10vw, 8rem)/.9 var(--font); font-variation-settings: "SHRP" 100; transition: transform .25s ease; }
.ask__go:hover { transform: rotate(-8deg); }
.ask__results { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + .5rem); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .75rem; box-shadow: 0 18px 50px -20px rgba(20, 35, 45, .45); max-height: min(70vh, 560px); overflow: auto; }
.ask__results h2 { font-size: var(--step--1); font-weight: 600; color: var(--muted); margin: .4rem .5rem .3rem; letter-spacing: 0; }
.ask__results a { display: flex; gap: .8rem; align-items: center; padding: .5rem; border-radius: 8px; color: var(--ink); text-decoration: none; }
.ask__results a[aria-selected="true"], .ask__results a:hover { background: var(--paper); }
.ask__results img { width: 72px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; flex: none; }
.ask__results small { display: block; color: var(--muted); }
.ask__results .all { justify-content: center; color: var(--melt); font-weight: 550; }
.ask__results .none { padding: .5rem; color: var(--muted); margin: 0; }

.topics { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.5rem; }
.topic { display: inline-flex; gap: .45rem; align-items: baseline; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: var(--r-ctl); color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem; }
.topic:hover { border-color: var(--ink); }
.topic--video { border-color: var(--melt); color: var(--melt); }
.topic .count { color: var(--muted); font-size: .8em; }

/* ---------- Sections ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.25rem; margin-bottom: 1.5rem; }
.sec-head h2 { margin: 0; }
.more { font-weight: 550; white-space: nowrap; }
.videos, .index, .blog, .related { margin-top: clamp(2rem, 6vw, 4rem); }
.empty { color: var(--muted); font-size: var(--step-1); max-width: 60ch; }

/* ---------- Video cards ---------- */
.vcard__media { position: relative; display: block; border-radius: var(--r-media); overflow: hidden; background: var(--ink); aspect-ratio: 16 / 9; }
.vcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.vcard:hover .vcard__media img { transform: scale(1.03); }
.vcard__blank { position: absolute; inset: 0; background: linear-gradient(135deg, #1B6A8E, #14232D); }
.vcard__dur { position: absolute; right: .5rem; bottom: .5rem; background: rgba(10, 20, 26, .85); color: #fff; font: 500 .8rem/1 var(--font); padding: .3rem .45rem; border-radius: 5px; }
.vcard__title { font-size: 1.1rem; font-weight: 600; margin: .75rem 0 .35rem; line-height: 1.3; }
.vcard__title a { color: var(--ink); text-decoration: none; }
.vcard__title a:hover { color: var(--melt); }
.vcard__meta { margin: 0; color: var(--muted); font-size: .88rem; display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.vcard__meta a { color: inherit; text-decoration: none; font-weight: 550; }
.vcard__meta a:hover { color: var(--melt); }
.vcard--lead { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center; margin-bottom: clamp(2rem, 4vw, 3rem); }
.vcard--lead .vcard__title { font-size: clamp(var(--step-2), 3vw, var(--step-4)); line-height: 1.12; letter-spacing: -.025em; margin-top: 0; }
.vcard--lead .vcard__excerpt { color: var(--muted); font-size: 1.05rem; max-width: 46ch; }
.vcard--lead .btn { margin-top: 1.25rem; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 2rem 1.5rem; }

/* ---------- Programming index ---------- */
.index__cols { columns: 3 260px; column-gap: 2.5rem; }
.index__group { break-inside: avoid; margin-bottom: 2rem; }
.index__group h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.index__group h3 a { color: var(--ink); text-decoration: none; border-bottom: 2px solid var(--signal); }
.index__group ul { list-style: none; margin: 0; padding: 0; }
.index__group li { padding: .35rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; line-height: 1.4; }
.index__group li a { color: var(--ink); text-decoration: none; }
.index__group li a:hover { color: var(--melt); text-decoration: underline; }
.index__all { display: inline-block; margin-top: .5rem; font-size: .9rem; font-weight: 550; }

/* ---------- Article rows ---------- */
.alist { display: grid; gap: 0; }
.alist--two { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); column-gap: 2.5rem; }
.arow { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.arow__title { font-size: 1.15rem; font-weight: 600; margin: 0 0 .3rem; }
.arow__title a { color: var(--ink); text-decoration: none; }
.arow__title a:hover { color: var(--melt); }
.arow__excerpt { margin: 0 0 .4rem; color: var(--muted); max-width: 75ch; }
.arow__meta { margin: 0; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.arow__meta a { color: inherit; font-weight: 550; text-decoration: none; }

/* ---------- Page heads, tabs, pagination ---------- */
.page-head { padding: clamp(2rem, 6vw, 4rem) 0 1.5rem; }
.page-head__up { display: inline-block; font-weight: 550; text-decoration: none; margin-bottom: .5rem; }
.page-head__desc { color: var(--muted); font-size: var(--step-1); max-width: 60ch; }
.page-head__desc p { margin: 0; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-top: 1rem; }
.tabs a { padding: .6rem .9rem; color: var(--muted); text-decoration: none; font-weight: 550; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--signal); }
.sub-h { font-size: var(--step-1); margin: 2rem 0 1rem; }
.pagination { margin: 2.5rem 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.pagination a, .pagination span { padding: .45rem .8rem; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); }
.pagination .current { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.search-inline { display: flex; gap: .5rem; max-width: 560px; margin-bottom: 3rem; }
.search-inline input { flex: 1; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-ctl); padding: .6rem 1rem; font: inherit; }

/* ---------- Single ---------- */
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.player__btn { all: unset; cursor: pointer; position: absolute; inset: 0; display: block; }
.player__btn img { width: 100%; height: 100%; object-fit: cover; }
.player__play { position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%; background: var(--signal); box-shadow: 0 10px 40px rgba(0,0,0,.35); transition: transform .2s ease; }
.player__play::after { content: ""; position: absolute; left: 36px; top: 28px; border-style: solid; border-width: 18px 0 18px 28px; border-color: transparent transparent transparent #fff; }
.player__btn:hover .player__play, .player__btn:focus-visible .player__play { transform: scale(1.08); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player--soon { margin: 0; aspect-ratio: auto; }
.player--soon figcaption { position: absolute; left: 1rem; bottom: 1rem; background: var(--paper); color: var(--ink); padding: .4rem .8rem; border-radius: var(--r-ctl); font-weight: 550; }
.entry__head { padding-top: clamp(1.5rem, 4vw, 3rem); }
.entry__title { font-size: clamp(var(--step-3), 4vw, 2.9rem); letter-spacing: -.025em; }
.entry--video .entry__title { font-size: clamp(var(--step-2), 3.2vw, 2.4rem); }
.entry__meta { color: var(--muted); display: flex; gap: 1rem; margin: 0 0 1.5rem; font-size: .95rem; }
.entry__hero img { border-radius: var(--r-media); margin-bottom: 1.5rem; }
.entry__content { font-size: 1.075rem; line-height: 1.7; }
.entry__content > * + * { margin-top: 1.1em; }
.entry__content h2 { margin-top: 2em; font-size: var(--step-2); }
.entry__content h3 { margin-top: 1.6em; }
.entry__content img { border-radius: 8px; }
.entry__content blockquote { margin-inline: 0; padding-left: 1.2rem; border-left: 3px solid var(--signal); color: var(--muted); }
.entry__content code { font-family: var(--mono); font-size: .9em; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: .1em .35em; }
.entry__content pre { font-family: var(--mono); font-size: .9rem; line-height: 1.55; background: #13232C; color: #E3ECEF; border-radius: 10px; padding: 1.1rem 1.25rem; overflow-x: auto; }
.entry__content pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.entry__content table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.entry__content th, .entry__content td { border-bottom: 1px solid var(--line); padding: .5rem; text-align: left; }
.entry__content .chapters { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.entry__content .chapters li { padding: .45rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.entry__content .sources { font-size: .95rem; color: var(--muted); }
.entry__content .note { font-size: .92rem; color: var(--muted); }
.ts { all: unset; cursor: pointer; font-family: var(--mono); font-size: .9em; color: var(--melt); margin-right: .7rem; padding: .05rem .35rem; border-radius: 5px; background: var(--surface); border: 1px solid var(--line); }
.ts:hover { border-color: var(--melt); }
.ts:focus-visible { outline: 3px solid var(--signal); }
.subscribe { margin-top: 2.5rem; padding-top: 1.5rem; padding-bottom: 1.5rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.subscribe p { margin: 0; font-size: 1.1rem; font-weight: 550; }
.tags { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.tags a { font-size: .85rem; padding: .3rem .7rem; border: 1px solid var(--line); border-radius: var(--r-ctl); text-decoration: none; color: var(--muted); }
.comments-wrap { margin-top: 3rem; }
.comment-form p { margin: 0 0 1rem; }
.comment-form label { display: block; font-weight: 550; margin-bottom: .3rem; }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: .6rem .8rem; font: inherit; }
.comment-form .comment-form-cookies-consent label { display: inline; font-weight: 400; }
.comment-form input[type=submit] { border: 1px solid var(--ink); border-radius: var(--r-ctl); padding: .6rem 1.2rem; font: 550 .95rem var(--font); background: var(--ink); color: var(--paper); cursor: pointer; }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.comment-list .avatar { border-radius: 50%; float: left; margin-right: .8rem; }

/* ---------- Footer ---------- */
.site-foot { margin-top: clamp(3rem, 8vw, 6rem); border-top: 1px solid var(--line); padding: 3rem 0 1.5rem; }
.site-foot__in { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: 2rem; }
.site-foot__brand p { color: var(--muted); max-width: 36ch; }
.site-foot__col h2, .site-foot .widget-title { font-size: 1rem; margin-bottom: .6rem; }
.site-foot__col h2 a { color: var(--ink); text-decoration: none; }
.site-foot__col > a:not(.sub-btn):not(.brand), .site-foot__col li a { display: block; color: var(--muted); text-decoration: none; padding: .2rem 0; }
.site-foot__col > a:not(.sub-btn):not(.brand):hover, .site-foot__col li a:hover { color: var(--melt); }
.site-foot .widget + .widget { margin-top: 1.5rem; }
.site-foot .widget p { color: var(--muted); }
.site-foot .menu { list-style: none; margin: 0; padding: 0; }
.videos__more { margin-top: 2.5rem; }
.home-content { margin-top: clamp(1.5rem, 4vw, 3rem); }
.home-content .entry__content { max-width: none; }
.home-below { margin-top: clamp(2rem, 6vw, 4rem); }
.home-below .widget + .widget { margin-top: 2rem; }
.player--soon figcaption a { color: var(--melt); }
.site-foot__col .count { display: none; }
.site-foot__col ul { list-style: none; margin: 0; padding: 0; }
.site-foot__legal { margin-top: 2.5rem; color: var(--muted); font-size: .85rem; }

/* ---------- Small screens ---------- */
@media (max-width: 900px) {
	.vcard--lead { grid-template-columns: 1fr; }
	.head-search { display: none; }
	.menu-btn { display: inline-flex; align-items: center; gap: .5rem; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--ink); border-radius: var(--r-ctl); padding: .45rem .9rem; font: 550 .95rem var(--font); cursor: pointer; }
	.menu-btn__bars { width: 16px; height: 10px; border-top: 2px solid; border-bottom: 2px solid; position: relative; }
	.menu-btn__bars::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px solid; }
	.site-head .sub-btn { margin-left: 0; padding: .45rem .9rem; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); padding: .5rem var(--pad) 1rem; }
	.site-nav.is-open { display: block; }
	.site-nav .menu { flex-direction: column; }
	.site-nav .sub-menu { display: block; position: static; border: 0; background: none; padding: 0 0 0 1rem; }
	.site-foot__in { grid-template-columns: 1fr 1fr; }
	.site-foot__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
	.site-head .sub-btn { display: none; }
	.ask__input { font-size: 1.6rem; }
	.ask__go { font-size: 2.9rem; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
