/* Defenders Gateway public blog — community storytelling.
 * Chivo (sans) for UI/brand. Source Serif 4 for editorial content.
 * Brand: #045AA3 / #D41E40 — used sparingly, content leads.
 */

:root {
	--bg:           #fafaf6;
	--surface:      #ffffff;
	--ink:          #1a1a1a;
	--ink-soft:     #4a4a4a;
	--ink-muted:    #767676;
	--rule:         #e8e6df;
	--brand:        #045AA3;
	--brand-accent: #D41E40;
	--serif: 'Source Serif 4', Charter, Georgia, 'Times New Roman', serif;
	--sans:  'Chivo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	font-family: var(--sans);
	color: var(--ink);
	line-height: 1.6;
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ----- App banner ----- */
.app-banner {
	display: flex; align-items: center; gap: 14px;
	padding: 12px 24px; background: var(--brand); color: #fff;
}
.app-banner-icon { width: 36px; height: 36px; border-radius: 8px; }
.app-banner-text { display: flex; flex-direction: column; line-height: 1.25; flex: 1; }
.app-banner-text strong { font-weight: 700; font-size: 14px; }
.app-banner-text span  { font-size: 13px; opacity: 0.9; }
.app-banner-cta {
	background: #fff; color: var(--brand);
	padding: 7px 16px; border-radius: 999px;
	font-weight: 600; font-size: 13px;
}
.app-banner-cta:hover { text-decoration: none; opacity: 0.95; }
.app-banner-close {
	background: transparent; color: #fff; border: 0;
	font-size: 22px; line-height: 1; cursor: pointer;
	padding: 4px 8px; opacity: 0.8;
}
.app-banner-close:hover { opacity: 1; }

/* ----- Header ----- */
.site-header {
	border-bottom: 1px solid var(--rule);
	background-color: rgba(250, 250, 246, 0.92);
	backdrop-filter: saturate(160%) blur(8px);
	position: sticky; top: 0; z-index: 50;
}
.header-inner {
	display: flex; align-items: center;
	padding: 18px 0; gap: 24px;
	flex-wrap: wrap;
}
.brand {
	display: inline-flex; align-items: baseline; gap: 8px;
	font-weight: 900; letter-spacing: 0.4px;
	font-size: 17px; color: var(--brand);
	flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--brand); }
.brand-mark--accent { color: var(--brand-accent); }
.brand-tag {
	font-size: 10px; color: var(--ink-muted); font-weight: 600;
	letter-spacing: 1.5px; text-transform: uppercase;
}

.nav {
	display: flex; flex-wrap: wrap;
	gap: 6px 18px;
	font-family: var(--sans);
	font-size: 13px;
	align-items: center;
	flex: 1;
	justify-content: flex-end;
}
.nav-link {
	color: var(--ink-soft); font-weight: 500;
	border-bottom: 1px solid transparent;
	padding: 2px 0;
	white-space: nowrap;
	transition: color 0.15s ease, border-color 0.15s ease;
}
.nav-link:hover {
	color: var(--ink);
	border-bottom-color: var(--cat-color, var(--ink));
	text-decoration: none;
}
.nav-link--lead { font-weight: 700; color: var(--ink); }
.nav-link--meta { color: var(--ink-muted); font-size: 12px; letter-spacing: 0.3px; text-transform: uppercase; }

/* Hamburger — hidden on desktop, shown on mobile */
.nav-toggle {
	display: none;
	background: transparent; border: 0;
	cursor: pointer; padding: 6px;
	margin-left: auto;
}
.nav-toggle-bar {
	display: block; width: 22px; height: 2px;
	background: var(--ink);
	border-radius: 2px;
	margin: 5px 0;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 860px) {
	.header-inner { padding: 14px 0; gap: 12px; flex-wrap: nowrap; }
	.nav-toggle { display: block; }
	.nav {
		display: none;
		flex-basis: 100%;
		flex-direction: column;
		gap: 0;
		font-size: 15px;
		padding: 8px 0 16px;
		margin-top: 8px;
		border-top: 1px solid var(--rule);
		justify-content: flex-start;
	}
	.nav.is-open { display: flex; }
	.nav-link {
		padding: 12px 4px;
		border-bottom: 1px solid var(--rule);
		white-space: normal;
	}
	.nav-link:last-child { border-bottom: 0; }
	.nav-link--lead { font-size: 16px; }
	.nav-link--meta {
		font-size: 12px;
		margin-top: 4px;
	}
}

