/*
Theme Name: Matthew Ashley
Theme URI: https://matthewashley.co.uk/
Author: Matthew Ashley
Description: A dark, Story-style blog theme for MatthewAshley.co.uk: a classic posts list with a right sidebar (Bluesky, recent posts, quotes), a signature logo, easy-to-read articles, consistent image framing and a light mode switch.
Version: 2.9.0
Requires at least: 6.4
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: matthewashley
*/

/* ---------- Colour tokens: dark sage (light sage and white is the default, set in the head script) ---------- */
:root {
	--bg: #1C241E;
	--surface: #243027;
	--text: #EEF2EC;
	--muted: #ADB9AA;
	--accent: #B4CBA6;
	--on-accent: #1C241E;
	--tint: #2A372D;
	--line: #34433A;
	--gold: #EEF2EC;
	--sky: #4BA3FF;
	--head-bg: #1C241E;
	--nav-bg: #4E6B48;
	--nav-text: #FFFFFF;
	--nav-active: #FFFFFF;
	--foot: #161D18;
	--foot-text: #E3E9E1;
	--foot-muted: #A3AFA0;
	--tile: #5E7A57;
	--tile-line: #D5E2CC;
	--shadow: 0 12px 28px rgba(0, 0, 0, 0.4);

	--serif: 'Newsreader', Georgia, 'Times New Roman', serif;
	--sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--script: 'Mrs Saint Delafield', 'Brush Script MT', cursive;
	--wrap: 1140px;
	--body-size: 20px;
}

