/* ===========================================================================
   INDIAN PIN CODE DIRECTORY

   Palette is institutional rather than startup-blue: a deep ink navy, a
   saturated indigo for interaction, and a single postal red reserved
   exclusively for delivery status. Red appears nowhere else, so when it does
   appear it means something.

   Type: IBM Plex Sans for interface, IBM Plex Mono for every PIN code and
   coordinate. The digits are the content, so they get the face that makes
   them scannable in a column.
   =========================================================================== */

:root {
  --ink:        #16202E;
  --ink-soft:   #5A6779;
  --ink-faint:  #8B96A6;
  --paper:      #F5F7FA;
  --surface:    #FFFFFF;
  --indigo:     #2E4BA8;
  --indigo-deep:#1B2E6B;
  --indigo-wash:#EEF2FC;
  --seal:       #C8102E;
  --seal-wash:  #FCEEF0;
  --green:      #1B6E44;
  --rule:       #E3E7EE;

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --r:   6px;
  --r-lg: 10px;
  --shadow: 0 1px 2px rgba(22,32,46,.05), 0 4px 12px rgba(22,32,46,.05);
  --wrap: 1120px;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
h2 { font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem); }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1rem; }

a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
  border-radius: 2px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

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

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--indigo); color: #fff; padding: .6rem 1rem;
}
.skip:focus { left: 0; }

/* --------------------------------------------------------------- MASTHEAD */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 40;
}

.masthead__inner {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: 64px; flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand__mark { color: var(--indigo); display: flex; }
.brand__text { font-size: .98rem; letter-spacing: -.01em; }

.masthead__search { position: relative; display: flex; flex: 1 1 260px; max-width: 460px; }
.masthead__search input {
  flex: 1; min-width: 0;
  font: inherit; font-size: .92rem;
  padding: .5rem .75rem;
  border: 1px solid var(--rule); border-right: 0;
  border-radius: var(--r) 0 0 var(--r);
  background: var(--paper);
}
.masthead__search input:focus { background: var(--surface); outline-offset: -2px; }
.masthead__search button {
  font: inherit; font-size: .88rem; font-weight: 500;
  padding: .5rem .9rem; cursor: pointer;
  color: #fff; background: var(--indigo);
  border: 1px solid var(--indigo);
  border-radius: 0 var(--r) var(--r) 0;
}
.masthead__search button:hover { background: var(--indigo-deep); border-color: var(--indigo-deep); }

.masthead__nav { display: flex; gap: 1.1rem; font-size: .9rem; }
.masthead__nav a { color: var(--ink-soft); }
.masthead__nav a:hover { color: var(--indigo); }

@media (max-width: 720px) {
  .masthead__nav { display: none; }
  .masthead__inner { padding-top: .6rem; padding-bottom: .6rem; }
}

/* ------------------------------------------------------------ BREADCRUMBS */

.crumbs { background: var(--surface); border-bottom: 1px solid var(--rule); }
.crumbs ol {
  list-style: none; display: flex; flex-wrap: wrap; gap: .4rem;
  margin: 0; padding: .55rem 0; font-size: .82rem; color: var(--ink-faint);
}
.crumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--rule); }
.crumbs a { color: var(--ink-soft); }

/* ------------------------------------------------------------------- HERO */

.hero {
  background:
    linear-gradient(180deg, var(--surface) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--rule);
  padding: clamp(2.5rem, 5vw, 4.5rem) 0;
}
.hero__inner { max-width: 720px; text-align: center; }
.hero h1 { margin-bottom: .6rem; }
.hero__lede { color: var(--ink-soft); font-size: 1.02rem; margin-bottom: 1.75rem; }
.hero__hint { font-size: .88rem; color: var(--ink-faint); margin-top: .9rem; }
.hero__hint a { font-family: var(--mono); }

