/*
Theme Name: Varivalimised
Theme URI: https://varivalimised.ee/
Description: Kerge editorial-teema: valikud, võrdlused ja juhendid. Ilma page builder'ita, ilma välisfontideta.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: varivalimised
*/

:root {
	--ink: #17202b;
	--ink-2: #4b5665;
	--ink-3: #6b7685;
	--paper: #fbfaf7;
	--card: #fff;
	--line: #e3dfd6;
	--tint: #f1eee7;
	--accent: #0b5cab;
	--accent-ink: #084782;
	--mark: #f2c94c;
	--ok: #1d6b45;
	--err: #a32828;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
	--wrap: 1120px;
	--measure: 720px;
	--gap: clamp(1rem, 3vw, 2rem);
	--radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.125rem;
	line-height: 1.65;
	text-rendering: optimizeLegibility;
}
@media (min-width: 900px) { body { font-size: 1.1875rem; } }
img, svg, video { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: .06em; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.2; color: var(--ink); margin: 0 0 .5em; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.4rem); }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1.1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.screen-reader-text, .skip-link:not(:focus) {
	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: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
.narrow { max-width: calc(var(--measure) + 2 * clamp(1.1rem, 4vw, 2rem)); }
.section { padding-block: clamp(2.2rem, 6vw, 4rem); }
.section + .section { border-top: 1px solid var(--line); }
.section--tint { background: var(--tint); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem 1.5rem; margin-bottom: 1.4rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: .3rem 0 0; color: var(--ink-2); flex-basis: 100%; max-width: 60ch; }
.more-link { font-size: 1rem; font-weight: 600; white-space: nowrap; }

/* Päis */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: relative; z-index: 20; }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; }
.brand { display: inline-flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.1; padding-block: .5rem; }
.brand__name { font-family: var(--sans); font-weight: 800; font-size: 1.15rem; letter-spacing: .04em; }
.brand__name span { color: var(--accent); letter-spacing: 0; }
.brand__tag { font-size: .72rem; color: var(--ink-3); letter-spacing: .03em; margin-top: .2rem; }
.nav-toggle { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; }
.nav-toggle__icon { width: 18px; height: 12px; border-block: 2px solid currentColor; position: relative; }
.nav-toggle__icon::after { content: ""; position: absolute; inset: 3px 0 auto; border-top: 2px solid currentColor; }
.site-nav { display: none; border-top: 1px solid var(--line); padding-block: .5rem 1rem; }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: .7rem .2rem; color: var(--ink); text-decoration: none; font-size: 1.05rem; font-weight: 600; border-bottom: 1px solid var(--tint); }
.site-nav a:hover, .site-nav .current-menu-item > a, .site-nav .current-post-ancestor > a, .site-nav .current-category-ancestor > a { color: var(--accent); }
.site-nav .search-form { margin-top: 1rem; }
@media (min-width: 1000px) {
	.nav-toggle { display: none; }
	.site-header__bar { min-height: 68px; }
	.site-nav { display: block !important; border-top: 1px solid var(--tint); padding: 0; }
	.site-nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
	.site-nav ul { display: flex; flex-wrap: wrap; gap: 0 1.35rem; }
	.site-nav a { padding: .75rem 0; border: 0; font-size: .98rem; }
	.site-nav .search-form { margin: 0; max-width: 230px; }
	.site-nav .search-form input[type="search"] { padding: .4rem .7rem; font-size: .95rem; }
	.site-nav .search-form button { padding: .4rem .7rem; font-size: .95rem; }
}

