/* Afterword Books & Coffee — mobile-first fiction demo */
:root {
  --aw-parchment: #f5edd9;
  --aw-paper: #faf6ee;
  --aw-panel: #fffef9;
  --aw-ink: #1a1410;
  --aw-mute: #5c5348;
  --aw-cobalt: #1e4a8c;
  --aw-cobalt-deep: #16366a;
  --aw-ember: #c2410c;
  --aw-red-dot: #b91c1c;
  --aw-rule: #d9cdb8;
  --aw-linen: #ebe3d4;
  --aw-focus: #1e4a8c;
  --aw-max: 80rem;
  --aw-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --aw-sans: system-ui, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--aw-parchment);
  color: var(--aw-ink);
  font: 1.0625rem/1.68 var(--aw-sans);
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--aw-cobalt-deep); }

a:focus-visible, button:focus-visible, summary:focus-visible, .aw-cta:focus-visible {
  outline: 3px solid var(--aw-focus);
  outline-offset: 3px;
}

.aw-skip {
  position: absolute; left: 1rem; top: 1rem;
  width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
}
.aw-skip:focus {
  width: auto; height: auto; clip: auto; z-index: 100;
  background: #fff; padding: 0.75rem 1rem; min-height: 44px;
  display: inline-flex; align-items: center;
}

.aw-utility {
  background: var(--aw-cobalt);
  color: var(--aw-linen);
  font-size: 0.6875rem; font-weight: 650;
  letter-spacing: 0.16em; text-transform: uppercase;
  text-align: center; padding: 0.55rem 1rem;
  margin: 0;
}

.aw-masthead {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.25rem 0.85rem;
  background: var(--aw-paper);
  border-bottom: 1px solid var(--aw-rule);
  max-width: var(--aw-max);
  margin: 0 auto;
}

.aw-brand {
  font-family: var(--aw-serif);
  font-size: clamp(1.35rem, 4.5vw, 1.95rem);
  font-weight: 600;
  text-decoration: none;
  color: var(--aw-ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.aw-brand span {
  display: block;
  font-family: var(--aw-sans);
  font-size: 0.62em;
  font-weight: 600;
  color: var(--aw-cobalt);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 0.2rem;
}

.aw-nav-wrap { width: 100%; }

.aw-nav-mobile summary {
  list-style: none;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--aw-rule);
  background: var(--aw-panel);
  font-weight: 600;
  color: var(--aw-ink);
}
.aw-nav-mobile summary::-webkit-details-marker { display: none; }
.aw-nav-mobile[open] summary { border-bottom-color: transparent; }

.aw-nav-mobile__bars {
  width: 1.25rem; height: 2px; background: var(--aw-cobalt);
  box-shadow: 0 6px 0 var(--aw-cobalt), 0 -6px 0 var(--aw-cobalt);
}

.aw-nav-mobile__close { display: none; }
.aw-nav-mobile[open] .aw-nav-mobile__open { display: none; }
.aw-nav-mobile[open] .aw-nav-mobile__close { display: inline; }

.aw-drawer {
  display: grid;
  gap: 0.25rem;
  padding: 0.5rem 0.85rem 1rem;
  border: 1px solid var(--aw-rule);
  border-top: none;
  background: var(--aw-panel);
}
.aw-drawer a {
  text-decoration: none;
  padding: 0.65rem 0.25rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 550;
  border-bottom: 1px solid var(--aw-rule);
  color: var(--aw-cobalt-deep);
}
.aw-drawer a:last-child { border-bottom: none; }

.aw-desktop-nav { display: none; flex-wrap: wrap; gap: 0.35rem 1rem; }

.aw-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--aw-ember);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.32em;
}

.aw-page {
  max-width: var(--aw-max);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.aw-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--aw-cobalt);
  margin: 0 0 0.65rem;
}

.aw-label::after {
  content: " ·";
  color: var(--aw-red-dot);
  font-weight: 800;
}

.aw-page h1 {
  font-family: var(--aw-serif);
  font-size: clamp(2.1rem, 6.5vw, 3.65rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  max-width: 18ch;
}

.aw-lede {
  font-size: 1.125rem;
  color: var(--aw-mute);
  margin: 0 0 1.35rem;
  max-width: 38rem;
}

.aw-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1.25rem;
}

.aw-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  font-weight: 650;
  font-size: 0.9375rem;
  text-decoration: none;
  background: var(--aw-cobalt);
  color: #f8fafc;
  border: 2px solid var(--aw-cobalt);
}
.aw-cta--ghost {
  background: transparent;
  color: var(--aw-cobalt-deep);
  border-color: var(--aw-rule);
}
.aw-cta--ember {
  background: var(--aw-ember);
  border-color: var(--aw-ember);
}

/* Home hero — mobile: copy first, tight image */
.aw-hero-home {
  padding: 1.35rem 0 2rem;
  display: grid;
  gap: 1.25rem;
}

.aw-hero-home__thumb {
  border: 1px solid var(--aw-rule);
  background: var(--aw-panel);
  overflow: hidden;
  max-height: 220px;
}
.aw-hero-home__thumb img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center 42%;
}

.aw-hero-home__wide { display: none; }

