/*
Theme Name: Msft Advocate
Theme URI: https://msftadvocate.com
Author: Msft Advocate
Description: A clean, fast and modern blog theme for Microsoft technology content — Entra ID, Microsoft 365, Defender, Exchange, Intune, Windows Server, PowerShell and more. Features dark mode, color-coded categories, a featured hero post, auto table of contents, reading progress bar, code blocks with copy buttons and related posts.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
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: msftadvocate
Tags: blog, news, two-columns, grid-layout, custom-logo, custom-menu, featured-images, dark-mode, threaded-comments, translation-ready
*/

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
	--bg: #f5f7fa;
	--surface: #ffffff;
	--surface-2: #eef2f6;
	--text: #18202a;
	--muted: #5a6573;
	--border: #e2e7ed;
	--accent: #0067b8;
	--accent-2: #00a4ef;
	--accent-soft: rgba(0, 103, 184, .09);
	--media-bg: linear-gradient(135deg, #ffffff 0%, #eef3f9 100%);
	--code-bg: #0f1722;
	--code-text: #e6edf3;
	--radius: 16px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .06);
	--shadow-lg: 0 2px 4px rgba(16, 24, 40, .05), 0 18px 40px rgba(16, 24, 40, .12);
	--container: 1240px;
	--font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--font-mono: "Cascadia Code", "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
	color-scheme: light;
}

[data-theme="dark"] {
	--bg: #0b1017;
	--surface: #121923;
	--surface-2: #18212d;
	--text: #e7edf4;
	--muted: #9aa6b4;
	--border: #233040;
	--accent: #4ba6ff;
	--accent-2: #3fd0ff;
	--accent-soft: rgba(75, 166, 255, .12);
	--media-bg: linear-gradient(135deg, #fbfcfe 0%, #eaf0f6 100%);
	--code-bg: #070b11;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
	--shadow-lg: 0 2px 4px rgba(0, 0, 0, .3), 0 18px 40px rgba(0, 0, 0, .45);
	color-scheme: dark;
}

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

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

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	transition: background-color .25s ease, color .25s ease;
}

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

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-2); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	line-height: 1.25;
	margin: 0 0 .6em;
	letter-spacing: -.015em;
	font-weight: 700;
}

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

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; width: 1px; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto; z-index: 1000;
	top: 12px; left: 12px; padding: 10px 16px; background: var(--surface); color: var(--text);
	border-radius: 8px; box-shadow: var(--shadow-lg);
}

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

/* ==========================================================================
   3. Header
   ========================================================================== */
.reading-progress {
	position: fixed; top: 0; left: 0; height: 3px; width: 0;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
	z-index: 200; transition: width .1s linear;
}

.site-header {
	position: sticky; top: 0; z-index: 100;
	background: color-mix(in srgb, var(--surface) 88%, transparent);
	backdrop-filter: saturate(180%) blur(14px);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid var(--border);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }

