/* ============================================================
   KULAMBOGAN LGU — Tourism Portal Brand Design System
   ============================================================
   Ported from the canonical kulambogan LGU brand pack
   (lguMargos/brand/styles.css). Deep-navy field, Philippine
   sun gold accent, anti-AI-slop hero composition: every visual
   choice mirrors the official municipal seal — navy interior,
   gold rim, crescent + 3 stars + book + waves of Dumanquillas Bay.
   ============================================================ */

:root {
  --m-navy-900: #050d24;
  --m-navy-800: #0a1f44;
  --m-navy-700: #112a5e;
  --m-navy-600: #1e3a8a;
  --m-navy-500: #2b4ea8;
  --m-gold-500: #fbbf24;
  --m-gold-400: #fcd34d;
  --m-gold-600: #f59e0b;
  --m-gold-300: #fde68a;
  --m-ink-100:  #f1f5f9;
  --m-ink-200:  #e2e8f0;
  --m-ink-400:  #94a3b8;
  --m-ink-600:  #475569;
  --m-white:    #ffffff;

  --m-shadow-soft: 0 10px 30px rgba(5, 13, 36, 0.18);
  --m-shadow-card: 0 20px 50px rgba(5, 13, 36, 0.32);
  --m-shadow-glow: 0 0 40px rgba(251, 191, 36, 0.25);

  --m-r-sm: 8px;
  --m-r-md: 14px;
  --m-r-lg: 22px;
  --m-r-xl: 32px;

  --m-font-head: 'Poppins', system-ui, sans-serif;
  --m-font-body: 'Inter',   system-ui, sans-serif;
  --m-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   App shell — scoped to .margos-shell so the rest of the
   tourism portal (Pagadian default) is unaffected.
   ============================================================ */
.margos-shell {
  font-family: var(--m-font-body);
  color: var(--m-ink-100);
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(30, 58, 138, 0.45), transparent 60%),
    radial-gradient(900px  500px at 10% 100%, rgba(251, 191, 36, 0.08), transparent 60%),
    linear-gradient(180deg, var(--m-navy-900) 0%, var(--m-navy-800) 30%, var(--m-navy-900) 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.margos-shell * { box-sizing: border-box; }

.margos-shell h1, .margos-shell h2, .margos-shell h3,
.margos-shell h4, .margos-shell h5 {
  font-family: var(--m-font-head);
  font-weight: 600;
  margin: 0;
  letter-spacing: 0;
  line-height: 1.15;
}

.margos-shell a { color: inherit; text-decoration: none; }

/* Particle canvas — fixed behind the content, ignores pointer events. */
.margos-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
  pointer-events: none;
}

.margos-main { position: relative; z-index: 5; }

/* ============================================================
   Top bar + nav
   ============================================================ */
.m-topbar {
  position: relative;
  z-index: 10;
  background: rgba(5, 13, 36, 0.82);
  color: rgba(241, 245, 249, 0.78);
  font-size: 12px;
  padding: 8px 24px;
  display: flex; gap: 18px; flex-wrap: wrap; justify-content: space-between;
  border-bottom: 1px solid rgba(251, 191, 36, 0.12);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}
.m-topbar a { color: var(--m-gold-400); }
.m-topbar a:hover { color: var(--m-white); }
/* Persistent "Back to Portal" pill in the topbar — same on every tourism
   page so users always know how to return to the unified portal landing. */
.m-portal-back {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.32);
  color: var(--m-gold-400) !important;
  font-weight: 600; font-size: 11px; letter-spacing: 0.04em;
  transition: background 200ms, border-color 200ms, color 200ms, transform 200ms;
}
.m-portal-back:hover {
  background: rgba(251, 191, 36, 0.22);
  border-color: rgba(251, 191, 36, 0.6);
  color: var(--m-white) !important;
  transform: translateX(-2px);
}

