/* Portal home composition on top of style.css. Keep this file under 120 lines. */

/* ---- Hero: headline column and the directory board ---------------------- */
.hero { padding: clamp(2.5rem, 1.5rem + 3.5vw, 5rem) 0; border-bottom: 1px solid var(--border); }
/* em, not ch: ch is a Latin digit width and would starve CJK headlines. */
.hero h1 { max-width: 12em; margin-bottom: var(--space-5); }
.hero-lead { max-width: 52ch; }
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-8); align-items: end; }
}

.board-summary { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
/* Hairline grid: 1px gaps over the border colour, so tiles share edges. */
.board {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  margin: 0; padding: 0; list-style: none;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
@media (min-width: 600px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.board li { display: flex; margin: 0; }
.board-item {
  display: flex; flex: 1; flex-direction: column; gap: var(--space-1);
  min-height: 7.5rem; padding: var(--space-4);
  background: var(--surface-raised); color: var(--text-muted); text-decoration: none;
  transition: background-color var(--dur) var(--ease-out);
}
.board-item:hover { background: var(--bg); color: var(--text-muted); }
.board-item:focus-visible { outline-offset: -5px; }
.board-code, .board-state { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.04em; }
.board-name { margin-top: auto; color: var(--text); font-weight: 600; line-height: 1.25; transition: transform var(--dur) var(--ease-out); }
.board-state { display: inline-flex; align-items: center; gap: var(--space-2); }
.board-state::before { content: ""; width: 7px; height: 7px; border: 1.5px solid currentColor; border-radius: 50%; }
/* The one live service is the focal tile: ink surface plus an accent edge. */
.board-ok, .board-ok:hover { background: var(--inverse-bg); color: var(--inverse-muted); box-shadow: inset 0 3px 0 var(--inverse-accent); }
.board-ok .board-name { color: var(--inverse-text); }
.board-ok .board-state { color: var(--inverse-success); }
.board-ok .board-state::before { background: currentColor; }
.board-ok:focus-visible { outline-color: var(--inverse-accent); }

/* ---- Directory ledger: numbered rows instead of a grid of cards ---------- */
.ledger { margin: 0; padding: 0; list-style: none; border-top: 2px solid var(--rule); }
.ledger > li + li { margin-top: 0; }
.entry {
  position: relative; display: grid; gap: var(--space-2) var(--space-4);
  grid-template-columns: 2.5rem minmax(0, 1fr); grid-template-areas: "num code" "body body" "meta meta";
  padding: var(--space-5) var(--space-3); border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--header-height) + var(--space-5));
  transition: background-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
@media (min-width: 769px) {
  .entry { grid-template-columns: 2.5rem 4.5rem minmax(0, 1fr) auto; grid-template-areas: "num code body meta"; align-items: baseline; padding-inline: var(--space-4); }
  .entry-meta { justify-content: flex-end; }
}
.entry-num, .entry-code { font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.04em; }
.entry-num { grid-area: num; color: var(--text-muted); }
.entry-code { grid-area: code; color: var(--primary); font-weight: 600; }
.entry-body { grid-area: body; }
.entry-body p { margin: 0; max-width: 52ch; color: var(--text-muted); }
.entry-title { margin-bottom: var(--space-1); font-size: var(--text-lg); }
.entry-meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }

/* Live row: the title link stretches over the whole row. */
.entry-ok { background: var(--surface-raised); box-shadow: inset 3px 0 0 var(--primary); }
.entry-ok:hover { background: var(--primary-soft); }
.entry-ok .entry-title { font-family: var(--font-display); font-size: clamp(1.5rem, 1.3rem + 0.6vw, 1.875rem); font-weight: 600; letter-spacing: -0.02em; }
.entry-link { color: inherit; text-decoration: none; }
.entry-link:hover { color: inherit; }
.entry-link::after { content: ""; position: absolute; inset: 0; }
.entry-link:focus-visible { outline-color: transparent; } /* not none: forced colors repaint it */
.entry-link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: -3px; }
.entry-action {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--target); padding: 0 var(--space-4);
  border-radius: var(--radius); background: var(--primary); color: var(--on-primary); font-weight: 600;
  transition: background-color var(--dur-fast) ease;
}
.entry-ok:hover .entry-action { background: var(--primary-hover); }
.entry-action .icon { transition: transform var(--dur) var(--ease-out); }

/* Not live: no link, no hover, receding type; the badge carries the state. */
.entry-soon .entry-code { color: var(--text-muted); font-weight: 400; }
.entry-soon .entry-title { color: var(--text-muted); font-weight: 600; }
/* Arriving from the board: mark the row that was jumped to. */
.entry:target { box-shadow: inset 3px 0 0 var(--primary); background: var(--surface-raised); }
@media (prefers-reduced-motion: no-preference) { /* movement is opt-in; colour feedback always works */
  .board-item:hover .board-name { transform: translateX(2px); }
  .entry-ok:hover .entry-action .icon { transform: translate(2px, -2px); }
  .entry-ok:active .entry-action { transform: translateY(1px); }
}

/* ---- Boundaries: two ruled columns, check and cross marks ---------------- */
.boundary { border-top: 1px solid var(--border); }
.boundary-cols { display: grid; gap: var(--space-6); padding-top: var(--space-5); border-top: 2px solid var(--rule); }
@media (min-width: 769px) {
  .boundary-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .boundary-col:first-child { padding-right: var(--space-6); }
  .boundary-col + .boundary-col { padding-left: var(--space-6); border-left: 1px solid var(--border); }
}
.boundary-col h3 { margin-bottom: var(--space-3); }
.mark-list { margin: 0; padding: 0; list-style: none; }
.mark-list li { position: relative; margin: 0; padding: var(--space-3) 0 var(--space-3) var(--space-6); border-top: 1px solid var(--border); }
.mark-list li::before { content: ""; position: absolute; left: 0.125rem; top: calc(var(--space-3) + 0.45em); width: 0.75rem; height: 0.75rem; }
.mark-yes li::before {
  height: 0.4rem; top: calc(var(--space-3) + 0.5em); color: var(--success);
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
}
.mark-no li::before {
  color: var(--text-muted);
  background: linear-gradient(45deg, transparent 42%, currentColor 42% 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, currentColor 42% 58%, transparent 58%);
}

/* ---- Closing band: inverse panel ---------------------------------------- */
.cta-band { --focus: var(--inverse-accent); background: var(--inverse-bg); color: var(--inverse-text); }
.cta-inner { display: grid; gap: var(--space-6); }
@media (min-width: 1024px) { .cta-inner { grid-template-columns: minmax(0, 1fr) auto; align-items: end; } }
.cta-band .lead { margin: 0; color: var(--inverse-muted); }
.cta-band .btn-primary { background: var(--inverse-accent); color: var(--inverse-on-accent); }
.cta-band .btn-primary:hover { background: var(--inverse-accent-hover); color: var(--inverse-on-accent); }
.cta-band .btn-secondary { border-color: var(--inverse-muted); color: var(--inverse-text); }
.cta-band .btn-secondary:hover { background: transparent; border-color: var(--inverse-text); color: var(--inverse-text); }
