/**
 * Static pages — izebuy design system.
 *
 * The "normal" WordPress pages (About, How It Works, Terms, Privacy, FAQ …) as
 * opposed to blog posts. Research-backed reading layout: content sits in a card
 * at a comfortable 50–75 character measure with 1.5+ line-height and generous
 * whitespace; an optional sidebar carries marketplace nav/CTAs.
 *
 * Templates: page.php (default, adaptive sidebar), page-tpl_full_width.php
 * (no sidebar), page-tpl_left_sidebar.php, page-tpl_side_menu.php.
 *
 * Depends on: tokens.css, components.css (.ize-pagination), widgets.css
 * (the .ize-widget cards used in the page sidebar).
 */

/* Page measure — narrower than the listing container (--ize-container) so body
 * text never runs too wide. Defined here (pages.css only loads on page
 * templates) so the wrap and the heading band can share one value. */
:root {
	--ize-page-max: 1180px;     /* content + sidebar */
	--ize-page-measure: 720px;  /* centred no-sidebar reading column (~66 chars/line) */
	--ize-page-aside: 320px;    /* sidebar column width */
}

/* ── Shell ───────────────────────────────────────────────────────────────── */

.ize-page {
	background: var(--ize-surface-2);
	padding: var(--ize-5) 0 var(--ize-7);
}
.ize-page__wrap {
	max-width: var(--ize-page-max);
	margin: 0 auto;
	padding: 0 var(--ize-4);
}

/* ── Layout ──────────────────────────────────────────────────────────────── */

/* One column by default; modifiers add the sidebar/measure. The grid stacks on
 * small screens and only splits at ≥992px. */
.ize-page__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--ize-6);
	align-items: start;
}

/* No sidebar — a single, centred reading column (Terms, Privacy, About …). */
.ize-page__layout--narrow {
	grid-template-columns: minmax(0, var(--ize-page-measure));
	justify-content: center;
}

/* No sidebar, full container width — for wide / image-led content. */
.ize-page__layout--full {
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 992px) {
	/* Content + right sidebar. */
	.ize-page__layout--sidebar {
		grid-template-columns: minmax(0, 1fr) var(--ize-page-aside);
	}
	/* Content + left sidebar. DOM order stays content-first (so it leads on
	 * mobile); explicit placement moves the sidebar to the left on desktop. */
	.ize-page__layout--left-sidebar {
		grid-template-columns: var(--ize-page-aside) minmax(0, 1fr);
	}
	.ize-page__layout--left-sidebar .ize-page__main {
		grid-column: 2;
		grid-row: 1;
	}
	.ize-page__layout--left-sidebar .ize-page__sidebar {
		grid-column: 1;
		grid-row: 1;
	}
	/* Content + a section nav (child pages) on the left. */
	.ize-page__layout--side-menu {
		grid-template-columns: 260px minmax(0, 1fr);
	}
	.ize-page__layout--side-menu .ize-page__main {
		grid-column: 2;
		grid-row: 1;
	}
	.ize-page__layout--side-menu .ize-page__nav {
		grid-column: 1;
		grid-row: 1;
	}
	/* Content flanked by a sidebar on each side. DOM order is content, left,
	 * right (content leads on mobile); explicit placement spreads them across
	 * the three columns on desktop. */
	.ize-page__layout--both {
		grid-template-columns: var(--ize-page-aside) minmax(0, 1fr) var(--ize-page-aside);
	}
	.ize-page__layout--both .ize-page__main {
		grid-column: 2;
		grid-row: 1;
	}
	.ize-page__layout--both .ize-page__sidebar--left {
		grid-column: 1;
		grid-row: 1;
	}
	.ize-page__layout--both .ize-page__sidebar--right {
		grid-column: 3;
		grid-row: 1;
	}
}

/* ── Content card ────────────────────────────────────────────────────────── */

.ize-page__main {
	min-width: 0;                /* let the grid item shrink (no overflow) */
	background: var(--ize-surface);
	border-radius: var(--ize-radius-lg);
	padding: var(--ize-6);
	box-shadow: var(--ize-shadow-sm);
}
@media (max-width: 575px) {
	.ize-page__main {
		padding: var(--ize-5) var(--ize-4);
	}
}

