/* Blog styles — loaded after page-style.css on pages built by scripts/build-blog.js */
.blog-wrap {
	max-width: 1040px;
	margin: 0 auto;
	padding: 40px 20px 80px;
}

/* ── Breadcrumb (in the page header) ── */
.blog-breadcrumb {
	font-size: 0.88rem;
	font-weight: 500;
	color: var(--muted);
	margin-bottom: 14px;
}

.blog-breadcrumb a { color: var(--muted); text-decoration: none; }
.blog-breadcrumb a:hover { color: var(--accent); }
.blog-breadcrumb [aria-current] { color: var(--text-soft); }

/* ── Category control ── */
.blog-categories {
	display: flex;
	width: fit-content;
	max-width: 100%;
	overflow-x: auto;
	margin: 0 auto 32px;
	padding: 4px;
	gap: 2px;
	background: var(--bg-subtle);
	border: 1px solid var(--border);
	border-radius: 12px;
}

.blog-chip {
	color: var(--muted);
	font-weight: 500;
	font-size: 0.92rem;
	padding: 7px 16px;
	border-radius: 9px;
	white-space: nowrap;
}

.blog-chip:hover { color: var(--text); text-decoration: none; }

.blog-chip.active {
	background: var(--surface);
	color: var(--text);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--border);
}

/* ── Post cards ── */
.post-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
}

.post-card {
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: 24px;
	color: inherit;
	overflow: hidden;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.post-card:hover {
	border-color: var(--border-strong);
	box-shadow: var(--shadow);
	color: inherit;
	text-decoration: none;
}

.post-card.has-thumb { padding-top: 0; }

.post-thumb {
	display: block;
	width: calc(100% + 48px);
	margin: 0 -24px 20px;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-bottom: 1px solid var(--border);
}

.post-tag {
	align-self: flex-start;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--accent);
	margin-bottom: 10px;
}

.post-card h2 {
	font-size: 1.2rem;
	line-height: 1.35;
	margin: 0 0 10px;
}

.post-card:hover h2 { color: var(--accent); }

.post-card p {
	color: var(--muted);
	font-size: 0.94rem;
	line-height: 1.6;
	flex-grow: 1;
	margin: 0 0 16px;
}

.post-meta { font-size: 0.85rem; color: var(--muted); }

.blog-empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* ── Article ── */
.blog-wrap > .blog-article {
	max-width: 720px;
	margin: 0 auto 56px;
	padding: 0;
}

.blog-article p,
.blog-article li {
	font-size: 1.06rem;
	line-height: 1.75;
}

.blog-article h2 {
	font-size: 1.45rem;
	margin: 2.4rem 0 0.7rem;
}

.blog-article > :first-child { margin-top: 0; }
.blog-article > :last-child { margin-bottom: 0; }

.blog-article .callout {
	border-left: 3px solid var(--accent);
	border-radius: 0 var(--radius) var(--radius) 0;
	background: var(--accent-soft);
	color: var(--text-soft);
	padding: 16px 20px;
	margin: 1.75rem 0;
}

.blog-article .callout strong { color: var(--text); }

/* ── App card ── */
.blog-article .app-card {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--bg-subtle);
	padding: 20px;
	margin: 1.75rem 0;
}

.app-card-icon {
	flex-shrink: 0;
	border-radius: 22%;
	box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.app-card-body { flex: 1; min-width: 0; }

.app-card-title {
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 1.1rem;
	color: var(--text);
}

.blog-article .app-card-desc {
	color: var(--muted);
	font-size: 0.94rem;
	line-height: 1.55;
	margin: 4px 0 6px;
}

.app-card-meta {
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--muted);
	margin-bottom: 14px;
}

.app-card-badges {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}

.blog-article .store-badge { text-decoration: none; }
.blog-article .badge-amazon,
.blog-article .badge-amazon:hover { color: #fff; }

/* ── App Store screenshots ── */
.app-screens { margin: 1.75rem 0; }

.app-screens-strip {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	padding-bottom: 6px;
	scroll-snap-type: x mandatory;
}

.app-screens-strip a { flex-shrink: 0; scroll-snap-align: start; }

.app-screens-strip img {
	display: block;
	height: 300px;
	width: auto;
	border-radius: 14px;
	border: 1px solid var(--border);
}

.app-screens figcaption,
.blog-article figure figcaption {
	font-size: 0.85rem;
	color: var(--muted);
	margin-top: 8px;
	text-align: center;
}

/* ── Post images ── */
.blog-article figure { margin: 1.75rem 0; }

.blog-article figure > img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--radius-lg);
}

.blog-article figure.narrow > img {
	width: auto;
	max-width: min(100%, 340px);
	margin: 0 auto;
}

/* Gallery of phone screenshots: <figure class="gallery"> (3 across), .two or .one */
.blog-article .gallery-grid {
	display: grid;
	grid-template-columns: repeat(var(--gallery-cols, 3), minmax(0, 1fr));
	gap: 12px;
	max-width: 560px;
	margin: 0 auto;
}

.blog-article .gallery.two .gallery-grid { --gallery-cols: 2; max-width: 380px; }
.blog-article .gallery.one .gallery-grid { --gallery-cols: 1; max-width: 200px; }

.blog-article .gallery-grid img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 16px;
	border: 1px solid var(--border);
	box-shadow: var(--shadow);
}

.blog-article .post-cover { margin: 0 0 2rem; }

.blog-article .post-cover img {
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* ── Related posts ── */
.related-posts {
	border-top: 1px solid var(--border);
	padding-top: 48px;
}

.related-posts h2 {
	font-size: 1.4rem;
	text-align: center;
	margin-bottom: 24px;
}

.blog-back {
	text-align: center;
	margin: 36px 0 0;
	font-weight: 500;
}

.blog-back a { text-decoration: none; }

@media (max-width: 575.98px) {
	.blog-article .app-card { flex-direction: column; }
	.app-screens-strip img { height: 240px; }
}

@media (prefers-color-scheme: dark) {
	.blog-chip.active { box-shadow: 0 0 0 1px var(--border); }
	.app-card-icon { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06); }
}
