/* 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; }

/* Selected film work (About page) */
.films { border-top: 1px solid var(--rule); }
.film { border-bottom: 1px solid var(--rule); }
.film summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 28px 14px 0;
  position: relative;
  line-height: 1.35;
}
.film summary::-webkit-details-marker { display: none; }
.film summary::after {
  content: "+";
  position: absolute;
  right: 2px;
  top: 12px;
  font-size: 22px;
  color: var(--muted);
  transition: transform 0.2s;
}
.film[open] summary::after { transform: rotate(45deg); }
.film summary:hover .film-title { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.film-title { font-style: italic; }
.film summary .muted { display: block; margin-top: 2px; font-size: 16px; }
.film-logline { font-size: 17px; color: var(--muted); margin-bottom: 14px; }
.film-video { position: relative; aspect-ratio: 16 / 9; background: #111; margin-bottom: 20px; }
.film-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- 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 ---------- */

@media (max-width: 860px) and (min-width: 601px) {
  .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) {
  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; }
}
