/* spencerthielmann.com — shared styles */

/* Fonts are self-hosted (both are free, open-licensed). To switch the whole
   site between Garamond and Baskerville, change --serif below. */
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("fonts/libre-baskerville-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("fonts/libre-baskerville-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Libre Baskerville"; src: url("fonts/libre-baskerville-latin-700-normal.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }

:root {
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --bg: #faf8f3;
  --ink: #1f1d1a;
  --muted: #6f6a62;
  --rule: #e2ddd2;
  --card: #ece7dc;
  --measure: 640px;
  --pad: 24px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s, color 0.15s;
}
a:hover { text-decoration-color: currentColor; }

img { display: block; max-width: 100%; height: auto; }

.page {
  max-width: calc(var(--measure) + var(--pad) * 2);
  margin: 0 auto;
  padding: 48px var(--pad) 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* Header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 72px;
}
.site-header .name { font-size: 22px; font-weight: 500; text-decoration: none; }
.site-header nav { display: flex; gap: 22px; font-size: 18px; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover,
.site-header nav a[aria-current="page"] { color: var(--ink); }

/* Headings */
h1, h2 { font-weight: 500; line-height: 1.2; }
h1 { font-size: 34px; }
h2 { font-size: 26px; margin-bottom: 18px; }

.muted { color: var(--muted); }
.small { font-size: 16px; }

p + p { margin-top: 0.8em; }

section + section { margin-top: 72px; }

/* ---------- Books ---------- */

.book + .book { margin-top: 96px; padding-top: 96px; border-top: 1px solid var(--rule); }

/* Books page is wider so the cover can be large */
.page-wide { --measure: 1000px; }

.book {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 48px;
  align-items: start;
}

.cover-wrap { grid-column: 1; grid-row: 1; }
.book-text { grid-column: 2; grid-row: 1 / span 2; }

/* Jocie and Stormi, under the cover */
.book-art {
  grid-column: 1;
  grid-row: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  align-self: start;
  margin-top: 40px;
}
.book-art figure:first-child { width: 54%; }
.book-art figure:last-child { width: 40%; }
.book-art img { width: 100%; }
.book-art figcaption { margin-top: 6px; text-align: center; font-size: 15px; font-style: italic; color: var(--muted); }

.cover {
  aspect-ratio: 2 / 3;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08), 0 14px 30px -14px rgba(0,0,0,0.4);
  overflow: hidden;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  font-style: italic;
  color: var(--muted);
}

.byline { margin-top: 8px; font-size: 21px; font-style: italic; }
.book-meta { margin-top: 12px; margin-bottom: 32px; color: var(--muted); font-size: 17px; line-height: 1.5; }
.cover-credit { margin-top: 12px; color: var(--muted); font-size: 15px; font-style: italic; text-align: center; }

.hook { font-style: italic; }

/* Preorder box */
.buy {
  margin-top: 40px;
  padding: 22px 24px 24px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: #fffdf8;
}
.buy-label { font-size: 22px; font-weight: 500; margin-bottom: 14px; }
.buy-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.buy-links a {
  display: block;
  padding: 10px 12px;
  text-align: center;
  font-size: 18px;
  text-decoration: none;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.buy-links a:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- About ---------- */

.about-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 56px;
  align-items: start;
}
.about-text h1 { margin-bottom: 24px; }
.about-text h2 { margin-top: 56px; }
.about-photo { margin-top: 6px; }
.portrait { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--card); }
.photo-credit { margin-top: 8px; font-size: 15px; font-style: italic; color: var(--muted); }

.press-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
  margin-top: 8px;
}
.press-grid .wide { grid-column: 1 / -1; }
.press-grid img { width: 100%; object-fit: cover; background: var(--card); }
.press-grid .wide img,
.press-grid .landscape img { aspect-ratio: 3 / 2; }
.press-grid .tall img { aspect-ratio: 3 / 4; }
.press-grid figcaption { margin-top: 8px; font-size: 16px; display: flex; justify-content: space-between; gap: 12px; }
.press-grid a:has(img) { text-decoration: none; }

.press-cover { margin-top: 28px; font-size: 18px; }

