/* Billy Gibb — shared styles for index.html and prints.html */

@font-face {
  font-family: "Courier Prime";
  src: url(fonts/courier-prime-400.woff2) format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url(fonts/courier-prime-400-italic.woff2) format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --white: #FFFFFF;
  --ink: #2A2A28;          /* typewriter ink */
  --red: #C0221B;          /* the red half of a typewriter ribbon */
  --grey: #6F6F6B;
  --wash: #F3F3F1;         /* shown while a photo loads */
  --type: "Courier Prime", "Courier New", Courier, monospace;
  --gutter: clamp(18px, 3.6vw, 56px);
  --maxw: 1560px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font-family: var(--type); font-size: 15px; line-height: 1.6; font-weight: 400;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--red); color: var(--white); }
:focus-visible { outline: 1px solid var(--red); outline-offset: 4px; }
.wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- The two words at the top ---------- */
.top { position: sticky; top: 0; z-index: 10; background: var(--white); }
.top .wrap { display: flex; justify-content: space-between; align-items: baseline; padding-block: 16px 14px; }
.name { color: var(--red); font-size: 15px; letter-spacing: 0.01em; }
.toplink { font-size: 15px; }
.toplink:hover, .toplink[aria-current="page"] { color: var(--red); }

/* ---------- Collage ---------- */
.collage { padding-top: clamp(36px, 9vh, 110px); }
.row {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(14px, 2.4vw, 40px);
  align-items: start; margin-bottom: clamp(56px, 7vw, 120px);
}
.ph { display: block; grid-row: 1; width: 100%; cursor: zoom-in; background: var(--wash); }
.ph img { width: 100%; height: auto; opacity: 0; transition: opacity .7s ease; }
.ph img.is-in { opacity: 1; }
.ph.end { align-self: end; }
@media (prefers-reduced-motion: reduce) { .ph img { transition: none; } }

/* ---------- About, at the foot of the home page ---------- */
.about { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(14px, 2.4vw, 40px); padding-top: clamp(20px, 4vw, 60px); }
.about__text { grid-column: 2 / 8; max-width: 52ch; }
.about__text p + p { margin-top: 1.1em; }
.about__open { margin-top: 2.4em !important; }
.about__contact { margin-top: 0.4em; display: flex; flex-wrap: wrap; gap: 4px 28px; }
.about__contact a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.about__contact a:hover { color: var(--red); }
.about__roll { grid-column: 10 / 13; align-self: end; }
.about__roll img { width: 100%; height: auto; }

.foot { padding-block: clamp(80px, 10vw, 140px) 28px; font-size: 12.5px; color: var(--grey); }

/* ---------- Prints page ---------- */
.intro { padding-top: clamp(36px, 9vh, 110px); max-width: 54ch; }
.intro p + p { margin-top: 1.1em; }
.prints { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(72px, 9vw, 140px) clamp(28px, 6vw, 110px); margin-top: clamp(64px, 9vw, 130px); }
.print__img { display: block; background: var(--wash); }
.print__img img { width: 100%; height: auto; opacity: 0; transition: opacity .7s ease; }
.print__img img.is-in { opacity: 1; }
.print.is-portrait .print__img { width: 45%; }  /* same height as a landscape beside it */
.print { scroll-margin-top: 70px; }
.print h2 { margin: 18px 0 10px; font-size: 15px; font-weight: 400; color: var(--red); }
.sizes { width: 100%; max-width: 460px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sizes td { padding: 3px 18px 3px 0; white-space: nowrap; }
.sizes td:last-child { padding-right: 0; text-align: right; width: 100%; }
.buy { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.buy:hover { color: var(--red); }
.soon { color: var(--grey); }
.is-sold td:not(:last-child) { color: var(--grey); text-decoration: line-through; }
.notes { margin-top: clamp(90px, 11vw, 160px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px clamp(28px, 6vw, 110px); max-width: 1100px; }
.notes h3 { margin: 0 0 4px; font-size: 15px; font-weight: 400; color: var(--red); }
.notes p { color: var(--ink); }
.ask { margin-top: clamp(60px, 8vw, 110px); }
.ask a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ask a:hover { color: var(--red); }

/* ---------- Viewer ---------- */
dialog { border: 0; padding: 0; color: var(--ink); }
dialog::backdrop { background: var(--white); }
.viewer { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; background: var(--white); }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
@media (prefers-reduced-motion: no-preference) { .viewer[open] { animation: fade .25s ease-out; } }
@keyframes fade { from { opacity: 0; } }
.viewer__bar { display: flex; justify-content: space-between; align-items: baseline; padding: 16px var(--gutter) 14px; }
.viewer__fig { margin: 0; min-height: 0; display: grid; place-items: center; padding: 0 var(--gutter); }
.viewer__fig img { max-width: 100%; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); width: auto; height: auto; cursor: e-resize; }
.viewer__cap { display: flex; justify-content: space-between; gap: 20px; padding: 14px var(--gutter) 18px; min-height: 52px; }
.viewer__cap a { text-decoration: underline; text-underline-offset: 3px; }
.viewer__cap a:hover, .viewer button:hover { color: var(--red); }
.count { color: var(--grey); }

.thanks { max-width: min(480px, calc(100vw - 32px)); padding: 30px; background: var(--white); border: 1px solid var(--ink); }
.thanks::backdrop { background: rgba(255,255,255,.92); }
.thanks h2 { margin: 0 0 10px; font-size: 15px; font-weight: 400; color: var(--red); }
.thanks p { margin-bottom: 20px; }
.thanks button { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .row { display: block; margin-bottom: 0; }
  .ph { margin-bottom: 52px; }
  .ph.is-portrait { width: 72%; }
  .ph.is-landscape.is-small { width: 82%; }
  .ph.push { margin-left: auto; }
  .about { display: block; }
  .about__roll { width: 46%; margin-top: 48px; }
  .prints { grid-template-columns: minmax(0, 1fr); }
  .print.is-portrait .print__img { width: 70%; }
  .notes { grid-template-columns: minmax(0, 1fr); }
}