/* Light (the default look): white page, rich green header with a white name, deep green menu bar and footer. */
:root[data-theme="light"] {
	--bg: #FFFFFF;
	--surface: #FFFFFF;
	--text: #1E2A21;
	--muted: #5A6A5C;
	--accent: #355A31;
	--on-accent: #FFFFFF;
	--tint: #EDF3EA;
	--line: #D3DECD;
	--gold: #2A4427;
	--sky: #1185FE;
	--head-bg: #6F8F67;
	--nav-bg: #3E5A39;
	--nav-text: #FFFFFF;
	--nav-active: #FFFFFF;
	--foot: #24331F;
	--foot-text: #E8EEE6;
	--foot-muted: #B4C2B1;
	--tile: #24391F;
	--tile-line: #A9C29C;
	--shadow: 0 12px 28px rgba(30, 42, 33, 0.1);
}
:root[data-theme="light"] .header-main { --text: #FFFFFF; --line: #5C7A55; }
:root[data-theme="light"] .header-main .search-field,
:root[data-theme="light"] .header-main .icon-button { background: #FFFFFF; color: #1E2A21; }
:root[data-theme="light"] .header-main .search-field::placeholder { color: #5A6A5C; }
:root[data-theme="light"] .site-footer {
	--bg: #33472D; --text: #F2F5F0; --muted: #B4C2B1; --line: #3E5537; --gold: #F2F5F0; --accent: #C9DBBE; --tile: #6F8F67; --tile-line: #D5E2CC;
}
:root[data-theme="light"] .site-header,
:root[data-theme="light"] .main-nav { border-color: #3E5A39; }
.main-nav { border-top-color: #3E5A39; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}
img { max-width: 100%; height: auto; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 100;
	width: auto; height: auto; clip: auto;
	padding: 10px 16px;
	background: var(--surface); color: var(--text);
	border-radius: 6px;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.icon { display: inline-block; flex: 0 0 auto; vertical-align: middle; }

/* ---------- Logo ---------- */
.brand { display: flex; align-items: center; gap: 16px; color: var(--text); }
.brand:hover { text-decoration: none; }
.ma-tile {
	position: relative;
	display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
	width: 58px; height: 58px; padding-bottom: 4px;
	border-radius: 10px;
	background: var(--tile); color: #FFFFFF;
	font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: 0.5px; line-height: 1;
}
.ma-tile::after {
	content: ''; position: absolute; left: 50%; bottom: 13px;
	width: 22px; height: 1.5px; margin-left: -11px;
	background: var(--tile-line);
}
.brand-name { font-family: var(--serif); font-size: 32px; font-weight: 500; line-height: 1.1; }
.custom-logo { max-height: 64px; width: auto; }

/* ---------- Header ---------- */
.site-header { background: var(--head-bg); border-bottom: 1px solid var(--line); }
.header-main {
	display: flex; flex-wrap: wrap; gap: 16px 32px;
	justify-content: space-between; align-items: center;
	padding-top: 28px; padding-bottom: 22px;
}
.header-tools { display: flex; align-items: center; gap: 10px; }
.search-form { display: flex; align-items: center; }
.search-field {
	width: 200px; height: 40px; padding: 0 14px;
	border: 1px solid var(--line); border-radius: 999px;
	background: var(--bg); color: var(--text);
	font: inherit; font-size: 15px;
}
.search-field::placeholder { color: var(--muted); }
.icon-button {
	width: 40px; height: 40px;
	display: inline-flex; align-items: center; justify-content: center;
	border: 1px solid var(--line); border-radius: 50%;
	background: var(--bg); color: var(--text);
	cursor: pointer;
}
.theme-toggle .icon-sun { display: inline-block; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: inline-block; }

.main-nav { background: var(--nav-bg); border-top: 1px solid var(--line); color: var(--nav-text); }
.menu-toggle {
	display: none;
	align-items: center; gap: 8px;
	min-height: 48px; padding: 0;
	border: 0; background: transparent; color: var(--nav-text);
	font: inherit; font-size: 15px; font-weight: 500; cursor: pointer;
}
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav .menu {
	display: flex; flex-wrap: wrap; gap: 4px 30px;
	font-size: 15px; font-weight: 500;
}
.main-nav .menu > li { position: relative; display: flex; align-items: center; }
.main-nav .menu > li > a {
	display: block;
	padding: 14px 0 11px;
	border-bottom: 3px solid transparent;
}
.main-nav .menu > li > a:hover { text-decoration: none; color: var(--nav-active); }
.main-nav .current-menu-item > a,
.main-nav .current-menu-ancestor > a,
.main-nav .current_page_item > a,
.main-nav .current_page_ancestor > a {
	color: var(--nav-active);
	border-bottom-color: var(--nav-active) !important;
}
.submenu-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 28px; height: 28px; margin-left: 2px;
	border: 0; background: transparent; color: inherit; cursor: pointer;
}
.submenu-toggle .icon { transition: transform 0.15s ease; }
li.is-open > .submenu-toggle .icon { transform: rotate(180deg); }
.main-nav .sub-menu,
.main-nav .children {
	position: absolute; top: 100%; left: -18px; z-index: 30;
	min-width: 300px; padding: 8px 0;
	background: var(--surface); color: var(--text);
	border: 1px solid var(--line); border-top: 2px solid var(--gold);
	border-radius: 0 0 8px 8px;
	box-shadow: var(--shadow);
	font-weight: 400;
	display: none;
}
.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu,
.main-nav li.is-open > .sub-menu,
.main-nav li:hover > .children,
.main-nav li:focus-within > .children,
.main-nav li.is-open > .children { display: block; }
.main-nav .sub-menu a, .main-nav .children a { display: block; padding: 10px 18px; }
.main-nav .sub-menu a:hover, .main-nav .children a:hover { background: var(--tint); text-decoration: none; }
.main-nav .sub-menu .sub-menu, .main-nav .children .children { position: static; border: 0; box-shadow: none; padding-left: 12px; display: block; }

/* ---------- Layout ---------- */
.layout {
	display: flex; flex-wrap: wrap; gap: 56px; align-items: flex-start;
	padding-top: 44px; padding-bottom: 72px;
}
.layout > .primary { flex: 999 1 600px; min-width: 0; }
.layout > .sidebar { flex: 1 1 300px; min-width: 0; align-self: stretch; }

/* ---------- Image frames: every picture cropped to a fixed shape, never stretched ---------- */
.frame {
	position: relative; display: block; overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	background: var(--tint);
}
.frame img {
	position: absolute; inset: 0;
	width: 100%; height: 100%;
	object-fit: cover; object-position: center;
}

/* ---------- Post list ---------- */
.archive-header { margin-bottom: 36px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.archive-title { margin: 0 0 6px; font-family: var(--serif); font-size: 40px; line-height: 1.15; font-weight: 600; }
.archive-description { color: var(--muted); }
.archive-description p { margin: 0; }

.post-card {
	display: flex; flex-direction: column; gap: 14px;
	padding-bottom: 40px; margin-bottom: 40px;
	border-bottom: 1px solid var(--line);
}
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 14px; }
.post-meta .cat { font-weight: 600; color: var(--accent); }
.post-meta .date { color: var(--muted); }
.post-card-title {
	margin: 0;
	font-family: var(--serif); font-size: 34px; line-height: 1.18; font-weight: 600;
	letter-spacing: -0.4px;
}
.post-card .frame { margin-top: 6px; }
.post-card-excerpt {
	max-width: 64ch;
	font-family: var(--serif); font-size: 20px; line-height: 1.7;
}
.post-card-excerpt p { margin: 4px 0 0; }
.pill {
	align-self: flex-start;
	display: inline-flex; align-items: center; gap: 8px;
	min-height: 44px; padding: 0 18px;
	border: 1px solid var(--accent); border-radius: 999px;
	font-size: 15px; font-weight: 600; color: var(--accent);
}
.pill:hover { text-decoration: none; background: var(--accent); color: var(--on-accent); }

.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; font-size: 15px; font-weight: 500; }
.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; min-height: 44px; padding: 0 14px;
	border: 1px solid var(--line); border-radius: 8px;
}
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pagination .page-numbers.dots { border: 0; }
.pagination a.page-numbers:hover { text-decoration: none; border-color: var(--accent); }

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 36px; }
.widget { display: flex; flex-direction: column; }
.widget-title {
	margin: 0 0 14px;
	display: flex; align-items: center; gap: 8px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--accent);
	font-family: var(--sans); font-size: 14px; font-weight: 600;
	text-transform: uppercase; letter-spacing: 1.2px;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.widget select, .widget input[type="search"], .widget input[type="text"] {
	max-width: 100%; padding: 8px 10px;
	border: 1px solid var(--line); border-radius: 6px;
	background: var(--surface); color: var(--text); font: inherit;
}

.recent-list { margin: -6px 0 0; padding: 0; list-style: none; }
.recent-list li { padding: 0; border: 0; }
.recent-list a {
	display: flex; flex-direction: column; gap: 2px;
	padding: 12px 0; border-bottom: 1px solid var(--line);
}
.recent-list a:hover { text-decoration: none; }
.recent-list a:hover .recent-title { text-decoration: underline; text-underline-offset: 3px; }
.recent-title { font-family: var(--serif); font-size: 18px; line-height: 1.35; font-weight: 500; }
.recent-date { font-size: 13px; color: var(--muted); }

.quote-list { display: flex; flex-direction: column; gap: 14px; }
.quote-card { margin: 0; padding: 20px 22px; border-radius: 10px; background: var(--tint); }
.quote-card blockquote {
	margin: 0;
	font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.45;
}
.quote-card figcaption { margin-top: 8px; font-size: 14px; color: var(--muted); }

/* Bluesky */
.bsky { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.bsky-logo { color: var(--sky); }
.bsky-item {
	display: flex; flex-direction: column; gap: 6px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--line);
	font-size: 15px; line-height: 1.55;
}
.bsky-item p { margin: 0; overflow-wrap: anywhere; }
.bsky-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.bsky-author { font-size: 13px; font-weight: 600; }
.bsky-author span { font-weight: 400; color: var(--muted); }
.bsky-date { font-size: 13px; color: var(--muted); }
.bsky-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.bsky-images .frame { aspect-ratio: 4 / 3; border-radius: 6px; }
.bsky-images .frame:only-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.bsky-follow {
	display: flex; align-items: center; justify-content: center;
	min-height: 44px; font-size: 14px; font-weight: 600; color: var(--accent);
}
.bsky-empty { margin: 0; padding: 16px; font-size: 14px; color: var(--muted); border-bottom: 1px solid var(--line); }

/* ---------- Single article ---------- */
.breadcrumb { font-size: 14px; color: var(--muted); }
.article { display: flex; flex-direction: column; gap: 18px; }
.article-title {
	margin: 0;
	font-family: var(--serif); font-size: 46px; line-height: 1.12; font-weight: 600;
	letter-spacing: -0.8px;
}
.article-dek { margin: 0; max-width: 62ch; font-family: var(--serif); font-size: 22px; line-height: 1.5; color: var(--muted); }
.article-bar {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
	padding: 14px 0;
	border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
	font-size: 14px; color: var(--muted);
}
.article-bar strong { color: var(--text); font-weight: 600; }
.text-size { display: flex; gap: 8px; margin-left: auto; }
.text-size button {
	min-width: 44px; min-height: 36px;
	border: 1px solid var(--line); border-radius: 999px;
	background: var(--surface); color: var(--text);
	font: inherit; font-size: 14px; cursor: pointer;
}
.article-hero { margin: 8px 0 0; }
.article-hero figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* Post content: readable measure and well-behaved images */
.entry-content {
	max-width: 66ch;
	margin-top: 12px;
	font-family: var(--serif); font-size: var(--body-size); line-height: 1.75;
	overflow-wrap: break-word;
}
.entry-content > * { margin-top: 0; margin-bottom: 24px; }
.entry-content h2 { margin-top: 48px; font-size: 1.5em; line-height: 1.25; font-weight: 600; }
.entry-content h3 { margin-top: 36px; font-size: 1.25em; line-height: 1.3; font-weight: 600; }
.entry-content h2, .entry-content h3 { scroll-margin-top: 24px; }
.entry-content > p:first-child { font-size: 1.12em; line-height: 1.65; }

/* Table of contents and reading progress */
.toc { font-family: var(--sans); }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li.toc-h2 { counter-increment: toc; }
.toc a { display: block; padding: 6px 0; color: var(--text); font-size: 15px; line-height: 1.4; }
.toc li.toc-h2 > a::before { content: counter(toc) "."; display: inline-block; min-width: 22px; color: var(--accent); font-weight: 600; }
.toc li.toc-h3 > a { padding-left: 22px; font-size: 14px; color: var(--muted); }
.toc-inline {
	max-width: 66ch; margin-top: 8px;
	padding: 18px 22px;
	background: var(--tint);
	border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 8px;
}
.toc-inline summary {
	display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
	cursor: pointer; list-style: none;
	font-size: 13px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase;
}
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline summary span { font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.toc-inline[open] summary { margin-bottom: 10px; }
.toc-side { position: sticky; top: 24px; }
.toc-side ol { border-left: 2px solid var(--line); }
.toc-side li { padding: 0; border: 0; }
.toc-side a { margin-left: -2px; padding: 7px 0 7px 14px; border-left: 2px solid transparent; font-size: 14px; }
.toc-side li.toc-h3 > a { padding-left: 28px; font-size: 13px; }
.toc-side a.is-active { border-left-color: var(--accent); color: var(--accent); font-weight: 600; }
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--accent); }
.entry-content h4 { margin-top: 28px; font-size: 1.1em; font-weight: 600; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content strong { font-weight: 600; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; }
.entry-content li { margin-bottom: 8px; }
.entry-content blockquote,
.entry-content .wp-block-quote,
.entry-content .wp-block-pullquote {
	margin: 32px 0; padding: 18px 24px;
	border: 0; border-left: 4px solid var(--accent);
	border-radius: 0 8px 8px 0;
	background: var(--tint);
	font-size: 1.15em; line-height: 1.5; font-style: italic;
	text-align: left;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content cite { display: block; margin-top: 8px; font-family: var(--sans); font-size: 14px; font-style: normal; color: var(--muted); }
.entry-content table { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: 15px; display: block; overflow-x: auto; }
.entry-content th, .entry-content td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.entry-content pre { overflow-x: auto; padding: 16px; background: var(--tint); border-radius: 6px; font-size: 15px; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.entry-content img,
.entry-content video,
.entry-content iframe,
.entry-content embed,
.entry-content object { max-width: 100%; height: auto; }
.entry-content iframe { width: 100%; aspect-ratio: 16 / 9; }
.entry-content img { display: block; border-radius: 6px; }
.entry-content figure,
.entry-content .wp-caption,
.entry-content .wp-block-image { margin-left: 0; margin-right: 0; max-width: 100%; }
.entry-content .wp-caption { width: auto !important; }
.entry-content figure img,
.entry-content .wp-caption img,
.entry-content .wp-block-image img { width: 100%; height: auto; }
.entry-content figcaption,
.entry-content .wp-caption-text,
.entry-content .wp-element-caption {
	margin-top: 10px;
	font-family: var(--sans); font-size: 14px; line-height: 1.5; color: var(--muted);
	text-align: left;
}
/* Small images keep their size, centred */
.entry-content img.size-thumbnail,
.entry-content img.size-medium { width: auto; }
.entry-content .aligncenter, .entry-content img.aligncenter { margin-left: auto; margin-right: auto; text-align: center; }
.entry-content .aligncenter img { margin-left: auto; margin-right: auto; }
/* Floats never take more than half the column, and stack on phones */
.entry-content .alignleft, .entry-content .alignright { max-width: 50%; }
.entry-content .alignleft { float: left; margin: 6px 28px 16px 0; }
.entry-content .alignright { float: right; margin: 6px 0 16px 28px; }
.entry-content .alignleft img, .entry-content .alignright img { width: 100%; }
.entry-content::after { content: ""; display: table; clear: both; }
/* Wide and full images stay inside the column next to the sidebar */
.entry-content .alignwide, .entry-content .alignfull { margin-left: 0; margin-right: 0; width: 100%; max-width: 100%; }
/* Galleries: even square tiles */
.entry-content .wp-block-gallery,
.entry-content .gallery {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}
.entry-content .wp-block-gallery.columns-3, .entry-content .gallery-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.entry-content .wp-block-gallery .wp-block-image,
.entry-content .gallery .gallery-item { margin: 0 !important; width: auto !important; max-width: none !important; }
.entry-content .wp-block-gallery img,
.entry-content .gallery img { aspect-ratio: 1 / 1; object-fit: cover; height: 100% !important; }
.entry-content .gallery br { display: none; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; font-size: 14px; }
.tags a { padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.tags a:hover { text-decoration: none; border-color: var(--accent); }

.post-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.post-nav a {
	display: flex; flex-direction: column; gap: 4px;
	padding: 18px;
	border: 1px solid var(--line); border-radius: 10px;
	background: var(--surface);
}
.post-nav a:hover { text-decoration: none; border-color: var(--accent); }
.post-nav .next { grid-column: 2; text-align: right; }
.post-nav .label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.post-nav .title { font-family: var(--serif); font-size: 19px; line-height: 1.3; font-weight: 600; }

/* ---------- Pages ---------- */
.page-header { margin-bottom: 8px; }

/* ---------- Comments ---------- */
.comments { margin-top: 40px; max-width: 66ch; }
.comments-title, .comment-reply-title { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 0 0 16px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.comment-meta { font-size: 13px; color: var(--muted); }
.comment-author .avatar { border-radius: 50%; vertical-align: middle; margin-right: 8px; }
.comment-respond { margin-top: 32px; }
.comment-respond label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.comment-respond input[type="text"], .comment-respond input[type="email"], .comment-respond input[type="url"], .comment-respond textarea {
	width: 100%; padding: 10px 12px;
	border: 1px solid var(--line); border-radius: 6px;
	background: var(--surface); color: var(--text);
	font: inherit;
}
.comment-respond .submit, .button {
	min-height: 44px; padding: 0 22px;
	border: 0; border-radius: 999px;
	background: var(--accent); color: var(--on-accent);
	font: inherit; font-weight: 600; cursor: pointer;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--foot); color: var(--foot-text); border-top: 1px solid var(--line); }
.footer-main {
	display: flex; flex-wrap: wrap; gap: 48px; justify-content: space-between;
	padding-top: 56px; padding-bottom: 40px;
}
.footer-about { flex: 1 1 300px; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.footer-about .brand { color: var(--foot-text); gap: 14px; }
.footer-about .ma-tile { width: 46px; height: 46px; font-size: 21px; border-radius: 8px; }
.footer-about .ma-tile::after { bottom: 10px; width: 18px; margin-left: -9px; }
.footer-about .brand-name { font-size: 25px; }
.footer-about p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--foot-muted); }
.footer-follow {
	align-self: flex-start;
	display: inline-flex; align-items: center; gap: 8px;
	min-height: 44px; padding: 0 18px;
	border: 1px solid var(--gold); border-radius: 999px;
	font-size: 14px; font-weight: 600; color: var(--gold);
}
.footer-follow:hover { text-decoration: none; background: var(--gold); color: var(--foot); }
.footer-columns {
	flex: 2 1 520px;
	display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 32px;
	font-size: 15px;
}
.footer-columns h2 {
	margin: 0 0 12px;
	font-family: var(--sans); font-size: 12px; font-weight: 600;
	letter-spacing: 1.6px; text-transform: uppercase;
	color: var(--gold);
}
.footer-columns ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom .wrap {
	display: flex; flex-wrap: wrap; gap: 12px 24px;
	justify-content: space-between; align-items: center;
	padding-top: 20px; padding-bottom: 20px;
	font-size: 13px; color: var(--foot-muted);
}
.back-to-top { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
	.header-main { padding-top: 20px; padding-bottom: 16px; }
	.toc-side { display: none; }
	.brand { gap: 12px; }
	.ma-tile { width: 46px; height: 46px; font-size: 21px; border-radius: 8px; }
	.ma-tile::after { bottom: 10px; width: 18px; margin-left: -9px; }
	.brand-name { font-size: 25px; }
	.header-tools { width: 100%; }
	.search-form { flex: 1; }
	.search-field { width: 100%; }
	.menu-toggle { display: inline-flex; }
	.main-nav .menu { display: none; flex-direction: column; gap: 0; padding-bottom: 10px; }
	.main-nav.is-open .menu { display: flex; }
	.main-nav .menu > li { flex-wrap: wrap; justify-content: space-between; border-bottom: 1px solid var(--line); }
	.main-nav .menu > li > a { padding: 12px 0; border-bottom: 0; }
	.main-nav .current-menu-item > a, .main-nav .current_page_item > a { border-bottom: 0 !important; }
	.submenu-toggle { width: 44px; height: 44px; }
	.main-nav .sub-menu, .main-nav .children {
		position: static; width: 100%; min-width: 0;
		border: 0; border-left: 2px solid var(--gold); border-radius: 0;
		box-shadow: none; background: transparent; color: var(--nav-text);
		margin: 0 0 10px; padding: 0 0 0 8px;
	}
	.main-nav li:hover > .sub-menu, .main-nav li:hover > .children,
	.main-nav li:focus-within > .sub-menu, .main-nav li:focus-within > .children { display: none; }
	.main-nav li.is-open > .sub-menu, .main-nav li.is-open > .children { display: block; }
	.main-nav .sub-menu a:hover, .main-nav .children a:hover { background: transparent; }

	.layout { padding-top: 28px; gap: 48px; }
	.post-card-title { font-size: 27px; }
	.post-card-excerpt { font-size: 18px; }
	.article-title { font-size: 34px; }
	.article-dek { font-size: 19px; }
	.text-size { margin-left: 0; }
	.entry-content .alignleft, .entry-content .alignright { float: none; max-width: 100%; margin: 0 0 22px; }
	.entry-content .wp-block-gallery.columns-3, .entry-content .gallery-columns-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.post-nav { grid-template-columns: 1fr; }
	.post-nav .next { grid-column: 1; }
}