.m-nav {
  position: sticky; top: 0; z-index: 50;
  padding: 16px 24px;
  background: rgba(5, 13, 36, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(251, 191, 36, 0.15);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.m-brand { display: flex; align-items: center; gap: 14px; }
.m-brand img {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--m-white);
  padding: 2px;
  box-shadow: 0 6px 18px rgba(251, 191, 36, 0.25), 0 0 0 1px rgba(251, 191, 36, 0.4);
}
.m-brand-text { line-height: 1.15; }
.m-brand-text .b1 { font-family: var(--m-font-head); font-weight: 700; font-size: 16px; color: var(--m-white); letter-spacing: 0.01em; }
.m-brand-text .b2 { font-size: 10.5px; color: var(--m-gold-400); letter-spacing: 0.18em; text-transform: uppercase; margin-top: 2px; }

/* Nav links — sized to fit the full 11-item kulambogan tourism nav
   (Home, Sites, 3D Map, Trails, Events, Stay, Safety, Guide, Trip Planner,
   Directory, About) + brand + Ask kulambogan CTA on a 1440px viewport
   without wrapping. Below 1280px the icons hide; below 1100px the nav
   wraps to a second row. */
.m-nav-links { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; justify-content: center; min-width: 0; }
.m-nav-link {
  position: relative;
  padding: 8px 10px;
  font-size: 13px; font-weight: 500;
  color: rgba(241, 245, 249, 0.78);
  border-radius: 8px;
  transition: color 200ms, background 200ms;
  white-space: nowrap;
}
.m-nav-link i { margin-right: 5px; opacity: 0.85; font-size: 0.92em; }
.m-nav-link::after {
  content: ''; position: absolute;
  left: 10px; right: 10px; bottom: 3px; height: 2px;
  background: linear-gradient(90deg, var(--m-gold-500), var(--m-gold-400));
  transform: scaleX(0); transform-origin: left;
  transition: transform 300ms var(--m-ease-out);
  border-radius: 2px;
}
.m-nav-link:hover, .m-nav-link.active { color: var(--m-white); }
.m-nav-link:hover::after, .m-nav-link.active::after { transform: scaleX(1); }
@media (max-width: 1280px) {
  .m-nav-link i { display: none; }
  .m-nav-link { padding: 8px 9px; }
}
@media (max-width: 1100px) {
  .m-nav { flex-wrap: wrap; }
  .m-nav-links { order: 3; width: 100%; justify-content: flex-start; padding-top: 8px; border-top: 1px solid rgba(251,191,36,0.12); }
}

.m-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px;
  background: linear-gradient(135deg, var(--m-gold-500), var(--m-gold-600));
  color: var(--m-navy-900);
  font-weight: 700; font-size: 13px; letter-spacing: 0.02em;
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3);
  transition: transform 200ms, box-shadow 200ms;
  border: 0; cursor: pointer;
}
.m-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(251, 191, 36, 0.45); }
.m-cta.ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--m-white);
  border: 1px solid rgba(251, 191, 36, 0.35);
  box-shadow: none;
}
.m-cta.ghost:hover { background: rgba(251, 191, 36, 0.1); }

/* ============================================================
   Tourism command center - kulambogan first viewport.
   ============================================================ */