/* ----- Eyebrow / category label ----- */
.post-category {
	display: inline-block;
	font-family: var(--sans);
	font-size: 11px; font-weight: 700;
	text-transform: uppercase; letter-spacing: 1.5px;
	margin-bottom: 8px;
}

/* ----- Post meta (byline) ----- */
.post-meta {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
	color: var(--ink-muted);
	font-family: var(--sans);
	font-size: 14px;
	margin-top: 16px;
}
.post-meta .dot { color: var(--rule); }
.post-meta .post-author { color: var(--ink-soft); font-weight: 600; }
.post-meta .post-author-avatar {
	width: 24px; height: 24px;
	border-radius: 50%; object-fit: cover;
	border: 1px solid var(--rule);
	display: inline-block; vertical-align: middle;
	margin-right: 4px;
}

/* ----- Featured (home hero) ----- */
.featured-card {
	display: block;
	max-width: 800px;
	margin: 56px auto 32px;
}
.featured-card:hover { text-decoration: none; }
.featured-image {
	width: 100%; height: 440px;
	background-size: cover; background-position: center;
	background-color: var(--rule);
	border-radius: 4px;
	margin-bottom: 28px;
	transition: opacity 0.2s ease;
}
.featured-card:hover .featured-image { opacity: 0.94; }
.featured-body { padding: 0 4px; }
.featured-body h1 {
	font-family: var(--serif); font-weight: 700;
	font-size: 44px; line-height: 1.12;
	color: var(--ink);
	margin: 4px 0 12px;
	letter-spacing: -0.02em;
}
.featured-subtitle {
	font-family: var(--serif); font-style: italic;
	color: var(--ink-soft);
	font-size: 20px; line-height: 1.5;
	margin: 0 0 20px;
}

