/* Per-post arrangement components (scripts/post_layout.py, site/data/post_layout/<slug>.json).
   The words are always the post's own; these classes only arrange them. Catalogue: pages/post-layout/GUIDE.md */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout: contents on the left, article column, nothing floating on the right */
.post-wrap { padding-top: var(--s-4); }
.post-body.lc { max-width: 760px; }
.post-body.lc > * + * { margin-top: var(--s-3); }
.post-body.lc p { line-height: 1.75; }
.post-body.lc h2 { margin-top: var(--s-6); }
.post-body.lc h3 { margin-top: var(--s-4); }

/* Contents (desktop sidebar + phone drop-down) */
.lc-toc { max-height: calc(100vh - 2 * var(--s-3)); overflow-y: auto; padding-right: var(--s-1); }
/* Each entry is its own numbered row with a divider, so wrapped titles don't run into the next one */
.lc-toc > ol { border-left: 0 !important; counter-reset: t; }
.lc-toc > ol > li { counter-increment: t; border-bottom: 1px solid var(--c-line); }
.lc-toc > ol > li:last-child { border-bottom: 0; }
.lc-toc > ol > li > a { display: grid !important; grid-template-columns: 26px 1fr; align-items: start; min-height: 0 !important; margin-left: 0 !important; padding: 10px 8px !important; border-left: 0 !important; font-size: .9375rem; line-height: 1.35; color: var(--c-slate); border-radius: var(--radius-sm); }
.lc-toc > ol > li > a::before { content: counter(t); font-family: var(--ff-display); font-size: .8125rem; line-height: 1.6; color: var(--c-text-muted); }
.lc-toc > ol > li.lc-toc--h3 { counter-increment: none; border-bottom: 0; }
.lc-toc > ol > li.lc-toc--h3 > a { padding: 4px 8px 6px 34px !important; grid-template-columns: 1fr; font-size: .8125rem; }
.lc-toc > ol > li.lc-toc--h3 > a::before { content: none; }
.lc-toc > ol > li > a:hover { color: var(--c-red-text); background: var(--c-surface); }
.lc-toc > ol > li > a.is-on { color: var(--c-charcoal); background: var(--c-surface); box-shadow: inset 3px 0 0 var(--c-red-text); }
.lc-toc > ol > li > a.is-on::before { color: var(--c-red-text); }
.lc-toc__cases { margin-top: var(--s-4); }
.lc-caselinks { border-left: 2px solid var(--c-line); }
.lc-caselinks a { display: block; padding: 6px 0 6px var(--s-2); margin-left: -2px; border-left: 2px solid transparent; color: var(--c-slate); font-family: var(--ff-serif); font-style: italic; font-size: .875rem; line-height: 1.35; text-decoration: none; }
.lc-caselinks a:hover { color: var(--c-red-text); border-left-color: var(--c-red-text); }
.lc-mtoc, .lc-mcases { border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-white); }
.lc-mtoc summary, .lc-mcases summary { display: flex; justify-content: space-between; align-items: center; min-height: var(--tap-min); padding: 0 var(--s-2); font-family: var(--ff-display); color: var(--c-charcoal); cursor: pointer; }
.lc-mtoc summary span, .lc-mcases summary span { font-size: var(--fs-sm); color: var(--c-text-muted); }
.lc-mtoc ol { padding: 0 var(--s-2) var(--s-2) var(--s-4) !important; list-style: decimal; }
.lc-mtoc li.lc-toc--h3 { list-style: none; margin-left: var(--s-2); font-size: var(--fs-sm); }
.lc-mtoc a { display: block; padding: 6px 0; color: var(--c-slate); text-decoration: none !important; }
.lc-mcases ol { padding: 0 var(--s-2) var(--s-2) !important; border: 0; list-style: none; }
.post-body .lc-mcases a { text-decoration: none; }
@media (min-width: 960px) { .lc-mtoc, .lc-mcases { display: none; } }

