@import url("https://fonts.googleapis.com/css2?family=Newsreader:opsz,wght@6..72,400;6..72,500;6..72,600&family=Noto+Serif+Devanagari:wght@400;500;600&family=Noto+Sans+Devanagari:wght@400;500;600&display=swap");

/* Portal layout on the light parchment palette.
   Reading pages stay a single calm column; the home page and hubs use tiles and panels. */
:root {
  --paper: #f7f2e6;
  --panel: #fffaf0;
  --ink: #1b2236;
  --muted: #5a6276;
  --card: #fffaf0;
  --line: #d8cfb6;
  --accent: #7d5a14;
  --accent-soft: #efe6cc;
  --gold: #7d5a14;
  --band: #5b1f14;        /* maroon nav band */
  --band-ink: #fbefd9;
  --saffron: #b4501a;     /* call-to-action */
  --saffron-ink: #ffffff;
  --max: 1180px;
  --read: 720px;
  --radius: 10px;
  --serif: "Newsreader", "Noto Serif Devanagari", Georgia, "Times New Roman", serif;
  --sans: "Noto Sans Devanagari", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.7 var(--serif);
  font-feature-settings: "kern", "liga";
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0 0 .6rem; }
h2 { font-size: 1.45rem; margin: 2.4rem 0 .6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
h3 { font-size: 1.2rem; margin: 1.6rem 0 .4rem; }
p { margin: 0 0 1.05rem; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; }
table { font-variant-numeric: tabular-nums; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.read { max-width: var(--read); }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--paper); padding: 6px 10px; z-index: 10; }

/* ---------- Header: utility strip, name row, maroon nav band ---------- */
.site-header { background: var(--paper); }
.topbar { background: var(--ink); color: #d9dcea; font-family: var(--sans); font-size: .78rem; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 32px; }
.topbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-switch { color: #fff; text-decoration: none; font-weight: 600; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 1px 12px; flex: none; }
.lang-switch:hover { background: rgba(255,255,255,.12); }
.brandrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; color: var(--ink); text-decoration: none; line-height: 1.1; }
.brand small { display: block; font-family: var(--sans); font-size: .74rem; font-weight: 400; color: var(--muted); letter-spacing: .02em; margin-top: 3px; }
.cta, .btn-solid {
  display: inline-block; background: var(--saffron); color: var(--saffron-ink); text-decoration: none;
  font-family: var(--sans); font-size: .9rem; font-weight: 600; padding: 9px 18px; border-radius: 999px; border: 0; cursor: pointer;
}
.cta:hover, .btn-solid:hover { background: #963f12; }
.menu-btn[hidden] { display: none; }
.nav { background: var(--band); }
.nav .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav .wrap::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--band-ink); text-decoration: none; font-family: var(--sans); font-size: .9rem; font-weight: 500;
  padding: 11px 13px; white-space: nowrap; border-bottom: 3px solid transparent;
}
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { border-bottom-color: #f0b25a; color: #fff; }
@media (max-width: 640px) {
  .brand { font-size: 1.35rem; }
  .brand small { display: none; }
  .cta { padding: 8px 14px; font-size: .85rem; }
  .topbar span { font-size: .72rem; }
}

/* Breadcrumb */
.crumbs { font-family: var(--sans); font-size: .8rem; color: var(--muted); padding: 18px 0 0; }
.crumbs a { color: var(--muted); }

/* ---------- Home portal ---------- */
.portal-hero { padding: 24px 0 8px; }
.portal-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin-bottom: .3rem; }
.portal-hero .lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 18px; max-width: 760px; }
.hero-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.panel-title { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.panel-title h2 { margin: 0; padding: 0; border: 0; font-size: 1.3rem; }
.panel-title a { font-family: var(--sans); font-size: .82rem; white-space: nowrap; }
.panel label { display: block; font-family: var(--sans); font-size: .76rem; color: var(--muted); margin: 10px 0 4px; }
.panel input, .panel select {
  width: 100%; font: inherit; font-size: 1rem; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.panel input:focus, .panel select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.panel .row2 { display: grid; gap: 0 12px; grid-template-columns: 1fr 1fr; }
.panel .btn-solid { margin-top: 14px; width: 100%; padding: 11px 18px; font-size: .95rem; }
.panel .note { font-family: var(--sans); font-size: .78rem; color: var(--muted); margin: 10px 0 0; }

.today { width: 100%; border-collapse: collapse; font-size: .98rem; }
.today th { text-align: left; font-family: var(--sans); font-weight: 500; font-size: .82rem; color: var(--muted); padding: 7px 10px 7px 0; vertical-align: top; width: 38%; }
.today td { padding: 7px 0; border-bottom: 1px solid var(--accent-soft); }
.today tr:last-child td { border-bottom: 0; }
.today .sub { display: block; font-family: var(--sans); font-size: .76rem; color: var(--muted); }
.today-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.today-head select { width: auto; flex: 1; padding: 6px 8px; font-size: .9rem; }
.today-date { font-family: var(--sans); font-size: .82rem; color: var(--muted); }

.block { padding: 26px 0 4px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.block-head h2 { margin: 0; padding: 0; border: 0; font-size: 1.45rem; }
.block-head a { font-family: var(--sans); font-size: .85rem; white-space: nowrap; }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
@media (max-width: 520px) {
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile { flex-direction: column; gap: 8px; padding: 12px; }
  .tile .glyph { width: 38px; height: 38px; font-size: 1.05rem; }
}
.tile {
  display: flex; gap: 12px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s;
}
a.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile .glyph {
  flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--band); font-family: "Noto Serif Devanagari", serif; font-size: 1.2rem; font-weight: 600;
}
.tile strong { display: block; font-family: var(--sans); font-size: .98rem; font-weight: 600; line-height: 1.3; }
.tile span.d { display: block; font-family: var(--sans); font-size: .8rem; color: var(--muted); line-height: 1.45; margin-top: 3px; }
.tile[aria-disabled="true"] { opacity: .6; }
.tile .soon { display: inline-block; font-family: var(--sans); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--saffron); margin-top: 4px; }

.rashi-grid { display: grid; gap: 10px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 900px) { .rashi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .rashi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.rashi {
  display: block; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 6px; text-decoration: none; color: var(--ink);
}
.rashi:hover { border-color: var(--accent); }
.rashi .dv { display: block; font-family: "Noto Serif Devanagari", serif; font-size: 1.35rem; color: var(--band); line-height: 1.3; }
.rashi .en { display: block; font-family: var(--sans); font-size: .82rem; font-weight: 600; }
.rashi .lord { display: block; font-family: var(--sans); font-size: .72rem; color: var(--muted); }

.cols3 { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .cols3 { grid-template-columns: 1fr; } }
.linklist { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: .9rem; }
.linklist li { border-bottom: 1px solid var(--accent-soft); }
.linklist li:last-child { border-bottom: 0; }
.linklist a { display: block; padding: 7px 0; color: var(--ink); text-decoration: none; }
.linklist a:hover { color: var(--accent); }
.linklist .m { color: var(--muted); font-size: .78rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a {
  font-family: var(--sans); font-size: .8rem; text-decoration: none; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.trust { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .trust { grid-template-columns: 1fr; } }
.trust .panel h3 { margin: 0 0 4px; font-size: 1.05rem; }
.trust .panel p { margin: 0; font-family: var(--sans); font-size: .85rem; color: var(--muted); line-height: 1.5; }

/* ---------- Hubs and older list cards ---------- */
.hero { padding: 32px 0 12px; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 680px; margin-top: .6rem; }
.btn {
  display: inline-block; padding: 10px 2px 10px 16px; font-family: var(--sans); font-size: .82rem;
  letter-spacing: .04em; text-transform: uppercase; background: none; color: var(--accent);
  border: 0; text-decoration: none; cursor: pointer;
}
.section { padding: 16px 0 8px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.section-head h2 { border: 0; padding: 0; margin: 1.4rem 0 .4rem; }
.section-head a { font-family: var(--sans); font-size: .85rem; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; color: var(--ink);
}
a.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 4px; font-size: 1.1rem; color: var(--accent); }
.card p { margin: 0; color: var(--muted); font-family: var(--sans); font-size: .85rem; line-height: 1.5; }
.card[aria-disabled="true"] { opacity: .62; }
.card[aria-disabled="true"] h3 { color: var(--ink); }
.tag { display: block; font-family: var(--sans); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--saffron); margin: 0 0 4px; }

/* ---------- Long-form pages ---------- */
.article { padding: 16px 0 48px; }
.answer { font-size: 1.15rem; line-height: 1.6; color: var(--ink); margin: 14px 0 28px; }
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 28px; font-family: var(--sans); font-size: .9rem; }
.toc strong { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; }
.toc ol { margin: 8px 0 0; padding-left: 20px; }
.two-col { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr) 260px; }
.side { position: sticky; top: 16px; align-self: start; font-family: var(--sans); font-size: .95rem; }
.side .card { margin-bottom: 10px; }
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; gap: 24px; }
  .side { position: static; }
}
.sources { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--gold); font-family: var(--sans); font-size: .85rem; color: var(--muted); }

