/**
 * Typography System
 * ---------------------------------------------------------------------------
 * File: assets/css/typography.css
 * Enqueued by: inc/enqueue.php (handle: gdq-typography), depends on
 * gdq-variables and gdq-base.
 *
 * Defines how typographic elements actually LOOK, using only the tokens
 * from variables.css — this file contains zero hard-coded sizes, weights,
 * colours, or spacing. base.css strips browser defaults; this file adds
 * the approved design back on top of that clean slate.
 *
 * Scope check (per Sprint 2A instructions): headings, paragraphs, lead
 * text, small text, lists, blockquotes, captions. No buttons, cards, nav,
 * hero, or other components — those are Sprint 2B+.
 */

/* ==========================================================================
   HEADINGS (H1–H6)
   All six levels share colour/line-height rules; size/weight per-level
   comes straight from the token scale so a single edit to variables.css
   is the only place a heading size ever needs to change.
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
	color: var(--gdq-color-text-heading);
	font-weight: 700; /* overridden per-level below where the approved
	                      weight differs (e.g. H3 is 600, not 700) */
	/* Vertical rhythm: any heading that follows a text element gets
	   deliberate top spacing, using the token scale rather than relying
	   on default browser margins (which base.css already zeroed out). */
	margin-top: var(--gdq-space-5);
}

h1 {
	font-size: var(--gdq-text-h1-size);
	font-weight: var(--gdq-text-h1-weight);
	line-height: var(--gdq-text-h1-lh);
}

h2 {
	font-size: var(--gdq-text-h2-size);
	font-weight: var(--gdq-text-h2-weight);
	line-height: var(--gdq-text-h2-lh);
}

h3 {
	font-size: var(--gdq-text-h3-size);
	font-weight: var(--gdq-text-h3-weight);
	line-height: var(--gdq-text-h3-lh);
}

h4 {
	font-size: var(--gdq-text-h4-size);
	font-weight: var(--gdq-text-h4-weight);
	line-height: var(--gdq-text-h4-lh);
}

h5 {
	font-size: var(--gdq-text-h5-size);
	font-weight: var(--gdq-text-h5-weight);
	line-height: var(--gdq-text-h5-lh);
}

h6 {
	font-size: var(--gdq-text-h6-size);
	font-weight: var(--gdq-text-h6-weight);
	line-height: var(--gdq-text-h6-lh);
	text-transform: uppercase; /* H6 doubles as a "smallest label" level in
	                               practice — uppercase distinguishes it from
	                               a merely-smaller H5 rather than the two
	                               being visually redundant */
	letter-spacing: var(--gdq-text-eyebrow-ls);
}

/* Tighten heading line-height further when a heading directly follows
   another heading (rare, but happens in eyebrow+heading pairings) —
   avoids doubled-up spacing from two default margins colliding. */
h1 + h2, h2 + h3, h3 + h4 {
	margin-top: var(--gdq-space-2);
}

h1:first-child, h2:first-child, h3:first-child,
h4:first-child, h5:first-child, h6:first-child {
	margin-top: 0; /* never add top space if the heading opens its container */
}

/* ==========================================================================
   PARAGRAPHS
   ========================================================================== */
p {
	font-size: var(--gdq-text-body-size);
	font-weight: var(--gdq-text-body-weight);
	line-height: var(--gdq-text-body-lh);
	max-width: 65ch; /* readable measure by default; layout.css's width
	                     utilities can override where a component needs a
	                     different measure (e.g. a 2-column card description) */
}

p + p {
	margin-top: var(--gdq-space-3); /* space between consecutive paragraphs,
	                                    matching the ~24px rhythm observed
	                                    in body-copy blocks across all 6 pages */
}

/* Lead paragraph — the larger intro sentence seen under section headings
   and in hero subcopy across every analysed page. Applied via a utility
   class rather than a bare selector since not every first paragraph is a
   lead paragraph. */
.lead {
	font-size: var(--gdq-text-lead-size);
	font-weight: var(--gdq-text-lead-weight);
	line-height: var(--gdq-text-lead-lh);
	color: var(--gdq-color-text-heading); /* lead text reads closer to
	                                          heading contrast than body
	                                          copy in every hero/intro
	                                          observed — body-body grey
	                                          is reserved for supporting
	                                          copy, not the lead line */
	max-width: 60ch;
}

/* Small text — fine print, meta info (dates, read-time), captions-adjacent
   copy that isn't inside a <figure>. */
.text-small,
small {
	font-size: var(--gdq-text-small-size);
	font-weight: var(--gdq-text-small-weight);
	line-height: var(--gdq-text-small-lh);
}

/* Eyebrow — the small uppercase gold label preceding section headings
   sitewide (Design Spec §2.3). Typography rule only lives here; the three
   structural variants (plain-label / underline-accent / pill-badge) are a
   component, built in Sprint 2B — this class supplies the shared text
   styling all three variants use underneath their structural differences. */
