/*
Theme Name: Vidhi
Theme URI: https://punelawfirm.in
Author: Pune Law Notes
Description: A typography-led WordPress theme for an independent Maharashtra legal publication. Built around an annotated-statute layout: a marginal apparatus column carries statutory references, citations and currency dates alongside the running text. Includes custom post types for legal formats, court reference pages, a glossary and interactive litigation calculators, with first-class Marathi support.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vidhi
Tags: blog, custom-menu, editor-style, translation-ready, right-sidebar
*/

/* ============================================================
   TOKENS
   Palette derives from legal stationery and the green of court
   seals and revenue stamps, not from a generic editorial cream.
   ============================================================ */

:root{
  --paper:        #F5F6F0;
  --paper-raised: #FCFCFA;
  --paper-sunk:   #EDEFE6;
  --ink:          #1A1D1A;
  --ink-soft:     #565B54;
  --ink-faint:    #858A7E;
  --rule:         #D6D9CE;
  --rule-strong:  #B9BEB0;
  --seal:         #1F4D3D;
  --seal-bright:  #2E7A5F;
  --seal-wash:    #E4EBE5;
  --flag:         #8A3324;
  --flag-wash:    #F3E7E3;

  --serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans:  "Archivo", "Helvetica Neue", Arial, sans-serif;
  --deva:  "Tiro Devanagari Marathi", "Noto Serif Devanagari", serif;

  --measure: 34rem;          /* ~66 characters at body size */
  --margin-col: 12rem;       /* the apparatus column */
  --gutter: 2.5rem;
  --pad: clamp(1.15rem, 4vw, 2.5rem);

  --step--1: 0.875rem;
  --step-0:  1.1875rem;
  --step-1:  1.4rem;
  --step-2:  1.75rem;
  --step-3:  2.25rem;
  --step-4:  clamp(2.4rem, 5.5vw, 3.4rem);
}

*,*::before,*::after{ box-sizing:border-box; }

html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--serif);
  font-size:var(--step-0);
  line-height:1.68;
  font-variant-numeric:oldstyle-nums proportional-nums;
  -webkit-font-smoothing:antialiased;
}

/* Marathi and any Devanagari runs */
:lang(mr), :lang(hi), .deva{
  font-family:var(--deva);
  line-height:1.85;
  font-variant-numeric:normal;
}

img,svg,video{ max-width:100%; height:auto; }

a{ color:var(--seal); text-underline-offset:.18em; text-decoration-thickness:.06em; }
a:hover{ color:var(--seal-bright); }
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,
summary:focus-visible,[tabindex]:focus-visible{
  outline:2px solid var(--seal);
  outline-offset:3px;
  border-radius:1px;
}

h1,h2,h3,h4{ font-weight:600; line-height:1.18; letter-spacing:-0.012em; margin:0 0 .5em; text-wrap:balance; }
h1{ font-size:var(--step-4); letter-spacing:-0.02em; }
h2{ font-size:var(--step-2); margin-top:2.4em; }
h3{ font-size:var(--step-1); margin-top:2em; }
h4{ font-size:var(--step-0); margin-top:1.6em; }

p,ul,ol,blockquote,table,figure{ margin:0 0 1.25em; }
ul,ol{ padding-left:1.3em; }
li{ margin-bottom:.4em; }

blockquote{
  margin-left:0; padding-left:1.2em;
  border-left:2px solid var(--seal);
  color:var(--ink-soft); font-style:italic;
}

hr{ border:0; border-top:1px solid var(--rule); margin:2.5em 0; }

code,kbd,samp{ font-family:ui-monospace,"SFMono-Regular",Menlo,monospace; font-size:.86em; background:var(--paper-sunk); padding:.1em .32em; }

table{ width:100%; border-collapse:collapse; font-size:var(--step--1); font-family:var(--sans); }
th,td{ text-align:left; padding:.6rem .7rem; border-bottom:1px solid var(--rule); vertical-align:top; }
th{ font-weight:600; border-bottom:1px solid var(--rule-strong); }
tbody tr:last-child td{ border-bottom:0; }

.screen-reader-text{
  position:absolute!important; width:1px; height:1px; overflow:hidden;
  clip:rect(1px,1px,1px,1px); white-space:nowrap;
}
.skip-link{
  position:absolute; left:-9999px; top:0; z-index:100;
  background:var(--seal); color:#fff; padding:.7rem 1.1rem; font-family:var(--sans);
}
.skip-link:focus{ left:0; }

/* ============================================================
   SHELL
   ============================================================ */

