/* ==========================================================================
   ideas/shared/idea-index.css — the Ideas CATALOGUE layout
   Compact discovery surface on top of idea-page.css. The catalogue is the
   dominant content: a slim header, a one-line summary strip, one toolbar,
   then results. Lifecycle definitions live in ONE
   place — the help popover — never twice on the same screen.
   No colour, type step or radius is declared here that the design system does
   not already own, and no container width (shared/layout.css owns that).
   ========================================================================== */

.mono { font-family: var(--font-mono); }

/* ---------- slim header ------------------------------------------------ */
.ihero--slim { padding: 16px var(--page-pad) 16px; }
.ihero--slim .crumb { margin: 0 0 8px; }
.ihero--slim .ihero__row { display: flex; align-items: baseline; gap: 8px 18px; flex-wrap: wrap; }
.ihero--slim h1 { font-size: var(--fs-2xl); margin: 0; }
.ihero__sub { font-size: var(--fs-sm); line-height: var(--lh-relaxed); color: var(--cane-100); margin: 0; max-width: 680px; overflow-wrap: break-word; }

/* ---------- sticky chrome: the Ideas local nav (idea-page.css styles it) */
.istick { position: sticky; top: 0; z-index: 50; background: var(--cane-900); }
.istick .inav { position: static; }

/* ---------- summary strip ---------------------------------------------- */
.sumstrip { display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; padding: 0 0 12px; margin: 0; border-bottom: 1px solid var(--border); }
.sf { display: inline-flex; align-items: baseline; gap: 6px; }
.sf__v { font-family: var(--font-mono); font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--cane-700); line-height: 1.2; }
[data-theme="dark"] .sf__v { color: var(--cane-300); }
.sf__k { font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--ls-caps); color: var(--text-subtle); }
.sumstrip__sp { flex: 1 1 auto; }

/* ---------- help popover (the ONE lifecycle explanation) --------------- */
.hlp { position: relative; }
.hlpbtn { font-family: var(--font-mono); font-size: var(--i-ctrl-fs); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; height: var(--i-ctrl-h); padding: 0 var(--i-ctrl-px); border: 1px solid var(--border); border-radius: var(--radius-md, 2px); background: var(--surface); color: var(--text-muted); cursor: pointer; }
.hlpbtn:hover { border-color: var(--border-strong); color: var(--text); }
.hlpbtn[aria-expanded="true"] { background: var(--primary-soft, var(--surface-2)); border-color: color-mix(in oklch, var(--primary) 35%, transparent); color: var(--primary); }
.hlpbtn__q { font-weight: var(--fw-bold); border: 1px solid currentColor; border-radius: 999px; width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; }
.hlppanel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 90; width: min(720px, calc(100vw - 2 * var(--page-pad))); border: 1px solid var(--border-strong); border-radius: var(--radius-lg, 3px); background: var(--surface); box-shadow: 0 8px 28px rgba(15, 32, 24, .18); padding: 14px 16px; }
[data-theme="dark"] .hlppanel { box-shadow: 0 8px 28px rgba(0, 0, 0, .5); }
.hlppanel__hd { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.hlppanel__t { font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--ls-caps); color: var(--text-subtle); margin: 0; }
.hlppanel__x { margin-left: auto; }
.hlppanel__note { font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-relaxed); margin: 0 0 12px; text-wrap: pretty; }
.hlpcols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .hlpcols { grid-template-columns: 1fr; } }
.hlpcols h3 { font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--ls-caps); color: var(--text-subtle); margin: 0 0 8px; }
.hlpcols dl { margin: 0; display: grid; gap: 6px; }
.hlpcols .lk { display: grid; grid-template-columns: auto 1fr; gap: 9px; align-items: baseline; }
.hlpcols dd { margin: 0; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.45; }