.m-command + .m-hero,
.m-command + .m-hero + .m-kpi { display: none; }
.m-command {
  position: relative; z-index: 8;
  min-height: 760px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  padding: 24px;
  background:
    radial-gradient(800px 360px at 80% 10%, rgba(20, 184, 166, 0.22), transparent 62%),
    radial-gradient(700px 360px at 18% 84%, rgba(251, 191, 36, 0.14), transparent 64%),
    linear-gradient(145deg, rgba(4, 10, 31, 0.98), rgba(10, 31, 68, 0.94));
  border-bottom: 1px solid rgba(251, 191, 36, 0.18);
}
.m-command-rail {
  min-height: 710px;
  display: flex; flex-direction: column; gap: 18px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(7, 20, 48, 0.96), rgba(5, 13, 36, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.m-command-brand {
  display: flex; align-items: center; gap: 12px; min-height: 72px;
}
.m-command-brand img {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--m-white); padding: 3px;
}
.m-command-brand strong {
  display: block; font-family: var(--m-font-head); font-size: 17px; color: var(--m-white);
}
.m-command-brand small {
  display: block; margin-top: 3px; color: var(--m-gold-400);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
}
.m-command-menu { display: grid; gap: 8px; }
.m-command-menu a {
  min-height: 42px;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(241, 245, 249, 0.78);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 700; font-size: 13px;
}
.m-command-menu a:hover,
.m-command-menu a.active {
  color: var(--m-navy-900);
  background: linear-gradient(135deg, var(--m-gold-400), var(--m-gold-600));
  border-color: rgba(251, 191, 36, 0.65);
}
.m-command-menu i { width: 20px; text-align: center; }
.m-command-office {
  margin-top: auto;
  display: grid; gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(20, 184, 166, 0.08);
  border: 1px solid rgba(94, 234, 212, 0.22);
}
.m-command-office img {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover;
  border-radius: 6px; background: var(--m-white);
}
.m-command-office strong { color: var(--m-white); font-size: 13px; }
.m-command-office span { color: rgba(226, 232, 240, 0.72); font-size: 12px; line-height: 1.4; }
.m-command-workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
}
.m-command-hero {
  min-height: 280px;
  position: relative;
  display: flex; align-items: end; justify-content: space-between; gap: 20px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  background-size: cover; background-position: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.m-command-hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 13, 36, 0.92) 0%, rgba(5, 13, 36, 0.68) 44%, rgba(5, 13, 36, 0.22) 100%),
    linear-gradient(0deg, rgba(5, 13, 36, 0.72), transparent 58%);
  z-index: 1;
}
.m-command-copy,
.m-command-portal-card { position: relative; z-index: 2; }
.m-command-copy { max-width: 740px; padding: 32px; }
.m-command-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--m-gold-400);
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 14px;
}
.m-command-copy h1 {
  font-size: 44px; line-height: 1.05; color: var(--m-white); margin-bottom: 14px;
}
.m-command-copy p {
  max-width: 680px; color: rgba(241, 245, 249, 0.86);
  font-size: 17px; line-height: 1.55;
}
.m-command-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.m-command-portal-card {
  align-self: start; margin: 20px; min-width: 245px;
  display: grid; grid-template-columns: 44px 1fr; column-gap: 10px; row-gap: 2px; align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.m-command-portal-card img {
  grid-row: span 2; width: 44px; height: 44px; border-radius: 50%;
  background: var(--m-white); padding: 2px;
}
.m-command-portal-card span { color: rgba(241, 245, 249, 0.82); font-size: 12px; }
.m-command-portal-card strong { color: var(--m-white); font-size: 14px; }
.m-command-kpis {
  display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 10px;
}
.m-command-kpi {
  min-height: 96px;
  display: grid; grid-template-columns: 38px 1fr; grid-template-rows: auto auto;
  column-gap: 10px; align-items: center;
  padding: 12px;
  background: linear-gradient(135deg, rgba(253, 230, 138, 0.92), rgba(94, 234, 212, 0.58));
  color: var(--m-navy-900);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
}
.m-command-kpi i {
  grid-row: span 2; width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 8px; background: rgba(5, 13, 36, 0.12);
}
.m-command-kpi strong { font-family: var(--m-font-head); font-size: 27px; line-height: 1; }
.m-command-kpi span { font-size: 12px; line-height: 1.2; font-weight: 800; }
.m-command-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  grid-auto-rows: minmax(210px, auto);
  gap: 12px;
}
.m-map-panel,
.m-feature-panel,
.m-brief-panel {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.18);
  background: rgba(10, 31, 68, 0.82);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}
