/* ─── Courses overview hero strip ─── */
/* The site header is position:fixed glass-morphic — hero needs top padding to
 * clear it. Matches the homepage hero convention (140px desktop / 84px mobile). */
.courses-hero {
  background: linear-gradient(135deg, #ecfeff 0%, #f8fdff 50%, #ffffff 100%);
  padding: 156px 24px 36px;
  border-bottom: 1px solid var(--border);
}
.courses-hero .section-wrap { max-width: 1400px; margin: 0 auto; }
.courses-eyebrow {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 10px;
  font-weight: 500;
}
.courses-hero h1 {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 42px;
  line-height: 1.05;
  color: var(--deep);
  margin: 0 0 12px;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.courses-lede {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.55;
  max-width: 680px;
  margin: 0 0 22px;
}
.courses-hero-stats { display: flex; gap: 32px; flex-wrap: wrap; }
.courses-hero-stats > div { display: flex; flex-direction: column; }
.courses-hero-stats strong {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 26px;
  color: var(--deep);
  font-weight: 600;
  line-height: 1;
}
.courses-hero-stats span {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-top: 5px;
  font-family: 'Josefin Sans', sans-serif;
}

/* ─── Level option count badge (inside the Sort & Filters panel) ─── */
.courses-archive-body .level-option { justify-content: space-between; }
.cat-tab-count {
  font-size: 11px;
  opacity: .75;
  font-weight: 500;
  padding: 1px 7px;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 100px;
  letter-spacing: 0;
}
.courses-archive-body .sort-option.active .cat-tab-count { background: rgba(6, 182, 212, 0.18); opacity: 1; }
/* Active filter polish — gradient tint + accent bar (scoped to /courses/ only; see designplan §5) */
.courses-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);
}

/* ─── Courses-specific layout tweaks ─── */
.courses-main-layout { padding-top: 8px; }
.courses-archive-body .results-bar { padding: 18px 0 12px; display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: center; gap: 12px; }
.courses-archive-body .results-bar .results-count { flex: 0 0 auto; white-space: nowrap; }
.courses-archive-body .content { padding: 0 24px 48px; min-width: 0; flex: 1; }

/* ─── Card-as-link fixes ─── */
/* The whole card is an <a>, so anchor underlines and link-blue would otherwise
 * leak into title/subtitle/price. Reset and re-apply text colour. */
.courses-archive-body .dest-card,
.courses-archive-body .dest-card:hover,
.courses-archive-body .dest-card:focus,
.courses-archive-body .dest-card:visited,
.courses-archive-body .dest-card * {
  text-decoration: none !important;
}
.courses-archive-body .dest-card { color: var(--text); }
.courses-archive-body .dest-card .card-name { color: var(--text); }
.courses-archive-body .dest-card .card-sub  { color: var(--muted); }
.courses-archive-body .dest-card .price-amount { color: var(--text); }
.courses-archive-body .dest-card .price-srp    { color: var(--dim); }
.courses-archive-body .dest-card .price-per    { color: var(--dim); }

/* Tighten the title → subtitle gap.
 * styles.css gives .card-name min-height for 2 lines (alignment) and .card-sub
 * margin-top: 4px — together that creates a wide gap when title is 1 line. */
.courses-archive-body .dest-card .card-name {
  margin: 0;
  min-height: 0;
  -webkit-line-clamp: 2;
  line-height: 1.18;
}
.courses-archive-body .dest-card .card-sub {
  margin-top: 2px;
  min-height: 0;
  line-height: 1.4;
}

/* Book button — uses the brand logo gradient (green → cyan → blue) like the
 * homepage hero "Plan with Laila" CTA. */
