/* ============================================
   yarim · yarım — shared stylesheet
   Link this from every page with:
   <link rel="stylesheet" href="style.css">
   (adjust path to ../style.css inside subfolders)
   ============================================ */

:root {
  --bg: #f4f1ea;
  --ink: #1f1c18;
  --muted: #8a8378;
  --rule: #d8d2c6;
  --accent: #6b4f3a;

  --measure: 38rem;          /* reading width */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Newsreader', Georgia, serif;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding: 0 1.5rem;
}

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 6rem 0 8rem;
}

/* ---------- Masthead ---------- */

header {
  margin-bottom: 4.5rem;
}

h1 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 3.4rem;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.9rem;
}

/* the second spelling, rendered as the "half" / faded twin */
h1 .half {
  color: var(--muted);
}

.tagline {
  font-style: italic;
  color: var(--muted);
  font-size: 1.1rem;
}

/* ---------- Index sections ---------- */

section {
  margin-bottom: 3.5rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.4rem;
}

ul { list-style: none; }

li {
  padding: 0.55rem 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
}

li a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease, color 0.25s ease;
}

li a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.date {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  font-style: italic;
  padding: 0.55rem 0;
}

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

footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.85rem;
  color: var(--muted);
}

footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Reading pages (essays / poems) ---------- */
/* These styles are ready for when you build individual pieces.
   Wrap a piece in <article> and they'll apply automatically. */

article {
  margin-top: 1rem;
}

article .back {
  display: inline-block;
  margin-bottom: 2.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.02em;
}

article .back:hover { color: var(--accent); }

article h1 {
  font-size: 2.4rem;
  margin-bottom: 0.4rem;
}

article .meta {
  font-style: italic;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

article p {
  margin-bottom: 1.3rem;
}

/* poems: preserve line breaks and indentation as written */
article .verse {
  white-space: pre-wrap;
  font-size: 1.15rem;
  line-height: 1.9;
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
  h1 { font-size: 2.6rem; }
  .wrap { padding: 4rem 0 5rem; }
  article h1 { font-size: 2rem; }
}