.eyebrow {
	display: inline-block;
	font-size: var(--gdq-text-eyebrow-size);
	font-weight: var(--gdq-text-eyebrow-weight);
	letter-spacing: var(--gdq-text-eyebrow-ls);
	text-transform: uppercase;
	color: var(--gdq-color-accent);
}

/* ==========================================================================
   LISTS (content context)
   base.css strips ALL list markers sitewide (nav menus, card lists, etc.
   should not show bullets by default). Here, markers are deliberately
   restored — but ONLY inside a content wrapper (.entry-content, the
   WordPress post/page body), since that's the one context where a reader
   expects to see real bullets/numbers, matching how bulleted deliverables
   lists read in the approved designs (e.g. Rich Service Card, Design Spec
   §2.7).
   ========================================================================== */
.entry-content ul,
.entry-content ol {
	padding-left: var(--gdq-space-4);
	margin-block: var(--gdq-space-3);
}

.entry-content ul {
	list-style: disc;
}

.entry-content ol {
	list-style: decimal;
}

.entry-content li + li {
	margin-top: var(--gdq-space-1);
}

.entry-content ul ul,
.entry-content ol ul,
.entry-content ul ol,
.entry-content ol ol {
	margin-block: var(--gdq-space-1);
}

/* Bulleted deliverables list, matching the small gold-bullet micro-
 * component observed in the Services Rich Service Card (Design Spec
 * §2.7/§2.19). Available as a utility class so it can be used outside
 * .entry-content too (e.g. inside a card template-part). */
.list-bullet {
	list-style: none;
	padding-left: 0;
}

.list-bullet li {
	position: relative;
	padding-left: var(--gdq-space-3);
}

.list-bullet li + li {
	margin-top: var(--gdq-space-1);
}

.list-bullet li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.6em;
	width: 5px;
	height: 5px;
	border-radius: var(--gdq-radius-pill);
	background-color: var(--gdq-color-accent);
}

/* ==========================================================================
   BLOCKQUOTES
   Left-border-accent style — a common, low-risk default for a dark,
   editorial-adjacent theme; no blockquote appeared in any of the 6
   analysed pages, so this is a conservative, on-brand default (gold
   accent border, heading-weight text) rather than an invented visual
   flourish.
   ========================================================================== */
blockquote {
	border-left: 3px solid var(--gdq-color-blockquote-border);
	padding-left: var(--gdq-space-3);
	margin-block: var(--gdq-space-4);
	font-size: var(--gdq-text-lead-size);
	font-style: italic;
	color: var(--gdq-color-text-heading);
}

blockquote cite {
	display: block;
	margin-top: var(--gdq-space-2);
	font-size: var(--gdq-text-small-size);
	font-style: normal;
	font-weight: 600;
	color: var(--gdq-color-text-body);
}

blockquote cite::before {
	content: "— ";
}

/* ==========================================================================
   CAPTIONS
   Covers <figcaption> and WordPress's .wp-caption-text class, plus a
   .caption utility for non-figure contexts (e.g. a table caption-style
   note). Matches the "Image credits/meta" pattern implied by the Design
   Spec's Image Overlay Badge component without duplicating that
   component's own styling here — this is plain caption TEXT, not the
   badge component itself.
   ========================================================================== */
figcaption,
.wp-caption-text,
.caption {
	font-size: var(--gdq-text-caption-size);
	font-weight: var(--gdq-text-caption-weight);
	font-style: var(--gdq-text-caption-style);
	color: var(--gdq-color-text-body);
	margin-top: var(--gdq-space-1);
}

/* ==========================================================================
   TABLES (content context)
   base.css handles the technical border-collapse reset; this is the
   visual treatment for a table appearing inside post/page content.
   ========================================================================== */
.entry-content table {
	margin-block: var(--gdq-space-4);
	font-size: var(--gdq-text-small-size);
}

.entry-content th,
.entry-content td {
	padding: var(--gdq-space-2);
	border-bottom: 1px solid var(--gdq-color-border-table);
}

.entry-content th {
	color: var(--gdq-color-text-heading);
	font-weight: 600;
}

/* ==========================================================================
   CODE (content context)
   base.css handles font-family/overflow reset; this adds the visual
   treatment (background, padding, radius) using the code-specific colour
   aliases defined in variables.css.
   ========================================================================== */
.entry-content code {
	background-color: var(--gdq-color-code-bg);
	color: var(--gdq-color-code-text);
	padding: 0.2em 0.4em;
	border-radius: var(--gdq-radius-sm);
}

.entry-content pre {
	background-color: var(--gdq-color-code-bg);
	color: var(--gdq-color-code-text);
	padding: var(--gdq-space-3);
	border-radius: var(--gdq-radius-md);
	margin-block: var(--gdq-space-4);
}

.entry-content pre code {
	background: none; /* avoid double-background when <code> is nested inside <pre> */
	padding: 0;
}
