/* ==========================================================================
   usaindiacfo.com — public PHP tier (blog index / post / category, login)
   Overrides on top of /assets/css/clay.css (v27 "Warm Bronze Clay").
   Load order: clay.css FIRST, then this file. Everything here reuses clay's
   tokens (--ink*, --bronze*, --line, --clay-*, --r*, --ease, --gutter) and
   only adds what the blog needs: the mobile sticky bar, category pills,
   post-list meta, pagination, the subscribe band, long-form article type,
   the author block and the admin login card.
   The /manage/ screens do NOT use this file — see admin.css.
   ========================================================================== */

/* ── skip link ──────────────────────────────────────────────────────────── */
.skip-link { position: absolute; left: -9999px; top: 12px; z-index: 200; }
.skip-link:focus { left: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }


/* Header, drawer, footer and the mobile sticky bar are the generated chrome
   (includes/chrome/*.html from site/build.py) and are styled by clay.css +
   site.css exactly as on the marketing pages — no chrome overrides here. */
/* the constellation window (js/home-window.js) sets these on <html> while its
   frame is the viewport: the bar leaves with the header (see home-window.css) */
html.win-chrome .mbar { transition: transform .6s var(--ease); }
html.win-immersive .mbar { transform: translate3d(0, calc(100% + 40px), 0); }

/* ── page-hero top row (title left, note right) ─────────────────────────── */
.head-split { display: flex; align-items: baseline; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.head-split > p { max-width: 36ch; margin-bottom: 14px; }

/* ── category pills ─────────────────────────────────────────────────────── */
.cats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(28px, 3.5vw, 44px); }
.cats .pill { transition: color .3s var(--ease), box-shadow .3s var(--ease), background-color .3s var(--ease); }
/* category names read as names (imp-pages 17 Oct): sentence case at reading size, not the
   uppercase label style ("NEWS" next to "Case Study"); the stored name is title-cased by
   insights_cat_label() (includes/insights-text.php) */
.cats .pill { text-transform: none; letter-spacing: .01em; font-size: 14px; min-height: 40px; padding: 8px 18px; }
.cats .pill:hover { color: var(--bronze-deep); }
.cats .pill[aria-current="page"] {
  background: linear-gradient(178deg, var(--umber-236) 0%, var(--dark) 100%);
  color: var(--bronze-bright); box-shadow: var(--clay-dark-in);
}

/* ── post list (index rows) ─────────────────────────────────────────────── */
/* the index under the window hero: the window's close glides the page to
   this section's top, so it clears the (returning) fixed header */