/* ---------- Films ---------- */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.reel + .reel { margin-top: 112px; padding-top: 112px; border-top: 1px solid var(--rule); }
.reel { scroll-margin-top: 24px; }
.reel-video { position: relative; aspect-ratio: 16 / 9; background: #111; }
.reel-video.ratio-4x3 { aspect-ratio: 4 / 3; max-width: 820px; margin-inline: auto; }
.reel-video.ratio-scope { aspect-ratio: 2.35 / 1; }
.reel-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.reel-info { max-width: var(--narrow, 680px); margin: 32px auto 0; }
.reel-info h2 { text-align: center; margin-bottom: 4px; }
.reel-meta { text-align: center; color: var(--muted); font-size: 17px; margin-bottom: 20px; }

.stills {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.stills.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stills .still { display: block; cursor: zoom-in; text-decoration: none; }
.stills img { width: 100%; background: var(--card); transition: opacity 0.15s; }
.stills .still:hover img { opacity: 0.85; }
/* Cosmic Bowling stills come in two widths; crop them all to the film's 2.35:1 shape so rows line up */
#cosmic-bowling .stills:not(.bts-grid) img { aspect-ratio: 2.35 / 1; object-fit: cover; }

/* Extra credits under a film's description (label on the left, names on the right) */
.credits {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 20px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 16px;
  line-height: 1.45;
}
.credits dt { color: var(--muted); }

/* Behind the scenes: a labeled divider above a second grid */
.bts { margin-top: 40px; }
.bts-label {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 17px;
  color: var(--muted);
}
.bts-label::before,
.bts-label::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.bts .bts-grid { margin-top: 24px; }
/* BTS photos mix upright and sideways shots; crop the grid to one shape per film (the viewer shows them whole) */
.bts-grid img { aspect-ratio: 3 / 2; object-fit: cover; }
#cbaf .bts-grid img { aspect-ratio: 4 / 3; }

/* Click-to-enlarge viewer for film stills */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0b0b;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  touch-action: pan-y;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img {
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 120px);
  max-height: calc(100svh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
}
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  opacity: 0.75;
  font: 300 44px/1 var(--serif);
  padding: 16px;
}
.lightbox button:hover { opacity: 1; }
.lightbox .lb-close { top: 12px; right: 16px; font-size: 40px; }
.lightbox .lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,0.7); font-size: 15px; }
.lb-open { overflow: hidden; }
/* Photos that open in the click-to-enlarge viewer */
a.zoom { display: block; cursor: zoom-in; text-decoration: none; }
.cover a.zoom { height: 100%; }
a.zoom img { transition: opacity 0.15s; }
a.zoom:hover img { opacity: 0.9; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }


/* ---------- Footer ---------- */

footer {
  margin-top: 96px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 16px;
  color: var(--muted);
}

/* ---------- Phones ---------- */

/* Contacts row (about page): three across, stacks on phones */
.contacts {
  display: grid;
  /* Middle column a little wider so the long publicity email has room */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 40px;
  margin-top: 72px;
}
.contacts h2 { margin-top: 0; }
.contacts p { margin: 0; }

@media (max-width: 860px) and (min-width: 601px) {
  .contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about-top { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
  .book { grid-template-columns: 300px minmax(0, 1fr); gap: 36px; }
}

@media (max-width: 600px) {
  .contacts { grid-template-columns: 1fr; gap: 32px; margin-top: 56px; }
  body { font-size: 18px; }
  .page { padding-top: 32px; }
  .site-header { margin-bottom: 48px; }
  h1 { font-size: 28px; }
  h2 { font-size: 23px; }
  .book { grid-template-columns: 1fr; grid-template-rows: none; gap: 32px; }
  .cover-wrap, .book-text, .book-art { grid-column: 1; grid-row: auto; }
  .cover-wrap { max-width: 300px; }
  .book-art { margin-top: 8px; max-width: 360px; margin-inline: auto; }
  .buy { padding: 18px; }
  .buy-links { grid-template-columns: 1fr; }
  .about-top { grid-template-columns: 1fr; gap: 28px; }
  .about-photo { order: -1; max-width: 320px; margin-top: 0; }
  .about-text h2 { margin-top: 44px; }
  .press-grid { grid-template-columns: 1fr; gap: 24px; }
  .press-grid .tall img { aspect-ratio: auto; }
  footer { flex-direction: column; gap: 4px; }
  .reel + .reel { margin-top: 72px; padding-top: 72px; }
  .reel-video, .reel-video.ratio-4x3 { margin-inline: calc(var(--pad) * -1); max-width: none; }
  .reel-info { margin-top: 24px; }
  .credits { grid-template-columns: 1fr; gap: 0; }
  .credits dd + dt { margin-top: 10px; }
  .stills, .stills.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 32px; }
  .bts { margin-top: 28px; }
  .bts .bts-grid { margin-top: 18px; }
  .lightbox img { max-width: 100vw; max-height: calc(100svh - 140px); }
  .lightbox .lb-prev, .lightbox .lb-next { top: auto; bottom: 4px; transform: none; }
}
