/* ============================================================
   DESTINATIONS PAGES
   /destinations and /destinations/<country> (pageStyles in lib/pages.js),
   after sections.css (the shared .sx-* components) and before
   preferences.css. Classes are prefixed ds-.
   ============================================================ */

/* ─── Hero ──────────────────────────────────────────────────── */
.ds-hero-badge { display: inline-flex; margin-bottom: 16px; }
.ds-hero h1 { max-width: 26ch; }

/* ─── Country cards ─────────────────────────────────────────── */
.ds-countries {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}
.ds-country {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--dark);
  color: #fff;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.ds-country-photo { position: absolute; inset: 0; }
.ds-country-photo > img { position: absolute; inset: 0; transition: transform 0.8s var(--ease-out); }
.ds-country-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(8,16,8,0.9) 0%, rgba(8,16,8,0.5) 40%, rgba(8,16,8,0) 72%);
}
.ds-country-body {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px;
}
.ds-country-region {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.ds-country-name { font-size: 1.7rem; font-weight: 800; line-height: 1.15; letter-spacing: -0.015em; }
.ds-country-tag { font-size: 0.86rem; line-height: 1.5; color: rgba(255,255,255,0.8); }
.ds-country-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.18);
  font-size: 0.86rem;
  font-weight: 700;
  font-variant-numeric: lining-nums tabular-nums;
}
.ds-country-go {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--dark);
  font-size: 0.85rem;
  transition: transform var(--dur-base) var(--ease-out);
}
/* the whole card is the link, so the keyboard ring goes round the card */
.ds-country:focus-visible { outline-color: var(--accent); outline-offset: 4px; }

/* ─── Park cards ────────────────────────────────────────────── */
.ds-parks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
.ds-park {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.ds-park-photo { position: relative; aspect-ratio: 16 / 10; background: var(--primary-light); overflow: hidden; }
.ds-park-photo > img { position: absolute; inset: 0; transition: transform 0.7s var(--ease-out); }
.ds-park-body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.ds-park h3 { margin: 0 0 12px; font-size: 1.25rem; line-height: 1.3; color: var(--dark); }
.ds-park-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ds-park-facts li {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--primary-dark);
}
.ds-park-facts i { margin-top: 2px; font-size: 0.72rem; }
.ds-park-desc { margin: 0 0 12px; font-size: 0.93rem; line-height: var(--leading-read); color: var(--text-muted); }
.ds-park-highlights {
  display: flex;
  gap: 8px;
  margin: 0 0 auto;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: var(--leading-ui);
  color: var(--accent-text);
}
.ds-park-highlights i { flex: none; margin-top: 4px; font-size: 0.72rem; }

/* the safaris that visit this park */
.ds-park-tours { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border-light); }
.ds-park-tours-label {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.ds-park-tours ul { list-style: none; display: grid; gap: 4px; }
.ds-park-tours li a {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--primary);
}
.ds-park-tours li a i { flex: none; margin-top: 4px; font-size: 0.75rem; transition: transform var(--dur-base) var(--ease-out); }
.ds-park-more { display: inline-block; margin-top: 6px; font-size: 0.84rem; font-weight: 700; color: var(--primary); }
.ds-park-more i { margin-left: 4px; font-size: 0.72rem; }

/* ─── Country page: about ───────────────────────────────────── */
.ds-about-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.ds-about-media { position: relative; padding-bottom: 24px; }
.ds-about-photo {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--primary-light);
  box-shadow: var(--shadow-lg);
}
.ds-about-photo > img { position: absolute; inset: 0; }
.ds-about-media .sx-badge { left: 20px; bottom: 0; }

/* the tour grid sits straight under its heading (components.css gives it a top margin) */
.ds-tours .tours-grid { margin-top: 0; }

/* ─── Hover (hover-capable devices only) ────────────────────── */
@media (hover: hover) {
  .ds-country:hover { box-shadow: var(--shadow-lg); }
  .ds-country:hover .ds-country-photo > img { transform: scale(1.06); }
  .ds-country:hover .ds-country-go { transform: translateX(4px); }
  .ds-park:hover { box-shadow: var(--shadow-md); }
  .ds-park:hover .ds-park-photo > img { transform: scale(1.05); }
  .ds-park-tours li a:hover i { transform: translateX(4px); }
  .ds-park-tours li a:hover span, .ds-park-more:hover { text-decoration: underline; text-underline-offset: 3px; }
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .ds-countries { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ds-country { aspect-ratio: 4 / 3; }
  .ds-parks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ds-countries { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ds-country { aspect-ratio: 4 / 3.2; }
  .ds-parks { grid-template-columns: minmax(0, 1fr); }
  .ds-about-actions .btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .ds-country-photo > img, .ds-country-go, .ds-park-photo > img, .ds-park-tours li a i { transition: none; }
}