.wrap{ max-width:72rem; margin:0 auto; padding-inline:var(--pad); }

.masthead{
  border-bottom:1px solid var(--rule);
  background:var(--paper);
}
.masthead__inner{
  display:flex; align-items:baseline; gap:var(--gutter);
  padding-block:1.5rem 1.25rem; flex-wrap:wrap;
}
.masthead__title{
  font-size:var(--step-2); font-weight:600; letter-spacing:-0.02em;
  margin:0; line-height:1;
}
.masthead__title a{ color:var(--ink); text-decoration:none; }
.masthead__tagline{
  font-family:var(--sans); font-size:.8rem; color:var(--ink-soft);
  margin:.4rem 0 0; max-width:26rem; line-height:1.45;
}

.nav{ margin-left:auto; }
.nav ul{ display:flex; gap:1.5rem; list-style:none; margin:0; padding:0; flex-wrap:wrap; }
.nav a{
  font-family:var(--sans); font-size:.9rem; color:var(--ink);
  text-decoration:none; padding-bottom:.2rem; border-bottom:1px solid transparent;
}
.nav a:hover,.nav .current-menu-item > a{ border-bottom-color:var(--seal); color:var(--seal); }

.nav-toggle{
  display:none; font-family:var(--sans); font-size:.9rem;
  background:none; border:1px solid var(--rule-strong); color:var(--ink);
  padding:.45rem .8rem; cursor:pointer; margin-left:auto;
}

/* The standing notice. Not dismissible on the server; this is the
   line that tells a visitor arriving at a firm-sounding domain what
   this actually is. */
