/*
Theme Name:   Niihea
Theme URI:    https://niihea.ee/
Description:  Kohandatud teema niihea.ee jaoks. Asendab Swyfti, hoiab sama sisu, logo, Inter kirjatüübi ja värvid.
Author:       SEO agentuur
Author URI:   https://seo-agentuur.ee/
Version:      1.0.2
Requires at least: 6.4
Requires PHP: 7.4
Text Domain:  niihea
*/

/* ---------------------------------------------------------------
   Inter, self-hosted (variable font, weights 400-700, SIL OFL)
   ------------------------------------------------------------ */
@font-face {
	font-family: Inter;
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("assets/fonts/inter-latin-ext.woff2") format("woff2");
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: Inter;
	font-style: normal;
	font-weight: 400 700;
	font-display: swap;
	src: url("assets/fonts/inter-latin.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;
}

/* ---------------------------------------------------------------
   Tokens: the palette Swyft had in the Customizer on niihea.ee
   ------------------------------------------------------------ */
:root {
	--bg: #ffffff;
	--layout: #f1f1f2;
	--text: #1d1d1f;
	--muted: #616162;
	--line: #e4e4e4;
	--accent: #0d6eff;
	--accent-text: #0a5fdb; /* #0d6eff is under 4.5:1 for small text */
	--accent-hover: #084cb0;
	--btn: #1d1d1f;
	--btn-text: #ffffff;
	--soft: #ededed;
	--shadow: 0 1px 2px rgba(29, 29, 31, .06), 0 8px 24px rgba(29, 29, 31, .08);
	--radius: 14px;
	--radius-sm: 10px;
	--wrap: 1240px;
	--gutter: 24px;
	--header-h: 72px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-scheme="light"]) {
		--bg: #1c1c1c;
		--layout: #232323;
		--text: #ffffff;
		--muted: #cdcbca;
		--line: #343434;
		--accent-text: #4d94ff;
		--accent-hover: #3d8bff;
		--btn: #3e3e3e;
		--soft: #2c2c2c;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
		color-scheme: dark;
	}
}

:root[data-scheme="dark"] {
	--bg: #1c1c1c;
	--layout: #232323;
	--text: #ffffff;
	--muted: #cdcbca;
	--line: #343434;
	--accent-text: #4d94ff;
	--accent-hover: #3d8bff;
	--btn: #3e3e3e;
	--soft: #2c2c2c;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
	color-scheme: dark;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

img {
	height: auto;
	display: block;
}

a {
	color: inherit;
	text-decoration: none;
}

h1,
h2,
h3,
h4 {
	margin: 0;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.035em;
}

p {
	margin: 0;
}

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

.wrap {
	width: 100%;
	max-width: calc(var(--wrap) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 0 var(--gutter);
}

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

.skip-link:focus {
	position: fixed;
	top: 12px;
	left: 12px;
	z-index: 100;
	padding: 10px 16px;
	background: var(--btn);
	color: var(--btn-text);
	border-radius: var(--radius-sm);
}

.btn,
.wp-block-button__link,
.wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 22px;
	border: 0;
	border-radius: var(--radius-sm);
	background: var(--btn);
	color: var(--btn-text);
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background-color .2s ease, transform .2s ease;
}

.btn:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
	background: var(--accent);
	color: #fff;
}

.btn:active {
	transform: translateY(1px);
}

/* ---------------------------------------------------------------
   Header
   ------------------------------------------------------------ */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--bg);
	border-bottom: 1px solid var(--line);
}

.admin-bar .site-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header {
		top: 46px;
	}
}

@media (max-width: 600px) {
	.admin-bar .site-header {
		top: 0;
	}
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 32px;
	height: var(--header-h);
}

.site-logo {
	margin: 0;
	font-size: inherit;
	flex-shrink: 0;
}

.site-logo a {
	display: block;
}

.logo-img {
	height: 38px;
	width: auto;
}

.logo-dark {
	display: none;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-scheme="light"]) .logo-light { display: none; }
	:root:not([data-scheme="light"]) .logo-dark { display: block; }
}

:root[data-scheme="dark"] .logo-light { display: none; }
:root[data-scheme="dark"] .logo-dark { display: block; }

.main-nav {
	margin-left: auto;
}

.main-nav .menu,
.mobile-panel .menu,
.footer-nav .menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-nav .menu {
	display: flex;
	gap: 4px;
}

