/* =========================================================================
   CaffeBench — main stylesheet
   Design tokens first, then layout, then components, then responsive rules.
   Brand colors can also be overridden live from Appearance → Customize
   (see inc/customizer.php), which prints :root overrides in <head>.
   ========================================================================= */

:root {
	/* Brand palette (overridable via Customizer) */
	--cb-ink: #241811;
	--cb-ink-2: #3a2818;
	--cb-accent: #e3b04b;
	--cb-accent-dark: #c2903a;
	--cb-mint: #bfe0d3;
	--cb-cream: #f6efe2;

	/* Derived / fixed tokens */
	--cb-cream-2: #efe2c9;
	--cb-paper: #fffbf4;
	--cb-white: #ffffff;
	--cb-text: #241a12;
	--cb-text-soft: #6d5d4c;
	--cb-text-on-dark: #f3ead9;
	--cb-text-on-dark-soft: #cbb9a4;
	--cb-line: #e7dcc4;
	--cb-line-dark: rgba(255, 255, 255, 0.14);

	--cb-font-display: "Fraunces", Georgia, "Times New Roman", serif;
	--cb-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

	--cb-radius-sm: 10px;
	--cb-radius-md: 18px;
	--cb-radius-lg: 26px;
	--cb-radius-pill: 999px;

	--cb-container: 1200px;
	--cb-shadow-card: 0 10px 30px -12px rgba(36, 24, 17, 0.18);
	--cb-shadow-pop: 0 20px 50px -18px rgba(36, 24, 17, 0.35);
}

/* ---------- Reset-ish base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: var(--cb-font-body);
	color: var(--cb-text);
	background: var(--cb-paper);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { font-family: var(--cb-font-display); font-weight: 600; line-height: 1.15; margin: 0 0 0.5em; color: var(--cb-text); }
p { margin: 0 0 1em; }
button { font: inherit; }

.screen-reader-text {
	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px; height: 1px; overflow: hidden;
}
.cb-skip-link {
	position: fixed; top: -60px; left: 12px; z-index: 999;
	background: var(--cb-ink); color: var(--cb-white);
	padding: 10px 18px; border-radius: var(--cb-radius-sm);
	transition: top .2s ease;
}
.cb-skip-link:focus { top: 12px; }

.cb-container {
	max-width: var(--cb-container);
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- Buttons ---------- */
.cb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 28px;
	border-radius: var(--cb-radius-pill);
	font-weight: 600;
	font-size: 15px;
	border: 1.5px solid transparent;
	transition: transform .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
	cursor: pointer;
	white-space: nowrap;
}
.cb-btn--solid { background: var(--cb-accent); color: var(--cb-ink); }
.cb-btn--solid:hover { background: var(--cb-accent-dark); transform: translateY(-1px); }
.cb-btn--outline { background: transparent; color: currentColor; border-color: currentColor; }
.cb-btn--outline:hover { background: rgba(255, 255, 255, 0.08); transform: translateY(-1px); }
.cb-btn--sm { padding: 9px 18px; font-size: 13px; }

/* On light backgrounds, outline buttons should use ink, not white, as the border/text color */
.cb-section .cb-btn--outline,
.cb-card .cb-btn--outline,
.cb-page-content .cb-btn--outline {
	color: var(--cb-ink);
}
.cb-section .cb-btn--outline:hover,
.cb-card .cb-btn--outline:hover,
.cb-page-content .cb-btn--outline:hover {
	background: var(--cb-ink);
	color: var(--cb-white);
}

.cb-link-arrow {
	font-weight: 600;
	font-size: 14px;
	position: relative;
	padding-right: 20px;
}
.cb-link-arrow::after {
	content: "→";
	position: absolute;
	right: 0;
	transition: transform .15s ease;
}
.cb-link-arrow:hover::after { transform: translateX(4px); }

/* ---------- Eyebrow label ---------- */
.cb-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--cb-accent);
	margin-bottom: 18px;
}
.cb-eyebrow__rule { width: 28px; height: 2px; background: currentColor; display: inline-block; }
.cb-eyebrow--dark { color: var(--cb-accent-dark); }

