/* ==========================================================================
   Grace Digital Theme — main.css
   Tokens lifted directly from the Grace Digital Store strategy doc (§6.2).
   ========================================================================== */

:root {
	/* Color */
	--bg: #FAFAF7;
	--surface: #FFFFFF;
	--ink: #111111;
	--muted: #6B7280;
	--border: #E5E7EB;
	--accent: #1F6F4A;
	--accent-hover: #185B3C;
	--accent-soft: #E8F1EC;
	--success: #1F8A53;
	--warning: #B45309;
	--danger: #B42318;
	--info: #1D4ED8;

	/* Typography */
	--font-display: "Fraunces", Georgia, "Times New Roman", serif;
	--font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	/* Spacing (4-pt scale) */
	--s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
	--s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

	/* Radius */
	--r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-pill: 999px;

	/* Shadow */
	--sh-sm: 0 1px 2px rgba(0,0,0,.06);
	--sh-md: 0 4px 12px rgba(0,0,0,.08);
	--sh-lg: 0 16px 40px rgba(0,0,0,.12);

	--container: 1200px;
}

/* Reset-ish */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; color: var(--ink); margin: 0 0 var(--s-4); }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: 1.375rem; }
p { margin: 0 0 var(--s-4); }
.muted { color: var(--muted); }
.lede { font-size: 1.125rem; color: var(--muted); max-width: 60ch; }

/* Layout */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding-inline: var(--s-5); }
.section { padding-block: var(--s-8); }
.section--center { text-align: center; }
.section--intro { padding-block: var(--s-8) var(--s-5); }
.section--cta { background: var(--accent-soft); }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); flex-wrap: wrap; }
.section__title { margin: 0; }
.link-more { font-weight: 600; font-size: .95rem; }

.grid { display: grid; gap: var(--s-5); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

/* Skip link */
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--s-4); top: var(--s-4); background: var(--surface); padding: var(--s-2) var(--s-4); z-index: 1000; border-radius: var(--r-sm); }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.site-header__inner { display: flex; align-items: center; gap: var(--s-5); padding-block: var(--s-4); }
.site-title { font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.main-navigation { margin-left: auto; }
.nav-menu, .main-navigation ul { list-style: none; display: flex; gap: var(--s-5); margin: 0; padding: 0; }
.nav-menu a { color: var(--ink); font-weight: 500; }
.nav-menu a:hover { color: var(--accent); text-decoration: none; }
.site-header__actions { display: flex; align-items: center; gap: var(--s-4); }
.header-cart { position: relative; color: var(--ink); }
.header-cart__count {
	position: absolute; top: -8px; right: -10px; background: var(--accent); color: #fff;
	font-size: .7rem; line-height: 1; min-width: 18px; height: 18px; display: grid; place-items: center;
	border-radius: var(--r-pill); padding: 0 4px;
}
.header-account { font-weight: 600; }
.menu-toggle { display: none; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
	font-family: var(--font-body); font-weight: 600; font-size: .95rem; line-height: 1;
	padding: var(--s-3) var(--s-5); border-radius: var(--r-md); border: 1px solid transparent;
	cursor: pointer; transition: background .15s ease-out, color .15s ease-out, border-color .15s ease-out;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--secondary { background: var(--accent-soft); color: var(--accent-hover); }
.btn--secondary:hover { background: #dceae2; color: var(--accent-hover); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--sm { padding: var(--s-2) var(--s-4); font-size: .875rem; }
.btn--block { width: 100%; }

/* Hero */
.hero { background: linear-gradient(180deg, var(--accent-soft), var(--bg)); padding-block: var(--s-9); }
.hero__inner { max-width: 760px; }
.hero__eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 600; color: var(--accent); margin-bottom: var(--s-3); }
.hero__heading { margin-bottom: var(--s-4); }
.hero__subtext { font-size: 1.125rem; color: var(--muted); margin-bottom: var(--s-5); }
.hero__actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-6); }
.hero__trust { list-style: none; display: flex; gap: var(--s-5); padding: 0; margin: 0; flex-wrap: wrap; color: var(--muted); font-size: .9rem; }
.hero__trust li::before { content: "\2713  "; color: var(--accent); font-weight: 700; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--sh-sm); transition: box-shadow .15s ease-out, transform .15s ease-out; }
.card:hover { box-shadow: var(--sh-md); transform: translateY(-2px); }
.card__media { display: block; aspect-ratio: 4 / 3; background: var(--accent-soft); overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media-placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, var(--accent-soft), #fff); }
.card__body { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.card__title { font-size: 1.1rem; margin: 0; }
.card__title a { color: var(--ink); }
.card__price { font-weight: 700; color: var(--accent-hover); margin: 0; }
.card__excerpt { color: var(--muted); font-size: .95rem; }

/* Tier card */
.card--tier { padding: var(--s-5); gap: var(--s-3); }
.card--tier.is-featured { border-color: var(--accent); box-shadow: var(--sh-md); }
.tier-flag { align-self: flex-start; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 600; padding: var(--s-1) var(--s-3); border-radius: var(--r-pill); }

/* Quote card */
.card--quote { padding: var(--s-5); }
.card--quote blockquote { margin: 0 0 var(--s-4); font-size: 1.05rem; }
.card--quote figcaption { display: flex; flex-direction: column; }

/* Process */
.process__steps { list-style: none; counter-reset: step; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-5); }
.process__steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); position: relative; }
.process__steps li strong { display: block; font-family: var(--font-display); margin-bottom: var(--s-2); }
.process__steps li::before { counter-increment: step; content: counter(step); position: absolute; top: var(--s-4); right: var(--s-4); color: var(--accent); font-weight: 700; opacity: .35; font-size: 1.5rem; }

