/* ============================================
   1. DESIGN TOKENS
   Dark mode only now — no light theme, no toggle.
   ============================================ */
:root {
  --bg: #121212;          /* soft black — page background */
  --bg-sidebar: #1F3025;  /* forest green — sidebar panel */
  --bg-card: #1A1F1C;     /* near-black, faint green tint — cards */

  --text: #E7E1D6;        /* parchment — main text */
  --text-soft: #79866D;   /* sage — labels, metadata, muted text */
  --accent: #93A587;      /* brightened sage — links & highlights.
                             (regular sage was too close in value to
                             the dark backgrounds to read comfortably,
                             so this is a touch lighter) */
  --border: #2D4734;      /* hunter green — hairlines, dividers */

  --font-heading: "Fraunces", serif;
  --font-body: "Work Sans", sans-serif;
  --font-mono: "Space Mono", monospace;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.75rem;
  --space-lg: 3rem;
  --space-xl: 5rem;

  --sidebar-width: 280px;
}

/* ============================================
   2. RESET / BASE
   ============================================ */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

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

/* ============================================
   3. PAGE SHELL
   Sidebar + content, side by side on desktop.
   ============================================ */
.page-shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

/* ============================================
   4. SIDEBAR
   Sticky so it stays in view while content scrolls.
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background-color: var(--bg-sidebar);
  padding: var(--space-lg) var(--space-md);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--border);
}

.sidebar-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--text-soft); /* shows before a real photo is added */
  margin-bottom: var(--space-sm);
}

.sidebar-name {
  font-family: var(--font-heading);
  font-size: 1.7rem;
  font-style: italic;
  margin: 0 0 0.1rem;
}

.sidebar-handle {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-soft);
  margin: 0 0 var(--space-xs);
}

.sidebar-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-soft);
  margin: 0 0 var(--space-sm);
}

.sidebar-bio {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0 0 var(--space-md);
}

.sidebar-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin: 0 0 0.5rem;
}

/* 
  Nav as a grid of small pill buttons instead of a plain
  vertical list — reads as "things you can press", not
  a bullet-point list on a resume.
*/
.sidebar-nav-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.nav-pill {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-align: center;
  padding: 0.5rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-pill.is-active {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--bg-sidebar);
  font-weight: 700;
}

/* ============================================
   5. MAIN CONTENT
   ============================================ */
.content {
  flex: 1;
  min-width: 0;
  padding: var(--space-xl) var(--space-lg);
  max-width: 760px;
}

.ask-card-large {
  max-width: 420px;
  padding: var(--space-lg);
}

.ask-card-large .ask-card-text {
  font-size: 1.4rem;
}

.content-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-soft);
  margin: 0 0 0.2rem;
}

.content-title {
  font-family: var(--font-heading);
  font-size: 2.4rem;
  line-height: 1.15;
  margin: 0 0 var(--space-md);
}

.content-title-mark {
  color: var(--accent);
}

/* Badges */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-lg);
}

.badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--accent);
}

/* Section label, reused across pages (e.g. "currently", "pinned", "latest") */
.content-section {
  margin-bottom: var(--space-lg);
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin: 0 0 var(--space-sm);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}

/* Currently list */
.currently-list {
  display: flex;
  flex-direction: column;
}

.currently-row {
  display: flex;
  gap: var(--space-sm);
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border);
}

.currently-row:last-child {
  border-bottom: none;
}

.currently-key {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-soft);
  width: 110px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 0.15rem;
}

.currently-value {
  font-family: var(--font-heading);
  font-size: 1rem;
}

/* Ask card */
.ask-card {
  display: block;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-md);
  transition: border-color 0.2s ease;
}

.ask-card:hover {
  border-color: var(--accent);
}

.ask-card-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin: 0 0 0.4rem;
}

.ask-card-text {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0 0 var(--space-sm);
}