.main-nav a {
	position: relative;
	display: block;
	padding: 10px 14px;
	border-radius: var(--radius-sm);
	font-size: 15px;
	font-weight: 500;
	letter-spacing: -0.02em;
	transition: background-color .2s ease;
}

.main-nav a:hover {
	background: var(--layout);
}

.main-nav .current-menu-item > a,
.main-nav .current-menu-parent > a,
.main-nav .current-post-ancestor > a,
.main-nav .current-category-ancestor > a {
	color: var(--accent-text);
}

.main-nav .current-menu-item > a::after,
.main-nav .current-post-ancestor > a::after {
	content: "";
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: -15px;
	height: 2px;
	background: var(--accent);
}

.header-tools {
	display: flex;
	align-items: center;
	gap: 4px;
}

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--text);
	cursor: pointer;
	list-style: none;
	transition: background-color .2s ease;
}

.icon-btn::-webkit-details-marker {
	display: none;
}

.icon-btn:hover,
details[open] > .icon-btn {
	background: var(--layout);
}

.scheme-btn .icon-sun {
	display: none;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-scheme="light"]) .scheme-btn .icon-sun { display: block; }
	:root:not([data-scheme="light"]) .scheme-btn .icon-moon { display: none; }
}

:root[data-scheme="dark"] .scheme-btn .icon-sun { display: block; }
:root[data-scheme="dark"] .scheme-btn .icon-moon { display: none; }

.search-toggle,
.mobile-nav {
	position: relative;
}

.search-panel,
.mobile-panel {
	position: absolute;
	top: calc(100% + 16px);
	right: 0;
	z-index: 60;
	background: var(--bg);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.search-panel {
	width: min(400px, calc(100vw - 2 * var(--gutter)));
	padding: 14px;
}

.mobile-nav {
	display: none;
}

.mobile-panel {
	width: min(320px, calc(100vw - 2 * var(--gutter)));
	padding: 8px;
}

.mobile-panel a {
	display: block;
	padding: 12px 14px;
	border-radius: var(--radius-sm);
	font-weight: 500;
}

.mobile-panel a:hover,
.mobile-panel .current-menu-item > a {
	background: var(--layout);
}

@media (max-width: 960px) {
	.main-nav {
		display: none;
	}

	.header-tools {
		margin-left: auto;
	}

	.mobile-nav {
		display: block;
	}
}

/* Search form */
.search-form {
	display: flex;
	gap: 8px;
}

.search-field,
.wp-block-search__input {
	flex: 1;
	min-width: 0;
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--bg);
	color: var(--text);
	font: inherit;
	font-size: 15px;
	font-weight: 500;
}

.search-field:focus,
.wp-block-search__input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgba(13, 110, 255, .18);
}

/* Widget band under the header (Kiwi.com flight search on the home page) */
.header-after {
	padding: 14px 0;
	background: var(--layout);
	border-bottom: 1px solid var(--line);
}

.header-after .wrap > * {
	border-radius: var(--radius);
	overflow: hidden;
}

/* Reserve the Kiwi widget's rendered height (measured 2026-10-29) so the
   page does not jump down when its script fills the box. min-height lets
   it still grow if Travelpayouts ever makes it taller. */
.header-after .wrap {
	min-height: 242px;
}

@media (max-width: 814px) {
	.header-after .wrap {
		min-height: 300px;
	}
}

@media (max-width: 619px) {
	.header-after .wrap {
		min-height: 529px;
	}
}

/* ---------------------------------------------------------------
   Shared bits
   ------------------------------------------------------------ */
.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 14px;
	color: var(--muted);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: -0.01em;
}

.entry-meta > * + *::before {
	content: "";
	display: inline-block;
	width: 3px;
	height: 3px;
	margin-right: 14px;
	border-radius: 50%;
	background: currentColor;
	vertical-align: middle;
	opacity: .6;
}

.entry-cat {
	color: var(--accent-text);
	font-weight: 600;
}

.entry-cat:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.section-label {
	margin-bottom: 4px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.section-title {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 18px;
	font-size: 22px;
}

.section-title::before {
	content: "";
	width: 5px;
	height: 22px;
	border-radius: 3px;
	background: var(--accent);
}

.breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
	color: var(--muted);
	font-size: 14px;
	font-weight: 500;
}

.breadcrumbs a:hover {
	color: var(--accent-text);
}

/* ---------------------------------------------------------------
   Home: lead + side stories
   ------------------------------------------------------------ */
.hero {
	padding: 24px 0 0;
}

.hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
	gap: 32px;
	align-items: stretch;
}

.lead-media,
.card-media,
.side-media {
	display: block;
	overflow: hidden;
	background: var(--layout);
}

.lead {
	position: relative;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--layout);
}

.lead-media {
	height: 100%;
	min-height: 400px;
	aspect-ratio: 16 / 9;
}

.lead-media img,
.card-media img,
.side-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s ease;
}

.lead:hover .lead-media img,
.card:hover .card-media img,
.side-item:hover .side-media img {
	transform: scale(1.035);
}

.lead-body {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 96px 32px 28px;
	background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, .55) 55%, rgba(0, 0, 0, 0));
	color: #fff;
	pointer-events: none;
}

.lead-body a {
	pointer-events: auto;
}

.lead-body .entry-meta {
	color: rgba(255, 255, 255, .85);
}

.lead-body .entry-cat {
	color: #fff;
}

.lead-title {
	margin: 8px 0 8px;
	max-width: 680px;
	font-size: clamp(26px, 2.8vw, 38px);
	line-height: 1.12;
	letter-spacing: -0.04em;
}

.lead-body .lead-title a:hover {
	color: #fff;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.lead-title a:hover,
.side-title a:hover,
.card-title a:hover {
	color: var(--accent-text);
}

.lead-excerpt {
	display: -webkit-box;
	max-width: 620px;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	color: rgba(255, 255, 255, .85);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: -0.015em;
}

.hero-side {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.side-item {
	display: grid;
	grid-template-columns: 104px minmax(0, 1fr);
	gap: 16px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid var(--line);
}

.side-item:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.side-media {
	aspect-ratio: 1;
	border-radius: var(--radius-sm);
}

.side-title {
	margin-top: 6px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.025em;
}

/* Topic index: plain list, not cards */
.topics {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 28px;
	margin-top: 24px;
	margin-bottom: 28px;
	padding-top: 14px;
	padding-bottom: 14px;
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
}

.topics-label {
	color: var(--muted);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.topics ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.topics a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	letter-spacing: -0.02em;
}

.topics a::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--accent);
}

.topics a span {
	color: var(--muted);
	font-weight: 500;
}

.topics a:hover {
	color: var(--accent-text);
}

/* ---------------------------------------------------------------
   Content + sidebar layout and the post grid
   ------------------------------------------------------------ */
.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 40px;
	align-items: start;
}

.paged .layout,
.archive .layout,
.search .layout {
	padding-top: 28px;
}

.grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px 20px;
}

.grid-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-top: 40px;
}

.card-media {
	aspect-ratio: 3 / 2;
	margin-bottom: 12px;
	border-radius: var(--radius-sm);
}

.card-title {
	margin-top: 6px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.025em;
}

/* Pagination */
.pagination {
	margin-top: 36px;
}

.pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pagination li > .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	font-size: 15px;
	font-weight: 600;
}

.pagination a.page-numbers:hover {
	border-color: var(--text);
}

.pagination .current {
	background: var(--btn);
	border-color: var(--btn);
	color: var(--btn-text);
}

.pagination .dots {
	border: 0;
}

/* ---------------------------------------------------------------
   Page heads (archives, search, pages, 404)
   ------------------------------------------------------------ */
.page-head {
	padding: 28px 0 30px;
	background: var(--layout);
}

.page-title {
	font-size: clamp(32px, 4.4vw, 52px);
	letter-spacing: -0.045em;
}

.page-lead {
	max-width: 680px;
	margin-top: 14px;
	color: var(--muted);
	font-size: 18px;
	font-weight: 500;
}

.page-count {
	margin-top: 12px;
	color: var(--muted);
	font-size: 15px;
	font-weight: 500;
}

.page-search {
	max-width: 520px;
	margin-top: 24px;
}

/* ---------------------------------------------------------------
   Single post
   ------------------------------------------------------------ */
.entry-header {
	padding-top: 28px;
	padding-bottom: 22px;
}

.entry-title {
	max-width: 960px;
	margin-bottom: 18px;
	font-size: clamp(32px, 4.6vw, 54px);
	line-height: 1.08;
	letter-spacing: -0.045em;
}

.entry-media {
	margin: 0 auto 36px;
}

.entry-media img {
	width: 100%;
	max-height: 600px;
	aspect-ratio: 2 / 1;
	object-fit: cover;
	border-radius: var(--radius);
}

