/*
Theme Name: Dhacker Neon
Description: Neon Hacker x iOS reskin of dhacker.in, child theme of GeneratePress.
Author: dhacker.in
Template: generatepress
Version: 1.0.5
Text Domain: dhacker-neon
*/

:root {
	--bg: #0a0e14;
	--surface: #12171f;
	--surface-alt: #161b22;
	--border: #1f2733;
	--text-primary: #e6edf3;
	--text-body: #b3b9c4;
	--text-muted: #8b949e;
	--text-faint: #6e7681;

	/* Accent palette: change the colours here, in one place. RGB triplets are used for tints/glows. */
	--blue-1: #4f9cff;
	--blue-2: #8ab8ff;
	--blue-3: #7c8cff;
	--cyan-1: #22d3ee;
	--cyan-2: #67e8f9;
	--red: #ff5c6c; /* a touch only: never body text or large areas */
	--blue-1-rgb: 79, 156, 255;
	--blue-2-rgb: 138, 184, 255;
	--blue-3-rgb: 124, 140, 255;
	--cyan-1-rgb: 34, 211, 238;
	--cyan-2-rgb: 103, 232, 249;
	--red-rgb: 255, 92, 108;

	--accent: var(--blue-1);
	--accent-rgb: var(--blue-1-rgb);
	--accent-alt: var(--red);
	--accent-tint: rgba(79, 156, 255, 0.06);
	--accent-tint-border: rgba(79, 156, 255, 0.18);

	/* Solid blue buttons: deeper blue so white text reaches WCAG AA (about 4.6:1). Buttons only. */
	--btn-bg: #1f6feb;
	--btn-bg-rgb: 31, 111, 235; /* same colour as --btn-bg, used so every button's hover glow is this one blue, not a random accent. */
	--btn-text: #fff;
	--font-sans: -apple-system, "Segoe UI", Roboto, sans-serif;
	--font-mono: "JetBrains Mono", "Fira Code", monospace;
}

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

html, body { background: var(--bg); }

body {
	margin: 0;
	font-family: var(--font-sans);
	color: var(--text-body);
	line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Safety net: anything rendered by WordPress core or a plugin that this theme hasn't
   explicitly styled (comments, shortcodes, unexpected widgets) still gets a readable
   color on the dark background instead of inheriting a light-theme default.
   Scoped under .dhacker-page / .site-footer (rather than bare tag selectors) because the
   Hostinger plugin ships a buggy admin-bar stylesheet with the unscoped selector
   ".hostinger p, h1, h2, h3, h4 { color: rgb(29,30,32) }" — h1-h4 there were clearly meant
   to be scoped under .hostinger too but aren't, so it darkens every heading site-wide for
   logged-in users. A bare "h1, h2, ..." rule here ties with theirs on specificity and can
   lose on source order; adding our own class scope reliably outranks it without !important. */
.dhacker-page h1, .dhacker-page h2, .dhacker-page h3, .dhacker-page h4, .dhacker-page h5, .dhacker-page h6,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4, .site-footer h5, .site-footer h6 {
	color: var(--text-primary);
	font-weight: 500;
}
.dhacker-page p, .dhacker-page li, .dhacker-page dd, .dhacker-page dt, .dhacker-page td, .dhacker-page th, .dhacker-page label,
.site-footer p, .site-footer li, .site-footer label {
	color: var(--text-body);
}

.dhacker-page {
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px 18px 56px;
}

/* ===== Nav ===== */
.nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 16px; }
.logo { font-family: var(--font-mono); font-size: 16px; font-weight: 500; color: var(--text-primary); white-space: nowrap; }
.logo a { color: inherit; }
.logo span { color: var(--cyan-1); }
.nav-links { display: none; align-items: center; gap: 28px; margin-left: 40px; margin-right: auto; }
.nav-links a { font-size: 14px; color: var(--text-muted); display: inline-block; transition: transform 0.15s ease, color 0.15s ease; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--c, var(--cyan-2)); text-decoration: none; transform: translateY(-2px) scale(1.05); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); display: flex; align-items: center; justify-content: center; flex-shrink: 0; cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease; }
.icon-btn:hover, .icon-btn:focus-visible { color: var(--text-primary); text-decoration: none; transform: translateY(-2px) scale(1.08); border-color: var(--c, var(--cyan-2)); box-shadow: 0 8px 16px rgba(var(--c-rgb, var(--cyan-2-rgb)), 0.3); }