/* ---------- toolbar ---------------------------------------------------- */
.tbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 0; }
.srch { display: flex; flex: 1 1 340px; min-width: 240px; gap: 6px; }
.srch input[type="search"] { flex: 1 1 auto; min-width: 0; font-family: inherit; font-size: var(--fs-xs); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md, 2px); padding: 0 9px; min-height: var(--i-ctrl-h);  height: var(--i-ctrl-h); }
.sbtn { font-family: var(--font-mono); font-size: var(--i-ctrl-fs); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; height: var(--i-ctrl-h); padding: 0 var(--i-ctrl-px); border: 1px solid var(--primary); border-radius: var(--radius-md, 2px); background: var(--primary); color: var(--neutral-0); cursor: pointer; }
.sbtn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.sbtn:disabled { opacity: .5; cursor: not-allowed; }
.fld { display: inline-flex; align-items: center; gap: 6px; height: var(--i-ctrl-h); padding: 0 0 0 8px; border: 1px solid var(--border); border-radius: var(--radius-md, 2px); background: var(--surface); }
.fld__k { font-family: var(--font-mono); font-size: var(--i-ctrl-fs); text-transform: uppercase; letter-spacing: var(--ls-caps); color: var(--text-subtle); white-space: nowrap; }
.fld select { font-family: inherit; font-size: var(--fs-xs); color: var(--text); background: transparent; border: 0; border-radius: 0 var(--radius-md, 2px) var(--radius-md, 2px) 0; padding: 0 6px; max-width: 168px; }
.fld select:disabled { color: var(--text-subtle); }
.tbar input:focus-visible, .tbar select:focus-visible, .sbtn:focus-visible, .hlpbtn:focus-visible, .achip button:focus-visible, .pbtn:focus-visible, .lbtn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.fld:focus-within { border-color: var(--primary); }
.lbtn { font-family: var(--font-mono); font-size: var(--i-ctrl-fs); text-transform: uppercase; letter-spacing: .05em; height: var(--i-ctrl-h); padding: 0 var(--i-ctrl-px); border: 1px solid var(--border); border-radius: var(--radius-md, 2px); background: var(--surface); color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.lbtn:hover { border-color: var(--border-strong); color: var(--text); }
.tbar__hint { flex: 1 1 100%; font-size: var(--fs-2xs); color: var(--text-subtle); margin: 0; line-height: 1.5; }

/* ---------- active filter chips ---------------------------------------- */
.achips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; }
.achips__k { font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--ls-caps); color: var(--text-subtle); }
.achip { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-mono); font-size: var(--fs-2xs); padding: 3px 3px 3px 8px; border: 1px solid color-mix(in oklch, var(--primary) 35%, transparent); border-radius: var(--radius-md, 2px); background: var(--primary-soft, var(--surface-2)); color: var(--primary); max-width: 320px; }
.achip__t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.achip button { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 2px; background: transparent; color: inherit; cursor: pointer; font-size: 12px; line-height: 1; flex: none; }
.achip button:hover { background: color-mix(in oklch, var(--primary) 18%, transparent); }

/* ---------- smart-search status --------------------------------------- */
.smartbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-md, 2px); background: var(--surface-2); font-size: var(--fs-xs); color: var(--text); }
.smartbar--ok { background: var(--info-soft); border-color: color-mix(in oklch, var(--info) 30%, transparent); }
.smartbar--err { background: var(--warning-soft); border-color: color-mix(in oklch, var(--warning) 35%, transparent); }
.smartbar__tag { font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--ls-caps); border: 1px solid currentColor; border-radius: 2px; padding: 1px 5px; white-space: nowrap; }
.smartbar__m { flex: 1 1 240px; line-height: 1.45; text-wrap: pretty; }
.smartbar__n { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-muted); }
.spin { width: 13px; height: 13px; border: 2px solid color-mix(in oklch, var(--primary) 30%, transparent); border-top-color: var(--primary); border-radius: 999px; animation: ispin .8s linear infinite; flex: none; }
@keyframes ispin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* ---------- results header + pager ------------------------------------ */
.resline { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin: 14px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.resline__t { font-family: var(--font-mono); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--ls-caps); color: var(--text-muted); margin: 0; }
.resline__t:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.resline__r { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-subtle); }
.resline__sp { flex: 1 1 auto; }

.pager { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pbtn { font-family: var(--font-mono); font-size: var(--i-ctrl-fs); min-width: var(--i-ctrl-h); height: var(--i-ctrl-h); padding: 0 7px; border: 1px solid var(--border); border-radius: var(--radius-md, 2px); background: var(--surface); color: var(--text-muted); cursor: pointer; }
.pbtn:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.pbtn:disabled { opacity: .45; cursor: not-allowed; }
.pbtn[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--neutral-0); font-weight: var(--fw-bold); }
.pgap { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-subtle); padding: 0 2px; }
.pfoot { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------- groups ---------------------------------------------------- */
.igroup { margin: 18px 0 0; }
.igroup:first-child { margin-top: 0; }
.igroup__hd { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; }
.igroup__t { font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--ls-caps); color: var(--text-muted); margin: 0; }
.igroup__n { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-subtle); }

