/* Cultivera R20 · sitewide CD correction authority · 2026-08-30
   Genuine-defect fixes only. Loaded last so the frozen page authorities remain intact. */

/* Progressive enhancement must never make the base document unreadable. */
.reveal,
.page-insights-long-view .story-chapter {
  opacity: 1 !important;
  transform: none !important;
}

body.donor-glow .glow-atlas:not(.is-ready) .atlas-locator,
body.donor-glow .glow-atlas:not(.is-ready) .glow-atlas__upazilas path,
body.donor-glow .glow-atlas:not(.is-ready) .glow-atlas__rivers,
body.donor-glow .glow-atlas:not(.is-ready) .glow-atlas__screening,
body.donor-glow .glow-atlas:not(.is-ready) .atlas-candidate-label {
  opacity: 1 !important;
  transform: none !important;
}

/* Potato Long View: keep the chronology inside the Atlas column. */
@media (min-width: 901px) {
  .page-insights-long-view .timeline {
    right: 0;
  }

  .page-insights-long-view .timeline a span {
    right: 51px;
    left: auto;
    text-align: right;
  }
}

/* Large numerals are indivisible typographic objects. */
body[data-project-id="cocores-bd"] .cc-tension__number strong,
.page-biogas-policy .number-record article > span {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  font-variant-numeric: tabular-nums;
}

/* Biochar inherits the shared project-pagination grammar. */
body[data-project-id="biochar-field"] .project-pagination {
  padding: clamp(36px, 4.5vw, 62px) clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--bc-line);
  background: #ede8dd;
}

body[data-project-id="biochar-field"] .project-pagination__inner {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(24px, 4vw, 60px);
  align-items: center;
}

body[data-project-id="biochar-field"] .project-pagination a {
  color: var(--bc-ink);
  text-decoration: none;
}

body[data-project-id="biochar-field"] .project-pagination__link {
  display: grid;
  gap: 8px;
  padding: 20px 0;
  border-block: 1px solid var(--bc-line);
}

body[data-project-id="biochar-field"] .project-pagination__link--next {
  text-align: right;
}

body[data-project-id="biochar-field"] .project-pagination__link > span,
body[data-project-id="biochar-field"] .project-pagination__all {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body[data-project-id="biochar-field"] .project-pagination__link > span {
  color: #8b5c28;
}

body[data-project-id="biochar-field"] .project-pagination__link strong {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.35rem, 1.85vw, 1.95rem);
  font-weight: 400;
  line-height: 1.1;
}

body[data-project-id="biochar-field"] .project-pagination__all {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--bc-line);
  border-radius: 999px;
}

/* Editorial links underline only their actual label-and-arrow group. */
.editorial-link,
.sr-text-link {
  position: relative;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  border-bottom: 0 !important;
  text-decoration: none;
}

.editorial-link::after,
.sr-text-link::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 3px;
  left: 0;
  height: 1px;
  background: currentColor;
  opacity: .3;
}

.cd-inline-arrow {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  overflow: visible;
}

.cd-inline-arrow path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

/* Keep Insights provenance readable over the photograph at tablet widths. */
@media (min-width: 721px) and (max-width: 1100px) {
  .page-insights .r18-cover-media figcaption {
    max-width: 42ch;
    padding: 6px 8px;
    background: rgba(5, 19, 12, .76);
    color: #fff;
    text-shadow: none;
  }
}

/* Prevent the 320 px evidence rule from running through its label. */
@media (max-width: 360px) {
  .page-insights-long-view .atlas-regime {
    position: relative;
    z-index: 2;
    width: max-content;
    padding-right: 8px;
    background: var(--paper);
    box-shadow: 6px 0 0 var(--paper);
  }
}

/* Mobile Advisory: fieldsets own hierarchy; answers read as rows, not a tile matrix. */
@media (max-width: 760px) {
  .page-advisory .question {
    padding-block: 34px 38px;
  }

  .page-advisory .question:first-child {
    padding-top: 0;
  }

  .page-advisory .options,
  .page-advisory .options-four {
    display: block;
    border-left: 0;
  }

  .page-advisory .option {
    display: block;
    border-right: 0;
    background: transparent;
  }

  .page-advisory .option span {
    padding: 16px 2px 17px;
  }

  .page-advisory .option:has(input:checked) {
    padding-left: 12px;
    box-shadow: inset 2px 0 0 var(--forest);
  }
}

