/* Tashina Knight · site styles
   A slate-blue room, bright paintings, one marigold accent.
   Contrast (WCAG): ink on page 6.3:1, muted on page 5.3:1, marigold on page 3.9:1
   (large text and UI only), ink on marigold buttons 8.2:1. */

:root {
  color-scheme: dark;
  --bg: #3e5d82;          /* page */
  --bg-glow: #4d6f97;     /* soft lighter wash at the top */
  --bg-band: #22385a;     /* stripe pane, footer */
  --card: #33506f;        /* placeholder behind loading images */
  --viewer: rgba(14, 23, 40, 0.97); /* large view: darker so the art pops */
  --ink: #f4f7fc;
  --muted: #dbe4f1;
  --ink-on-accent: #172a45;
  --line: rgba(244, 247, 252, 0.22);
  --came: #f4f7fc;

  --accent: #ffb547;      /* marigold: the one accent */

  /* Art-glass stripe colors (fixed) */
  --g1: #ff8a2a;  /* tangerine */
  --g2: #ffd23f;  /* sun */
  --g3: #ff4f9a;  /* pink */
  --g4: #1fd6c4;  /* teal */
  --g5: #b9f23c;  /* lime */

  --display: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;

  --gutter: 16px;
  --gap: 18px;
  --max: 1520px;
}

@media (min-width: 700px) { :root { --gutter: 32px; --gap: 26px; } }
@media (min-width: 1100px) { :root { --gutter: 48px; --gap: 32px; } }

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(110% 50% at 50% -8%, var(--bg-glow) 0%, rgba(77, 111, 151, 0) 65%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  background: var(--ink); color: var(--ink-on-accent); padding: 8px 14px; font-family: var(--display); font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}
.skip:focus { top: 8px; }

/* ---------- Art-glass stripe (Frank Lloyd Wright window, by way of a beach towel) */
.band { display: block; width: 100%; height: 40px; }
#glass .pane { fill: var(--bg-band); }
#glass .g1 { fill: var(--g1); }
#glass .g2 { fill: var(--g2); }
#glass .g3 { fill: var(--g3); }
#glass .g4 { fill: var(--g4); }
#glass .g5 { fill: var(--g5); }
#glass .came line { stroke: var(--came); stroke-width: 1.4; opacity: .5; }

/* ---------- Masthead: a header, not a billboard */
.masthead-inner {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 32px;
  padding-top: clamp(22px, 4vw, 40px); padding-bottom: clamp(16px, 2.6vw, 24px);
}
.title-block { min-width: 0; }

.name {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  font-size: clamp(2.1rem, 6.4vw, 3.4rem);
  line-height: .95;
  letter-spacing: .035em;
}
.name .first { color: var(--ink); }
.name .last { color: var(--accent); }

.tagline {
  margin: 6px 0 0;
  font-style: italic;
  color: var(--muted);
  font-size: clamp(.98rem, 2.2vw, 1.12rem);
}

