/* Nixfriction Google Maps decks — shared mobile-first carousel */
:root {
  --navy: #0A2540;
  --navy-deep: #06182c;
  --amber: #e8a838;
  --amber-hot: #f5b942;
  --cream: #f7f4ef;
  --muted: #6b7c8f;
  --white: #ffffff;
  --chrome-h: 52px;
  --dots-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--navy-deep);
  color: var(--white);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  min-height: 100vh;
  padding-top: var(--safe-t);
  padding-bottom: var(--safe-b);
}

/* —— Chrome —— */
.deck-header {
  flex: 0 0 auto;
  height: var(--chrome-h);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0 0.75rem;
  background: var(--navy);
  border-bottom: 2px solid var(--amber);
  z-index: 20;
}

.deck-header .logo {
  height: 28px;
  width: auto;
  display: block;
}

.deck-header .titles {
  flex: 1;
  min-width: 0;
  line-height: 1.15;
}

.deck-header .eyebrow {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
}

.deck-header h1 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-label {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.deck-header .back-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.55rem;
  margin-right: 0.15rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 168, 56, 0.45);
  color: var(--cream);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
}

.deck-header .back-link:active,
.deck-header .back-link:hover {
  background: rgba(232, 168, 56, 0.18);
  border-color: var(--amber);
  color: var(--white);
}

@media (max-width: 380px) {
  .deck-header .logo { display: none; }
}


/* —— Stage —— */
.stage {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
  background: var(--navy-deep);
  touch-action: pan-y pinch-zoom;
}

.track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }

.slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  position: relative;
}

.slide figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.slide img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - var(--chrome-h) - var(--dots-h) - var(--safe-t) - var(--safe-b) - 1rem);
  max-height: calc(100vh - var(--chrome-h) - var(--dots-h) - 1rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  background: #fff;
  /* pinch-zoom friendly on supporting browsers */
  touch-action: pinch-zoom;
}

.slide figcaption {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* —— Controls —— */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 15;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(10, 37, 64, 0.75);
  color: var(--white);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(232, 168, 56, 0.35);
  transition: background 0.15s, opacity 0.15s;
}
.nav-btn:hover, .nav-btn:focus-visible {
  background: rgba(232, 168, 56, 0.9);
  color: var(--navy);
  outline: none;
}
.nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}
.nav-btn.prev { left: 0.35rem; }
.nav-btn.next { right: 0.35rem; }

@media (max-width: 480px) {
  .nav-btn {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
  }
}

/* —— Footer / dots —— */
.deck-footer {
  flex: 0 0 auto;
  min-height: var(--dots-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem 0.65rem;
  background: var(--navy);
  border-top: 1px solid rgba(232, 168, 56, 0.25);
  z-index: 20;
}

.dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.28);
  cursor: pointer;
  transition: width 0.2s, background 0.2s;
}
.dots button[aria-current="true"] {
  width: 22px;
  background: var(--amber);
}
.dots button:focus-visible {
  outline: 2px solid var(--amber-hot);
  outline-offset: 2px;
}

.hint {
  margin: 0;
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
}

.caption-bar {
  width: 100%;
  max-width: 42rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--cream);
  line-height: 1.3;
  min-height: 1.3em;
  opacity: 0.92;
}

/* —— Landscape phone / short height —— */
@media (max-height: 480px) {
  :root { --chrome-h: 40px; --dots-h: 44px; }
  .deck-header .eyebrow { display: none; }
  .hint { display: none; }
  .slide { padding: 0.25rem; }
  .slide img {
    border-radius: 4px;
    max-height: calc(100dvh - var(--chrome-h) - var(--dots-h) - 0.5rem);
  }
}

/* —— Desktop comfort —— */
@media (min-width: 900px) {
  .slide { padding: 1rem; }
  .nav-btn.prev { left: 1rem; }
  .nav-btn.next { right: 1rem; }
  .slide img {
    max-height: min(78vh, 820px);
    max-width: min(96vw, 1400px);
  }
}


/* Sticky WhatsApp (match hub) */
.whatsapp-fab {
  position: fixed;
  right: calc(14px + env(safe-area-inset-right, 0px));
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  background: #25D366;
  color: #fff;
  font: 700 0.9rem/1 system-ui, -apple-system, sans-serif;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(0,0,0,.35);
}
.whatsapp-fab svg { width: 20px; height: 20px; flex: 0 0 20px; }
.whatsapp-fab:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
@media (min-width: 640px) {
  .whatsapp-fab { display: none; }
}
