/* site.css — shared design system for Diana's Paintings
   Used by index.html and gallery.html. gallery.css layers on top.
   Reusable classes for other pages: .site-header, .site-nav, .container,
   .btn, .btn-primary, .chip, .chip.is-active, .chip-row, .eyebrow,
   .notice, .notice-error, .spinner, .visually-hidden */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;1,500&family=Inter:wght@400;500;600&display=swap');

:root {
  /* colour: a warm gallery wall */
  --ground: #f6f2ea;
  --ground-2: #efe9dd;
  --surface: #fffdf8;
  --ink: #2b2a27;
  --ink-2: #5d5a53;
  --ink-3: #8b877e;
  --line: #e2dbcd;
  --accent: #9a5b3c;          /* burnt sienna */
  --accent-2: #b8785a;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(43, 42, 39, .06), 0 8px 24px rgba(43, 42, 39, .08);
  --shadow-lg: 0 2px 4px rgba(43, 42, 39, .08), 0 18px 40px rgba(43, 42, 39, .14);

  /* type */
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.375rem;
  --fs-xl: clamp(1.75rem, 1.2rem + 2vw, 2.5rem);
  --fs-2xl: clamp(2.25rem, 1.5rem + 3.5vw, 3.75rem);

  /* spacing + shape */
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4.5rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max-w: 1280px;
  --radius: 6px;
  --radius-lg: 10px;
  --ease: 220ms cubic-bezier(.2, .7, .2, 1);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .15em; }
a:hover { color: var(--accent-2); }
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: .005em;
  margin: 0 0 var(--sp-3);
  color: var(--ink);
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--sp-4); }
p.lede { font-size: var(--fs-lg); font-family: var(--font-display); color: var(--ink-2); max-width: 42ch; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--sp-2);
}
.muted { color: var(--ink-2); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* ---------- header ---------- */
.site-header {
  background: var(--ground);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 4.25rem;
  padding-block: var(--sp-3);
}
.site-title {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.site-title:hover { color: var(--accent); }
.site-nav { display: flex; gap: var(--sp-1); flex-wrap: wrap; justify-content: flex-end; }
.site-nav a {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  transition: background var(--ease), color var(--ease);
}
.site-nav a:hover { color: var(--ink); background: var(--ground-2); }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--fs-xs);
  padding-block: var(--sp-5);
  margin-top: var(--sp-8);
}
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.footer-admin { min-height: 2rem; padding: .3rem .75rem; font-size: var(--fs-xs); color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 2.5rem;
  padding: .5rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
}
.btn:hover { background: var(--ground-2); border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--ground-2); border-color: transparent; }
.btn-icon { padding: .5rem; width: 2.5rem; }

/* ---------- chips (filter pills) ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 2rem;
  padding: .3rem .85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-active, .chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}
.chip .chip-count { font-size: var(--fs-xs); opacity: .7; }

/* ---------- notices / states ---------- */
.notice {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  max-width: 44rem;
  color: var(--ink-2);
}
.notice h2, .notice h3 { margin-bottom: var(--sp-2); }
.notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .9em;
  background: var(--ground-2);
  padding: .1em .4em;
  border-radius: 4px;
  color: var(--ink);
}
.notice-error { border-color: var(--accent-2); }
.state-loading { display: flex; align-items: center; gap: var(--sp-3); color: var(--ink-3); padding-block: var(--sp-6); }
.spinner {
  width: 1.25rem; height: 1.25rem; flex: none;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  .site-header .container { min-height: 3.75rem; }
  .site-title { font-size: 1.375rem; }
  .site-nav a { padding: var(--sp-2); }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .spinner { border-top-color: var(--line); }
}
