/* Shared styles for every page, layered on the design tokens in assets/style.css.
   Covers the common header and footer behaviour, page heads with illustrations,
   and the components used by the News & Blogs, Community Help, Support Us and
   Gaumata Raksha pages. Colours derive from the theme tokens so light and dark
   modes stay consistent. */
:root {
  --surface-2: var(--bg-elev);
  --brand-soft: color-mix(in srgb, var(--brand-solid) 10%, var(--surface));
  --info: #2563eb; --warn: #ea580c; --ok: #059669;
}
html { scroll-padding-top: 80px; }
.muted { color: var(--muted); }
.section.alt { background: var(--bg-elev); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* ---------- Header: eight links inline on desktop and tablet, menu button on phones ---------- */
.nav-links { gap: 2px; }
.nav-links a { white-space: nowrap; }
@media (min-width: 861px) and (max-width: 1080px) {
  .menu-btn { display: none; }
  .nav-links { display: flex; position: static; flex-direction: row; padding: 0; background: none; border: 0; }
  .nav-links a { padding: 8px 7px; font-size: .86rem; }
}
@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .nav-links { display: none; position: absolute; left: 0; right: 0; top: 68px; flex-direction: column; align-items: stretch; padding: 10px 20px 16px; background: var(--bg-elev); border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
}

/* ---------- Footer: four columns ---------- */
.footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.site-footer .fineprint a { color: #cbd5e1; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Page head with illustration ---------- */
.page-head.split { text-align: left; padding: 56px 0 40px; }
.page-head.split .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 40px; align-items: center; }
.page-head.split h1 { font-size: clamp(1.9rem, 4.2vw, 2.8rem); }
.page-head.split p { margin: 0 0 1.2em; max-width: 620px; }
.page-head .head-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.page-head figure { margin: 0; }
.page-head figure img { display: block; width: 100%; max-width: 420px; margin-left: auto; }
@media (max-width: 860px) {
  .page-head.split .wrap { grid-template-columns: 1fr; gap: 20px; }
  .page-head figure { order: -1; }
  .page-head figure img { max-width: 260px; margin: 0 auto; }
}

/* ---------- Buttons, pills, meta ---------- */
.btn:not(.btn-primary):not(.btn-ghost) { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn:not(.btn-primary):not(.btn-ghost):hover { border-color: var(--text); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none !important; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.pill.mca { --c: #4f46e5; } .pill.sebi { --c: #db2777; } .pill.gst { --c: #059669; } .pill.income-tax { --c: #d97706; } .pill.labour { --c: #0284c7; } .pill.msme { --c: #7c3aed; }
.pill[class*=" "]:not(.plain) { color: color-mix(in srgb, var(--c, var(--muted)) 80%, var(--text)); background: color-mix(in srgb, var(--c, var(--muted)) 12%, var(--surface)); border-color: color-mix(in srgb, var(--c, var(--muted)) 30%, var(--border)); }
.meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); }
.byline { font-weight: 600; color: var(--text); }
.author-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .85rem; }
.author-badge img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; object-position: center 15%; background: var(--surface); }

/* ---------- Grids and cards ---------- */
.grid.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .grid.grid-3, .grid.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid.grid-2, .grid.grid-3, .grid.grid-4 { grid-template-columns: 1fr; } }
.card h3 { font-size: 1.12rem; }
.card p { margin: .4em 0 0; }
a.card { text-decoration: none; color: var(--text); }
.card.flat::before { display: none; }
.card.flat:hover { transform: none; }
.card ul { color: var(--muted); padding-left: 1.1em; margin: .6em 0 0; }
.mod-card .mod-img { margin: -28px -28px 18px; height: 140px; display: block; width: calc(100% + 56px); object-fit: cover; border-bottom: 1px solid var(--border); background: var(--bg-elev); }
.mod-card .more { margin-top: auto; padding-top: 12px; font-weight: 700; color: var(--brand); font-size: .9rem; }

/* ---------- Callouts and tables ---------- */
.callout { --c: var(--info); border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border)); border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 7%, var(--surface)); border-radius: 10px; padding: 14px 16px; margin: 16px 0; }
.callout.warn { --c: var(--warn); }
.callout.tip { --c: var(--ok); }
.callout.legal { --c: var(--brand-solid); border-width: 2px; border-left-width: 6px; font-size: 1.02rem; }
.table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--border); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { background: var(--bg-elev); font-weight: 700; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: color-mix(in srgb, var(--brand-solid) 3%, var(--surface)); }