.m-map-panel { grid-row: span 2; min-height: 430px; }
.m-panel-head {
  min-height: 52px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  color: var(--m-white);
  border-bottom: 1px solid rgba(251, 191, 36, 0.14);
  font-weight: 800;
}
.m-panel-head a { color: var(--m-gold-400); font-size: 12px; font-weight: 800; }
.m-map-board {
  position: relative; height: 378px;
  background: linear-gradient(135deg, #67e8f9 0%, #5eead4 38%, #fcd34d 38%, #f7c56d 68%, #6aa84f 68%, #2f6b45 100%);
}
.m-map-water {
  position: absolute; left: 28px; bottom: 28px;
  color: rgba(5, 13, 36, 0.68);
  font-family: var(--m-font-head); font-weight: 800;
}
.m-map-land {
  position: absolute; inset: 22px;
  border-radius: 46% 54% 50% 50%;
  background:
    radial-gradient(circle at 64% 28%, rgba(255, 255, 255, 0.32), transparent 8%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.02));
  border: 2px solid rgba(255, 255, 255, 0.42);
}
.m-map-label {
  position: absolute;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--m-navy-900);
  background: rgba(255, 255, 255, 0.78);
  font-weight: 900; font-size: 12px;
}
.m-map-label.town { left: 54%; top: 55%; }
.m-map-label.coast { left: 10%; top: 20%; }
.m-map-road {
  position: absolute; height: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  transform-origin: left center;
}
.m-map-road.r1 { left: 22%; top: 58%; width: 60%; transform: rotate(-10deg); }
.m-map-road.r2 { left: 36%; top: 42%; width: 42%; transform: rotate(24deg); }
.m-map-pin {
  position: absolute;
  display: flex; align-items: center; gap: 6px;
  color: var(--m-navy-900);
  font-weight: 900; font-size: 12px;
}
.m-map-pin i {
  color: #0f766e; font-size: 24px;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.24));
}
.m-map-pin span {
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--m-navy-900);
  border-radius: 6px;
}
.m-map-pin.p1 { left: 18%; top: 31%; }
.m-map-pin.p2 { left: 39%; top: 22%; }
.m-map-pin.p3 { left: 66%; top: 37%; }
.m-map-pin.p4 { left: 57%; top: 60%; }
.m-feature-panel { position: relative; min-height: 270px; }
.m-feature-panel img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.m-feature-panel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 13, 36, 0.9) 74%);
}
.m-feature-copy {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 22px;
}
.m-feature-copy span {
  display: inline-block;
  color: var(--m-navy-900); background: var(--m-gold-400);
  padding: 5px 9px; border-radius: 6px;
  font-size: 11px; font-weight: 900; text-transform: uppercase;
}
.m-feature-copy h2 { margin-top: 10px; color: var(--m-white); font-size: 28px; }
.m-feature-copy p {
  max-width: 520px; color: rgba(241, 245, 249, 0.88);
  line-height: 1.45; margin: 8px 0 12px;
}
.m-feature-copy a { color: var(--m-gold-400); font-weight: 800; }
.m-brief-panel { padding-bottom: 10px; }
.m-brief-panel ul {
  list-style: none;
  padding: 0 16px 12px;
  margin: 0;
  display: grid; gap: 10px;
}
.m-brief-panel li {
  display: grid; gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.m-brief-panel li:last-child { border-bottom: 0; }
.m-brief-panel strong { color: var(--m-gold-400); font-size: 13px; }
.m-brief-panel span { color: rgba(226, 232, 240, 0.74); font-size: 13px; line-height: 1.45; }

/* ============================================================
   Hero — cinematic navy field, glowing seal, wave divider.
   ============================================================ */
.m-hero {
  position: relative;
  min-height: 88vh;
  padding: 80px 32px 120px;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(30, 58, 138, 0.55), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(5, 13, 36, 0.95), transparent 70%),
    url('/assets/images/margos-hero-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}
.m-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(5, 13, 36, 0.3) 0%, rgba(5, 13, 36, 0.7) 100%);
  z-index: 1; pointer-events: none;
}
.m-hero-inner {
  position: relative; z-index: 3;
  max-width: 920px; margin: 0 auto;
}
.m-seal-wrap {
  position: relative;
  width: 200px; height: 200px;
  margin: 0 auto 32px;
}
.m-seal-wrap img {
  position: relative; z-index: 3;
  width: 180px; height: 180px; border-radius: 50%;
  background: var(--m-white);
  padding: 4px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(251, 191, 36, 0.45);
  display: block;
  margin: 10px auto;
}
.m-seal-glow {
  position: absolute; inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(251, 191, 36, 0.3);
  animation: m-sealRing 4s ease-in-out infinite;
}
.m-seal-glow.r2 {
  inset: -28px;
  border-color: rgba(251, 191, 36, 0.15);
  animation-delay: 1.5s;
}
@keyframes m-sealRing {
  0%, 100% { transform: scale(1);   opacity: 0.7; }
  50%      { transform: scale(1.08); opacity: 1;   }
}
.m-hero-eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--m-gold-400);
  background: rgba(251, 191, 36, 0.1);
  padding: 6px 16px; border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  margin-bottom: 22px;
}
.m-hero-title {
  font-family: var(--m-font-head);
  font-weight: 700;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.05; letter-spacing: 0;
  color: var(--m-white);
  margin-bottom: 18px;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.m-hero-title .gold {
  background: linear-gradient(180deg, var(--m-gold-300), var(--m-gold-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.m-hero-sub {
  font-size: 17px; line-height: 1.55;
  color: rgba(226, 232, 240, 0.86);
  max-width: 62ch; margin: 0 auto 32px;
}
.m-hero-ctas {
  display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}

/* Animated wave divider at the bottom of the hero. */
.m-wave-divider {
  position: absolute; left: 0; right: 0; bottom: -1px;
  height: 120px; z-index: 4;
  pointer-events: none;
}
.m-wave-divider svg { width: 100%; height: 100%; display: block; }
.m-wave-path-1 { animation: m-waveShift1 14s ease-in-out infinite; transform-origin: center; }
.m-wave-path-2 { animation: m-waveShift2 18s ease-in-out infinite; transform-origin: center; }
.m-wave-line   { animation: m-waveShift1 10s ease-in-out infinite; }
.m-wave-pulse  { animation: m-pulseDot 2.2s ease-in-out infinite; filter: drop-shadow(0 0 6px var(--m-gold-500)); }
@keyframes m-waveShift1 { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-20px); } }
@keyframes m-waveShift2 { 0%,100% { transform: translateX(0); } 50% { transform: translateX(24px); } }
@keyframes m-pulseDot    { 0%,100% { opacity: 0.6; r: 3; } 50% { opacity: 1; r: 4.5; } }

/* ============================================================
   KPI strip — gold-trimmed cards floating on navy.
   ============================================================ */
.m-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px; max-width: 1200px;
  margin: -60px auto 80px; padding: 0 24px;
  position: relative; z-index: 6;
}
.m-kpi-card {
  background: linear-gradient(155deg, rgba(17, 42, 94, 0.85), rgba(10, 31, 68, 0.95));
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: var(--m-r-md);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--m-shadow-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 280ms var(--m-ease-out), border-color 280ms;
}
.m-kpi-card:hover { transform: translateY(-4px); border-color: rgba(251, 191, 36, 0.45); }
.m-kpi-icon {
  width: 44px; height: 44px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--m-gold-500), var(--m-gold-600));
  color: var(--m-navy-900);
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}
.m-kpi-value {
  font-family: var(--m-font-head);
  font-size: 28px; font-weight: 800;
  color: var(--m-white);
  line-height: 1;
}
.m-kpi-label {
  font-size: 11px; color: var(--m-gold-400);
  text-transform: uppercase; letter-spacing: 0.14em;
  margin-top: 4px;
}

