/*
Theme Name: Readability of Wikipedia
Theme URI: https://readabilityofwikipedia.com
Author: ReadabilityOfWikipedia.com
Author URI: https://readabilityofwikipedia.com
Description: A clean, fast, purpose-built theme for ReadabilityOfWikipedia.com. Ships a landing page centered on the [readability_checker] tool, plus tidy page/post templates. Designed to pair with the Readability of Wikipedia plugin.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: readabilityofwikipedia
Tags: custom-menu, featured-images, translation-ready, blog, one-column, two-columns
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */

:root {
	--row-blue: #2c5aa0;
	--row-blue-dark: #234a85;
	--row-teal: #0f8b81;
	--row-teal-dark: #0b6c64;
	--row-ink: #17222e;
	--row-body: #364150;
	--row-muted: #5b6675;
	--row-line: #e4e8ee;
	--row-bg: #ffffff;
	--row-bg-alt: #f5f8fc;
	--row-bg-deep: #0f2036;
	--row-radius: 12px;
	--row-radius-lg: 18px;
	--row-shadow: 0 1px 2px rgba(15, 32, 54, .06), 0 10px 30px rgba(15, 32, 54, .08);
	--row-shadow-soft: 0 1px 2px rgba(15, 32, 54, .05), 0 6px 18px rgba(15, 32, 54, .06);
	--row-maxw: 1120px;
	--row-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--row-font-head: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--row-font);
	font-size: 17px;
	line-height: 1.65;
	color: var(--row-body);
	background: var(--row-bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--row-font-head);
	color: var(--row-ink);
	line-height: 1.2;
	margin: 0 0 .5em;
	font-weight: 700;
	letter-spacing: -.01em;
}

a { color: var(--row-blue); text-decoration: none; }
a:hover, a:focus { color: var(--row-blue-dark); text-decoration: underline; }

img { max-width: 100%; height: auto; }

p { margin: 0 0 1em; }

:focus-visible {
	outline: 3px solid rgba(44, 90, 160, .5);
	outline-offset: 2px;
	border-radius: 4px;
}

.row-container {
	width: 100%;
	max-width: var(--row-maxw);
	margin-inline: auto;
	padding-inline: 24px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0,0,0,0);
	white-space: nowrap; border: 0;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--row-ink);
	color: #fff;
	padding: .75em 1.25em;
	z-index: 1000;
	border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.row-btn {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	padding: .7em 1.5em;
	border-radius: 999px;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}
.row-btn:hover, .row-btn:focus { text-decoration: none; }
.row-btn:active { transform: translateY(1px); }

.row-btn--primary { background: var(--row-blue); color: #fff; }
.row-btn--primary:hover, .row-btn--primary:focus { background: var(--row-blue-dark); color: #fff; }

.row-btn--teal { background: var(--row-teal); color: #fff; }
.row-btn--teal:hover, .row-btn--teal:focus { background: var(--row-teal-dark); color: #fff; }

.row-btn--ghost { background: transparent; color: var(--row-ink); border-color: var(--row-line); }
.row-btn--ghost:hover, .row-btn--ghost:focus { border-color: var(--row-blue); color: var(--row-blue); }

/* ==========================================================================
   Site header
   ========================================================================== */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(255,255,255,.92);
	backdrop-filter: saturate(140%) blur(8px);
	border-bottom: 1px solid var(--row-line);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	min-height: 70px;
}

.site-brand { display: flex; align-items: center; gap: .6rem; }
.site-brand a { display: inline-flex; align-items: center; gap: .6rem; color: var(--row-ink); }
.site-brand a:hover { text-decoration: none; }

.site-brand__mark {
	width: 34px; height: 34px;
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	border-radius: 9px;
	background: linear-gradient(135deg, var(--row-blue), var(--row-teal));
	color: #fff;
	font-weight: 800;
	font-size: 18px;
}

.site-brand__name { font-weight: 800; font-size: 1.1rem; color: var(--row-ink); letter-spacing: -.02em; }
.site-brand__name span { color: var(--row-blue); }

.site-brand__desc { display: block; font-size: .8rem; color: var(--row-muted); font-weight: 400; }

.main-nav ul {
	list-style: none;
	display: flex;
	align-items: center;
	gap: .35rem;
	margin: 0; padding: 0;
}
.main-nav a {
	display: block;
	padding: .5rem .9rem;
	border-radius: 8px;
	color: var(--row-body);
	font-weight: 500;
	font-size: .98rem;
}
.main-nav a:hover, .main-nav a:focus,
.main-nav .current-menu-item > a {
	background: var(--row-bg-alt);
	color: var(--row-blue);
	text-decoration: none;
}

.header-actions { display: flex; align-items: center; gap: .6rem; }

.nav-toggle {
	display: none;
	background: none;
	border: 1px solid var(--row-line);
	border-radius: 8px;
	padding: .45rem .6rem;
	cursor: pointer;
	color: var(--row-ink);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
	position: relative;
	background:
		radial-gradient(1100px 480px at 82% -8%, rgba(15,139,129,.12), transparent 60%),
		radial-gradient(900px 420px at 5% 0%, rgba(44,90,160,.12), transparent 55%),
		var(--row-bg-alt);
	border-bottom: 1px solid var(--row-line);
	padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem);
}

.hero__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	background: #fff;
	border: 1px solid var(--row-line);
	color: var(--row-teal-dark);
	font-weight: 600;
	font-size: .85rem;
	padding: .4rem .9rem;
	border-radius: 999px;
	margin-bottom: 1.25rem;
	box-shadow: var(--row-shadow-soft);
}
.hero__eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--row-teal); }

