/*
 * Revio — main styles.
 *
 * Colors and radii are CSS custom properties printed from the Customizer (inc/customizer.php):
 * --bg, --surface, --soft, --line, --text, --muted, --hero*, --accent, --on-accent, --r-sm … --r-xl.
 *
 * 1. Base
 * 2. Layout
 * 3. Buttons, links, badges
 * 4. Header and mobile menu
 * 5. Footer
 * 6. Page hero and sections
 * 7. Content (prose) and core blocks
 * 8. Cards and lists
 * 9. Comments and forms
 * 10. WordPress classes
 */

/* 1. Base */
:root {
	--font-heading: "Revio Heading", system-ui, sans-serif;
	--font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
}

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

a {
	color: inherit;
}

a:hover {
	opacity: 0.85;
}

:focus-visible {
	outline: 2px solid var(--accent-strong);
	outline-offset: 2px;
}

[hidden] {
	display: none !important;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--font-heading);
	line-height: 1.15;
	letter-spacing: -0.01em;
}

/* 2. Layout */
.container {
	width: 100%;
	max-width: 1240px;
	margin-inline: auto;
	padding-inline: 24px;
}

.container--text {
	max-width: 808px;
}

.section {
	padding-block: 56px;
}

.layout {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 40px 56px;
	padding-block: 40px 80px;
}

.layout__main {
	flex: 999 1 640px;
	min-width: 0;
}

.layout__aside {
	flex: 1 1 300px;
	min-width: 0;
	position: sticky;
	top: 24px;
	display: grid;
	gap: 16px;
}

/* 3. Buttons, links, badges */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 22px;
	border: 1px solid transparent;
	border-radius: var(--r-sm);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.btn--accent {
	background: var(--accent);
	color: var(--on-accent);
}

.btn--solid {
	background: var(--text);
	color: var(--bg);
}

.btn--outline {
	border-color: var(--text);
	background: transparent;
	color: var(--text);
}

.btn--light {
	background: var(--hero-text);
	color: var(--hero);
}

.link {
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.age-badge {
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 30px;
	height: 30px;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	font-size: 11px;
	font-weight: 600;
}

.icon {
	flex: none;
}

/* 4. Header and mobile menu */
.header {
	background: var(--hero);
	color: var(--hero-text);
	border-bottom: 1px solid var(--hero-line);
}

.header__inner {
	display: flex;
	align-items: center;
	gap: 16px 32px;
	min-height: 76px;
}

.logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	text-decoration: none;
}

.logo__mark {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: var(--r-sm);
	background: var(--accent);
	color: var(--on-accent);
	font-family: var(--font-heading);
	font-size: 20px;
	font-weight: 800;
}

.logo__name {
	font-family: var(--font-heading);
	font-size: 20px;
	font-weight: 700;
}

.custom-logo {
	display: block;
	width: auto;
	max-height: 44px;
}

.header__nav {
	flex: 1 1 auto;
}

.nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 15px;
	font-weight: 500;
}

.nav a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
}

/* Badge next to a menu item (Appearance → Menus → "Badge"). */
.menu-badge {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 99px;
	background: var(--accent);
	color: var(--on-accent);
	font-family: var(--font-body);
	font-size: 10px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	vertical-align: middle;
}

.mobile-menu__list .menu-badge {
	padding: 2px 7px;
}

.nav .current-menu-item > a {
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 6px;
}

.nav .sub-menu {
	display: none;
}

.header__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-left: auto;
}

.search {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--hero-line);
	border-radius: var(--r-sm);
	color: var(--hero-muted);
}

.search__field {
	width: 180px;
	min-width: 0;
	border: 0;
	background: transparent;
	color: var(--hero-text);
	font: inherit;
	font-size: 14px;
	outline: none;
}

.header__account {
	min-height: 44px;
	padding: 0 16px;
	font-size: 14px;
}

.header__burger {
	display: none;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--hero-line);
	border-radius: var(--r-sm);
	background: transparent;
	color: var(--hero-text);
	cursor: pointer;
}

.header__burger .icon--close,
.header__burger[aria-expanded="true"] .icon--menu {
	display: none;
}

