/* Nilay Popat and Associates — site styles */
@font-face { font-family: "Instrument Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Sans"; font-style: italic; font-weight: 400 700; font-display: swap; src: url("/assets/fonts/instrument-sans-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "Cinzel"; font-style: normal; font-weight: 600; font-display: swap; src: url("/assets/fonts/cinzel-latin-600-normal.woff2") format("woff2"); }
:root {
  /* Palette taken from the CA India logo */
  --paper: #FFFFFF;
  --surface: #FFFFFF;
  --tint: #F3F7FA;
  --ink: #175888;          /* CA India blue: all text */
  --muted: #4C7393;        /* lighter blue for secondary text (5:1 on white) */
  --rule: #D9E3EB;
  --accent: #175888;
  --accent-hover: #0F4166;
  --accent-ink: #FFFFFF;
  --mark: #175888;
  --saffron: #F47920;      /* decorative only */
  --green: #52B947;        /* decorative only */
  --ok-bg: #EAF6E8; --ok-ink: #2B6A24;
  --err-bg: #FDECEC; --err-ink: #9A2A2A;
  --focus: #F47920;
  --radius: 6px;
  --wrap: 1120px;
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font); font-feature-settings: "kern"; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.35rem, 2.2vw, 1.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
address { font-style: normal; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--surface); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: .5rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.lead { font-size: clamp(1.08rem, 1.6vw, 1.22rem); color: var(--muted); max-width: 62ch; }
.fine { font-size: .875rem; color: var(--muted); }
.empty { color: var(--muted); padding: 2rem 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4em; padding: .7em 1.2em; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  font: 600 .98rem/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-quiet:hover { background: var(--tint); color: var(--ink); border-color: var(--rule); }
.btn-small { padding: .45em .85em; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* preview bar + header */
body::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--saffron) 0 50%, var(--green) 50% 100%); }
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--rule); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 5rem; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-logo { width: auto; height: 52px; object-fit: contain; display: block; }
/* Name + suffix together match the logo height (52px = 29 + 23) */
.brand-text { display: flex; flex-direction: column; justify-content: center; height: 52px; }
.brand-name { font-family: "Cinzel", "Trajan Pro", Georgia, serif; font-weight: 600; font-size: 25px; line-height: 29px; letter-spacing: 0.01em; }
.brand-suffix { font-size: 19px; line-height: 23px; color: var(--muted); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.site-nav a { display: block; padding: .5rem .7rem; color: var(--ink); text-decoration: none; border-radius: var(--radius); font-size: .97rem; }
.site-nav a:hover { background: var(--tint); }
.site-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.nav-toggle { display: none; }
@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); color: var(--ink); cursor: pointer; }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; content: ""; transition: transform .2s; }
  .nav-toggle-bars::before { position: absolute; top: -6px; } .nav-toggle-bars::after { position: absolute; top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }
  .site-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--rule); display: none; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: .5rem 16px 1rem; }
  .site-nav a { padding: .8rem .25rem; border-bottom: 1px solid var(--rule); border-radius: 0; }
  .site-nav a[aria-current="page"] { box-shadow: none; }
  .brand-logo { height: 40px; }
  .brand-text { height: 40px; }
  .brand-name { font-size: 15px; line-height: 22px; letter-spacing: 0; }
  .brand-suffix { font-size: 14px; line-height: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* client login: outlined button in the desktop header, floating button on phones */
.site-nav .nav-login a { border: 1px solid var(--accent); border-radius: var(--radius); margin-left: .5rem; font-weight: 500; }
.site-nav .nav-login a:hover { background: var(--accent); color: var(--accent-ink); }
.fab-login { display: none; }
@media (max-width: 899px) {
  .site-nav .nav-login a { border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; margin: 0; font-weight: 600; }
  .fab-login {
    display: inline-flex; align-items: center; gap: .45rem; position: fixed; z-index: 25;
    right: 16px; bottom: calc(16px + env(safe-area-inset-bottom) + var(--notice-h, 0px));
    padding: .75rem 1.1rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
    font-weight: 600; font-size: .95rem; text-decoration: none; box-shadow: 0 6px 18px rgba(23, 88, 136, .28);
  }
  .fab-login:hover, .fab-login:focus-visible { color: var(--accent-ink); background: var(--accent-hover); }
  body.menu-open .fab-login { display: none; }
}
@media print { .fab-login { display: none !important; } }

/* hero */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.hero-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: end; gap: 4rem; } }
.hero h1 { font-size: clamp(2.1rem, 4.8vw, 3.5rem); line-height: 1.06; letter-spacing: -0.025em; max-width: 17ch; }
.particulars { margin: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: .25rem 1.25rem; }
.particulars > div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--rule); }
.particulars > div:last-child { border-bottom: 0; }
.particulars dt { color: var(--muted); font-size: .88rem; padding-top: .1rem; }
.particulars dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .particulars > div { grid-template-columns: 1fr; gap: .1rem; } }