/* Opening paragraph */
.post-body p.lc-lead { font-family: var(--ff-serif); font-size: 1.1875rem; line-height: 1.7; color: var(--c-charcoal); }
.post-body p.lc-leadin { font-family: var(--ff-display); color: var(--c-slate); }
.post-body p.lc-leadin strong { font-weight: normal; }

/* Highlight box: definitions, tests, the key line of a judgment */
.post-body .lc-key { padding: var(--s-3); background: #FBF6E9; border-left: 5px solid var(--c-gold); border-radius: var(--radius); }
.post-body .lc-key > * + * { margin-top: var(--s-2); }
.post-body p.lc-key { font-family: var(--ff-serif); }

/* Pull line: a quoted authority or a sentence the post leans on */
.post-body p.lc-pull { padding-left: var(--s-3); border-left: 3px solid var(--c-red-text); font-family: var(--ff-serif); font-style: italic; font-size: 1.0625rem; color: var(--c-slate); }

/* Case card */
.post-body .lc-case { position: relative; padding: var(--s-3); background: var(--c-white); border: 1px solid var(--c-line); border-top: 4px solid var(--c-charcoal); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.post-body .lc-case > * + * { margin-top: var(--s-2); }
.post-body .lc-case > p:first-child > strong:first-of-type, .post-body .lc-case strong[id] { font-family: var(--ff-serif); font-style: italic; color: var(--c-maroon); }
.post-body .lc-case blockquote { background: var(--c-surface); }

/* Cases in date order: cards on a line */
.post-body .lc-timeline-cards { position: relative; padding-left: var(--s-4); }
.post-body .lc-timeline-cards::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: var(--c-line); }
.post-body .lc-timeline-cards > .lc-case { margin-top: var(--s-3); }
.post-body .lc-timeline-cards > .lc-case::before { content: ""; position: absolute; left: calc(-1 * var(--s-4) + 3px); top: var(--s-3); width: 14px; height: 14px; border-radius: 50%; background: var(--c-white); border: 3px solid var(--c-red-text); }
.post-body ol.lc-timeline { list-style: none; padding-left: var(--s-4); position: relative; }
.post-body ol.lc-timeline::before { content: ""; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: var(--c-line); }
.post-body ol.lc-timeline > li { position: relative; padding: var(--s-3); background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow-card); max-width: none; }
.post-body ol.lc-timeline > li + li { margin-top: var(--s-3); }
.post-body ol.lc-timeline > li::before { content: ""; position: absolute; left: calc(-1 * var(--s-4) + 3px); top: var(--s-3); width: 14px; height: 14px; border-radius: 50%; background: var(--c-white); border: 3px solid var(--c-red-text); }
.post-body ol.lc-timeline strong[id] { font-family: var(--ff-serif); font-style: italic; color: var(--c-maroon); }

/* Numbered elements / steps */
.post-body ol.lc-steps { list-style: none; padding-left: 0; counter-reset: s; }
.post-body ol.lc-steps > li { counter-increment: s; position: relative; padding-left: 44px; min-height: 32px; }
.post-body ol.lc-steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--c-charcoal); color: var(--c-white); font-family: var(--ff-display); font-size: .9rem; }

/* Numbered points with a bold label: each point stands apart */
.post-body ol.lc-points { list-style: none; padding-left: 0; counter-reset: p; }
.post-body ol.lc-points > li { counter-increment: p; position: relative; padding: var(--s-2) var(--s-2) var(--s-2) 52px; background: var(--c-surface); border-radius: var(--radius); max-width: none; }
.post-body ol.lc-points > li + li { margin-top: var(--s-2); }
.post-body ol.lc-points > li::before { content: counter(p, decimal-leading-zero); position: absolute; left: var(--s-2); top: var(--s-2); font-family: var(--ff-display); color: var(--c-red-text); font-size: 1.05rem; }
.post-body ol.lc-points > li > strong:first-child { color: var(--c-charcoal); }
.post-body ol.lc-points ol[type="a"] { list-style: lower-alpha; margin-top: var(--s-1); }

