/* District Profiles: shared directory and profile stylesheet after the shell.
   Type follows the Insights family: Playfair Display for headings and figures,
   Inter for reading text, JetBrains Mono for labels. Palette follows the
   Climate Atlas. Shared surfaces and labels are declared once below. */

/* ---------- tokens ---------- */
:root {
  --dp-paper: #f8f6f1;
  --dp-paper-2: #eef1ea;
  --dp-card: #fffdf9;
  --dp-forest: #173a2e;
  --dp-ink: #1b2920;
  --dp-muted: #4f604f;
  --dp-line: #d3d9cf;
  --dp-line-strong: #b5c0b1;
  --dp-focus: #ad6b20;
  --dp-ochre: #96601e;
  --dp-rain: #3f7f9f;
  --dp-rain-soft: #a7c7d6;
  --dp-shape: #c4d3c0;
  --dp-radius: 6px;
  --dp-shadow: 0 1px 0 rgba(23, 58, 46, .04), 0 18px 40px -30px rgba(23, 58, 46, .45);
  --dp-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --dp-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --dp-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --dp-measure: 64ch;
  --dp-gap: 12px;
}

/* ---------- page ---------- */
.page-districts { margin: 0; background: var(--dp-paper); color: var(--dp-ink); font: 400 var(--cv-type-body)/1.6 var(--dp-sans); }
.page-districts *, .page-districts *::before, .page-districts *::after { box-sizing: border-box; }
.page-districts button, .page-districts select, .page-districts input { font: inherit; }
.page-districts [hidden] { display: none; }
.page-districts .skip { position: absolute; left: 12px; top: -100px; z-index: 200; background: #fff; padding: 10px; }
.page-districts .skip:focus { top: 8px; }
.dp { max-width: 1180px; margin: 0 auto; padding: 96px 24px 80px; overflow-wrap: anywhere; }
.dp a { color: var(--dp-forest); text-decoration-thickness: 1px; text-underline-offset: .22em; }
.dp a:hover { color: var(--dp-ochre); }
/* The eyebrow's "Cultivera Insights" parent link keeps the eyebrow colour (N4 atlas contract). */
.dp .dp-eyebrow a, .dp .dp-eyebrow a:hover { color: inherit; }
.dp :where(a, button, select, input, [tabindex]):focus-visible { outline: 3px solid var(--dp-focus); outline-offset: 3px; }
:where(.dp) p { margin: 0 0 1em; text-wrap: pretty; }

/* ---------- type ---------- */
.dp h1, .dp h2, .dp-kpi strong, .dp-crop-name, .dp-crop-share, .dp-card strong, .dp-project strong, .dp-more strong {
  font-family: var(--dp-serif);
  font-weight: 400;
  color: var(--dp-forest);
  font-variant-numeric: lining-nums tabular-nums;
}
.dp h1, .dp h2 { letter-spacing: -.015em; line-height: 1.08; text-wrap: balance; margin: 0 0 .35em; }
.dp h1:focus { outline: none; }
.dp-deck { line-height: 1.55; color: var(--dp-muted); max-width: 40em; }
.dp-intro, .dp-lede { max-width: var(--dp-measure); }
.dp-intro { color: var(--dp-muted); }
.dp-lede { font-size: 1.08rem; }

/* Mono labels: one voice for every small-caps label on the page */
.dp-eyebrow, .dp-label, .dp-kpi dt, .dp-project-geo, .dp-division-title span, .dp-credit, .dp-figure figcaption {
  font-family: var(--dp-mono);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: .06em;
}
.dp-eyebrow, .dp-label, .dp-kpi dt, .dp-project-geo, .dp-division-title span, .dp-credit:where(:not([data-cv-source-credit])), .dp-figure figcaption {
  font-size: var(--cv-type-data-label);
}
.dp-eyebrow, .dp-label, .dp-kpi dt, .dp-project-geo { text-transform: uppercase; }
.dp-eyebrow { color: var(--dp-ochre); font-weight: 600; letter-spacing: .1em; margin: 0 0 .9em; }
.dp-label, .dp-kpi dt, .dp-credit, .dp-figure figcaption { color: var(--dp-muted); }
.dp-label { display: block; margin-bottom: .45em; }
.dp-credit, .dp-figure figcaption { letter-spacing: .02em; text-transform: none; }

/* Source notes: an ochre rule, set apart from what they describe */
.dp-source { margin: 1.4em 0 0; padding-left: .85em; border-left: 2px solid var(--dp-ochre); font-size: .8rem; line-height: 1.55; color: var(--dp-muted); max-width: 72ch; }

/* ---------- shared surfaces ---------- */
.dp-kpi, .dp-crop, .dp-project, .dp-figure, .dp-photo, .dp-card {
  background: var(--dp-card);
  border: 1px solid var(--dp-line);
  border-radius: var(--dp-radius);
}
.dp-crop, .dp-project, .dp-card { display: block; height: 100%; text-decoration: none; color: var(--dp-ink); transition: box-shadow .16s ease, transform .16s ease; }
.dp-crop:hover, .dp-project:hover, .dp-card:hover { box-shadow: var(--dp-shadow); color: var(--dp-ink); }
.dp-card:hover { transform: translateY(-2px); }
.dp-button, .dp-picker, .dp-search { min-height: 44px; border: 1.5px solid var(--dp-line-strong); border-radius: var(--dp-radius); background: var(--dp-card); color: var(--dp-ink); }
.dp-button { margin-left: .4em; padding: .3em 1em; border-color: var(--dp-forest); color: var(--dp-forest); font-weight: 600; cursor: pointer; }
.dp-status { min-height: 1.5em; color: var(--dp-muted); font-size: .95rem; }
.dp-status:empty { min-height: 0; margin: 0; }
.dp-status.is-alert { color: #8a3b12; font-weight: 600; }

/* ---------- maps ---------- */
.dp-map { display: block; width: 100%; height: auto; max-height: 78vh; }
.dp-map-district { fill: var(--dp-shape); stroke: var(--dp-card); stroke-width: .9; vector-effect: non-scaling-stroke; transition: fill .15s ease; }
.dp-map a:hover .dp-map-district, .dp-map a:focus-visible .dp-map-district { fill: var(--dp-ochre); stroke: var(--dp-forest); }
.dp-map a:focus-visible { outline: none; }
.dp-map-district.is-dim { fill: #dde5da; }
.dp-map-district.is-active { fill: var(--dp-forest); stroke: var(--dp-ochre); stroke-width: 2; }
.dp-map-pin { fill: var(--dp-ochre); stroke: var(--dp-card); stroke-width: 2; }

/* ---------- index ---------- */
.dp-opening { padding: 24px 0 8px; max-width: 820px; }
.dp-index { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-areas: "map search" "map list"; gap: 20px 48px; align-items: start; margin-top: 24px; }
.dp-index-search { grid-area: search; }
.dp-index-list { grid-area: list; }
.dp-index-map { grid-area: map; position: sticky; top: 84px; margin: 0; }
.dp-index-map .dp-source { margin-top: 1em; }
.dp-index-list .dp-division:first-child { margin-top: 0; }
.dp-search { width: 100%; padding: .6em .85em; }
.dp-search:focus { border-color: var(--dp-forest); }
.dp-count { font-size: .85rem; color: var(--dp-muted); margin: .5em 0 0; }
.dp-count:empty { margin: 0; }
.dp-search-results { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 8px; margin: .75em 0 0; padding: 0; }
.dp-search-results a { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 48px; padding: .45em .75em; border: 1px solid var(--dp-line); border-radius: var(--dp-radius); background: var(--dp-card); line-height: 1.35; }
.dp-search-results .dp-bn { text-decoration: none; }
.dp-bn, .dp-name-bn { font-family: "Noto Sans Bengali", "Nirmala UI", system-ui, sans-serif; }
.dp-bn { color: var(--dp-muted); font-size: .88rem; }
.dp-card .dp-bn { padding: .25em .9em 0; }
.dp-division { margin-top: 36px; }
.dp .dp-division-title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .25em 1em; font-size: 1.3rem; letter-spacing: 0; margin: 0 0 .8em; padding-bottom: .4em; border-bottom: 1px solid var(--dp-line); }
.dp-division-title span { color: var(--dp-muted); }
.dp-card-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--dp-gap); }
.dp-card { display: flex; flex-direction: column; overflow: hidden; }
.dp-card-art { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--dp-paper-2); border-bottom: 1px solid var(--dp-line); }
.dp-card-art > * { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.dp-card-art img { object-fit: cover; }
.dp-card-shape { padding: 10%; }
.dp-card-shape use { fill: var(--dp-shape); stroke: var(--dp-forest); stroke-width: 1.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; transition: fill .16s ease; }
.dp-card:hover .dp-card-shape use { fill: #d9c3a3; }
.dp-card strong { font-size: 1.1rem; line-height: 1.2; padding: .6em .75em 0; }
.dp-card > span:last-child { font-size: .78rem; line-height: 1.4; color: var(--dp-muted); padding: .25em .75em .8em; font-variant-numeric: tabular-nums; }

/* ---------- profile: header ---------- */
.dp-crumbs { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px; padding: 10px 0 14px; border-bottom: 1px solid var(--dp-line); font-size: .92rem; }
.dp-crumbs-step { display: flex; align-items: center; gap: 12px; }
.dp-crumbs a { min-height: 44px; display: inline-flex; align-items: center; }
.dp-picker { padding: .3em .5em; }
.dp-opening--profile { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) 220px; grid-template-areas: "name locator" "reading locator"; gap: 16px 32px; align-items: center; padding-top: 32px; }
.dp-profile-name { grid-area: name; }
.dp-profile-reading { grid-area: reading; }
.dp-opening--profile h1 { margin-bottom: .12em; }
.dp-name-bn { color: var(--dp-forest); font-size: 1.1rem; margin: 0; }
.dp-local-reading, .dp-livelihood { margin-bottom: .35em; }
.dp-livelihood { font-size: .95rem; max-width: 64ch; }
.dp-measure-caption { color: var(--dp-muted); font-size: .8rem; line-height: 1.45; }
.dp-locator { grid-area: locator; }
.dp-locator .dp-map { max-height: 270px; }
.dp-jump { display: flex; flex-wrap: wrap; gap: 4px 20px; list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.dp-jump a { min-height: 40px; display: inline-flex; align-items: center; }

/* ---------- profile: photographs ---------- */
.dp-gallery { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; margin: 32px 0 8px; }
.dp-gallery--single { grid-template-columns: minmax(0, 1fr); }
.dp-gallery-rest { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; }
.dp-gallery-rest .dp-photo:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.dp-photo { margin: 0; overflow: hidden; }
.dp-photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--dp-paper-2); }
.dp-photo--lead { display: flex; flex-direction: column; }
.dp-photo--lead img { flex: 1 1 auto; aspect-ratio: 3 / 2; min-height: 0; }
.dp-gallery:not(.dp-gallery--single) .dp-photo--lead img { aspect-ratio: auto; height: 100%; min-height: 320px; }
.dp-gallery--single .dp-photo--lead img { aspect-ratio: 21 / 9; }
.dp-photo figcaption { padding: .65em .85em .75em; font-size: .86rem; line-height: 1.45; }
.dp-photo figcaption > span { display: block; }
.dp-credit { display: block; margin-top: .35em; }
.dp-map-plate { margin-top: 32px; }
.dp-map-plate img { height: auto; aspect-ratio: 1200 / 630; object-fit: contain; }

