/* --- modern reset (subset of Andy Bell's; scoped to what most pages need) --- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, blockquote, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; }
img, picture, video, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* --- base typography --- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Dark theme with gold accents — inspired by jeweler aesthetic */
  --color-bg: #0d0d0d;
  --color-fg: #e8e8e8;
  --color-muted: #9d8b7e;
  --color-accent: #d4af37;
  --color-accent-dark: #b8941a;
  --color-rule: #2a2a2a;
  --color-surface: #1a1a1a;
  --max-w: 1200px;

  /* Optional "framed page" pattern. Set --max-w-page to a value like
     1920px and pick a contrasting --page-frame-bg (e.g. #000) to render
     the body as a capped wrapper with a colored frame on wider viewports.
     Defaults are no-ops so the starter looks blank out of the box. */
  --max-w-page:    none;
  --page-frame-bg: var(--color-bg);
}

html { font-family: var(--font-sans); color: var(--color-fg); background: var(--page-frame-bg); line-height: 1.55; }
body {
  max-width: var(--max-w-page);
  margin-inline: auto;
  padding: 2rem 1rem;
  background: var(--color-bg);
  overflow-x: clip; /* contain any full-bleed children inside the wrapper */
}

/* --- centred content column --- */
.container { max-width: var(--max-w); margin-inline: auto; }

/* --- structure --- */
.site-header,
.site-footer { padding-block: 1rem; }
.site-footer { color: var(--color-muted); font-size: 0.875rem; border-top: 1px solid var(--color-rule); margin-top: 3rem; padding-top: 1.25rem; }

.site-nav ul {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  width: 100%;
}

.site-nav li:nth-child(3) {
  text-align: center;
  grid-column: 3;
}

.site-nav li:nth-child(1),
.site-nav li:nth-child(2) {
  text-align: left;
}

.site-nav li:nth-child(4),
.site-nav li:nth-child(5) {
  text-align: right;
}

.site-nav a { text-decoration: none; color: var(--color-muted); transition: color 0.2s ease; }
.site-nav a:hover { color: var(--color-accent); }

main { padding-block: 2rem; }

/* --- prose --- */
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; margin-top: 2rem; }
h3 { font-size: 1.125rem; margin-top: 1.5rem; }
p, ul, ol, blockquote { margin-block: 0.75rem; }
ul, ol { padding-left: 1.25rem; }
blockquote { border-left: 3px solid var(--color-accent); padding-left: 1rem; color: var(--color-muted); }
code { font-family: var(--font-mono); font-size: 0.9em; background: var(--color-surface); padding: 0.1em 0.3em; border-radius: 3px; color: var(--color-accent); }
pre { background: var(--color-surface); padding: 1rem; border-radius: 4px; overflow-x: auto; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--color-rule); margin-block: 2rem; }
a { color: var(--color-accent); }

/* --- archive list --- */
.archive-list { list-style: none; }
.archive-item { padding-block: 0.75rem; border-bottom: 1px solid var(--color-rule); }
.archive-item:last-child { border-bottom: 0; }
.archive-item a { text-decoration: none; font-weight: 500; color: var(--color-accent); transition: color 0.2s ease; }
.archive-item a:hover { color: var(--color-accent-dark); }
.archive-meta { color: var(--color-muted); font-size: 0.875rem; }

/* --- pagination --- */
.pagination { display: flex; gap: 1rem; align-items: center; margin-top: 2rem; font-size: 0.9rem; }
.pagination a { text-decoration: none; color: var(--color-accent); transition: color 0.2s ease; }
.pagination a:hover { color: var(--color-accent-dark); }

/* --- content images ---
   The reset already sets `max-width: 100%; height: auto` so the browser
   scales images down proportionally to fit the column without stretching.
   These rules add the visual treatment: centered placement, vertical
   breathing room, and rounded corners. We deliberately don't force a
   width — small icons or graphics shouldn't be upscaled and blurred. */
article img,
.prose img,
figure img { margin-inline: auto; margin-block: 1.5rem; border-radius: 6px; }

figure { margin-block: 1.5rem; }
figure img { margin-block: 0; }
figcaption { text-align: center; font-size: 0.875rem; color: var(--color-muted); margin-top: 0.5rem; }

.post-featured { margin-block: 1.5rem; }
.post-featured img { margin: 0; }

/* --- contact form (rendered by `contact_form()` Twig helper) ---
   Minimal styling for the bundled contact template. Themes that want
   something fancier can replace the `.fp-form*` rules or stop using the
   helper and roll their own markup against the same /submit/<form>
   endpoint. */
.fp-form { display: grid; gap: 1rem; max-width: 36rem; }
.fp-form__row { display: grid; gap: 0.25rem; font-size: 0.875rem; }
.fp-form__row span { font-weight: 500; color: var(--color-fg); }
.fp-form__row input,
.fp-form__row textarea,
.fp-form__row select {
  font: inherit;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-rule);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-fg);
}
.fp-form__row input:focus,
.fp-form__row textarea:focus,
.fp-form__row select:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: -1px;
  border-color: transparent;
}
.fp-form__row textarea { min-height: 8rem; resize: vertical; }
.fp-form__cb { display: flex; gap: 0.5rem; align-items: center; font-size: 0.875rem; }
.fp-form button[type="submit"] {
  align-self: start;
  padding: 0.5rem 1.25rem;
  border: 0;
  border-radius: 6px;
  background: var(--color-accent);
  color: #000;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.fp-form button[type="submit"]:hover { background: var(--color-accent-dark); }
.fp-form__status {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.fp-form__status--ok  { background: #1a3a2a; color: #7ee8a6; border: 1px solid #4a7a66; }
.fp-form__status--err { background: #3a1a1a; color: #f89a9a; border: 1px solid #8a4a4a; }

/* --- error page (404, etc) --- */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 3rem;
  text-align: center;
}

.error-hero {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.error-code {
  font-size: 5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-accent), var(--color-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.1em;
  margin: 0;
}

.error-title {
  font-size: 2rem;
  color: var(--color-fg);
  margin: 0;
}

.error-message {
  font-size: 1.1rem;
  color: var(--color-muted);
  margin: 0.5rem 0 0;
}

.error-path {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: 1rem;
}

.error-path code {
  background: var(--color-surface);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--color-accent);
}

.error-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.error-link {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border: 2px solid var(--color-accent);
  border-radius: 6px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  background: transparent;
}

.error-link:hover {
  background: var(--color-accent);
  color: #000;
}

.error-link.secondary {
  border-color: var(--color-muted);
  color: var(--color-muted);
}

.error-link.secondary:hover {
  background: var(--color-muted);
  color: var(--color-bg);
  border-color: var(--color-muted);
}