.standing-notice{
  background:var(--seal); color:#EAF0EB;
  font-family:var(--sans); font-size:.8rem; line-height:1.5;
}
.standing-notice p{ margin:0; padding-block:.6rem; }
.standing-notice strong{ color:#fff; font-weight:600; }

/* ============================================================
   ARTICLE LAYOUT — the annotated statute
   ============================================================ */

.article-grid{
  display:grid;
  grid-template-columns:var(--margin-col) minmax(0,var(--measure));
  gap:var(--gutter);
  padding-block:3rem 4rem;
}

.apparatus{
  font-family:var(--sans);
  font-size:.78rem;
  line-height:1.5;
  color:var(--ink-soft);
  position:sticky; top:1.5rem; align-self:start;
  border-right:1px solid var(--rule);
  padding-right:1.1rem;
  text-align:right;
}
.apparatus dl{ margin:0; }
.apparatus dt{
  color:var(--ink-faint); font-size:.7rem; letter-spacing:.02em;
  margin-top:1.1rem;
}
.apparatus dt:first-child{ margin-top:0; }
.apparatus dd{ margin:.15rem 0 0; color:var(--ink); }
.apparatus a{ color:var(--seal); }
.apparatus .cite{ font-style:italic; }

.entry{ min-width:0; }

.entry__kicker{
  font-family:var(--sans); font-size:.82rem; color:var(--seal);
  text-decoration:none; display:inline-block; margin-bottom:.9rem;
}
.entry__title{ margin-bottom:.55em; }
.entry__standfirst{
  font-size:var(--step-1); line-height:1.5; color:var(--ink-soft);
  margin-bottom:1.5rem; text-wrap:pretty;
}
.entry__byline{
  font-family:var(--sans); font-size:.85rem; color:var(--ink-soft);
  border-top:1px solid var(--rule); border-bottom:1px solid var(--rule);
  padding-block:.7rem; margin-bottom:2rem;
}
.entry__byline a{ color:var(--ink); }
.sep, .entry__byline .sep{ color:var(--rule-strong); margin-inline:.5rem; }

.field--check{ grid-template-columns:auto 1fr; align-items:start; gap:.2rem .6rem; }
.field--check > label{ order:2; grid-column:2; font-weight:400; }
.field--check > input{ order:1; grid-column:1; width:auto; margin-top:.25rem; accent-color:var(--seal); }
.field--check > .field__hint{ order:3; grid-column:2; }

/* Contents list, built from the h2s already in the article. */
[data-contents] dl{ display:block; }
[data-contents] dt{ margin-bottom:.4rem; }
[data-contents] dd{ margin:0 0 .3rem; }
[data-contents] dd a{ text-decoration:none; }
[data-contents] dd a:hover{ text-decoration:underline; }

.entry__body > *:first-child{ margin-top:0; }
.entry__body h2{ padding-top:.3em; }

/* Inline apparatus for narrow screens — same content, different place */
.apparatus--inline{
  display:none; border:0; border-top:1px solid var(--rule);
  border-bottom:1px solid var(--rule); text-align:left;
  padding:1rem 0; margin-bottom:2rem; position:static;
}
.apparatus--inline dl{ display:grid; grid-template-columns:auto 1fr; gap:.25rem 1rem; }
.apparatus--inline dt{ margin-top:0; }

/* Currency block */
.currency{
  font-family:var(--sans); font-size:.82rem; line-height:1.55;
  border-top:2px solid var(--ink); padding-top:1rem; margin-top:3rem;
  color:var(--ink-soft);
}
.currency strong{ color:var(--ink); }
.currency--stale{ border-top-color:var(--flag); }
.currency--stale .currency__flag{ color:var(--flag); font-weight:600; }

.changelog{ margin-top:1.2rem; }
.changelog summary{ cursor:pointer; color:var(--seal); }
.changelog ul{ margin-top:.7rem; font-size:.8rem; }

/* ============================================================
   LISTS AND CARDS
   ============================================================ */

.page-head{ padding-block:3rem 1.5rem; border-bottom:1px solid var(--rule); }
.page-head h1{ margin-bottom:.4em; }
.page-head__intro{ max-width:38rem; color:var(--ink-soft); font-size:var(--step-1); line-height:1.55; margin:0; }

.stream{ padding-block:2.5rem 4rem; display:grid; gap:2.5rem; max-width:46rem; }

.item{ display:grid; gap:.4rem; }
.item__meta{ font-family:var(--sans); font-size:.78rem; color:var(--ink-soft); }
.item__meta a{ color:var(--seal); text-decoration:none; }
.item__title{ font-size:var(--step-1); margin:0; line-height:1.25; }
.item__title a{ color:var(--ink); text-decoration:none; }
.item__title a:hover{ color:var(--seal); text-decoration:underline; }
.item__dek{ margin:0; color:var(--ink-soft); font-size:1rem; line-height:1.6; }

.grid-2{ display:grid; grid-template-columns:repeat(auto-fill,minmax(17rem,1fr)); gap:1.75rem 2.5rem; }

/* Section index blocks. Deliberately not identical rounded cards —
   these are ruled entries, closer to an index than to a dashboard. */
.index-entry{
  border-top:1px solid var(--rule); padding-top:.9rem;
}
.index-entry h3{ margin:0 0 .3rem; font-size:1.05rem; }
.index-entry h3 a{ color:var(--ink); text-decoration:none; }
.index-entry h3 a:hover{ color:var(--seal); }
.index-entry p{ margin:0; font-size:.92rem; color:var(--ink-soft); line-height:1.55; }

/* ============================================================
   HOME
   ============================================================ */

.lede{ padding-block:3.5rem 2.5rem; border-bottom:1px solid var(--rule); }
.lede__title{ font-size:var(--step-4); max-width:20ch; margin-bottom:.35em; }
.lede__title a{ color:var(--ink); text-decoration:none; }
.lede__title a:hover{ color:var(--seal); }
.lede__dek{ font-size:var(--step-1); color:var(--ink-soft); max-width:42ch; line-height:1.5; margin:0 0 1rem; }
.lede__meta{ font-family:var(--sans); font-size:.82rem; color:var(--ink-soft); }

.home-section{ padding-block:3rem; border-bottom:1px solid var(--rule); }
.home-section:last-of-type{ border-bottom:0; }
.home-section__head{
  display:flex; align-items:baseline; justify-content:space-between;
  gap:1rem; margin-bottom:1.75rem; flex-wrap:wrap;
}
.home-section__head h2{ font-size:var(--step-1); margin:0; }
.home-section__head a{ font-family:var(--sans); font-size:.85rem; }

/* ============================================================
   TOOLS — the calculators
   ============================================================ */

.tool{
  font-family:var(--sans);
  border:1px solid var(--rule-strong);
  background:var(--paper-raised);
  padding:1.5rem;
  margin-block:2rem;
  max-width:38rem;
}
.tool__title{ font-family:var(--serif); font-size:var(--step-1); margin:0 0 .35rem; }
.tool__basis{ font-size:.8rem; color:var(--ink-soft); margin:0 0 1.25rem; line-height:1.5; }
.tool__basis a{ color:var(--seal); }

.tool__unverified{
  background:var(--flag-wash); border-left:3px solid var(--flag);
  padding:.8rem 1rem; font-size:.82rem; line-height:1.5; margin-bottom:1.25rem;
}
.tool__unverified strong{ color:var(--flag); }

.field{ display:grid; gap:.3rem; margin-bottom:1rem; }
.field > label{ font-size:.82rem; font-weight:500; color:var(--ink); }
.field__hint{ font-size:.75rem; color:var(--ink-soft); line-height:1.45; }
.field input[type="date"],
.field input[type="number"],
.field input[type="text"],
.field select{
  font-family:var(--sans); font-size:.95rem; color:var(--ink);
  background:var(--paper-raised);
  border:1px solid var(--rule-strong); padding:.55rem .65rem; width:100%;
  border-radius:0;
}
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:1rem; }

