/* ───────────────────────────────────────────────────────────────────────────
 *  dest-courses-section.css
 *  Styles only the "Courses offered here" section on destination hub pages.
 *  All classes prefixed `dest-courses-`. Loaded only by _source-destination.html.
 * ─────────────────────────────────────────────────────────────────────────── */

.dest-courses-section {
  background: #ffffff;
}

/* Category filter pills (match the destination anchor-tab pill style). */
.dest-courses-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 6px;
}
.dest-courses-pill {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.7);
  border: 1.5px solid rgba(6, 182, 212, 0.18);
  box-shadow: 0 1px 3px rgba(6, 95, 120, 0.04);
  border-radius: 100px;
  padding: 9px 18px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--deep, #0f172a);
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
}
.dest-courses-pill:hover {
  border-color: var(--primary, #06b6d4);
  color: var(--primary, #06b6d4);
  background: #fff;
  transform: translateY(-1px);
}
.dest-courses-pill.is-active {
  background: linear-gradient(135deg,
    rgba(16, 185, 129, 0.96) 0%,
    rgba(6, 182, 212, 0.96) 55%,
    rgba(29, 78, 216, 0.96) 100%);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  box-shadow:
    0 4px 12px rgba(29, 78, 216, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.dest-courses-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  gap: 16px;
  margin-top: 22px;
  align-items: stretch;
}
.dest-courses-card.is-hidden { display: none; }

.dest-courses-more { text-align: center; margin-top: 28px; }
.dest-courses-viewall {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid rgba(6, 182, 212, 0.32);
  color: var(--secondary-hover, #0f766e);
  font-family: 'Josefin Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 100px;
  cursor: pointer;
  transition: all .2s ease;
}
.dest-courses-viewall:hover {
  border-color: var(--primary, #06b6d4);
  color: var(--primary, #06b6d4);
  box-shadow: 0 8px 20px -10px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 1280px) { .dest-courses-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1024px) { .dest-courses-grid { grid-template-columns: repeat(3, 1fr); } }

/* ─── Course card — mirrors the marine-life archive card (.species-archive-card) ─── */
.dest-courses-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid var(--border, rgba(6, 182, 212, 0.16));
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: all .25s ease;
  position: relative;
}
.dest-courses-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary, #06b6d4);
  box-shadow: 0 14px 28px rgba(6, 182, 212, 0.14), 0 6px 14px rgba(15, 23, 42, 0.06);
}

.dcc-hero {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg2, #f0fdff);
}
.dcc-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.dest-courses-card:hover .dcc-hero img { transform: scale(1.05); }
.dcc-hero-overlay {
  position: absolute; inset: auto 0 0 0;
  height: 50%;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.55) 0%, rgba(15, 23, 42, 0) 100%);
  pointer-events: none;
}
.dcc-cat {
  position: absolute; top: 10px; left: 10px;
  max-width: calc(100% - 78px);
  background: rgba(255, 255, 255, 0.96);
  color: var(--deep, #164e63);
  font-family: 'Josefin Sans', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 100px;
  border-left: 3px solid var(--cat-color, var(--primary, #06b6d4));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dcc-agency {
  position: absolute; top: 10px; right: 10px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 100px;
  line-height: 1;
}

.dcc-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.dcc-name {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--deep, #164e63);
  line-height: 1.18;
  margin: 0;
  letter-spacing: -0.2px;
}
.dcc-meta {
  font-family: 'Roboto', sans-serif;
  font-size: 11px;
  color: var(--muted, #475569);
  margin: -2px 0 0;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dcc-tagline {
  font-family: 'Roboto', sans-serif;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  margin: 2px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dcc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border, rgba(6, 182, 212, 0.12));
  margin-top: auto;
}
.dcc-price {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--deep, #164e63);
  line-height: 1.2;
  min-width: 0;
}
.dcc-price-enquire { font-size: 14px; }
.dcc-price-sub {
  display: block;
  font-family: 'Roboto', sans-serif;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--muted, #475569);
  margin-top: 1px;
}
.dcc-cta {
  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%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  width: 32px; height: 32px; min-width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(29, 78, 216, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  transition: all .2s ease;
}
.dcc-cta i { font-size: 12px; line-height: 1; }
.dest-courses-card:hover .dcc-cta {
  transform: translateY(-1px) scale(1.06);
  background: linear-gradient(135deg, #0ea371 0%, #0891b2 50%, #1e40af 100%);
}

.dest-courses-empty {
  padding: 24px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}

/* ─── Filter / sort toolbar (liveaboards-style, scoped to this section) ─────── */
.dest-courses-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 4px;
}
.dest-courses-count {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #475569);
}
.dest-courses-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* Glass "Filters" pill button */
.dest-courses-filterbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--deep, #164e63);
  background: linear-gradient(180deg, rgba(255,255,255,0.82) 0%, rgba(255,255,255,0.62) 100%);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.55);
  box-shadow: 0 2px 8px rgba(6,95,120,0.06), inset 0 1px 0 rgba(255,255,255,0.6);
  border-radius: 100px;
  padding: 9px 16px;
  cursor: pointer;
  transition: all .2s ease;
}
.dest-courses-filterbtn:hover {
  border-color: var(--primary, #06b6d4);
  color: var(--primary, #06b6d4);
}

/* Active-filter chips row (reuses global .active-chip / .chip-clear) */
.dest-courses-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.dest-courses-chips.has-chips { margin: 12px 0 2px; }

/* Filter panel — desktop dropdown anchored to the section */
.dest-courses-section .section-wrap { position: relative; }
.dest-courses-panel {
  position: absolute;
  z-index: 60;
  right: 0;
  top: auto;
  width: 300px;
  max-width: calc(100vw - 40px);
  margin-top: 8px;
  padding: 6px 4px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(255,255,255,0.8) 100%);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 16px 44px rgba(6,95,120,0.20), 0 4px 12px rgba(6,182,212,0.08), inset 0 1px 0 rgba(255,255,255,0.7);
}
.dest-courses-panel.open { animation: dcfPanelIn .16s ease; }
@keyframes dcfPanelIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.dcf-panel-head {
  display: none;                       /* header/footer are mobile-sheet only */
  justify-content: space-between;
  align-items: center;
  font-family: 'Josefin Sans', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--deep, #164e63);
  padding: 14px 18px 10px;
}
.dcf-panel-close { background: none; border: 0; font-size: 18px; color: var(--muted, #475569); cursor: pointer; }
.dcf-panel-foot { display: none; gap: 10px; padding: 12px 16px 16px; }
.dcf-clear, .dcf-apply {
  flex: 1;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  border-radius: 100px;
  padding: 11px 16px;
  cursor: pointer;
}
.dcf-clear { background: #fff; border: 1.5px solid rgba(6,182,212,0.32); color: var(--muted, #475569); }
.dcf-apply {
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff;
  background: linear-gradient(135deg, rgba(16,185,129,0.96) 0%, rgba(6,182,212,0.96) 55%, rgba(29,78,216,0.96) 100%);
}
.dest-courses-panel-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 55; }

@media (max-width: 720px) {
  .dest-courses-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: auto; gap: 12px; }
  .dest-courses-card { height: auto; }
  .dcc-name { font-size: 15px; }
  .dcc-tagline { font-size: 12px; }
  .dcc-body { padding: 10px 12px 12px; }

  /* Toolbar stacks; Filters button fills the row */
  .dest-courses-toolbar { gap: 10px; }
  .dest-courses-count { flex: 1 1 100%; }
  .dest-courses-tools { flex: 1 1 100%; }
  .dest-courses-filterbtn { flex: 1; justify-content: center; }

  /* Filter panel becomes a bottom sheet */
  .dest-courses-panel {
    position: fixed;
    z-index: 300;
    left: 0; right: 0; bottom: 0; top: auto;
    width: auto;
    max-width: none;
    margin: 0;
    border-radius: 20px 20px 0 0;
    max-height: 82vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .25s ease;
    animation: none;
  }
  .dest-courses-panel.open { transform: translateY(0); }
  .dcf-panel-head { display: flex; }
  .dcf-panel-foot { display: flex; position: sticky; bottom: 0; background: rgba(255,255,255,0.92); }
  .dest-courses-panel-overlay { z-index: 299; }
}