/* ---------- profile: sections ---------- */
.dp-section { padding: 64px 0 40px; border-bottom: 1px solid var(--dp-line); scroll-margin-top: 72px; }
.dp-section-head { max-width: 760px; margin-bottom: 24px; }
.dp-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--dp-gap); margin: 0; }
.dp-kpis + .dp-kpis, .dp-figure + .dp-kpis { margin-top: 16px; }
.dp-kpis + .dp-figure { margin-top: 16px; }
.dp-gdd { padding: 18px 20px 16px; overflow-x: auto; }
.dp-table { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.dp-table caption { text-align: left; font-family: var(--dp-serif); font-weight: 600; font-size: 1.1rem; color: var(--dp-forest); margin-bottom: .6em; }
.dp-table th, .dp-table td { padding: .55em .9em .55em 0; text-align: left; vertical-align: baseline; border-bottom: 1px solid var(--dp-line); }
.dp-table thead th { font-family: var(--dp-mono); font-size: .75rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--dp-muted); }
.dp-table tbody th { font-weight: 600; color: var(--dp-ink); }
.dp-table .dp-num { text-align: right; }
.dp-table-note { display: block; font-size: .82rem; color: var(--dp-muted); }
.dp-gdd figcaption { margin-top: .9em; max-width: 72ch; }
@media (max-width: 560px) {
  .dp-gdd { padding: 14px 12px 12px; }
  .dp-table { font-size: .86rem; }
  .dp-table th, .dp-table td { padding-right: .6em; }
}
.dp-kpi { padding: 14px 16px 16px; border-top: 3px solid var(--dp-forest); }
.dp-kpi dd { margin: .4em 0 0; display: flex; flex-direction: column; gap: .2em; }
.dp-kpi strong { font-size: 1.85rem; line-height: 1.1; }
.dp-kpi-compare { font-size: .84rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.dp-kpi-note { font-size: .76rem; line-height: 1.45; color: var(--dp-muted); }

.dp-crops { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--dp-gap); }
.dp-crop { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img name share" "img bar bar" "img rank rank" "source source source"; column-gap: 14px; row-gap: 4px; align-items: center; padding: 12px 16px 12px 12px; }
.dp-crop img { grid-area: img; width: 64px; height: 64px; object-fit: contain; background: var(--dp-paper); border-radius: 4px; }
.dp-crop-name { grid-area: name; font-size: 1.15rem; line-height: 1.2; }
.dp-crop-share { grid-area: share; font-size: 1.15rem; color: var(--dp-ochre); }
.dp-crop-bar { grid-area: bar; display: block; height: 5px; background: var(--dp-paper-2); border-radius: 3px; overflow: hidden; }
.dp-crop-bar i { display: block; height: 100%; background: var(--dp-ochre); border-radius: 3px; }
.dp-crop-rank { grid-area: rank; font-size: .76rem; line-height: 1.4; color: var(--dp-muted); font-variant-numeric: tabular-nums; }
.dp-crop-source { grid-area: source; }
.dp-crops-caption { margin: 0 0 10px; }

.dp-climate { margin-bottom: 16px; }
.dp-figure { margin: 0 0 16px; padding: 16px 16px 12px; }
.dp-figure figcaption { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 8px; }
.dp-chart { display: block; width: 100%; height: auto; }
.dp-grid { stroke: var(--dp-line); stroke-width: 1; }
.dp-axis { font: 500 11px var(--dp-mono); fill: var(--dp-muted); }
.dp-axis--temp { fill: var(--dp-ochre); }
.dp-chart--narrow .dp-axis { font-size: 13px; }
.dp-rain, .dp-year--wet { fill: var(--dp-rain); }
.dp-year--dry { fill: var(--dp-rain-soft); }
.dp-temp { fill: none; stroke: var(--dp-ochre); stroke-width: 2.4; stroke-linejoin: round; }
.dp-temp-dot { fill: var(--dp-card); stroke: var(--dp-ochre); stroke-width: 2; }
.dp-normal { stroke: var(--dp-forest); stroke-width: 1.4; stroke-dasharray: 4 3; }
.dp-key::before { content: ""; display: inline-block; width: 12px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.dp-key--rain::before { background: var(--dp-rain); }
.dp-key--temp::before { height: 0; border-top: 2.4px solid var(--dp-ochre); vertical-align: 3px; }

.dp-projects { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--dp-gap); }
.dp-project { display: flex; flex-direction: column; gap: .4em; padding: 16px 18px 18px; border-left: 4px solid var(--dp-forest); font-size: .9rem; line-height: 1.5; }
.dp-project strong { font-size: 1.3rem; line-height: 1.2; }
.dp-project-geo { color: var(--dp-ochre); }
.dp-project-more { margin-top: auto; padding-top: .4em; font-weight: 600; color: var(--dp-forest); }
.dp-empty { color: var(--dp-muted); }

.dp-more { padding: 48px 0 0; }
.dp-more ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--dp-gap); }
.dp-more a { display: flex; flex-direction: column; gap: .2em; height: 100%; padding: 14px 0; border-top: 1px solid var(--dp-line-strong); text-decoration: none; }
.dp-more strong { font-size: 1.2rem; }
.dp-more span { font-size: .88rem; color: var(--dp-muted); }
.dp-more a:hover strong { color: var(--dp-ochre); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .dp { padding: 80px 16px 56px; }
  .dp-index { grid-template-columns: minmax(0, 1fr); grid-template-areas: "search" "map" "list"; gap: 24px; }
  .dp-index-map { position: static; max-width: 360px; margin: 0 auto; }
  .dp-opening--profile { grid-template-columns: minmax(0, 1fr) 140px; gap: 20px; }
  .dp-gallery { grid-template-columns: minmax(0, 1fr); }
  .dp-section { padding: 48px 0 32px; }
}
@media (max-width: 560px) {
  .dp-opening--profile { grid-template-columns: minmax(0, 1fr) 124px; grid-template-areas: "name locator" "reading reading"; gap: 16px 12px; }
  .dp-crumbs { font-size: .85rem; }
  .dp-crumbs-step { width: 100%; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; }
  .dp-picker { max-width: 100%; }
  .dp-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dp-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .dp-kpi { padding: 12px 12px 14px; }
  .dp-kpi strong { font-size: 1.45rem; }
  .dp-crops, .dp-projects { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 430px) {
  .dp-opening--long-name {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "name" "reading" "locator";
  }
  .dp-opening--long-name .dp-locator { width: 124px; }
}
@media (prefers-reduced-motion: reduce) {
  .dp-card, .dp-crop, .dp-project, .dp-map-district, .dp-card-shape use { transition: none; }
  .dp-card:hover { transform: none; }
}
