/* ============================================================
   portal.css — Open ONDC additions layered on the engine (site.css).
   Only the classes the ONDC information architecture introduces,
   plus a few hero/stat refinements. Loaded AFTER site.css, so a
   handful of rules here intentionally refine engine defaults.
   Every colour/shape/type value comes from a token — no literals
   except the translucent white overlays used on the navy hero.
   ============================================================ */

/* ---------- stat tiles (build emits .stat-v/.stat-l; engine styles .stat .n/.l) ---------- */
.stat-v { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; color: var(--primary); line-height: 1.1; }
.stat-l { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- home hero ---------- */
.hero-sub { color: var(--hero-muted); font-size: clamp(0.98rem, 2vw, 1.14rem); max-width: 60ch; margin-top: 14px; }
.hl { color: var(--brand-cyan); }
.hero .hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
/* stat tiles floating on the navy hero read as translucent glass */
.hero-stats { margin-top: 30px; }
.hero-stats .stat {
  background: rgb(255 255 255 / 0.08);
  border-color: rgb(255 255 255 / 0.18);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.hero-stats .stat-v { color: var(--hero-text); }
.hero-stats .stat-l { color: var(--hero-muted); }
@media (max-width: 560px) { .hero-cta .btn { flex: 1 1 100%; } }

/* ---------- lead paragraph (engine styles .page-head .lede; we emit .lead) ---------- */
.lead { margin-top: 10px; font-size: 1.05rem; color: var(--text-muted); max-width: 64ch; }
.lead p { margin-top: 10px; }
.lead p:first-child { margin-top: 0; }
.lead a { color: var(--link); }

/* ---------- browse cards on the home + section pages ---------- */
.card-link { display: flex; flex-direction: column; }
.card-link .card-icon { margin-bottom: 12px; }
.card-link h3 { font-size: 1.02rem; }
.card-link p { margin-top: 6px; }

/* ---------- section header row ("Latest news →") ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 4px; }
.sec-head h2 { margin: 0; }
.sec-more { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; font-weight: 600; color: var(--link); white-space: nowrap; }
.sec-more svg { width: 15px; height: 15px; }
.sec-more:hover { text-decoration: none; color: var(--link-hover); }

/* ---------- directory / news search field ---------- */
.dir-search { position: relative; flex: 1 1 260px; min-width: 200px; }
.dir-search input {
  width: 100%; padding: 10px 14px; font-size: 0.92rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
.dir-search input::placeholder { color: var(--text-faint); }
.dir-search input:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 22%, transparent); }

/* ---------- segmented filter buttons (directory categories, news years) ---------- */
.seg-wrap { display: flex; flex-wrap: wrap; gap: 7px; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; font-size: 0.82rem; font-weight: 600; line-height: 1;
  color: var(--text-muted); background: var(--surface); cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  transition: color var(--speed) var(--ease), background var(--speed) var(--ease), border-color var(--speed) var(--ease);
}
.seg-btn:hover { border-color: var(--border-strong); color: var(--text); }
.seg-btn.is-active { color: var(--primary-contrast); background: var(--primary); border-color: var(--primary); }
.seg-btn .count-pill { margin-left: 4px; }
.seg-btn.is-active .count-pill { color: var(--primary-contrast); background: rgb(255 255 255 / 0.22); }

/* ---------- repo directory grid + cards (extend engine .scheme-card) ---------- */
.repo-grid { scroll-margin-top: 80px; }
.repo-card .abbr { text-transform: none; }
.repo-card h3 { font-family: var(--font-mono); font-size: 0.92rem; word-break: break-word; }

/* ---------- domain spec repo links (domains page) ---------- */
.dom-repo {
  display: flex; align-items: center; gap: 8px; margin-top: 8px;
  font-size: 0.85rem; color: var(--text); font-family: var(--font-mono);
}
.dom-repo svg { width: 15px; height: 15px; flex: none; color: var(--text-faint); }
.dom-repo:hover { text-decoration: none; color: var(--link); }
.dom-repo .stars { margin-left: auto; font-size: 0.78rem; color: var(--accent); font-family: var(--font-body); font-weight: 600; }
.card .top .count-pill { margin-left: 0; }

/* ---------- FAQ disclosure cards (engine .qcard is a container; we add <details>) ---------- */
details.qcard { padding: 0; }
details.qcard summary {
  list-style: none; cursor: pointer; padding: 16px 20px;
  font-weight: 600; font-size: 0.98rem; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
details.qcard summary::-webkit-details-marker { display: none; }
details.qcard summary::before {
  content: ""; width: 8px; height: 8px; flex: none;
  border-right: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint);
  transform: rotate(-45deg); transition: transform var(--speed) var(--ease);
}
details.qcard[open] summary::before { transform: rotate(45deg); }
details.qcard summary:hover { color: var(--link); }
details.qcard > div { padding: 0 20px 18px 38px; color: var(--text-muted); font-size: 0.92rem; }
details.qcard > div p { margin-top: 8px; }
details.qcard + .qcard { margin-top: 10px; }

/* ---------- brand: official ONDC network-cursor mark in the topbar ---------- */
.brand-logo { width: 26px; height: 26px; flex: none; display: block; border-radius: 6px; }

/* ---------- footer: official ONDC wordmark as source attribution ---------- */
.footer-note { display: flex; align-items: flex-start; gap: 14px; }
.footer-wordmark {
  flex: none; width: 104px; height: auto; align-self: center;
  padding: 7px 9px; border-radius: 10px;
  background: #fff; box-shadow: var(--shadow-1);
}
@media (max-width: 520px) { .footer-note { flex-direction: column; gap: 10px; } }

/* ---------- global news bar: flush strip under the topbar, above the app shell ---------- */
body > .news-ticker {
  margin: 0;
  border-width: 0 0 1px 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
}

/* ============================================================
   Audience-first components (home doors, explainers, journeys)
   ============================================================ */

/* ---------- persona doors: the three "start here" entry points ---------- */
.doors { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); margin: -26px 0 8px; position: relative; z-index: 2; }
.door {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; color: inherit;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.door:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-3); border-color: var(--link); }
.door .card-icon { flex: none; }
.door-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.door-body strong { font-size: 1rem; letter-spacing: -0.01em; }
.door-body span { font-size: 0.84rem; color: var(--text-muted); line-height: 1.4; }
.door-arrow { margin-left: auto; color: var(--text-faint); flex: none; transition: transform var(--speed) var(--ease), color var(--speed) var(--ease); }
.door-arrow svg { width: 18px; height: 18px; }
.door:hover .door-arrow { transform: translateX(3px); color: var(--accent); }

