/* ============================================================
   pages/destinations.css

   The searchable global destinations directory
   (staging/destinations/index.html, generated by
   scripts/theme_v2/build_destinations.py).

   Layout:
     - .otg-dest__hero      flat structured hero (eyebrow + H1 + lede + stat)
     - .otg-dest__search    sticky search bar: input + continent chips + count
     - .otg-dest__results   continent groups, each a responsive grid of
                            country cards; subregion chip-links nested per card
     - .is-hidden           the single toggle the filter JS uses

   Kayak-style enterprise-minimal: flat hairline surfaces, cool greyscale,
   one font, no photography on this index (kept text-forward so 195+ entries
   stay lightning fast). Every value uses var(--otg-*) tokens.
   ============================================================ */

.is-hidden { display: none !important; }


/* ============================================================
   1. Hero
   ============================================================ */
.otg-dest__hero {
  background: var(--otg-bg);
  padding-top: var(--otg-space-7);
  padding-bottom: var(--otg-space-6);
}

@media (min-width: 1024px) {
  .otg-dest__hero {
    padding-top: var(--otg-space-9);
    padding-bottom: var(--otg-space-7);
  }
}

.otg-dest__eyebrow {
  font-size: var(--otg-text-micro);
  line-height: var(--otg-leading-micro);
  font-weight: var(--otg-weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--otg-tracking-wide);
  color: var(--otg-text-secondary);
  margin: 0 0 var(--otg-space-4) 0;
}

.otg-dest__title {
  font-family: var(--otg-font-display);
  font-size: var(--otg-text-display-lg);
  line-height: var(--otg-leading-display-lg);
  font-weight: var(--otg-weight-semibold);
  letter-spacing: var(--otg-tracking-display);
  color: var(--otg-text-primary);
  margin: 0;
}

@media (min-width: 1024px) {
  .otg-dest__title {
    font-size: var(--otg-text-display-xl);
    line-height: var(--otg-leading-display-xl);
  }
}

.otg-dest__lede {
  max-width: 58ch;
  margin: var(--otg-space-5) 0 0 0;
  font-size: var(--otg-text-body-lg);
  line-height: var(--otg-leading-body-lg);
  color: var(--otg-text-secondary);
}

.otg-dest__stat {
  margin: var(--otg-space-4) 0 0 0;
  font-size: var(--otg-text-small);
  line-height: var(--otg-leading-small);
  color: var(--otg-text-muted);
}


/* ============================================================
   2. Sticky search bar
   ============================================================ */
.otg-dest__search {
  position: sticky;
  top: 56px;                         /* mobile header height */
  z-index: 40;                       /* below header (50) */
  background: var(--otg-surface);
  border-top: 1px solid var(--otg-border);
  border-bottom: 1px solid var(--otg-border);
  padding-top: var(--otg-space-4);
  padding-bottom: var(--otg-space-4);
}

@media (min-width: 1024px) {
  .otg-dest__search {
    top: 64px;                       /* desktop header height */
    padding-top: var(--otg-space-5);
    padding-bottom: var(--otg-space-5);
  }
}

.otg-dest__search-inner {
  display: flex;
  flex-direction: column;
  gap: var(--otg-space-4);
}

@media (min-width: 768px) {
  .otg-dest__search-inner {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--otg-space-4) var(--otg-space-5);
  }
}

/* ---------- Search input (icon + field) ---------- */
/* Base (mobile, column layout): full width, auto height. The flex-basis is
   applied only in the row layout below — in a column it would size the
   HEIGHT and detach the centred icon. */
.otg-dest__form {
  position: relative;
  width: 100%;
  min-width: 0;
  margin: 0;
}

@media (min-width: 768px) {
  .otg-dest__form {
    flex: 1 1 320px;
    width: auto;
  }
}

.otg-dest__search-icon {
  position: absolute;
  left: var(--otg-space-4);
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--otg-text-muted);
  pointer-events: none;
}

.otg-dest__search-icon svg { width: 20px; height: 20px; display: block; }

.otg-dest__input {
  width: 100%;
  padding-left: calc(var(--otg-space-4) + 20px + var(--otg-space-3));
  height: 48px;
}

/* Remove the native search clear cross for a cleaner look. */
.otg-dest__input::-webkit-search-decoration,
.otg-dest__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* ---------- Continent filter chips ---------- */
.otg-dest__filters { min-width: 0; }

.otg-dest__filters .otg-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--otg-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---------- Result count ---------- */
.otg-dest__status {
  margin: 0;
  font-size: var(--otg-text-small);
  line-height: var(--otg-leading-small);
  color: var(--otg-text-muted);
  white-space: nowrap;
}

@media (min-width: 768px) {
  .otg-dest__status { margin-left: auto; }
}


/* ============================================================
   3. Results — continent groups + country cards
   ============================================================ */
.otg-dest__results {
  background: var(--otg-bg);
  padding-top: var(--otg-space-7);
  padding-bottom: var(--otg-space-9);
}