.header-top {
	display: flex; align-items: center; justify-content: space-between; gap: 20px;
	min-height: 72px;
}

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
	width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
	display: grid; place-items: center;
	background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
	color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -.02em;
	box-shadow: 0 6px 16px -6px var(--accent);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.site-title { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.site-description { font-size: 12.5px; color: var(--muted); margin: 3px 0 0; }
.custom-logo-link img { max-height: 48px; width: auto; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
	display: inline-grid; place-items: center; width: 42px; height: 42px;
	border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text);
	cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.menu-toggle { display: none; }

/* Primary navigation */
.main-navigation { border-top: 1px solid var(--border); }
.main-navigation .nav-inner { position: relative; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; }
.main-navigation > .nav-inner > ul,
.main-navigation .menu {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; padding: 8px 0;
}
.main-navigation li { position: relative; }
.main-navigation a {
	display: block; padding: 8px 13px; border-radius: 9px;
	color: var(--muted); font-size: 13.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current-cat > a,
.main-navigation .current-menu-ancestor > a { color: var(--accent); background: var(--accent-soft); }

.main-navigation .sub-menu, .main-navigation .children {
	position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px;
	background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
	padding: 6px; opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s; z-index: 50;
}
.main-navigation li:hover > .sub-menu, .main-navigation li:focus-within > .sub-menu,
.main-navigation li:hover > .children, .main-navigation li:focus-within > .children {
	opacity: 1; visibility: visible; transform: none;
}
.main-navigation .sub-menu a, .main-navigation .children a { white-space: normal; }

/* Search overlay */
.search-overlay {
	position: fixed; inset: 0; z-index: 300; display: none;
	background: rgba(8, 12, 18, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	padding: 12vh 20px 20px;
}
.search-overlay.is-open { display: block; animation: fadeIn .18s ease; }
.search-overlay .search-panel {
	max-width: 680px; margin: 0 auto; background: var(--surface); border-radius: 18px;
	box-shadow: var(--shadow-lg); padding: 22px; border: 1px solid var(--border);
}
.search-overlay .search-hint { font-size: 13px; color: var(--muted); margin: 12px 4px 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.search-form { display: flex; gap: 8px; }
.search-form label { flex: 1; }
.search-field {
	width: 100%; height: 50px; padding: 0 16px; font-size: 16px; font-family: inherit;
	color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
}
.search-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ==========================================================================
   4. Buttons, badges, meta
   ========================================================================== */
.btn, .search-submit, input[type="submit"], button[type="submit"] {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	height: 46px; padding: 0 20px; border: 0; border-radius: 12px; cursor: pointer;
	background: var(--accent); color: #fff; font: 600 15px/1 var(--font);
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
	white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover, .search-submit:hover, input[type="submit"]:hover, button[type="submit"]:hover {
	color: #fff; transform: translateY(-1px); box-shadow: 0 8px 18px -8px var(--accent);
}
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--accent); box-shadow: none; }
.search-overlay .search-submit { height: 50px; }

.cat-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.cat-badge {
	--cat: var(--accent);
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 10px; border-radius: 999px;
	font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1.5;
	color: var(--cat); background: color-mix(in srgb, var(--cat) 12%, transparent);
	border: 1px solid color-mix(in srgb, var(--cat) 22%, transparent);
}
.cat-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cat); }
.cat-badge:hover { color: var(--cat); background: color-mix(in srgb, var(--cat) 20%, transparent); }
[data-theme="dark"] .cat-badge { color: color-mix(in srgb, var(--cat) 55%, #fff); }

.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 13.5px; }
.entry-meta .meta-item { display: inline-flex; align-items: center; gap: 6px; }
.entry-meta svg { width: 15px; height: 15px; opacity: .8; }
.entry-meta a { color: inherit; }
.entry-meta a:hover { color: var(--accent); }
.entry-meta .avatar { border-radius: 50%; width: 28px; height: 28px; }

/* ==========================================================================
   5. Home / hero
   ========================================================================== */
.site-main { padding: 40px 0 72px; }

.hero {
	display: grid; grid-template-columns: 1.15fr 1fr; gap: 0;
	background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
	overflow: hidden; box-shadow: var(--shadow); margin-bottom: 56px;
}
.hero-media { position: relative; display: block; min-height: 360px; background: var(--surface-2); overflow: hidden; }
.hero-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.hero:hover .hero-media img { transform: scale(1.03); }
.hero-body { padding: 44px 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.hero-kicker {
	font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
	margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.hero-kicker::before { content: ""; width: 24px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.hero-title { font-size: clamp(26px, 3vw, 36px); margin-bottom: 14px; }
.hero-title a { color: var(--text); }
.hero-title a:hover { color: var(--accent); }
.hero-excerpt { color: var(--muted); font-size: 16.5px; margin: 0 0 22px; }
.hero-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.section-head {
	display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap;
	margin-bottom: 24px;
}
.section-title { font-size: 26px; margin: 0; }
.section-sub { color: var(--muted); margin: 4px 0 0; font-size: 15px; }

.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; padding: 0; list-style: none; }
.topic-chips a {
	--cat: var(--accent);
	display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
	background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 14px; font-weight: 600;
	transition: border-color .15s ease, transform .15s ease;
}
.topic-chips a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cat); }
.topic-chips a:hover { border-color: var(--cat); transform: translateY(-1px); color: var(--text); }
.topic-chips .count { color: var(--muted); font-weight: 500; font-size: 12.5px; }

/* ==========================================================================
   6. Post cards
   ========================================================================== */
.posts-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }

.card {
	display: flex; flex-direction: column; background: var(--surface);
	border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
	box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.card-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 22px 22px 20px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 19px; margin: 0 0 10px; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-excerpt {
	color: var(--muted); font-size: 15px; line-height: 1.65; margin: 0 0 18px;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
	margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border);
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.read-more { font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.read-more svg { width: 16px; height: 16px; transition: transform .15s ease; }
.read-more:hover svg, .card:hover .read-more svg { transform: translateX(3px); }

/* Featured images: fit & centre (default) — logos are never cropped */
.card-media, .hero-media { background: var(--media-bg); isolation: isolate; }
.card-media .thumb-img, .hero-media .thumb-img {
	position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: contain; object-position: center; padding: 7% 9%; z-index: 1;
	border-radius: 0; filter: drop-shadow(0 6px 14px rgba(16, 24, 40, .10));
}
.thumb-bg {
	position: absolute; inset: -30px; z-index: 0; background-size: cover; background-position: center;
	filter: blur(28px) saturate(1.3); opacity: .45; transform: scale(1.1);
}
.card:hover .card-media .thumb-img, .hero:hover .hero-media .thumb-img { transform: scale(1.04); }
.card-media::after, .hero-media::after {
	content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
	box-shadow: inset 0 -1px 0 var(--border);
}
[data-theme="dark"] .card-media .thumb-img, [data-theme="dark"] .hero-media .thumb-img { filter: none; }

/* Optional: fill & crop mode (Customizer → Msft Advocate Options) */
.img-fit-cover .card-media .thumb-img, .img-fit-cover .hero-media .thumb-img { object-fit: cover; padding: 0; filter: none; }
.img-fit-cover .thumb-bg { display: none; }

/* Placeholder thumbnail (posts without featured image) */
.thumb-placeholder {
	--cat: var(--accent);
	position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center;
	background:
		radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--cat) 35%, transparent), transparent 55%),
		radial-gradient(circle at 85% 80%, color-mix(in srgb, var(--cat) 25%, transparent), transparent 50%),
		linear-gradient(135deg, color-mix(in srgb, var(--cat) 85%, #000) 0%, color-mix(in srgb, var(--cat) 60%, #000) 100%);
	color: #fff;
}
.thumb-placeholder span { font-family: var(--font-display); font-weight: 800; font-size: 22px; letter-spacing: -.01em; opacity: .95; }
.thumb-placeholder::after {
	content: ""; position: absolute; inset: 0; opacity: .14;
	background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
	background-size: 28px 28px;
}

/* ==========================================================================
   7. Archive header
   ========================================================================== */
.archive-header {
	--cat: var(--accent);
	position: relative; overflow: hidden; padding: 40px; margin-bottom: 40px;
	background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow);
}
.archive-header::before {
	content: ""; position: absolute; right: -80px; top: -80px; width: 280px; height: 280px; border-radius: 50%;
	background: radial-gradient(circle, color-mix(in srgb, var(--cat) 28%, transparent), transparent 70%);
}
.archive-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--cat); }
.archive-title { font-size: clamp(28px, 3.4vw, 40px); margin: 6px 0 8px; position: relative; }
.archive-description { color: var(--muted); max-width: 720px; position: relative; }
.archive-description p { margin: 0; }
.archive-count { color: var(--muted); font-size: 14px; margin-top: 8px; position: relative; }