/* Checklist (holdings, conditions, characteristics) */
.post-body ul.lc-check, .post-body ol.lc-check { list-style: none; padding-left: 0; }
.post-body .lc-check > li { position: relative; padding-left: 32px; }
.post-body .lc-check > li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 16px; height: 9px; border-left: 3px solid var(--c-red-text); border-bottom: 3px solid var(--c-red-text); transform: rotate(-45deg); }

/* Issues list: two columns on wide screens, red markers */
.post-body ul.lc-issues { list-style: none; padding-left: 0; display: grid; gap: var(--s-2); }
.post-body ul.lc-issues > li { margin: 0 !important; padding: var(--s-2); border-left: 4px solid var(--c-red-text); background: var(--c-white); border-radius: var(--radius-sm); box-shadow: var(--shadow-card); max-width: none; }
@media (min-width: 640px) { .post-body ul.lc-issues { grid-template-columns: 1fr 1fr; } }

/* Terms list (Decolonisation – ...) */
.post-body ul.lc-terms { list-style: none; padding-left: 0; display: grid; gap: var(--s-2); }
.post-body ul.lc-terms > li { margin: 0 !important; padding: var(--s-2); background: var(--c-surface); border-radius: var(--radius); max-width: none; }
@media (min-width: 640px) { .post-body ul.lc-terms { grid-template-columns: 1fr 1fr; } }

/* Chips (short items) */
.post-body ul.lc-chips { list-style: none; padding-left: 0; display: flex; flex-wrap: wrap; gap: var(--s-1); }
.post-body ul.lc-chips > li { margin: 0 !important; padding: 6px 14px; border: 1px solid var(--c-line); border-radius: 999px; background: var(--c-white); font-size: .9375rem; }