.ask-card-arrow {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

/* ============================================
   6. RESPONSIVE
   Sidebar stacks on top instead of sitting beside content.
   ============================================ */
@media (max-width: 760px) {
  .page-shell {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .content {
    padding: var(--space-lg) var(--space-md);
    max-width: none;
  }

  .currently-row {
    flex-direction: column;
    gap: 0.2rem;
  }

  .currently-key {
    width: auto;
  }
}

/* ============================================
   7. FORM ELEMENTS
   The ask form, shared by index.html (link only)
   and qa.html (the real form).
   ============================================ */

.empty-message {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* Mode toggle: "ask a question" vs "suggest for heartquarters" */
.ask-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0 0.8rem;
}

.ask-mode-button {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

.ask-mode-button:hover {
  color: var(--text);
  border-color: var(--accent);
}

.ask-mode-button.is-active {
  color: var(--bg);
  background-color: var(--accent);
  border-color: var(--accent);
}

/* Ask form (qa.html) — design only, no backend */
.ask-form {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.ask-textarea {
  width: 100%;
  background-color: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.7rem;
  margin: 0.6rem 0;
  resize: vertical;
}

.ask-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.ask-submit-button {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background-color: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
}

.ask-submit-button:hover {
  opacity: 0.85;
}

.ask-form-note {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-soft);
  margin: 0.6rem 0 0;
  min-height: 1em; /* keeps layout from jumping when the note appears */
}

/* ============================================
   8. TWEET CARDS (tweets.html)
   ============================================ */
/* Padlet-style masonry-ish grid — cards wrap into columns
   instead of stacking in a single line. */
.tweet-grid {
  columns: 2 260px;
  column-gap: var(--space-sm);
}

.tweet-card {
  display: block;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: var(--space-sm);
  overflow: hidden; /* keeps the image's corners rounded to match the card */
  break-inside: avoid; /* keeps a card from splitting across columns */
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.tweet-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* The photo, if the tweet has one, sits full-width at the
   top of the card — like a link-preview embed. */
.tweet-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.tweet-card-body {
  padding: var(--space-sm) var(--space-md);
}

.tweet-card-text {
  font-size: 0.95rem;
  margin: 0 0 0.7rem;
  white-space: pre-line; /* makes \n in the text (see data.js) render as an actual line break */
}

/* Date on one side, small "x" mark on the other — signals
   "this opens on twitter/x" without needing extra text. */
.tweet-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.tweet-card-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-soft);
}

.tweet-card-footer-icon {
  width: 14px;
  height: 14px;
  color: var(--text-soft);
}

/* ============================================
   9. Q&A CARDS (qa.html)
   ============================================ */
.qa-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.qa-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-sm) var(--space-md);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  scroll-margin-top: var(--space-lg); /* keeps the card from hiding under the top edge when scrolled to */
}

/* Briefly applied by qa.js when a shared link (#qa-<id>) points
   here, so the visitor can immediately spot which card it was
   talking about. */
.qa-card-highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.qa-card-date {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-soft);
  margin: 0 0 0.6rem;
}

/* Each of question/answer sits in its own labeled block —
   this is what actually keeps them from reading as one
   run-on paragraph once the text gets longer. */
.qa-card-block {
  margin-bottom: 0.7rem;
}

.qa-card-block-answer {
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}

.qa-card-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin: 0 0 0.3rem;
}

.qa-card-question {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin: 0;
}

.qa-card-answer {
  font-size: 0.92rem;
  margin: 0;
}

/* Share button, in the footer of each card */
.qa-card-footer {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}

.qa-share-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
}

.qa-share-button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.qa-share-icon {
  width: 13px;
  height: 13px;
}

/* ============================================
   10. ABOUT / FANDOM PAGE HELPERS
   Reused across about.html and fandom.html
   ============================================ */
.about-text {
  max-width: 65ch;
  font-size: 0.95rem;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-sm);
}

.fact-item {
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.5rem;
}

.fact-key {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft);
  margin: 0 0 0.2rem;
}

.fact-value {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin: 0;
}

.fact-list {
  margin: 0;
  padding-left: 1.2rem;
}

.fact-list li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

/* ============================================
   11. FANDOM PAGE — GROUP ACCORDION
   Click a group's name to reveal/hide its panel.
   ============================================ */
.group-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.group-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: none;
  border: none;
  color: var(--text);
  font-family: var(--font-heading);
  font-size: 1.1rem;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  text-align: left;
}

.group-toggle:hover {
  color: var(--accent);
}

.group-toggle-icon {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 1.1rem;
  flex-shrink: 0; /* keeps the +/− from ever getting squeezed by a long group name */
}

/* Panel starts collapsed (max-height: 0) and expands
   smoothly when .is-open is added by fandom.js. */
.group-panel {
  max-height: 0;
  overflow: hidden;
  padding: 0 var(--space-md);
  transition: max-height 0.25s ease, padding 0.25s ease;
}

.group-panel.is-open {
  max-height: 260px;
  padding: var(--space-sm) var(--space-md) var(--space-sm);
  border-top: 1px dashed var(--border);
}

/* ============================================
   12. LINKS PAGE — centered buttons + icons
   ============================================ */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 220px));
  gap: var(--space-sm);
  justify-content: center;
  max-width: 640px;
  margin: 0 auto;
}

.link-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: var(--space-md) 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.link-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.link-icon {
  width: 26px;
  height: 26px;
}

.links-note {
  max-width: 640px;
  margin: var(--space-lg) auto 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-soft);
}