.bigsearch { position: relative; display: flex; box-shadow: var(--shadow); border-radius: var(--r-lg); }
.bigsearch input {
  flex: 1; min-width: 0;
  font: inherit; font-size: 1rem;
  padding: .95rem 1.1rem;
  border: 1px solid var(--rule); border-right: 0;
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  background: var(--surface);
}
.bigsearch button {
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: .95rem 1.5rem; cursor: pointer; white-space: nowrap;
  color: #fff; background: var(--indigo);
  border: 1px solid var(--indigo);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
}
.bigsearch button:hover { background: var(--indigo-deep); border-color: var(--indigo-deep); }
.bigsearch--inline { max-width: 560px; box-shadow: none; }
.bigsearch--inline input, .bigsearch--inline button { padding-top: .7rem; padding-bottom: .7rem; }

/* ----------------------------------------------------------- AUTOCOMPLETE */

.suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
  background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: 0 8px 28px rgba(22,32,46,.12);
  max-height: 340px; overflow-y: auto; text-align: left;
}
.suggest__item {
  display: flex; align-items: baseline; gap: .7rem;
  padding: .55rem .85rem; cursor: pointer;
  border-bottom: 1px solid var(--rule);
}
.suggest__item:last-child { border-bottom: 0; }
.suggest__item:hover, .suggest__item.is-active { background: var(--indigo-wash); }
.suggest__label { font-weight: 500; }
.suggest__item[data-type="pincode"] .suggest__label { font-family: var(--mono); }
.suggest__meta { color: var(--ink-soft); font-size: .84rem; flex: 1; }
.suggest__note { color: var(--ink-faint); font-size: .78rem; font-family: var(--mono); }

/* ---------------------------------------------------------- PIN CODE HEAD */

.pinhead { background: var(--surface); border-bottom: 1px solid var(--rule); padding: 2rem 0; }
.pinhead__inner { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: start; }

.pinhead__eyebrow {
  display: block; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .35rem;
}

/* The digits are the page's subject, so they get real size and a rule that
   separates the area portion from the office portion. */
.digits { display: flex; gap: .18rem; margin: 0; font-family: var(--mono); }
.digits__d {
  display: grid; place-items: center;
  width: 2.1rem; height: 2.7rem;
  font-size: 1.5rem; font-weight: 500;
  border: 1px solid var(--rule); border-radius: 3px;
  background: var(--paper);
}
.digits__d.is-area   { color: var(--indigo-deep); border-color: #C9D4EE; background: var(--indigo-wash); }
.digits__d.is-office { color: var(--ink); }

.pinhead h1 { margin-bottom: .4rem; }
.pinhead h1 span { color: var(--ink-soft); font-weight: 400; }
.pinhead__summary { color: var(--ink-soft); max-width: 62ch; }

@media (max-width: 640px) {
  .pinhead__inner { grid-template-columns: 1fr; gap: 1.25rem; }
  .digits__d { width: 1.8rem; height: 2.3rem; font-size: 1.25rem; }
}

/* --------------------------------------------------------------- FACT BAR */

.factbar {
  display: flex; flex-wrap: wrap; gap: 0; margin: 1.25rem 0 0;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface); overflow: hidden;
}
.factbar > div {
  flex: 1 1 150px; padding: .7rem .9rem;
  border-right: 1px solid var(--rule);
}
.factbar > div:last-child { border-right: 0; }
.factbar dt {
  font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .15rem;
}
.factbar dd { margin: 0; font-weight: 500; font-size: .95rem; }

/* ------------------------------------------------- SIGNATURE: PIN ANATOMY */

.anatomy { padding: 2.25rem 0 .5rem; }
.anatomy__strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
}
.anatomy__seg {
  padding: 1rem 1.1rem;
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: .3rem;
}
.anatomy__seg:last-child { border-right: 0; }
.anatomy__seg.is-office { background: var(--indigo-wash); }

