/*
 * drq.life — site stylesheet
 *
 * Hand-written, mobile-first, single stylesheet for the umbrella.
 * Per-book chapter overrides will land alongside in chapter-specific
 * files (panda.css, diamonds.css) when Phase 2 builds those pages.
 *
 * See DESIGN.md §4 (direction) and §5 (typography) for rationale.
 */

/* -----------------------------------------------------------------
 * Font-face declarations
 * local() first so a system-installed copy is preferred over the
 * woff2 fetch, per the Wayback-fitness / dev-prod-parity discipline
 * captured in DESIGN.md §5.
 * --------------------------------------------------------------- */

@font-face {
  font-family: 'Montserrat Alternates';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Montserrat Alternates'),
       local('MontserratAlternates-Regular'),
       url('/assets/fonts/montserrat-alternates-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat Alternates';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local('Montserrat Alternates Italic'),
       local('MontserratAlternates-Italic'),
       url('/assets/fonts/montserrat-alternates-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Montserrat Alternates';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Montserrat Alternates Bold'),
       local('MontserratAlternates-Bold'),
       url('/assets/fonts/montserrat-alternates-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('EB Garamond'),
       local('EBGaramond-Regular'),
       url('/assets/fonts/eb-garamond-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: local('EB Garamond Italic'),
       local('EBGaramond-Italic'),
       url('/assets/fonts/eb-garamond-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('EB Garamond Bold'),
       local('EBGaramond-Bold'),
       url('/assets/fonts/eb-garamond-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: local('EB Garamond Bold Italic'),
       local('EBGaramond-BoldItalic'),
       url('/assets/fonts/eb-garamond-latin-700-italic.woff2') format('woff2');
}

/* -----------------------------------------------------------------
 * Custom properties (palette, type scale, spacing)
 * Chapter overrides redefine these inside their scope.
 * --------------------------------------------------------------- */

:root {
  --bg: #f7f5ef;             /* warm cream, umbrella default */
  --ink: #1c1a16;            /* near-black, warm */
  --ink-soft: #4a4640;       /* muted body emphasis */
  --ink-faint: #6b665e;      /* meta / footer */
  --rule: #d8d2c2;           /* hairline divider */

  --display: 'Montserrat Alternates', 'Avenir Next', Avenir,
             'Century Gothic', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'EB Garamond', 'Iowan Old Style', 'Hoefler Text', Garamond,
          'Palatino Linotype', Palatino, Georgia, serif;

  --measure: 32rem;          /* readable line length, prose */
  --measure-wide: 44rem;     /* wider blocks (catalog rows, etc.) */

  font-synthesis: none;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

/* -----------------------------------------------------------------
 * Reset and base
 * --------------------------------------------------------------- */

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 100%;
  line-height: 1.55;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a,
a:link,
a:visited,
a:hover,
a:focus,
a:active {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

/* -----------------------------------------------------------------
 * Layout primitives
 * --------------------------------------------------------------- */

.page {
  flex: 1;
  width: 100%;
  max-width: var(--measure-wide);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.masthead {
  text-align: center;
  margin-bottom: 4rem;
}

.masthead .name {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 2.25rem;
  margin: 0 0 0.25rem;
}

.masthead .role {
  font-family: var(--body);
  font-style: italic;
  color: var(--ink-soft);
  margin: 0;
  font-size: 1.125rem;
}

.prose {
  max-width: var(--measure);
  margin: 0 auto;
  font-size: 1.125rem;
}

.prose p {
  margin: 0 0 1em;
}

.prose p + p {
  text-indent: 1.5em;
}

/* Colophon paragraphs read better without the literary indent —
   they're build credits, not prose. */
[data-chapter="colophon"] .prose p + p {
  text-indent: 0;
}

.section-title {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
  color: var(--ink-soft);
  text-align: center;
  margin: 4rem 0 2rem;
}

.section-title::after {
  content: '';
  display: block;
  width: 3rem;
  height: 1px;
  background: var(--rule);
  margin: 1rem auto 0;
}

/* -----------------------------------------------------------------
 * Catalog (book listing)
 * --------------------------------------------------------------- */

.catalog {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 3rem;
}

@media (min-width: 640px) {
  .catalog {
    grid-template-columns: 1fr 1fr;
    gap: 4rem 3rem;
  }
}

.catalog-item {
  text-align: center;
}

.catalog-item .title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1em;
  transition: border-color 0.15s;
}

.catalog-item .title a:hover {
  border-bottom-color: var(--ink-soft);
}

.catalog-item .cover {
  margin: 0 auto 1rem;
  max-width: 14rem;
  box-shadow: 0 1rem 2.5rem rgba(0,0,0,0.18);
}

.catalog-item .title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  color: var(--ink);
}

/* -----------------------------------------------------------------
 * Forthcoming (upcoming titles, not yet linked)
 * --------------------------------------------------------------- */

.forthcoming {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: var(--measure);
}

.forthcoming-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}

.forthcoming-item:last-child {
  border-bottom: none;
}

.forthcoming-title {
  font-style: italic;
  font-size: 1.125rem;
  color: var(--ink);
}

.forthcoming-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1em;
  transition: border-color 0.15s;
}

.forthcoming-link:hover {
  border-bottom-color: var(--ink-soft);
}

.forthcoming-date {
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .forthcoming-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
}

/* -----------------------------------------------------------------
 * Chapter pages (per-book gallery rooms)
 * Layout primitives shared across chapters; per-chapter CSS files
 * (chapter-panda.css, chapter-diamonds.css) override the palette
 * custom properties for their visual world.
 * --------------------------------------------------------------- */

.chapter-nav {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  margin-bottom: 3rem;
}

.chapter-nav a {
  text-decoration: none;
  color: var(--ink-faint);
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1em;
  transition: color 0.15s, border-color 0.15s;
}

.chapter-nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.chapter-masthead {
  text-align: center;
  margin-bottom: 3rem;
}

.book-title {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
  max-width: 30rem;
  margin-left: auto;
  margin-right: auto;
}

.book-byline {
  font-family: var(--body);
  font-style: italic;
  color: var(--ink-soft);
  margin: 0;
  font-size: 1rem;
}

.cover-hero {
  margin: 0 auto 3rem;
  max-width: 22rem;
}

.cover-hero img {
  box-shadow: 0 1.5rem 3rem rgba(0,0,0,0.45);
  width: 100%;
  height: auto;
}

.jacket {
  margin-bottom: 3rem;
}

.jacket p {
  margin: 0 0 1em;
}

.jacket p + p {
  text-indent: 1.5em;
}

.purchase-line {
  text-align: center;
  margin: 3rem 0;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.875rem;
}

.purchase-line a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--rule);
  padding: 0.75rem 1.5rem;
  display: inline-block;
  transition: background 0.15s, color 0.15s;
}

.purchase-line a:hover {
  background: var(--ink);
  color: var(--bg);
}

.poems-placeholder {
  text-align: center;
  font-style: italic;
  color: var(--ink-faint);
  margin: 2rem 0;
}

.poem-index {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 28rem;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.poem-index li {
  text-align: center;
}

.poem-index a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1em;
  transition: border-color 0.15s;
}

.poem-index a:hover {
  border-bottom-color: var(--ink-soft);
}

/* -----------------------------------------------------------------
 * Poem pages
 * Per-poem permanent URLs (/panda/<slug>/ and /diamonds/<slug>/).
 * Typography per DESIGN.md §5: EB Garamond at reading size, exact
 * line breaks preserved via per-line block elements, hanging-
 * indent treatment so any wrapped continuation is visibly distinct
 * from a new poetic line.
 * --------------------------------------------------------------- */

.poem-masthead {
  text-align: center;
  margin: 1rem 0 3rem;
}

.poem-title {
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 1.125rem;
  line-height: 1.3;
  margin: 0;
}

.poem {
  max-width: 32rem;
  margin: 0 auto 3rem;
  font-family: var(--body);
  font-size: 1.125rem;
}

.poem .stanza {
  margin: 0 0 1.5em;
}

.poem .stanza:last-child {
  margin-bottom: 0;
}

.poem .line {
  margin: 0;
  padding-left: 2em;
  text-indent: -2em;
  line-height: 1.55;
}

/* Intentional indentation for poems that use it as structure
   (cherita form, alternating-couplet patterns, etc.). One level
   per --indent class; padding-left adds to the hanging-indent
   base so continuation lines stay distinct. */
.poem .line.indent-1 { padding-left: 4em; }
.poem .line.indent-2 { padding-left: 6em; }
.poem .line.indent-3 { padding-left: 8em; }

/* Author footnotes (e.g., 'Inspired by...' attribution lines) */
.poem-footnote {
  max-width: 32rem;
  margin: 2.5rem auto 0;
  font-family: var(--body);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.poem-nav-footer {
  text-align: center;
  margin: 4rem 0 2rem;
  font-family: var(--display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
}

.poem-nav-footer a {
  text-decoration: none;
  color: var(--ink-faint);
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1em;
  transition: color 0.15s, border-color 0.15s;
}

.poem-nav-footer a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

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

.site-footer {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  font-size: 0.875rem;
  color: var(--ink-faint);
  border-top: 1px solid var(--rule);
  margin-top: 6rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

/* -----------------------------------------------------------------
 * Responsive adjustments
 * --------------------------------------------------------------- */

@media (max-width: 480px) {
  .page { padding: 2rem 1.25rem 3rem; }
  .masthead .name { font-size: 1.75rem; }
  .masthead .role { font-size: 1rem; }
  .prose { font-size: 1.0625rem; }
}