.entry-content {
	max-width: 740px;
	font-size: 18px;
	line-height: 1.7;
	letter-spacing: -0.011em;
	overflow-wrap: break-word;
}

.entry-content > * {
	margin-top: 0;
	margin-bottom: 1.25em;
}

.entry-content h2 {
	margin-top: 1.9em;
	margin-bottom: .6em;
	font-size: 30px;
	line-height: 1.2;
}

.entry-content h3 {
	margin-top: 1.6em;
	margin-bottom: .5em;
	font-size: 23px;
	line-height: 1.25;
	letter-spacing: -0.03em;
}

.entry-content h4 {
	margin-top: 1.4em;
	margin-bottom: .4em;
	font-size: 19px;
	letter-spacing: -0.02em;
}

.entry-content > :first-child {
	margin-top: 0;
}

.entry-content a {
	color: var(--accent-text);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.entry-content a:hover {
	text-decoration-thickness: 2px;
}

.entry-content .wp-block-button__link {
	color: var(--btn-text);
	text-decoration: none;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.3em;
}

.entry-content li + li {
	margin-top: .4em;
}

.entry-content li::marker {
	color: var(--accent);
}

.entry-content strong {
	font-weight: 600;
}

.entry-content figure {
	margin-left: 0;
	margin-right: 0;
}

.entry-content img {
	border-radius: var(--radius-sm);
}

.entry-content figcaption,
.wp-element-caption {
	margin-top: 10px;
	color: var(--muted);
	font-size: 14px;
	text-align: center;
}

.entry-content blockquote {
	margin-left: 0;
	padding: 4px 0 4px 22px;
	border-left: 4px solid var(--accent);
	font-size: 20px;
	font-weight: 500;
	letter-spacing: -0.02em;
}

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

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	font-size: 16px;
}

.entry-content th,
.entry-content td {
	padding: 12px 14px;
	border: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.entry-content th,
.entry-content thead td {
	background: var(--layout);
	font-weight: 600;
}

.entry-content hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 2.5em 0;
}

.entry-content .wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.entry-content .is-content-justification-center {
	justify-content: center;
}

.aligncenter {
	margin-left: auto;
	margin-right: auto;
}

.alignleft {
	float: left;
	margin: .3em 1.5em 1em 0;
}

.alignright {
	float: right;
	margin: .3em 0 1em 1.5em;
}

.related {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------
   Sidebar widgets (Swyft's block widgets carried over)
   ------------------------------------------------------------ */
.sidebar-inner > .widget + .widget {
	margin-top: 28px;
}

.sidebar .widget img {
	border-radius: var(--radius-sm);
}

.sidebar .widget > a > img {
	margin: 0 auto;
}

.sidebar figure {
	margin: 0;
}

.sidebar .wp-block-heading,
.sidebar .widget-title,
.sidebar .wp-block-search__label {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 14px;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.03em;
}

.sidebar .wp-block-heading::before,
.sidebar .widget-title::before,
.sidebar .wp-block-search__label::before {
	content: "";
	width: 4px;
	height: 18px;
	border-radius: 2px;
	background: var(--accent);
}

.wp-block-search__inside-wrapper {
	display: flex;
	gap: 8px;
}

.sidebar ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.sidebar .wp-block-latest-posts li {
	padding: 10px 0;
	border-bottom: 1px solid var(--line);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: -0.02em;
}

.sidebar .wp-block-latest-posts li:first-child {
	padding-top: 0;
}

.sidebar .wp-block-latest-posts li:last-child {
	border-bottom: 0;
}

.sidebar .wp-block-latest-posts a:hover {
	color: var(--accent-text);
}

.sidebar .wp-block-latest-posts.has-dates li,
.sidebar .is-style-cs-horizontal-layout li {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr);
	grid-template-rows: auto auto;
	column-gap: 14px;
	align-items: center;
}

.sidebar .wp-block-latest-posts__featured-image {
	grid-row: 1 / span 2;
	float: none !important;
	margin: 0 !important;
}

.sidebar .wp-block-latest-posts__featured-image img {
	width: 72px;
	height: 72px;
	object-fit: cover;
}

.sidebar .wp-block-latest-posts__post-date {
	grid-column: 2;
	margin-top: 4px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 500;
}

.sidebar .wp-block-categories li,
.sidebar .widget_categories li {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid var(--line);
	color: var(--muted);
	font-weight: 500;
}

.sidebar .wp-block-categories li a,
.sidebar .widget_categories li a {
	color: var(--text);
	font-weight: 600;
	letter-spacing: -0.02em;
}

.sidebar .wp-block-categories li a:hover {
	color: var(--accent-text);
}

/* ---------------------------------------------------------------
   Footer
   ------------------------------------------------------------ */
.site-footer {
	margin-top: 56px;
	background: var(--layout);
	color: var(--text);
}

.footer-top {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, .8fr);
	gap: 40px;
	padding-top: 40px;
	padding-bottom: 32px;
}

