/*
Theme Name: Lab Theme
Version: 1.4
Description: 教育ラボ — Stripe-inspired light SaaS blog theme with semantic HTML and JSON-LD.
Requires at least: 6.2
Requires PHP: 7.4
*/

/* ═══════════════════════════════
   RESET
   ═══════════════════════════════ */

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

/* ═══════════════════════════════
   BASE
   ═══════════════════════════════ */

html {
	scroll-padding-top: 88px;
	scroll-behavior: smooth;
}

body {
	font-family: "Inter", "Noto Sans JP", -apple-system, BlinkMacSystemFont, sans-serif;
	font-weight: 400;
	font-size: 1rem;
	line-height: 1.8;
	color: #1e1e2e;
	background: #f9f9fc;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════
   ANIMATED BACKGROUND BLOBS
   Fixed to viewport, behind content
   ═══════════════════════════════ */

body::before,
body::after {
	content: "";
	position: fixed;
	z-index: -1;
	border-radius: 50%;
	filter: blur(120px);
	opacity: 0.3;
	pointer-events: none;
	will-change: transform;
}

body::before {
	width: 600px;
	height: 600px;
	background: radial-gradient(circle, #c4b5fd 0%, #a78bfa 40%, #7c3aed 100%);
	top: -10%;
	left: -5%;
	animation: blob-drift-1 25s ease-in-out infinite alternate;
}

body::after {
	width: 500px;
	height: 500px;
	background: radial-gradient(circle, #a5b4fc 0%, #818cf8 40%, #4f46e5 100%);
	bottom: -10%;
	right: -5%;
	animation: blob-drift-2 30s ease-in-out infinite alternate;
}

@keyframes blob-drift-1 {
	0% {
		transform: translate(0, 0) scale(1);
	}
	25% {
		transform: translate(30vw, 20vh) scale(1.15);
	}
	50% {
		transform: translate(15vw, 55vh) scale(0.9);
	}
	75% {
		transform: translate(50vw, 30vh) scale(1.1);
	}
	100% {
		transform: translate(35vw, 65vh) scale(1);
	}
}

@keyframes blob-drift-2 {
	0% {
		transform: translate(0, 0) scale(1);
	}
	25% {
		transform: translate(-25vw, -30vh) scale(1.1);
	}
	50% {
		transform: translate(-40vw, -15vh) scale(0.85);
	}
	75% {
		transform: translate(-15vw, -50vh) scale(1.15);
	}
	100% {
		transform: translate(-30vw, -40vh) scale(0.95);
	}
}

a {
	color: currentColor;
	transition: color 0.2s ease, opacity 0.2s ease;
}

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

/* ═══════════════════════════════
   STICKY SITE HEADER  (light)
   ═══════════════════════════════ */

body > header {
	position: sticky;
	top: 0;
	z-index: 1000;
	background: rgba(255, 255, 255, 0.75);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-bottom: 1px solid #ebebf0;
}

body > header > nav {
	max-width: 1060px;
	margin: 0 auto;
	padding: 0 clamp(20px, 4vw, 40px);
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

body > header > nav > a {
	color: #1e1e2e;
	font-weight: 800;
	font-size: 1.125rem;
	letter-spacing: -0.3px;
	text-decoration: none;
}

body > header > nav > a:hover {
	opacity: 0.7;
}

body > header > nav > ul {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 28px;
}

body > header > nav > ul a {
	color: #52526b;
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	transition: color 0.2s ease;
}

body > header > nav > ul a:hover {
	color: #1e1e2e;
}

/* ═══════════════════════════════
   HERO / TITLE SECTION  (main > header)
   ═══════════════════════════════ */

main {
	background: rgba(255, 255, 255, 0.55);
}

/* ─── Sponsored content banner ─── */

body > p.sponsored-banner,
main > p.sponsored-banner {
	border-bottom: 1px solid #e2e8f0;
	background-color: #f8fafc;
	font-size: 10px;
	padding: 10px 16px;
	color: #64748b;
	text-align: center;
	letter-spacing: -0.025em;
	line-height: 1.625;
	margin: 0;
	font-family: "JetBrains Mono", monospace;
}

@media (min-width: 640px) {
	body > p.sponsored-banner,
	main > p.sponsored-banner {
		font-size: 12px;
	}
}

main > p.sponsored-banner[hidden] {
	display: none;
}

main > header {
	padding-top: clamp(32px, 5vw, 56px);
	padding-bottom: clamp(48px, 6vw, 72px);
	max-width: 1060px;
	margin-inline: auto;
	padding-left: clamp(20px, 4vw, 40px);
	padding-right: clamp(20px, 4vw, 40px);
}

main > header:has(> article) {
	padding-bottom: clamp(16px, 3vw, 24px);
}

main > header:has(> article):last-child {
	padding-bottom: clamp(48px, 6vw, 72px);
}

main > header > h1 {
	font-size: clamp(1.75rem, 1.2rem + 2.2vw, 3rem);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.8px;
	color: #1e1e2e;
}

main > header > p {
	margin-top: 12px;
	font-size: clamp(0.9375rem, 0.85rem + 0.25vw, 1.0625rem);
	color: #6b6b80;
	font-weight: 400;
	line-height: 1.7;
}

/* ─── Breadcrumbs ─── */

main > header > nav {
	display: flex;
	align-items: center;
	margin-bottom: clamp(16px, 2.5vw, 24px);
	font-size: 0.8125rem;
	font-weight: 500;
	line-height: 1;
}

main > header > nav a {
	color: #6d28d9;
	text-decoration: none;
}

main > header > nav a:hover {
	color: #5b21b6;
	text-decoration: underline;
}

main > header > nav span {
	margin: 0 8px;
	color: #b0b0c0;
	user-select: none;
}

/* ─── Single page: two-column title offset ─── */

main > header:has(address) {
	display: grid;
	grid-template-columns: 220px 1fr;
	column-gap: 40px;
	padding-bottom: clamp(40px, 5vw, 56px);
}

main > header:not(:has(+ article figure)):has(address) {
	padding-bottom: clamp(32px, 4vw, 44px);
}

main > header:has(address) > * {
	grid-column: 2;
}

main > header:has(address) > nav {
	grid-column: 1 / -1;
}

main > header .entry-meta {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	margin-top: 14px;
}

main > header .entry-meta time {
	display: block;
	font-size: 0.875rem;
	color: #8b8b9e;
	font-weight: 400;
}

main > header .entry-meta address {
	font-style: normal;
	font-size: 0.875rem;
	color: #8b8b9e;
}

/* ─── Hero featured article card (gradient) ─── */

main > header > article {
	margin-top: clamp(48px, 6vw, 80px);
	display: grid;
	grid-template-columns: 1fr 1fr;
	grid-template-rows: 1fr auto auto auto auto 1fr;
	column-gap: clamp(40px, 8vw, 120px);
	row-gap: 24px;
}

main > header > article:not(:has(figure)) {
	grid-template-columns: 1fr;
	grid-template-rows: auto auto auto auto;
}

main > header > article > time {
	grid-column: 1;
	grid-row: 2;
	display: block;
	font-size: 0.875rem;
	color: #64748b;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	margin-bottom: -12px;
}

main > header > article > h2 {
	grid-column: 1;
	grid-row: 3;
	font-size: clamp(1.5rem, 1.3rem + 1.5vw, 2.25rem);
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: -0.5px;
	color: #0f172a;
}

main > header > article > h2 a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

main > header > article > h2 a:hover {
	color: #4f46e5;
}

main > header > article > p {
	grid-column: 1;
	grid-row: 4;
	font-size: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
	line-height: 1.8;
	color: #475569;
	margin-top: -4px;
}

main > header > article > a:last-of-type {
	grid-column: 1;
	grid-row: 5;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	font-size: 1rem;
	font-weight: 600;
	color: #4f46e5;
	text-decoration: none;
	width: fit-content;
	transition: color 0.2s ease;
}

main > header > article > a:last-of-type:hover {
	color: #3730a3;
}

main > header > article > a:last-of-type::after {
	content: "\2192";
	transition: transform 0.2s ease;
}

main > header > article > a:last-of-type:hover::after {
	transform: translateX(4px);
}

main > header > article > figure {
	grid-column: 2;
	grid-row: 1 / -1;
	align-self: center;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
	margin-left: auto;
}

main > header > article > figure > img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
}

/* ═══════════════════════════════
   FEATURED GRID  (注目の記事)
   first section when two exist
   ═══════════════════════════════ */

main > section.featured-articles {
	max-width: 1060px;
	margin: 0 auto;
	padding: clamp(24px, 4vw, 40px) clamp(20px, 4vw, 40px) 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(20px, 3vw, 28px);
}

main > section.featured-articles:last-child {
	padding-bottom: clamp(48px, 6vw, 80px);
}

main > section.featured-articles > h2 {
	grid-column: 1 / -1;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #8b8b9e;
	padding-bottom: 16px;
	border-bottom: 1px solid #ebebf0;
	margin-bottom: 4px;
}

main > section.featured-articles > article {
	display: flex;
}

main > section.featured-articles > article > a {
	display: flex;
	flex-direction: column;
	width: 100%;
	text-decoration: none;
	border: 1px solid #ebebf0;
	border-radius: 12px;
	overflow: hidden;
	background: #ffffff;
	transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

main > section.featured-articles > article > a:hover {
	border-color: #d4d0e8;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
	transform: translateY(-3px);
}

main > section.featured-articles > article > a > figure {
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #f4f3f8;
}

main > section.featured-articles > article > a > figure > img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

main > section.featured-articles > article > a:hover > figure > img {
	transform: scale(1.03);
}

main > section.featured-articles > article > a > h3 {
	padding: 18px 20px 0;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: -0.2px;
	color: #1e1e2e;
}

main > section.featured-articles > article > a > time {
	display: block;
	margin-top: auto;
	padding: 8px 20px 20px;
	font-size: 0.8125rem;
	font-weight: 500;
	color: #8b8b9e;
}

/* ═══════════════════════════════
   ARTICLE LIST  (最新の記事)
   last section or only section
   ═══════════════════════════════ */

main > section.latest-articles {
	max-width: 1060px;
	margin: 0 auto;
	padding: clamp(48px, 6vw, 80px) clamp(20px, 4vw, 40px) clamp(48px, 6vw, 80px);
}

main > section.latest-articles > h2 {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #8b8b9e;
	padding-bottom: 16px;
	border-bottom: 1px solid #ebebf0;
	margin-bottom: 0;
}

main > section.latest-articles > article {
	padding: clamp(20px, 3vw, 32px) 0;
	border-bottom: 1px solid #ebebf0;
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-rows: auto auto;
	column-gap: 24px;
	align-items: baseline;
}

main > section.latest-articles > article:last-child {
	border-bottom: none;
}

main > section.latest-articles > article > h3 {
	grid-column: 1;
	grid-row: 1;
	font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: -0.2px;
}

main > section.latest-articles > article > h3 a {
	text-decoration: none;
}

main > section.latest-articles > article > h3 a:hover {
	color: #6d28d9;
}

main > section.latest-articles > article > time {
	grid-column: 2;
	grid-row: 1;
	font-size: 0.8125rem;
	color: #8b8b9e;
	font-weight: 500;
	white-space: nowrap;
}

main > section.latest-articles > article > p {
	grid-column: 1 / -1;
	grid-row: 2;
	margin-top: 6px;
	color: #52526b;
	font-size: 0.9375rem;
	line-height: 1.7;
}

/* ═══════════════════════════════
   EMPTY STATE (NO ARTICLES)
   ═══════════════════════════════ */

main > section.no-articles {
	max-width: 1060px;
	margin: 0 auto;
	padding: clamp(64px, 10vw, 120px) clamp(20px, 4vw, 40px);
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 40vh;
}

main > section.no-articles > p {
	font-size: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
	color: #52526b;
	font-weight: 500;
	text-align: center;
	padding: 40px 60px;
	background: #ffffff;
	border: 1px solid #ebebf0;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

/* ═══════════════════════════════
   SINGLE — ARTICLE TWO-COLUMN GRID
   Col 1: aside (ToC)
   Col 2: figure, section, footer
   ═══════════════════════════════ */

main > article {
	display: grid;
	grid-template-columns: 220px 1fr;
	column-gap: 40px;
	max-width: 1060px;
	margin-inline: auto;
	padding-inline: clamp(20px, 4vw, 40px);
	min-width: 0;
}

/* Aside (ToC) occupies column 1, spans all rows */
main > article > aside {
	grid-column: 1;
	grid-row: 1 / 20;
	position: relative;
}

/* Content children go to column 2 */
main > article > figure,
main > article > section,
main > article > footer {
	grid-column: 2;
}

/* ═══════════════════════════════
   SINGLE — STICKY TABLE OF CONTENTS
   ═══════════════════════════════ */

main > article > aside > nav {
	position: sticky;
	top: 80px;
	max-height: calc(100vh - 100px);
	overflow-y: auto;
	padding-top: clamp(32px, 5vw, 52px);
	padding-bottom: 32px;
}

/* Hide aside if no headings (JS sets hidden attribute) */
main > article > aside[hidden] {
	display: none;
}

main > article:not(:has(aside:not([hidden]))) {
	grid-template-columns: 1fr;
	max-width: 800px;
}

main > article:not(:has(aside:not([hidden]))) > figure,
main > article:not(:has(aside:not([hidden]))) > section,
main > article:not(:has(aside:not([hidden]))) > footer {
	grid-column: 1;
}

/* ToC label */
main > article > aside > nav > p {
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #8b8b9e;
	margin-bottom: 16px;
}

/* H2 list */
main > article > aside > nav > ol {
	list-style: none;
	padding: 0;
	margin: 0;
}

main > article > aside > nav > ol > li {
	border-left: 2px solid #ebebf0;
	transition: border-color 0.2s ease;
}

/* Active H2 — highlighted border */
main > article > aside > nav > ol > li[aria-current="true"] {
	border-left-color: #6d28d9;
}

/* H2 link */
main > article > aside > nav > ol > li > a {
	display: block;
	padding: 6px 0 6px 14px;
	font-size: 0.8125rem;
	font-weight: 500;
	color: #52526b;
	text-decoration: none;
	line-height: 1.45;
	transition: color 0.2s ease;
}

main > article > aside > nav > ol > li[aria-current="true"] > a {
	color: #6d28d9;
	font-weight: 600;
}

main > article > aside > nav > ol > li > a:hover {
	color: #6d28d9;
}

/* H3 nested list — collapsed by default */
main > article > aside > nav > ol > li > ol {
	list-style: none;
	padding: 0;
	margin: 0;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.35s ease;
}

/* Expanded state */
main > article > aside > nav > ol > li[aria-expanded="true"] > ol {
	max-height: 600px;
}

/* H3 link */
main > article > aside > nav > ol > li > ol > li > a {
	display: block;
	padding: 4px 0 4px 26px;
	font-size: 0.78125rem;
	font-weight: 400;
	color: #8b8b9e;
	text-decoration: none;
	line-height: 1.45;
	transition: color 0.2s ease;
}

main > article > aside > nav > ol > li > ol > li[aria-current="true"] > a {
	color: #6d28d9;
	font-weight: 500;
}

main > article > aside > nav > ol > li > ol > li > a:hover {
	color: #6d28d9;
}

/* ═══════════════════════════════
   SINGLE — FEATURED IMAGE
   ═══════════════════════════════ */

main > article > figure {
	padding-top: clamp(32px, 5vw, 56px);
}

main > article > figure > img {
	width: 100%;
	aspect-ratio: 2 / 1;
	object-fit: cover;
	border-radius: 10px;
}

main > article > figure > figcaption {
	font-size: 0.8125rem;
	color: #8b8b9e;
	margin-top: 10px;
}

/* ═══════════════════════════════
   SINGLE — ARTICLE BODY
   ═══════════════════════════════ */

main > article > section {
	padding-top: clamp(32px, 5vw, 52px);
	padding-bottom: clamp(40px, 6vw, 64px);
	min-width: 0;
}

main > article > section p {
	margin-bottom: 1.5rem;
	color: #2d2d44;
	line-height: 1.85;
	font-size: 0.9625rem;
}

main > article > section h2 {
	font-size: clamp(1.3rem, 1.15rem + 0.5vw, 1.625rem);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -0.3px;
	margin-top: clamp(40px, 5vw, 56px);
	margin-bottom: 14px;
	color: #1e1e2e;
	padding-bottom: 8px;
	border-bottom: 2px solid #ede9fe;
}

main > article > section h3 {
	font-size: clamp(1.0625rem, 1rem + 0.2vw, 1.25rem);
	font-weight: 600;
	line-height: 1.35;
	margin-top: 32px;
	margin-bottom: 10px;
	color: #1e1e2e;
}

main > article > section h4 {
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
	margin-top: 24px;
	margin-bottom: 8px;
	color: #1e1e2e;
}

main > article > section a {
	color: #6d28d9;
	font-weight: 500;
	text-underline-offset: 3px;
}

main > article > section a:hover {
	color: #5b21b6;
}

main > article > section blockquote {
	border-left: 3px solid #7c3aed;
	margin: 1.75rem 0;
	padding: 16px 20px;
	background: #faf5ff;
	border-radius: 0 6px 6px 0;
}

main > article > section blockquote p {
	color: #4a4a64;
	margin-bottom: 0;
}

main > article > section blockquote cite {
	display: block;
	font-size: 0.8125rem;
	font-style: normal;
	font-weight: 500;
	color: #8b8b9e;
	margin-top: 8px;
}

main > article > section pre {
	background: #1e1e2e;
	color: #e2e8f0;
	padding: 20px 24px;
	border-radius: 8px;
	overflow-x: auto;
	margin: 1.75rem 0;
	font-family: "JetBrains Mono", "Fira Code", monospace;
	font-size: 0.8625rem;
	line-height: 1.7;
}

main > article > section code {
	font-family: "JetBrains Mono", "Fira Code", monospace;
	font-size: 0.875em;
	background: #f4f0ff;
	color: #6d28d9;
	padding: 2px 6px;
	border-radius: 4px;
}

main > article > section pre code {
	background: none;
	color: inherit;
	padding: 0;
	border-radius: 0;
	font-size: inherit;
}

main > article > section img {
	border-radius: 8px;
	margin: 1rem 0;
}

main > article > section ul {
	list-style: none;
	padding-left: 0;
	margin-bottom: 1.5rem;
	color: #2d2d44;
}

main > article > section ul > li {
	padding-left: 2.5em;
	position: relative;
}

main > article > section ul > li::before {
	content: "";
	position: absolute;
	left: 0.45em;
	top: 0.7em;
	width: 0.5em;
	height: 0.5em;
	background: #6d28d9;
	border-radius: 50%;
}

main > article > section ol {
	list-style: none;
	padding-left: 0;
	margin-bottom: 1.5rem;
	color: #2d2d44;
	counter-reset: ol-counter;
}

main > article > section ol > li {
	counter-increment: ol-counter;
	padding-left: 2.5em;
	position: relative;
}

main > article > section ol > li::before {
	content: counter(ol-counter);
	position: absolute;
	left: 0;
	top: 0.35em;
	width: 1.6em;
	height: 1.6em;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ede9fe;
	color: #6d28d9;
	font-size: 0.8125rem;
	font-weight: 700;
	border-radius: 50%;
	line-height: 1;
}

main > article > section li {
	margin-top: 0.5rem;
	line-height: 1.8;
}

main > article > section hr {
	border: none;
	border-top: 1px solid #ebebf0;
	margin: clamp(32px, 4vw, 48px) 0;
}

main > article > section .table-wrap {
	position: relative;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin: 1.5rem 0;
	border: 1px solid #e2e1e9;
	border-radius: 8px;
	max-width: 100%;
}

main > article > section .table-scroll-hint {
	position: absolute;
	top: 0;
	right: 0;
	width: 56px;
	height: 100%;
	pointer-events: none;
	z-index: 1;
	background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.9));
	border-radius: 0 8px 8px 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
	transition: opacity 0.4s ease;
}

main > article > section .table-scroll-hint.is-hidden {
	opacity: 0;
}

main > article > section .table-scroll-hint > span {
	display: block;
	font-size: 20px;
	color: #7c3aed;
	animation: swipe-arrow 1.2s ease-in-out infinite;
}

@keyframes swipe-arrow {
	0%, 100% { transform: translateX(0); opacity: 0.4; }
	50% { transform: translateX(-8px); opacity: 1; }
}

main > article > section table {
	width: 100%;
	min-width: 480px;
	border-collapse: collapse;
	font-size: 0.9375rem;
	background: #fff;
}

main > article > section th,
main > article > section td {
	text-align: left;
	padding: 12px 16px;
	border-bottom: 1px solid #ebebf0;
	white-space: nowrap;
}

main > article > section td {
	white-space: normal;
	min-width: 100px;
}

main > article > section th {
	font-weight: 600;
	color: #1e1e2e;
	background: #f4f3fa;
	position: sticky;
	top: 0;
}

main > article > section tr:last-child td {
	border-bottom: none;
}

main > article > section tr:nth-child(even) {
	background: #f7f7fa;
}

main > article > section tbody tr:hover {
	background: #eeedf5;
}

/* ═══════════════════════════════
   SINGLE — TAGS
   ═══════════════════════════════ */

main > article > footer {
	border-top: 1px solid #ebebf0;
	padding-top: clamp(20px, 3vw, 32px);
	padding-bottom: clamp(32px, 5vw, 52px);
}

main > article > footer > nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

main > article > footer > nav a {
	display: inline-block;
	font-size: 0.8125rem;
	font-weight: 500;
	color: #6d28d9;
	text-decoration: none;
	padding: 5px 14px;
	border: 1px solid #e8e0f7;
	border-radius: 100px;
	background: #faf5ff;
	transition: background 0.15s ease, border-color 0.15s ease;
}

main > article > footer > nav a:hover {
	background: #ede9fe;
	border-color: #c4b5fd;
}

/* ═══════════════════════════════
   SINGLE — POST NAVIGATION
   ═══════════════════════════════ */

main > article + nav {
	display: grid;
	grid-template-columns: 220px 1fr 1fr;
	column-gap: 20px;
	row-gap: 16px;
	max-width: 1060px;
	margin-inline: auto;
	padding-inline: clamp(20px, 4vw, 40px);
	padding-bottom: clamp(48px, 6vw, 72px);
}

main > article + nav > a {
	display: block;
	padding: 18px 20px;
	border: 1px solid #ebebf0;
	border-radius: 8px;
	text-decoration: none;
	background: rgba(255, 255, 255, 0.85);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

main > article + nav > a[rel="prev"] {
	grid-column: 2;
}

main > article + nav > a[rel="next"] {
	grid-column: 3;
}

main > article + nav > a:only-child[rel="prev"] {
	grid-column: 2;
}

main > article + nav > a:only-child[rel="next"] {
	grid-column: 2 / -1;
}

main > article + nav > a:hover {
	border-color: #c4b5fd;
	box-shadow: 0 2px 12px rgba(109, 40, 217, 0.06);
}

main > article + nav > a > small {
	display: block;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.5px;
	color: #8b8b9e;
	margin-bottom: 4px;
}

main > article + nav > a > span {
	display: block;
	font-size: 0.9375rem;
	font-weight: 600;
	color: #1e1e2e;
	line-height: 1.4;
}

/* ═══════════════════════════════
   SITE FOOTER  (dark contrast)
   ═══════════════════════════════ */

body > footer {
	background: #0f0f1a;
	padding-top: clamp(48px, 6vw, 72px);
	padding-bottom: clamp(36px, 5vw, 48px);
}

.footer-inner {
	max-width: 1060px;
	margin-inline: auto;
	padding-inline: clamp(20px, 4vw, 40px);
}

.footer-brand > p {
	color: rgba(255, 255, 255, 0.5);
	font-size: 0.9375rem;
	line-height: 1.7;
	max-width: 320px;
}

.footer-brand > p > strong {
	display: block;
	font-size: 1.125rem;
	font-weight: 800;
	letter-spacing: -0.3px;
	color: #ffffff;
	margin-bottom: 4px;
}

/* ─── Footer Stripe-like Navigation Grid ─── */

.footer-nav-grid {
	margin-top: clamp(40px, 6vw, 64px);
}

ul.footer-columns {
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 48px 24px;
	align-items: start;
}

ul.footer-columns > li {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* Parent Category / Column Title (Bold) */
.footer-column-title {
	display: block;
	font-size: 0.9375rem;
	font-weight: 700;
	color: #ffffff;
	margin-bottom: 24px;
	letter-spacing: -0.2px;
}

ul.footer-columns > li:not(.footer-column-item) > a {
	display: block;
	font-size: 0.9375rem;
	font-weight: 700;
	color: #ffffff;
	margin-bottom: 20px;
	text-decoration: none;
	letter-spacing: -0.2px;
	transition: color 0.2s ease;
}

ul.footer-columns > li:not(.footer-column-item) > a:hover {
	color: rgba(255, 255, 255, 0.8);
}

/* Child Categories / Menu Items (Smaller, Normal Weight) */
ul.footer-columns > li ul.children {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding-left: 0;
	min-width: 0;
	width: 100%;
}

ul.footer-columns > li ul.children a {
	font-size: 0.875rem;
	font-weight: 400;
	color: rgba(255, 255, 255, 0.6);
	text-decoration: none;
	transition: color 0.2s ease;
}

ul.footer-columns > li ul.children a:hover {
	color: #ffffff;
}

.footer-inner > small {
	display: block;
	font-size: 0.8125rem;
	color: rgba(255, 255, 255, 0.25);
	padding-top: clamp(28px, 4vw, 40px);
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	margin-top: clamp(32px, 5vw, 64px);
}


/* ═══════════════════════════════
   RESPONSIVE
   ═══════════════════════════════ */

@media (max-width: 960px) {
	/* Collapse single-page two-column layout */
	main > header:has(address) {
		grid-template-columns: 1fr;
		max-width: none;
	}

	main > header:has(address) > * {
		grid-column: 1;
	}

	main > article {
		grid-template-columns: 1fr;
		max-width: none;
		padding-inline: clamp(20px, 4vw, 40px);
	}

	main > article > aside {
		grid-column: 1;
		grid-row: auto;
	}

	main > article > aside > nav {
		position: static;
		max-height: none;
		display: none;
	}

	main > article > figure,
	main > article > section,
	main > article > footer {
		grid-column: 1;
	}

	main > article + nav {
		grid-template-columns: 1fr 1fr;
		max-width: none;
	}

	main > article + nav > a[rel="prev"],
	main > article + nav > a[rel="next"] {
		grid-column: auto;
	}

	main > article + nav > a:only-child[rel="prev"],
	main > article + nav > a:only-child[rel="next"] {
		grid-column: 1 / -1;
	}

	/* Archive grid */
	main > section.featured-articles {
		grid-template-columns: repeat(2, 1fr);
	}

	main > header > article {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 640px) {
	main > header > article {
		grid-template-columns: 1fr;
		grid-template-rows: auto;
		column-gap: 0;
	}

	main > header > article > time,
	main > header > article > h2,
	main > header > article > p,
	main > header > article > a:last-of-type,
	main > header > article > figure {
		grid-column: 1;
		grid-row: auto;
		margin-left: 0;
	}

	main > section.featured-articles {
		grid-template-columns: 1fr;
	}

	main > section.latest-articles > article {
		grid-template-columns: 1fr;
	}

	main > section.latest-articles > article > time {
		grid-column: 1;
		grid-row: auto;
		margin-top: 2px;
		order: -1;
	}

	main > section.latest-articles > article > h3 {
		margin-top: 2px;
	}

	main > article + nav {
		grid-template-columns: 1fr;
	}

	main > article + nav > a[rel="prev"],
	main > article + nav > a[rel="next"] {
		grid-column: 1 / -1;
	}

	main > article > section ul > li {
		padding-left: 1.5em;
	}

	main > article > section ul > li::before {
		left: 0;
	}

	main > article > section ol > li {
		padding-left: 2.2em;
	}

	/* Footer nav: 3-column grid on mobile */
	ul.footer-columns {
		grid-template-columns: repeat(3, 1fr);
		gap: 32px 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body::before,
	body::after {
		animation: none;
	}
}

/* ═══════════════════════════════
   404 ERROR PAGE
   ═══════════════════════════════ */

.error-404-main {
	min-height: calc(100vh - 200px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(64px, 10vw, 120px) clamp(20px, 4vw, 40px);
}

.error-404-container {
	text-align: center;
	background: rgba(255, 255, 255, 0.85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	padding: clamp(40px, 6vw, 80px) clamp(30px, 5vw, 60px);
	border: 1px solid #ffffff;
	border-radius: 20px;
	box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.02);
	max-width: 600px;
	width: 100%;
}

.error-404-container .page-title {
	font-size: clamp(4.5rem, 10vw, 7rem);
	font-weight: 900;
	line-height: 1;
	letter-spacing: -2px;
	margin-bottom: 12px;
	background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	color: #4f46e5;
}

.error-404-container .error-message {
	font-size: clamp(1.125rem, 3vw, 1.375rem);
	font-weight: 700;
	color: #1e1e2e;
	margin-bottom: 16px;
	letter-spacing: -0.5px;
}

.error-404-container .error-description {
	font-size: 0.9375rem;
	color: #64748b;
	line-height: 1.8;
	margin-bottom: 32px;
}

.error-404-container .return-home-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 32px;
	background: #1e1e2e;
	color: #ffffff;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9375rem;
	border-radius: 40px;
	transition: all 0.25s ease;
	box-shadow: 0 8px 16px rgba(30, 30, 46, 0.15);
}

.error-404-container .return-home-btn:hover {
	background: #4f46e5;
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 12px 24px rgba(79, 70, 229, 0.25);
}

/* ═══════════════════════════════
   IN-ARTICLE ADS — hidden until filled
   ═══════════════════════════════ */

main > article > section .in-article-ad {
	display: none;
}

main > article > section .in-article-ad:has(ins[data-ad-status="filled"]) {
	display: block;
	margin: clamp(32px, 4vw, 48px) 0;
}

/* ═══════════════════════════════
   STICKY BOTTOM AD (MOBILE ONLY)
   ═══════════════════════════════ */

.ad-sticky-bottom {
	display: none;
}

.ad-sticky-bottom:has(ins[data-ad-status="filled"]) {
	display: block;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	background: #ffffff;
	box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
	padding: 8px 16px;
	max-height: 100px;
	overflow: hidden;
}

/* Add bottom padding to body so sticky ad does not cover content */
body:has(.ad-sticky-bottom ins[data-ad-status="filled"]) {
	padding-bottom: 5rem;
}

/* Hide sticky bottom ad on desktop */
@media (min-width: 768px) {
	.ad-sticky-bottom:has(ins[data-ad-status="filled"]) {
		display: none;
	}

	body:has(.ad-sticky-bottom ins[data-ad-status="filled"]) {
		padding-bottom: 0;
	}
}
