/*
V7-HEADER
* Title:    Buktika - MamaDEX Mamas Map Hero Styles
* Filename: assets/css/mamadex/mamadex-mamas-map.css
* Version:  v3.13.0
* Issued:   2026-03-03
* Updated:  2026-06-13 (golden divider removed; box-sizing; mobile top-align; added .maplibregl-ctrl-help ? button styles)
* Author:   Buktika Webdesk (Binka)
* Owner:    Buktika — Binka
* Purpose:  Partial styles for mamadex-mamas-map.html.
*           - Partial-internal elements: hero-inner, hero-title, #map-container, #map.
*           - Mama pin elements and hover/featured states.
*           - Tippy tooltip card (sentraledex theme) — unscoped: Tippy renders at body root.
*           - z-index hierarchy: controls (100) > tooltips (10000) > pins (5).
*           Hero geometry (height, gradient, breakpoints) owned by mamadex-mamas.css §4.1.
* Type:     CSS stylesheet (partial)
* Colour Map:    v3.9.0 Section 5.3 (LOCKED)
* Design System: v4.0.0
* ISO Reference: ISO 27001, ISO 9241-110
* Source Naming Standard: Buktika v7.1 (ISO Aligned)
* License:  © Buktika, 2026. All rights reserved.
*
* Exceptions (permanent):
*   #234038        — photography-derived gradient stop. No token.
*   rgba(248,248,248,0.945) — map chrome surface. Must be light regardless of theme.
*   rgba(251,146,60,...)   — decorative pin glow. No token.
*   Tippy unscoped  — renders at body root; page-scope architecturally impossible.
*   rgba(255,255,255,0.80) — secondary text on dark tooltip bg. No token for rgba opacity.
*
*/

/* 0) Header and dependency notes
   depends on:
   - /assets/css/global.css   (canonical tokens + shared components)
   - /assets/css/themes.css   ([data-theme] alias layer)
   - /assets/css/mamadex/mamadex-mamas.css (page variable binding)
   Third-party: tippy.css, maplibre-gl.css (loaded after this file)
*/

/* ======================================================================================================
   Hero map section — partial-internal rules only
   Layout, height, gradient, and responsive breakpoints are owned by mamadex-mamas.css section 3.
   ====================================================================================================== */

/* Override global.css .hero { max-width: 1400px }.
   padding:0 and height:100% already set in mamadex-mamas.css §3.
   max-width must be none — JS reads full viewport width via getBoundingClientRect(). */
.page-mamadex-mamas .hero-mamadex-map {
  max-width: none;
  min-height: auto;                    /* REVERTED: v3.8.0 added min-height:auto which removed the height the JS relies on */
  height: 800px;                      /* EXCEPTION: hero height fixed at 800px per §15.2 — JS relies on this for map init */
}

/* Inner wrapper keeps content constrained */
.page-mamadex-mamas .hero-mamadex-map .hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 75rem;                /* 1200px */
  padding: 0 1.25rem;             /* 0 20px */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Headline block above the map */
.page-mamadex-mamas .hero-mamadex-map .hero-title {
  margin: 0 auto 1.5rem;
  max-width: 55rem;
  text-align: center;
}

.page-mamadex-mamas .hero-mamadex-map .hero-title .headline {
  margin: 0 0 0.5rem;
  font-family: var(--headline-font);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  color: #ffffff;                  /* EXCEPTION: hero text always white — §global.css */
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
  letter-spacing: -0.01em;
}

.page-mamadex-mamas .hero-mamadex-map .hero-title .tagline {
  margin: 0;
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82); /* EXCEPTION: no token for rgba white opacity */
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.40);
}

/* Decorative amber rule below tagline — REMOVED (owner: drop the golden line, match eco-guilds). */

/* ? help control — joins the MapLibre control group; opens the SDXStage help panel. */
.page-mamadex-mamas .maplibregl-ctrl-help {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--sdx-color-slate-dark);
  transition: background 0.15s ease, color 0.15s ease;
  padding: 0;
  line-height: 1;
}
.page-mamadex-mamas .maplibregl-ctrl-help:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--page-primary);
}
.page-mamadex-mamas .maplibregl-ctrl-help.is-active {
  background: rgba(139, 92, 246, 0.12);   /* mama-violet tint */
  color: var(--page-primary);
}
.page-mamadex-mamas .maplibregl-ctrl-help:focus-visible {
  outline: 2px solid var(--page-primary);
  outline-offset: 1px;
}
[data-theme="dark"] .page-mamadex-mamas .maplibregl-ctrl-help {
  color: var(--fg);
}

/* Instruction line below map container (element removed; rule retained harmlessly). */
.page-mamadex-mamas .hero-mamadex-map .map-instruction {
  margin: 0.875rem auto 0;
  text-align: center;
  font-size: 0.8125rem;            /* 13px */
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55); /* EXCEPTION: muted white — no token for rgba */
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* ======================================================================================================
   Map container
   ====================================================================================================== */

.page-mamadex-mamas #map-container {
  margin: 0 auto;                  /* JS controls container dimensions; no extra margin */
  box-sizing: border-box;          /* width:100% (mobile) includes padding+border — no overflow */
  padding: 0.5rem;                 /* 8px */
  border-radius: 1rem;             /* 16px */
  border: 1px solid rgba(148, 163, 184, 0.25);
  /* EXCEPTION: rgba(248,248,248,0.945) — near-white map chrome surface.
     Must remain light regardless of [data-theme] for MapLibre contrast.
     Not a page surface token. Permanent exception. */
  background: rgba(248, 248, 248, 0.945);
  position: relative;
  overflow: hidden;
  transform: translateY(-8px);
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.55),
    0 0 0 1px rgba(15, 23, 42, 0.18);
}