/* ---------- explainer prose ---------- */
.explain { max-width: 68ch; }
.explain p { margin-top: 12px; color: var(--text-muted); line-height: 1.65; }
.explain .explain-lede, .section-lede { font-size: 1.06rem; color: var(--text); line-height: 1.6; max-width: 68ch; }
.explain .explain-lede { margin-top: 0; }
.section-lede { margin: 6px 0 16px; color: var(--text-muted); }

/* ---------- "not an app" style callout ---------- */
.callout {
  display: block; margin: 22px 0 0; padding: 16px 20px; max-width: 68ch;
  background: var(--accent-tint); border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.callout strong { color: var(--accent-strong); font-size: 0.95rem; }
.callout p { margin-top: 6px; font-size: 0.92rem; color: var(--text); line-height: 1.55; }

/* ---------- numbered step lists (journeys) ---------- */
.steps { list-style: none; margin: 18px 0 0; padding: 0; max-width: 70ch; counter-reset: step; }
.step { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; }
.step + .step { border-top: 1px dashed var(--border); }
.step-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: var(--primary-contrast);
  font-weight: 700; font-size: 0.88rem; font-family: var(--font-display);
}
.step-body strong { display: block; margin-bottom: 3px; }
.step-body p { color: var(--text-muted); font-size: 0.93rem; line-height: 1.55; margin: 0; }

/* ---------- transaction-flow strip ---------- */
.flow { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); margin-top: 18px; }
.flow-stage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.flow-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.flow-top .step-num { width: 26px; height: 26px; font-size: 0.8rem; }
.flow-top strong { font-size: 0.95rem; }
.flow-stage p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.5; }
.flow-actors { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }

/* ---------- network diagram (who talks to whom) ---------- */
.netmap {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px;
  margin: 24px 0 4px; padding: 18px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg); background: var(--surface-alt);
}
.net-node {
  flex: 1 1 130px; min-width: 120px;
  display: flex; flex-direction: column; gap: 3px; justify-content: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 12px; text-align: center;
}
.net-node strong { font-size: 0.86rem; color: var(--primary); }
.net-node span { font-size: 0.74rem; color: var(--text-faint); line-height: 1.35; }
.net-arrow { align-self: center; color: var(--accent); font-weight: 700; font-size: 1.1rem; flex: none; }
@media (max-width: 700px) { .netmap { flex-direction: column; } .net-arrow { transform: rotate(90deg); } }

/* ---------- checklists (benefits, principles) ---------- */
.checklist { list-style: none; margin: 16px 0 0; padding: 0; max-width: 70ch; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-muted); font-size: 0.95rem; line-height: 1.5; }
.checklist svg { width: 17px; height: 17px; flex: none; color: var(--success); margin-top: 2px; }

/* ---------- category pills (non-link) ---------- */
.cat-pill {
  display: inline-block; font-size: 0.84rem; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill); padding: 6px 14px;
}

/* ---------- testimonials ---------- */
.quotecard blockquote { font-size: 0.93rem; color: var(--text); line-height: 1.55; font-style: italic; }
.quotecard figcaption { margin-top: 10px; font-size: 0.82rem; color: var(--text-faint); font-weight: 600; }

/* ---------- example walkthrough card + as-of caption ---------- */
.example-card { margin-top: 22px; max-width: 76ch; }
.example-card .steps { margin-top: 8px; }
.asof { font-size: 0.7rem; color: var(--text-faint); margin-top: 5px; font-family: var(--font-mono); }

/* ---------- inline icons inside card headings (e.g. external-link) ---------- */
.card h3 svg { width: 15px; height: 15px; flex: none; color: var(--text-faint); }

/* ---------- misc ---------- */
.stars { white-space: nowrap; }