/* ==========================================================================
   8. Pagination
   ========================================================================== */
.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers {
	display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px;
	border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600;
}
.pagination .page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .page-numbers.dots { border: 0; background: transparent; }

/* ==========================================================================
   9. Single post
   ========================================================================== */
.single-header { max-width: 860px; margin: 0 auto 32px; text-align: center; }
.single-header .cat-badges, .single-header .entry-meta { justify-content: center; }
.single-title { font-size: clamp(30px, 4.2vw, 46px); margin: 6px 0 18px; letter-spacing: -.025em; }
.single-header .entry-meta { font-size: 14.5px; }

.breadcrumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

.single-featured {
	max-width: 1040px; margin: 0 auto 48px; border-radius: 22px; overflow: hidden;
	border: 1px solid var(--border); box-shadow: var(--shadow-lg); background: var(--surface);
}
.single-featured { background: var(--media-bg); display: flex; justify-content: center; }
.single-featured img { width: auto; max-width: 100%; max-height: 540px; object-fit: contain; }

.single-layout {
	display: grid; grid-template-columns: minmax(0, 760px); justify-content: center; gap: 56px;
}
.single-layout.has-toc { grid-template-columns: minmax(0, 760px) 260px; }

.toc {
	position: sticky; top: 150px; align-self: start; max-height: calc(100vh - 180px); overflow: auto;
	font-size: 14px; padding: 4px 0 4px 18px; border-left: 2px solid var(--border);
}
.toc[hidden] { display: none; }
.toc-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc li.toc-h3 { padding-left: 14px; }
.toc a { display: block; padding: 5px 0; color: var(--muted); line-height: 1.45; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--accent); font-weight: 600; }

