/* ============================================================
   CURRENT AFFAIRS — digest, hub, and the FAQ box that
   inc/faq-meta.php renders on single posts.

   Enqueued by riyasat_ca_assets() in inc/current-affairs.php
   (and defensively by the templates themselves, same handle):
   only on a CA hub/digest, or on a single post that actually
   has FAQ pairs stored. Never sitewide.

   ------------------------------------------------------------
   TOKENS
   ------------------------------------------------------------
   main.css declares --s-*, --e-*, --hairline, --ink, --ink-soft
   on .yatharth-page-wrapper, and every CA template renders
   inside that wrapper. Each var() below still carries its
   literal fallback: riyasat_faq_render() is callable from any
   template, and an unresolved --s-2 would collapse the padding
   to zero rather than degrade to something readable.

   Palette is the existing one — #e71d39, #FA4651, #FF515A,
   #FF8C2B — plus the greys already in main.css / single.css
   (#f9f9f9, #fbf9f8, #3a3430, #eeeeee). Nothing new.

   ------------------------------------------------------------
   MARKUP CONTRACT
   ------------------------------------------------------------
   Confirmed against template-parts/ca-digest.php,
   riyasat_ca_date_list_shortcode() and riyasat_faq_render():

     .ca-shell.ca-layout[.ca-layout--sidebar]
       .ca-main
         nav.ca-crumbs > ol > li
         header.ca-intro                       (grey intro card)
           h1.ca-intro-title
           p.ca-intro-byline > .ca-intro-sep + time
           p.ca-intro-text
           p.ca-intro-count
         .ca-articles
           section.ca-daygroup                 (month mode only)
             h2.ca-daygroup-head > a
             .ca-daygroup-body
           article.ca-article
             h2|h3.ca-article-title > a
             figure.ca-article-media > a > img.ca-article-img
                                     + figcaption.ca-article-cap
             .ca-article-content.entry-content
             section.ca-box.ca-faq
           hr.ca-sep
           aside.ca-cta > .ca-cta-title
                        + .ca-cta-row > a.ca-btn.ca-btn--call|--wa|--apply
                        + .ca-cta-note > a.ca-cta-tel
         .ca-empty > .ca-empty-title + p + ul.ca-empty-links
         nav.ca-pagination > .nav-links > .page-numbers
       aside.ca-side                           (sidebar column)

   Box shell, shared by the hub's Trending list, the date-list
   shortcode and every FAQ block:

     section.ca-box > h2.ca-box-head + .ca-box-body

   Hub-only classes (.ca-head, .ca-eyebrow, .ca-title,
   .ca-trending, .ca-linkgrid, .ca-desc) and sidebar-only
   classes (.ca-card, .ca-datepick, .ca-recent, .ca-links) are
   styled here to the same contract; ca-hub.php and
   ca-sidebar.php must emit exactly these names.

   Mobile-first: base rules are the 375px layout, min-width
   queries upgrade. Every interactive target is >= 44px.
   ============================================================ */

/* ---------- utilities ---------- */
.ca-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   1. SHELL AND COLUMN LAYOUT
   ca-digest.php puts .ca-shell and .ca-layout on the SAME
   element, so the two must compose rather than nest.
   ============================================================ */
.ca-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 700px) {
  .ca-shell { padding: 0 24px; }
}

.ca-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-4, 32px);
  align-items: start;
  padding-top: var(--s-3, 24px);
  padding-bottom: var(--s-6, 64px);
}

/* Two columns only when there is genuinely room. 1000px, not
   768px: at tablet width a 320px rail squeezes the article body
   under 45 characters a line, which is where long-form reading
   falls apart. */
@media (min-width: 1000px) {
  .ca-layout--sidebar {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--s-5, 48px);
  }
}

.ca-main { min-width: 0; }

/* Without a sidebar the main column would run the full 1240px.
   Cap it at a reading measure so a digest is not 160 characters
   a line on a desktop. */
.ca-layout:not(.ca-layout--sidebar) .ca-main {
  max-width: 78ch;
  margin-inline: auto;
}

@media (min-width: 1000px) {
  .ca-side {
    position: sticky;
    top: 90px;
  }
}

/* ============================================================
   2. BREADCRUMB
   ============================================================ */