.hero__title {
	font-size: clamp(2rem, 5vw, 3.25rem);
	line-height: 1.08;
	max-width: 16ch;
	margin: 0 0 1rem;
}
.hero__title .accent {
	background: linear-gradient(120deg, var(--row-blue), var(--row-teal));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.hero__lead {
	font-size: clamp(1.05rem, 2.2vw, 1.3rem);
	color: var(--row-muted);
	max-width: 52ch;
	margin: 0 0 1.75rem;
}

.hero__tool {
	margin-top: 2rem;
	background: #fff;
	border: 1px solid var(--row-line);
	border-radius: var(--row-radius-lg);
	box-shadow: var(--row-shadow);
	padding: clamp(1.25rem, 3vw, 2rem);
}

.hero__tool-head { margin-bottom: 1rem; }
.hero__tool-head h2 { font-size: 1.25rem; margin-bottom: .25rem; }
.hero__tool-head p { margin: 0; color: var(--row-muted); font-size: .95rem; }

.hero__examples {
	margin-top: 1.5rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5rem;
	font-size: .9rem;
	color: var(--row-muted);
}
.hero__examples .label { font-weight: 600; color: var(--row-body); }
.hero__example {
	border: 1px solid var(--row-line);
	background: #fff;
	color: var(--row-blue);
	border-radius: 999px;
	padding: .3rem .85rem;
	font-size: .85rem;
	cursor: pointer;
	font-family: inherit;
}
.hero__example:hover, .hero__example:focus { border-color: var(--row-blue); background: var(--row-bg-alt); }

/* ==========================================================================
   Sections
   ========================================================================== */

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--alt { background: var(--row-bg-alt); border-block: 1px solid var(--row-line); }
.section--deep {
	background:
		radial-gradient(800px 400px at 90% 10%, rgba(15,139,129,.18), transparent 60%),
		var(--row-bg-deep);
	color: #cdd7e3;
}
.section--deep h2, .section--deep h3 { color: #fff; }

.section__head { max-width: 640px; margin: 0 auto clamp(2rem, 4vw, 3rem); text-align: center; }
.section__eyebrow {
	display: inline-block;
	text-transform: uppercase;
	letter-spacing: .08em;
	font-size: .8rem;
	font-weight: 700;
	color: var(--row-teal-dark);
	margin-bottom: .6rem;
}
.section__title { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: .6rem; }
.section__lead { font-size: 1.1rem; color: var(--row-muted); margin: 0; }
.section--deep .section__lead { color: #9fb0c4; }
.section--deep .section__eyebrow { color: #5ecbc0; }

/* Steps */
.steps {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.25rem;
	counter-reset: step;
}
.step {
	background: #fff;
	border: 1px solid var(--row-line);
	border-radius: var(--row-radius);
	padding: 1.5rem;
	box-shadow: var(--row-shadow-soft);
	position: relative;
}
.step__num {
	width: 38px; height: 38px;
	display: grid; place-items: center;
	border-radius: 10px;
	background: var(--row-bg-alt);
	color: var(--row-blue);
	font-weight: 800;
	margin-bottom: .9rem;
}
.step h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.step p { margin: 0; color: var(--row-muted); font-size: .95rem; }

/* Audience cards */
.cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
}
.card {
	background: #fff;
	border: 1px solid var(--row-line);
	border-radius: var(--row-radius);
	padding: 1.75rem;
	box-shadow: var(--row-shadow-soft);
}
.card__icon {
	width: 46px; height: 46px;
	display: grid; place-items: center;
	border-radius: 12px;
	background: linear-gradient(135deg, rgba(44,90,160,.12), rgba(15,139,129,.12));
	margin-bottom: 1rem;
	font-size: 22px;
}
.card h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.card p { margin: 0; color: var(--row-muted); font-size: .96rem; }

/* Why / split content */
.split {
	display: grid;
	grid-template-columns: 1.05fr .95fr;
	gap: clamp(2rem, 5vw, 4rem);
	align-items: center;
}
.split__media {
	background: #fff;
	border: 1px solid var(--row-line);
	border-radius: var(--row-radius-lg);
	box-shadow: var(--row-shadow);
	padding: 1.5rem;
}
.stat-list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: .9rem; }
.stat-list li { display: flex; gap: .8rem; align-items: flex-start; }
.stat-list .check {
	flex: 0 0 auto;
	width: 24px; height: 24px;
	display: grid; place-items: center;
	border-radius: 50%;
	background: rgba(15,139,129,.14);
	color: var(--row-teal-dark);
	font-size: 14px;
	margin-top: 2px;
}

/* Mock gauge for the "why" media panel */
.mock-gauge { }
.mock-gauge__row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .35rem; }
.mock-gauge__row strong { color: var(--row-ink); }
.mock-gauge__bar {
	height: 10px; border-radius: 6px;
	background: linear-gradient(90deg, #7fbf7f, #e8d477, #d98080);
	position: relative;
	margin-bottom: 1.1rem;
}
.mock-gauge__marker {
	position: absolute; top: -4px; width: 4px; height: 18px;
	background: var(--row-ink); border-radius: 2px; margin-left: -2px;
}
.mock-gauge__scale { display: flex; justify-content: space-between; font-size: .82rem; color: var(--row-muted); }

/* Formula grid */
.formula-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.25rem;
}
.formula {
	background: #fff;
	border: 1px solid var(--row-line);
	border-radius: var(--row-radius);
	padding: 1.5rem;
	box-shadow: var(--row-shadow-soft);
}
.formula__tag {
	display: inline-block;
	font-size: .75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--row-teal-dark);
	background: rgba(15,139,129,.1);
	padding: .2rem .6rem;
	border-radius: 6px;
	margin-bottom: .7rem;
}
.formula h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.formula p { margin: 0; color: var(--row-muted); font-size: .93rem; }

/* FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq__item {
	border: 1px solid var(--row-line);
	border-radius: var(--row-radius);
	background: #fff;
	margin-bottom: .85rem;
	overflow: hidden;
	box-shadow: var(--row-shadow-soft);
}
.faq__item summary {
	list-style: none;
	cursor: pointer;
	padding: 1.15rem 1.4rem;
	font-weight: 600;
	color: var(--row-ink);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	font-size: 1.05rem;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
	content: "+";
	font-size: 1.4rem;
	color: var(--row-blue);
	line-height: 1;
	transition: transform .2s ease;
	flex: 0 0 auto;
}
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item .faq__body { padding: 0 1.4rem 1.3rem; color: var(--row-muted); }
.faq__item .faq__body p { margin: 0; }

/* CTA */
.cta {
	text-align: center;
	background: linear-gradient(135deg, var(--row-blue), var(--row-teal));
	border-radius: var(--row-radius-lg);
	padding: clamp(2.5rem, 5vw, 3.5rem);
	color: #fff;
	box-shadow: var(--row-shadow);
}
.cta h2 { color: #fff; font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.cta p { color: rgba(255,255,255,.9); max-width: 46ch; margin-inline: auto; }
.cta .row-btn--primary { background: #fff; color: var(--row-blue); }
.cta .row-btn--primary:hover, .cta .row-btn--primary:focus { background: #eef4ff; color: var(--row-blue-dark); }

/* ==========================================================================
   Generic page / post content
   ========================================================================== */

.page-hero {
	background: var(--row-bg-alt);
	border-bottom: 1px solid var(--row-line);
	padding: clamp(2.5rem, 5vw, 3.5rem) 0;
}
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0; }
.page-hero .meta { color: var(--row-muted); margin-top: .5rem; }

.content-area { padding: clamp(2.5rem, 5vw, 4rem) 0; }
.entry-content { max-width: 760px; margin-inline: auto; }
.entry-content > * { margin-bottom: 1.1em; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.3em; }
.entry-content img { border-radius: var(--row-radius); }
.entry-content blockquote {
	margin: 1.5em 0;
	padding: .5em 1.25em;
	border-left: 4px solid var(--row-blue);
	background: var(--row-bg-alt);
	border-radius: 0 8px 8px 0;
	color: var(--row-body);
}
.entry-content pre {
	background: #0f2036; color: #e6edf5;
	padding: 1em 1.25em; border-radius: 10px; overflow:auto;
}
.entry-content code { background: var(--row-bg-alt); padding: .15em .4em; border-radius: 5px; }
.entry-content pre code { background: none; padding: 0; }

.post-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.post-card {
	background:#fff; border:1px solid var(--row-line); border-radius: var(--row-radius);
	overflow: hidden; box-shadow: var(--row-shadow-soft); display:flex; flex-direction:column;
}
.post-card { transition: transform .12s ease, box-shadow .12s ease; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--row-shadow); }
.post-card__thumb img { width:100%; aspect-ratio: 16/9; object-fit: cover; display:block; }
.post-card__body { padding: 1.25rem 1.4rem 1.5rem; display:flex; flex-direction:column; align-items:flex-start; }
.post-card__cat {
	display:inline-block; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
	color: var(--row-teal-dark); background: rgba(15,139,129,.1);
	padding:.2rem .6rem; border-radius:6px; margin-bottom:.7rem;
}
.post-card__cat:hover { text-decoration:none; background: rgba(15,139,129,.18); }
.post-card__body h2 { font-size: 1.2rem; margin-bottom:.35rem; }
.post-card__body h2 a { color: var(--row-ink); }
.post-card__body h2 a:hover { color: var(--row-blue); text-decoration:none; }
.post-card__meta { color: var(--row-muted); font-size:.85rem; margin-bottom:.6rem; }
.post-card__body p { color: var(--row-body); font-size:.96rem; }
.post-card__more { margin-top:auto; font-weight:600; font-size:.92rem; }
.post-card__more:hover { text-decoration:none; }

.page-hero .section__eyebrow { margin-bottom:.5rem; }
.page-hero__intro { margin-top:.6rem; color: var(--row-muted); max-width: 60ch; }
.page-hero__intro p:last-child { margin-bottom:0; }

.pagination { display:flex; gap:.5rem; justify-content:center; margin-top:2.5rem; flex-wrap:wrap; }
.pagination .page-numbers {
	padding:.5rem .9rem; border:1px solid var(--row-line); border-radius:8px; color:var(--row-body);
}
.pagination .page-numbers.current { background: var(--row-blue); color:#fff; border-color: var(--row-blue); }

.error-404 { text-align:center; padding: clamp(3rem,8vw,6rem) 0; }
.error-404 .code { font-size: clamp(4rem, 12vw, 8rem); font-weight: 800; color: var(--row-blue); line-height:1; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	background: var(--row-bg-deep);
	color: #9fb0c4;
	padding: clamp(3rem, 5vw, 4rem) 0 2rem;
}
.site-footer a { color: #cdd7e3; }
.site-footer a:hover { color: #fff; }

.footer-grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr 1fr;
	gap: 2rem;
}
.footer-brand .site-brand__name { color:#fff; }
.footer-brand p { margin-top: .75rem; max-width: 34ch; font-size:.95rem; }

.footer-col h4 { color:#fff; font-size:.95rem; text-transform: uppercase; letter-spacing:.06em; margin-bottom:.9rem; }
.footer-col ul { list-style:none; margin:0; padding:0; display:grid; gap:.55rem; }
.footer-col a { font-size:.95rem; }

.footer-bottom {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255,255,255,.1);
	display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap;
	font-size:.9rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
	.steps { grid-template-columns: repeat(2, 1fr); }
	.cards, .formula-grid { grid-template-columns: repeat(2, 1fr); }
	.split { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 782px) {
	.main-nav {
		position: absolute;
		top: 100%; left: 0; right: 0;
		background: #fff;
		border-bottom: 1px solid var(--row-line);
		box-shadow: var(--row-shadow);
		display: none;
		padding: .75rem;
	}
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; align-items: stretch; gap: .15rem; }
	.main-nav a { padding: .7rem .9rem; }
	.nav-toggle { display: inline-flex; }
	.header-actions .row-btn--ghost { display:none; }
}

@media (max-width: 640px) {
	body { font-size: 16px; }
	.steps, .cards, .formula-grid { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr; }
	.footer-bottom { flex-direction: column; align-items:flex-start; }
	.site-brand__desc { display:none; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition: none !important; }
}