/* ---------- Header ---------- */
.cb-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--cb-paper);
	border-bottom: 1px solid var(--cb-line);
	transition: box-shadow .2s ease;
}
.cb-header.is-scrolled { box-shadow: 0 4px 20px -8px rgba(36, 24, 17, 0.15); }
.cb-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 76px;
	gap: 24px;
}
.cb-brand { display: flex; align-items: center; gap: 10px; color: var(--cb-ink); }
.cb-logo-mark { color: var(--cb-accent-dark); flex-shrink: 0; }
.cb-brand__name { font-family: var(--cb-font-display); font-size: 21px; font-weight: 600; letter-spacing: -0.01em; }
.cb-brand__name em { font-style: italic; color: var(--cb-accent-dark); }

.cb-nav__list { display: flex; align-items: center; gap: 32px; }
.cb-nav__list a {
	font-size: 15px;
	font-weight: 500;
	color: var(--cb-text);
	transition: color .15s ease;
}
.cb-nav__list a:hover { color: var(--cb-accent-dark); }

.cb-nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	background: none;
	border: none;
	cursor: pointer;
	border-radius: var(--cb-radius-sm);
}
.cb-nav-toggle__bar {
	width: 22px;
	height: 2px;
	background: var(--cb-ink);
	transition: transform .2s ease, opacity .2s ease;
	margin: 0 auto;
}
.cb-nav-toggle.is-open .cb-nav-toggle__bar:nth-child(2) { transform: translateY(7px) rotate(45deg); }
.cb-nav-toggle.is-open .cb-nav-toggle__bar:nth-child(3) { opacity: 0; }
.cb-nav-toggle.is-open .cb-nav-toggle__bar:nth-child(4) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Header actions: search + CTA ---------- */
.cb-header__actions { display: flex; align-items: center; gap: 14px; }
.cb-search-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1.5px solid var(--cb-line);
	background: transparent;
	color: var(--cb-ink);
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
	flex-shrink: 0;
}
.cb-search-toggle:hover,
.cb-search-toggle.is-open { border-color: var(--cb-accent-dark); background: var(--cb-cream); }
.cb-header__cta { flex-shrink: 0; }
.cb-header__cta svg { margin-left: 2px; }

.cb-search-form {
	overflow: hidden;
	max-height: 0;
	background: var(--cb-cream);
	border-bottom: 1px solid var(--cb-line);
	transition: max-height .25s ease;
}
.cb-search-form:not([hidden]) { max-height: 90px; }
.cb-search-form form {
	display: flex;
	gap: 12px;
	padding: 18px 24px;
}
.cb-search-form input[type="search"] {
	flex: 1;
	border: 1.5px solid var(--cb-line);
	border-radius: var(--cb-radius-pill);
	padding: 11px 20px;
	font: inherit;
	font-size: 15px;
	background: var(--cb-paper);
	color: var(--cb-text);
}
.cb-search-form input[type="search"]:focus { outline: 2px solid var(--cb-accent-dark); outline-offset: 1px; }

/* ---------- Hero ---------- */
.cb-hero {
	position: relative;
	background: radial-gradient(120% 140% at 15% 10%, var(--cb-ink-2) 0%, var(--cb-ink) 55%);
	color: var(--cb-text-on-dark);
	overflow: hidden;
	padding: 76px 0 64px;
}
.cb-hero__wavy { position: absolute; top: 0; height: 100%; width: 24px; color: rgba(255,255,255,0.14); }
.cb-hero__wavy--1 { left: 46%; }
.cb-hero__wavy--2 { left: 68%; }
.cb-wavy { width: 100%; height: 100%; }

.cb-hero__inner {
	position: relative;
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: 48px;
	align-items: center;
}
.cb-hero__heading {
	font-size: clamp(38px, 5.2vw, 64px);
	color: var(--cb-white);
	margin-bottom: 22px;
	max-width: 14ch;
}
.cb-hero__heading em { font-style: italic; color: var(--cb-mint); }
.cb-hero__subhead {
	font-size: 17px;
	color: var(--cb-text-on-dark-soft);
	max-width: 46ch;
	margin-bottom: 34px;
}
.cb-hero__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 56px; }
.cb-hero__actions .cb-btn--outline { color: var(--cb-white); border-color: rgba(255,255,255,0.5); }