.posts-section { padding-top: calc(var(--head-h) + 36px); }
.posts-section .cats--list { margin-top: 0; margin-bottom: clamp(28px, 3.5vw, 44px); }
.posts { margin-top: 0; }
.post-meta { display: block; margin-top: 12px; font: 500 11px/1.6 Inter, sans-serif;
  letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.post-meta b { font-weight: 500; color: var(--bronze-deep); }
.posts .index-row__title { text-wrap: balance; }
/* phones: the hover arrow's column is empty space here (no hover) and squeezed
   the title into 4–7 lines — the title takes the width instead */
@media (max-width: 600px) {
  .posts .index-row { grid-template-columns: 40px minmax(0, 1fr); }
  .posts .index-row__arrow { display: none; }
}

/* ── pagination ─────────────────────────────────────────────────────────── */
.pager { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px;
  margin-top: clamp(36px, 4vw, 56px); }
.pager__n {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: var(--r-pill);
  font: 500 13px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; color: var(--ink-muted);
  background: linear-gradient(178deg, var(--sand-980) 0%, var(--sand-943) 100%); box-shadow: var(--clay-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), color .3s var(--ease);
}
a.pager__n:hover { transform: translate3d(-1px, -2px, 0); box-shadow: var(--clay-md); color: var(--ink); }
.pager__n[aria-current="page"] {
  background: linear-gradient(178deg, var(--gold-1) 0%, var(--gold-2) 56%, var(--gold-3) 100%); color: var(--dark);
  box-shadow: inset 0 -3px 6px rgba(var(--gold-shade-rgb),.26), inset 0 1px 1px rgba(var(--gold-hi-rgb),.5);
}
.pager__nav { padding: 0 18px; }
.pager__gap { color: var(--ink-faint); padding: 0 2px; }

/* ── empty state ────────────────────────────────────────────────────────── */
.empty { max-width: 560px; }

/* ── subscribe band (dark clay) ─────────────────────────────────────────── */
.subscribe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: clamp(28px, 4vw, 56px); align-items: center; }
.subscribe__form { display: flex; gap: 12px; align-items: stretch; }
.subscribe__form .field { flex: 1 1 auto; }
.subscribe__form .btn { flex: 0 0 auto; }
.subscribe__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.subscribe__status { margin-top: 12px; min-height: 1.4em; color: rgba(var(--cream-rgb),.7); }
.clay--dark .field > label { color: rgba(var(--cream-rgb),.6); }
/* clay.css only recolours h3/h4 inside .clay--dark; the blog's dark cards use h2 + lede/body/small */
.clay--dark h1, .clay--dark h2 { color: var(--cream); }
.clay--dark .lede, .clay--dark .body { color: rgba(var(--cream-rgb),.66); }
.clay--dark .small { color: rgba(var(--cream-rgb),.5); }
@media (max-width: 940px) { .subscribe { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .subscribe__form { flex-direction: column; } .subscribe__form .btn { width: 100%; } }

/* ── article page ───────────────────────────────────────────────────────── */
.post-hero h1 { max-width: 22ch; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 26px;
  font: 400 13.5px/1.68 Inter, sans-serif; color: var(--ink-soft); }
.byline b { font-weight: 500; color: var(--ink); }
.post-main { padding-top: clamp(36px, 4vw, 56px); }
.post-figure { margin: 0 0 clamp(36px, 4vw, 56px); }
.post-figure .figure__frame > img { max-height: 560px; }

.post-body { font: 400 17px/1.78 Inter, sans-serif; color: var(--stone-335); overflow-wrap: break-word; }
.post-body > * + * { margin-top: 1.25em; }
.post-body h2, .post-body h3, .post-body h4 { color: var(--ink); }
.post-body h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.12; margin-top: 2em; }
.post-body h3 { font-size: clamp(1.375rem, 2vw, 1.75rem); line-height: 1.2; margin-top: 1.7em; }
.post-body h4 { font-size: 1.25rem; line-height: 1.3; margin-top: 1.5em; }
.post-body h2 + *, .post-body h3 + *, .post-body h4 + * { margin-top: .75em; }
.post-body a { color: var(--bronze-deep); text-decoration: underline;
  text-decoration-color: rgba(var(--bronze-deep-rgb),.4); text-underline-offset: 3px; }
.post-body a:hover { text-decoration-color: currentColor; }
/* imported posts wrap FAQ headings in anchors — keep them headings, not links */
.post-body h2 a, .post-body h3 a, .post-body h4 a { color: inherit; text-decoration: none; }
.post-body h2 a:hover, .post-body h3 a:hover, .post-body h4 a:hover { color: var(--bronze-deep); text-decoration: underline; }
.post-body strong, .post-body b { font-weight: 600; color: var(--ink); }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li + li { margin-top: .5em; }
.post-body li::marker { color: var(--bronze-deep); }
.post-body blockquote { margin: 2em 0; padding: 4px 0 4px 28px; border-left: 2px solid var(--bronze);
  font: 300 clamp(1.25rem, 1.9vw, 1.5rem)/1.45 Newsreader, Georgia, serif; font-style: italic; color: var(--ink); }
.post-body blockquote p + p { margin-top: .8em; }
.post-body img { display: block; width: 100%; height: auto; border-radius: var(--r-lg);
  box-shadow: var(--clay-md); filter: saturate(.9) sepia(.06); }
.post-body figure { margin: 2em 0; }
.post-body figcaption { margin-top: 12px; font: 400 12.5px/1.55 Inter, sans-serif; color: var(--ink-faint); }
.post-body pre { padding: 20px 24px; border-radius: var(--r); overflow-x: auto;
  background: linear-gradient(178deg, var(--sand-917b) 0%, var(--sand-941) 100%); box-shadow: var(--clay-in);
  font: 400 13.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); }
.post-body code { font: 400 .9em/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(var(--ink-rgb),.06); padding: .15em .4em; border-radius: 4px; }
.post-body pre code { background: none; padding: 0; font-size: inherit; }
/* tables (imp-pages 17 Oct): body-size text, header cells in sentence case (not the 11px
   uppercase label style), a hairline frame; the table is its own sideways scroller on narrow
   screens (keyboard-focusable: includes/a11y-html.php), with a soft edge showing more */
.post-body table { width: 100%; border-collapse: collapse; display: block; overflow-x: auto; max-width: 100%;
  font: 400 15.5px/1.6 Inter, sans-serif; color: var(--stone-335);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, var(--ground-flat) 30%, rgba(var(--ground-rgb), 0)) left / 28px 100% no-repeat local,
    linear-gradient(270deg, var(--ground-flat) 30%, rgba(var(--ground-rgb), 0)) right / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(var(--shade), .16), transparent) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(var(--shade), .16), transparent) right / 12px 100% no-repeat scroll; }