/* Decorative numbering removed from unordered choices and service families. */
.page-about .about-way__index,
.page-contact .route-number {
  display: none !important;
}

.page-about .about-way {
  grid-template-columns: minmax(180px, .55fr) minmax(260px, 1.1fr) auto;
}

.page-contact .route-option {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 700px) {
  /* Long-form routes: preserve every decision and evidence datum, without mobile dead air. */
  body[data-project-id="biochar-field"] .bc-section {
    padding-block: 62px;
  }

  body[data-project-id="biochar-field"] .bc-batch__visual {
    min-height: 390px;
  }

  body[data-project-id="biochar-field"] .bc-section--sources {
    padding-block: 58px 64px;
  }

  body.page-scaling-biogas-bangladesh .story-hero {
    padding-block: 50px 44px;
  }

  body.page-scaling-biogas-bangladesh .story-section,
  body.page-scaling-biogas-bangladesh :is(#evidence, #market, #plan).story-section,
  body.page-scaling-biogas-bangladesh .story-section:not([id]) {
    padding-block: 50px;
  }

  body.donor-mavh[data-project-id="mahasthangarh-agri-value-hub"] .mavh-first-site__facts p,
  body.donor-mavh[data-project-id="mahasthangarh-agri-value-hub"] .mavh-funding-fit__grid article {
    padding-block: 16px;
  }

  body.donor-mavh[data-project-id="mahasthangarh-agri-value-hub"] .mavh-close {
    min-height: 540px;
  }

  body.donor-mavh[data-project-id="mahasthangarh-agri-value-hub"] .mavh-close__inner {
    padding-top: 260px;
    padding-bottom: 42px;
  }

  body[data-project-id="biochar-field"] .project-pagination__inner {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  body[data-project-id="biochar-field"] .project-pagination__link--next {
    text-align: left;
  }

  body[data-project-id="biochar-field"] .project-pagination__all {
    order: 3;
    width: fit-content;
  }

  .page-about .about-way {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .page-insights-long-view .story-chapter,
  body.donor-glow .glow-atlas * {
    transition: none !important;
    animation: none !important;
  }
}

/* No-JS responsive shell: keep primary navigation usable when menu scripting is unavailable. */
@media (scripting: none) and (max-width: 1180px) {
  body:not(.page-retained-capital) .cv-global-nav {
    position: relative !important;
    inset: auto !important;
    height: auto !important;
    min-height: 58px !important;
    background: #f9f9f5 !important;
    color: #171b17 !important;
    border-bottom: 1px solid rgba(23,27,23,.12) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  body:not(.page-retained-capital) .cv-global-nav__inner {
    height: auto !important;
    min-height: 58px !important;
    grid-template-columns: minmax(116px,128px) 1fr !important;
    gap: 8px 18px !important;
    padding: 7px 0 9px !important;
  }
  body:not(.page-retained-capital) .cv-global-logo--primary { opacity: 1 !important; }
  body:not(.page-retained-capital) .cv-global-logo--reverse { opacity: 0 !important; }
  body:not(.page-retained-capital) .cv-global-menu,
  body:not(.page-retained-capital) .cv-global-cta { display: none !important; }
  body:not(.page-retained-capital) .cv-global-links {
    display: flex !important;
    grid-column: 1 / -1 !important;
    justify-self: start !important;
    flex-wrap: wrap !important;
    gap: 0 16px !important;
    color: #656b65 !important;
  }
  body:not(.page-retained-capital) .cv-global-links a {
    min-height: 44px !important;
    color: inherit !important;
  }
  body:not(.page-retained-capital) .cv-global-mobile { display: none !important; }
  body:not(.page-retained-capital) .cv-global-mobile + main { padding-top: 0 !important; }
}

/* Field Systems: use the accepted status vocabulary and make the portfolio arithmetic explicit. */
.page-field-systems .metrics-grid .metric:nth-child(2) span,
.page-field-systems .metrics-grid .metric:nth-child(3) span {
  position: relative;
  visibility: hidden;
}

.page-field-systems .metrics-grid .metric:nth-child(2) span::after,
.page-field-systems .metrics-grid .metric:nth-child(3) span::after {
  position: absolute;
  inset: 0 auto auto 0;
  visibility: visible;
  white-space: nowrap;
  color: inherit;
}

.page-field-systems .metrics-grid .metric:nth-child(2) span::after {
  content: "projects · 2 concept";
}

.page-field-systems .metrics-grid .metric:nth-child(3) span::after {
  content: "open for funding";
}

.page-field-systems #atlasScopeFunding {
  font-size: 0;
}

.page-field-systems #atlasScopeFunding::before,
.page-field-systems #atlasScopeFunding span {
  font-size: .68rem;
}

.page-field-systems #atlasScopeFunding::before {
  content: "Open for funding";
}

.page-field-systems #atlasScopeFunding span {
  margin-left: .45rem;
}

