/* memoirs.css — styling for all archive views.
   Self-contained: works whether or not theme.css/layout.css define these classes.
   Load AFTER theme.css and layout.css so it can layer on top. */

:root {
  --hb-parchment: #f5e6c8;
  --hb-ink: #2b1b0f;
  --hb-ink-soft: #5a3417;
  --hb-accent: #8b5a2b;
  --hb-line: rgba(139, 90, 43, 0.35);
}

/* ---------- shared scaffolding ---------- */
.card {
  background: rgba(20, 12, 24, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1.5rem;
  margin: 0 auto 1.25rem;
  max-width: 1040px;
}
.card.soft { background: rgba(255, 255, 255, 0.03); }
.view-head { margin-bottom: 1.25rem; }
.view-head h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 0.4rem; letter-spacing: 0.02em; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.8rem; opacity: 0.65; margin: 0 0 0.3rem; }
.lede { opacity: 0.85; line-height: 1.6; max-width: 60ch; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 760px) { .grid-two { grid-template-columns: 1fr; } }

.notice {
  border: 1px dashed var(--hb-line); border-radius: 12px;
  padding: 1.25rem 1.5rem; opacity: 0.85; line-height: 1.6;
}
.notice code { background: rgba(255,255,255,0.08); padding: 0.1em 0.4em; border-radius: 4px; }

/* ---------- home ---------- */
.portraits { display: flex; gap: 1rem; }
.portraits figure { margin: 0; flex: 1; text-align: center; }
.portraits img { width: 100%; border-radius: 12px; }
.portraits figcaption { margin-top: 0.4rem; font-weight: 600; }
.explore-list { line-height: 1.9; padding-left: 1.1rem; }

/* ---------- memoir ---------- */
.memoir-intro { text-align: center; }
.memoir-sub { font-style: italic; opacity: 0.8; margin: 0 0 1rem; }
.memoir-blurb { margin: 0 auto; }
.memoir-layout { display: grid; grid-template-columns: 270px 1fr; gap: 1.5rem; align-items: start; margin-top: 1.25rem; }
@media (max-width: 820px) { .memoir-layout { grid-template-columns: 1fr; } }

.chapter-menu {
  position: sticky; top: 1rem; border: 1px solid var(--hb-line);
  border-radius: 10px; padding: 1rem; max-height: 80vh; overflow-y: auto;
}
.chapter-menu h3 {
  font-family: system-ui, sans-serif; font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; opacity: 0.6; margin: 0 0 0.6rem;
}
.chapter-btn {
  display: block; width: 100%; text-align: left; cursor: pointer; color: inherit;
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  font: inherit; padding: 0.5rem 0.7rem; margin-bottom: 0.25rem;
  transition: background 0.15s, border-color 0.15s;
}
.chapter-btn:hover { background: rgba(139, 90, 43, 0.25); }
.chapter-btn.active { background: var(--hb-accent); border-color: var(--hb-parchment); color: #fff; font-weight: bold; }
.chapter-btn .cb-num {
  display: block; font-family: system-ui, sans-serif; font-size: 0.68rem;
  letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.65; margin-bottom: 0.1rem;
}

.memoir-reader { min-width: 0; }
.memoir-chapter { display: none; }
.memoir-chapter.active { display: block; animation: hbFade 0.3s ease-out both; }
@keyframes hbFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.memoir-body > h2 { font-size: 2rem; text-align: center; margin: 0.3rem 0 0.1rem; }
.memoir-body > h3 { font-size: 1.1rem; text-align: center; font-style: italic; font-weight: normal; opacity: 0.75; margin: 0 0 1.5rem; }
.memoir-body p { line-height: 1.85; margin: 0 0 1.1rem; text-align: justify; hyphens: auto; }
.memoir-body p.first-para::first-letter {
  float: left; font-size: 3.2rem; line-height: 0.8; padding: 0.1rem 0.5rem 0 0;
  font-weight: bold; color: var(--hb-accent);
}
.chapter-nav { display: flex; justify-content: space-between; gap: 0.75rem; margin: 2rem 0 0.5rem; }
.chapter-nav button {
  flex: 1; cursor: pointer; background: transparent; color: inherit; font: inherit;
  border: 1px solid var(--hb-line); border-radius: 8px; padding: 0.6rem 0.9rem;
  transition: background 0.15s, color 0.15s;
}
.chapter-nav button:hover:not(:disabled) { background: var(--hb-accent); color: #fff; }
.chapter-nav button:disabled { opacity: 0.35; cursor: default; }
.chapter-nav .cn-next { text-align: right; }
.chapter-nav small { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.07em; opacity: 0.6; }
.memoir-foot { text-align: center; font-style: italic; opacity: 0.7; margin-top: 2rem; }

/* ---------- tree & map hosts ---------- */
.tree-host { height: 620px; background: #0c0710; border-radius: 14px; margin-top: 1rem; overflow: hidden; }
.map-host { height: 600px; border-radius: 14px; margin-top: 1rem; overflow: hidden; }

/* ---------- birthdays ---------- */
.bday-month { margin-bottom: 1.5rem; }
.bday-month h2 { border-bottom: 1px solid var(--hb-line); padding-bottom: 0.3rem; }
.bday-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.bday-list li { padding: 0.35rem 0; line-height: 1.5; }
.bday-day { display: inline-block; min-width: 2ch; font-weight: bold; color: var(--hb-accent); }
.bday-year { opacity: 0.6; }

/* ---------- history / timeline ---------- */
.timeline-controls { display: flex; align-items: center; gap: 1rem; margin: 0.5rem 0 1.5rem; }
.timeline-controls input[type="range"] { flex: 1; accent-color: var(--hb-accent); }
.timeline-controls output { font-size: 1.4rem; font-weight: bold; min-width: 4ch; text-align: right; }
.timeline-events { display: flex; flex-direction: column; gap: 1rem; }
.timeline-block { border-left: 3px solid var(--hb-accent); padding: 0.5rem 0 0.5rem 1rem; }
.timeline-block h3 { margin: 0 0 0.3rem; }
.t-year { color: var(--hb-accent); }
.timeline-photo { max-width: 320px; border-radius: 10px; margin-top: 0.5rem; }

/* ---------- photos ---------- */
.breadcrumb { margin: 0.5rem 0 1rem; opacity: 0.85; }
.breadcrumb .crumb { background: none; border: none; color: var(--hb-accent); cursor: pointer; font: inherit; padding: 0; }
.breadcrumb .crumb:hover { text-decoration: underline; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
.photo-folder, .photo-thumb {
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem; cursor: pointer;
  background: rgba(255,255,255,0.04); border: 1px solid var(--hb-line); border-radius: 12px;
  padding: 1rem 0.75rem; color: inherit; font: inherit; text-align: center;
  transition: transform 0.12s, background 0.12s;
}
.photo-folder:hover, .photo-thumb:hover { transform: translateY(-2px); background: rgba(139,90,43,0.2); }
.folder-ico { font-size: 2.2rem; }
.photo-thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; }
.photo-thumb .cap { font-size: 0.85rem; opacity: 0.85; }
.empty { opacity: 0.7; }
.photo-viewer {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem;
}
.photo-viewer img { max-width: 90vw; max-height: 80vh; border-radius: 8px; }
.photo-viewer p { color: #fff; margin-top: 1rem; }
.pv-close { position: absolute; top: 1rem; right: 1.5rem; font-size: 2rem; background: none; border: none; color: #fff; cursor: pointer; }

/* ---------- larger text ---------- */
body.larger-text { font-size: 1.15rem; }
body.larger-text .memoir-body p { line-height: 2; }