/* ============================================================
   Section base
   ============================================================ */
.m-section { max-width: 1200px; margin: 0 auto; padding: 80px 24px; position: relative; z-index: 5; }
.m-section-head { text-align: center; margin-bottom: 56px; }
.m-section-head.left { text-align: left; }
.m-eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--m-gold-400);
}
.m-eyebrow::before { content: ''; width: 28px; height: 1px; background: var(--m-gold-500); }
.m-section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700; margin: 16px 0 14px;
  background: linear-gradient(180deg, #fff, #cfd9ee);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.m-section-lead {
  font-size: 16px; line-height: 1.6;
  color: rgba(226, 232, 240, 0.7);
  max-width: 640px; margin: 0 auto;
}

/* ============================================================
   Reveal-on-scroll — graceful: visible by default (no-JS users
   + screenshot tools see everything). Only when <html> has
   .m-js-ready (added by JS as soon as it boots) do we hide
   elements pending intersection-observer reveal.
   ============================================================ */
.m-reveal {
  transition: opacity 800ms var(--m-ease-out), transform 800ms var(--m-ease-out);
}
html.m-js-ready .m-reveal:not(.in) {
  opacity: 0;
  transform: translateY(28px);
}
.m-reveal.in { opacity: 1; transform: none; }
.m-reveal.d-1 { transition-delay:  80ms; }
.m-reveal.d-2 { transition-delay: 160ms; }
.m-reveal.d-3 { transition-delay: 240ms; }
.m-reveal.d-4 { transition-delay: 320ms; }
.m-reveal.d-5 { transition-delay: 400ms; }