.post-body table:focus-visible { outline: 2px solid var(--bronze-deep); outline-offset: 4px; }
.post-body th, .post-body td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top;
  min-width: 9rem; }
.post-body tr:last-child > td { border-bottom: 0; }
.post-body th, .post-body thead td { font: 600 14.5px/1.45 Inter, sans-serif; letter-spacing: 0; text-transform: none; color: var(--ink);
  background: rgba(var(--shade), .05); border-bottom: 1px solid var(--line); }
.post-body td p { margin: 0; }
.post-body td p + p { margin-top: .5em; }
@media (max-width: 600px) { .post-body table { font-size: 15px; } .post-body th, .post-body td { padding: 10px 12px; } }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }

.author { display: flex; gap: 24px; align-items: flex-start; margin-top: clamp(44px, 6vw, 72px); }
.author__photo { flex: 0 0 auto; width: 76px; height: 76px; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(178deg, var(--sand-917b) 0%, var(--sand-941) 100%); box-shadow: var(--clay-sm);
  font: 300 1.75rem/1 Newsreader, Georgia, serif; color: var(--bronze-deep); }
.author__photo img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.82) sepia(.14) contrast(.97); }
.author__name { margin-top: 10px; font: 350 clamp(1.25rem, 1.8vw, 1.5rem)/1.25 Newsreader, Georgia, serif; color: var(--ink); }
.author__cred { margin-top: 4px; font: 500 11px/1.6 Inter, sans-serif; letter-spacing: .16em;
  text-transform: uppercase; color: var(--bronze-deep); }
.author__bio { margin-top: 10px; max-width: 60ch; }
@media (max-width: 560px) { .author { flex-direction: column; gap: 16px; } }

/* ── table of contents, mid-article call to action, the advice note, related posts (imp-pages) ── */
.post-toc { margin: 0 0 clamp(32px, 4vw, 48px); padding: 18px 22px; border-radius: var(--r);
  background: linear-gradient(178deg, var(--sand-980) 0%, var(--sand-943) 100%); box-shadow: var(--clay-sm); }
.post-toc__s { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; cursor: pointer; list-style: none; min-height: 28px; }
.post-toc__s::-webkit-details-marker { display: none; }
.post-toc__s::after { content: ""; width: 8px; height: 8px; margin-left: 4px; border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft); transform: rotate(45deg) translateY(-3px); transition: transform .3s var(--ease); }
.post-toc[open] .post-toc__s::after { transform: rotate(-135deg); }
.post-toc__s:focus-visible { outline: 2px solid var(--bronze-deep); outline-offset: 4px; border-radius: 6px; }
.post-toc__n { margin-left: auto; font: 400 13px/1.4 Inter, sans-serif; color: var(--ink-soft); }
.post-toc__list { margin: 14px 0 2px; padding-left: 1.4em; columns: 2 280px; column-gap: 40px;
  font: 400 15px/1.5 Inter, sans-serif; }
.post-toc__list li { break-inside: avoid; padding: 4px 0; }
.post-toc__list li::marker { color: var(--bronze-deep); font-size: 13px; }
.post-toc__list a { color: var(--ink-muted); }
.post-toc__list a:hover { color: var(--bronze-deep); }
.post-body h2[id] { scroll-margin-top: calc(var(--head-h) + 20px); }

.post-body .post-midcta { margin: 2.4em 0; padding: 22px 26px; border-radius: var(--r);
  border-left: 3px solid var(--bronze); background: rgba(var(--bronze-rgb), .07); }
.post-body .post-midcta > * + * { margin-top: 6px; }
.post-midcta__t { font: 400 1.25rem/1.3 Newsreader, Georgia, serif; color: var(--ink); }
.post-midcta__b { font: 400 15px/1.6 Inter, sans-serif; color: var(--ink-muted); }
.post-body .post-midcta__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 16px; }
.post-body .post-midcta a { text-decoration: none; }
.post-body .post-midcta .btn { color: var(--dark); }

.post-note { margin-top: clamp(32px, 4vw, 44px); padding-top: 16px; border-top: 1px solid var(--line); max-width: 70ch;
  font: 400 13.5px/1.6 Inter, sans-serif; color: var(--ink-soft); }
.author__more { margin-top: 12px; }
.author__more .link-arrow { font-size: 14px; }

