/*
Theme Name: Astra Child — Pheonix Solutions
Theme URI: https://pheonixsolutions.com/
Description: Blog redesign child theme for Astra (free). Adds TOC, share buttons, related posts and card styling. No Astra template overrides.
Author: Pheonix Solutions
Template: astra
Version: 1.0.0
Text Domain: psol
*/

/* ---- Tokens ------------------------------------------------------------ */
:root {
	--psol-ink: #15263b;          /* headings — 13.9:1 on white */
	--psol-body: #22303f;         /* body copy — 12.6:1 on white */
	--psol-muted: #4a5c74;        /* meta — 7.0:1 on white */
	--psol-link: #0a63c2;         /* links — 6.1:1 on white */
	--psol-link-hover: #084a94;
	--psol-tint: #eaf2fd;
	--psol-surface: #ffffff;
	--psol-page: #eef3fa;
	--psol-line: #e2e9f3;
	--psol-radius: 14px;
	--psol-shadow: 0 1px 2px rgba(21, 38, 59, .04), 0 8px 24px rgba(21, 38, 59, .06);
}

/* ---- Base -------------------------------------------------------------- */
body { background: var(--psol-page); color: var(--psol-body); }
.entry-content { font-size: 18.5px; line-height: 1.72; }
.entry-content a { color: var(--psol-link); text-underline-offset: 3px; }
.entry-content a:hover,
.entry-content a:focus { color: var(--psol-link-hover); }
.entry-content h2 { font-size: 28px; line-height: 1.25; margin: 40px 0 14px; letter-spacing: -.02em; }
.entry-content h3 { font-size: 22px; line-height: 1.3; margin: 32px 0 12px; }
.entry-content pre {
	background: #0e1726; color: #dce7f5; padding: 20px 22px;
	border-radius: 12px; overflow-x: auto; font-size: 13.5px; line-height: 1.7;
}
.entry-content blockquote {
	border-left: 4px solid var(--psol-link); background: var(--psol-surface);
	padding: 18px 24px; border-radius: 0 12px 12px 0; margin: 0 0 24px; font-style: normal;
}
/* Zero CLS: reserve the box before the image decodes. */
.wp-post-image, .psol-card__media img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; height: auto; }

/* ---- Focus visibility (WCAG 2.4.7) ------------------------------------ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.ast-button:focus-visible {
	outline: 3px solid var(--psol-link);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---- Cards (archive, related, homepage shortcode) --------------------- */
.psol-grid { display: grid; gap: 24px; }
.psol-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.psol-card {
	display: flex; flex-direction: column;
	background: var(--psol-surface); border: 1px solid var(--psol-line);
	border-radius: var(--psol-radius); overflow: hidden; box-shadow: var(--psol-shadow);
	transition: border-color .18s ease, transform .18s ease;
}
.psol-card:hover { border-color: #9cc3ee; transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .psol-card { transition: none; } .psol-card:hover { transform: none; } }
.psol-card__media { display: block; background: #dce7f5; }
.psol-card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 11px; flex: 1; }
.psol-card__cat {
	align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .06em;
	text-transform: uppercase; color: var(--psol-link); background: var(--psol-tint);
	padding: 5px 10px; border-radius: 6px; text-decoration: none;
}
.psol-card__title { margin: 0; font-size: 20px; line-height: 1.28; letter-spacing: -.015em; }
.psol-card__title a { color: var(--psol-ink); text-decoration: none; }
.psol-card__title a:hover { color: var(--psol-link); }
.psol-card__excerpt { margin: 0; color: var(--psol-muted); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.psol-card__meta {
	margin-top: auto; padding-top: 14px; border-top: 1px solid #edf2f9;
	color: var(--psol-muted); font-size: 13px; font-weight: 600;
}

/* ---- Table of contents ------------------------------------------------ */
.psol-toc {
	background: var(--psol-surface); border: 1px solid var(--psol-line);
	border-radius: 12px; padding: 20px 22px; margin: 0 0 28px;
}
.psol-toc__title { margin: 0 0 14px; font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.psol-toc__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.psol-toc__item--h3 { padding-left: 16px; }
.psol-toc a { font-size: 14px; font-weight: 600; color: var(--psol-link); text-decoration: none; }
.psol-toc a:hover { text-decoration: underline; }
/* Anchor jumps clear the sticky Astra header. */
.entry-content h2[id], .entry-content h3[id] { scroll-margin-top: 100px; }

@media (min-width: 1200px) {
	/* Desktop: float the TOC into the margin as a sticky rail. */
	.single-post .psol-toc {
		position: sticky; top: 100px; float: right; width: 250px;
		margin: 0 0 28px 32px;
	}
}

/* ---- Share buttons --------------------------------------------------- */
.psol-share { display: flex; align-items: center; gap: 10px; margin: 22px 0 0; flex-wrap: wrap; }
.psol-share__label { color: var(--psol-muted); font-size: 13px; font-weight: 700; }
.psol-share__list { list-style: none; display: flex; gap: 10px; margin: 0; padding: 0; flex-wrap: wrap; }
.psol-share__btn {
	display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 14px;
	border: 1px solid #cbd8ea; border-radius: 10px; background: var(--psol-surface);
	color: var(--psol-ink); font-size: 13px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.psol-share__btn:hover { border-color: var(--psol-link); color: var(--psol-link); }

/* ---- Related posts --------------------------------------------------- */
.psol-related { border-top: 1px solid var(--psol-line); margin-top: 48px; padding-top: 40px; }
.psol-related__title { margin: 0 0 22px; font-size: 28px; letter-spacing: -.02em; }
.psol-related__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }

.psol-readtime { margin-left: .5em; color: var(--psol-muted); }

/* ---- Explicit breakpoint behaviour (matches Astra's 921 / 544) -------- */
@media (max-width: 921px) {
	.psol-grid--3, .psol-related__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.entry-content { font-size: 18px; }
	.entry-content h2 { font-size: 25px; }
	/* Astra drops the sidebar below content here — keep the gap deliberate. */
	#secondary { margin-top: 40px; }
}

@media (max-width: 544px) {
	.psol-grid--3, .psol-related__grid { grid-template-columns: 1fr; }
	.entry-content { font-size: 17px; }
	.entry-content h2 { font-size: 23px; }
	.entry-content h3 { font-size: 19px; }
	.entry-content pre { padding: 16px; font-size: 12.5px; border-radius: 10px; }
	.psol-card__title { font-size: 18px; }
	.psol-related__title { font-size: 24px; }
	/* Full-width tap targets for share row. */
	.psol-share__btn { min-width: 48px; height: 48px; }
}
