/* Jax Card Company theme.
 *
 * To re-theme the site, change the values in :root below — layout and
 * templates reference only these variables, never raw colors or fonts.
 * A future theme = a new file overriding :root (e.g. theme-dark.css).
 */

:root {
  /* Brand */
  --color-bg: #faf7f1;          /* warm paper */
  --color-surface: #ffffff;
  --color-ink: #1c1917;         /* warm charcoal */
  --color-muted: #78716c;       /* warm gray */
  --color-accent: #b45309;      /* copper */
  --color-accent-ink: #ffffff;
  --color-rule: #e7e0d4;        /* hairline rules */
  --color-card-edge: #d6cfbf;

  /* Type */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Shape + space */
  --radius: 10px;
  --space: 1rem;
  --max-width: 72rem;
}

* { box-sizing: border-box; }

/* Reserve the scrollbar gutter at all times so panels growing or
 * shrinking (e.g. the designer layer editor) never shift the page
 * horizontally when a scrollbar appears or disappears. */
html {
  scrollbar-gutter: stable;
}

@supports not (scrollbar-gutter: stable) {
  html { overflow-y: scroll; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  line-height: 1.6;
}

.site-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 calc(var(--space) * 1.5);
}

.site-header {
  border-bottom: 1px solid var(--color-rule);
  padding: calc(var(--space) * 1.25) 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: calc(var(--space) * 0.75);
  text-decoration: none;
  color: var(--color-ink);
}

.brand img {
  width: 40px;
  height: 40px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.02em;
}

.hero {
  text-align: center;
  padding: calc(var(--space) * 5) 0;
  position: relative;
  overflow: hidden;
}

/* Admin-managed background photo (/admin/hero): full-bleed cover with
 * a dark overlay so the headline stays readable over any photo.
 * Without an image the plain paper background renders as before. */
.hero.has-bg {
  background-size: cover;
  background-position: center;
  color: #fff;
}

.hero.has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, 0.55);
}

.hero.has-bg > * { position: relative; }

.hero.has-bg p { color: rgba(255, 255, 255, 0.88); }

.hero.has-bg h1 { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5); }

.hero img {
  width: 96px;
  height: 96px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.75rem;
  margin: calc(var(--space) * 1.5) 0 calc(var(--space) * 0.5);
  letter-spacing: 0.01em;
}

.hero p {
  color: var(--color-muted);
  margin: 0;
}

.hero p + p { margin-top: calc(var(--space) * 1.25); }

.site-footer {
  border-top: 1px solid var(--color-rule);
  color: var(--color-muted);
  font-size: 0.875rem;
  padding: calc(var(--space) * 1.25) 0;
  text-align: center;
}

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
  flex-wrap: wrap;
}

.site-nav {
  display: flex;
  gap: calc(var(--space) * 1.25);
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--color-muted);
  text-decoration: none;
  font-weight: 600;
}

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

.site-nav a.active {
  color: var(--color-ink);
  border-bottom: 2px solid var(--color-accent);
}

.btn {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  text-decoration: none;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius);
}

.btn:hover { filter: brightness(1.08); }

.home-section {
  padding: calc(var(--space) * 2.5) 0;
  border-top: 1px solid var(--color-rule);
}

.home-section h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin: 0 0 calc(var(--space) * 0.5);
}

.home-section .muted { color: var(--color-muted); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: calc(var(--space) * 1.25);
  margin-top: var(--space);
}

.product-card { margin: 0; }

.product-card a { display: block; }

.product-shot-img {
  width: 100%;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  display: block;
  border: 1px solid var(--color-card-edge);
  border-radius: var(--radius);
}

.product-shot {
  aspect-ratio: 8 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  border: 1px dashed var(--color-card-edge);
  border-radius: var(--radius);
  color: var(--color-muted);
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.product-card figcaption {
  color: var(--color-muted);
  font-size: 0.875rem;
  padding-top: 0.35rem;
  text-align: center;
}

/* ---------- shared form elements (admin, future order form) ---------- */

.field { margin-bottom: calc(var(--space) * 0.75); max-width: 28rem; }

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.field input,
.field select,
.field textarea,
.home-section input,
.home-section select,
.home-section textarea {
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--color-card-edge);
  border-radius: 6px;
  font: inherit;
  background: var(--color-surface);
  color: var(--color-ink);
}

.field input,
.field select,
.field textarea { width: 100%; }

.field textarea {
  min-height: 6rem;
  resize: vertical;
}

/* Contact form: per-topic fieldsets (JS toggles [hidden]) + honeypot. */
.contact-extra {
  border: 0;
  padding: 0;
  margin: 0 0 calc(var(--space) * 0.5);
}

.contact-extra[hidden] { display: none; }

.hp { display: none !important; }

/* Contact form banners (server-rendered error / success). */
.form-err,
.form-ok {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid;
  max-width: 40rem;
}

.form-err {
  color: #7f1d1d;
  background: #fef2f2;
  border-color: #fecaca;
}

.form-ok {
  color: #14532d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.home-section button {
  font: inherit;
  padding: 0.4rem 1rem;
  border: 1px solid var(--color-card-edge);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
}

.home-section button:hover { border-color: var(--color-accent); }
