/* ───────────────────────────────────────────────────────────────────────────
 *  destinations-index.css
 *  Scoped styles for the dual-section /destinations/ index page only.
 *  Loaded by _source-destinations.html. NOT loaded on other pages.
 *  All classes prefixed `dest-index-*` to avoid colliding with destination
 *  hub (destination.css) or any other module.
 * ─────────────────────────────────────────────────────────────────────────── */

/* ── Section blocks ── */
.dest-index-section {
  margin: 0 0 40px;
  scroll-margin-top: 72px; /* offset for sticky pill row when jumping */
}
.dest-index-section + .dest-index-section {
  padding-top: 28px;
  border-top: 1px solid #e2e8f0;
}

.dest-index-section-header {
  margin: 0 0 20px;
  text-align: left;
}
.dest-index-section-heading {
  font-family: 'Josefin Sans', sans-serif;
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: #0f172a;
  text-align: left;   /* override the global `section h2 { text-align:center }` in styles.css */
}
.dest-index-section-sub {
  font-size: 14.5px;
  line-height: 1.55;
  color: #64748b;
  max-width: 680px;
  margin: 0;
}

/* ── State/UT or Country group (one per row of cards) ── */
.dest-index-group {
  margin: 28px 0;
}
.dest-index-group-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #cbd5e1;
}
.dest-index-group-title {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 17.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0f172a;
  margin: 0;
}
.dest-index-group-flag {
  width: 22px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
  display: inline-block;
  vertical-align: middle;
  margin-right: 2px;
}
.dest-index-group-count {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: #64748b;
  margin-left: auto;
  letter-spacing: 0.04em;
}

/* ── Continent block in World section ── */
.dest-index-continent {
  margin: 0 0 28px;
}
.dest-index-continent-heading {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #0f172a;
  margin: 0 0 14px;
}

/* ── Flat card grid (redesign 2026-06) ── */
.dest-index-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) { .dest-index-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 600px)  { .dest-index-grid { grid-template-columns: 1fr; gap: 14px; } }

/* ── Minimal card (index page only) — overrides the heavier base in destinations.css.
   This stylesheet loads after destinations.css, so equal-specificity rules win. ── */