@media (min-width: 1024px) {
  .otg-dest__results {
    padding-top: var(--otg-space-8);
    padding-bottom: var(--otg-space-10);
  }
}

.otg-dest-group { margin-top: var(--otg-space-8); }
.otg-dest-group:first-of-type { margin-top: 0; }

@media (min-width: 1024px) {
  .otg-dest-group { margin-top: var(--otg-space-9); }
}

.otg-dest-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--otg-space-4);
  margin: 0 0 var(--otg-space-5) 0;
  padding-bottom: var(--otg-space-4);
  border-bottom: 1px solid var(--otg-border);
}

.otg-dest-group__title {
  font-family: var(--otg-font-display);
  font-size: var(--otg-text-display-md);
  line-height: var(--otg-leading-display-md);
  font-weight: var(--otg-weight-semibold);
  letter-spacing: var(--otg-tracking-display);
  color: var(--otg-text-primary);
  margin: 0;
}

.otg-dest-group__count {
  flex-shrink: 0;
  font-size: var(--otg-text-micro);
  line-height: var(--otg-leading-micro);
  font-weight: var(--otg-weight-medium);
  text-transform: uppercase;
  letter-spacing: var(--otg-tracking-wide);
  color: var(--otg-text-muted);
}

/* ---------- Grid of country cards ---------- */
.otg-dest-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--otg-space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 560px) {
  .otg-dest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .otg-dest-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--otg-space-5);
  }
}

@media (min-width: 1440px) {
  .otg-dest-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.otg-dest-item { min-width: 0; }

/* ---------- Country card ----------
   The card fills its grid cell (height:100%) and the grid stretches every
   cell in a row to the tallest card, so rows stay uniform regardless of
   2-line country names or a trailing region-chip row. The country link
   grows to fill, chips sit at the bottom of the box. */
.otg-dest-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--otg-space-4) var(--otg-space-5);
  background: var(--otg-surface);
  border: 1px solid var(--otg-border);
  border-radius: var(--otg-radius);
  transition: border-color var(--otg-duration-3) var(--otg-ease),
              box-shadow var(--otg-duration-3) var(--otg-ease),
              transform var(--otg-duration-3) var(--otg-ease);
}

.otg-dest-card:hover {
  border-color: var(--otg-border-strong);
  box-shadow: var(--otg-shadow-hover);
  transform: translateY(-2px);
}

.otg-dest-card__link {
  display: flex;
  flex-direction: column;
  gap: var(--otg-space-1);
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
}

.otg-dest-card__link:focus-visible {
  outline: 3px solid var(--otg-focus-ring);
  outline-offset: 2px;
}

.otg-dest-card__name {
  font-family: var(--otg-font-sans);
  font-size: var(--otg-text-h4);
  line-height: var(--otg-leading-h4);
  font-weight: var(--otg-weight-semibold);
  color: var(--otg-text-primary);
}

.otg-dest-card:hover .otg-dest-card__name { color: var(--otg-accent); }

.otg-dest-card__meta {
  font-size: var(--otg-text-small);
  line-height: var(--otg-leading-small);
  color: var(--otg-text-muted);
}

/* ---------- Subregion chip-links under a country ---------- */
.otg-dest-subs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--otg-space-2);
  list-style: none;
  margin: var(--otg-space-3) 0 0 0;
  padding: 0;
  flex: 0 0 auto;
}

.otg-dest-sub a {
  display: inline-flex;
  align-items: center;
  padding: 3px var(--otg-space-3);
  background: var(--otg-surface-sunken);
  border: 1px solid var(--otg-border);
  border-radius: var(--otg-radius-sm);
  font-size: var(--otg-text-small);
  line-height: var(--otg-leading-small);
  font-weight: var(--otg-weight-regular);
  color: var(--otg-text-secondary);
  text-decoration: none;
  transition: border-color var(--otg-duration-2) var(--otg-ease),
              color var(--otg-duration-2) var(--otg-ease),
              background-color var(--otg-duration-2) var(--otg-ease);
}

.otg-dest-sub a:hover {
  background: var(--otg-surface);
  border-color: var(--otg-border-strong);
  color: var(--otg-text-primary);
}

.otg-dest-sub a:focus-visible {
  outline: 3px solid var(--otg-focus-ring);
  outline-offset: 2px;
}


/* ============================================================
   4. Empty state
   ============================================================ */
.otg-dest-empty {
  max-width: 52ch;
  margin: var(--otg-space-7) auto;
  text-align: center;
}

.otg-dest-empty__title {
  font-family: var(--otg-font-display);
  font-size: var(--otg-text-h3);
  line-height: var(--otg-leading-h3);
  font-weight: var(--otg-weight-semibold);
  color: var(--otg-text-primary);
  margin: 0;
}

.otg-dest-empty__hint {
  margin: var(--otg-space-3) 0 0 0;
  font-size: var(--otg-text-body);
  line-height: var(--otg-leading-body);
  color: var(--otg-text-secondary);
}