.aw-band {
  padding: 2.25rem 0;
  border-top: 1px solid var(--aw-rule);
}
.aw-band--bleed {
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  background: var(--aw-paper);
}
.aw-band--ink {
  background: var(--aw-ink);
  color: var(--aw-linen);
  border-top: none;
}
.aw-band--ink .aw-label { color: #93b4e8; }
.aw-band--ink a { color: #dbeafe; }
.aw-band--ink h2, .aw-band--ink h3 { color: #fff; }

.aw-page h2 {
  font-family: var(--aw-serif);
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  margin: 0 0 0.85rem;
  line-height: 1.12;
}

.aw-page h3 {
  font-family: var(--aw-serif);
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}

.aw-shelf-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 640px) {
  .aw-shelf-grid { grid-template-columns: repeat(2, 1fr); }
}

.aw-shelf-card {
  display: block;
  text-decoration: none;
  padding: 1.15rem 1.2rem;
  background: var(--aw-panel);
  border: 1px solid var(--aw-rule);
  color: var(--aw-ink);
  min-height: 44px;
}
.aw-shelf-card:hover { border-color: var(--aw-cobalt); }
.aw-shelf-card p { margin: 0.35rem 0 0; color: var(--aw-mute); font-size: 0.98rem; }

.aw-aside-grid {
  display: grid;
  gap: 1.5rem;
  align-items: start;
}

.aw-figure {
  margin: 0;
  border: 1px solid var(--aw-rule);
  background: var(--aw-panel);
}
.aw-figure img {
  width: 100%;
  object-fit: cover;
}
.aw-figure--tall img { max-height: 420px; object-position: center 35%; }
.aw-figure--shelf img { object-position: center 40%; }
.aw-figure--reader img { object-position: center 30%; }
.aw-figure figcaption {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--aw-mute);
  border-top: 1px solid var(--aw-rule);
}

.aw-bleed-figure {
  margin: 0 -1.25rem;
  border-top: 1px solid var(--aw-rule);
  border-bottom: 1px solid var(--aw-rule);
}
.aw-bleed-figure img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  object-position: center 45%;
}

.aw-prose { max-width: 42rem; }
.aw-prose p { margin: 0 0 1rem; }
.aw-prose ul, .aw-prose ol {
  margin: 0 0 1.25rem;
  padding-left: 1.25rem;
  color: var(--aw-mute);
}
.aw-prose li { margin-bottom: 0.45rem; }
.aw-prose li strong { color: var(--aw-ink); }

.aw-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
}
.aw-tag {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--aw-rule);
  background: var(--aw-panel);
  color: var(--aw-cobalt);
}

.aw-split {
  display: grid;
  gap: 1.5rem;
}

.aw-contact-links {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}
.aw-contact-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.85rem 1rem;
  text-decoration: none;
  font-weight: 600;
  background: var(--aw-panel);
  border: 1px solid var(--aw-rule);
  color: var(--aw-cobalt-deep);
}

.aw-footer {
  max-width: var(--aw-max);
  margin: 0 auto;
  padding: 2rem 1.25rem 2.5rem;
  border-top: 3px solid var(--aw-cobalt);
  background: var(--aw-paper);
}

.aw-fiction {
  font-size: 0.9rem;
  color: var(--aw-mute);
  margin: 0 0 1.25rem;
  max-width: 36rem;
}

.aw-footer-nav__label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--aw-cobalt);
  margin: 0 0 0.65rem;
}

.aw-footer-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 720px) {
  .aw-footer-nav__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.aw-footer-nav__list a {
  text-decoration: none;
  font-weight: 550;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.aw-colophon {
  margin: 1.5rem 0 0;
  font-family: var(--aw-serif);
  font-size: 1.1rem;
  color: var(--aw-ink);
}

@media (min-width: 900px) {
  .aw-masthead {
    grid-template-columns: 1fr auto;
    align-items: end;
    padding: 1.25rem 2rem 1rem;
  }
  .aw-nav-mobile { display: none; }
  .aw-desktop-nav {
    display: flex;
    justify-content: flex-end;
  }
  .aw-desktop-nav a {
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--aw-cobalt-deep);
    padding: 0.35rem 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .aw-page { padding: 0 2rem 4rem; }
  .aw-band--bleed {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: max(2rem, calc(50vw - var(--aw-max) / 2 + 2rem));
    padding-right: max(2rem, calc(50vw - var(--aw-max) / 2 + 2rem));
  }
  .aw-hero-home {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2.5rem;
    align-items: center;
    padding: 2.5rem 0 3rem;
  }
  .aw-hero-home__thumb { display: none; }
  .aw-hero-home__wide {
    display: block;
    border: 1px solid var(--aw-rule);
    background: var(--aw-panel);
  }
  .aw-hero-home__wide img {
    width: 100%;
    min-height: 380px;
    max-height: 520px;
    object-fit: cover;
    object-position: 58% 42%;
  }
  .aw-aside-grid { grid-template-columns: 1fr 1fr; gap: 2.5rem; }
  .aw-aside-grid--reverse { direction: rtl; }
  .aw-aside-grid--reverse > * { direction: ltr; }
  .aw-split { grid-template-columns: 1.1fr 0.9fr; gap: 2.5rem; align-items: start; }
  .aw-bleed-figure img { max-height: 420px; }
  .aw-page h1 { max-width: 14ch; }
}