.dest-index-section .dest-archive-card .dac-hero { aspect-ratio: 16 / 10; }
.dest-index-section .dest-archive-card .dac-hero img.dac-flag {
  top: 12px; left: 12px; right: auto;       /* mockup puts the flag top-left */
  width: 30px;
}
.dest-index-section .dest-archive-card .dac-body {
  padding: 14px 16px 16px;
  gap: 4px;
}
.dest-index-section .dac-name { font-size: 18px; }
.dest-index-section .dac-sub {
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  color: #64748b;
  margin: 0;
}
.dest-index-section .dac-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  padding-top: 11px;
  border-top: 1px solid #eef2f6;
}
.dest-index-section .dac-stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Roboto', sans-serif;
  font-size: 12.5px;
  color: #475569;
  white-space: nowrap;
}
.dest-index-section .dac-stat i { color: var(--primary, #06b6d4); font-size: 13px; }

@media (max-width: 720px) {
  .dest-index-section { margin-bottom: 32px; }
}

/* ── Section toggle: "Dive in India" / "Dive Worldwide" ──
   Fully self-contained: the shared .cat-tab base lives only in liveaboards.css,
   so this page owns its tab styling (decoupled, can't be corrupted by another
   module — see designplan.md §4/§7). Glass container + gradient active pill. */
/* Floating rounded glass "pill bar" card — matches the /liveaboards/ tab bar. */
.cat-tabs-wrap {
  position: sticky;
  top: 72px;
  z-index: 50;
  width: fit-content;
  max-width: calc(100% - 48px);
  margin: 16px auto 8px;
  padding: 8px 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.82) 0%, rgba(255,255,255,.66) 100%);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 18px;
  box-shadow:
    0 8px 32px rgba(6,95,120,.08),
    0 2px 8px rgba(6,182,212,.06),
    inset 0 1px 0 rgba(255,255,255,.6);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .cat-tabs-wrap { background: rgba(255,255,255,.97); }
}
.dest-index-section-tabs {
  display: flex;
  gap: 10px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;          /* only two pills — keep them centred */
}
.dest-index-section-tabs .dest-index-section-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--deep, #164e63);
  background: #fff;
  border: 1.5px solid var(--border-strong, rgba(6,182,212,.30));
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition, all .25s ease);
}
.dest-index-section-tabs .dest-index-section-tab:hover {
  border-color: var(--primary, #06b6d4);
  color: var(--primary, #06b6d4);
  transform: translateY(-1px);
}
.dest-index-section-tabs .dest-index-section-tab.active,
.dest-index-section-tabs .dest-index-section-tab.active:hover {
  background: linear-gradient(135deg,
    rgba(16,185,129,.96) 0%,
    rgba(6,182,212,.96) 50%,
    rgba(29,78,216,.96) 100%);
  border-color: rgba(255,255,255,.28);
  color: #fff;
  box-shadow:
    0 4px 12px rgba(29,78,216,.16),
    0 2px 6px rgba(16,185,129,.08),
    inset 0 1px 0 rgba(255,255,255,.28);
}
@media (max-width: 720px) {
  .cat-tabs-wrap { top: 60px; padding: 9px 16px; }
  .dest-index-section-tabs .dest-index-section-tab { font-size: 13px; padding: 8px 16px; }
}

/* ── Sidebar active-filter polish (scoped to this archive only) ── */
.destinations-archive-body .sort-option.active {
  background: linear-gradient(135deg, rgba(16,185,129,.14) 0%, rgba(6,182,212,.14) 50%, rgba(29,78,216,.14) 100%);
  color: var(--deep, #164e63);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--primary, #06b6d4);
}

/* ── Card hero placeholder (when a destination has no DEST_IMAGES yet) ── */
.dac-hero-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #cffafe 0%, #ecfeff 50%, #f0fdfa 100%);
  color: var(--secondary-hover, #0f766e);
}
.dac-hero-placeholder span {
  font-size: 64px;
  filter: drop-shadow(0 2px 6px rgba(6, 182, 212, 0.18));
  line-height: 1;
}

/* ── Empty state when filters hide everything in a section ── */
.dest-index-section-empty {
  padding: 28px 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

/* ── Check Visibility pill in the card body — slightly smaller, with a little
   breathing room above it so it doesn't crowd the stats row. ── */
.dest-index-section .dest-archive-card .visibility-btn {
  align-self: flex-start;
  margin: 12px 0 2px;          /* gap above, away from the dive-sites/flight row */
  padding: 6px 13px;           /* a touch smaller than the homepage default */
  font-size: 11.5px;
}
.dest-index-section .dest-archive-card .visibility-icon { font-size: 12.5px; }

/* ── "Filters" button — opens the off-canvas sidebar on mobile. Desktop has the
   always-visible sidebar, so it's hidden there. (Was an UNSTYLED native button —
   no rule existed for .filter-btn-mobile, so it rendered with the grey 3D
   browser default.) Premium pill style, matches the pill-tab look. ── */
.filter-btn-mobile { display: none; }
@media (max-width: 720px) {
  .filter-btn-mobile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    min-height: 44px;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--deep, #164e63);
    background: #fff;
    border: 1.5px solid var(--border-strong, rgba(6, 182, 212, 0.30));
    border-radius: 100px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(6, 95, 120, 0.06);
    transition: var(--transition, all .25s ease);
  }
  .filter-btn-mobile i { color: var(--primary, #06b6d4); font-size: 13px; }
  .filter-btn-mobile:hover { border-color: var(--primary, #06b6d4); color: var(--primary, #06b6d4); }
  .filter-btn-mobile:active { transform: scale(.98); }
}

/* ── "Show N destinations" apply button → brand gradient, matching the
   /liveaboards/ and /shop/ filter sheets (overrides the solid var(--primary)
   default in styles.css). Mobile-only, scoped to this page. ── */
@media (max-width: 720px) {
  body.destinations-archive-body .sidebar.mobile-open .sheet-apply {
    background: linear-gradient(135deg,
      rgba(16, 185, 129, 0.96) 0%,
      rgba(6, 182, 212, 0.96) 50%,
      rgba(29, 78, 216, 0.96) 100%);
    box-shadow:
      0 8px 22px rgba(29, 78, 216, 0.32),
      0 3px 10px rgba(16, 185, 129, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.26);
  }
  body.destinations-archive-body .sidebar.mobile-open .sheet-apply:active { transform: scale(.98); }
}