/* ============================================================
   Tourism / Sites tile grid — uses inline SVG scenes from
   margos-scenes.js as background images (cinematic, brand-aligned).
   ============================================================ */
.m-tiles {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(180px, auto);
  gap: 16px;
}
.m-tile {
  position: relative;
  border-radius: var(--m-r-lg);
  overflow: hidden;
  background: var(--m-navy-800);
  border: 1px solid rgba(251, 191, 36, 0.12);
  transition: transform 380ms var(--m-ease-out), border-color 280ms, box-shadow 380ms;
  min-height: 220px;
  text-decoration: none;
  color: var(--m-white);
}
.m-tile:hover { transform: translateY(-4px); border-color: rgba(251, 191, 36, 0.45); box-shadow: var(--m-shadow-card); }
.m-tile-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform 800ms var(--m-ease-out);
}
.m-tile:hover .m-tile-bg { transform: scale(1.06); }
.m-tile-info {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 20px 22px;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 13, 36, 0.85) 60%, rgba(5, 13, 36, 0.96) 100%);
  z-index: 2;
}
.m-tile-tag {
  display: inline-block;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--m-gold-400);
  background: rgba(251, 191, 36, 0.12);
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  margin-bottom: 10px;
}
.m-tile-info h4 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.m-tile-info p { font-size: 13px; color: rgba(241, 245, 249, 0.78); line-height: 1.5; }

/* Tile spans (12-col grid) */
.m-tile.span-6 { grid-column: span 6; }
.m-tile.span-4 { grid-column: span 4; }
.m-tile.span-3 { grid-column: span 3; }
.m-tile.row-2  { grid-row: span 2; }

@media (max-width: 960px) {
  .m-tile.span-6, .m-tile.span-4, .m-tile.span-3 { grid-column: span 12; }
  .m-tile.row-2 { grid-row: auto; }
}

/* ============================================================
   Event / list cards
   ============================================================ */
.m-event {
  background: linear-gradient(155deg, rgba(17, 42, 94, 0.6), rgba(10, 31, 68, 0.85));
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: var(--m-r-md);
  padding: 18px 20px;
  display: grid; grid-template-columns: 78px 1fr auto; gap: 16px; align-items: center;
  transition: border-color 220ms, transform 280ms var(--m-ease-out);
  color: var(--m-ink-100);
  text-decoration: none;
}
.m-event:hover { border-color: rgba(251, 191, 36, 0.45); transform: translateY(-3px); }
.m-event-date {
  background: linear-gradient(155deg, var(--m-gold-500), var(--m-gold-600));
  color: var(--m-navy-900);
  border-radius: var(--m-r-sm);
  padding: 12px 8px;
  text-align: center;
  box-shadow: 0 6px 16px rgba(251, 191, 36, 0.3);
}
.m-event-date strong { display: block; font-family: var(--m-font-head); font-weight: 800; font-size: 26px; line-height: 1; }
.m-event-date span { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 4px; opacity: 0.85; }
.m-event-body strong { display: block; font-family: var(--m-font-head); font-size: 16px; font-weight: 700; }
.m-event-body small  { display: block; font-size: 13px; color: var(--m-ink-400); margin-top: 4px; }
.m-event-cta { color: var(--m-gold-400); font-weight: 600; font-size: 13px; }

/* ============================================================
   Generic card / accommodation list
   ============================================================ */