.tool__modes{ display:flex; flex-wrap:wrap; gap:0; margin-bottom:1.25rem; border-bottom:1px solid var(--rule); }
.tool__mode{
  font-family:var(--sans); font-size:.85rem; background:none; border:0;
  border-bottom:2px solid transparent; padding:.5rem .9rem .5rem 0; margin-right:1.1rem;
  color:var(--ink-soft); cursor:pointer;
}
.tool__mode[aria-selected="true"]{ color:var(--seal); border-bottom-color:var(--seal); font-weight:600; }

.btn{
  font-family:var(--sans); font-size:.9rem; font-weight:500;
  background:var(--seal); color:#fff; border:1px solid var(--seal);
  padding:.6rem 1.2rem; cursor:pointer; border-radius:0;
}
.btn:hover{ background:var(--seal-bright); border-color:var(--seal-bright); }
.btn--quiet{ background:none; color:var(--seal); }
.btn--quiet:hover{ background:var(--seal-wash); color:var(--seal); }

.tool__out{ margin-top:1.5rem; }
.tool__out:empty{ margin-top:0; }

/* Result steps ARE a sequence, so numbering is doing real work here. */
.steps{ list-style:none; margin:0; padding:0; counter-reset:step; }
.steps li{
  counter-increment:step;
  display:grid; grid-template-columns:1.6rem 1fr; gap:.9rem;
  padding:.85rem 0; border-top:1px solid var(--rule); align-items:start;
}
.steps li::before{
  content:counter(step);
  font-size:.8rem; color:var(--seal); font-weight:600;
  border:1px solid var(--seal); width:1.6rem; height:1.6rem;
  display:grid; place-items:center; margin-top:.1rem;
}
.steps__date{ font-weight:600; font-size:1rem; display:block; }
.steps__what{ font-size:.85rem; color:var(--ink-soft); line-height:1.5; display:block; margin-top:.15rem; }
.steps__basis{ font-size:.75rem; color:var(--ink-faint); display:block; margin-top:.25rem; }
.steps li.is-flag .steps__date{ color:var(--flag); }

.result{
  border-top:2px solid var(--ink); padding-top:1rem; margin-top:1.25rem;
}
.result__value{ font-family:var(--serif); font-size:var(--step-2); line-height:1.2; margin:0 0 .3rem; }
.result__note{ font-size:.82rem; color:var(--ink-soft); margin:0; line-height:1.5; }
.result__warn{ color:var(--flag); }

.tool__caveat{
  font-size:.78rem; color:var(--ink-soft); line-height:1.55;
  border-top:1px solid var(--rule); margin-top:1.5rem; padding-top:.9rem;
}

/* ============================================================
   FORMATS / COURTS / GLOSSARY
   ============================================================ */

.format-doc{
  border:1px solid var(--rule-strong); background:var(--paper-raised);
  padding:clamp(1.25rem,4vw,2.25rem); margin-block:2rem;
  font-size:.98rem; line-height:1.75;
}
.format-doc h2,.format-doc h3{ margin-top:1.6em; }