/* section scaffolding */
.block { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.block-tint { background: var(--paper); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; }
.two-col { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 4rem; } }
.page-head { padding: clamp(2.25rem, 6vw, 4rem) 0 clamp(1rem, 3vw, 1.5rem); border-bottom: 1px solid var(--rule); }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: .75rem; }
.crumbs a { color: var(--muted); }

/* the due-date ledger strip (signature element) */
.due { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--tint); padding: 2rem 0 2.25rem; }
.due-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.due-strip li { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .85rem; padding: .9rem 1rem .9rem 0; border-top: 1px solid var(--rule); }
@media (min-width: 720px) { .due-strip li { border-top: 0; border-left: 1px solid var(--rule); padding: .25rem 1.25rem; } .due-strip li:first-child { border-left: 0; padding-left: 0; } }
.due-strip time { grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: center; min-width: 2.6rem; line-height: 1; }
.due-day { font-size: 2.2rem; font-weight: 600; color: var(--mark); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.due-mon { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.due-title { font-weight: 600; font-size: .98rem; line-height: 1.3; align-self: end; }
.due-meta { font-size: .85rem; color: var(--muted); }

/* services index */
.svc-index { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--rule); }
@media (min-width: 900px) { .svc-index { grid-template-columns: 1fr 1fr; column-gap: 3rem; } }
.svc-index a { display: grid; gap: .2rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--ink); height: 100%; }
.svc-name { font-weight: 600; font-size: 1.12rem; }
.svc-sum { color: var(--muted); }
.svc-index a:hover .svc-name { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }
.svc-row { display: grid; gap: .5rem 3rem; padding: 2rem 0; border-bottom: 1px solid var(--rule); }
.svc-row:first-child { padding-top: 0; }
@media (min-width: 900px) { .svc-row { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.svc-row h2 a { color: var(--ink); text-decoration: none; }
.svc-row h2 a:hover { color: var(--accent); text-decoration: underline; }
.with-aside { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .with-aside { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 4rem; } }
.aside-nav { border-left: 1px solid var(--rule); padding-left: 1.5rem; align-self: start; }
.aside-head { color: var(--muted); font-size: .9rem; margin-bottom: .5rem; }
.aside-nav ul { list-style: none; padding: 0; margin: 0; }
.aside-nav li { padding: .35rem 0; }
.after-prose { margin-top: 2rem; }

/* prose */
.prose { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.2rem; margin: 0 0 1em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--muted); }
.prose h2 { margin-top: 1.8em; } .prose h3 { margin-top: 1.5em; }
.prose blockquote { margin: 1.5em 0; padding: .25em 0 .25em 1.25em; border-left: 3px solid var(--accent); color: var(--muted); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: .55em .75em .55em 0; text-align: left; vertical-align: top; }
.prose code { font-size: .9em; background: var(--tint); padding: .1em .35em; border-radius: 3px; }
.prose img { border-radius: var(--radius); margin: 1.5em 0; }
.plain-list { list-style: none; padding: 0; margin: 0 0 1.25rem; }
.plain-list li { padding: .55rem 0; border-bottom: 1px solid var(--rule); }

/* facts (about/contact) */
.facts { margin: 0; border-top: 1px solid var(--rule); }
.facts > div { display: grid; gap: .2rem 2rem; padding: .9rem 0; border-bottom: 1px solid var(--rule); }
@media (min-width: 640px) { .facts > div { grid-template-columns: 13rem 1fr; } }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts-stacked > div { grid-template-columns: 1fr !important; }

/* posts */
.post-list { display: grid; gap: 0 3rem; }
@media (min-width: 720px) { .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .post-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.post-item { padding: 1.25rem 0 1.5rem; border-top: 1px solid var(--rule); }
.post-item h3 { margin: .3rem 0 .5rem; font-size: 1.15rem; }
.post-item h3 a { color: var(--ink); text-decoration: none; }
.post-item h3 a:hover { color: var(--accent); text-decoration: underline; }
.post-item p:last-child { color: var(--muted); margin: 0; }
.post-meta { font-size: .88rem; color: var(--muted); margin: 0; }
.post-meta a { color: var(--muted); }
.article .page-head { border-bottom: 0; }
.article .prose { font-size: 1.1rem; line-height: 1.7; margin: 1.5rem 0 2.5rem; }
.cover { border-radius: var(--radius); margin: .5rem 0 1rem; width: 100%; }
.draft-flag { background: #FEF1E6; color: #8A3F0A; padding: .5rem .8rem; border-radius: var(--radius); font-size: .9rem; display: inline-block; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.chips a { padding: .35rem .8rem; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .9rem; background: var(--surface); }
.chips a:hover { border-color: var(--accent); }
.chips a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pager { display: flex; gap: .4rem; margin-top: 2rem; }
.pager a { min-width: 2.4rem; text-align: center; padding: .4rem .6rem; border: 1px solid var(--rule); border-radius: var(--radius); text-decoration: none; }
.pager a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* calendar */
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.cal-month { margin: 0; text-align: center; }
.cal-table { width: 100%; border-collapse: collapse; margin-top: 1.5rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.cal-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: .88rem; padding: .7rem 1rem; border-bottom: 1px solid var(--rule); background: var(--tint); }
.cal-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.cal-table tr:last-child td { border-bottom: 0; }
.cal-date { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--mark); font-weight: 600; }
.cal-table .is-past td { opacity: .55; }
.cal-src { font-size: .82rem; color: var(--muted); }
@media (max-width: 640px) {
  .cal-table thead { display: none; }
  .cal-table, .cal-table tbody, .cal-table tr, .cal-table td { display: block; }
  .cal-table tr { padding: .75rem 1rem; border-bottom: 1px solid var(--rule); }
  .cal-table td { border: 0; padding: .1rem 0; }
  .cal-table td:nth-child(3), .cal-table td:nth-child(4) { display: inline; color: var(--muted); font-size: .9rem; }
  .cal-table td:nth-child(3)::after { content: ", "; }
}

/* forms */
.contact-grid { display: grid; gap: 2.5rem; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 4rem; } }
.map { margin: 1.5rem 0 .75rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); aspect-ratio: 4 / 3; background: var(--tint); }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
.form-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); align-self: start; }
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field > span { font-size: .92rem; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: .65rem .75rem; min-height: 44px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.field input[type="file"] { padding: .5rem; }
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .92rem; margin: .5rem 0 1rem; }
.check input { width: 1.1rem; height: 1.1rem; margin-top: .2rem; flex: none; accent-color: var(--accent); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: .8rem 1rem; border-radius: var(--radius); margin-bottom: 1.25rem; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-ok { background: var(--ok-bg); color: var(--ok-ink); }
.alert-err { background: var(--err-bg); color: var(--err-ink); }
.opening { padding: 1.25rem 0; border-top: 1px solid var(--rule); }
.opening h3 { margin: 0; }

/* footer */
.site-footer { margin-top: 0; border-top: 1px solid var(--rule); background: var(--tint); padding: 3rem 0 1.5rem; font-size: .95rem; }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-name { font-weight: 600; font-size: 1.05rem; } .footer-name span { font-weight: 400; color: var(--muted); font-size: .9rem; }
.footer-head { color: var(--muted); font-size: .88rem; margin-bottom: .5rem; }
.footer-links { list-style: none; padding: 0; margin: 0; } .footer-links li { padding: .2rem 0; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .85rem; }
.footer-base p { margin: 0; max-width: 70ch; }

/* first-visit notice */
.notice { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--ink); color: var(--paper); padding: .9rem 0; }
.notice a { color: inherit; }
.notice-inner { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.notice p { margin: 0; font-size: .9rem; max-width: 80ch; }
.notice .btn { background: var(--paper); color: var(--ink); border-color: var(--paper); }

/* sign-in card (admin) */
body.gate { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.gate-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 2rem; }
.gate-card .brand-name { margin: 0; font-size: 1.1rem; display: block; }
.gate-card .brand-suffix { margin: 0 0 1.75rem; display: block; }
.gate-card h1 { font-size: 1.5rem; }
.gate-card .btn { width: 100%; justify-content: center; }

@media print {
  .site-header, .site-footer, .notice, .actions, .map { display: none !important; }
  body { background: #fff; color: #000; }
}