.nav { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.nav a {
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
  font-size: 1rem; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { border-bottom-color: var(--accent); }

/* ---------- Gallery: masonry via grid row spans (spans are set by site.js) */
.work { padding-top: clamp(24px, 4.5vw, 52px); padding-bottom: clamp(40px, 7vw, 90px); }

.gallery {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 4px;
  grid-auto-flow: row dense; /* fill the shortest column first, like a real masonry wall */
  column-gap: var(--gap);
}
@media (min-width: 560px)  { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1700px) { .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.gallery > li { grid-row-end: span 80; min-width: 0; }
.tile-inner { padding-bottom: var(--gap); }

.tile { display: block; text-decoration: none; color: inherit; }

.frame {
  position: relative;
  aspect-ratio: var(--ar, 4 / 5);
  background: var(--card);
  box-shadow: 0 16px 34px -16px rgba(10, 18, 34, .75), 0 3px 8px -3px rgba(10, 18, 34, .5);
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s;
}
.frame img { width: 100%; height: 100%; object-fit: contain; }

.tile:hover .frame, .tile:focus-visible .frame { transform: translateY(-3px); box-shadow: 0 24px 46px -18px rgba(10, 18, 34, .85), 0 0 0 3px var(--accent); }
.tile:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) { .frame { transition: none; } .tile:hover .frame { transform: none; } }

.cap { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 10px; }
.cap .t { font-style: italic; font-size: 1.06rem; line-height: 1.3; }
.cap .y { font-family: var(--display); font-weight: 600; letter-spacing: .1em; color: var(--muted); font-size: .95rem; white-space: nowrap; }

/* Missing image: a patterned card with the title rather than a broken icon */
.frame.missing { aspect-ratio: 4 / 3; display: grid; place-items: center; background:
  repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 10px, transparent 10px 20px), var(--card); }
.frame.missing::after { content: "Image coming soon"; font-family: var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.frame.missing img { display: none; }

.noscript { color: var(--muted); }

/* ---------- Section headings */
.section-h {
  margin: 0 0 14px;
  font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
  font-size: clamp(2rem, 5.5vw, 2.8rem); line-height: 1;
}

/* ---------- About */
.about {
  display: grid; gap: 28px;
  padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(40px, 7vw, 80px);
  border-top: 1px solid var(--line);
}
@media (min-width: 800px) { .about { grid-template-columns: 240px minmax(0, 62ch); gap: 56px; align-items: start; } }

.about-photo { max-width: 215px; }
.about-photo img { box-shadow: 10px 10px 0 var(--accent), 0 18px 40px -18px rgba(10,18,34,.8); }

.about p { margin: 0 0 1em; }
.about .lede { font-size: 1.2rem; line-height: 1.5; }
.about .small { color: var(--muted); font-size: .98rem; }
.about cite { font-style: italic; color: var(--ink); }

.button {
  display: inline-block; margin-top: 8px; padding: 12px 18px;
  font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 1rem;
  text-decoration: none; color: var(--ink-on-accent); background: var(--accent);
  border: 0; border-radius: 2px; cursor: pointer; transition: transform .2s;
}
.button:hover { transform: translateY(-2px); }
.button[disabled] { opacity: .65; cursor: progress; transform: none; }

/* ---------- Contact */
.contact {
  display: grid; gap: 20px;
  padding-top: clamp(40px, 7vw, 80px); padding-bottom: clamp(48px, 8vw, 100px);
  border-top: 1px solid var(--line);
}
@media (min-width: 800px) { .contact { grid-template-columns: 240px minmax(0, 62ch); gap: 56px; align-items: start; } }
.contact-intro { color: var(--muted); margin: 0; }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: .95rem; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: rgba(14, 23, 40, .28);
  border: 1px solid rgba(244, 247, 252, .45); border-radius: 3px;
  padding: 11px 12px;
}
.field textarea { min-height: 9.5em; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status { margin: 0; min-height: 1.6em; }
.form-status.ok { color: var(--ink); }
.form-status.ok::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.form-status.err { color: var(--ink); }
.form-status.err::before { content: "! "; color: var(--accent); font-weight: 700; }
.form-status a { text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* Messages for visitors without JavaScript (contact.php redirects to #sent / #not-sent) */
.flash { display: none; margin: 0; padding: 12px 14px; border-left: 4px solid var(--accent); background: rgba(14, 23, 40, .28); }
.flash:target { display: block; }

/* ---------- Footer */
.footer { background: var(--bg-band); }
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px;
  padding-top: 18px; padding-bottom: max(26px, env(safe-area-inset-bottom));
  color: var(--muted); font-size: .95rem;
}
.footer-inner p { margin: 0; }
.footer-inner a { text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* ---------- Viewer (large view) */
.viewer {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--viewer); color: var(--ink);
  overflow: hidden;
}
.viewer[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-columns: 100%;
}
.viewer::backdrop { background: rgba(14, 23, 40, .85); }

.viewer-stage {
  display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden;
  padding: 60px 12px 10px;
  touch-action: pan-y pinch-zoom;
}
.viewer-stage img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.9);
  transition: opacity .25s ease;
}
.viewer-stage img.swapping { opacity: 0; }

.viewer-caption { text-align: center; padding: 8px var(--gutter) 0; }
.viewer-caption h2 { margin: 0; font-weight: 400; font-style: italic; font-size: clamp(1.35rem, 3.4vw, 1.9rem); line-height: 1.2; }
.viewer-caption .meta { margin: 4px 0 0; font-family: var(--display); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-size: .98rem; }
.viewer-caption .note { margin: 8px auto 0; max-width: 60ch; color: var(--muted); font-size: .98rem; }
.viewer-caption .meta:empty, .viewer-caption .note:empty { display: none; }

.viewer-controls { display: flex; align-items: center; justify-content: center; gap: 22px; padding: 12px 0 max(16px, env(safe-area-inset-bottom)); }
.count { font-family: var(--display); font-weight: 600; letter-spacing: .14em; color: var(--muted); min-width: 4.5em; text-align: center; }

.vbtn {
  appearance: none; border: 1px solid rgba(244,247,252,.3); background: rgba(255,255,255,.05); color: var(--ink);
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; transition: background .2s, border-color .2s;
}
.vbtn:focus-visible { border-radius: 50%; }
.vbtn:hover { background: var(--accent); border-color: var(--accent); color: var(--ink-on-accent); }
.vbtn.close { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); font-size: 1.8rem; }

@media (min-width: 900px) {
  .viewer-stage { padding: 40px 96px 10px; }
  .viewer .prev, .viewer .next { position: absolute; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; }
  .viewer .prev { left: 24px; }
  .viewer .next { right: 24px; }
  .viewer-controls { padding-top: 6px; }
}

body.viewer-open { overflow: hidden; }
