/* Shared blog styles extracted from weave-head.html */

header time.date {
  display: block;
  margin: 4px 0 10px;   /* space around the date */
  color: var(--muted);
  font-size: 0.95rem;
}
:root {
  --width: 980px;
  --text: #111;
  --muted: #555;
  --bg: #fff;
  --code-bg: #0f172a0d;
  --border: #e5e7eb;
  --accent: #0f766e;
}
html, body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  margin: 0;
  padding: 0;
  color-scheme: light dark;
}
.container {
  max-width: var(--width);
  margin: 0 auto;
  padding: 32px 20px 80px;
}
header h1 {
  font-size: 2.1rem;
  line-height: 1.2;
  margin: 0 0 8px 0;
  letter-spacing: -0.01em;
}
header p.sub {
  margin: 0 0 20px 0;
  color: var(--muted);
}
h2 {
  font-size: 1.5rem;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}
h3 {
  font-size: 1.15rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}
p, li {
  font-size: 1rem;
}
a {text-decoration: underline;}

/* Figures */
figure { margin: 1rem 0 1.75rem; }
figcaption { color: var(--muted); font-size: 0.95rem; margin-top: 8px; }
/* Utility: center a single figure's caption */
figure.ccaption figcaption { text-align: center; max-width: 68ch; margin: 10px auto 0; }
.media {
  display: block; width: 100%; height: auto;
  border-radius: 8px; border: 1px solid var(--border);
}
.grid-2 {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; align-items: start;
}
.grid-2 figure { margin: 0; }
@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; }
}

/* Code + collapsible */
pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  /* no fixed height, no forced scroll */
  overflow-x: auto; /* allow horizontal scroll for long lines */
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.8rem;
}
/* Wrap long lines in BibTeX block to avoid overflow */
pre.bibtex { white-space: pre-wrap; }
pre.bibtex code {
  white-space: inherit;           /* follow pre-wrap from parent */
  overflow-wrap: anywhere;        /* break long URLs/identifiers */
  word-break: break-word;         /* fallback for older browsers */
}
.note {
  border-left: 4px solid var(--accent);
  background: #ecfeff;
  padding: 12px 14px;
  border-radius: 6px;
  margin: 1rem 0 1.5rem;
}


figcaption .msize{
  font-weight: 800;
  color: var(--accent);
  letter-spacing: .02em;
}

/* Experiments section: roomier, easier scanning */
#experiments { line-height: 1.75; }
#experiments p { margin: 0.25rem 0 1rem; }
#experiments .grid-2 { gap: 18px; margin-top: 12px; }
#experiments figure { margin: 0.75rem 0 1.5rem; }
#experiments figcaption { font-size: 1.04rem; line-height: 1.55; margin-top: 12px; }

/* Lead-in labels inside Experiments (no caps) */
#experiments p.lead { margin: 1rem 0 0.35rem; color: var(--muted); font-weight: 600; }
#experiments p.lead strong { color: var(--text); }

/* Tables (for setup) */
table { border-collapse: collapse; width: 100%; margin: 0.5rem 0 1.0rem; }
th, td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: #f8fafc; font-weight: 600; }
td code { white-space: nowrap; }

/* Collapsible setup blocks (de-emphasized) */
details.setup { margin: 0.25rem 0 0.75rem; }
details.setup summary { cursor: pointer; color: var(--muted); font-weight: 600; }
details.setup summary:hover { color: var(--text); }
details.setup table { font-size: 0.92rem; }
details.setup th, details.setup td { padding: 6px 8px; }

/* Unified compare grid with shared column headers */
#experiments .compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
  margin-top: 12px;
}
#experiments .compare-grid .rowtitle {
  grid-column: 1 / -1;
  margin-top: 1rem;
  padding-top: 0;
  border-top: none;
  margin-bottom: 6px; /* tighter coupling to following figure */
}
#experiments .compare-grid .rowtitle::before {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  background: var(--border);
  margin-bottom: 8px;
}
#experiments .compare-grid .rowtitle:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 1rem;
}

/* Pair figure with shared caption */
#experiments figure.pair { grid-column: 1 / -1; margin: 0.75rem 0 1.5rem; }
#experiments figure.pair .imgs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
#experiments figure.pair .panel { position: static; aspect-ratio: 16 / 10; }
#experiments figure.pair .panel .media { width: 100%; height: 100%; object-fit: contain; }
#experiments figure.pair figcaption {
  text-align: left;
  max-width: none;
  margin: 10px 0 0;
}

/* Mobile tweaks: slightly airier on small screens */
/* Default: allow horizontal scroll for wide compare blocks */
#experiments .compare-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#experiments .compare-scroll .compare-grid { min-width: 760px; }

@media (max-width: 760px) {
  #experiments { line-height: 1.8; }
  #experiments p { margin: 0.25rem 0 1.05rem; }
  #experiments .grid-2 { gap: 16px; margin-top: 14px; }
  #experiments figure { margin: 0.9rem 0 1.7rem; }
  #experiments figcaption { font-size: 1.02rem; margin-top: 12px; }
  /* On small screens, keep side-by-side but allow wrap-free fit
     by removing forced min-width and tightening gaps. */
  #experiments .compare-scroll .compare-grid { min-width: 0; }
  #experiments figure.pair .imgs { gap: 12px; }
  #experiments figure.pair .panel { min-width: 0; }
}

/* Section label within Experiments (for 4B & 7B Results) */
#experiments h3.section-label {
  margin-top: 0.9rem;
  margin-bottom: 0.4rem;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e5e7eb;
    --muted: #a3a3a3;
    --bg: #0b0f19;
    --code-bg: #111827;
    --border: #1f2937;
    --accent: #22d3ee;
  }
  th { background: #0f172a; }
  .note { background: #0d3b3f; }
}