.header__burger[aria-expanded="true"] .icon--close {
	display: block;
}

.mobile-menu {
	border-top: 1px solid var(--hero-line);
}

.mobile-menu__inner {
	display: grid;
	gap: 20px;
	padding-block: 16px 28px;
}

.mobile-menu .search__field {
	width: 100%;
	font-size: 16px;
}

.mobile-menu__list {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid var(--hero-line);
}

.mobile-menu__list > li {
	border-bottom: 1px solid var(--hero-line);
}

.mobile-menu__list a {
	display: flex;
	align-items: center;
	min-height: 60px;
	font-family: var(--font-heading);
	font-size: 22px;
	font-weight: 700;
	text-decoration: none;
}

.mobile-menu__list .sub-menu {
	margin: 0 0 12px;
	padding: 0 0 0 16px;
	list-style: none;
}

.mobile-menu__list .sub-menu a {
	min-height: 44px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
}

.mobile-menu__age {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-size: 13px;
	color: var(--hero-muted);
}

@media (max-width: 960px) {
	.header__nav,
	.header__search,
	.header__account {
		display: none;
	}

	.header__burger {
		display: grid;
	}
}

@media (min-width: 961px) {
	.mobile-menu {
		display: none !important;
	}
}

/* 5. Footer */
.footer {
	background: var(--hero);
	color: var(--hero-muted);
	font-size: 14px;
}

.footer__top {
	display: flex;
	flex-wrap: wrap;
	gap: 40px;
	padding-block: 56px 32px;
}

.footer__about {
	flex: 2 1 320px;
}

.footer__about .logo {
	color: var(--hero-text);
}

.footer__about p {
	max-width: 420px;
}

.footer__nav {
	flex: 1 1 160px;
}

.footer__title {
	margin: 0 0 8px;
	color: var(--hero-text);
	font-weight: 600;
}

.footer__menu {
	display: grid;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer__menu a {
	text-decoration: none;
}

.footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
	padding-block: 20px 32px;
	border-top: 1px solid var(--hero-line);
}

.footer__note {
	flex: 1 1 400px;
	margin: 0;
}

.footer__copy {
	margin: 0;
}

/* 6. Page hero and sections */
.page-hero {
	background: var(--hero);
	color: var(--hero-text);
}

.page-hero > .container {
	padding-block: 40px 48px;
}

.page-hero__kicker {
	margin: 0 0 12px;
	font-size: 13px;
	color: var(--hero-muted);
}

.page-hero__kicker a {
	text-decoration: none;
}

.page-hero__title {
	max-width: 900px;
	margin: 0;
	font-size: clamp(34px, 5vw, 52px);
	font-weight: 800;
	letter-spacing: -0.03em;
}

.page-hero__lead {
	max-width: 620px;
	margin-top: 12px;
	font-size: 18px;
	color: var(--hero-muted);
}

.page-hero__code {
	margin: 0;
	font-family: var(--font-mono);
	font-size: clamp(80px, 12vw, 132px);
	font-weight: 700;
	line-height: 0.9;
	color: var(--accent);
}

.page-hero .search {
	max-width: 560px;
	margin-bottom: 24px;
}

/* 7. Content (prose) and core blocks */
.entry-content > * {
	max-width: 760px;
	margin-inline: auto;
	padding-inline: 24px;
}

.entry-content > .alignwide {
	max-width: 1240px;
}

.entry-content > .alignfull {
	max-width: none;
	padding-inline: 0;
}

/* Revio blocks are sections with their own container: full width unless set to wide. */
.entry-content > [class*="wp-block-revio-"]:not(.alignwide) {
	max-width: none;
	padding-inline: 0;
}

.entry-cover {
	margin: 0 0 28px;
}

.entry-cover img {
	display: block;
	width: 100%;
	border-radius: var(--r-lg);
}

/*
 * Text from the editor: posts, pages and the "Text section" block.
 * Every core element is styled, so any content looks finished.
 */
.prose {
	font-size: 17px;
	line-height: 1.7;
}

.prose::after {
	content: "";
	display: table;
	clear: both;
}