/* Provision / Article card */
.post-body .lc-art, .post-body .lc-prov { padding: var(--s-3); border: 1px solid var(--c-line); border-radius: var(--radius-lg); background: var(--c-white); box-shadow: var(--shadow-card); }
.post-body .lc-art > * + *, .post-body .lc-prov > * + * { margin-top: var(--s-2); }
.post-body .lc-art__head { margin: calc(-1 * var(--s-3)) calc(-1 * var(--s-3)) var(--s-3) !important; padding: var(--s-2) var(--s-3); background: var(--c-charcoal); color: var(--c-white); border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-width: none !important; }
.post-body .lc-art__head strong { font-weight: normal; }
.post-body .lc-prov > h3:first-child { margin: calc(-1 * var(--s-3)) calc(-1 * var(--s-3)) var(--s-3); padding: var(--s-2) var(--s-3); background: var(--c-charcoal); color: var(--c-white); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.post-body p.lc-sublabel { font-family: var(--ff-display); color: var(--c-red-text); letter-spacing: .02em; }
.post-body p.lc-sublabel strong { font-weight: normal; }
.post-body .lc-analysis { padding: var(--s-2) var(--s-3); background: #FBF6E9; border-radius: var(--radius); border-left: 4px solid var(--c-gold); }
.post-body .lc-analysis > * + * { margin-top: var(--s-1); }

/* Side by side (state vs government, merits vs demerits, for vs against) */
.post-body .lc-duo { display: grid; gap: var(--s-3); }
.post-body .lc-duo > * { margin: 0 !important; min-width: 0; }
.post-body .lc-duo__card, .post-body .lc-duo__col { padding: var(--s-3); background: var(--c-white); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.post-body .lc-duo__card > * + *, .post-body .lc-duo__col > * + * { margin-top: var(--s-2); }
.post-body .lc-duo__card { border-top: 4px solid var(--c-charcoal); }
.post-body .lc-duo__card + .lc-duo__card { border-top-color: var(--c-red-text); }
.post-body .lc-duo__col h2, .post-body .lc-duo__col h3 { margin-top: 0 !important; font-size: var(--fs-h3); }
.post-body .lc-duo__col h2::before { display: none; }
.post-body .lc-pro { border-top: 4px solid #2F7D4F; }
.post-body .lc-con { border-top: 4px solid var(--c-red-text); }
.post-body .lc-duo ol.lc-points > li { padding-left: 44px; }
@media (min-width: 760px) { .post-body .lc-duo { grid-template-columns: 1fr 1fr; } }

/* Comparison table (stacks into cards on phones) */
.post-body .lc-compare table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; font-size: .9375rem; line-height: 1.55; }
.post-body .lc-compare th, .post-body .lc-compare td { padding: var(--s-2); border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }
.post-body .lc-compare thead th { background: var(--c-charcoal); color: var(--c-white); font-family: var(--ff-display); font-weight: normal; }
.post-body .lc-compare thead th:first-child, .post-body .lc-compare tbody th { width: 24%; }
.post-body .lc-compare tbody th { background: var(--c-surface); font-family: var(--ff-display); font-weight: normal; color: var(--c-charcoal); }
.post-body .lc-compare tr:last-child > * { border-bottom: 0; }
@media (max-width: 639px) {
  .post-body .lc-compare thead { display: none; }
  .post-body .lc-compare table, .post-body .lc-compare tbody, .post-body .lc-compare tr, .post-body .lc-compare th, .post-body .lc-compare td { display: block; width: auto; }
  .post-body .lc-compare tr { border-bottom: 1px solid var(--c-line); }
  .post-body .lc-compare tbody th { width: auto; border: 0; }
  .post-body .lc-compare td { border: 0; padding-top: var(--s-1); }
  .post-body .lc-compare td::before { content: attr(data-col); display: block; font-family: var(--ff-display); font-size: var(--fs-sm); color: var(--c-red-text); }
}

/* Doctrine / country grids */
.post-body .lc-docs, .post-body .lc-countries { display: grid; gap: var(--s-2); }
.post-body .lc-doc, .post-body .lc-country { margin: 0 !important; padding: var(--s-3); background: var(--c-surface); border-radius: var(--radius); }
.post-body .lc-doc > * + *, .post-body .lc-country > * + * { margin-top: var(--s-2); }
.post-body .lc-country:first-child { grid-column: 1 / -1; }
.post-body .lc-country strong:first-child { display: block; font-family: var(--ff-display); font-weight: normal; font-size: 1.125rem; color: var(--c-charcoal); }
@media (min-width: 760px) { .post-body .lc-docs, .post-body .lc-countries { grid-template-columns: 1fr 1fr; } }

.post-body ol.lc-compact { font-family: var(--ff-serif); font-style: italic; }

/* Ending: the post's own last paragraphs, set apart without a new heading */
.post-body .lc-end { margin-top: var(--s-5) !important; padding-top: var(--s-4); border-top: 1px solid var(--c-line); position: relative; }
.post-body .lc-end::before { content: ""; position: absolute; top: -5px; left: 0; width: 56px; height: 9px; background: linear-gradient(var(--c-red-text), var(--c-red-text)) left center / 56px 3px no-repeat; }
.post-body .lc-end > * + * { margin-top: var(--s-2); }
.post-body .lc-end p, .post-body p.lc-end { font-family: var(--ff-serif); color: var(--c-charcoal); }

/* Question papers */
.post-body .lc-q { padding: var(--s-3); background: var(--c-white); border: 1px solid var(--c-line); border-left: 4px solid var(--c-charcoal); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.post-body .lc-q > * + * { margin-top: var(--s-2); }
.post-body .lc-q p { max-width: none; }
.post-body p.lc-q__stem { font-family: var(--ff-display); color: var(--c-charcoal); }
.post-body p.lc-q__stem strong { font-weight: normal; }
.post-body .lc-marks { display: inline-block; margin-left: 6px; padding: 1px 10px; border-radius: 999px; background: var(--c-surface); border: 1px solid var(--c-line); font-family: var(--ff-display); font-size: .8125rem; color: var(--c-red-text); white-space: nowrap; }
.post-body p.lc-years a { display: inline-block; margin: 2px; padding: 0 10px; border: 1px solid var(--c-line); border-radius: 999px; text-decoration: none; font-family: var(--ff-display); font-size: .9rem; }
.post-body .lc-follow { padding: var(--s-2) var(--s-3); background: var(--c-surface); border-radius: var(--radius); font-size: var(--fs-sm); }
.post-body .lc-follow > * + * { margin-top: 4px; }

/* Topper strategy card at the end of a subject post (build_posts.topper_tip_html) */
.post-topper-tip { margin: 2rem 0 1.5rem; padding: 1rem 1.25rem; border-left: 4px solid var(--gold, #D9B45A); background: #FBF6EA; border-radius: 6px; }
.post-topper-tip__kicker { margin: 0 0 .35rem; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; color: #6E0F1F; font-family: Spinnaker, system-ui, sans-serif; }
.post-topper-tip__line { margin: 0; font-weight: 700; }
.post-topper-tip__line a { text-decoration: underline; text-underline-offset: 3px; }

/* "Asked in UPSC" box (build_posts.pyq_box_html): real PYQs with year, paper, question number, marks */
.post-pyq { margin: 2.25rem 0 1.5rem; padding: 1.1rem 1.25rem 1rem; border: 1px solid #E3D6B8; border-top: 4px solid #6E0F1F; background: #FFFDF7; border-radius: 6px; }
.post-pyq__title { margin: 0 0 .25rem; font-size: 1.15rem; }
.post-pyq__lead { margin: 0 0 .75rem; font-size: .92rem; color: #5A5F66; }
.post-pyq ol { margin: 0; padding: 0; list-style: none; counter-reset: pyq; }
.post-pyq li { padding: .7rem 0; border-top: 1px dashed #E3D6B8; }
.post-pyq li:first-child { border-top: 0; padding-top: .2rem; }
.post-pyq__meta { margin: 0 0 .25rem; font-family: Spinnaker, system-ui, sans-serif; font-size: .82rem; letter-spacing: .02em; }
.post-pyq__meta a { color: #6E0F1F; font-weight: 700; text-decoration: none; }
.post-pyq__meta a:hover { text-decoration: underline; }
.post-pyq__q { margin: 0 0 .3rem; font-style: italic; }
.post-pyq__use { margin: 0; font-size: .9rem; color: #3A3F46; }
.post-pyq { margin: 1.75rem 0 2rem; }
.post-pyq__kicker { margin: 0 0 .15rem; font-family: Spinnaker, system-ui, sans-serif; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #8A6540; }
.post-pyq__how, .post-pyq__use { margin: .45rem 0 0; font-size: .93rem; line-height: 1.6; }
.post-pyq__q { font-size: 1rem; }

/* Plain comparison tables in new articles (cls lc-table on the table's wrapper): no mid-word breaks, label column wide enough */
.lc-table table { table-layout: auto; width: 100%; }
.lc-table th, .lc-table td { word-break: normal; overflow-wrap: break-word; hyphens: manual; }
.lc-table th:first-child, .lc-table td:first-child { min-width: 7.5em; font-weight: 700; }
@media (max-width: 600px) { .lc-table th:first-child, .lc-table td:first-child { min-width: 6.5em; } }

/* Explanatory diagrams in new articles (pages/new-articles/figures.json) */
.post-figure { margin: 1.75rem 0; }
.post-figure img { display: block; width: 100%; height: auto; border: 1px solid #E3D6B8; border-radius: 6px; background: #FFFDF7; }
.post-figure figcaption { margin-top: .5rem; font-size: .88rem; color: #5A5F66; }
.post-body .post-sources { margin-top: 2rem; padding-top: .75rem; border-top: 1px solid #E3D6B8; font-size: .85rem; color: #5A5F66; }
