/*
 * Hubka Theme
 *
 * Phase: 11B.2 — Global Foundation
 * Purpose: Global reading rhythm (paragraphs, headings, lists, blockquote, code, hr, links) for raw content theme.json cannot reach.
 *
 * Rules:
 * - Reuse theme.json tokens.
 * - Use logical properties.
 * - Keep selectors shallow.
 * - Do not duplicate component styling.
 */

/*
 * Base typography — global reading rhythm.
 *
 * Covers only what theme.json cannot express: vertical rhythm for raw,
 * non-block HTML (e.g. WooCommerce's rendered account/description content
 * via core/post-content, which isn't a sequence of gap-aware blocks), plus
 * generic element defaults (lists, blockquote, code, hr, link decoration).
 *
 * Root font-family, font sizes, line-height, and heading font-weight are
 * already set in theme.json and are not duplicated here.
 *
 * Targets .wp-block-post-content only (not .entry-content): confirmed by
 * direct render that core/post-content always outputs both classes on the
 * same element in this block-theme architecture, and Hubka has no classic
 * PHP templates where .entry-content could appear alone — so the single
 * class already covers every case.
 */

/* Paragraph rhythm for raw rendered content (shortcodes, the_content()). */
.wp-block-post-content p {
	margin-block: 0 var(--wp--preset--spacing--40);
}

.wp-block-post-content p:last-child {
	margin-block-end: 0;
}

/* Heading rhythm: more space above than below, so a heading introduces
 * what follows rather than floating ambiguously between blocks. */
.wp-block-post-content h1,
.wp-block-post-content h2,
.wp-block-post-content h3,
.wp-block-post-content h4,
.wp-block-post-content h5,
.wp-block-post-content h6 {
	margin-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--30);
}

/* Lists */
.wp-block-post-content ul,
.wp-block-post-content ol {
	margin-block: 0 var(--wp--preset--spacing--40);
	padding-inline-start: var(--wp--preset--spacing--50);
}

.wp-block-post-content li {
	margin-block-end: var(--wp--preset--spacing--20);
}

/* Blockquote: a quiet inline-start border, muted text — never louder
 * than the surrounding copy. */
blockquote {
	margin-block: var(--wp--preset--spacing--40);
	margin-inline: 0;
	padding-inline-start: var(--wp--preset--spacing--40);
	border-inline-start: 2px solid var(--wp--preset--color--border);
	color: var(--wp--preset--color--muted);
}

blockquote p:last-child {
	margin-block-end: 0;
}

/* Code / pre */
code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background-color: var(--wp--preset--color--background-secondary);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0.375rem;
	padding-inline: 0.3em;
	padding-block: 0.1em;
}

pre {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background-color: var(--wp--preset--color--background-secondary);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0.375rem;
	padding: var(--wp--preset--spacing--40);
	margin-block: 0 var(--wp--preset--spacing--40);
	overflow-inline: auto;
}

pre code {
	background: none;
	border: none;
	padding: 0;
}

/* Horizontal rule (raw <hr>, outside the core/separator block context) */
hr {
	border: none;
	border-block-start: 1px solid var(--wp--preset--color--border);
	margin-block: var(--wp--preset--spacing--60);
}

/* Link decoration: theme.json already sets link color/hover; this adds
 * only the underline behavior, which theme.json has no setting for. */
a {
	text-decoration: none;
}

a:hover,
a:focus-visible {
	text-decoration: underline;
}

/* Tables: clean, editorial — not a dense spreadsheet. Added in Phase
 * 11B.5 (not present when this file was created in 11B.2). */
.wp-block-post-content table {
	width: 100%;
	border-collapse: collapse;
	margin-block: 0 var(--wp--preset--spacing--40);
}

.wp-block-post-content th {
	text-align: start;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	padding-block: var(--wp--preset--spacing--20);
	padding-inline-end: var(--wp--preset--spacing--30);
	border-block-end: 1px solid var(--wp--preset--color--border);
}

.wp-block-post-content td {
	padding-block: var(--wp--preset--spacing--20);
	padding-inline-end: var(--wp--preset--spacing--30);
	border-block-end: 1px solid var(--wp--preset--color--border);
}

/* Pull quotes: a distinct, larger editorial moment — not just a bigger
 * blockquote. Added in Phase 11B.5. */
.wp-block-pullquote {
	margin-block: var(--wp--preset--spacing--60);
	padding: 0;
	border: none;
	text-align: center;
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.4;
	color: var(--wp--preset--color--text);
}

.wp-block-pullquote cite {
	display: block;
	margin-block-start: var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	font-style: normal;
}