.footer-text {
	max-width: 440px;
	margin-top: 18px;
	color: var(--muted);
	font-size: 15px;
	line-height: 1.6;
}

.footer-title {
	margin-bottom: 14px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.footer-nav .menu {
	display: grid;
	gap: 10px;
}

.footer-nav a {
	font-weight: 500;
	letter-spacing: -0.02em;
}

.footer-nav a:hover {
	color: var(--accent-text);
}

.site-footer .footer-nav:first-of-type .menu {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 24px;
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 12px;
	padding-top: 18px;
	padding-bottom: 22px;
	border-top: 1px solid var(--line);
	color: var(--muted);
	font-size: 14px;
	font-weight: 500;
}

.footer-bottom a:hover {
	color: var(--accent-text);
}

.footer-bottom p a {
	color: var(--text);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

/* ---------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */
@media (max-width: 1180px) {
	.layout {
		grid-template-columns: minmax(0, 1fr) 260px;
		gap: 40px;
	}

	.grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 1024px) {
	.layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.sidebar {
		padding-top: 48px;
		border-top: 1px solid var(--line);
	}

	.sidebar-inner {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 36px 32px;
		align-items: start;
	}

	.sidebar-inner > .widget + .widget {
		margin-top: 0;
	}

	.grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.grid-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.footer-top {
		grid-template-columns: 1fr 1fr;
	}

	.footer-brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 900px) {
	.hero-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Tablet portrait: the three side stories sit in a row under the lead */
@media (min-width: 641px) and (max-width: 900px) {
	.hero-side {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 0 20px;
	}

	.hero-side .section-label {
		grid-column: 1 / -1;
		margin-bottom: 12px;
	}

	.side-item {
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
		align-items: start;
		padding: 0;
		border-bottom: 0;
	}

	.side-media {
		aspect-ratio: 3 / 2;
	}

	.side-title {
		font-size: 16px;
	}
}

@media (max-width: 640px) {
	:root {
		--gutter: 16px;
		--header-h: 64px;
	}

	.logo-img {
		height: 32px;
	}

	.hero {
		padding-top: 16px;
	}

	.lead-media {
		min-height: 0;
		aspect-ratio: 1;
	}

	.lead-body {
		padding: 56px 18px 18px;
	}

	.lead-excerpt {
		display: none;
	}

	.side-item {
		grid-template-columns: 84px minmax(0, 1fr);
		padding: 12px 0;
	}

	.side-title {
		font-size: 17px;
	}

	.card-title {
		margin-top: 4px;
		font-size: 16px;
	}

	.topics {
		margin-bottom: 24px;
	}

	.grid,
	.grid-4 {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	/* Phones: cards become thumbnail rows instead of full-width photos */
	.card {
		display: grid;
		grid-template-columns: 112px minmax(0, 1fr);
		gap: 14px;
		align-items: center;
		padding: 14px 0;
		border-bottom: 1px solid var(--line);
	}

	.card:first-child {
		padding-top: 0;
	}

	.card:last-child {
		border-bottom: 0;
	}

	.card-media {
		aspect-ratio: 1;
		margin-bottom: 0;
	}

	.card .entry-meta {
		font-size: 13px;
		gap: 2px 10px;
	}

	.card .entry-meta > * + *::before {
		margin-right: 10px;
	}

	.sidebar-inner {
		grid-template-columns: minmax(0, 1fr);
	}

	.entry-content {
		font-size: 17px;
	}

	.entry-content h2 {
		font-size: 25px;
	}

	.entry-content h3 {
		font-size: 21px;
	}

	.entry-media {
		padding: 0;
		margin-bottom: 32px;
	}

	.entry-media img {
		border-radius: 0;
		aspect-ratio: 3 / 2;
	}

	.alignleft,
	.alignright {
		float: none;
		margin: 0 0 1em;
	}

	.footer-top {
		grid-template-columns: minmax(0, 1fr);
		gap: 36px;
	}

	.site-footer .footer-nav:first-of-type .menu {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}
}

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