.m-card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.m-card {
  background: linear-gradient(155deg, rgba(17, 42, 94, 0.55), rgba(10, 31, 68, 0.78));
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: var(--m-r-md);
  padding: 20px;
  color: var(--m-ink-100);
  transition: transform 280ms var(--m-ease-out), border-color 280ms;
}
.m-card:hover { transform: translateY(-3px); border-color: rgba(251, 191, 36, 0.4); }
.m-card-type {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--m-navy-900); background: var(--m-gold-400);
  padding: 4px 10px; border-radius: 999px;
}
.m-card h4 { font-size: 17px; font-weight: 700; margin: 10px 0 6px; color: var(--m-white); }
.m-card p  { font-size: 13.5px; color: rgba(226, 232, 240, 0.75); line-height: 1.55; }
.m-card-with-media { padding: 0; overflow: hidden; }
.m-card-with-media .m-card-type,
.m-card-with-media h4,
.m-card-with-media p,
.m-card-with-media div:not(.m-card-media-wrap) { margin-left: 18px; margin-right: 18px; }
.m-card-with-media .m-card-type { margin-top: 18px; }
.m-card-with-media > div:last-child { margin-bottom: 18px; }
.m-card-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(251, 191, 36, 0.14);
}

/* Empty state */
.m-empty {
  text-align: center; padding: 40px 16px;
  color: var(--m-ink-400);
  border: 1px dashed rgba(251, 191, 36, 0.25);
  border-radius: var(--m-r-md);
  background: rgba(10, 31, 68, 0.35);
}
.m-empty i { font-size: 36px; color: var(--m-gold-500); opacity: 0.55; margin-bottom: 12px; display: block; }

/* ============================================================
   Research-backed municipal study views
   ============================================================ */
.m-study-grid,
.m-service-grid,
.m-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}
.m-study-card,
.m-service-card,
.m-source-card,
.m-culture-card,
.m-barangay-card,
.m-timeline-item {
  border: 1px solid rgba(251, 191, 36, 0.16);
  border-radius: 8px;
  background: linear-gradient(155deg, rgba(17, 42, 94, 0.55), rgba(10, 31, 68, 0.82));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}
