/* Shared listener chrome (templates/partials/site_nav.html). The top bar, tab bar and More sheet rules live in app.css;
   this file adds what every page needs on top: the always-visible More tab, the Appearance control, a sub-nav row,
   a plain-page shell, and guards against page stylesheets that restyle bare a/svg elements. */

:root { --site-tabbar: 0px; }

/* More holds Timeline, Topics and Samvaad, so it is shown at every width. */
.topnav-more { display: inline-flex; }

.topnav a, .tabbar a, .more-sheet a { text-decoration: none; }
.topnav .icon-button svg, .more-icon svg { width: 20px; height: 20px; }
.topnav .toptab svg { width: 14px; height: 14px; }
.more-action { color: var(--text); }

.site-theme .segmented { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Embedded pages (the topic page frames a timeline) drop the site chrome. */
[data-framed] .topnav, [data-framed] .tabbar { display: none; }

/* Secondary navigation under the top bar (Learn sections, timeline type). */
.subnav {
  display: flex; align-items: center; gap: 10px; max-width: calc(var(--page-w) + 56px); margin: 0 auto; padding: 14px 28px 4px;
}
.subnav-links { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.subnav-links::-webkit-scrollbar { display: none; }
.subnav-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap; text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.subnav-link:hover { background: var(--hover); color: var(--text); }
.subnav-link[aria-current="page"], .subnav-link.is-on { background: var(--text); border-color: var(--text); color: var(--bg); }
.subnav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Plain pages (privacy, account): page width and type from the home page tokens. */
.site-page { max-width: 760px; margin: 0 auto; padding: 8px 28px 80px; }
.site-page .page-head { padding: 22px 0 18px; }
.site-card { margin: 0 0 16px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.site-card h2 { margin: 0 0 8px; font: 700 18px/1.3 var(--font-display); letter-spacing: -0.015em; }
.site-card p { margin: 0 0 10px; }
.site-card p:last-child { margin-bottom: 0; }
.site-card ul { margin: 0; padding-left: 20px; }
.site-card li + li { margin-top: 5px; }
.site-card code { padding: 1px 5px; border-radius: 5px; background: var(--raised); font: 0.88em ui-monospace, "SF Mono", Menlo, monospace; }
.site-page a:not(.pill-button) { color: var(--accent); }

.account-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.account-links { display: flex; gap: 8px; }
.account-links form { margin: 0; }
.account-page .group { margin: 0 0 22px; }
.account-page .group > form { margin: 10px 0 0; }
.account-page h2.group-label { font-size: 13px; }
.account-page .list-row input:not([type="hidden"]) {
  min-width: 0; width: min(280px, 55%); height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); outline: none;
}
.account-page .list-row input:focus { border-color: var(--accent); }
.account-page .list-row.end { justify-content: flex-end; }
.account-page .list-row small { display: block; color: var(--text-2); font-size: 13px; }
.account-page .group-note { margin-top: 8px; font-size: 13px; }
.pill-button.danger { color: var(--bad); }
.pill-button.subtle { min-height: 30px; font-size: 13px; }
.badge.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.banner { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.banner.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); }
.banner.bad { background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); }

/* The one AI disclosure chip (partials/ai_chip.html, js/aichip.js); it always links to /about/ai. */
.ai-chip {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 22px; height: 18px;
  padding: 0 6px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); font: 700 10.5px/1 var(--font); letter-spacing: 0.04em;
  text-decoration: none !important; vertical-align: 0.1em; white-space: nowrap;
}
.ai-chip:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.ai-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-chip-label { font-weight: 600; letter-spacing: 0; }
.answer-ai-line { margin: 6px 0 0; }
.answer-text:empty + .answer-ai-line { display: none; }

/* Small notes on items and stories: "Corrected <date>" and the All India Radio excerpt notice (js/trustnotes.js). */
.trust-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--raised); color: var(--text-2); font-size: 13px;
}
.trust-note a { color: var(--accent); font-weight: 500; }
.trust-note strong { color: var(--text); font-weight: 600; }

/* Trust links at the end of every listener page (partials/site_footer.html, moved into <main> by site-nav.js). */
.site-footer {
  max-width: calc(var(--page-w) + 56px); margin: 40px auto 0; padding: 18px 28px 28px; border-top: 1px solid var(--line);
  color: var(--text-2); font-size: 13px;
}
.site-page .site-footer { padding-left: 0; padding-right: 0; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer-links a { color: var(--text-2); text-decoration: none; }
.site-footer-links a:hover { color: var(--text); text-decoration: underline; }
.site-footer-note { margin: 10px 0 0; color: var(--text-3); }
#view-ask:not([hidden]) ~ .site-footer, [data-framed] .site-footer { display: none; }

@media (max-width: 999px) {
  .topnav-more.is-on-narrow { color: var(--text); }
  .topnav-more.is-on-narrow::after { transform: scaleX(1); }
}

@media (max-width: 860px) {
  .subnav { padding: 10px 16px 2px; }
  .site-page { padding: 4px 16px 60px; }
  .site-footer { padding: 16px 16px 24px; }
}

@media (max-width: 759px) {
  :root { --site-tabbar: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .has-site-nav::after { content: ""; display: block; height: var(--site-tabbar); }
  [data-framed] { --site-tabbar: 0px; }
}