.anatomy__num {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 500;
  color: var(--indigo-deep); letter-spacing: .02em; line-height: 1;
}
.anatomy__seg.is-office .anatomy__num { color: var(--seal); }
.anatomy__lbl {
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint);
}
.anatomy__desc { font-size: .85rem; color: var(--ink-soft); line-height: 1.5; }
.anatomy__note {
  margin-top: .9rem; font-size: .87rem; color: var(--ink-soft);
  border-left: 3px solid var(--seal); padding-left: .8rem;
}

@media (max-width: 860px) {
  .anatomy__strip { grid-template-columns: repeat(2, 1fr); }
  .anatomy__seg:nth-child(2) { border-right: 0; }
  .anatomy__seg:nth-child(-n+2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 460px) {
  .anatomy__strip { grid-template-columns: 1fr; }
  .anatomy__seg { border-right: 0; border-bottom: 1px solid var(--rule); }
  .anatomy__seg:last-child { border-bottom: 0; }
}

/* ------------------------------------------------------------- PAGE HEADS */

.pagehead { padding: 2rem 0 .5rem; }
.pagehead__lede { color: var(--ink-soft); max-width: 68ch; }

.block { padding: 2rem 0; }
.block__lede { color: var(--ink-soft); font-size: .92rem; margin-top: -.25rem; }

/* ----------------------------------------------------------------- TABLES */

.tablewrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); }

.grid { width: 100%; border-collapse: collapse; font-size: .92rem; }
.grid th, .grid td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--rule); }
.grid thead th {
  font-size: .72rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; background: var(--paper);
  white-space: nowrap;
}
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover { background: var(--indigo-wash); }

.tag {
  display: inline-block; font-family: var(--mono); font-size: .74rem;
  padding: .1rem .4rem; border-radius: 3px;
  background: var(--paper); border: 1px solid var(--rule); color: var(--ink-soft);
}

.status { font-size: .82rem; font-weight: 500; white-space: nowrap; }
.status.is-yes { color: var(--green); }
.status.is-no  { color: var(--seal); }

.coords {
  display: block; font-family: var(--mono); font-size: .75rem;
  color: var(--ink-faint); margin-top: .15rem;
}
.coords__map { margin-left: .35rem; }

.legend { font-size: .82rem; color: var(--ink-faint); margin-top: .8rem; }

/* Cards on narrow screens: tables become label/value stacks rather than a
   horizontally scrolling grid the reader has to hunt through. */
@media (max-width: 640px) {
  .grid thead { display: none; }
  .grid, .grid tbody, .grid tr, .grid td { display: block; width: 100%; }
  .grid tr { border-bottom: 1px solid var(--rule); padding: .5rem 0; }
  .grid td { border: 0; padding: .25rem .85rem; display: flex; gap: .75rem; }
  .grid td::before {
    content: attr(data-label);
    flex: 0 0 32%; font-size: .72rem; letter-spacing: .06em;
    text-transform: uppercase; color: var(--ink-faint);
  }
}

/* ------------------------------------------------------------------ LISTS */