.prose > * {
	max-width: 760px;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
	margin: 1.6em 0 0.5em;
	font-family: var(--font-heading);
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.prose h1 {
	margin-top: 0;
	font-size: 44px;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.prose h2 {
	font-size: 32px;
	font-weight: 800;
}

.prose h3 {
	font-size: 24px;
	font-weight: 700;
}

.prose h4 {
	font-size: 20px;
	font-weight: 700;
}

.prose h5 {
	font-size: 17px;
	font-weight: 700;
}

.prose h6 {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--muted);
}

.prose p,
.prose ul,
.prose ol,
.prose dl,
.prose table,
.prose blockquote,
.prose pre,
.prose figure,
.prose address {
	margin: 0 0 1.1em;
}

.prose .is-style-lead,
.prose .has-large-font-size {
	font-size: 20px;
	line-height: 1.6;
}

.prose a {
	color: var(--text);
	text-decoration: underline;
	text-decoration-color: var(--accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.prose ul,
.prose ol {
	padding-left: 1.4em;
}

.prose li {
	margin: 0.3em 0;
}

.prose li > ul,
.prose li > ol {
	margin: 0.3em 0 0;
}

.prose ul li::marker {
	color: var(--muted);
}

.prose ol li::marker {
	font-family: var(--font-mono);
	font-size: 0.85em;
	color: var(--muted);
}

.prose dt {
	font-weight: 600;
}

.prose dd {
	margin: 0 0 0.6em;
	color: var(--muted);
}

.prose blockquote {
	margin-right: 0;
	margin-left: 0;
	padding: 20px 24px;
	border-left: 4px solid var(--accent);
	border-radius: 0 var(--r-md) var(--r-md) 0;
	background: var(--surface);
	font-family: var(--font-heading);
	font-size: 22px;
	font-weight: 500;
	line-height: 1.4;
}

.prose blockquote p {
	margin: 0;
}

.prose blockquote cite {
	display: block;
	margin-top: 12px;
	font-family: var(--font-body);
	font-size: 14px;
	font-style: normal;
	color: var(--muted);
}

.prose blockquote cite::before {
	content: "— ";
}

.prose .wp-block-table {
	overflow-x: auto;
}

.prose table {
	width: 100%;
	border: 1px solid var(--line);
	border-collapse: collapse;
	font-size: 15px;
}

.prose caption,
.prose .wp-block-table figcaption {
	padding-bottom: 8px;
	caption-side: top;
	font-size: 14px;
	text-align: left;
	color: var(--muted);
}

.prose th,
.prose td {
	padding: 12px 16px;
	border-bottom: 1px solid var(--line);
	text-align: left;
}

.prose thead th {
	background: var(--soft);
	font-weight: 600;
}

.prose tbody tr:nth-child(even) {
	background: var(--surface);
}

.prose tfoot td {
	border-bottom: 0;
	font-size: 14px;
	color: var(--muted);
}

.prose code,
.prose kbd {
	font-family: var(--font-mono);
	font-size: 0.85em;
}

.prose :not(pre) > code {
	padding: 2px 6px;
	border-radius: 6px;
	background: var(--soft);
}

.prose kbd {
	padding: 2px 6px;
	border: 1px solid var(--line);
	border-bottom-width: 2px;
	border-radius: 6px;
	background: var(--surface);
}

.prose pre {
	overflow-x: auto;
	padding: 18px 20px;
	border-radius: var(--r-md);
	background: #0d1b1e;
	color: #e8f0ee;
	font-size: 15px;
	line-height: 1.6;
}

.prose mark {
	padding: 0 3px;
	background: var(--accent);
	color: var(--on-accent);
}

.prose abbr[title] {
	text-decoration: underline dotted;
	cursor: help;
}

.prose del,
.prose small,
.prose address {
	color: var(--muted);
}

.prose ins {
	padding: 0 3px;
	background: var(--soft);
	text-decoration: none;
}

.prose address {
	font-style: normal;
}

.prose hr {
	height: 1px;
	margin: 2em 0;
	border: 0;
	background: var(--line);
}

.prose img {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--r-md);
}

.prose figcaption {
	margin-top: 8px;
	font-size: 14px;
	color: var(--muted);
}

.prose .alignright {
	float: right;
	width: 44%;
	margin: 4px 0 16px 24px;
}

.prose .alignleft {
	float: left;
	width: 44%;
	margin: 4px 24px 16px 0;
}

.prose .alignright img,
.prose .alignleft img {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.prose .alignwide,
.prose .alignfull {
	clear: both;
}

.prose .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 0 22px;
	border-radius: var(--r-sm);
	background: var(--accent);
	color: var(--on-accent);
	font-weight: 600;
	text-decoration: none;
}

@media (max-width: 640px) {
	.prose {
		font-size: 16px;
	}

	.prose h1 {
		font-size: 34px;
	}

	.prose h2 {
		font-size: 26px;
	}

	.prose .alignright,
	.prose .alignleft {
		float: none;
		width: auto;
		margin: 0 0 1.1em;
	}

	.prose table {
		font-size: 14px;
	}

	.prose th,
	.prose td {
		padding: 10px 12px;
	}
}

.wp-block-details {
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	background: var(--surface);
}

.wp-block-details summary {
	padding: 18px 22px;
	font-weight: 600;
	cursor: pointer;
}

.wp-block-details > :not(summary) {
	margin: 0;
	padding: 0 22px 20px;
	color: var(--muted);
}

/* 8. Cards and lists */
.post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
	gap: 16px;
}

.post-card {
	position: relative;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: var(--surface);
	transition: border-color 0.15s;
}

.post-card:hover {
	border-color: var(--text);
}

.post-card__media img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.post-card__body {
	padding: 20px;
}

.post-card__meta {
	margin: 0;
	font-size: 12px;
	color: var(--muted);
}

.post-card__title {
	margin: 10px 0 0;
	font-size: 19px;
	line-height: 1.3;
}

.post-card__title a {
	text-decoration: none;
}

.post-card__excerpt {
	margin: 8px 0 0;
	font-size: 14px;
	color: var(--muted);
}

.card-link::after {
	content: "";
	position: absolute;
	inset: 0;
}

.empty {
	padding: 40px;
	border-radius: var(--r-lg);
	background: var(--soft);
	text-align: center;
}

.tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 32px 0 0;
	padding: 0;
	list-style: none;
}

