/* Estuary Paper Co. Gallery-wall presentation: each print is shown matted
   on a warm paper-toned wall. Colors come from the logo: navy ink on cream. */

:root {
  --wall: #F1ECE3;
  --mat: #FFFFFF;
  --navy: #2D4A68;
  --ink: #26323F;
  --muted: #5F6B78;
  --rule: #DBD3C6;
  --shadow: 45, 74, 104;
  --serif: "Spectral", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}

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

body.shop-body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.shop-body a { color: inherit; }
.shop-body a:focus-visible,
.shop-body .buy:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }

/* Header: logo centered, like a letterhead */
.site-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 40px var(--gutter) 28px;
  max-width: 1280px;
  margin: 0 auto;
}
.wordmark {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
}
.wordmark img { display: block; height: clamp(40px, 5vw, 60px); width: auto; max-width: 100%; }
.site-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 2rem; font-size: .95rem; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--navy); }

main.shop-main { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter) 96px; }

/* Intro */
.intro {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
  line-height: 1.35;
  font-weight: 400;
  max-width: 34ch;
  margin: 20px auto 80px;
  text-align: center;
  color: var(--ink);
}

/* The wall: pieces hang on a shared center line */
.wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 72px clamp(24px, 4vw, 64px);
}
.piece { text-decoration: none; display: block; }
/* The white mat is drawn on the image itself (background + padding), so the
   image only ever sizes against its column. Wrapping it in a separate box
   made Safari on iPhone keep the image at full size. */
.mat {
  --pad: clamp(12px, 1.6vw, 20px);
  display: block;
  box-sizing: content-box;
  background: var(--mat);
  padding: var(--pad);
  box-shadow: 0 1px 2px rgba(var(--shadow), .10), 0 14px 28px -16px rgba(var(--shadow), .40);
  width: auto;
  height: auto;
  max-width: calc(100% - 2 * var(--pad));
}
.hang {
  --hang: clamp(300px, 30vw, 420px);
  height: var(--hang);
  display: flex;
  align-items: center;
  justify-content: center;
}
.hang .mat { min-width: 0; max-height: calc(var(--hang) - 2 * var(--pad)); }

.label { margin-top: 22px; text-align: center; }
.label-title { font-family: var(--serif); font-style: italic; font-size: 1.15rem; margin: 0; }
.piece:hover .label-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.label-meta { color: var(--muted); font-size: .9rem; margin: 2px 0 0; }

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

/* About + footer */
.about {
  border-top: 1px solid var(--rule);
  margin-top: 112px;
  padding-top: 40px;
  display: grid;
  gap: 1rem 4rem;
  grid-template-columns: 1fr;
}
@media (min-width: 800px) { .about { grid-template-columns: 1fr 2fr; } }
.about h2 { color: var(--navy); font-family: var(--serif); font-weight: 500; font-size: 1.35rem; margin: 0; }
.about p { margin: 0 0 1rem; max-width: 60ch; line-height: 1.65; }

.site-foot {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px var(--gutter) 40px;
  color: var(--muted);
  font-size: .85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Detail */
.back { display: inline-block; margin: 8px 0 32px; color: var(--muted); text-decoration: none; font-size: .95rem; }
.back:hover { color: var(--ink); }
.detail { display: grid; gap: 48px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .detail { grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); gap: 72px; } }
.detail-wall { display: block; }
.detail-wall .mat { --pad: clamp(14px, 2.4vw, 32px); margin: 0 auto; }
/* Desktop: fit the whole print on screen beside its details.
   Phones: let it use the full width; people scroll. */
@media (min-width: 900px) {
  .detail-wall .mat { max-height: min(calc(100vh - 340px), 820px); }
}

.placard h1 {
  color: var(--navy);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 .5rem;
}
.placard .by { margin: 0; }
.placard .medium { color: var(--muted); margin: 0; }
.placard .desc { font-family: var(--serif); font-size: 1.1rem; line-height: 1.6; margin: 1.5rem 0 0; max-width: 46ch; }

.sizes { list-style: none; padding: 0; margin: 2rem 0 1.25rem; border-top: 1px solid var(--rule); }
.sizes li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}
.size-name { font-weight: 500; }
.size-ed { display: block; color: var(--muted); font-size: .88rem; }
.size-price { font-variant-numeric: tabular-nums; text-align: right; min-width: 3.5rem; }
.buy, .unavailable {
  display: inline-block;
  width: 8.5rem;
  text-align: center;
  padding: 10px 18px;
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: 2px;
}
.shop-body .buy { background: var(--navy); color: #fff; border: 1px solid var(--navy); }
.shop-body .buy:hover { background: #213851; border-color: #213851; }
.unavailable { color: var(--muted); border: 1px solid var(--rule); }
.fine { color: var(--muted); font-size: .9rem; margin: 0 0 .5rem; max-width: 46ch; }

/* Thanks */
.thanks { max-width: 40rem; padding: 48px 0; }
.thanks h1 { color: var(--navy); font-family: var(--serif); font-weight: 400; font-size: clamp(1.9rem, 3.2vw, 2.6rem); margin: 0 0 1rem; }
.thanks p { font-size: 1.05rem; line-height: 1.65; }

@media (max-width: 560px) {
  .site-head { padding-top: 20px; padding-bottom: 20px; }
  .intro { margin-bottom: 48px; }
  .wall { gap: 56px; }
  .buy, .unavailable { width: 7.5rem; padding: 10px 8px; }
}

/* Below ~685px the wall is one column: no shared hanging line to keep,
   so each print takes its natural height. */
@media (max-width: 685px) {
  .hang { height: auto; }
  .hang .mat { max-height: min(115vw, 460px); }
}