.btn-subscribe { display: none; height: 44px; padding: 0 22px; border-radius: 22px; background: var(--btn-bg); color: var(--btn-text); font-weight: 600; font-size: 14px; align-items: center; justify-content: center; white-space: nowrap; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.btn-subscribe:hover, .btn-subscribe:focus-visible { text-decoration: none; color: var(--btn-text); transform: translateY(-2px) scale(1.05); box-shadow: 0 10px 22px rgba(var(--btn-bg-rgb), 0.35); }

.mobile-menu { position: relative; }
.mobile-menu summary { list-style: none; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu[open] summary { color: var(--text-primary); }
.mobile-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 200px; z-index: 30; }
.mobile-menu-panel a { padding: 10px 12px; border-radius: 10px; color: var(--text-body); font-size: 14px; transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease; }
.mobile-menu-panel a:hover, .mobile-menu-panel a:focus-visible { background: var(--surface-alt); color: var(--text-primary); text-decoration: none; transform: scale(1.03); box-shadow: inset 3px 0 0 var(--c, var(--cyan-1)); }
.mobile-menu-panel .btn-subscribe { display: flex; margin-top: 6px; }

@media (min-width: 720px) {
	.nav-links { display: flex; }
	.nav-actions > .btn-subscribe { display: inline-flex; }
	.mobile-menu { display: none; }
}

/* ===== Segmented control ===== */
.segmented-wrap { margin-bottom: 22px; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
.segmented-wrap::-webkit-scrollbar { display: none; }
.segmented { display: inline-flex; background: var(--accent-tint); border-radius: 10px; padding: 3px; min-width: 100%; }
.segmented a { flex: 1 0 auto; white-space: nowrap; text-align: center; font-size: 12px; padding: 7px 16px; border-radius: 8px; color: var(--text-muted); transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease; }
.segmented a:not(.active):hover, .segmented a:not(.active):focus-visible { text-decoration: none; color: var(--text-primary); transform: translateY(-1px) scale(1.05); box-shadow: 0 4px 10px rgba(var(--c-rgb, var(--blue-1-rgb)), 0.3); }
.segmented a.active { background: var(--btn-bg); color: var(--btn-text); font-weight: 500; }

/* ===== Hero ===== */
.eyebrow { font-family: var(--font-mono); font-size: 12px; color: var(--cyan-1); margin: 0 0 8px; }
.sub { font-size: 14px; color: var(--text-body); line-height: 1.65; margin: 0 0 20px; }
.hero h1 { font-size: 22px; font-weight: 500; color: var(--text-primary); line-height: 1.35; margin: 0 0 10px; }

@media (min-width: 720px) {
	.hero h1 { font-size: 32px; }
	.hero .sub { font-size: 16px; }
}

.hero-section { margin-bottom: 22px; }
.hero-buttons { display: flex; flex-direction: column; gap: 12px; }
.hero-buttons a { width: 100%; }

.btn-primary { height: 56px; padding: 0 32px; border-radius: 28px; background: var(--btn-bg); color: var(--btn-text); font-weight: 700; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; text-align: center; transition: transform 0.18s ease, box-shadow 0.18s ease; }
/* Hover: same text colour as the resting state (not GeneratePress's global link-hover colour),
   and only a soft glow — no ring-style box-shadow standing in for a border. */
.btn-primary:hover, .btn-primary:focus-visible { text-decoration: none; color: var(--btn-text); transform: translateY(-3px) scale(1.03); box-shadow: 0 16px 30px rgba(var(--btn-bg-rgb), 0.4); }
.btn-outline { height: 56px; padding: 0 32px; border-radius: 28px; border: 2px solid var(--accent); background: transparent; color: var(--accent); font-weight: 600; font-size: 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-align: center; font-family: var(--font-sans); transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease; }
.btn-outline:hover, .btn-outline:focus-visible { text-decoration: none; color: var(--accent); transform: translateY(-3px) scale(1.03); box-shadow: 0 16px 30px rgba(var(--btn-bg-rgb), 0.4); }

.hero-visual { display: none; }

@media (min-width: 960px) {
	.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
	.hero-buttons { flex-direction: row; }
	.hero-buttons a { width: auto; }
	.btn-primary { height: 60px; padding: 0 36px; }
	.btn-outline { height: 60px; padding: 0 36px; }

	.hero-visual { display: block; position: relative; height: 420px; border-radius: 28px; border: 1px solid var(--border); background-color: #0c1119; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 22px 22px; overflow: hidden; }

	.code-panel { position: absolute; left: 32px; top: 36px; width: 420px; max-width: calc(100% - 64px); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
	.code-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 12px; color: var(--text-body); }
	.code-panel-flag { color: var(--accent-alt); background: rgba(var(--red-rgb), 0.12); padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
	.code-panel-body { padding: 12px 0; font-family: var(--font-mono); font-size: 12px; line-height: 1.9; }
	.code-line { padding: 0 16px; color: var(--text-muted); white-space: pre-wrap; word-break: break-word; }
	.code-line.removed { background: rgba(var(--red-rgb), 0.10); color: #ffb3bb; }
	.code-line.added { background: rgba(var(--cyan-1-rgb), 0.08); color: #a5f3fc; }

	.widget-floating { position: absolute; right: 28px; bottom: 32px; width: 280px; max-width: calc(100% - 56px); background: rgba(18, 23, 31, 0.55); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--accent-tint-border); margin-bottom: 0; }
}

/* ===== Widget card ===== */
.widget { background: var(--accent-tint); border: 1px solid var(--accent-tint-border); border-radius: 20px; padding: 16px; margin-bottom: 22px; }
.widget-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.widget-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(var(--cyan-1-rgb), 0.15); display: flex; align-items: center; justify-content: center; color: var(--cyan-1); font-size: 16px; flex-shrink: 0; }
.widget-label { font-size: 12px; color: var(--text-muted); }
.widget p { font-size: 14px; color: var(--text-primary); line-height: 1.6; margin: 0; }

/* ===== "Pick a track" / app-icon grid ===== */
.section-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.section-header h2 { margin: 0 0 6px; font-size: 22px; }
.section-sub { margin: 0; font-size: 14px; color: var(--text-muted); }
.see-all { font-size: 14px; color: var(--text-primary); }

.icon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.tile { text-align: center; }
.tile a { color: inherit; display: block; }
.tile-box { aspect-ratio: 1; border-radius: 16px; background: var(--surface); border: 1px solid rgba(var(--c-rgb, var(--blue-1-rgb)), 0.30); display: flex; align-items: center; justify-content: center; color: var(--c, var(--accent)); font-size: 20px; margin-bottom: 6px; }
.tile-box.alt { color: var(--accent-alt); border-color: rgba(var(--red-rgb), 0.30); }
.tile-box.highlight { background: var(--cyan-1); color: var(--bg); border-color: var(--cyan-1); }
.tile-label { font-size: 11px; color: var(--text-muted); margin: 0; }
.tile-desc { display: none; }

@media (min-width: 720px) {
	.icon-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 960px) {
	.section-header.tracks-header { margin-bottom: 28px; }
	.icon-grid { gap: 16px; }
	.tile { text-align: left; }
	.tile a {
		display: flex;
		flex-direction: column;
		gap: 14px;
		padding: 22px;
		min-height: 200px;
		height: 100%; /* .tile (the grid item) is stretched to the row's tallest neighbour by
		                 CSS Grid's default align-items: stretch, but this inner <a> carries the
		                 visible card (background/border) and previously wasn't told to fill that
		                 stretched height — so a tile with a short description showed a shorter
		                 card than one with a long description, even in the same row. */
		background: var(--surface);
		border: 1px solid var(--border);
		border-radius: 20px;
		transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
	}
	.tile a:hover, .tile a:focus-visible { text-decoration: none; transform: translateY(-4px) scale(1.02); border-color: var(--c, var(--blue-1)); box-shadow: 0 0 0 1px rgba(var(--c-rgb, var(--blue-1-rgb)), 0.25), 0 14px 28px rgba(var(--c-rgb, var(--blue-1-rgb)), 0.2); }
	.tile-box { width: 52px; height: 52px; aspect-ratio: auto; border-radius: 14px; background: rgba(var(--c-rgb, var(--blue-1-rgb)), 0.10); font-size: 22px; margin-bottom: 0; }
	.tile-box.alt { background: rgba(var(--red-rgb), 0.12); }
	.tile-box.highlight { background: var(--cyan-1); }
	.tile-label { font-size: 16px; font-weight: 500; color: var(--text-primary); }
	.tile-desc { display: block; margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-muted); }
}

/* ===== CTA button ===== */
.cta { display: block; width: 100%; text-align: center; background: var(--btn-bg); color: var(--btn-text); border: none; border-radius: 24px; padding: 16px 0; font-size: 15px; font-weight: 600; cursor: pointer; font-family: var(--font-sans); margin-bottom: 8px; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.cta:hover, .cta:focus-visible { text-decoration: none; color: var(--btn-text); transform: translateY(-3px) scale(1.02); box-shadow: 0 14px 28px rgba(var(--btn-bg-rgb), 0.35); }

@media (min-width: 720px) {
	.cta { width: auto; display: inline-block; padding: 16px 36px; }
}

/* Section divider: blue -> cyan -> a small red tip. */
hr.section { border: none; height: 1px; background: linear-gradient(90deg, var(--blue-1), var(--cyan-1) 70%, var(--red)); opacity: 0.55; margin: 36px 0; }

/* ===== Post grid (homepage) ===== */
.post-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

@media (min-width: 720px) {
	.post-grid { grid-template-columns: repeat(3, 1fr); }
}

.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.post-card:not(.promo-card):hover,
.post-card:not(.promo-card):focus-within { transform: translateY(-5px) scale(1.015); border-color: var(--c, var(--blue-1)); box-shadow: 0 0 0 1px rgba(var(--c-rgb, var(--blue-1-rgb)), 0.25), 0 16px 32px rgba(var(--c-rgb, var(--blue-1-rgb)), 0.22); }
.post-card-thumb { height: 140px; background-color: #0b1d33; background-image: radial-gradient(rgba(var(--c-rgb, var(--blue-1-rgb)), 0.22) 1px, transparent 1px); background-size: 18px 18px; display: flex; align-items: center; justify-content: center; color: var(--c, var(--accent)); font-size: 32px; }
.post-card-thumb.alt { background-color: #2a0d14; background-image: radial-gradient(rgba(var(--red-rgb), 0.18) 1px, transparent 1px); color: var(--accent-alt); }
.post-card-thumb { overflow: hidden; }
/* object-fit: contain (not cover) + a little padding so the whole featured image is always
   visible — cover was cropping the edges off thumbnails whose aspect ratio didn't match the
   140px-tall box. The dotted accent background shows through as letterboxing instead. */
.post-card-thumb img.post-card-img { width: 100%; height: 100%; object-fit: contain; padding: 10px; display: block; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35); }
.post-card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card-body .tag { align-self: flex-start; margin: 0; color: var(--c, var(--cyan-1)); background: rgba(var(--c-rgb, var(--cyan-1-rgb)), 0.08); }
.post-card-body h3 { font-size: 17px; font-weight: 500; color: var(--text-primary); line-height: 1.4; margin: 0; }
.post-card-body h3 a { color: inherit; }
.post-card-body h3 a:hover { text-decoration: none; color: var(--c, var(--accent)); }
.post-card-body .excerpt { font-size: 13px; color: var(--text-body); line-height: 1.6; margin: 0; }
.post-card-body .post-meta { font-size: 12px; color: var(--text-faint); margin: auto 0 0; }

/* Sponsored placeholder card: reuses .post-card so it always matches whatever the real
   post cards look like, per the design spec's "inherits styling automatically" rule.
   Class names avoid "ad"/"sponsor" substrings — see the comment in
   dhacker_render_ad_card() in functions.php for why. */
.post-grid .promo-card { grid-column: 1 / -1; }
.promo-card-body { display: flex; align-items: center; gap: 18px; padding: 20px 22px; flex-wrap: wrap; }
.promo-card-icon { width: 52px; height: 52px; flex-shrink: 0; border-radius: 14px; background: var(--surface-alt); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 22px; }
.promo-card-copy { flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; }
.promo-card-copy h3 { margin: 0; font-size: 16px; font-weight: 500; color: var(--text-primary); }
.promo-card-copy p { margin: 0; font-size: 13px; color: var(--text-body); }
.promo-card-label { font-size: 11px; color: var(--text-faint); margin: 0; }
.promo-card-cta { height: 38px; padding: 0 18px; border-radius: 19px; border: 1px solid #2c3746; color: var(--text-primary); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease; }
.promo-card-cta:hover { transform: translateY(-2px) scale(1.05); border-color: var(--blue-1); box-shadow: 0 8px 16px rgba(var(--blue-1-rgb), 0.25); }

.empty-state { font-size: 14px; color: var(--text-muted); padding: 24px 0; }

/* ===== Archive / search header ===== */
.hero .sub a { color: var(--accent); }

/* ===== Search form (search results page) ===== */
.search-form { display: flex; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 4px 4px 4px 16px; margin-bottom: 24px; max-width: 480px; }
.search-form input[type="search"] { flex: 1; background: none; border: none; color: var(--text-primary); font-family: var(--font-sans); font-size: 14px; outline: none; }
.search-form input[type="search"]::placeholder { color: var(--text-faint); }
.search-form button { background: var(--btn-bg); color: var(--btn-text); border: none; border-radius: 20px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.search-form button:hover, .search-form button:focus-visible { transform: scale(1.1); box-shadow: 0 0 0 2px var(--cyan-1), 0 6px 14px rgba(var(--cyan-1-rgb), 0.3); }

/* ===== Pagination ===== */
.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); font-size: 13px; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.pagination .page-numbers:not(.current):not(.dots):hover,
.pagination .page-numbers:not(.current):not(.dots):focus-visible { color: var(--text-primary); text-decoration: none; transform: translateY(-2px) scale(1.08); border-color: var(--c, var(--blue-1)); box-shadow: 0 6px 14px rgba(var(--c-rgb, var(--blue-1-rgb)), 0.3); }
.pagination .page-numbers.current { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); font-weight: 500; }
.pagination .page-numbers.dots { background: none; border: none; }

/* ===== 404 ===== */
.notfound { text-align: center; padding: 60px 0; }
.notfound .cta { max-width: 260px; margin: 0 auto; }

/* ===== Single post ===== */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin: 0 0 14px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-primary); text-decoration: none; }
.tag { display: inline-block; background: rgba(var(--cyan-1-rgb), 0.08); color: var(--cyan-1); font-size: 12px; font-family: var(--font-mono); padding: 3px 9px; border-radius: 5px; margin-bottom: 10px; }
h1.post-title { font-size: 20px; font-weight: 500; color: var(--text-primary); line-height: 1.35; margin: 0 0 10px; max-width: 46em; }
.single .byline { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-primary); flex-shrink: 0; }
.byline p { font-size: 12px; color: var(--text-faint); margin: 0; }

/* Featured image: sits below the title/byline, above the article body, with rounded corners. */
.post-thumbnail { max-width: 46em; margin: 0 0 24px; }
.post-thumbnail-img { width: 100%; height: auto; border-radius: 16px; display: block; box-shadow: 0 4px 16px 2px rgba(66, 135, 245, 0.55); }
.post-content img { box-shadow: 0 4px 16px 2px rgba(66, 135, 245, 0.55); }
.post-content > div, .post-content figure { box-shadow: 0 4px 16px 2px rgba(66, 135, 245, 0.55); }

@media (min-width: 720px) {
	h1.post-title { font-size: 30px; }
}

.post-content { max-width: 46em; font-size: 14px; color: var(--text-body); line-height: 1.8; }
.post-content p { margin: 0 0 18px; }
.post-content h2, .post-content h3 { color: var(--text-primary); font-weight: 500; margin: 28px 0 12px; }
.post-content h2::after { content: ""; display: block; width: 36px; height: 2px; margin-top: 8px; border-radius: 2px; background: var(--h, var(--blue-1)); }
.post-content ul, .post-content ol { margin: 0 0 18px; padding-left: 22px; }
.post-content a { text-decoration: underline; }
.post-content a:hover { color: var(--cyan-2); text-decoration-color: var(--red); }
.post-content blockquote { border-left: 2px solid var(--q, var(--blue-1)); margin: 0 0 18px; padding: 4px 0 4px 16px; color: var(--text-muted); }

.post-content pre,
.post-content code,
.code {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
	font-family: var(--font-mono);
	color: var(--text-primary);
}

.post-content pre {
	padding: 12px 14px;
	margin: 0 0 18px;
	font-size: 12px;
	line-height: 1.8;
	overflow-x: auto;
}
.post-content pre { border-left: 3px solid var(--k, var(--blue-1)); }

.post-content code { padding: 2px 5px; font-size: 0.9em; border-radius: 5px; }
.post-content pre code { padding: 0; border: none; background: none; border-radius: 0; }

/*
 * Ad Inserter (real, live AdSense blocks) wraps every automatic placement in a
 * .code-block div — wherever it appears (single post content, archive excerpts, the
 * homepage). Style that wrapper like .ad-card directly, rather than injecting a second ad
 * element, so real ads inherit the card look everywhere without per-placement hand-matching.
 */
.code-block {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 14px;
	margin: 0 0 18px !important;
	clear: both;
	overflow: hidden;
}
.code-block::before {
	content: "Sponsored";
	display: block;
	font-size: 11px;
	color: var(--text-faint);
	margin: 0 0 8px;
}

/* ===== Courses waitlist / newsletter split section ===== */
.split-section { display: grid; grid-template-columns: 1fr; gap: 20px; margin: 8px 0 40px; }

@media (min-width: 720px) {
	.split-section { grid-template-columns: repeat(2, 1fr); }
}

.panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.panel-card h3 { margin: 0; font-size: 22px; line-height: 1.3; }
.field-label { font-size: 13px; color: var(--text-muted); margin-top: 6px; }
.inline-form { display: flex; flex-direction: column; gap: 10px; }

@media (min-width: 560px) {
	.inline-form { flex-direction: row; }
}

.inline-form input { flex: 1; height: 50px; box-sizing: border-box; padding: 0 18px; border-radius: 25px; border: 1px solid #2c3746; background: var(--bg); color: var(--text-primary); font-family: var(--font-sans); font-size: 14px; }
.inline-form input::placeholder { color: var(--text-faint); }
.inline-form button { height: 50px; padding: 0 24px; border-radius: 25px; border: none; background: var(--btn-bg); color: var(--btn-text); font-family: var(--font-sans); font-size: 14px; font-weight: 600; cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.inline-form button:hover, .inline-form button:focus-visible { transform: translateY(-2px) scale(1.03); box-shadow: 0 0 0 2px var(--cyan-1), 0 10px 20px rgba(var(--cyan-1-rgb), 0.3); }

.panel-decorative { position: relative; border: 1px solid var(--border); border-radius: 24px; background-color: #0c1119; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 20px 20px; padding: 20px; display: flex; align-items: center; }
.panel-glass { padding: 24px; border-radius: 20px; background: rgba(18, 23, 31, 0.6); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--accent-tint-border); display: flex; flex-direction: column; gap: 12px; width: 100%; }
.panel-glass h3 { margin: 0; font-size: 20px; line-height: 1.35; }
.panel-glass .btn-outline { align-self: flex-start; margin-top: 4px; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 40px 18px 28px; }
.site-footer .footer-inner { max-width: 1100px; margin: 0 auto; }

.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; margin-bottom: 28px; }

@media (min-width: 720px) {
	.footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}

.footer-brand .logo { display: block; margin-bottom: 10px; font-size: 18px; }
.footer-brand p { max-width: 360px; font-size: 14px; color: var(--text-muted); margin: 0; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col-title { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-bottom: 2px; }
.footer-col a { font-size: 13px; color: var(--text-muted); }
.footer-col a:hover { color: var(--cyan-2); text-decoration: none; }

.footer-bottom { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 20px; }
.footer-bottom span { font-size: 12px; color: var(--text-faint); }
.footer-tag { font-family: var(--font-mono); color: var(--cyan-1) !important; }

/* ===== Stable accent cycles =====
   "Random-looking" but fixed: the colour of an item depends only on its position, so it is
   identical on every page load (no JavaScript, no flicker). Red appears about once in six/seven.
   Each cycle sets --c (colour) and --c-rgb (same colour as r,g,b for tints and glows). */

/* Post cards (home, blog list, archives): 7 steps. */
.post-grid > :nth-child(7n+1) { --c: var(--blue-1); --c-rgb: var(--blue-1-rgb); }
.post-grid > :nth-child(7n+2) { --c: var(--cyan-1); --c-rgb: var(--cyan-1-rgb); }
.post-grid > :nth-child(7n+3) { --c: var(--blue-2); --c-rgb: var(--blue-2-rgb); }
.post-grid > :nth-child(7n+4) { --c: var(--cyan-2); --c-rgb: var(--cyan-2-rgb); }
.post-grid > :nth-child(7n+5) { --c: var(--blue-3); --c-rgb: var(--blue-3-rgb); }
.post-grid > :nth-child(7n+6) { --c: var(--red); --c-rgb: var(--red-rgb); }
.post-grid > :nth-child(7n+7) { --c: var(--cyan-1); --c-rgb: var(--cyan-1-rgb); }

/* "Pick a track" tiles: 6 steps (5th is the red one). */
.icon-grid > .tile:nth-child(6n+1) { --c: var(--blue-1); --c-rgb: var(--blue-1-rgb); }
.icon-grid > .tile:nth-child(6n+2) { --c: var(--cyan-1); --c-rgb: var(--cyan-1-rgb); }
.icon-grid > .tile:nth-child(6n+3) { --c: var(--blue-2); --c-rgb: var(--blue-2-rgb); }
.icon-grid > .tile:nth-child(6n+4) { --c: var(--cyan-2); --c-rgb: var(--cyan-2-rgb); }
.icon-grid > .tile:nth-child(6n+5) { --c: var(--red); --c-rgb: var(--red-rgb); }
.icon-grid > .tile:nth-child(6n+6) { --c: var(--blue-3); --c-rgb: var(--blue-3-rgb); }

/* Article h2 underlines: 6 steps, red on every 6th. */
.post-content h2:nth-of-type(6n+1) { --h: var(--blue-1); }
.post-content h2:nth-of-type(6n+2) { --h: var(--cyan-1); }
.post-content h2:nth-of-type(6n+3) { --h: var(--blue-2); }
.post-content h2:nth-of-type(6n+4) { --h: var(--cyan-2); }
.post-content h2:nth-of-type(6n+5) { --h: var(--blue-3); }
.post-content h2:nth-of-type(6n+6) { --h: var(--red); }

/* Blockquote bars: 4 steps, red on every 4th. */
.post-content blockquote:nth-of-type(4n+1) { --q: var(--blue-1); }
.post-content blockquote:nth-of-type(4n+2) { --q: var(--cyan-1); }
.post-content blockquote:nth-of-type(4n+3) { --q: var(--blue-2); }
.post-content blockquote:nth-of-type(4n+4) { --q: var(--red); }

/* Code block left bars: 4 steps, no red (red on code could read as "vulnerable"). */
.post-content pre:nth-of-type(4n+1) { --k: var(--blue-1); }
.post-content pre:nth-of-type(4n+2) { --k: var(--cyan-1); }
.post-content pre:nth-of-type(4n+3) { --k: var(--blue-2); }
.post-content pre:nth-of-type(4n+4) { --k: var(--cyan-2); }

/* Category chip bar (All posts + category pages): 6 steps. */
.chips a:nth-child(6n+1) { --c: var(--blue-1); --c-rgb: var(--blue-1-rgb); }
.chips a:nth-child(6n+2) { --c: var(--cyan-1); --c-rgb: var(--cyan-1-rgb); }
.chips a:nth-child(6n+3) { --c: var(--blue-2); --c-rgb: var(--blue-2-rgb); }
.chips a:nth-child(6n+4) { --c: var(--cyan-2); --c-rgb: var(--cyan-2-rgb); }
.chips a:nth-child(6n+5) { --c: var(--red); --c-rgb: var(--red-rgb); }
.chips a:nth-child(6n+6) { --c: var(--blue-3); --c-rgb: var(--blue-3-rgb); }

/* Homepage segmented control: 6 steps. */
.segmented a:nth-child(6n+1) { --c: var(--cyan-1); --c-rgb: var(--cyan-1-rgb); }
.segmented a:nth-child(6n+2) { --c: var(--blue-2); --c-rgb: var(--blue-2-rgb); }
.segmented a:nth-child(6n+3) { --c: var(--cyan-2); --c-rgb: var(--cyan-2-rgb); }
.segmented a:nth-child(6n+4) { --c: var(--blue-3); --c-rgb: var(--blue-3-rgb); }
.segmented a:nth-child(6n+5) { --c: var(--red); --c-rgb: var(--red-rgb); }
.segmented a:nth-child(6n+6) { --c: var(--blue-1); --c-rgb: var(--blue-1-rgb); }

/* Pagination numbers: 6 steps. */
.pagination .page-numbers:nth-of-type(6n+1) { --c: var(--blue-2); --c-rgb: var(--blue-2-rgb); }
.pagination .page-numbers:nth-of-type(6n+2) { --c: var(--cyan-2); --c-rgb: var(--cyan-2-rgb); }
.pagination .page-numbers:nth-of-type(6n+3) { --c: var(--blue-3); --c-rgb: var(--blue-3-rgb); }
.pagination .page-numbers:nth-of-type(6n+4) { --c: var(--red); --c-rgb: var(--red-rgb); }
.pagination .page-numbers:nth-of-type(6n+5) { --c: var(--blue-1); --c-rgb: var(--blue-1-rgb); }
.pagination .page-numbers:nth-of-type(6n+6) { --c: var(--cyan-1); --c-rgb: var(--cyan-1-rgb); }

/* Desktop header nav links: 6 steps. */
.nav-links a:nth-child(6n+1) { --c: var(--blue-1); --c-rgb: var(--blue-1-rgb); }
.nav-links a:nth-child(6n+2) { --c: var(--cyan-1); --c-rgb: var(--cyan-1-rgb); }
.nav-links a:nth-child(6n+3) { --c: var(--blue-2); --c-rgb: var(--blue-2-rgb); }
.nav-links a:nth-child(6n+4) { --c: var(--cyan-2); --c-rgb: var(--cyan-2-rgb); }
.nav-links a:nth-child(6n+5) { --c: var(--blue-3); --c-rgb: var(--blue-3-rgb); }
.nav-links a:nth-child(6n+6) { --c: var(--red); --c-rgb: var(--red-rgb); }

/* Mobile menu panel links: 6 steps. */
.mobile-menu-panel a:nth-child(6n+1) { --c: var(--cyan-1); --c-rgb: var(--cyan-1-rgb); }
.mobile-menu-panel a:nth-child(6n+2) { --c: var(--blue-2); --c-rgb: var(--blue-2-rgb); }
.mobile-menu-panel a:nth-child(6n+3) { --c: var(--cyan-2); --c-rgb: var(--cyan-2-rgb); }
.mobile-menu-panel a:nth-child(6n+4) { --c: var(--blue-3); --c-rgb: var(--blue-3-rgb); }
.mobile-menu-panel a:nth-child(6n+5) { --c: var(--red); --c-rgb: var(--red-rgb); }
.mobile-menu-panel a:nth-child(6n+6) { --c: var(--blue-1); --c-rgb: var(--blue-1-rgb); }

/* Respect "reduce motion": keep the colour/border feedback, drop the movement. */
@media (prefers-reduced-motion: reduce) {
	.btn-primary, .btn-outline, .cta, .btn-subscribe, .icon-btn,
	.chips a, .segmented a, .pagination .page-numbers, .tile a, .post-card,
	.nav-links a, .mobile-menu-panel a, .search-form button, .inline-form button,
	.promo-card-cta {
		transition: none;
	}
	.btn-primary:hover, .btn-outline:hover, .cta:hover, .btn-subscribe:hover, .icon-btn:hover,
	.chips a:hover, .segmented a:hover, .pagination .page-numbers:hover, .tile a:hover, .post-card:hover,
	.nav-links a:hover, .mobile-menu-panel a:hover, .search-form button:hover, .inline-form button:hover,
	.promo-card-cta:hover {
		transform: none;
	}
}

/* ===== Responsive visibility helpers =====
   Placed last so they win ties against earlier component rules of equal specificity. */
@media (min-width: 720px) {
	.mobile-only { display: none !important; }
}

@media (max-width: 719.98px) {
	.desktop-only { display: none !important; }
}

/* ===== Navigation upgrade: categories in the header, mobile menu, breadcrumbs, chip bar =====
   Added as new classes only; templates opt in to them step by step. */

/* Skip link: first Tab stop, visible only when focused */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--btn-bg); color: var(--btn-text); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.skip-link:focus { left: 12px; text-decoration: none; }

/* Visible keyboard focus on all navigation links */
.nav a:focus-visible, .chips a:focus-visible, .mobile-menu summary:focus-visible, .breadcrumb a:focus-visible, .footer-col a:focus-visible, .see-all:focus-visible { outline: 2px solid var(--cyan-1); outline-offset: 2px; border-radius: 6px; }

/* Desktop header: six categories, divider, All posts, About */
.nav-links .nav-cat, .nav-links .nav-all, .nav-links .nav-about { white-space: nowrap; padding: 8px 0; }
.nav-links a[aria-current="page"] { color: var(--text-primary); box-shadow: inset 0 -2px 0 var(--cyan-1); }
.nav-links .nav-all { color: var(--text-primary); }
.nav-links .nav-divider { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; }
.nav-links .nav-about { display: none; }

@media (min-width: 720px) {
	.nav-links { gap: 14px; margin-left: 20px; }
}
/* 720-999px: not enough room for Subscribe in the header (it stays on the homepage and in the menu) */
@media (min-width: 720px) and (max-width: 999.98px) {
	.nav-actions > .btn-subscribe { display: none; }
}
@media (min-width: 900px) {
	.nav-links { gap: 18px; margin-left: 28px; }
	.nav-links .nav-about { display: inline-block; }
}
@media (min-width: 1000px) {
	.nav-links { gap: 20px; }
}
@media (min-width: 1100px) {
	.nav-links { gap: 24px; margin-left: 36px; }
}

/* Mobile menu: "Menu" button with a label, categories with icons, search, About, Subscribe */
.icon-btn.menu-btn { width: auto; padding: 0 16px 0 12px; gap: 6px; font-size: 14px; color: var(--text-body); }
.mobile-menu-panel { width: min(300px, calc(100vw - 36px)); max-height: calc(100vh - 90px); overflow-y: auto; }
.mobile-menu-panel a { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.mobile-menu-panel a i { color: var(--cyan-1); font-size: 18px; width: 20px; text-align: center; }
.mobile-menu-panel a[aria-current="page"] { color: var(--text-primary); background: var(--accent-tint); }
.mobile-menu-panel .menu-heading { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); padding: 6px 12px 4px; }
.mobile-menu-panel .menu-divider { height: 1px; background: var(--border); margin: 6px 4px; }
.mobile-menu-panel .search-form.menu-search { margin: 6px 0 4px; max-width: none; }

/* Breadcrumb trail (replaces the single back arrow) */
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.breadcrumb li { margin: 0; white-space: nowrap; flex-shrink: 0; line-height: 1.2; }
.breadcrumb li + li::before { content: "\203A"; margin-right: 6px; color: var(--text-faint); }
.breadcrumb li:last-child { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb li a { display: inline-block; padding: 6px 0; }
.breadcrumb li span { color: var(--text-body); }

/* Chip bar: All + categories with counts; scrolls sideways on phones */
.chip-bar { position: relative; margin: 0 0 24px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 8px; scrollbar-width: none; -ms-overflow-style: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--text-body); font-size: 13px; white-space: nowrap; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.chips a:not(.active):hover, .chips a:not(.active):focus-visible { color: var(--text-primary); border-color: var(--c, var(--accent-tint-border)); text-decoration: none; transform: translateY(-2px) scale(1.05); box-shadow: 0 6px 14px rgba(var(--c-rgb, var(--blue-1-rgb)), 0.25); }
.chips a.active { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-text); font-weight: 500; }
.chips .count { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.chips a.active .count { color: #fff; }
@media (max-width: 719.98px) {
	.chips { padding-right: 36px; }
	.chip-bar::after { content: ""; position: absolute; top: 0; right: 0; bottom: 8px; width: 36px; pointer-events: none; background: linear-gradient(90deg, rgba(10, 14, 20, 0), var(--bg)); }
}

/* Mobile menu fixes: readable Subscribe label, 16px search text (stops iOS zoom), tighter rows */
.mobile-menu-panel a { padding-top: 4px; padding-bottom: 4px; }
.mobile-menu-panel a.btn-subscribe { color: var(--btn-text); justify-content: center; }
.search-form.menu-search input[type="search"] { font-size: 16px; min-width: 0; }

/* "More in <category>" block under a post */
.related { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.related .section-header { margin-bottom: 16px; }
.related .section-header h2 { font-size: 20px; margin: 0; }

/* ===== Signup panels (Courses waitlist + Weekly roundup) ===== */
.dhk-subscribe { margin: 0; }
.dhk-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dhk-status { min-height: 1.2em; margin: 10px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.dhk-status.ok { color: var(--cyan-1, #4fd1c5); }
.dhk-status.err { color: var(--accent-alt, #ff8b6b); }
.dhk-subscribe button[disabled] { opacity: 0.6; cursor: progress; }