.courses-archive-body .dest-card .card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  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 !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 10px 20px;
  border-radius: 100px;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  box-shadow:
    0 6px 18px rgba(29, 78, 216, 0.30),
    0 3px 10px rgba(16, 185, 129, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  transition: var(--transition, all .2s ease);
}
.courses-archive-body .dest-card:hover .card-cta {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #0ea371 0%, #0891b2 50%, #1e40af 100%);
  box-shadow:
    0 12px 26px rgba(29, 78, 216, 0.42),
    0 5px 14px rgba(16, 185, 129, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

/* Special card badge variants */
.dest-card .card-season-badge.badge-school {
  background: #dbeafe; border-color: #93c5fd; color: #1e40af;
}
.dest-card .card-season-badge.badge-refresher {
  background: #fef3c7; border-color: #fcd34d; color: #92400e;
}
.dest-card .card-season-badge.badge-bestseller {
  background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
  border-color: #fcd34d;
  color: #78350f;
}

/* No results */
.no-results {
  grid-column: 1 / -1;
  padding: 64px 24px;
  text-align: center;
  color: var(--muted);
  font-family: 'Josefin Sans', sans-serif;
}
.no-results h3 {
  font-size: 22px;
  color: var(--deep);
  margin: 0 0 8px;
  font-weight: 600;
}
.no-results p { margin: 0 0 16px; font-size: 14px; }
.no-results .clear-link {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 10px 18px;
  border-radius: 100px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
}

/* Range slider */
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; accent-color: var(--primary); }
.range-val {
  font-family: 'Josefin Sans', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--primary);
  min-width: 60px;
  text-align: right;
}