/* Field Systems Atlas closeout · large-desktop hierarchy and legibility only. */
.page-field-systems .atlas-preview.is-neutral-view #atlasPreviewStatus {
  position: relative;
  visibility: hidden;
}

.page-field-systems .atlas-preview.is-neutral-view #atlasPreviewStatus::after {
  content: "Open for funding";
  position: absolute;
  inset: 0 auto auto 0;
  visibility: visible;
  white-space: nowrap;
}

.page-field-systems:has(#atlasScopeProgress.is-active) .atlas-preview.is-neutral-view #atlasPreviewStatus::after {
  content: "In progress";
}

@media (min-width: 1121px) {
  .page-field-systems .atlas-workspace {
    grid-template-columns: minmax(390px, .68fr) minmax(0, 1.32fr);
  }

  .page-field-systems .atlas-toolbar {
    min-height: 78px;
  }

  .page-field-systems .atlas-views,
  .page-field-systems .atlas-scope {
    position: relative;
    min-height: 77px;
    padding-top: 17px;
  }

  .page-field-systems .atlas-views::before,
  .page-field-systems .atlas-scope::before {
    position: absolute;
    top: 10px;
    color: #768078;
    font: 600 9px/1 var(--mono);
    letter-spacing: .1em;
    text-transform: uppercase;
  }

  .page-field-systems .atlas-views::before {
    content: "View";
    left: 0;
  }

  .page-field-systems .atlas-scope {
    padding-left: 24px;
    border-left: 1px solid rgba(31, 46, 35, .11);
  }

  .page-field-systems .atlas-scope::before {
    content: "Status";
    left: 24px;
  }

  .page-field-systems .atlas-views button,
  .page-field-systems .atlas-scope button {
    min-height: 48px;
    padding-top: 11px;
    font-weight: 560;
  }

  .page-field-systems .atlas-views button.is-active,
  .page-field-systems .atlas-scope button.is-active {
    color: var(--forest-2);
    font-weight: 650;
  }

  .page-field-systems .project-row {
    grid-template-columns: minmax(0, 1fr) minmax(88px, .24fr) 12px;
    gap: 12px;
    padding-right: 16px;
    padding-left: 14px;
  }

  .page-field-systems .project-row__main small {
    font-size: 10.25px;
    line-height: 1.34;
  }

  .page-field-systems .project-row-allocation {
    gap: 5px;
  }

  .page-field-systems .project-row-allocation__lead {
    overflow: hidden;
    font-size: 9.75px;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .page-field-systems .atlas-workspace[data-atlas-mode="projects"] .atlas-geography-field .map-legend {
    left: 0;
    right: 0;
    bottom: 0;
    display: flex !important;
    min-height: 34px;
    gap: 8px 12px;
    padding: 9px 14px 8px;
    border-top: 1px solid rgba(31, 46, 35, .10);
    background: rgba(239, 238, 231, .92);
    color: #5e685f;
    font-size: 9.5px;
    pointer-events: none;
  }

  .page-field-systems .atlas-workspace[data-atlas-mode="projects"] .atlas-geography-field .map-legend strong {
    font-size: 9px;
  }

  .page-field-systems .atlas-workspace[data-atlas-mode="projects"] .atlas-geography-field .map-legend i {
    width: 6px;
    height: 6px;
  }
}
