/**
 * Geo Tokens - CSS Custom Properties for Map Visual Atoms
 *
 * These tokens define the visual styling for the Nigeria terrain map,
 * including contours, boundaries, terrain fills, labels, and cultural overlays.
 *
 * Organized by visual atom type as defined in the M1 spec:
 * - A1. Contour (elevation lines)
 * - A2. Boundary (admin boundaries)
 * - A3. Terrain (elevation fills)
 * - A4. Label (typography)
 * - A5. Marker (point symbols)
 * - A6. Ethnicity Fill (region identification)
 * - A7. Motif Slot (cultural pattern overlays)
 */

:root {
  /* =========================================================================
   * A1. CONTOUR TOKENS
   * Elevation line styling for topographic contours
   * ========================================================================= */

  /* Major contours (every 500m) */
  --geo-contour-major-stroke: var(--heritage-earth-600, #6b3a0f);
  --geo-contour-major-width: 1.5px;
  --geo-contour-major-opacity: 0.7;

  /* Minor contours (every 100m) */
  --geo-contour-minor-stroke: var(--heritage-earth-400, #a66b3d);
  --geo-contour-minor-width: 0.75px;
  --geo-contour-minor-opacity: 0.5;

  /* Index contours (labeled elevation) */
  --geo-contour-index-stroke: var(--heritage-earth-700, #4a2808);
  --geo-contour-index-width: 2px;
  --geo-contour-index-opacity: 0.8;

  /* =========================================================================
   * A2. BOUNDARY TOKENS
   * Administrative boundary hierarchy
   * ========================================================================= */

  /* National boundary */
  --geo-boundary-national-stroke: var(--heritage-indigo-900, #0d0d3a);
  --geo-boundary-national-width: 3px;
  --geo-boundary-national-dash: none;
  --geo-boundary-national-opacity: 1;

  /* State boundary */
  --geo-boundary-state-stroke: var(--heritage-indigo-600, #2a2a8f);
  --geo-boundary-state-width: 1.5px;
  --geo-boundary-state-dash: 8 4;
  --geo-boundary-state-opacity: 0.8;

  /* LGA boundary (future) */
  --geo-boundary-lga-stroke: var(--heritage-indigo-400, #5050b0);
  --geo-boundary-lga-width: 0.75px;
  --geo-boundary-lga-dash: 4 4;
  --geo-boundary-lga-opacity: 0.6;

  /* =========================================================================
   * A3. TERRAIN TOKENS
   * Elevation band fills for terrain visualization
   * ========================================================================= */

  /* Lowland (0-200m) */
  --geo-terrain-lowland-fill: #e8f4e8;
  --geo-terrain-lowland-opacity: 0.6;

  /* Midland (200-500m) */
  --geo-terrain-midland-fill: #c8e0c0;
  --geo-terrain-midland-opacity: 0.6;

  /* Highland (500-1000m) */
  --geo-terrain-highland-fill: #a8c8a0;
  --geo-terrain-highland-opacity: 0.6;

  /* Peak (1000m+) */
  --geo-terrain-peak-fill: #88a880;
  --geo-terrain-peak-opacity: 0.7;

  /* Hillshade overlay */
  --geo-terrain-hillshade-light-opacity: 0.15;
  --geo-terrain-hillshade-shadow-opacity: 0.12;

  /* =========================================================================
   * A4. LABEL TOKENS
   * Typography hierarchy for map labels
   * ========================================================================= */

  /* Region labels (states, major areas) */
  --geo-label-region-size: 14px;
  --geo-label-region-weight: 600;
  --geo-label-region-color: var(--joinbody-ink-800, #1a1a1a);
  --geo-label-region-transform: uppercase;
  --geo-label-region-letter-spacing: 0.1em;

  /* Feature labels (heritage sites, monarch seats) */
  --geo-label-feature-size: 12px;
  --geo-label-feature-weight: 500;
  --geo-label-feature-color: var(--joinbody-ink-700, #2a2a2a);
  --geo-label-feature-transform: none;

  /* City labels */
  --geo-label-city-size: 11px;
  --geo-label-city-weight: 400;
  --geo-label-city-color: var(--joinbody-ink-600, #4a4a4a);
  --geo-label-city-transform: none;

  /* Elevation labels (contour numbers) */
  --geo-label-elevation-size: 9px;
  --geo-label-elevation-weight: 400;
  --geo-label-elevation-color: var(--heritage-earth-600, #6b3a0f);

  /* =========================================================================
   * A5. MARKER TOKENS
   * Point feature marker styling
   * ========================================================================= */

  /* Heritage site marker */
  --geo-marker-heritage-fill: var(--heritage-gold-500, #d4af37);
  --geo-marker-heritage-stroke: var(--heritage-gold-700, #a68929);
  --geo-marker-heritage-size: 12px;

  /* Monarch seat marker */
  --geo-marker-monarchy-fill: var(--heritage-indigo-500, #3a3aaf);
  --geo-marker-monarchy-stroke: var(--heritage-indigo-700, #1a1a6e);
  --geo-marker-monarchy-size: 14px;

  /* Slave trade port marker */
  --geo-marker-port-fill: var(--heritage-earth-500, #8b4513);
  --geo-marker-port-stroke: var(--heritage-earth-700, #4a2808);
  --geo-marker-port-size: 10px;

  /* General marker defaults */
  --geo-marker-stroke-width: 1.5px;
  --geo-marker-hover-scale: 1.2;

  /* =========================================================================
   * A6. ETHNICITY FILL TOKENS
   * Region identification colors and patterns (Phase 2)
   * ========================================================================= */

  /* Hausa region (geometric patterns inspired by Arewa architecture) */
  --geo-ethnicity-hausa-fill: rgba(26, 39, 68, 0.15);
  --geo-ethnicity-hausa-pattern: url('/patterns/scenic/hausa-zaure.svg');
  --geo-ethnicity-hausa-stroke: var(--heritage-indigo-400, #5050b0);

  /* Yoruba region (flowing patterns inspired by Adire) */
  --geo-ethnicity-yoruba-fill: rgba(107, 58, 15, 0.12);
  --geo-ethnicity-yoruba-pattern: url('/patterns/scenic/yoruba-adire.svg');
  --geo-ethnicity-yoruba-stroke: var(--heritage-earth-400, #a66b3d);

  /* Igbo region (organic patterns inspired by Uli) */
  --geo-ethnicity-igbo-fill: rgba(139, 58, 26, 0.12);
  --geo-ethnicity-igbo-pattern: url('/patterns/scenic/igbo-uli.svg');
  --geo-ethnicity-igbo-stroke: var(--heritage-earth-500, #8b4513);

  /* =========================================================================
   * A7. MOTIF SLOT TOKENS
   * Cultural pattern overlay opacity and blending
   * ========================================================================= */

  /* Adire motif (Yoruba) */
  --geo-motif-adire-opacity: 0.08;
  --geo-motif-adire-blend: multiply;

  /* Uli motif (Igbo) */
  --geo-motif-uli-opacity: 0.06;
  --geo-motif-uli-blend: multiply;

  /* Arewa motif (Hausa) */
  --geo-motif-arewa-opacity: 0.08;
  --geo-motif-arewa-blend: multiply;

  /* Universal motif (cross-cultural) */
  --geo-motif-universal-opacity: 0.05;
  --geo-motif-universal-blend: soft-light;

  /* =========================================================================
   * MAP FRAME TOKENS
   * Border and cartouche styling
   * ========================================================================= */

  --geo-frame-border-color: var(--heritage-indigo-200, #9090d0);
  --geo-frame-border-width: 2px;
  --geo-frame-corner-size: 48px;
  --geo-frame-cartouche-bg: var(--joinbody-cream-50, #fefdfb);

  /* =========================================================================
   * INTERACTIVE STATE TOKENS
   * Hover, focus, and active states
   * ========================================================================= */

  --geo-interactive-hover-opacity: 0.9;
  --geo-interactive-focus-ring: 2px solid var(--heritage-indigo-500, #3a3aaf);
  --geo-interactive-focus-offset: 2px;

  /* =========================================================================
   * PRINT TOKENS
   * Overrides for print media
   * ========================================================================= */

  --geo-print-min-stroke: 0.3pt;
  --geo-print-contour-opacity: 0.9;
  --geo-print-boundary-opacity: 1;
}

/* Print media overrides */
@media print {
  :root {
    --geo-contour-major-width: max(var(--geo-contour-major-width), var(--geo-print-min-stroke));
    --geo-contour-minor-width: max(var(--geo-contour-minor-width), var(--geo-print-min-stroke));
    --geo-contour-major-opacity: var(--geo-print-contour-opacity);
    --geo-contour-minor-opacity: var(--geo-print-contour-opacity);
    --geo-boundary-national-opacity: var(--geo-print-boundary-opacity);
    --geo-boundary-state-opacity: var(--geo-print-boundary-opacity);
  }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  :root {
    --geo-marker-hover-scale: 1;
  }
}

/* Culture-aware token overrides */
[data-culture="yoruba"] {
  --geo-motif-active-opacity: var(--geo-motif-adire-opacity);
  --geo-motif-active-blend: var(--geo-motif-adire-blend);
}

[data-culture="igbo"] {
  --geo-motif-active-opacity: var(--geo-motif-uli-opacity);
  --geo-motif-active-blend: var(--geo-motif-uli-blend);
}

[data-culture="hausa"] {
  --geo-motif-active-opacity: var(--geo-motif-arewa-opacity);
  --geo-motif-active-blend: var(--geo-motif-arewa-blend);
}

[data-culture="universal"] {
  --geo-motif-active-opacity: var(--geo-motif-universal-opacity);
  --geo-motif-active-blend: var(--geo-motif-universal-blend);
}