.tags a {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 99px;
	background: var(--soft);
	font-size: 13px;
	text-decoration: none;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 28px;
}

.pagination .page-numbers {
	display: grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	text-decoration: none;
}

.pagination .page-numbers.current {
	border-color: var(--text);
	background: var(--text);
	color: var(--bg);
}

/* 9. Comments and forms */
.comments {
	margin-top: 48px;
}

.comments__list {
	display: grid;
	gap: 12px;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
}

.comments__list .comment-body {
	padding: 18px 22px;
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	background: var(--surface);
}

.comments__list .children {
	margin: 10px 0 0 40px;
	padding: 0;
	list-style: none;
}

.comments__form input[type="text"],
.comments__form input[type="email"],
.comments__form input[type="url"],
.comments__form textarea {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: var(--r-sm);
	background: var(--bg);
	color: var(--text);
	font: inherit;
}

/* 10. WordPress classes */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
	word-wrap: normal !important;
}

.skip-link:focus {
	z-index: 100000;
	top: 8px;
	left: 8px;
	width: auto;
	height: auto;
	padding: 12px 20px;
	clip: auto;
	clip-path: none;
	background: var(--surface);
	color: var(--text);
}

.alignleft {
	float: left;
	margin: 0 24px 16px 0;
}

.alignright {
	float: right;
	margin: 0 0 16px 24px;
}

.aligncenter {
	display: block;
	margin-inline: auto;
}

.wp-caption,
.gallery-caption,
.wp-element-caption {
	font-size: 14px;
	color: var(--muted);
}

.sticky,
.bypostauthor {
	/* Required by WordPress; styled through post cards and comments. */
}

@media (max-width: 640px) {
	.container {
		padding-inline: 16px;
	}

	.alignleft,
	.alignright {
		float: none;
		margin: 0 0 16px;
	}
}
