/* ============================================================
   MIDSALIP LGU — Tourism Portal Brand Design System
   ============================================================
   Ported from the canonical Midsalip LGU brand pack
   (lguMidsalip/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 Dumanquilas 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 .midsalip-shell so the rest of the
   tourism portal (Pagadian default) is unaffected.
   ============================================================ */
.midsalip-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;
}

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

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

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

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

.midsalip-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 Midsalip tourism nav
   (Home, Sites, 3D Map, Trails, Events, Stay, Safety, Guide, Trip Planner,
   Directory, About) + brand + Ask Midsalip 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); }

/* ============================================================
   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/midsalip-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.02em;
  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
   midsalip-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; }

/* 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; }

/* ============================================================
   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-footer-grid { grid-template-columns: 1fr; }
  .m-nav { flex-wrap: wrap; }
  .m-nav-links { order: 3; width: 100%; justify-content: center; }
}

@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; }
}