.downloads{ display:flex; gap:.75rem; flex-wrap:wrap; margin-block:1.5rem; }
.download{
  font-family:var(--sans); font-size:.88rem; text-decoration:none;
  border:1px solid var(--seal); color:var(--seal);
  padding:.55rem 1rem; display:inline-block;
}
.download:hover{ background:var(--seal); color:#fff; }

.caution{
  border-left:3px solid var(--flag); background:var(--flag-wash);
  padding:1rem 1.15rem; font-family:var(--sans); font-size:.85rem; line-height:1.6;
  margin-block:1.5rem;
}
.caution p:last-child{ margin-bottom:0; }
.caution strong{ color:var(--flag); }

.factbox{
  font-family:var(--sans); font-size:.85rem;
  border-top:2px solid var(--ink); border-bottom:1px solid var(--rule);
  padding-block:1rem; margin-block:2rem;
}
.factbox dl{ display:grid; grid-template-columns:11rem 1fr; gap:.55rem 1.25rem; margin:0; }
.factbox dt{ color:var(--ink-soft); }
.factbox dd{ margin:0; }

.glossary-nav{
  display:flex; flex-wrap:wrap; gap:.15rem; font-family:var(--sans);
  font-size:.85rem; margin-block:1.5rem 2.5rem;
  border-block:1px solid var(--rule); padding-block:.8rem;
}
.glossary-nav a{ padding:.15rem .45rem; text-decoration:none; color:var(--seal); }
.glossary-nav a:hover{ background:var(--seal-wash); }
.glossary-nav span{ padding:.15rem .45rem; color:var(--ink-faint); }

.glossary-list{ list-style:none; padding:0; margin:0; }
.glossary-list li{ border-top:1px solid var(--rule); padding:.75rem 0; }
.glossary-list .term{ font-size:1.05rem; }
.glossary-list .term a{ color:var(--ink); text-decoration:none; }
.glossary-list .term a:hover{ color:var(--seal); }
.glossary-list .gloss{ font-size:.9rem; color:var(--ink-soft); margin:.15rem 0 0; }

.related{ margin-top:1.5rem; font-family:var(--sans); font-size:.85rem; }
.related a{ margin-right:.9rem; }

/* Language switch */
.langswitch{ font-family:var(--sans); font-size:.8rem; }
.langswitch a{ text-decoration:none; }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer{
  border-top:1px solid var(--rule); margin-top:4rem;
  background:var(--paper-sunk); font-family:var(--sans); font-size:.84rem;
  line-height:1.65; color:var(--ink-soft);
}
.site-footer__inner{ padding-block:2.5rem 3rem; display:grid; gap:2rem; grid-template-columns:1.4fr 1fr; }
.site-footer h2{ font-family:var(--sans); font-size:.8rem; font-weight:600; color:var(--ink); margin:0 0 .6rem; }
.site-footer ul{ list-style:none; margin:0; padding:0; }
.site-footer li{ margin-bottom:.3rem; }
.site-footer a{ color:var(--ink); }
.site-footer__legal{ border-top:1px solid var(--rule-strong); padding-block:1.25rem 2rem; font-size:.78rem; }
.site-footer__legal p{ margin:0 0 .6rem; max-width:60rem; }

.pagination{ font-family:var(--sans); font-size:.9rem; padding-block:2rem 4rem; display:flex; gap:1rem; }
.pagination .page-numbers{ padding:.35rem .7rem; border:1px solid var(--rule-strong); text-decoration:none; }
.pagination .current{ background:var(--seal); color:#fff; border-color:var(--seal); }

.searchform{ display:flex; gap:.5rem; max-width:26rem; }
.searchform input[type="search"]{
  font-family:var(--sans); font-size:.95rem; padding:.55rem .65rem;
  border:1px solid var(--rule-strong); background:var(--paper-raised); flex:1; border-radius:0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 62rem){
  .article-grid{ grid-template-columns:minmax(0,var(--measure)); }
  .apparatus{ display:none; }
  .apparatus--inline{ display:block; }
  .site-footer__inner{ grid-template-columns:1fr; }
}

@media (max-width: 46rem){
  :root{ --step-0:1.125rem; }
  .masthead__inner{ padding-block:1.1rem .9rem; }
  .nav-toggle{ display:block; }
  .nav{ flex-basis:100%; margin-left:0; display:none; }
  .nav.is-open{ display:block; }
  .nav ul{ flex-direction:column; gap:0; padding-top:.75rem; }
  .nav li{ border-top:1px solid var(--rule); }
  .nav a{ display:block; padding:.6rem 0; border-bottom:0; }
  .field-row{ grid-template-columns:1fr; }
  .factbox dl{ grid-template-columns:1fr; gap:.15rem; }
  .factbox dt{ margin-top:.6rem; }
  .tool{ padding:1.15rem; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration:.01ms!important; transition-duration:.01ms!important; scroll-behavior:auto!important; }
}

@media print{
  .masthead,.site-footer,.standing-notice,.nav,.tool__modes,.btn{ display:none!important; }
  body{ background:#fff; font-size:11pt; }
  .article-grid{ grid-template-columns:1fr; }
  a{ text-decoration:none; color:#000; }
  .entry__body a[href^="http"]::after{ content:" (" attr(href) ")"; font-size:9pt; color:#555; }
}