/* Entry content typography */
.entry-content { font-size: 18px; line-height: 1.8; overflow-wrap: break-word; }
.entry-content > * { margin-top: 0; margin-bottom: 1.35em; }
.entry-content h2 { font-size: 28px; margin-top: 1.9em; padding-top: .2em; scroll-margin-top: 140px; }
.entry-content h3 { font-size: 22px; margin-top: 1.6em; scroll-margin-top: 140px; }
.entry-content h4 { font-size: 19px; margin-top: 1.4em; }
.entry-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.entry-content a:hover { text-decoration-color: currentColor; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin-bottom: .45em; }
.entry-content li::marker { color: var(--accent); }
.entry-content img { border-radius: 12px; }
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption, .wp-element-caption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 10px; }
.entry-content hr { border: 0; height: 1px; background: var(--border); margin: 2.5em 0; }

.entry-content blockquote {
	margin-left: 0; margin-right: 0; padding: 18px 24px; border-left: 4px solid var(--accent);
	background: var(--accent-soft); border-radius: 0 12px 12px 0; font-size: 17.5px;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

/* Inline code + code blocks */
.entry-content code, .entry-content kbd {
	font-family: var(--font-mono); font-size: .86em; padding: .15em .45em; border-radius: 6px;
	background: var(--surface-2); border: 1px solid var(--border);
}
.entry-content pre, .wp-block-code {
	position: relative; font-family: var(--font-mono); font-size: 14.5px; line-height: 1.65;
	background: var(--code-bg); color: var(--code-text); border-radius: 14px;
	padding: 48px 22px 20px; overflow-x: auto; border: 1px solid #1f2b3a; tab-size: 4;
}
.entry-content pre::before, .wp-block-code::before {
	content: attr(data-lang); position: absolute; top: 0; left: 0; right: 0; height: 36px;
	display: flex; align-items: center; padding: 0 16px 0 66px;
	font: 600 11.5px/1 var(--font); text-transform: uppercase; letter-spacing: .1em; color: #8b98a8;
	background: rgba(255,255,255,.035); border-bottom: 1px solid rgba(255,255,255,.06);
}
.entry-content pre::after, .wp-block-code::after {
	content: ""; position: absolute; top: 13px; left: 16px; width: 10px; height: 10px; border-radius: 50%;
	background: #ff5f57; box-shadow: 16px 0 0 #febc2e, 32px 0 0 #28c840;
}
.entry-content pre code, .wp-block-code code {
	background: none; border: 0; padding: 0; font-size: inherit; color: inherit; white-space: pre;
}
.code-copy {
	position: absolute; top: 5px; right: 8px; z-index: 2; height: 26px; padding: 0 10px; border-radius: 7px;
	font: 600 12px/1 var(--font); color: #c9d4e0; background: rgba(255,255,255,.07);
	border: 1px solid rgba(255,255,255,.1); cursor: pointer; transition: background .15s ease;
}
.code-copy:hover { background: rgba(255,255,255,.15); }
.code-copy.is-copied { color: #28c840; }

/* Tables */
.entry-content table, .wp-block-table table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.wp-block-table { overflow-x: auto; }
.entry-content th, .entry-content td { padding: 11px 14px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.entry-content th { background: var(--surface-2); font-weight: 700; }
.entry-content tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }

/* Callouts: add class "note", "tip", "warning" or "important" to a paragraph or group block */
.entry-content .note, .entry-content .tip, .entry-content .warning, .entry-content .important {
	--c: var(--accent); padding: 16px 20px 16px 22px; border-radius: 12px;
	border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
	background: color-mix(in srgb, var(--c) 9%, transparent); border-left: 4px solid var(--c);
}
.entry-content .tip { --c: #107c10; }
.entry-content .warning { --c: #d83b01; }
.entry-content .important { --c: #a4262c; }

/* Gutenberg alignments */
.alignwide { margin-left: -60px; margin-right: -60px; max-width: calc(100% + 120px); }
.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }

/* Post footer */
.post-footer { max-width: 760px; margin: 40px auto 0; }
.single-layout.has-toc + .post-footer { max-width: 1076px; padding-right: 316px; }
.tags-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tags-links a {
	padding: 5px 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
	color: var(--muted); font-size: 13.5px; font-weight: 600;
}
.tags-links a:hover { color: var(--accent); border-color: var(--accent); }

.share-bar {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	padding: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 32px;
}
.share-bar strong { font-size: 15px; }
.share-links { display: flex; gap: 8px; }
.share-links a, .share-links button {
	display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
	background: var(--surface); border: 1px solid var(--border); color: var(--text); cursor: pointer;
}
.share-links a:hover, .share-links button:hover { color: var(--accent); border-color: var(--accent); }
.share-links svg { width: 17px; height: 17px; }

.author-box {
	display: flex; gap: 20px; padding: 26px; border-radius: var(--radius);
	background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); margin-bottom: 32px;
}
.author-box .avatar { border-radius: 50%; width: 72px; height: 72px; flex-shrink: 0; }
.author-box h3 { font-size: 18px; margin-bottom: 4px; }
.author-box p { margin: 0; color: var(--muted); font-size: 15px; }
.author-box .author-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-navigation a {
	display: block; height: 100%; padding: 20px 22px; border-radius: var(--radius);
	background: var(--surface); border: 1px solid var(--border); color: var(--text);
	transition: border-color .15s ease, transform .15s ease;
}
.post-navigation a:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-navigation .nav-next { text-align: right; }
.post-navigation .nav-subtitle { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.post-navigation .nav-title { font-family: var(--font-display); font-weight: 700; line-height: 1.35; }

.related-posts { margin-top: 72px; padding-top: 56px; border-top: 1px solid var(--border); }
.related-posts .posts-grid { gap: 24px; }

/* ==========================================================================
   10. Comments
   ========================================================================== */
.comments-area { max-width: 760px; margin: 64px auto 0; }
.comments-title, .comment-reply-title { font-size: 22px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 40px; }
.comment-list .children { list-style: none; padding-left: 28px; border-left: 2px solid var(--border); margin-left: 8px; }
.comment-body {
	padding: 20px 22px; margin-bottom: 16px; border-radius: 14px;
	background: var(--surface); border: 1px solid var(--border);
}
.comment-meta { display: flex; align-items: center; gap: 12px; font-size: 14px; margin-bottom: 10px; }
.comment-author { display: flex; align-items: center; gap: 10px; }
.comment-author .avatar { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata a { color: var(--muted); }
.comment-content p { margin: 0 0 .8em; font-size: 16px; }
.reply a { font-size: 13.5px; font-weight: 700; }
.bypostauthor > .comment-body { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

.comment-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--text);
	background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.comment-form-cookies-consent { display: flex; gap: 8px; align-items: flex-start; }
.comment-form-cookies-consent label { font-weight: 400; }

/* ==========================================================================
   11. Pages, 404, search, widgets
   ========================================================================== */
.page-content-wrap { max-width: 800px; margin: 0 auto; }
.page-title { font-size: clamp(30px, 4vw, 44px); text-align: center; margin-bottom: 32px; }

.error-404 { text-align: center; padding: 60px 0; max-width: 620px; margin: 0 auto; }
.error-404 .big { font-size: clamp(90px, 16vw, 160px); font-weight: 800; line-height: 1; letter-spacing: -.05em;
	background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-404 .search-form { margin: 28px 0; }

.no-results { text-align: center; padding: 48px 24px; background: var(--surface); border: 1px dashed var(--border); border-radius: 20px; }
.no-results .search-form { max-width: 520px; margin: 24px auto 0; }

.widget { margin-bottom: 32px; }
.widget-title { font-size: 15px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 6px 0; }

/* ==========================================================================
   12. Footer
   ========================================================================== */
.site-footer { background: #0a0f16; color: #b6c1cd; padding: 64px 0 0; margin-top: 40px; font-size: 15px; }
[data-theme="dark"] .site-footer { background: #070a0f; border-top: 1px solid var(--border); }
.site-footer a { color: #d6dee7; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 48px; padding-bottom: 48px; }
.footer-brand .brand { color: #fff; margin-bottom: 16px; }
.footer-brand .site-description { color: #8d99a7; }
.footer-brand p { margin: 0 0 18px; max-width: 380px; }
.site-footer .btn-ghost { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #d6dee7; }
.site-footer .btn-ghost:hover { color: #fff; background: rgba(255,255,255,.12); }
.footer-col h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 5px 0; line-height: 1.45; }
.footer-col .widget-title { color: #fff; font-size: 13px; }
.footer-bottom {
	border-top: 1px solid rgba(255,255,255,.08); padding: 22px 0; font-size: 13.5px; color: #7f8b99;
	display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.footer-bottom ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; }
.footer-bottom a { color: #a6b2bf; }

.back-to-top {
	position: fixed; right: 22px; bottom: 22px; z-index: 90; width: 46px; height: 46px; border-radius: 14px;
	display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--text);
	box-shadow: var(--shadow-lg); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(10px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { color: var(--accent); border-color: var(--accent); }
.back-to-top svg { width: 20px; height: 20px; }

/* ==========================================================================
   13. Responsive
   ========================================================================== */
@media (max-width: 1180px) {
	.single-layout.has-toc { grid-template-columns: minmax(0, 760px); }
	.single-layout.has-toc .toc { display: none; }
	.single-layout.has-toc + .post-footer { max-width: 760px; padding-right: 0; }
	.alignwide { margin-left: 0; margin-right: 0; max-width: 100%; }
}

@media (max-width: 1024px) {
	.posts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.hero { grid-template-columns: 1fr; }
	.hero-media { min-height: 0; aspect-ratio: 16 / 8; }
	.hero-body { padding: 32px; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
	.menu-toggle { display: inline-grid; }
	.main-navigation { display: none; border-top: 1px solid var(--border); }
	.main-navigation.is-open { display: block; max-height: calc(100vh - 80px); overflow-y: auto; }
	.main-navigation > .nav-inner > ul, .main-navigation .menu { flex-direction: column; flex-wrap: nowrap; padding: 10px 0 16px; }
	.main-navigation a { padding: 11px 12px; font-size: 15px; }
	.main-navigation .sub-menu, .main-navigation .children {
		position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0;
		padding: 0 0 0 14px; background: transparent; min-width: 0;
	}
	.site-description { display: none; }
}

@media (max-width: 640px) {
	body { font-size: 16px; }
	.container { padding: 0 18px; }
	.site-main { padding: 24px 0 56px; }
	.posts-grid { grid-template-columns: 1fr; gap: 20px; }
	.hero { border-radius: 18px; margin-bottom: 40px; }
	.hero-body { padding: 24px; }
	.hero-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
	.site-title { font-size: 19px; }
	.brand-mark { width: 38px; height: 38px; font-size: 15px; }
	.archive-header { padding: 28px 22px; border-radius: 18px; }
	.entry-content { font-size: 17px; }
	.entry-content h2 { font-size: 24px; }
	.entry-content h3 { font-size: 20px; }
	.entry-content pre { margin-left: -18px; margin-right: -18px; border-radius: 0; border-left: 0; border-right: 0; }
	.single-featured { border-radius: 14px; margin-bottom: 32px; }
	.post-navigation .nav-links { grid-template-columns: 1fr; }
	.post-navigation .nav-next { text-align: left; }
	.author-box { flex-direction: column; }
	.footer-grid { grid-template-columns: 1fr; gap: 32px; }
	.search-form { flex-direction: column; }
	.alignleft, .alignright { float: none; margin: 0 0 1em; }
}

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

@media print {
	.site-header, .site-footer, .toc, .share-bar, .post-navigation, .related-posts, .comments-area, .back-to-top, .reading-progress { display: none !important; }
	body { background: #fff; color: #000; }
	.entry-content pre { background: #f5f5f5; color: #000; border: 1px solid #ccc; }
}