.m-study-card {
  min-height: 270px;
  padding: 22px;
  display: grid;
  align-content: start;
  gap: 10px;
}
.m-study-icon,
.m-service-card > i,
.m-culture-card > i {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--m-gold-500), var(--m-gold-600));
  color: var(--m-navy-900);
  box-shadow: 0 8px 22px rgba(251, 191, 36, 0.24);
}
.m-study-meta {
  color: var(--m-gold-400);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.m-study-card strong {
  color: var(--m-white);
  font-family: var(--m-font-head);
  font-size: 28px;
  line-height: 1;
}
.m-study-card h3,
.m-service-card h3,
.m-culture-card h3,
.m-timeline-item h3 {
  color: var(--m-white);
  font-size: 17px;
}
.m-study-card p,
.m-service-card p,
.m-culture-card p,
.m-timeline-item p,
.m-source-card p {
  color: rgba(226, 232, 240, 0.74);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
}
.m-atlas-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.m-atlas-summary > div {
  min-height: 96px;
  padding: 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, rgba(253, 230, 138, 0.92), rgba(94, 234, 212, 0.58));
  color: var(--m-navy-900);
}
.m-atlas-summary strong {
  display: block;
  font-family: var(--m-font-head);
  font-size: 30px;
  line-height: 1;
}
.m-atlas-summary span {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}
.m-barangay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.m-barangay-card {
  padding: 14px;
  display: grid;
  gap: 10px;
}
.m-barangay-card div:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
}
.m-barangay-card span {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(251, 191, 36, 0.16);
  color: var(--m-gold-400);
  font-size: 11px;
  font-weight: 900;
}
.m-barangay-card strong {
  color: var(--m-white);
  font-size: 14px;
}
.m-barangay-card b {
  color: var(--m-gold-400);
  font-family: var(--m-font-head);
  font-size: 24px;
}
.m-pop-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.m-pop-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--m-gold-500), #5eead4);
}
.m-barangay-card small {
  color: rgba(226, 232, 240, 0.62);
  font-size: 11.5px;
}
.m-heritage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 18px;
}
.m-timeline,
.m-culture-grid {
  display: grid;
  gap: 12px;
}
.m-timeline-item {
  padding: 18px 20px;
  border-left: 3px solid var(--m-gold-500);
}
.m-timeline-item span,
.m-service-card span {
  width: max-content;
  color: var(--m-navy-900);
  background: var(--m-gold-400);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 900;
}
.m-timeline-item span {
  display: inline-flex;
  margin-bottom: 10px;
}
.m-culture-card,
.m-service-card {
  padding: 20px;
  display: grid;
  gap: 12px;
}
.m-source-card {
  padding: 18px;
  display: grid;
  gap: 10px;
  color: var(--m-ink-100);
  transition: transform 280ms var(--m-ease-out), border-color 280ms;
}
.m-source-card:hover {
  transform: translateY(-3px);
  border-color: rgba(251, 191, 36, 0.42);
}
.m-source-card span,
.m-source-card small {
  color: var(--m-gold-400);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.m-source-card strong {
  color: var(--m-white);
  font-family: var(--m-font-head);
  font-size: 16px;
}

/* ============================================================
   Footer
   ============================================================ */
.m-footer {
  background: linear-gradient(180deg, var(--m-navy-900), #000);
  color: rgba(226, 232, 240, 0.78);
  padding: 80px 24px 32px;
  margin-top: 80px;
  border-top: 1px solid rgba(251, 191, 36, 0.18);
  position: relative; z-index: 5;
}
.m-footer-grid { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.m-footer h5 { color: var(--m-gold-400); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; margin-bottom: 16px; }
.m-footer p, .m-footer a, .m-footer li { font-size: 13.5px; line-height: 1.7; color: rgba(226, 232, 240, 0.7); }
.m-footer a:hover { color: var(--m-white); }
.m-footer ul { list-style: none; padding: 0; margin: 0; }
.m-footer-bottom { max-width: 1200px; margin: 40px auto 0; padding-top: 24px; border-top: 1px solid rgba(251, 191, 36, 0.12); font-size: 12px; color: rgba(226, 232, 240, 0.5); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

@media (max-width: 768px) {
  .m-atlas-summary,
  .m-heritage-layout { grid-template-columns: 1fr; }
  .m-footer-grid { grid-template-columns: 1fr; }
  .m-nav { flex-wrap: wrap; }
  .m-nav-links { order: 3; width: 100%; justify-content: center; }
}

@media (max-width: 1180px) {
  .m-command { grid-template-columns: 1fr; }
  .m-command-rail { min-height: auto; }
  .m-command-menu { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
  .m-command-office { display: none; }
  .m-command-kpis { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
}
@media (max-width: 840px) {
  .m-command { padding: 14px; }
  .m-command-menu { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .m-command-hero { min-height: 390px; align-items: stretch; flex-direction: column; justify-content: end; }
  .m-command-copy { padding: 24px; }
  .m-command-copy h1 { font-size: 34px; }
  .m-command-copy p { font-size: 15px; }
  .m-command-portal-card { align-self: stretch; margin: 0 18px 18px; min-width: 0; }
  .m-command-kpis { grid-template-columns: repeat(2, minmax(130px, 1fr)); }
  .m-command-grid { grid-template-columns: 1fr; }
  .m-map-panel { grid-row: auto; }
}
@media (max-width: 560px) {
  .m-command { padding: 10px; }
  .m-command-rail { padding: 14px; }
  .m-command-menu { grid-template-columns: 1fr; }
  .m-command-copy h1 { font-size: 28px; }
  .m-command-actions .m-cta { width: 100%; justify-content: center; }
  .m-command-kpis { grid-template-columns: 1fr; }
  .m-map-board { height: 330px; }
  .m-map-pin span,
  .m-map-label { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .m-seal-glow, .m-wave-path-1, .m-wave-path-2, .m-wave-line, .m-wave-pulse,
  .m-tile-bg, .m-tile, .m-event, .m-kpi-card, .m-card { animation: none !important; transition: none !important; }
}
