/* cb_mirror -- family health-journey archive.
   One small hand-written stylesheet: system fonts only, no build step,
   no external requests. Calm and legible over flashy -- this gets read
   by family, sometimes at 2am, sometimes on a phone in a waiting room. */

:root {
  --bg: #fbf7f0;
  --surface: #fffdf8;
  --ink: #2e2a24;
  --ink-soft: #6b6255;
  --line: #e4dcc9;
  --accent: #a8553f;
  --accent-soft: #f1e4db;
  --focus: #2e6e62;

  --font-serif: ui-serif, Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #211d19;
    --surface: #2a251f;
    --ink: #ede6da;
    --ink-soft: #b8ac9a;
    --line: #3e362c;
    --accent: #e08868;
    --accent-soft: #3a2a22;
    --focus: #7fc8b6;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}

/* -- Header ------------------------------------------------------ */

.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.site-avatar {
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--line);
}

.site-heading { flex: 1 1 auto; min-width: 0; }

.site-heading h1 {
  margin: 0;
  font-size: 1.5rem;
}

.site-heading h1 a { color: inherit; text-decoration: none; }

.site-subtitle {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.site-nav {
  display: flex;
  gap: 1rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

.site-nav a { text-decoration: none; }
.site-nav a:hover { text-decoration: underline; }

/* -- Timeline (the signature element) ----------------------------
   A soft vertical spine threading down the page, with each entry's
   date marked by a small circle on it -- a quiet, literal "journey"
   motif, the one deliberate flourish in an otherwise plain layout. */

.timeline {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
  border-left: 2px solid var(--line);
}

.entry {
  position: relative;
  padding: 0 0 2.5rem 1.5rem;
  margin-left: -2px;
  border-left: 2px solid var(--line);
}

.entry:last-child { border-left-color: transparent; padding-bottom: 0; }

.entry::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}

.entry-page .entry { border-left: none; padding-left: 0; margin-left: 0; }
.entry-page .entry::before { display: none; }

.entry-title {
  margin: 0 0 0.25rem;
  font-size: 1.375rem;
}

.entry-title a { color: inherit; text-decoration: none; }
.entry-title a:hover { text-decoration: underline; }

.entry-meta, .comment-meta {
  margin: 0 0 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.entry-author, .comment-author { font-weight: 600; }

.entry-body, .comment-body { overflow-wrap: break-word; }

.entry-body p, .comment-body p { margin: 0 0 0.9em; }
.entry-body p:last-child, .comment-body p:last-child { margin-bottom: 0; }

.entry-body blockquote, .comment-body blockquote {
  margin: 0.9em 0;
  padding: 0.1rem 1rem;
  border-left: 3px solid var(--line);
  color: var(--ink-soft);
}

/* -- Photos -------------------------------------------------------- */

.photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.photo, .gallery-item {
  display: block;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
}

.photos .photo img {
  max-height: 15rem;
  width: auto;
  max-width: 100%;
  display: block;
}

/* -- Reactions ------------------------------------------------------ */

.reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0 0;
}

.reaction {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--accent-soft);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.85rem;
}

/* -- Comments -------------------------------------------------------- */

.comments {
  margin-top: 1.25rem;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.comments summary {
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.comment {
  margin-top: 1rem;
  padding-bottom: 0.25rem;
}

.comment-replies {
  margin-top: 0.75rem;
  padding-left: 1.1rem;
  border-left: 2px solid var(--line);
}

/* -- Gallery -------------------------------------------------------- */

.gallery-grid {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.6rem;
}

.gallery-item img {
  width: 100%;
  height: 9rem;
  object-fit: cover;
  display: block;
}

.empty {
  color: var(--ink-soft);
  font-style: italic;
}

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

@media (max-width: 30rem) {
  .site-header { padding: 1.5rem 1rem 1.25rem; }
  .timeline { padding: 1.25rem 1rem 3rem; }
  .entry { padding-left: 1.1rem; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