/* Vormid ja nupud */
.btn, .wp-block-button__link, button[type="submit"], input[type="submit"] {
	display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .65rem 1.3rem;
	border: 2px solid var(--accent); border-radius: 8px; background: var(--accent); color: #fff;
	font: inherit; font-weight: 700; font-size: 1.02rem; text-decoration: none; cursor: pointer;
}
.btn:hover, .wp-block-button__link:hover, button[type="submit"]:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn--ghost { background: transparent; color: var(--accent); }
.btn--ghost:hover { background: var(--accent); color: #fff; }
input[type="text"], input[type="email"], input[type="url"], input[type="search"], select, textarea {
	width: 100%; padding: .7rem .85rem; border: 1px solid #c9c4b8; border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: 1.02rem;
}
textarea { min-height: 9rem; resize: vertical; }
label { font-weight: 600; font-size: 1rem; display: block; margin-bottom: .3rem; }
.search-form { display: flex; gap: .5rem; }
.search-form label { flex: 1; margin: 0; }
.vv-form { display: grid; gap: 1rem; max-width: 640px; }
.vv-form__row { display: grid; gap: 1rem; }
@media (min-width: 640px) { .vv-form__row { grid-template-columns: 1fr 1fr; } }
.vv-form__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.vv-form small { color: var(--ink-3); font-size: .9rem; }
.notice { padding: 1rem 1.2rem; border-radius: var(--radius); border: 1px solid; margin-bottom: 1.5rem; }
.notice--ok { background: #eaf5ee; border-color: #b9dcc7; color: var(--ok); }
.notice--err { background: #fbecec; border-color: #ecc3c3; color: var(--err); }

/* Leivapuru */
.crumbs { font-size: .92rem; color: var(--ink-3); margin-bottom: 1.2rem; }
.crumbs a { color: var(--ink-2); }
.crumbs .sep { margin-inline: .4em; opacity: .6; }

/* Avaleht */
.hero { padding-block: clamp(2.5rem, 8vw, 5rem); background: linear-gradient(180deg, #fff, var(--paper)); border-bottom: 1px solid var(--line); }
.hero__inner { max-width: 780px; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); margin-bottom: .35em; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--mark) 62%); }
.hero__lead { font-size: clamp(1.1rem, 2.4vw, 1.3rem); color: var(--ink-2); max-width: 62ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.kicker { text-transform: uppercase; letter-spacing: .09em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0 0 .6rem; }

.topics { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); list-style: none; margin: 0; padding: 0; }
.topic { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; display: flex; flex-direction: column; position: relative; transition: border-color .15s, transform .15s; }
.topic:hover { border-color: var(--accent); transform: translateY(-2px); }
.topic h3 { margin-bottom: .35em; }
.topic h3 a { color: var(--ink); text-decoration: none; }
.topic h3 a::after { content: ""; position: absolute; inset: 0; }
.topic p { color: var(--ink-2); font-size: 1rem; margin: 0 0 .8rem; }
.topic__meta { margin-top: auto; font-size: .88rem; color: var(--ink-3); }

.cards { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); list-style: none; margin: 0; padding: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; position: relative; }
.card__img { aspect-ratio: 16 / 10; background: var(--tint); overflow: hidden; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card__hub { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.card__title { font-size: 1.22rem; margin: 0; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card:hover .card__title a { color: var(--accent); }
.card__excerpt { font-size: .98rem; color: var(--ink-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__date { font-size: .85rem; color: var(--ink-3); margin-top: auto; padding-top: .3rem; }
.cards--list { grid-template-columns: 1fr; gap: 0; }
.cards--list .card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.cards--list .card__body { padding: 1rem 0; }

.steps { display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); list-style: none; margin: 0; padding: 0; }
.steps li { padding-top: .9rem; border-top: 3px solid var(--ink); }
.steps strong { display: block; font-size: 1.08rem; margin-bottom: .2rem; }
.steps span { color: var(--ink-2); font-size: 1rem; }
.disclosure { font-size: .98rem; color: var(--ink-2); max-width: 75ch; }

/* Hub / arhiiv */
.page-head { padding-block: clamp(1.8rem, 5vw, 3rem) clamp(1.2rem, 3vw, 2rem); background: #fff; border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: .3em; }
.page-head__intro { max-width: 70ch; color: var(--ink-2); }
.page-head__intro p:last-child { margin-bottom: 0; }
.hub-outro { max-width: var(--measure); }
.topic-links { display: flex; flex-wrap: wrap; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.topic-links a { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--ink); text-decoration: none; font-size: .98rem; font-weight: 600; }
.topic-links a:hover { border-color: var(--accent); color: var(--accent); }
.pagination { margin-top: 2rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.pagination .page-numbers { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: 0 .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); text-decoration: none; font-weight: 600; }
.pagination .current { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Artikkel */
.article-head { padding-top: clamp(1.5rem, 4vw, 2.5rem); }
.article-head .card__hub { display: inline-block; margin-bottom: .6rem; text-decoration: none; }
.article-meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; font-size: .93rem; color: var(--ink-3); margin: .2rem 0 1.5rem; }
.article-meta a { color: var(--ink-2); }
.article-figure { margin: 0 0 2rem; }
.article-figure img { width: 100%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: cover; }
.prose { max-width: var(--measure); }
.prose > * { max-width: 100%; }
.prose h2 { margin-top: 2em; scroll-margin-top: 1rem; }
.prose h3 { margin-top: 1.6em; }
.prose h4 { margin-top: 1.4em; }
.prose p > br:first-child { display: none; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose img { border-radius: 8px; }
.prose figure { margin: 1.8rem 0; }
.prose figcaption { font-size: .9rem; color: var(--ink-3); margin-top: .5rem; }
.prose blockquote { margin: 1.8rem 0; padding: .2rem 0 .2rem 1.2rem; border-left: 4px solid var(--mark); font-family: var(--serif); font-size: 1.15em; }
.prose .wp-block-table, .prose .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.8rem 0; }
.prose table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .97rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .6rem .75rem; text-align: left; vertical-align: top; }
.prose thead th, .prose tr:first-child th { background: var(--tint); }
.prose .alignwide, .prose .alignfull { max-width: 100%; }
.prose .wp-block-media-text { gap: 1rem; margin: 1.5rem 0; }
.toc { background: var(--tint); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 0 0 2rem; font-size: 1rem; }
.toc summary { font-weight: 700; cursor: pointer; }
.toc ol { margin: .7rem 0 0; padding-left: 1.2em; }
.toc li { margin-bottom: .3em; }
.toc a { color: var(--ink); }
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin: 1.8rem 0; }
.box--key { border-left: 5px solid var(--mark); }
.box--cta { border-left: 5px solid var(--accent); }
.box > :last-child { margin-bottom: 0; }
.box h2, .box h3 { margin-top: 0; font-size: 1.2rem; }
.sponsored-note { font-size: .92rem; color: var(--ink-2); background: var(--tint); border-radius: 8px; padding: .6rem .9rem; margin-bottom: 1.5rem; }
.author-box { display: flex; gap: 1rem; align-items: flex-start; border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1.5rem; max-width: var(--measure); font-size: 1rem; }
.author-box__logo { flex: 0 0 52px; height: 52px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 800; font-size: 1.5rem; display: grid; place-items: center; font-family: var(--sans); }
.author-box p { margin: .2rem 0 0; color: var(--ink-2); }
.author-box strong { font-size: 1.05rem; }

/* Jalus */
.site-footer { background: var(--ink); color: #c8cfd8; margin-top: clamp(2.5rem, 6vw, 4rem); padding-block: clamp(2.2rem, 5vw, 3.5rem) 1.5rem; font-size: 1rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.site-footer .brand { color: #fff; padding: 0; margin-bottom: .8rem; }
.site-footer .brand__name span { color: var(--mark); }
.site-footer .brand__tag { color: #9aa5b3; }
.site-footer h2 { font-family: var(--sans); font-size: .8rem; text-transform: uppercase; letter-spacing: .09em; color: #9aa5b3; margin-bottom: .8rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .1rem; }
.site-footer li a { display: inline-block; padding: .3rem 0; }
.site-footer__legal { border-top: 1px solid #2c3948; margin-top: 2rem; padding-top: 1.2rem; font-size: .9rem; color: #9aa5b3; display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between; }
.site-footer__legal p { margin: 0; max-width: 70ch; }

/* 404 / otsing */
.error-404 { text-align: left; }
.error-404 .search-form { max-width: 520px; margin-block: 1.5rem; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .topic { transition: none; } }
@media print { .site-header, .site-footer, .toc, .related, .nav-toggle { display: none !important; } body { background: #fff; font-size: 11pt; } }