/* ─── Top-row search box (in the results bar, next to the count) ─── */
.courses-archive-body .course-search-wrap {
  position: relative; display: inline-flex; align-items: center; flex: 1 1 auto; min-width: 0; max-width: 320px;
}
.courses-archive-body .course-search-wrap i {
  position: absolute; left: 12px; color: var(--dim, #94a3b8); font-size: 13px; pointer-events: none;
}
.courses-archive-body #course-search {
  width: 100%; padding: 9px 12px 9px 32px; font-size: 13.5px; color: #0f172a;
  border: 1px solid var(--border, #e2e8f0); border-radius: 12px; background: #fff;
  font-family: 'Roboto', sans-serif;
}
.courses-archive-body #course-search:focus {
  outline: none; border-color: var(--primary, #0e7490); box-shadow: 0 0 0 3px rgba(14,116,144,.12);
}

/* ─── Full-width "Filters & Sort" button (mobile only; desktop uses the sidebar),
       styled like the homepage .mfb-btn ─── */
.filter-sort-btn { display: none; }

@media (max-width: 720px) {
  .courses-hero { padding: 100px 18px 24px; }
  .courses-hero h1 { font-size: 30px; }
  .courses-lede { font-size: 14.5px; }
  .courses-hero-stats { gap: 22px; }
  .courses-hero-stats strong { font-size: 22px; }

  .courses-archive-body .course-search-wrap { flex: 1 1 auto; }

  .filter-sort-btn {
    display: flex; width: 100%; align-items: center; justify-content: center;
    gap: 8px; padding: 13px 14px; min-height: 48px; margin: 4px 0 14px;
    background: #fff; border: 1px solid var(--border, #e2e8f0); border-radius: 14px;
    cursor: pointer; font: 600 14.5px/1 'Josefin Sans', sans-serif; color: var(--deep, #0f172a);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  }
  .filter-sort-btn i { color: var(--primary, #0e7490); }
  .filter-sort-btn:active { transform: scale(.985); }

  .courses-archive-body .content { padding: 0 16px 32px; }

  /* Meta facts as a 2-col grid on mobile so duration / depth / season are all
     guaranteed visible (inline-wrap could clip the 3rd fact on narrow phones).
     Marine highlights take their own full-width row. */
  .courses-archive-body .card-meta {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px;
  }
  .courses-archive-body .card-fact { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Marine line spans the row and wraps so the fuller species list stays visible. */
  .courses-archive-body .card-fact-marine { grid-column: 1 / -1; white-space: normal; overflow: visible; align-items: flex-start; }
  .courses-archive-body .card-fact-marine i { margin-top: 2px; }
}

/* ─── Archive hero banner (scoped to /courses/ only) ─── */
body.courses-only-archive-body .courses-hero {
  position: relative;
  background:
    linear-gradient(90deg,
      rgba(15, 23, 42, 0.62) 0%,
      rgba(15, 23, 42, 0.30) 45%,
      rgba(15, 23, 42, 0.05) 70%),
    url('/assets/img/courses/archive-banner.webp') center/cover no-repeat;
  border-bottom: 1px solid rgba(15, 23, 42, 0.15);
}
body.courses-only-archive-body .courses-hero h1,
body.courses-only-archive-body .courses-hero .courses-eyebrow,
body.courses-only-archive-body .courses-hero .courses-lede,
body.courses-only-archive-body .courses-hero-stats strong,
body.courses-only-archive-body .courses-hero-stats span { color: #fff; }
body.courses-only-archive-body .courses-hero .courses-eyebrow { color: rgba(255,255,255,0.92); }
body.courses-only-archive-body .courses-hero .courses-lede,
body.courses-only-archive-body .courses-hero-stats span { color: rgba(255,255,255,0.85); }

/* ─── Catalogue filters (location / agency / marine / search) — added for the
       full SSI+PADI filterable catalogue. Scoped to the /courses/ archive. ─── */
.courses-archive-body .filter-select,
.courses-archive-body .filter-search {
  width: 100%;
  padding: 9px 11px;
  font-size: 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
}
.courses-archive-body .filter-select:focus,
.courses-archive-body .filter-search:focus {
  outline: none;
  border-color: var(--primary, #0e7490);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.12);
}
/* Agency badge colours on cards + chips */
.courses-archive-body .tag-type.tag-padi { background: #1e3a8a; color: #fff; }
.courses-archive-body .tag-type.tag-ssi  { background: #0e7490; color: #fff; }
.courses-archive-body .tag-type.tag-tdi  { background: #b91c1c; color: #fff; }
/* Show-more */
.courses-archive-body .catalogue-more-wrap { grid-column: 1 / -1; text-align: center; padding: 20px 0 8px; }
.courses-archive-body .catalogue-more {
  padding: 11px 22px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary, #0e7490);
  background: #fff;
  border: 1.5px solid var(--primary, #0e7490);
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.courses-archive-body .catalogue-more:hover { background: var(--primary, #0e7490); color: #fff; }

/* Card CTA arrow icon (replaces the literal → for a clean arrow shape) */
.courses-archive-body .card-cta i { margin-left: 6px; font-size: 11px; }

/* ─── Card scuba meta-facts row (duration · depth · season · marine) ─── */
.courses-archive-body .card-meta {
  display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 2px 0 0;
}
.courses-archive-body .card-fact {
  display: inline-flex; align-items: center; gap: 5px;
  font: 500 11.5px/1.3 'Roboto', sans-serif; color: var(--muted, #475569);
}
.courses-archive-body .card-fact i { color: var(--primary, #0e7490); font-size: 11px; width: 13px; text-align: center; }
.courses-archive-body .card-fact-marine { flex-basis: 100%; color: #92400e; }
.courses-archive-body .card-fact-marine i { color: #d97706; }
.courses-archive-body .marine-more { margin-left: 6px; color: var(--dim, #94a3b8); font-weight: 600; }
/* Tighten the (generous) footer + body gap to offset the new meta row so card
   height stays close to before. */
.courses-archive-body .card-footer { min-height: 0; padding-top: 12px; }
.courses-archive-body .card-body { gap: 8px; }

/* ─── Distance / geolocation UI (filterable catalogue) ─── */
.courses-archive-body .results-bar-controls { display: flex; align-items: center; gap: 12px; }
.courses-archive-body .card-dist-badge {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(15,23,42,.82); color: #fff; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(2px);
}
.courses-archive-body .geo-note { color: #64748b; font-size: 12.5px; padding: 6px 2px 0; }
.courses-archive-body .geo-note:empty { display: none; }
.courses-archive-body .geo-note i { color: var(--primary, #0e7490); margin-right: 4px; }

/* ─── Location: India / Outside India parent groups sit a level above the
       nested region sub-groups — make the parent header read as the heading
       and indent + soften the nested region headers under it. ─── */
.courses-archive-body .filter-subgroups > .filter-subsection > .filter-subtitle .sub-name {
  font-weight: 800;
  color: var(--deep, #0f172a);
}
.courses-archive-body .filter-subgroups > .filter-subsection > .filter-subbody .filter-subtitle {
  color: var(--deep, #0f172a);
  font-weight: 700;
}
.courses-archive-body .filter-subgroups > .filter-subsection > .filter-subbody {
  padding-left: 6px;
  border-left: 2px solid var(--primary-soft, rgba(6,182,212,0.18));
  margin-left: 4px;
}

/* ─── Desktop sidebar: no inner scroll, grow with content (full screen).
       Sections collapse by default (JS), so the column stays short until
       expanded, then the page scrolls naturally. Mobile sheet unchanged. ─── */
@media (min-width: 721px) {
  .courses-archive-body .sidebar {
    height: auto;
    max-height: none;
    overflow: visible;
    position: sticky;
    top: 130px;
    align-self: flex-start;
  }
  .courses-archive-body .filter-subgroups {
    max-height: none;
    overflow: visible;
  }
}