/* MapLibre map fills the container */
.page-mamadex-mamas #map {
  padding: 0.625rem;               /* 10px */
  width: 100%;
  height: 100%;
  border-radius: 0.75rem;          /* 12px */
}

/* Z-index hierarchy: navigation controls above pins, below tooltips */
.page-mamadex-mamas #map .maplibregl-ctrl-top-left,
.page-mamadex-mamas #map .maplibregl-ctrl-top-right {
  z-index: 100;
}

/* ======================================================================================================
   Mama map pins
   ====================================================================================================== */

.page-mamadex-mamas .mama-map-pin {
  position: absolute;
  width: 48px;                     /* EXCEPTION: fixed icon dimension §15.4 */
  height: 48px;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  z-index: 5;
}

.page-mamadex-mamas .mama-map-pin img {
  display: block;
  width: 48px;                     /* EXCEPTION: fixed icon dimension §15.4 */
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  background: #ffffff;             /* EXCEPTION: pin background always white. Permanent. */
  padding: 4px;                    /* EXCEPTION: fixed pin padding — icon geometry §15.4 */
  border: 3px solid #ffffff;       /* EXCEPTION: pin ring always white. Permanent. */
  box-shadow:
    0 0 0 1px rgba(47, 92, 104, 0.15),
    0 4px 12px rgba(15, 23, 42, 0.35);
  pointer-events: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.page-mamadex-mamas .mama-map-pin:hover img {
  transform: scale(1.1);
  box-shadow:
    0 0 0 1px rgba(47, 92, 104, 0.25),
    0 6px 16px rgba(15, 23, 42, 0.45);
}

/* Featured pin — mama-amber glow.
   Border uses var(--sdx-color-golden-joy) per §2.3 (was hardcoded #F59E0B). */
.page-mamadex-mamas .mama-map-pin.featured img {
  border-color: var(--sdx-color-golden-joy);
  box-shadow:
    0 0 0 3px rgba(245, 158, 11, 0.30),
    0 0 20px rgba(251, 146, 60, 0.60),   /* EXCEPTION: decorative glow — no token §header */
    0 4px 12px rgba(15, 23, 42, 0.35);
}

.page-mamadex-mamas .mama-map-pin.featured:hover img {
  box-shadow:
    0 0 0 3px rgba(245, 158, 11, 0.40),
    0 0 28px rgba(251, 146, 60, 0.70),   /* EXCEPTION: decorative glow — no token §header */
    0 6px 16px rgba(15, 23, 42, 0.45);
}

/* ======================================================================================================
   Tippy tooltip card (sentraledex theme) — MamaDEX portrait card inner layout.
   Base box visual (background, border, border-radius, box-shadow, arrow) is owned by
   global.css v3.20.0 per DOC-03 Amendment v2.1.0 §12.4. No base overrides here.
   This file owns ONLY the inner card content selectors.
   EXCEPTION: Unscoped — Tippy renders at document.body root. Page-scope impossible.
   Confirmed permanent architectural exception.
   ====================================================================================================== */

/* Card layout inside tooltip */
.tippy-box[data-theme~='sentraledex'] .mama-map-card-link {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;                    /* 12px */
  text-decoration: none;
  color: inherit;
}

.tippy-box[data-theme~='sentraledex'] .card-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.tippy-box[data-theme~='sentraledex'] .card-portrait {
  flex: 0 0 70px;                  /* EXCEPTION: fixed portrait thumbnail §15.4 */
  width: 70px;
  height: 70px;
  border-radius: 0.625rem;         /* 10px — confirmed exception §15.4 */
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.tippy-box[data-theme~='sentraledex'] .card-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid var(--sdx-color-mama-amber); /* portrait ring — separates face from dark card bg */
}

.tippy-box[data-theme~='sentraledex'] .card-name {
  margin: 0 0 0.125rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--sdx-color-mama-bg);    /* warm parchment on mama-depth = 12.1:1 WCAG AAA.
                                             Amber was hard to read at small size. PIL-03 §9.2 HARD RULE. */
}

.tippy-box[data-theme~='sentraledex'] .card-center {
  margin: 0;
  font-size: 0.8125rem;            /* 13px */
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.80); /* EXCEPTION: secondary white on dark bg — PIL-03 §9.2 HARD RULE. No token for rgba. */
}

/* ======================================================================================================
   Debug readout (uncomment in partial HTML when needed)
   ====================================================================================================== */

.page-mamadex-mamas .dimensions {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  text-align: center;
  color: rgba(241, 245, 249, 0.86);
}

.page-mamadex-mamas .dimensions-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ======================================================================================================
   Media queries
   ====================================================================================================== */

@media (max-width: 720px) {
  /* Top-align the stacked column so the title sits below the site header and is never clipped at
     the top (the map takes the remaining height, computed in the map JS). */
  .page-mamadex-mamas .hero-mamadex-map .hero-inner {
    justify-content: flex-start;
    padding-top: 0.85rem;
  }
  .page-mamadex-mamas .hero-mamadex-map .hero-title {
    padding: 0 0.25rem;
  }
  .page-mamadex-mamas .hero-mamadex-map .hero-title .headline {
    font-size: 1.75rem;
  }
  .page-mamadex-mamas .hero-mamadex-map .hero-title .tagline {
    font-size: var(--body);
  }
  .page-mamadex-mamas .hero-mamadex-map .map-instruction {
    font-size: 0.75rem;
  }
}
