/*
Theme Name: Irene's Essentials
Description: A deliberately plain theme for a curated Amazon picks site: a friendly landing page, category pages, and an All Picks page. No page builder, no JavaScript. Works with the Amazon Picks plugin.
Version: 2.2.0
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: irenes-essentials
*/

:root {
	--ie-bg: #fffaf7;
	--ie-ink: #24202a;
	--ie-muted: #6f6975;
	--ie-line: #ece6e1;
	--ie-accent: #7455d9;
	--ie-accent-hover: #5f43c2;
	--ie-pill-bg: #efe9ff;
	--ie-pill-ink: #5a3fb5;
	--ie-max: 1100px;
	--ie-sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
	--ie-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

	/* Colours for the Amazon Picks plugin's cards, buttons and tiles. */
	--ap-accent: var(--ie-accent);
	--ap-accent-hover: var(--ie-accent-hover);
	--ap-ink: var(--ie-ink);
	--ap-muted: var(--ie-muted);
	--ap-pill-bg: var(--ie-pill-bg);
	--ap-pill-ink: var(--ie-pill-ink);
	--ap-radius: 12px;
	--ap-radius-lg: 14px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

html, body {
	/* Backstop: nothing should ever be wide enough to cause a horizontal
	   scrollbar/shift, but this keeps a stray overflow from taking the
	   whole page sideways with it. */
	overflow-x: hidden;
}

body {
	margin: 0;
	background: var(--ie-bg);
	color: var(--ie-ink);
	font: 16px/1.6 var(--ie-sans);
}

a { color: var(--ie-accent); }
a:hover { text-decoration: none; }

img { max-width: 100%; height: auto; }

.wrap {
	max-width: var(--ie-max);
	margin: 0 auto;
	padding: 0 16px;
}

.screen-reader-text,
.skip:not(:focus) {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 10;
	padding: 8px 12px;
	background: #fff;
	border: 2px solid var(--ie-accent);
}

/* Header: brand left, navigation right. */
.site-header {
	border-bottom: 1px solid var(--ie-line);
}

.site-header .bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 24px;
	padding-top: 16px;
	padding-bottom: 14px;
}

/* Flex items default to min-width: auto, which can stop them shrinking (or
   their own wrapping children from wrapping) below their unwrapped content
   width even with flex-wrap set — the classic cause of a nav silently
   pushing the page wider than the viewport once it has enough items. */
.site-header .bar > * {
	min-width: 0;
}

.site-title {
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--ie-ink);
	text-decoration: none;
}

.site-title img { display: inline-block; vertical-align: middle; max-height: 44px; width: auto; }

.brand-mark { font-weight: 400; }

.site-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 22px;
	margin: 0;
	padding: 0;
	min-width: 0;
	list-style: none;
}

.site-nav a {
	color: var(--ie-ink);
	font-size: 0.95rem;
	font-weight: 700;
	text-decoration: none;
}

.site-nav a:hover { color: var(--ie-accent); }

.site-nav a[aria-current="page"] {
	color: var(--ie-accent);
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 2px;
}

/* Main */
main { padding: 28px 0 56px; min-height: 55vh; }

h1 {
	font-family: var(--ie-sans);
	font-size: 2rem;
	font-weight: 800;
	line-height: 1.15;
	margin: 0 0 0.4em;
	letter-spacing: -0.02em;
	text-align: center;
}

h2 {
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.3;
	margin: 1.6em 0 0.6em;
}

.crumbs {
	margin: 0 0 12px;
	font-size: 0.85rem;
	color: var(--ie-muted);
	text-align: center;
}
.crumbs a { color: var(--ie-muted); }
.crumbs span[aria-hidden] { margin: 0 6px; }

.term-desc {
	color: var(--ie-muted);
	max-width: 60ch;
	margin: 0 auto 1.2rem;
	font-size: 0.9rem;
	text-align: center;
}

.entry > *:first-child { margin-top: 0; }

/* Home: hero */
.hero {
	padding: 26px 0 8px;
	text-align: center;
}

.badge {
	display: inline-block;
	margin: 0;
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--ie-pill-bg);
	color: var(--ie-pill-ink);
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.hero h1 {
	max-width: 13em;
	margin: 20px auto 18px;
	font-family: var(--ie-serif);
	font-size: clamp(2.4rem, 8.2vw, 4.6rem);
	font-weight: 800;
	line-height: 1.03;
	letter-spacing: -0.025em;
	/* Split the headline into two even lines ("Little things that / make life easier."). */
	text-wrap: balance;
	/* System serifs have no black weight; a hairline stroke gives the heavy look. */
	-webkit-text-stroke: 0.03em currentColor;
}

.hero .accent { color: var(--ie-accent); }

.lede {
	max-width: 36em;
	margin: 0 auto;
	color: var(--ie-muted);
	font-size: 1.05rem;
	line-height: 1.6;
}

@media (min-width: 700px) {
	.lede { font-size: 1.2rem; }
}

.cta-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px 14px;
	margin: 28px 0 0;
}

.btn {
	display: inline-block;
	padding: 15px 24px;
	border: 1px solid transparent;
	border-radius: 12px;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary { background: var(--ie-accent); color: #fff; }
.btn-primary:hover { background: var(--ie-accent-hover); }

.btn-secondary { background: #fff; border-color: var(--ie-line); color: var(--ie-ink); }
.btn-secondary:hover { border-color: var(--ie-accent); color: var(--ie-accent); }

.btn:focus-visible { outline: 3px solid var(--ie-pill-bg); outline-offset: 2px; box-shadow: 0 0 0 2px var(--ie-accent); }

.disclosure-box {
	margin: 34px auto 8px;
	padding: 14px 18px;
	background: #fff;
	border: 1px solid var(--ie-line);
	border-radius: 14px;
	color: var(--ie-muted);
	font-size: 0.85rem;
	line-height: 1.5;
	text-align: center;
}

.disclosure-box strong { color: var(--ie-ink); }

.ie-home-sections { margin-top: 34px; }

/* Footer */
.site-footer {
	border-top: 1px solid var(--ie-line);
	padding: 20px 0 28px;
	font-size: 0.85rem;
	color: var(--ie-muted);
	text-align: center;
}
.site-footer p { margin: 0 0 4px; }
.site-footer a { color: var(--ie-muted); }