.ca-crumbs {
  font-size: 0.85rem;
  margin-bottom: var(--s-2, 16px);
}

.ca-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ca-crumbs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft, #5C5550);
}

.ca-crumbs li + li::before {
  content: '›';
  color: #b7afa9;
  font-size: 1rem;
  line-height: 1;
}

/* Vertical padding buys a taller hit area on a phone without
   making the crumb bar itself any taller — the li gap absorbs it. */
.ca-crumbs a {
  display: inline-block;
  padding: 6px 0;
  color: var(--ink-soft, #5C5550);
  text-decoration: none;
}

.ca-crumbs a:hover,
.ca-crumbs a:focus-visible {
  color: #e71d39;
  text-decoration: underline;
}

.ca-crumbs [aria-current='page'] {
  color: var(--ink, #14100E);
  font-weight: 600;
}

/* ============================================================
   3. GREY INTRO CARD (digest)
   ============================================================ */
.ca-intro {
  background: #f9f9f9;
  border: 1px solid var(--hairline, #ece8e4);
  border-radius: 16px;
  padding: var(--s-3, 24px) var(--s-2, 16px);
  margin: 0 0 var(--s-4, 32px);
}

@media (min-width: 700px) {
  .ca-intro { padding: var(--s-4, 32px); }
}

.ca-intro-title {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.5rem, 5.2vw, 2.25rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.025em;
  color: var(--ink, #14100E);
  margin: 0 0 10px;
}

.ca-intro-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 var(--s-2, 16px);
  padding-bottom: var(--s-2, 16px);
  border-bottom: 1px solid #e6e1dc;
  font-size: 0.88rem;
  color: var(--ink-soft, #5C5550);
}

.ca-intro-sep { color: #b7afa9; }

.ca-intro-text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink-soft, #5C5550);
}

.ca-intro-count {
  margin: var(--s-2, 16px) 0 0;
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e71d39;
}

/* ============================================================
   4. HUB HEAD  (ca-hub.php)
   ============================================================ */
.ca-head {
  margin: 0 0 var(--s-4, 32px);
}

.ca-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #e71d39;
}

.ca-eyebrow::before {
  content: '';
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #e71d39, #FF8C2B);
}

.ca-title {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.55rem, 5.4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.025em;
  color: var(--ink, #14100E);
  margin: 0 0 var(--s-2, 16px);
}

.ca-lede {
  max-width: 70ch;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--ink-soft, #5C5550);
}

/* ============================================================
   5. THE BOX — Trending / date list / FAQ
   The reference site's orange section headers map onto our
   #e71d39 → #FF8C2B gradient.
   ============================================================ */
.ca-box {
  background: #ffffff;
  border: 1px solid var(--hairline, #ece8e4);
  border-radius: 16px;
  box-shadow: var(--e-1, 0 1px 2px rgba(16, 12, 10, 0.04), 0 2px 8px rgba(16, 12, 10, 0.04));
  overflow: hidden;
  margin: 0 0 var(--s-4, 32px);
}

.ca-box-head {
  margin: 0;
  padding: 15px var(--s-2, 16px);
  background: linear-gradient(100deg, #e71d39 0%, #FA4651 48%, #FF8C2B 100%);
  color: #ffffff;
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

@media (min-width: 700px) {
  .ca-box-head {
    padding: 16px var(--s-3, 24px);
    font-size: 1.15rem;
  }
}

.ca-box-body {
  padding: var(--s-2, 16px);
}

@media (min-width: 700px) {
  .ca-box-body { padding: var(--s-3, 24px); }
}

/* ============================================================
   6. TWO-COLUMN LINK GRIDS
   .ca-linkgrid  — the hub's "Trending" archive loop
   .ca-datelist-grid — the [ca_date_list] shortcode
   One column at <= 600px.
   ============================================================ */
.ca-linkgrid,
.ca-datelist-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 var(--s-3, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 601px) {
  .ca-linkgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* --ca-cols is set inline by the shortcode, clamped 1–4 in PHP. */
  .ca-datelist-grid { grid-template-columns: repeat(var(--ca-cols, 2), minmax(0, 1fr)); }
}

.ca-linkgrid-item,
.ca-datelist-item {
  margin: 0;
  border-bottom: 1px solid #f0ece8;
}

.ca-linkgrid-item a,
.ca-datelist-item a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 11px 4px;
  color: var(--ink, #14100E);
  font-size: 0.97rem;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ca-linkgrid-item a:hover,
.ca-linkgrid-item a:focus-visible,
.ca-datelist-item a:hover,
.ca-datelist-item a:focus-visible {
  color: #e71d39;
}

/* Leading arrow marker on Trending — an icon, not a list bullet. */
.ca-linkgrid-item a::before {
  content: '➞';
  flex-shrink: 0;
  margin-top: 1px;
  color: #FF8C2B;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: transform 0.2s ease;
}

.ca-linkgrid-item a:hover::before,
.ca-linkgrid-item a:focus-visible::before {
  transform: translateX(3px);
}

/* Date rows push their arrow to the trailing edge. */
.ca-datelist-item a {
  justify-content: space-between;
  font-weight: 600;
}

.ca-arrow {
  flex-shrink: 0;
  color: #FF8C2B;
  transition: transform 0.2s ease;
}

.ca-datelist-item a:hover .ca-arrow,
.ca-datelist-item a:focus-visible .ca-arrow {
  transform: translateX(3px);
}

/* In the narrow sidebar the date box drops to one column always. */
.ca-side .ca-datelist-grid { grid-template-columns: minmax(0, 1fr); }

/* ============================================================
   7. DIGEST ARTICLES
   ============================================================ */
.ca-articles { margin: 0; }

.ca-article { margin: 0; }

.ca-article-title {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.3rem, 4.6vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink, #14100E);
  margin: 0 0 var(--s-2, 16px);
  scroll-margin-top: 96px;
}

.ca-article-title a {
  color: inherit;
  text-decoration: none;
}

.ca-article-title a:hover,
.ca-article-title a:focus-visible {
  color: #e71d39;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ca-article-media {
  margin: 0 0 var(--s-3, 24px);
}

.ca-article-media a {
  display: block;
  border-radius: 14px;
  overflow: hidden;
}

.ca-article-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.ca-article-cap {
  margin-top: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #6b6460;
  text-align: center;
}

/* ---------- article body ----------
   Mirrors single.css's .entry-content so an article reads the
   same on the digest as on its own page. Scoped to
   .ca-article-content because single.css is not loaded here. */
.ca-article-content {
  font-size: 1rem;
  line-height: 1.75;
  color: #3a3430;
  overflow-wrap: break-word;
}

@media (min-width: 700px) {
  .ca-article-content { font-size: 1.05rem; }
}

.ca-article-content > * { margin: 0 0 var(--s-3, 24px); }
.ca-article-content > *:last-child { margin-bottom: 0; }
.ca-article-content p { margin: 0 0 var(--s-3, 24px); }

.ca-article-content h2,
.ca-article-content h3,
.ca-article-content h4,
.ca-article-content h5,
.ca-article-content h6 {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--ink, #14100E);
  scroll-margin-top: 96px;
}

/* Deliberately one step smaller than .ca-article-title: on a
   digest the article title is the H2, so the post's own H2s must
   not compete with it. No border-top either — single.css uses one
   as a section rule, but here .ca-sep already divides articles
   and a second rule reads as a mis-split. */
.ca-article-content h2 {
  font-size: clamp(1.15rem, 3.8vw, 1.4rem);
  margin: var(--s-4, 32px) 0 var(--s-2, 16px);
}

.ca-article-content h3 {
  font-size: clamp(1.05rem, 3.2vw, 1.2rem);
  margin: var(--s-3, 24px) 0 12px;
}

.ca-article-content h4,
.ca-article-content h5,
.ca-article-content h6 {
  font-size: 1rem;
  margin: var(--s-3, 24px) 0 10px;
}

.ca-article-content a {
  color: #c2152f;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

.ca-article-content a:hover,
.ca-article-content a:focus-visible {
  color: #8e1023;
  text-decoration-thickness: 2px;
}

.ca-article-content strong,
.ca-article-content b {
  color: var(--ink, #14100E);
  font-weight: 700;
}

.ca-article-content ul,
.ca-article-content ol {
  margin: 0 0 var(--s-3, 24px);
  padding-left: 22px;
}

.ca-article-content li { margin-bottom: 8px; }
.ca-article-content ul li::marker { color: #FF8C2B; }
.ca-article-content ol li::marker { color: #e71d39; font-weight: 700; }

.ca-article-content blockquote {
  margin: var(--s-4, 32px) 0;
  padding: 16px 18px;
  background: #fbf9f8;
  border-left: 4px solid #e71d39;
  border-radius: 0 12px 12px 0;
  color: var(--ink, #14100E);
}

.ca-article-content blockquote p:last-child { margin-bottom: 0; }

.ca-article-content img,
.ca-article-content iframe,
.ca-article-content video {
  max-width: 100%;
  height: auto;
}

.ca-article-content img { border-radius: 12px; }

.ca-article-content figure { margin: var(--s-4, 32px) 0; }

.ca-article-content figcaption {
  margin-top: 8px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #6b6460;
  text-align: center;
}

/* Syllabus tables are common in these posts and must never push
   the page sideways on a phone. */
.ca-article-content table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.ca-article-content th,
.ca-article-content td {
  border: 1px solid var(--hairline, #ece8e4);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.ca-article-content th {
  background: #f9f9f9;
  color: var(--ink, #14100E);
  font-weight: 700;
}

/* The article's own FAQ block sits tight under its content. */
.ca-article .ca-faq {
  margin-top: var(--s-3, 24px);
  margin-bottom: 0;
}

/* ---------- separator between articles ---------- */
.ca-sep {
  height: 1px;
  border: 0;
  margin: var(--s-4, 32px) 0;
  background: linear-gradient(90deg, rgba(231, 29, 57, 0.3), rgba(255, 140, 43, 0.22) 45%, transparent);
}

/* The template emits an <hr> after every article including the
   last, where it would trail the page. It is always the final
   child of .ca-articles (day mode) or .ca-daygroup-body (month). */
.ca-sep:last-child { display: none; }

/* ---------- month mode: one group per calendar day ---------- */
.ca-daygroup {
  margin: 0 0 var(--s-5, 48px);
}

.ca-daygroup-head {
  margin: 0 0 var(--s-3, 24px);
  padding-bottom: 10px;
  border-bottom: 2px solid #f0ece8;
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.1rem, 3.6vw, 1.3rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink, #14100E);
}

.ca-daygroup-head a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
}

.ca-daygroup-head a::after {
  content: '→';
  color: #FF8C2B;
  font-size: 0.9em;
  transition: transform 0.2s ease;
}

.ca-daygroup-head a:hover,
.ca-daygroup-head a:focus-visible { color: #e71d39; }

.ca-daygroup-head a:hover::after,
.ca-daygroup-head a:focus-visible::after { transform: translateX(3px); }

/* ============================================================
   8. LEAD CTA BAND
   ============================================================ */
.ca-cta {
  border-radius: 18px;
  padding: var(--s-3, 24px) var(--s-2, 16px);
  margin: var(--s-4, 32px) 0;
  background:
    radial-gradient(700px 340px at 110% -25%, rgba(255, 140, 43, 0.2), transparent 62%),
    linear-gradient(135deg, #e71d39 0%, #FA4651 100%);
  color: rgba(255, 255, 255, 0.94);
  box-shadow: var(--e-2, 0 2px 4px rgba(16, 12, 10, 0.04), 0 8px 24px rgba(16, 12, 10, 0.07));
}

@media (min-width: 700px) {
  .ca-cta { padding: var(--s-4, 32px); }
}

.ca-cta--end { margin-bottom: 0; }

.ca-cta-title {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.15rem, 3.8vw, 1.45rem);
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.02em;
  color: #ffffff;
  margin: 0 0 10px;
}

.ca-cta p {
  margin: 0 0 var(--s-3, 24px);
  font-size: 0.95rem;
  line-height: 1.7;
}

.ca-cta-row {
  display: grid;
  gap: 10px;
}

@media (min-width: 560px) {
  .ca-cta-row {
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
}

/* The sidebar rail is never wide enough for three side-by-side. */
.ca-side .ca-cta-row {
  grid-auto-flow: row;
  grid-auto-columns: auto;
}

.ca-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 18px;
  border-radius: 10px;
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: filter 0.2s ease, transform 0.15s ease;
}

.ca-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  fill: currentColor;
}

.ca-btn--call,
.ca-btn--apply {
  background: #ffffff;
  color: #e71d39;
}

.ca-btn--wa {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.ca-btn:hover,
.ca-btn:focus-visible { filter: brightness(1.05); }
.ca-btn:active { transform: scale(0.98); }

.ca-cta-note {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.9);
}

/* A tel: link on a phone is a real CTA, so it gets a padded hit
   area rather than the bare 18px line box of inline text. */
.ca-cta-tel {
  display: inline-block;
  padding: 8px 2px;
  color: #ffffff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================================
   9. EMPTY DATE
   ============================================================ */
.ca-empty {
  background: #f9f9f9;
  border: 1px solid var(--hairline, #ece8e4);
  border-radius: 16px;
  padding: var(--s-4, 32px) var(--s-2, 16px);
  text-align: center;
}

.ca-empty-title {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.15rem, 4vw, 1.35rem);
  font-weight: 800;
  color: var(--ink, #14100E);
  margin: 0 0 10px;
}

.ca-empty p {
  margin: 0 auto;
  max-width: 48ch;
  line-height: 1.7;
  color: var(--ink-soft, #5C5550);
}

.ca-empty-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  margin: var(--s-3, 24px) 0 0;
  padding: 0;
  list-style: none;
}

.ca-empty-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--hairline, #ece8e4);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink, #14100E);
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.ca-empty-links a:hover,
.ca-empty-links a:focus-visible {
  border-color: #FF8C2B;
  color: #e71d39;
  background: #fff8f2;
}

/* ============================================================
   10. PAGINATION  (the_posts_pagination)
   ============================================================ */
.ca-pagination {
  margin: var(--s-4, 32px) 0;
}

.ca-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ca-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--hairline, #ece8e4);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink, #14100E);
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ca-pagination a.page-numbers:hover,
.ca-pagination a.page-numbers:focus-visible {
  border-color: #FF8C2B;
  color: #e71d39;
  background: #fff8f2;
}

.ca-pagination .page-numbers.current {
  background: linear-gradient(100deg, #e71d39, #FF8C2B);
  border-color: transparent;
  color: #ffffff;
}

.ca-pagination .page-numbers.dots {
  min-width: 24px;
  padding: 0 2px;
  border-color: transparent;
  background: transparent;
}

.ca-pagination .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ============================================================
   11. TERM DESCRIPTION BODY (hub) — long SEO copy with H2s
   ============================================================ */
.ca-desc {
  margin: 0 0 var(--s-4, 32px);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink-soft, #5C5550);
}

.ca-desc > *:first-child { margin-top: 0; }
.ca-desc > *:last-child { margin-bottom: 0; }

.ca-desc h2,
.ca-desc h3 {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink, #14100E);
  line-height: 1.3;
  margin: var(--s-4, 32px) 0 var(--s-2, 16px);
}

.ca-desc h2 { font-size: clamp(1.2rem, 3.8vw, 1.5rem); }
.ca-desc h3 { font-size: clamp(1.05rem, 3.2vw, 1.22rem); }

.ca-desc p { margin: 0 0 var(--s-2, 16px); }

.ca-desc ul,
.ca-desc ol {
  margin: 0 0 var(--s-2, 16px);
  padding-left: 22px;
}

.ca-desc li { margin-bottom: 8px; }
.ca-desc ul li::marker { color: #FF8C2B; }

.ca-desc a {
  color: #c2152f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* The date-list box is dropped straight into a term description,
   where it must not inherit the copy's paragraph rhythm. */
.ca-desc .ca-box { margin-top: var(--s-4, 32px); }

/* ============================================================
   12. FAQ BOX
   The accordion internals (.faq-box / .faq-trigger /
   .faq-content / .faq-plus-icon) are already styled in main.css
   and wired in main.js. Two things need correcting:

   (a) .faq-wrapper is a standalone 850px centred card in
       main.css. riyasat_faq_render() puts that class on
       .ca-box-body, so without this reset we get a card nested
       in a card, narrower than and offset from its own header.
   (b) .faq-trigger already carries 22px/16px padding, so the
       box body must not add a second layer on top.
   ============================================================ */
.ca-faq .ca-box-body {
  padding: 4px 8px;
}

@media (min-width: 700px) {
  .ca-faq .ca-box-body { padding: 6px var(--s-2, 16px); }
}

.ca-box .faq-wrapper {
  max-width: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Rich answers can hold lists and headings; main.css pads only <p>. */
.ca-faq .faq-content > *:not(p) {
  margin: 0 0 12px;
  padding: 0 16px;
}

.ca-faq .faq-content > *:last-child { padding-bottom: 18px; }

.ca-faq .faq-content ul,
.ca-faq .faq-content ol {
  padding-left: calc(16px + 22px);
}

.ca-faq .faq-content li { margin-bottom: 6px; }

.ca-faq .faq-content a {
  color: #c2152f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* In the rail the triggers need to give back horizontal room. */
.ca-side .ca-faq .faq-trigger {
  padding: 16px 10px;
  font-size: 1rem;
}

.ca-side .ca-faq .faq-content p { padding: 0 10px 16px; }

/* ============================================================
   13. SIDEBAR CARDS
   ============================================================ */
.ca-card {
  background: #ffffff;
  border: 1px solid var(--hairline, #ece8e4);
  border-radius: 16px;
  box-shadow: var(--e-1, 0 1px 2px rgba(16, 12, 10, 0.04), 0 2px 8px rgba(16, 12, 10, 0.04));
  overflow: hidden;
  margin: 0 0 var(--s-3, 24px);
}

.ca-card-head {
  margin: 0;
  padding: 14px var(--s-2, 16px);
  background: linear-gradient(100deg, #e71d39 0%, #FA4651 48%, #FF8C2B 100%);
  color: #ffffff;
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.ca-card-body {
  padding: var(--s-2, 16px);
}

/* ---------- Archives by Date ---------- */
.ca-datepick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.ca-select {
  width: 100%;
  min-height: 44px;
  padding: 10px 28px 10px 10px;
  border: 1px solid var(--hairline, #ece8e4);
  border-radius: 10px;
  background-color: #ffffff;
  /* Inline chevron as a data URI: no extra request, and no
     dependency on the icon sprite being present on this page. */
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235C5550' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  color: var(--ink, #14100E);
  font-family: inherit;
  /* 16px exactly: iOS Safari zooms the viewport on focus for
     anything smaller, which throws the reader off the page. */
  font-size: 16px;
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

@media (min-width: 1000px) {
  /* No touch-zoom risk once we are on a pointer device. */
  .ca-select { font-size: 0.92rem; }
}

.ca-select:focus-visible {
  outline: 2px solid #e71d39;
  outline-offset: 1px;
  border-color: #e71d39;
}

.ca-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 12px 18px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(100deg, #e71d39, #FF8C2B);
  color: #ffffff;
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.15s ease;
}

.ca-go:hover,
.ca-go:focus-visible { filter: brightness(1.06); }
.ca-go:active { transform: scale(0.98); }

.ca-datepick-note {
  margin: 10px 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-soft, #5C5550);
}

/* ---------- Recent posts + link blocks ---------- */
.ca-recent,
.ca-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ca-recent-item,
.ca-links-item {
  border-bottom: 1px solid #f0ece8;
}

.ca-recent-item:last-child,
.ca-links-item:last-child { border-bottom: 0; }

.ca-recent-item a,
.ca-links-item a {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  padding: 11px 2px;
  color: var(--ink, #14100E);
  font-size: 0.93rem;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ca-recent-item a::before,
.ca-links-item a::before {
  content: '➞';
  flex-shrink: 0;
  margin-top: 1px;
  color: #FF8C2B;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.ca-recent-item a:hover,
.ca-recent-item a:focus-visible,
.ca-links-item a:hover,
.ca-links-item a:focus-visible { color: #e71d39; }

.ca-recent-item a:hover::before,
.ca-recent-item a:focus-visible::before,
.ca-links-item a:hover::before,
.ca-links-item a:focus-visible::before { transform: translateX(3px); }

.ca-recent-date {
  display: block;
  margin-top: 3px;
  font-size: 0.78rem;
  color: var(--ink-soft, #5C5550);
}

/* ============================================================
   14. FOCUS VISIBILITY
   These pages are mostly long lists of links; a keyboard user
   must always be able to see where they are.
   ============================================================ */
.ca-layout a:focus-visible,
.ca-layout button:focus-visible,
.ca-layout select:focus-visible {
  outline: 2px solid #e71d39;
  outline-offset: 2px;
  border-radius: 4px;
}

.ca-cta a:focus-visible,
.ca-box-head a:focus-visible,
.ca-card-head a:focus-visible {
  outline-color: #ffffff;
}

/* ============================================================
   15. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .ca-layout *,
  .ca-layout *::before,
  .ca-layout *::after {
    transition: none !important;
    animation: none !important;
  }

  .ca-linkgrid-item a:hover::before,
  .ca-linkgrid-item a:focus-visible::before,
  .ca-recent-item a:hover::before,
  .ca-recent-item a:focus-visible::before,
  .ca-links-item a:hover::before,
  .ca-links-item a:focus-visible::before,
  .ca-daygroup-head a:hover::after,
  .ca-daygroup-head a:focus-visible::after,
  .ca-datelist-item a:hover .ca-arrow,
  .ca-datelist-item a:focus-visible .ca-arrow {
    transform: none;
  }

  .ca-go:active,
  .ca-btn:active { transform: none; }

  /* A sticky rail is its own kind of motion on a scrolling page. */
  .ca-side { position: static; }
}

/* ============================================================
   16. PRINT
   Aspirants print digests to revise offline. Strip the chrome,
   keep the reading. Backgrounds are dropped rather than forced
   with print-color-adjust: a solid gradient bar burns ink and
   greys the heading out on most office printers.
   ============================================================ */
@media print {
  .ca-side,
  .ca-cta,
  .ca-datelist,
  .ca-pagination,
  .ca-crumbs,
  .ca-eyebrow,
  .ca-intro-count,
  .ca-empty-links,
  .ca-datepick { display: none !important; }

  .ca-shell {
    max-width: none;
    padding: 0;
  }

  .ca-layout {
    display: block;
    padding: 0;
  }

  .ca-layout:not(.ca-layout--sidebar) .ca-main {
    max-width: none;
    margin-inline: 0;
  }

  .ca-box,
  .ca-card,
  .ca-intro,
  .ca-empty {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
  }

  .ca-box-head,
  .ca-card-head {
    background: none;
    color: #000000;
    padding: 0 0 4pt;
    margin-bottom: 8pt;
    border-bottom: 1pt solid #000000;
  }

  .ca-box-body,
  .ca-card-body,
  .ca-faq .ca-box-body { padding: 0; }

  .ca-intro {
    border-bottom: 1pt solid #cccccc;
    padding-bottom: 8pt;
    margin-bottom: 12pt;
  }

  .ca-intro-byline {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .ca-title,
  .ca-intro-title,
  .ca-article-title,
  .ca-daygroup-head,
  .ca-article-content { color: #000000; }

  /* Never orphan a heading at the foot of a page. */
  .ca-intro-title,
  .ca-article-title,
  .ca-daygroup-head,
  .ca-box-head,
  .ca-desc h2,
  .ca-article-content h2,
  .ca-article-content h3 {
    break-after: avoid-page;
    page-break-after: avoid;
  }

  .ca-article-img,
  .ca-article-content img,
  .ca-article-content table,
  .ca-article-content blockquote,
  .ca-article-content figure {
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  .ca-article-img,
  .ca-article-content img { max-width: 100%; }

  .ca-article-content blockquote {
    background: none;
    border-left: 2pt solid #000000;
  }

  .ca-article-content th { background: none; }

  .ca-sep {
    background: none;
    border-top: 1pt solid #cccccc;
    margin: 12pt 0;
  }

  /* Collapsed panels would print blank. */
  .ca-faq .faq-content {
    max-height: none !important;
    visibility: visible !important;
    overflow: visible !important;
  }

  .ca-faq .faq-plus-icon { display: none; }

  .ca-faq .faq-trigger {
    padding: 8pt 0 2pt;
    color: #000000;
    background: none;
  }

  .ca-faq .faq-content p,
  .ca-faq .faq-content > *:not(p) {
    padding-left: 0;
    padding-right: 0;
  }

  .ca-layout a {
    color: #000000;
    text-decoration: none;
  }

  /* Article links carry real reference value on paper. */
  .ca-article-content a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    word-break: break-all;
  }

  .ca-layout {
    font-size: 11pt;
    line-height: 1.5;
  }
}

/* Digest article summary — the digest links out rather than reprinting each
   article in full, so the summary and its "read the full article" affordance
   carry the whole block. */
.ca-article-summary {
  margin: 0 0 var(--s-3, 12px);
  color: var(--ink-soft, #55504b);
  font-size: 1.02rem;
  line-height: 1.65;
}
.ca-article-more { margin: 0; }
.ca-readmore {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700; font-size: 0.95rem;
  color: #e71d39; text-decoration: none;
}
.ca-readmore:hover, .ca-readmore:focus-visible { text-decoration: underline; }
.ca-readmore span { transition: transform .18s ease; }
.ca-readmore:hover span { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .ca-readmore span { transition: none; }
  .ca-readmore:hover span { transform: none; }
}


/* ============================================================
   BROWSE BY TOPIC — the static-reference section hub
   (template-parts/section-hub.php, /upsc-exam/).

   Lives here rather than in a pages/upsc-exam.css because the
   section hub emits this file's contract wholesale — .ca-shell,
   .ca-box, .ca-linkgrid, .ca-crumbs, .ca-card. The topic grid
   is the ONE component it adds, and splitting one component
   into a second stylesheet is how a shared contract drifts.

   Markup, from section-hub.php:

     section.ca-box.ca-topics > h2.ca-box-head
       + .ca-box-body
           > .ca-topic-grid
               > article.ca-topic
                   > h3.ca-topic-head
                   + p.ca-topic-blurb
                   + ul.ca-topic-links > li > a

   Arrows are ::before content, matching .ca-links-item, so the
   template emits no arrow markup.
   ============================================================ */
.ca-topic-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-2, 16px);
}

/* Two columns from the tablet breakpoint the .ca-linkgrid already
   uses, so the two grids on the page change shape together rather
   than at two different widths. */
@media (min-width: 601px) {
  .ca-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The sidebar takes ~320px of a 1000px viewport, so the main column
   only has room for a third card well past that. */
@media (min-width: 1180px) {
  .ca-topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.ca-topic {
  min-width: 0;
  padding: var(--s-2, 16px);
  background: #fbf9f8;
  border: 1px solid var(--hairline, #ece8e4);
  border-radius: 12px;
}

/* An H3 under the box's gradient H2. The rule is a colour accent, not
   a heading treatment — the gradient belongs to .ca-box-head alone, and
   repeating it on every card would flatten the hierarchy. */
.ca-topic-head {
  margin: 0 0 6px;
  padding: 0 0 0 10px;
  border-left: 3px solid #FF8C2B;
  color: var(--ink, #14100E);
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.ca-topic-blurb {
  margin: 0 0 10px;
  padding-left: 13px;
  color: var(--ink-soft, #5C5550);
  font-size: 0.86rem;
  line-height: 1.55;
}

.ca-topic-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ca-topic-links li { border-bottom: 1px solid #f0ece8; }
.ca-topic-links li:last-child { border-bottom: 0; }

.ca-topic-links a {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  /* 44px minimum touch target, per the rest of this file. */
  min-height: 44px;
  padding: 11px 2px;
  color: var(--ink, #14100E);
  font-size: 0.92rem;
  line-height: 1.5;
  text-decoration: none;
}

.ca-topic-links a::before {
  content: '➞';
  flex-shrink: 0;
  margin-top: 1px;
  color: #FF8C2B;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.ca-topic-links a:hover,
.ca-topic-links a:focus-visible { color: #e71d39; }

.ca-topic-links a:hover::before,
.ca-topic-links a:focus-visible::before { transform: translateX(3px); }

@media (min-width: 700px) {
  .ca-topic { padding: var(--s-3, 24px); }
  .ca-topic-head { font-size: 1.06rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ca-topic-links a::before,
  .ca-topic-links a:hover::before,
  .ca-topic-links a:focus-visible::before {
    transition: none;
    transform: none;
  }
}

/* The topic map is navigation, not reading matter — on paper it is a
   list of URLs the reader cannot follow. */
@media print {
  .ca-topics { display: none; }
}