/* ----- Post grid ----- */
.post-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 56px 40px;
	max-width: 1080px;
	margin: 56px auto 80px;
	padding-top: 32px;
	border-top: 1px solid var(--rule);
}
.post-card { display: block; }
.post-card:hover { text-decoration: none; }
.post-image {
	width: 100%; aspect-ratio: 16 / 10;
	background-size: cover; background-position: center;
	background-color: var(--rule);
	border-radius: 4px;
	margin-bottom: 18px;
	transition: opacity 0.2s ease;
}
.post-card:hover .post-image { opacity: 0.94; }
.post-image--empty { background: linear-gradient(135deg, #efece4, #e0ddd2); }
.post-card-body h2 {
	font-family: var(--serif); font-weight: 700;
	font-size: 26px; line-height: 1.22;
	color: var(--ink);
	margin: 4px 0 10px;
	letter-spacing: -0.01em;
}
.post-card-body p {
	font-family: var(--serif);
	color: var(--ink-soft);
	font-size: 17px; line-height: 1.5;
	margin: 0 0 12px;
}
.post-card-body .post-meta { margin-top: 12px; font-size: 13px; }

/* ----- Article ----- */
.post {
	max-width: 700px;
	margin: 56px auto 64px;
	padding: 0 4px;
}
.post-header { padding: 0 4px; }
.post-header h1 {
	font-family: var(--serif); font-weight: 700;
	font-size: 48px; line-height: 1.1;
	color: var(--ink);
	margin: 16px 0 12px;
	letter-spacing: -0.02em;
}
.post-subtitle {
	font-family: var(--serif); font-style: italic;
	color: var(--ink-soft);
	font-size: 22px; line-height: 1.45;
	margin: 0 0 20px;
}
.post-author-avatar {
	width: 36px; height: 36px;
	border-radius: 50%; object-fit: cover;
	border: 1px solid var(--rule);
}
.post-feature { margin: 36px -24px; }
.post-feature img { border-radius: 4px; }
.post-feature figcaption {
	font-family: var(--serif); font-style: italic;
	color: var(--ink-muted); font-size: 14px;
	text-align: center;
	margin-top: 12px; padding: 0 16px;
}
.post-body {
	font-family: var(--serif);
	font-size: 20px; line-height: 1.72;
	color: var(--ink);
	margin-top: 36px;
}
.post-body h2 {
	font-family: var(--serif); font-weight: 700;
	font-size: 30px; line-height: 1.2;
	margin: 44px 0 14px; color: var(--ink);
	letter-spacing: -0.015em;
}
.post-body h3 {
	font-family: var(--serif); font-weight: 700;
	font-size: 24px; line-height: 1.3;
	margin: 36px 0 10px; color: var(--ink);
}
.post-body h4 {
	font-family: var(--sans); font-weight: 700;
	font-size: 16px; text-transform: uppercase; letter-spacing: 1px;
	margin: 32px 0 8px; color: var(--ink-soft);
}
.post-body p { margin: 16px 0; }
.post-body img { border-radius: 4px; margin: 24px auto; }
.post-body blockquote {
	font-family: var(--serif); font-style: italic;
	font-size: 24px; line-height: 1.4;
	color: var(--ink);
	border-left: 3px solid var(--brand);
	padding: 4px 24px;
	margin: 28px 0;
}
.post-body blockquote p { margin: 8px 0; }
.post-body ul, .post-body ol { padding-left: 28px; }
.post-body li { margin: 8px 0; }
.post-body a {
	color: var(--brand);
	text-decoration: underline;
	text-decoration-color: rgba(4, 90, 163, 0.4);
	text-underline-offset: 3px;
}
.post-body a:hover { text-decoration-color: var(--brand); }
.post-body code, .post-body pre {
	font-family: SFMono-Regular, Menlo, Consolas, monospace;
}
.post-body pre {
	background: #1a1a1a; color: #e5e5e5;
	padding: 16px; border-radius: 4px; overflow-x: auto;
	font-size: 14px;
}
.post-body code {
	background: var(--rule); padding: 2px 6px;
	border-radius: 3px; font-size: 0.9em;
}

/* ----- Gated CTA ----- */
.gated-cta {
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: 4px;
	padding: 32px 28px;
	margin: 36px 0;
	text-align: center;
}
.gated-cta h3 {
	font-family: var(--serif); font-weight: 700;
	font-size: 24px; margin: 0 0 8px; color: var(--ink);
}
.gated-cta p {
	font-family: var(--serif);
	color: var(--ink-soft); margin: 0 0 18px;
	font-size: 17px;
}
.btn-primary {
	display: inline-block;
	background: var(--brand); color: #fff;
	padding: 12px 28px; border-radius: 999px;
	font-family: var(--sans);
	font-weight: 600; font-size: 14px;
	letter-spacing: 0.3px;
}
.btn-primary:hover { text-decoration: none; opacity: 0.92; }

/* ----- Tags ----- */
.post-tags {
	margin: 36px 0 28px;
	display: flex; flex-wrap: wrap; gap: 8px;
}
.post-tag {
	font-family: var(--sans);
	font-size: 13px; padding: 5px 14px;
	border-radius: 999px;
	border: 1px solid var(--rule);
	color: var(--ink-soft);
	background: var(--surface);
}
.post-tag:hover {
	text-decoration: none;
	border-color: var(--ink-muted);
	color: var(--ink);
}

/* ----- Share ----- */
.post-share {
	display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
	border-top: 1px solid var(--rule);
	padding-top: 24px; margin-top: 36px;
	font-family: var(--sans); font-size: 14px;
}
.post-share-label { color: var(--ink-muted); }
.post-share a, .post-share button {
	color: var(--brand);
	background: transparent; border: 0; cursor: pointer;
	font: inherit; padding: 0; text-decoration: none;
	font-weight: 500;
}
.post-share a:hover, .post-share button:hover { text-decoration: underline; }

/* ----- App CTA in article ----- */
.app-cta {
	background: var(--ink); color: #fff;
	border-radius: 4px;
	padding: 40px 32px;
	text-align: center;
	margin: 56px 0;
}
.app-cta h3 {
	font-family: var(--serif); font-weight: 700;
	font-size: 26px; margin: 0 0 8px;
	letter-spacing: -0.01em;
}
.app-cta p {
	font-family: var(--serif);
	font-size: 17px; margin: 0 0 22px;
	opacity: 0.9;
}
.store-badges {
	display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}
.store-badges a {
	background: #fff; color: var(--ink);
	padding: 11px 22px; border-radius: 4px;
	font-family: var(--sans);
	font-weight: 600; font-size: 14px;
	letter-spacing: 0.2px;
}
.store-badges a:hover { text-decoration: none; opacity: 0.94; }

/* ----- Related ----- */
.related {
	max-width: 1080px; margin: 48px auto 64px;
	padding: 32px 24px 0;
	border-top: 1px solid var(--rule);
}
.related h2 {
	font-family: var(--serif); font-weight: 700;
	font-size: 22px; margin: 0 0 24px;
	color: var(--ink); letter-spacing: -0.01em;
}
.related-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 32px;
}
.related-card { display: block; }
.related-card:hover { text-decoration: none; }
.related-image {
	width: 100%; aspect-ratio: 16 / 10;
	background-size: cover; background-position: center;
	background-color: var(--rule);
	border-radius: 4px; margin-bottom: 12px;
	transition: opacity 0.2s ease;
}
.related-card:hover .related-image { opacity: 0.94; }
.related-image--empty { background: linear-gradient(135deg, #efece4, #e0ddd2); }
.related-card-body h3 {
	font-family: var(--serif); font-weight: 700;
	font-size: 17px; line-height: 1.3;
	color: var(--ink); margin: 4px 0 6px;
	letter-spacing: -0.005em;
}
.related-card-body small {
	font-family: var(--sans);
	color: var(--ink-muted); font-size: 12px;
}

/* ----- Archive header (category/tag) ----- */
.archive-header {
	max-width: 700px;
	margin: 56px auto 32px;
	padding: 0 4px;
	text-align: center;
}
.archive-eyebrow {
	display: block;
	font-family: var(--sans);
	text-transform: uppercase; letter-spacing: 2px;
	font-size: 11px; font-weight: 700;
	margin-bottom: 8px;
}
.archive-header h1 {
	font-family: var(--serif); font-weight: 700;
	font-size: 40px; line-height: 1.15;
	margin: 4px 0 12px; color: var(--ink);
	letter-spacing: -0.02em;
}
.archive-description {
	font-family: var(--serif); font-style: italic;
	color: var(--ink-soft);
	font-size: 18px;
	max-width: 560px;
	margin: 12px auto 0;
}

/* ----- Empty / not found ----- */
.empty, .not-found {
	text-align: center;
	padding: 96px 20px;
	color: var(--ink-muted);
	font-family: var(--serif);
}
.empty h2, .not-found h1 {
	font-family: var(--serif); font-weight: 700;
	color: var(--ink);
	font-size: 32px;
	margin: 0 0 8px;
	letter-spacing: -0.01em;
}

/* ----- Footer ----- */
.site-footer {
	border-top: 1px solid var(--rule);
	background: var(--bg);
	padding: 56px 0 32px;
	margin-top: 80px;
}
.footer-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1.5fr;
	gap: 40px;
}
.footer-grid h4 {
	margin: 0 0 12px;
	font-family: var(--sans);
	font-size: 12px;
	text-transform: uppercase; letter-spacing: 1.5px;
	color: var(--ink-muted);
}
.footer-grid .brand { font-size: 18px; margin-bottom: 8px; }
.footer-tag {
	font-family: var(--serif);
	color: var(--ink-soft);
	font-size: 16px;
	line-height: 1.5;
	margin-top: 12px;
}
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { margin: 6px 0; }
.footer-list a {
	font-family: var(--sans);
	font-size: 14px; color: var(--ink-soft);
}
.footer-list a:hover { color: var(--ink); text-decoration: none; }
.footer-bottom {
	display: flex; justify-content: space-between; align-items: center;
	border-top: 1px solid var(--rule);
	margin-top: 40px; padding-top: 20px;
	color: var(--ink-muted);
	font-family: var(--sans); font-size: 13px;
}
.footer-bottom small a { color: var(--ink-muted); }
.footer-bottom small a:hover { color: var(--ink-soft); text-decoration: none; }

/* ----- Responsive ----- */
@media (max-width: 768px) {
	.post-grid {
		grid-template-columns: 1fr;
		gap: 48px;
		margin-top: 32px;
	}
	.featured-card { margin: 32px auto; }
	.featured-image { height: 260px; margin-bottom: 20px; }
	.featured-body h1 { font-size: 32px; }
	.featured-subtitle { font-size: 18px; }
	.post-card-body h2 { font-size: 22px; }
	.post-header h1 { font-size: 32px; }
	.post-subtitle { font-size: 18px; }
	.post-body { font-size: 18px; }
	.post-feature { margin: 24px 0; }
	.archive-header h1 { font-size: 30px; }
	.footer-grid { grid-template-columns: 1fr; gap: 32px; }
	.footer-bottom { flex-direction: column; gap: 8px; }
	.nav { gap: 16px; }
}

@media (max-width: 480px) {
	.container { padding: 0 16px; }
	.featured-image { height: 220px; }
	.featured-body h1 { font-size: 28px; }
	.post-header h1 { font-size: 28px; }
	.app-banner { padding: 10px 16px; }
}
