/* Fonts: reveal.html already gets them through css/style.css; /reveal/map.html
   loads this file on its own, so the imports live here too (the browser
   de-duplicates them). */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@100..900&display=swap');

/* ============================================================================
   REVEAL — page-specific styles (reveal.html) and shared REVEAL brand tokens.

   Scope rule: everything here is namespaced under .rv- / .reveal-page so the
   REVEAL palette never leaks into the rest of mesaplb.com. Shared site styles
   live in css/style.css and are NOT touched by this file.

   Palette from the agency brand PDF.
   ============================================================================ */

:root {
    --rv-terracotta: #a05d3a;
    --rv-terracotta-light: #c87958;
    --rv-green: #264c22;
    --rv-sand: #ece9e1;
    --rv-off-white: #fffffa;
    --rv-sky: #bce2f7;
    --rv-ink: #2b2320;
    --rv-rule: rgba(160, 93, 58, 0.28);
    /* Self-contained font tokens so /reveal/map.html does not need style.css */
    --rv-font-display: "Montserrat", sans-serif;
    --rv-font-serif: "Roboto Slab", serif;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.rv-hero {
    background: var(--rv-terracotta);
    color: var(--rv-off-white);
    padding: 120px 8px 64px;
    position: relative;
    z-index: 2;
}

.rv-hero-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.rv-hero h1 {
    margin: 0 0 24px;
}

.rv-hero-logo {
    width: auto;
    height: 180px;
    max-width: 100%;
    object-fit: contain;
}

/* Accessible text alternative kept in the flow of the H1 */
.rv-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;
}

/* Full acronym: the R-E-V-E-A-L capitals are picked out of the sentence. */
.rv-subtitle {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: 20px;
    line-height: 1.55;
    margin: 0;
    color: var(--rv-off-white);
}

.rv-cap {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--rv-sky);
}

@media (max-width: 991.98px) {
    .rv-hero { padding: 104px 8px 48px; }
    .rv-hero-logo { height: 140px; }
    .rv-subtitle { font-size: 18px; }
}

@media (max-width: 575.98px) {
    .rv-hero-logo { height: 104px; }
    .rv-subtitle { font-size: 16px; }
}

/* --------------------------------------------------------------------------
   Section rhythm — reuses the site's .padding, adds REVEAL colour bands
   -------------------------------------------------------------------------- */

.rv-band-sand {
    background: var(--rv-sand);
    position: relative;
    z-index: 2;
}

.rv-band-white {
    background: var(--rv-off-white);
    position: relative;
    z-index: 2;
}

.rv-section-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 38px;
    line-height: 1.1;
    color: var(--rv-terracotta);
    margin: 0 0 24px;
    text-shadow: none;
}

.rv-page-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 44px;
    line-height: 1.1;
    color: var(--rv-terracotta);
    margin: 0 0 40px;
    text-align: center;
    text-shadow: none;
}

@media (max-width: 767.98px) {
    .rv-section-title { font-size: 28px; }
    .rv-page-title { font-size: 30px; margin-bottom: 28px; }
}

.rv-body {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: 18px;
    line-height: 1.7;
    color: var(--rv-ink);
    margin: 0;
}

.rv-intro {
    font-size: 20px;
    line-height: 1.75;
    max-width: 900px;
    margin: 0 auto;
}

.rv-intro + .rv-intro { margin-top: 1.25em; }

@media (max-width: 767.98px) {
    .rv-body { font-size: 16px; }
    .rv-intro { font-size: 17px; }
}

/* --------------------------------------------------------------------------
   Narrative rows — text / photo, 2 columns from 992px, stacked below
   -------------------------------------------------------------------------- */

.rv-story {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: center;
    margin-bottom: 56px;
}

.rv-story:last-child { margin-bottom: 0; }

@media (min-width: 992px) {
    .rv-story {
        grid-template-columns: 1fr 1fr;
        gap: 56px;
        margin-bottom: 88px;
    }
    /* Alternate: even rows put the photo on the left without touching DOM order */
    .rv-story--flip .rv-story-media { order: -1; }
}

.rv-story-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 18px 40px -30px rgba(43, 35, 32, 0.9);
    background: var(--rv-sand);
}

/* --------------------------------------------------------------------------
   Web GIS section
   -------------------------------------------------------------------------- */

.rv-map-caption {
    max-width: 820px;
    margin: 0 auto 28px;
    text-align: center;
}

/* Fixed-ratio box: reserves the space before the iframe loads (no CLS). */
.rv-map-frame {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 480px;
    max-height: 760px;
    border: 2px solid var(--rv-terracotta);
    border-radius: 6px;
    overflow: hidden;
    background: var(--rv-sand);
}

.rv-map-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media (max-width: 575.98px) {
    .rv-map-frame { height: 74vh; min-height: 420px; }
}

/* Full-screen mode (js/reveal-map-overlay.js): the SAME iframe is pinned over
   the viewport, so the map keeps its zoom, layers and open popup. A bar on top
   carries the close button, out of the way of the map's own controls. The
   section is raised above the sticky header (z-index 99 inside .main-wrapper);
   the cookie banner (2000, outside .main-wrapper) stays reachable on top. */