.cb-stats { display: flex; gap: 44px; flex-wrap: wrap; }
.cb-stats__item dt {
	font-family: var(--cb-font-display);
	font-size: 30px;
	color: var(--cb-white);
	margin: 0;
}
.cb-stats__item dd {
	margin: 4px 0 0;
	font-size: 13px;
	color: var(--cb-text-on-dark-soft);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.cb-hero__visual { position: relative; display: flex; justify-content: center; }

/* Photo frame: holds either an uploaded machine photo or the fallback
   illustration, plus the floating badge card overlapping its corner. */
.cb-hero__photo-frame {
	position: relative;
	width: 100%;
	max-width: 440px;
	aspect-ratio: 4 / 5;
	border-radius: var(--cb-radius-lg);
	overflow: visible;
	box-shadow: var(--cb-shadow-pop);
}
.cb-hero__photo-frame::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: var(--cb-radius-lg);
	border: 1px solid rgba(255,255,255,0.14);
	pointer-events: none;
	z-index: 2;
}
.cb-hero__photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: var(--cb-radius-lg);
	display: block;
}
.cb-hero__photo-frame--illustration {
	background: linear-gradient(160deg, #4a3421, #2c1d12);
	border-radius: var(--cb-radius-lg);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
}
.cb-hero__illustration { width: 100%; height: auto; max-width: 300px; }
.cb-illus-ring { stroke: rgba(255,255,255,0.18); }
.cb-illus-cup { fill: rgba(191, 224, 211, 0.08); }
.cb-illus-cupbody { fill: var(--cb-accent); }
.cb-illus-handle { stroke: var(--cb-accent); }
.cb-illus-steam { stroke: var(--cb-mint); opacity: 0.8; }
.cb-illus-bench { fill: rgba(255,255,255,0.15); }

.cb-hero__badge {
	position: absolute;
	right: -18px;
	bottom: -22px;
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 190px;
	background: var(--cb-ink-2);
	border: 1px solid rgba(255,255,255,0.14);
	border-radius: var(--cb-radius-md);
	padding: 16px 18px;
	box-shadow: var(--cb-shadow-pop);
}
.cb-hero__badge-dot {
	flex-shrink: 0;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--cb-accent);
	box-shadow: 0 0 0 4px rgba(227, 176, 75, 0.22);
}
.cb-hero__badge-text {
	font-family: var(--cb-font-display);
	font-size: 15px;
	line-height: 1.25;
	color: var(--cb-white);
}

/* ---------- Sections ---------- */
.cb-section { padding: 88px 0; }
.cb-section--cream { background: var(--cb-cream); }
.cb-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 36px;
	flex-wrap: wrap;
}
.cb-section__title { font-size: clamp(26px, 3.4vw, 38px); max-width: 20ch; }

.cb-page-header {
	background: var(--cb-cream);
	padding: 64px 0 44px;
	border-bottom: 1px solid var(--cb-line);
}
.cb-page-header h1 { font-size: clamp(32px, 4.5vw, 46px); margin-bottom: 10px; }
.cb-page-header p { color: var(--cb-text-soft); max-width: 60ch; }

.cb-page-content { max-width: 760px; }
.cb-page-content h2 { margin-top: 1.6em; }
.cb-page-content :first-child { margin-top: 0; }

/* ---------- Grid & cards ---------- */
.cb-grid { display: grid; gap: 28px; }
.cb-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.cb-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.cb-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

