/* Sarah Ratchye — site styles. Colors and fonts live in the variables below. */
:root {
  --bg: #f6f5f3;
  --text: #222;
  --muted: #777;
  --line: #ddd;
  --accent: #222;
  --dark-bg: #0b0b0b;
  --dark-text: #f2f2f2;
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding: 0 var(--gutter) 64px; width: 100%; max-width: 1400px; margin: 0 auto; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- header & menu ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 22px var(--gutter);
  max-width: 1400px; width: 100%; margin: 0 auto;
}
.site-name { font-size: 22px; font-weight: 700; letter-spacing: .01em; text-decoration: none; }
nav ul { list-style: none; margin: 0; padding: 0; }
#site-nav > ul { display: flex; gap: 28px; }
#site-nav a { text-decoration: none; font-size: 15px; color: var(--muted); }
#site-nav a:hover, #site-nav a[aria-current] { color: var(--text); }
#site-nav a[aria-current] { border-bottom: 1px solid currentColor; }
.has-sub { position: relative; }
.sub {
  display: none; position: absolute; top: 100%; left: -16px; z-index: 10;
  background: var(--bg); padding: 12px 16px; min-width: 190px;
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
}
.sub li { padding: 4px 0; }
.has-sub:hover .sub, .has-sub:focus-within .sub { display: block; }
.menu-toggle { display: none; }

@media (max-width: 760px) {
  .site-header { flex-wrap: wrap; }
  .menu-toggle {
    display: block; background: none; border: 1px solid var(--line); color: inherit;
    font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 4px;
  }
  #site-nav { display: none; width: 100%; }
  #site-nav.open { display: block; }
  #site-nav > ul { flex-direction: column; gap: 10px; padding: 8px 0; }
  .sub { display: block; position: static; box-shadow: none; padding: 6px 0 0 16px; background: none; }
  #site-nav a { font-size: 17px; }
}

/* ---------- page titles & text ---------- */
.page-title { font-size: 28px; font-weight: 400; margin: 24px 0 32px; letter-spacing: .01em; }
.prose { max-width: 760px; }
.prose h2 { font-size: 19px; font-weight: 600; margin: 40px 0 12px; }
.prose p { margin: 0 0 16px; }
.prose ul { list-style: none; padding: 0; margin: 0; }
.prose li { padding: 5px 0; border-bottom: 1px solid var(--line); }
.prose li strong { display: inline-block; min-width: 68px; font-weight: 600; }

/* ---------- galleries ---------- */
/* Justified rows: order runs left to right, nothing is cropped,
   every image in a row shares a height (--row). --r is width/height, set per artwork. */
.gallery { --row: 280px; display: flex; flex-wrap: wrap; gap: 36px 28px; }
.gallery::after { content: ""; flex-grow: 999; }
.gallery figure { margin: 0; flex: calc(var(--r) * 100) 1 calc(var(--r) * var(--row)); max-width: calc(var(--r) * var(--row) * 1.6); }
.gallery img { width: 100%; aspect-ratio: var(--r); object-fit: contain; background: #e9e7e4; }
@media (max-width: 760px) { .gallery { --row: 190px; gap: 28px 16px; } }
@media (max-width: 420px) { .gallery figure { flex-basis: 100%; max-width: none; } }
.zoom { display: block; cursor: zoom-in; }
figcaption, .hero-caption { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
figcaption .title, .hero-caption .title { font-style: italic; color: var(--text); }
figcaption .details::before, .hero-caption .details::before { content: ", "; }
.sold { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #a33; margin-left: 4px; }

/* ---------- artwork index ---------- */
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 36px; }
.album-card { text-decoration: none; }
.album-card img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.album-card span { display: block; margin-top: 10px; font-size: 17px; }
.album-card small { color: var(--muted); }
.album-card .subtitle { font-style: normal; color: var(--muted); margin-left: 4px; }

/* ---------- dark home page ---------- */
body.dark { background: var(--dark-bg); color: var(--dark-text); }
body.dark .sub { background: #161616; }
body.dark #site-nav a { color: #9a9a9a; }
body.dark #site-nav a:hover { color: var(--dark-text); }
body.dark .site-header .site-name { visibility: hidden; }
body.dark .site-footer { border-color: #222; }
.hero { text-align: center; }
.hero h1 { font-size: clamp(40px, 8vw, 84px); font-weight: 700; margin: 8px 0 28px; letter-spacing: .01em; }
.hero img { margin: 0 auto; max-height: 72vh; width: auto; }
.hero-caption { margin-top: 14px; }
body.dark .hero-caption .title { color: #ccc; }

/* ---------- footer ---------- */
.site-footer {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 24px var(--gutter); font-size: 13px; color: var(--muted);
  max-width: 1400px; width: 100%; margin: 0 auto; border-top: 1px solid var(--line);
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(12,12,12,.96); color: #eee;
  display: none; flex-direction: column; align-items: center; justify-content: center; padding: 56px 16px 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 150px); width: auto; height: auto; }
.lightbox .lb-caption { font-size: 14px; margin-top: 14px; text-align: center; color: #bbb; max-width: 800px; }
.lightbox .lb-caption .title { color: #fff; font-style: italic; }
.lightbox .lb-caption .details::before { content: ", "; }
.lightbox button {
  position: absolute; background: none; border: 0; color: #ccc; font: 300 40px/1 var(--font);
  cursor: pointer; padding: 12px 16px;
}
.lightbox button:hover { color: #fff; }
.lb-close { top: 4px; right: 8px; font-size: 34px !important; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; top: 18px; left: 20px; font-size: 13px; color: #888; }