.pinlist, .statelist, .cards { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.pinlist  { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.statelist{ grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.cards    { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.pinlist a, .statelist a, .card a {
  display: block; padding: .7rem .85rem;
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r); color: var(--ink);
  transition: border-color .12s ease, transform .12s ease;
}
.pinlist a:hover, .statelist a:hover, .card a:hover {
  text-decoration: none; border-color: var(--indigo); transform: translateY(-1px);
}

.pinlist__code { display: block; font-family: var(--mono); font-size: 1.05rem; font-weight: 500; color: var(--indigo-deep); }
.pinlist__place{ display: block; font-size: .85rem; color: var(--ink-soft); }
.pinlist__count{ display: block; font-size: .75rem; color: var(--ink-faint); }

.statelist__name { display: block; font-weight: 500; }
.statelist__meta { display: block; font-size: .8rem; color: var(--ink-faint); }

.card h3 { margin-bottom: .3rem; font-size: .98rem; }
.card p  { margin: 0; font-size: .86rem; color: var(--ink-soft); }

/* -------------------------------------------------------------------- FAQ */

.faq { border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface); overflow: hidden; margin-top: 1rem; }
.faq details { border-bottom: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 0; }
.faq summary {
  cursor: pointer; list-style: none; font-weight: 500; font-size: .95rem;
  padding: .8rem 2.5rem .8rem .9rem; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 1rem; top: .65rem;
  font-size: 1.25rem; font-weight: 400; color: var(--indigo); line-height: 1;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { background: var(--indigo-wash); }
.faq p { margin: 0; padding: 0 .9rem .9rem; color: var(--ink-soft); font-size: .92rem; }

/* --------------------------------------------------------------- PAGINATION */

.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; font-size: .9rem; }
.pager__step {
  padding: .5rem .9rem; border: 1px solid var(--rule);
  border-radius: var(--r); background: var(--surface);
}
.pager__step.is-off { color: var(--ink-faint); background: transparent; border-color: transparent; }
.pager__count { color: var(--ink-soft); }

/* ------------------------------------------------------------ EMPTY / ADS */

.empty { text-align: center; max-width: 560px; margin: 2rem auto; }
.empty__code { font-family: var(--mono); font-size: 3rem; color: var(--ink-faint); margin: 0 0 .25rem; }
.empty p { color: var(--ink-soft); }
.empty .bigsearch { margin: 1.5rem auto 0; text-align: left; }

.btn {
  display: inline-block; padding: .65rem 1.2rem; border-radius: var(--r);
  background: var(--indigo); color: #fff; font-weight: 500;
}
.btn:hover { background: var(--indigo-deep); text-decoration: none; }

.coordblock { font-size: .9rem; color: var(--ink-soft); margin-top: 1rem; }
.coordblock.is-missing { color: var(--ink-faint); font-style: italic; }

/* Ads are visually fenced off from navigation and results (§54). */
.ad { max-width: var(--wrap); margin: 1.25rem auto; padding: 0 1.25rem; text-align: center; }
.ad__label {
  display: block; font-size: .65rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .35rem;
}

/* ----------------------------------------------------------------- FOOTER */

.foot { background: var(--ink); color: #C3CBD8; margin-top: 3rem; padding: 2.5rem 0 0; font-size: .88rem; }
.foot__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.foot h2 { font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; color: #8894A6; margin-bottom: .6rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.foot a { color: #C3CBD8; }
.foot a:hover { color: #fff; }
.foot__brand { font-weight: 600; color: #fff; margin-bottom: .5rem; }
.foot__note { color: #8894A6; font-size: .82rem; line-height: 1.55; max-width: 46ch; }
.foot__base { border-top: 1px solid #26313F; margin-top: 2rem; padding-top: 1.1rem; padding-bottom: 1.5rem; }
.foot__base p { margin: 0; font-size: .82rem; color: #8894A6; }

@media (max-width: 760px) {
  .foot__grid { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------------ MOTION */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* --------------------------------------------------- PROSE / LEGAL PAGES */

.prose { max-width: 720px; padding-top: 2.5rem; padding-bottom: 1rem; }
.prose h1 { margin-bottom: 1rem; }
.prose h2 {
  margin: 2rem 0 .6rem; padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  font-size: 1.15rem;
}
.prose h3 { margin: 1.4rem 0 .35rem; font-size: 1rem; color: var(--ink); }
.prose p, .prose li { color: var(--ink-soft); }
.prose .lede { font-size: 1.05rem; color: var(--ink); }
.prose ul { padding-left: 1.15rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .5rem; }
.prose strong { color: var(--ink); }
.prose__meta { font-size: .85rem; color: var(--ink-faint); }
.prose__hero { width: 100%; height: auto; border-radius: var(--r-lg); margin: 1rem 0 1.5rem; }

.page__meta {
  margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--rule);
  font-size: .82rem; color: var(--ink-faint);
}

/* --------------------------------------------------------------- NOTICES */

.notice {
  border: 1px solid var(--rule); border-left: 3px solid var(--indigo);
  background: var(--surface); border-radius: 0 var(--r) var(--r) 0;
  padding: .9rem 1.1rem; margin: 1.25rem 0;
}
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice.is-ok  { border-left-color: var(--green); }
.notice.is-bad { border-left-color: var(--seal); background: var(--seal-wash); }

/* ------------------------------------------------------------------ FORMS */

.form { margin-top: 1.5rem; }
.field { display: block; margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: .3rem; color: var(--ink); }
.field input, .field textarea {
  width: 100%; font: inherit; font-size: .95rem;
  padding: .6rem .75rem;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface); color: var(--ink);
}
.field input:focus, .field textarea:focus { border-color: var(--indigo); }
.field textarea { resize: vertical; min-height: 8rem; }
.field__hint { display: block; font-size: .8rem; color: var(--ink-faint); margin-top: .25rem; }

/* Honeypot: off-screen rather than display:none, which some bots detect. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.card__date { font-size: .78rem; color: var(--ink-faint); margin-top: .4rem; }

/* =========================================================================
   NEW FEATURES: maps, tools, share buttons
   ========================================================================= */

/* Maps */
.pinmap {
  height: 380px; width: 100%;
  border: 1px solid var(--rule); border-radius: var(--r-lg);
  margin-top: 1rem; z-index: 0;
}
.pinmap .leaflet-popup-content { font-family: var(--sans); font-size: .88rem; }

/* Share / copy buttons on PIN page */
.pinactions { display: flex; gap: .6rem; margin-top: 1.1rem; }
.pinbtn {
  font: inherit; font-size: .85rem; font-weight: 500; cursor: pointer;
  padding: .45rem .9rem; border-radius: var(--r);
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
  transition: border-color .12s ease, background .12s ease;
}
.pinbtn:hover { border-color: var(--indigo); color: var(--indigo); }

/* Tool grid on homepage */
.toolgrid a { border-left: 3px solid var(--indigo); }

/* Distance tool */
.distform__row, .compareform__row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.distform .afield { flex: 1 1 200px; }
.distform .afield span { display: block; font-weight: 500; font-size: .88rem; margin-bottom: .3rem; }
.distform input, .compareform input {
  width: 100%; font: inherit; font-family: var(--mono); font-size: 1rem;
  padding: .6rem .75rem; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface);
}
.compareform__row input { flex: 1 1 140px; }

.distresult {
  text-align: center; background: var(--surface);
  border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 2rem 1.5rem;
}
.distresult__km { font-family: var(--mono); font-size: 2.6rem; font-weight: 500;
  color: var(--indigo-deep); margin: 0; line-height: 1; }
.distresult__sub { color: var(--ink-faint); font-size: .85rem; margin: .3rem 0 1.5rem; }
.distresult__ends { display: flex; align-items: center; justify-content: center; gap: 1.5rem; flex-wrap: wrap; }
.distresult__ends > div { display: flex; flex-direction: column; }
.distresult__ends .mono { font-size: 1.1rem; color: var(--indigo-deep); }
.distresult__ends span { font-size: .82rem; color: var(--ink-soft); }
.distresult__arrow { font-size: 1.5rem; color: var(--ink-faint); }

/* Compare grid — first column is the attribute label */
.comparegrid th[scope="row"], .comparegrid tbody th { text-align: left; color: var(--ink-soft); font-weight: 500; }

/* Bulk lookup */
.bulkform textarea {
  width: 100%; font: inherit; font-family: var(--mono); font-size: .95rem;
  padding: .8rem; border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--surface); resize: vertical; margin-bottom: 1rem;
}