.cb-card {
	background: var(--cb-paper);
	border: 1px solid var(--cb-line);
	border-radius: var(--cb-radius-lg);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform .18s ease, box-shadow .18s ease;
}
.cb-card:hover { transform: translateY(-4px); box-shadow: var(--cb-shadow-card); }
.cb-card__media { position: relative; aspect-ratio: 4 / 3; background: var(--cb-cream-2); display: block; overflow: hidden; }
.cb-card__media img { width: 100%; height: 100%; object-fit: cover; }
.cb-card__media-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--cb-accent-dark); }
.cb-badge {
	position: absolute; top: 14px; left: 14px;
	background: var(--cb-accent); color: var(--cb-ink);
	font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
	padding: 6px 12px; border-radius: var(--cb-radius-pill);
}
.cb-card__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cb-card__eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--cb-accent-dark); }
.cb-card__title { font-size: 19px; margin: 0; }
.cb-card__title a:hover { color: var(--cb-accent-dark); }
.cb-card__rating { display: flex; align-items: center; gap: 8px; }
.cb-card__rating-num { font-size: 13px; color: var(--cb-text-soft); font-weight: 600; }
.cb-card__excerpt { color: var(--cb-text-soft); font-size: 14px; margin: 0; flex: 1; }
.cb-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 12px; }
.cb-card__price { font-weight: 700; font-family: var(--cb-font-display); font-size: 17px; }

.cb-stars { display: inline-flex; gap: 2px; color: var(--cb-accent-dark); }
.cb-star { width: 15px; height: 15px; fill: currentColor; stroke: currentColor; }
.cb-star--empty { fill: none; stroke: var(--cb-line); opacity: 1; }
.cb-star--empty path { fill: none; }
.cb-star--half path { stroke: currentColor; stroke-width: 1; }

.cb-empty { color: var(--cb-text-soft); padding: 40px 0; }

