/* ============================================================================
   editorial.css — the full Éist experience at "/" (the scrolling document).
   Loaded LAST, after colors/avian/application, so it overrides the fixed
   wall-shell body rules and adds the overview's own components. Every colour
   comes from colors.css (var(--…)); nothing is hardcoded here.
   ============================================================================ */

/* Undo the fixed wall-app shell (avian.css sets body overflow:hidden / fixed
   stage) so this page scrolls like a document. */
html { height: auto; }
body.ed {
  height: auto; min-height: 100vh; overflow: visible;
  background: var(--paper); color: var(--ink);
  font-family: ui-serif, "Iowan Old Style", "Apple Garamond", Georgia, serif;
}

.ed-main, .ed-top, .ed-foot { width: min(100%, 1120px); margin: 0 auto; padding-inline: 40px; }

/* ---- Masthead ---- */
.ed-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-top: 26px; padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}
/* React renders the brand + nav items as <button>; strip the native chrome. */
.ed-brand, .ed-navitem { background: transparent; border: 0; cursor: pointer; }
.ed-brand { display: flex; align-items: center; gap: 12px; padding: 0; text-decoration: none; color: inherit; }
.ed-mark { height: 46px; width: auto; display: block; }
/* The mark is dark line-art on transparency; flip it to read on the dark theme. */
:root[data-theme="dark"] .ed-mark { filter: invert(1); }
.ed-word { font: 500 30px/1 "Baskerville", "Hoefler Text", "EB Garamond", Georgia, serif; letter-spacing: 0.01em; }
.ed-nav { display: flex; align-items: center; gap: 28px; }
/* Nav item — one language at a time; the toggle picks which (see .lang rules). */
.ed-navitem {
  font: 11px ui-monospace, Menlo, monospace; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none; transition: color 160ms ease;
}
.ed-navitem:hover { color: var(--ink); }
.ed-navitem[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

/* Site-wide language switch: <html data-lang> shows one, hides the other. */
[data-lang="en"] .lang-ga { display: none; }
[data-lang="ga"] .lang-en { display: none; }

.ed-lang { display: inline-flex; align-items: center; }
.ed-lang-opt {
  background: transparent; border: 0; cursor: pointer; padding: 4px 8px;
  font: 10px ui-monospace, Menlo, monospace; letter-spacing: 0.12em;
  color: var(--ink-soft); transition: color 140ms ease;
}
.ed-lang-opt:hover { color: var(--ink); }
.ed-lang-opt.is-on { color: var(--ink); }
.ed-lang-opt + .ed-lang-opt { border-left: 1px solid var(--rule); }

/* Time-window picker (1H · 12H · 24H · 7D · ALL) — same understated pill row. */
.ed-window { display: inline-flex; align-items: center; background: var(--paper-2); border-radius: 999px; padding: 2px; box-shadow: var(--recess); }
.ed-win-opt {
  background: transparent; border: 0; cursor: pointer; padding: 5px 10px; border-radius: 999px;
  font: 9px ui-monospace, Menlo, monospace; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-soft); transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}
.ed-win-opt:hover { color: var(--ink); }
.ed-win-opt.is-on { color: var(--ink); background: var(--paper); box-shadow: var(--raised); }

/* Account avatar + dropdown menu */
.ed-user { position: relative; display: flex; }
.ed-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; border-radius: 999px; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 0; box-shadow: var(--edge);
  transition: box-shadow 160ms ease, transform 160ms ease;
}
.ed-avatar:hover { box-shadow: var(--raised); }
.ed-avatar { overflow: hidden; }
.ed-avatar svg { width: 21px; height: 21px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; }
.ed-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ed-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 40;
  min-width: 190px; padding: 8px; border-radius: 12px;
  background: var(--paper); box-shadow: var(--edge-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease, visibility 0s linear 140ms;
}
.ed-user.is-open .ed-menu { opacity: 1; visibility: visible; transform: translateY(0); transition: opacity 140ms ease, transform 140ms ease; }
.ed-menu-head { margin: 4px 10px 8px; font: 9px ui-monospace, Menlo, monospace; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
.ed-menu-user { padding: 6px 10px 10px; margin-bottom: 4px; box-shadow: inset 0 -1px 0 var(--hairline); }
.ed-menu-name { display: block; font: 15px/1.2 ui-serif, Georgia, serif; color: var(--ink); }
.ed-menu-sub { display: block; margin-top: 2px; font: 11px ui-monospace, Menlo, monospace; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; }
.ed-menu-item { display: block; padding: 9px 10px; border-radius: 7px; font: 14px/1 ui-serif, Georgia, serif; color: var(--ink); text-decoration: none; }
.ed-menu-item:hover { background: var(--paper-2); }
/* button_to renders a <form><button>; make the button read as a menu item. */
.ed-menu form { margin: 0; }
.ed-menu-btn { width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer; }

/* ---- The collage: dominant, full-bleed to the viewport edges ---- */
.ed-stage {
  position: relative;
  width: 100vw; margin-left: calc(50% - 50vw);
  padding: 30px clamp(20px, 5vw, 90px) 6px;
}
.ed-hero-collage { position: relative; display: flex; align-items: center; justify-content: center; }
.ed-hero-collage .collage__bg { display: none; }
.ed-hero-collage svg { width: 100%; height: auto; max-height: 76vh; display: block; }
.ed-tip {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  margin: 0; padding: 7px 16px; background: var(--paper); border-radius: 999px;
  box-shadow: var(--raised);
  font: italic 14px/1.3 "Baskerville", "Hoefler Text", Georgia, serif; color: var(--ink);
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 150ms ease;
}
.ed-tip[aria-hidden="false"] { opacity: 1; }
.ed-tip .ct-name { font-style: normal; font-weight: 600; }
.ed-tip .ct-n { font-style: normal; font-weight: 700; }
.ed-tip .ct-w { color: var(--ink-soft); }

/* ---- The nerdy details row ---- */
.ed-facts {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 14px 30px; padding: 10px 0 4px;
  font: 12px ui-monospace, Menlo, monospace; letter-spacing: 0.06em; color: var(--ink-2);
}
.ed-fact { display: inline-flex; align-items: center; gap: 7px; }

/* ---- Numbers band ---- */
.ed-band { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px; margin: 30px 0; }
.ed-num { border-top: 1px solid var(--ink); padding-top: 16px; }
.ed-num .n { display: block; font: 500 46px/0.95 ui-serif, "Iowan Old Style", Georgia, serif; font-variant-numeric: tabular-nums; }
.ed-num .lbl { display: block; margin-top: 12px; font: 10px ui-monospace, Menlo, monospace; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); }
.ed-num .sub { display: block; margin-top: 4px; font: italic 13px ui-serif, Georgia, serif; color: var(--ink-soft); }