.post-related { margin-top: clamp(44px, 6vw, 72px); }
.post-related__h { font: 500 12px/1.4 Inter, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: var(--bronze-deep); }
.post-related__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.post-related__a { display: flex; flex-direction: column; gap: 10px; padding: 20px 20px 22px; border-radius: var(--r); color: var(--ink); }
.post-related__a .post-meta { margin-top: 0; }
.post-related__t { font: 400 1.125rem/1.3 Newsreader, Georgia, serif; color: var(--ink); text-wrap: balance; }
.post-related__x { font: 400 14px/1.55 Inter, sans-serif; color: var(--ink-muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
@media (max-width: 860px) { .post-related__list { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .post-toc__s::after { transition: none; } }

.post-cta { margin-top: clamp(36px, 5vw, 56px); display: flex; align-items: center;
  justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.post-cta__acts { display: flex; gap: 14px; flex-wrap: wrap; }

.notfound { min-height: 64svh; display: flex; align-items: center; }

/* ── admin login (the one /manage/ screen on the public chrome) ─────────── */
.login-page { min-height: 100svh; display: flex; align-items: center; justify-content: center;
  padding: 40px var(--gutter); }
.login { width: 100%; max-width: 440px; }
.login__logo { height: 30px; width: auto; margin-bottom: 30px; }
.login h1 { font-size: clamp(2rem, 4vw, 2.75rem); margin-top: 14px; }
.login .body { margin-top: 10px; }
.login form { margin-top: 30px; }
.login .btn { width: 100%; }
.login__foot { margin-top: 22px; }
.alert { padding: 16px 20px; border-radius: var(--r-sm); font: 400 14px/1.6 Inter, sans-serif;
  box-shadow: var(--clay-in); margin-top: 22px; }
.alert-error { background: linear-gradient(178deg, #f1e2dc 0%, #f5e9e4 100%); color: #8a2f20; }
.alert-success { background: linear-gradient(178deg, #e7eedf 0%, #eef3e8 100%); color: #3f5137; }

/* ── list thumbnails (/insights/, categories, /events/) — CMS batch D, design
   group "list-images" b (includes/media-public.php). Same at every width. ── */
.index-row__thumb {
  display: block; width: min(100%, 248px); aspect-ratio: 16 / 10; margin: 2px 0 16px;
  overflow: hidden; border-radius: var(--r-sm, 14px); box-shadow: var(--clay-sm, var(--clay-md));
  background: linear-gradient(178deg, var(--sand-935, #efe7da) 0%, var(--sand-908, #e6dccb) 100%);
}
.index-row__thumb picture, .index-row__thumb img { display: block; width: 100%; height: 100%; }
.index-row__thumb img { object-fit: cover; transition: transform .6s var(--ease, ease); }
a.index-row:hover .index-row__thumb img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .index-row__thumb img { transition: none; } a.index-row:hover .index-row__thumb img { transform: none; } }

/* ── post cards (/insights/, categories, authors): the lead card's anatomy at a
   smaller scale — image left, copy right — so every row lines up under the
   "Latest" card (includes/post-card.php). Text-only when there is no image. ── */
.pcards { display: grid; gap: clamp(18px, 2vw, 26px); margin-top: 0; }
.pcard {
  display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); align-items: center;
  gap: clamp(22px, 3vw, 46px); padding: clamp(12px, 1.3vw, 18px);
  text-decoration: none; color: inherit;
}
.pcard--text { grid-template-columns: minmax(0, 1fr); padding: clamp(22px, 2.6vw, 34px); }
.pcard > .index-row__thumb { width: 100%; margin: 0; aspect-ratio: 1.9 / 1; border-radius: var(--r); box-shadow: var(--clay-in); }
.pcard__copy { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; min-width: 0;
  padding: clamp(2px, .8vw, 10px) clamp(4px, 1.4vw, 22px) clamp(2px, .8vw, 10px) 0; }
.pcard--text .pcard__copy { padding: 0; }
.pcard__title { font: 300 clamp(1.35rem, 2.1vw, 1.9rem)/1.15 Newsreader, Georgia, serif; letter-spacing: -.015em;
  color: var(--ink); text-wrap: balance; overflow-wrap: break-word; }
.pcard__title .tag-new { top: -.2em; }
.pcard__body { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  font: 400 15px/1.7 Inter, sans-serif; color: var(--ink-muted); }
.pcard .post-meta { margin-top: 0; }
.pcard__more svg { transition: transform .3s var(--ease, ease); }
.pcard:hover .pcard__more svg { transform: translateX(4px); }
.pcard:hover .index-row__thumb img { transform: scale(1.03); }
@media (max-width: 760px) {
  .pcard { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pcard__copy { padding: 0 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .pcard, .pcard__more svg { transition: none; }
  .pcard:hover, .pcard:focus-visible { transform: none; }
  .pcard:hover .pcard__more svg { transform: none; }
}