/* ---------- News & Blogs hub ---------- */
.hub-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.search:focus-within { border-color: var(--brand); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; padding: 12px 0; outline: none; min-width: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { padding: 8px 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font: 600 .86rem var(--font-body); cursor: pointer; transition: border-color .15s, color .15s; }
.tab:hover { border-color: var(--brand); color: var(--text); }
.tab[aria-pressed="true"] { background: var(--brand-solid); color: #fff; border-color: var(--brand-solid); }
.article-card { padding: 0; }
.article-card .cover { display: block; width: 100%; height: auto; aspect-ratio: 12 / 5; object-fit: cover; border-bottom: 1px solid var(--border); }
.article-card .body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.article-card h3 { font-size: 1.08rem; margin: 10px 0 6px; line-height: 1.35; }
.article-card p { font-size: .92rem; }
.article-card .meta.foot { margin-top: auto; padding-top: 14px; }
.update-item { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.update-item:last-child { border-bottom: 0; }
.update-item time { font-weight: 700; color: var(--brand); font-size: .9rem; }
.update-item h3 { font-size: 1.02rem; margin: 6px 0; }
.update-item .src { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }
@media (max-width: 640px) { .update-item { grid-template-columns: 1fr; gap: 4px; } }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* ---------- Article reader ---------- */
.art-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 48px; padding: 32px 0 64px; }
.art-main { min-width: 0; max-width: 820px; }
.art-head h1 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
.art-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.art-actions .btn { padding: 9px 14px; font-size: .88rem; }
.article-body { font-size: 1.02rem; }
.article-body p, .article-body li { color: var(--text); }
.article-body h2 { font-size: 1.4rem; margin-top: 2em; padding-top: .8em; border-top: 1px solid var(--border); }
.article-body h3 { font-size: 1.1rem; margin-top: 1.4em; }
.article-body ol.steps { padding-left: 1.3em; }
.article-body ol.steps > li { margin-bottom: .6em; }
.article-body ul.checklist { list-style: none; padding: 0; }
.article-body ul.checklist > li { position: relative; padding-left: 28px; margin-bottom: .7em; }
.article-body ul.checklist > li::before { content: "\2713"; position: absolute; left: 0; top: 0; color: var(--brand); font-weight: 800; }
.article-body .sources { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 10px; padding: 8px 20px; font-size: .93rem; }
.art-toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; border-left: 2px solid var(--border); padding-left: 16px; }
.art-toc h2 { font-family: var(--font-body); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.art-toc ol { list-style: none; margin: 0; padding: 0; }
.art-toc a { display: block; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: .88rem; line-height: 1.35; }
.art-toc a:hover { color: var(--text); }
.art-toc a.active { color: var(--brand); font-weight: 700; }
.toc-btn { display: none !important; }
@media (max-width: 1000px) {
  .art-layout { grid-template-columns: 1fr; gap: 16px; }
  .art-toc { position: static; max-height: none; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; display: none; order: -1; background: var(--surface); }
  .art-toc.open { display: block; }
  .toc-btn { display: inline-flex !important; }
}
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; }
.toast.show { opacity: 1; }

/* ---------- Accordions ---------- */
details.faq { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 0 18px; margin-bottom: 10px; }
details.faq summary { cursor: pointer; padding: 15px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.25rem; line-height: 1; color: var(--brand); }
details.faq[open] summary::after { content: "\2212"; }
details.faq > div { padding-bottom: 15px; color: var(--muted); }

/* ---------- Community Help ---------- */
.track-tabs { margin-bottom: 28px; }
.track-panel[hidden] { display: none; }
.track-intro { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 20px; }
.myth { cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.myth .label { font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.myth .label.m { color: #dc2626; } .myth .label.f { color: var(--ok); }
.myth .q { color: var(--text); font-weight: 600; margin: 6px 0 0; }
.myth .fact { display: none; margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.myth[aria-expanded="true"] .fact { display: block; }
.myth .hint { font-size: .8rem; color: var(--brand); font-weight: 600; margin-top: 10px; }
.myth[aria-expanded="true"] .hint { display: none; }
.cal-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.cal-controls label { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: .9rem; }
select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.cal-list { list-style: none; margin: 0; padding: 0; }
.cal-list li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: start; padding: 11px 0; border-bottom: 1px solid var(--border); }
.cal-list li:last-child { border-bottom: 0; }
.cal-day { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; color: var(--brand); }
@media (max-width: 520px) { .cal-list li { grid-template-columns: 44px 1fr; } .cal-list li .pill { grid-column: 2; justify-self: start; } }
.checklist-ui label { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.checklist-ui label:last-child { border-bottom: 0; }
.checklist-ui input { margin-top: 5px; accent-color: var(--brand-solid); width: 17px; height: 17px; flex: none; }
.progress { height: 8px; background: var(--bg-elev); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.progress span { display: block; height: 100%; background: var(--brand-solid); width: 0; transition: width .2s; }
.steps-list { padding-left: 1.2em; color: var(--muted); }
.steps-list li { margin-bottom: .5em; }
.case h3 { margin-top: 10px; }

/* ---------- Support Us and Gaumata Raksha ---------- */
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tier { text-align: left; padding: 14px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; font: inherit; transition: border-color .15s; }
.tier:hover { border-color: color-mix(in srgb, var(--brand-solid) 50%, var(--border)); }
.tier strong { display: block; font-family: var(--font-display); font-size: 1.2rem; }
.tier span { font-size: .84rem; color: var(--muted); }
.tier[aria-pressed="true"] { border-color: var(--brand-solid); background: var(--brand-soft); }
.amount-input { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; background: var(--surface); max-width: 280px; }
.amount-input input { border: 0; background: transparent; color: var(--text); font: 600 1.1rem var(--font-body); padding: 10px 0; width: 100%; outline: none; }
.pay-box { border: 1px dashed var(--border); border-radius: 12px; padding: 16px; background: var(--bg-elev); }
.pillar-num { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-solid); color: #fff; font-family: var(--font-display); font-weight: 700; margin-bottom: 12px; }
.check-ack { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; }
.check-ack input { margin-top: 5px; accent-color: var(--brand-solid); }

/* ---------- Portfolio: knowledge hub teaser ---------- */
.hub-teaser .mod-card h3 { font-size: 1.05rem; }

@media print {
  .art-toc, .art-actions, .toc-btn, .page-head figure { display: none !important; }
  .art-layout { display: block; }
}
@media (max-width: 760px) { .mod-card .mod-img { margin: -22px -22px 16px; width: calc(100% + 44px); } }
.mod-card .mod-img { max-width: none; object-fit: contain; }
button.btn, .tier, .tab { font-family: var(--font-body); }
.tier { display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; }

/* Mission and disclaimer */
.checklist-plain { list-style: none; padding: 0; margin: 0; }
.checklist-plain li { position: relative; padding: 12px 0 12px 30px; border-bottom: 1px solid var(--border); color: var(--muted); }
.checklist-plain li:last-child { border-bottom: 0; }
.checklist-plain li::before { content: "\2713"; position: absolute; left: 0; top: 12px; color: var(--brand); font-weight: 800; }
.checklist-plain strong { color: var(--text); }
.prose h2 { font-size: 1.35rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.1rem; margin-top: 1.5em; }
.mission-panel { display: grid; grid-template-columns: 300px 1fr; gap: 32px; align-items: center; }
.mission-panel img { width: 100%; height: auto; }
.mission-panel h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.mission-panel p { color: var(--muted); }
@media (max-width: 760px) { .mission-panel { grid-template-columns: 1fr; text-align: center; } .mission-panel img { max-width: 220px; margin: 0 auto; } }

/* ---------- Layout additions for images ---------- */
.track-hero { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 28px; }
.track-hero img { width: 100%; height: auto; border-radius: 10px; }
.track-hero h2 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); margin-bottom: .3em; }
.track-hero p { color: var(--muted); margin: 0; }
.about-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 36px; align-items: center; }
.about-grid .prose { margin: 0; max-width: none; }
.about-fig { margin: 0; }
.about-fig img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
@media (max-width: 860px) { .track-hero, .about-grid { grid-template-columns: 1fr; } .track-hero img, .about-fig img { max-width: 360px; margin: 0 auto; display: block; } }
.pillar .mod-img, .mod-card .mod-img { object-fit: cover; }

/* ---------- Motion ---------- */
body { transition: background-color .3s ease, color .3s ease; }
.site-nav { transition: box-shadow .25s ease, background-color .3s ease; }
.site-nav.scrolled { box-shadow: 0 1px 0 var(--border), 0 8px 24px rgba(15, 23, 42, .08); }
@keyframes cch-fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes cch-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes cch-fade { from { opacity: 0; } to { opacity: 1; } }
.motion .page-head > .wrap > div, .motion .hero-text { animation: cch-fade-up .7s ease both; }
.motion .page-head figure img, .motion .mission-panel img, .motion .hero-photo img { animation: cch-float 6s ease-in-out infinite; }
.motion .hero-photo img { animation-duration: 7s; }
.motion .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; transition-delay: var(--d, 0s); }
.motion .reveal.in { opacity: 1; transform: none; }
.mod-card .mod-img, .article-card .cover, .track-hero img, .about-fig img { transition: transform .5s ease; }
.mod-card:hover .mod-img, .article-card:hover .cover { transform: scale(1.04); }
.mod-card, .article-card { overflow: hidden; }
.track-panel:not([hidden]) { animation: cch-fade .35s ease; }
#app > * { animation: cch-fade .35s ease; }
.myth .fact { animation: cch-fade .3s ease; }
.btn { transition: transform .2s, box-shadow .2s, background .2s, border-color .2s, color .2s; }
.read-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, #e11d8f, var(--brand-solid)); z-index: 70; transition: width .1s linear; }
.to-top { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s, border-color .2s; z-index: 55; font-size: 1.1rem; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--brand); }
@media (prefers-reduced-motion: reduce) {
  .motion .reveal { opacity: 1; transform: none; transition: none; }
  .motion .page-head figure img, .motion .mission-panel img, .motion .hero-photo img, .motion .page-head > .wrap > div, .motion .hero-text { animation: none; }
  .mod-card:hover .mod-img, .article-card:hover .cover { transform: none; }
}
@media print { .read-progress, .to-top { display: none !important; } .motion .reveal { opacity: 1 !important; transform: none !important; } }
.mod-card .mod-img[src*="/scenes/"] { height: auto; aspect-ratio: 8 / 5; }