/* ---- Columns ---- */
.ed-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; margin: 24px 0 8px; }
.ed-grp + .ed-grp { margin-top: 30px; }
.ed-col-head { display: flex; align-items: baseline; justify-content: space-between; }
.ed-cols h2 { margin: 0 0 6px; font: 700 10px ui-monospace, Menlo, monospace; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink); border-left: 2px solid var(--accent); padding-left: 10px; }
.ed-viewall { font: 9px ui-monospace, Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); text-decoration: none; }
.ed-viewall:hover { color: var(--ink); }
.ed-list { list-style: none; margin: 0; padding: 0; }
.ed-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 9px 0; text-decoration: none; color: inherit; box-shadow: inset 0 -1px 0 var(--hairline); }
a.ed-row:hover, button.ed-row:hover { background: var(--paper-2); }
button.ed-row { width: 100%; background: transparent; border: 0; cursor: pointer; font: inherit; text-align: left; }
button.barlist-row { width: 100%; background: transparent; border: 0; cursor: pointer; padding: 0; }
.stats2-side button.row { width: 100%; background: transparent; border: 0; cursor: pointer; font: inherit; text-align: left; }

/* Directory (atlas) controls + cards, rendered as <button> in React. */
.atlas-scope button, .atlas-sort button {
  /* width:auto + height:auto override avian.css's 30x26 icon-button sizing, which
     would clip these text labels and make them overlap. */
  width: auto; height: auto;
  background: transparent; border: 0; cursor: pointer; color: var(--ink-soft);
  font: 10px ui-monospace, Menlo, monospace; letter-spacing: 0.16em; padding: 7px 13px;
  border-radius: 999px; text-transform: uppercase; transition: color 200ms ease;
}
.atlas-scope button:hover, .atlas-sort button:hover { color: var(--ink); }
.atlas-scope button[aria-current="true"], .atlas-sort button[aria-current="true"] {
  color: var(--ink); background: var(--paper); box-shadow: var(--raised);
}
button.bird-card { width: 100%; background: transparent; cursor: pointer; font: inherit; text-align: left; color: inherit; }
.ed-row-name { font: 15px/1.3 ui-serif, Georgia, serif; color: var(--ink); }
.ed-gloss { font-style: italic; color: var(--ink-soft); font-size: 0.82em; margin-left: 7px; }
.ed-row-meta { flex: 0 0 auto; font: 11px ui-monospace, Menlo, monospace; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.ed-row-meta.yr { color: var(--accent-2); letter-spacing: 0.03em; }
.ed-empty { margin: 8px 0 0; font: italic 14px ui-serif, Georgia, serif; color: var(--ink-soft); }

/* ---- Footer ---- */
.ed-foot {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin-top: 40px; padding: 22px 40px 34px; border-top: 1px solid var(--rule);
  font: 10px ui-monospace, Menlo, monospace; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft);
}
.ed-foot .dot { color: var(--rule); }

/* ---- Responsive: stack for tablet / phone ---- */
@media (max-width: 860px) {
  .ed-hero { grid-template-columns: 1fr; gap: 24px; }
  .ed-cols { grid-template-columns: 1fr; gap: 34px; }
  .ed-dek { max-width: none; }
}
@media (max-width: 560px) {
  .ed-main, .ed-top, .ed-foot { padding-inline: 20px; }
  .ed-band { grid-template-columns: 1fr; gap: 18px; }
  .ed-nav { gap: 16px; }
  .ed-lede { font-size: 28px; }
  .ed-tag { display: none; }
}