/* ---------- result cards ---------------------------------------------- */
.icards { display: grid; grid-template-columns: repeat(auto-fill, minmax(430px, 1fr)); gap: 10px; }
@media (max-width: 900px) { .icards { grid-template-columns: 1fr; } }
html[data-rs^="tablet"] .icards { grid-template-columns: 1fr; }

/* THE CARD IS THE LINK. The real anchor is on the id + title (keyboard,
   middle-click and no-JS all work through it); the card body activates the
   same href on a plain click that is not on a nested control and is not a
   text selection. */
.icard { position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg, 3px); background: var(--surface); padding: 10px 12px; cursor: pointer; transition: border-color var(--dur-fast, .14s) var(--ease-standard, ease), box-shadow var(--dur-fast, .14s) var(--ease-standard, ease), transform var(--dur-fast, .14s) var(--ease-standard, ease); }
@media (prefers-reduced-motion: reduce) { .icard { transition: none; } }
.icard:hover { border-color: color-mix(in oklch, var(--primary) 45%, var(--border)); box-shadow: 0 2px 10px rgba(15, 32, 24, .09); transform: translateY(-1px); }
[data-theme="dark"] .icard:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.icard:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; border-color: var(--primary); }
@media (max-width: 560px) { .icard { grid-template-columns: 72px 1fr; gap: 10px; } }
.icard__thumb { border: 1px solid var(--border); border-radius: var(--radius-md, 2px); overflow: hidden; background: var(--surface-3); align-self: start; }
.icard__thumb svg { display: block; width: 100%; height: auto; }
.icard__b { display: grid; gap: 6px; align-content: start; min-width: 0; }
/* …AND its children. A grid item keeps `min-width: auto`, so the footer's
   RELATED / DOWNSTREAM run (the widest row a card carries) held the track open
   at its own max-content and spilled out of the card — visible on screen at
   three columns and clipped on the A4 sheet. The folder's own responsive rule
   asks for `min-width: 0` on the children of every grid; this is that rule
   applied where it was missing. Found by the sheet view of 31 Aug 2026. */
.icard__b > * { min-width: 0; }
.icard__lnk { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; text-decoration: none; color: inherit; }
.icard__lnk:focus-visible { outline: none; }
.icard__id { font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: var(--fw-bold); color: var(--primary); }
.icard__t { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--cane-900); margin: 0; line-height: 1.35; }
[data-theme="dark"] .icard__t { color: var(--text-strong); }
.icard:hover .icard__t, .icard:focus-within .icard__t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.icard__c { font-size: var(--fs-xs); line-height: 1.5; color: var(--text-muted); margin: 0; text-wrap: pretty; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.icard__meta { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.icard__meta .pill { font-size: 9px; padding: 1px 5px; }
.icard__more { font-family: var(--font-mono); font-size: 9px; color: var(--text-subtle); }
.icard__why { font-size: var(--fs-2xs); line-height: 1.45; color: var(--text); margin: 0; padding: 5px 8px; border-left: 2px solid color-mix(in oklch, var(--info) 60%, transparent); background: var(--info-soft); border-radius: 0 2px 2px 0; text-wrap: pretty; }
.icard__why b { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing: var(--ls-caps); color: var(--text-subtle); margin-right: 6px; font-weight: var(--fw-bold); }
.icard__foot { display: flex; gap: 4px 14px; flex-wrap: wrap; align-items: baseline; border-top: 1px solid var(--border-subtle, var(--border)); padding-top: 6px; font-family: var(--font-mono); font-size: 10px; color: var(--text-subtle); }
.icard__foot a { position: relative; z-index: 2; color: var(--primary); text-decoration: none; }
.icard__foot a:hover { text-decoration: underline; }
.icard__foot .nw { white-space: nowrap; }
.icard__k { text-transform: uppercase; letter-spacing: var(--ls-caps); }

.iempty { border: 1px dashed var(--border-strong); border-radius: var(--radius-lg, 3px); background: var(--surface); padding: 28px; text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------- reviewer harness (off unless ?stress= is in the URL) ------- */
.stressbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--danger); border-radius: var(--radius-md, 2px); background: var(--danger-soft); font-size: var(--fs-xs); color: var(--text); }
.stressbar b { font-family: var(--font-mono); font-size: var(--fs-2xs); text-transform: uppercase; letter-spacing: var(--ls-caps); }
.icard--synthetic { border-style: dashed; cursor: default; }
.icard--synthetic:hover { transform: none; box-shadow: none; border-color: var(--border); }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