/* ---------- Tools ---------- */
.tool { margin: 24px 0 8px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tool label { display: block; font-family: var(--sans); font-size: .76rem; color: var(--muted); margin: 12px 0 4px; }
.tool input, .tool select {
  width: 100%; padding: 9px 10px; font: inherit; font-size: 1rem; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink);
}
.tool input:focus, .tool select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tool .row { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.tool button[type="submit"], .tool .btn {
  margin-top: 14px; background: var(--saffron); color: #fff; border: 0; border-radius: 999px; padding: 10px 22px;
  font-family: var(--sans); font-size: .9rem; font-weight: 600; letter-spacing: 0; text-transform: none; cursor: pointer;
}
.result-box { margin: 16px 0 0; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.result-box p { margin: 4px 0; }
.tool input[type="checkbox"] { width: auto; border: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #c9cddc; margin-top: 56px; padding: 30px 0 34px; font-family: var(--sans); font-size: .86rem; }
.foot-cols { display: grid; gap: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 20px; }
@media (max-width: 640px) { .foot-cols { grid-template-columns: 1fr 1fr; } }
.foot-cols h2 { font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #f0b25a; margin: 0 0 8px; padding: 0; border: 0; }
.foot-cols ul { list-style: none; margin: 0; padding: 0; }
.foot-cols li { margin: 0 0 6px; }
.site-footer a { color: #eef0f7; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.disclaimer { font-size: .78rem; margin: 0 0 6px; color: #a9aec2; }

/* Save as PDF */
.pdf-btn { font-family: var(--sans); font-size: .85rem; background: var(--panel); border: 1px solid var(--gold); color: var(--ink); padding: 6px 14px; border-radius: 999px; cursor: pointer; margin: 8px 0 0; }
.pdf-btn:hover { background: var(--ink); color: var(--paper); }

/* Print / Save as PDF: plain page, no navigation or form chrome */
@media print {
  :root { --paper: #fff; --panel: #fff; --ink: #000; --muted: #333; }
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .menu-btn, .nav, .skip, .pdf-btn, .tool form, .crumbs, #ck-out, .no-print { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  h1, h2, h3 { break-after: avoid; }
  .card, .panel, .result-box { break-inside: avoid; border-color: #999; }
}