/* ---------- Filter pills ---------- */
.cb-filter-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.cb-filter-pill {
	padding: 9px 18px;
	border-radius: var(--cb-radius-pill);
	border: 1.5px solid var(--cb-line);
	font-size: 14px;
	font-weight: 600;
	color: var(--cb-text);
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.cb-filter-pill:hover { border-color: var(--cb-accent-dark); }
.cb-filter-pill--active { background: var(--cb-ink); color: var(--cb-white); border-color: var(--cb-ink); }

/* ---------- Editorial (How We Test) ---------- */
.cb-editorial { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: start; }
.cb-editorial__text p { color: var(--cb-text-soft); max-width: 42ch; }
.cb-editorial__cards { display: grid; gap: 18px; }
.cb-mini-card {
	background: var(--cb-paper);
	border: 1px solid var(--cb-line);
	border-radius: var(--cb-radius-md);
	padding: 22px 24px;
}
.cb-mini-card__num { font-family: var(--cb-font-display); font-style: italic; color: var(--cb-accent-dark); font-size: 14px; }
.cb-mini-card h3 { font-size: 17px; margin: 6px 0 6px; }
.cb-mini-card p { color: var(--cb-text-soft); font-size: 14px; margin: 0; }

/* ---------- CTA band ---------- */
.cb-cta-band { background: var(--cb-ink); color: var(--cb-text-on-dark); }
.cb-cta-band__inner { text-align: center; max-width: 620px; margin: 0 auto; }
.cb-cta-band h2 { color: var(--cb-white); font-size: clamp(26px, 3.6vw, 36px); }
.cb-cta-band p { color: var(--cb-text-on-dark-soft); margin-bottom: 28px; }

/* ---------- Single product review ---------- */
.cb-review__header { background: var(--cb-cream); padding: 56px 0; border-bottom: 1px solid var(--cb-line); }
.cb-review__header-inner { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 44px; align-items: center; }
.cb-review__title { font-size: clamp(30px, 4.2vw, 44px); margin-bottom: 14px; }
.cb-review__verdict { font-size: 17px; color: var(--cb-text-soft); max-width: 52ch; }
.cb-review__meta { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; font-size: 14px; color: var(--cb-text-soft); margin: 18px 0; }
.cb-review__rating { display: flex; align-items: center; gap: 8px; }
.cb-review__actions { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.cb-review__price { font-family: var(--cb-font-display); font-size: 22px; font-weight: 600; }
.cb-review__media img { border-radius: var(--cb-radius-lg); box-shadow: var(--cb-shadow-card); }

.cb-review__body-wrap { padding: 56px 0; max-width: 820px; }
.cb-proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 44px; }
.cb-proscons__col { border-radius: var(--cb-radius-md); padding: 24px; }
.cb-proscons__col--pros { background: rgba(191, 224, 211, 0.28); }
.cb-proscons__col--cons { background: rgba(227, 176, 75, 0.16); }
.cb-proscons__col h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.cb-proscons__col li { position: relative; padding-left: 22px; margin-bottom: 8px; font-size: 15px; }
.cb-proscons__col--pros li::before { content: "+"; position: absolute; left: 0; font-weight: 700; color: #3f7a63; }
.cb-proscons__col--cons li::before { content: "–"; position: absolute; left: 0; font-weight: 700; color: var(--cb-accent-dark); }
.cb-review__content { font-size: 16px; }
.cb-review__content h2 { font-size: 24px; margin-top: 1.6em; }
.cb-review__content p { color: var(--cb-text); }

/* ---------- Footer ---------- */
.cb-footer { background: var(--cb-ink); color: var(--cb-text-on-dark-soft); padding: 64px 0 0; }
.cb-footer__inner {
	display: grid;
	grid-template-columns: 1.3fr 1fr 1fr;
	gap: 40px;
	padding-bottom: 44px;
	border-bottom: 1px solid var(--cb-line-dark);
}
.cb-footer .cb-brand__name { color: var(--cb-white); }
.cb-footer .cb-logo-mark { color: var(--cb-accent); }
.cb-footer__tagline { margin-top: 14px; max-width: 32ch; font-size: 14px; }
.cb-footer__list { display: flex; flex-direction: column; gap: 12px; }
.cb-footer__list a:hover { color: var(--cb-white); }
.footer-widget-title { color: var(--cb-white); font-size: 14px; margin-bottom: 10px; }
.cb-footer__bottom { padding: 24px 0; font-size: 13px; }

/* ---------- Pagination ---------- */
.cb-pagination { margin-top: 40px; display: flex; justify-content: center; gap: 10px; }
.cb-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 40px; height: 40px; padding: 0 12px;
	border-radius: var(--cb-radius-pill); border: 1.5px solid var(--cb-line);
	font-weight: 600; font-size: 14px;
}
.cb-pagination .page-numbers.current { background: var(--cb-ink); color: var(--cb-white); border-color: var(--cb-ink); }

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 1024px) {
	.cb-hero__inner { grid-template-columns: 1fr; }
	.cb-hero__visual { order: -1; max-width: 340px; margin: 0 auto 12px; }
	.cb-editorial { grid-template-columns: 1fr; }
	.cb-review__header-inner { grid-template-columns: 1fr; }
	.cb-review__media { order: -1; }
	.cb-grid--cols-3, .cb-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
	.cb-nav {
		position: absolute;
		top: 76px;
		left: 0;
		right: 0;
		background: var(--cb-paper);
		border-bottom: 1px solid var(--cb-line);
		max-height: 0;
		overflow: hidden;
		transition: max-height .25s ease;
	}
	.cb-nav.is-open { max-height: 400px; }
	.cb-nav__list { flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 24px 20px; }
	.cb-nav__list li { width: 100%; }
	.cb-nav__list a { display: block; padding: 14px 0; border-bottom: 1px solid var(--cb-line); }
	.cb-nav-toggle { display: flex; }
}

@media (max-width: 720px) {
	.cb-section { padding: 60px 0; }
	.cb-hero { padding: 48px 0 40px; }
	.cb-stats { gap: 28px; }
	.cb-hero__actions { flex-direction: column; align-items: stretch; }
	.cb-hero__actions .cb-btn { text-align: center; }
	.cb-grid--cols-3, .cb-grid--cols-2, .cb-grid--cols-4 { grid-template-columns: 1fr; }
	.cb-proscons { grid-template-columns: 1fr; }
	.cb-footer__inner { grid-template-columns: 1fr; }
	.cb-section__head { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
	.cb-header__cta { display: none; }
	.cb-header__actions { gap: 8px; }
}

@media (max-width: 480px) {
	.cb-container { padding: 0 18px; }
	.cb-brand__name { font-size: 18px; }
	.cb-review__actions { flex-wrap: wrap; }
	.cb-hero__badge { right: 8px; bottom: -18px; max-width: 160px; padding: 12px 14px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.cb-card, .cb-btn, .cb-nav { transition: none; }
}