.rv-map-bar { display: none; }

body.rv-map-open { overflow: hidden; }
body.rv-map-open #webgis { z-index: 1000; }

.rv-map-frame.is-full {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: none;
    border: 0;
    border-radius: 0;
    z-index: 1000;
}

.rv-map-frame.is-full .rv-map-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: var(--rv-map-bar-h, 56px);
    padding: 0 8px 0 20px;
    background: var(--rv-terracotta);
    color: var(--rv-off-white);
}

/* An iframe is a replaced element: top + bottom don't stretch it, so the
   height has to be explicit. */
.rv-map-frame.is-full iframe {
    top: var(--rv-map-bar-h, 56px);
    height: calc(100% - var(--rv-map-bar-h, 56px));
}

.rv-map-bar-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rv-map-close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 250, 0.55);
    border-radius: 50%;
    background: transparent;
    color: var(--rv-off-white);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.rv-map-close:hover,
.rv-map-close:focus-visible {
    background: var(--rv-off-white);
    color: var(--rv-terracotta);
    outline: none;
}

.rv-map-link {
    display: inline-block;
    margin-top: 18px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rv-off-white) !important;
    background: var(--rv-green);
    padding: 12px 22px;
    min-height: var(--touch-min, 44px);
    border-radius: 3px;
    transition: background .25s ease;
}

.rv-map-link:hover,
.rv-map-link:focus {
    background: var(--rv-terracotta);
    color: var(--rv-off-white) !important;
}

/* --------------------------------------------------------------------------
   Actors — card grid
   -------------------------------------------------------------------------- */

.rv-actors {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 992px) {
    .rv-actors { grid-template-columns: repeat(2, 1fr); gap: 32px; }
}

.rv-actor {
    background: var(--rv-off-white);
    border: 1px solid var(--rv-rule);
    border-top: 4px solid var(--rv-terracotta);
    border-radius: 6px;
    padding: 24px 24px 28px;
    display: flex;
    flex-direction: column;
}

.rv-actor-logo {
    width: auto;
    height: 64px;
    max-width: 200px;
    object-fit: contain;
    object-position: left center;
    margin-bottom: 16px;
}

.rv-actor h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    line-height: 1.25;
    color: var(--rv-green);
    margin: 0 0 12px;
}

.rv-actor p {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: 16px;
    line-height: 1.65;
    color: var(--rv-ink);
    margin: 0;
}

.rv-actor a {
    color: var(--rv-terracotta);
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Logo strip (replicates the client's banner / letterhead)
   Three rows split by rules: funders (2 columns) · initiative / framework /
   collaboration (3 columns) · partners (label, then a 3 × 2 logo grid on the
   same 3 columns). Logos sit in a fixed box with object-fit: contain, so wide
   marks get capped by width and tall ones by height.
   -------------------------------------------------------------------------- */

.rv-strip {
    background: var(--rv-off-white);
    position: relative;
    z-index: 2;
    padding: 56px 8px 64px;
}

.rv-strip-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px 32px;
}

@media (min-width: 768px) {
    .rv-strip-row--2 { grid-template-columns: repeat(2, 1fr); }
    .rv-strip-row--3 { grid-template-columns: repeat(3, 1fr); }
}

.rv-strip-group {
    text-align: center;
    min-width: 0;
}

.rv-strip-label {
    display: block;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--rv-terracotta);
    margin-bottom: 28px;
}

.rv-strip-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 24px 32px;
}

.rv-strip-logos img {
    width: auto;
    height: 88px;
    max-width: 180px;
    object-fit: contain;
}

/* Partners: same three columns as the row above */
.rv-strip-logos--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;
    gap: 36px 24px;
}

@media (min-width: 768px) {
    .rv-strip-logos--grid { grid-template-columns: repeat(3, 1fr); gap: 44px 32px; }
}

.rv-strip-logos--grid img {
    height: 80px;
    max-width: 170px;
}

/* <hr>: Bootstrap paints it as a 1px currentColor box at 25 % opacity;
   reset that so only the REVEAL rule shows. */
.rv-strip-divider {
    border: 0;
    border-top: 1px solid var(--rv-rule);
    height: 0;
    background: none;
    opacity: 1;
    margin: 40px 0;
}

@media (max-width: 575.98px) {
    .rv-strip-label { font-size: 12px; letter-spacing: 0.16em; margin-bottom: 20px; }
    .rv-strip-logos img { height: 72px; max-width: 150px; }
    .rv-strip-logos--grid img { height: 64px; max-width: 136px; }
}

/* --------------------------------------------------------------------------
   Footer bits replicated on this page (styling owned by css/style.css)
   -------------------------------------------------------------------------- */

.footer-cookie-link { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .rv-map-link,
    .rv-map-close,
    .rv-actor,
    .rv-story-media img {
        transition: none !important;
        animation: none !important;
    }
    html { scroll-behavior: auto !important; }
}