/* Featured image (optional) sits at the top of the card. */
.ize-page__feature {
	display: block;
	width: 100%;
	height: auto;
	margin-bottom: var(--ize-5);
	border-radius: var(--ize-radius);
}

/* Long-form reading typography — matches the blog article for a consistent read
 * across posts and pages. */
.ize-page__content {
	font-size: var(--ize-fs-md);   /* 18px */
	line-height: 1.75;
	color: var(--ize-ink);
}
.ize-page__content > :first-child {
	margin-top: 0;
}
.ize-page__content > * + * {
	margin-top: 1.4em;
}
.ize-page__content h2 {
	font-size: 1.6em;
	line-height: 1.3;
	margin-top: 1.8em;
}
.ize-page__content h3 {
	font-size: 1.3em;
	line-height: 1.35;
	margin-top: 1.6em;
}
.ize-page__content h4 {
	font-size: 1.1em;
	margin-top: 1.5em;
}
.ize-page__content a {
	color: var(--ize-brand);
	text-decoration: underline;
}
.ize-page__content a:hover {
	color: var(--ize-brand-hover);
}
.ize-page__content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--ize-radius);
}
.ize-page__content figure {
	margin: 1.6em 0;
}
.ize-page__content figcaption {
	margin-top: var(--ize-2);
	font-size: var(--ize-fs-sm);
	color: var(--ize-ink-3);
	text-align: center;
}
.ize-page__content blockquote {
	margin: 1.6em 0;
	padding: 4px 0 4px 20px;
	border-left: 3px solid var(--ize-line);
	color: var(--ize-ink-2);
	font-style: italic;
	font-size: 1.1em;
}
.ize-page__content ul,
.ize-page__content ol {
	padding-left: 1.4em;
}
.ize-page__content li + li {
	margin-top: 0.4em;
}
.ize-page__content hr {
	margin: 2em 0;
	border: 0;
	border-top: 1px solid var(--ize-line);
}
/* Tables (common on Terms/Privacy and comparison pages). */
.ize-page__content table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.6em 0;
	font-size: var(--ize-fs-sm);
}
.ize-page__content th,
.ize-page__content td {
	padding: var(--ize-2) var(--ize-3);
	border: 1px solid var(--ize-line);
	text-align: left;
	vertical-align: top;
}
.ize-page__content th {
	background: var(--ize-surface-2);
	font-weight: 700;
}
/* Inline code / preformatted blocks. */
.ize-page__content code {
	padding: 2px 6px;
	border-radius: var(--ize-radius-sm);
	background: var(--ize-surface-2);
	font-size: 0.9em;
}
.ize-page__content pre {
	overflow: auto;
	padding: var(--ize-4);
	border-radius: var(--ize-radius);
	background: var(--ize-surface-2);
}
.ize-page__content pre code {
	padding: 0;
	background: none;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

/* Widgets supply their own .ize-widget card chrome (widgets.css); the column
 * just stacks them. min-width:0 keeps long words from stretching the column. */
.ize-page__sidebar {
	min-width: 0;
}

/* ── Section nav (page-tpl_side_menu) ────────────────────────────────────────
 * A vertical list of the section's child pages, for multi-page areas like a help
 * centre or a multi-part guide. */
.ize-page__nav {
	min-width: 0;
	background: var(--ize-surface);
	border: 1px solid var(--ize-line);
	border-radius: var(--ize-radius);
	padding: var(--ize-3);
}
.ize-page__nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.ize-page__nav .children {
	margin: var(--ize-1) 0 var(--ize-1) var(--ize-3);
}
.ize-page__nav li {
	margin: 0;
}
.ize-page__nav a {
	display: block;
	padding: var(--ize-2) var(--ize-3);
	border-radius: var(--ize-radius-sm);
	color: var(--ize-ink);
	font-size: var(--ize-fs-sm);
	text-decoration: none;
	transition: background 0.15s var(--ize-ease, ease), color 0.15s var(--ize-ease, ease);
}
.ize-page__nav a:hover {
	background: var(--ize-surface-2);
	color: var(--ize-brand);
}
.ize-page__nav .current_page_item > a {
	background: color-mix(in srgb, var(--ize-brand) 8%, transparent);
	color: var(--ize-brand);
	font-weight: 700;
}

/* ── Pagination (multi-page content: <!--nextpage-->) ────────────────────── */
.ize-page__content + .ize-pagination {
	margin-top: var(--ize-6);
}