/* Notices */
.notice { border-radius: var(--r-md); padding: var(--s-4); border: 1px solid var(--border); }
.notice--info { background: var(--accent-soft); border-color: #cfe2d8; }

/* Content + sidebar */
.content-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-7); }
.entry-content { max-width: 72ch; }
.entry-content img { border-radius: var(--r-md); margin-block: var(--s-4); }
.entry-media { margin-bottom: var(--s-5); border-radius: var(--r-lg); overflow: hidden; }

/* Forms */
.gdc-form { display: grid; gap: var(--s-4); max-width: 560px; margin-inline: auto; text-align: left; }
.gdc-form label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: var(--s-1); }
.gdc-form input, .gdc-form textarea, .gdc-form select {
	width: 100%; font: inherit; padding: var(--s-3); border: 1px solid var(--border);
	border-radius: var(--r-md); background: var(--surface); color: var(--ink);
}
.gdc-form input:focus, .gdc-form textarea:focus, .gdc-form select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.gdc-form .gdc-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }

/* Footer */
.site-footer { background: var(--ink); color: #cbd5e1; margin-top: var(--s-9); }
.site-footer__cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-6); padding-block: var(--s-8) var(--s-6); }
.site-footer .widget-title { color: #fff; font-size: 1rem; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.site-footer__bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); padding-block: var(--s-5); border-top: 1px solid rgba(255,255,255,.12); flex-wrap: wrap; }
.footer-menu { list-style: none; display: flex; gap: var(--s-5); margin: 0; padding: 0; }
.site-footer__copy { margin: 0; font-size: .9rem; }

/* Pagination */
.pagination { display: flex; gap: var(--s-2); justify-content: center; margin-top: var(--s-7); }
.pagination .page-numbers { padding: var(--s-2) var(--s-3); border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--ink); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Page header */
.page-header { margin-bottom: var(--s-6); }
.page-title { margin: 0; }

/* Responsive (§6.6) */
@media (max-width: 1024px) {
	.grid--4 { grid-template-columns: repeat(2, 1fr); }
	.process__steps { grid-template-columns: repeat(2, 1fr); }
	.content-with-sidebar { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.grid--3, .grid--4 { grid-template-columns: 1fr; }
	.process__steps { grid-template-columns: 1fr; }
	.site-footer__cols { grid-template-columns: 1fr 1fr; }
	.gdc-form .gdc-form__row { grid-template-columns: 1fr; }

	.menu-toggle { display: inline-flex; flex-direction: column; gap: 4px; background: none; border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--s-2) var(--s-3); cursor: pointer; }
	.menu-toggle__bar, .menu-toggle__bar::before, .menu-toggle__bar::after { display: block; width: 20px; height: 2px; background: var(--ink); position: relative; }
	.menu-toggle__bar::before, .menu-toggle__bar::after { content: ""; position: absolute; left: 0; }
	.menu-toggle__bar::before { top: -6px; }
	.menu-toggle__bar::after { top: 6px; }
	.main-navigation ul { display: none; flex-direction: column; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--border); padding: var(--s-4) var(--s-5); gap: var(--s-3); }
	.main-navigation.is-open ul { display: flex; }
	.site-header__inner { position: relative; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; }
}