/* ============================================================================
   /reveal/map.html — standalone full-viewport Web GIS
   ============================================================================ */

.rv-map-page,
.rv-map-page body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.rv-map-page body {
    font-family: var(--rv-font-display);
    background: var(--rv-sand);
    color: var(--rv-ink);
}

#map {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--rv-sand);
}

/* Non-blocking data error line */
.rv-map-error {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1200;
    max-width: min(92vw, 520px);
    background: var(--rv-terracotta);
    color: var(--rv-off-white);
    font-family: var(--rv-font-display);
    font-size: 13px;
    line-height: 1.4;
    padding: 10px 16px;
    border-radius: 4px;
    box-shadow: 0 8px 24px -12px rgba(0, 0, 0, .6);
}

/* "Open in a new tab" — revealed only when the page is inside an iframe */
.rv-open-tab {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    font-family: var(--rv-font-display);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: var(--rv-off-white);
    color: var(--rv-terracotta) !important;
    border: 1px solid var(--rv-rule);
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    padding: 0 14px;
    height: 36px;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 6px 18px -12px rgba(0, 0, 0, .7);
}

.rv-open-tab:hover,
.rv-open-tab:focus {
    background: var(--rv-terracotta);
    color: var(--rv-off-white) !important;
}

/* ---- shared control chrome ---- */

.rv-ctl {
    background: rgba(255, 255, 250, .96);
    border: 1px solid var(--rv-rule);
    border-radius: 4px;
    box-shadow: 0 6px 20px -14px rgba(0, 0, 0, .8);
    font-family: var(--rv-font-display);
    font-size: 12px;
    color: var(--rv-ink);
}

.rv-ctl-title {
    font-family: var(--rv-font-display);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--rv-terracotta);
    margin: 10px 0 6px;
    padding-top: 8px;
    border-top: 1px solid var(--rv-rule);
}

.rv-ctl-title:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.rv-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
    flex: 0 0 auto;
}

/* ---- layer control ---- */

.rv-layers {
    max-width: min(80vw, 280px);
    max-height: calc(100vh - 120px);
    overflow: auto;
}

.rv-layers .rv-ctl-body {
    padding: 10px 12px 12px;
}

.rv-ctl-toggle {
    display: none;
    width: 100%;
    min-height: 44px;
    background: var(--rv-terracotta);
    color: var(--rv-off-white);
    border: 0;
    border-radius: 3px;
    font-family: var(--rv-font-display);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .1em;
    text-transform: uppercase;
    cursor: pointer;
}

.rv-ctl-row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 0;
    line-height: 1.3;
    cursor: pointer;
}

.rv-ctl-row input {
    margin: 0;
    flex: 0 0 auto;
    accent-color: var(--rv-terracotta);
}

@media (max-width: 767.98px) {
    .rv-ctl-toggle { display: block; }
    .rv-layers.rv-collapsed .rv-ctl-body { display: none; }
    .rv-ctl-row { padding: 7px 0; }
}

/* ---- reset view button ---- */

.rv-reset a {
    font-size: 20px;
    line-height: 26px;
    color: var(--rv-terracotta);
    text-align: center;
}

/* ---- popups ---- */

.leaflet-popup-content-wrapper {
    border-radius: 4px;
}

.leaflet-popup-content {
    margin: 12px 14px;
    font-family: var(--rv-font-serif);
}

.rv-popup-title {
    font-family: var(--rv-font-display);
    font-weight: 700;
    font-size: 17px;
    line-height: 1.2;
    color: var(--rv-terracotta);
    margin: 0 0 2px;
}

.rv-popup-sub {
    font-family: var(--rv-font-display);
    font-weight: 600;
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--rv-green);
    margin: 0 0 8px;
}

.rv-popup-desc {
    font-family: var(--rv-font-serif);
    font-weight: 400;
    font-size: 13px;
    line-height: 1.5;
    color: var(--rv-ink);
    margin: 0 0 10px;
}

.rv-popup-rows {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 10px;
    margin: 0;
    font-size: 13px;
}

.rv-popup-rows dt {
    font-family: var(--rv-font-display);
    font-weight: 600;
    color: var(--rv-terracotta);
    white-space: nowrap;
}

.rv-popup-rows dd {
    margin: 0;
    color: var(--rv-ink);
}

@media (prefers-reduced-motion: reduce) {
    .leaflet-fade-anim .leaflet-tile,
    .leaflet-zoom-anim .leaflet-zoom-animated {
        transition: none !important;
    }
    .rv-open-tab,
    .rv-ctl-toggle { transition: none !important; }
}

/* Nav over the terracotta hero: the site's "other-pages" rule paints links
   teal (responisve.css); on REVEAL they must be white. Specificity matches
   the .is-stuck override in style.css. */
.header-top.rv-header .navbar.other-pages .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
}
.header-top.rv-header .navbar.other-pages .navbar-nav .nav-link:hover,
.header-top.rv-header .navbar.other-pages .navbar-nav .nav-link.active {
    color: #ffffff;
    border-color: #ffffff;
}
