/* â”€â”€ PAGE BASE â”€â”€ */
section { position: relative; z-index: 1; }
/* Masthead height and the hero pattern now live in global.css (inner-page masthead).
   They used to be duplicated here; the bare min-height had no media query and beat
   global's own mobile rule at every width. Do not re-add them. */
.page-hero-content p {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 22px;
  font-weight: 400;
  color: #ffffff;
}

/* â”€â”€ FILTERS â”€â”€ */
.filters-section {
  background: #fff;
  padding: 24px 0;
  
  position: relative; z-index: 2;
}
.filter-bar {
  display: flex;
  align-items: stretch;
}
.filter-group-block {
  flex: 0 0 60%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  padding: 8px 0;
}
.filter-group-block.filter-type {
  flex: 0 0 35%;
}
.filter-separator {
  width: 1px;
  flex-shrink: 0;
  background: rgba(0,0,0,0.15);
  align-self: stretch;
  margin: 0 28px;
}
.filter-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: #505050;
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-pills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-pill {
  border: 1px solid #cccccc;
  border-radius: 100px;
  background: transparent;
  color: #505050;
  transition: all 0.18s;
  line-height: 1;
  white-space: nowrap;
}
.filter-pill.active { background: #043042; border-color: #043042; color: #fff; }
.filter-pill:hover:not(.active) { border-color: #043042; color: #043042; }

/* Mobile dropdown filters — hidden on desktop, shown ≤768px (see media query).
   Two selects side by side; the closed control is brand-styled, the open list
   is the native OS picker. */
.filter-selects { display: none; }
.filter-select-group {
  display: flex; flex-direction: column; gap: 6px;
  flex: 1 1 0; min-width: 0; /* allow shrink so both fit one row */
}
.filter-select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  width: 100%;
  font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 600;
  color: #043042; background-color: #fff;
  border: 1px solid #cccccc; border-radius: 100px;
  padding: 12px 40px 12px 18px;
  line-height: 1.2; cursor: pointer;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  /* cerise chevron */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ed1858' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
  transition: border-color 0.18s;
}
.filter-select:focus { outline: none; border-color: #043042; box-shadow: 0 0 0 3px rgba(4,48,66,0.12); }

/* â”€â”€ TOUR CARDS GRID â”€â”€ */
.tours-grid-section {
  padding: 48px 0 96px;
  background-color: #FAF8F5;
  background-image: url('../images/bg-pattern.svg');
  background-repeat: repeat;
  background-size: auto;
}
.tour-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.tour-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  transition: transform 0.25s, box-shadow 0.25s;
  border: 1px solid rgba(0,0,0,0.04);
  display: flex; flex-direction: column;
  position: relative;
}
.card-title a {
  text-decoration: none;
  color: inherit;
}
.card-title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
.tour-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
}
.card-image {
  position: relative;
  padding-bottom: 60%;
  overflow: hidden;
}
.card-image-inner {
  position: absolute; inset: 0;
  background: center/cover no-repeat;
  transition: transform 0.4s;
}
.tour-card:hover .card-image-inner { transform: scale(1.04); }
.card-badge {
  position: absolute; top: 12px; left: 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 2px;
  background: var(--cerise); color: #fff;
}
.card-badge.badge-training { background: var(--cerise); }
.card-wishlist {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.card-wishlist:hover { background: rgba(255, 255, 255, 0.6); }
.card-wishlist.active svg { fill: #ffffff; stroke: #ffffff; }
.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-dest {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px; font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cerise); margin-bottom: 6px;
}
.card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 22px; font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy); margin-bottom: 15px;
  line-height: 1.2;
}
/* Excerpt shows FOUR lines (client, 3 Aug 2026), with the type stepped down and
   the leading tightened so the extra two lines cost less height than they would
   have: 18px/1.55 x 2 lines = 56px became 16px/1.35 x 4 = 86px, so the card
   grows about 30px rather than the 56px a straight doubling would have added. */
.card-desc {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px; font-weight: 400; color: #505050; line-height: 1.35;
  margin-bottom: 16px;
  display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4;
  -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: auto;
  border-top: 1px solid #f2f2f2; padding-top: 16px;
}
.card-meta-stack {
  display: flex; flex-direction: column;
}
/* Sentence case, not caps (client instruction 31 Jul 2026: "Date in upper/
   lower case. ie Sep 2026"). The stored values are ALREADY sentence case —
   "Sep 2026", "Nov - Feb 2027", "07 - 11 Aug 2026" — so dropping the
   text-transform is the whole fix; nothing needs reformatting in PHP.
   Durations ("9D8N") are uppercase in the data and so are unaffected. */
.card-meta-item {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; font-weight: 600;
  color: #000000;
  line-height: 1.6;
}
/* Coming-soon tours have no date to show — flag the status in cerise instead. */
.card-meta-item.card-meta-soon { color: var(--cerise); }
/* ORPHANED 31 Jul 2026 — no template emits .card-meta-request any more; the
   client asked for "Dates on request" to be removed from the cards. Kept so the
   label can be restored without re-deriving the styling. Original note: the
   month shown beside it is a SEASON, not a departure, so the slot said so;
   muted rather than cerise because it qualified the date rather than alerting
   like "Coming soon". */
.card-price-block {
  display: flex; flex-direction: column;
  align-items: flex-start;
  margin-left: auto;
}
/* "From", not "FROM" (client instruction 31 Jul 2026). Markup already says
   "From" — the caps were this text-transform. */
.card-price-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 11px; font-weight: 400;
  color: #505050;
  letter-spacing: 0.05em; text-align: left;
}
.card-price-figure {
  font-family: 'Playfair Display', serif;
  font-size: 28px; font-weight: 900;
  color: #043042; text-align: left;
}
.card-price-figure.enquire { color: #043042; }
/* "Price on request" reads as a label, not a figure, so it drops the display face
   and huge size the day-rate uses (added 2026-07-21). */
.card-price-figure.card-price-request {
  font-family: var(--font-card);
  font-size: 15px; font-weight: 700;
  white-space: nowrap;
}
.no-tours {
  grid-column: 1 / -1;
  text-align: center;
  padding: 72px 20px;
  display: none;
}

/* â”€â”€ UPCOMING DEPARTURES â”€â”€ */
.departures-section {
  background: var(--navy);
  padding: 80px 0 96px;
  position: relative; overflow: hidden;
}
.departures-section::before {
  content: '';
  position: absolute; top: -120px; right: -80px;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(237,24,88,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.departures-section .section-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; font-weight: 300;
  text-transform: uppercase; letter-spacing: 0.15em;
  color: #ffffff;
}
.dep-heading {
  font-family: var(--font-heading);
  font-size: 48px; font-weight: 900; color: #fff;
  letter-spacing: -1px; line-height: 1.1;
  margin-bottom: 40px;
}
.dep-heading em { font-style: italic; color: var(--cerise); }
.departures-section .tours-filters {
  display: inline-flex;
  gap: 0;
  margin-bottom: 60px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px;
  border-radius: 3px;
}
.departures-section .filter-pill {
  padding: 15px 20px;
  border-radius: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  cursor: pointer; transition: all 0.2s;
  border: none;
  background: transparent; color: rgba(255,255,255,0.6);
}
.departures-section .filter-pill.active { background: var(--cerise); color: #fff; }
.departures-section .filter-pill:hover:not(.active) { color: #fff; }
.dep-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.dep-table thead tr { border-bottom: 1px solid rgba(255,255,255,0.1); }
.dep-table thead th {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  padding: 0 20px 16px 0;
  text-align: left;
}
.dep-table thead th:last-child { text-align: right; padding-right: 0; }

/* Sortable headers: the <button> inherits the uppercase header styling so it
   reads as the header itself, plus a hover/active affordance and a caret. */
.dep-table thead th.dep-sortable { padding: 0; }
.dep-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,0.32);
  padding: 0 20px 16px 0;
  transition: color 0.15s;
}
.dep-sort-btn:hover { color: rgba(255,255,255,0.7); }
.dep-sortable.sorted-asc .dep-sort-btn,
.dep-sortable.sorted-desc .dep-sort-btn { color: #fff; }
/* Neutral caret (both chevrons, dimmed) shown by default; active direction
   lights the matching chevron. */
.dep-sort-arrow {
  position: relative;
  width: 8px; height: 13px;
  flex: 0 0 auto;
}
.dep-sort-arrow::before,
.dep-sort-arrow::after {
  content: '';
  position: absolute;
  left: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  opacity: 0.35;
  transition: opacity 0.15s;
}
.dep-sort-arrow::before { /* up */
  top: 0;
  border-bottom: 5px solid currentColor;
}
.dep-sort-arrow::after { /* down */
  bottom: 0;
  border-top: 5px solid currentColor;
}
.dep-sortable.sorted-asc .dep-sort-arrow::before { opacity: 1; }
.dep-sortable.sorted-asc .dep-sort-arrow::after { opacity: 0.2; }
.dep-sortable.sorted-desc .dep-sort-arrow::after { opacity: 1; }
.dep-sortable.sorted-desc .dep-sort-arrow::before { opacity: 0.2; }
.dep-row {
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.dep-row td {
  padding: 20px 20px 20px 0;
  vertical-align: middle;
}
.dep-row td:last-child { padding-right: 0; }
.dep-tour-name {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
}
.dep-dest {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #ED1858;
}
.dep-dates, .dep-duration {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  color: rgba(255,255,255,0.78);
}
.dep-dates { white-space: nowrap; }
.type-badge {
  display: inline-block;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  text-transform: none;
  padding: 8px 20px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.08);
  color: #ED1858;
}
/* Stack multiple type badges (e.g. Private + Training) with breathing room.
   align-items:flex-start keeps each pill hugging its own text width. */
.type-badges {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.dep-cta-cell { text-align: right; }
.btn-dep-book {
  display: inline-block; width: 150px; text-align: center;
  padding: 10px 20px;
  background: transparent; color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  border: 1px solid #fff; cursor: pointer; border-radius: 0;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-dep-book:hover { background: #fff; color: var(--navy); }

/* ============================================================
   RESPONSIVE — page-specific overrides (global.css handles nav/footer)
   Desktop (>=1280) unchanged. Only max-width rules below.
   ============================================================ */

/* ---- 1024px: 3-col cards → 2-col ---- */
@media (max-width: 1024px) {
  .tour-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .dep-heading { font-size: 40px; }

  /* Tablet (769–1024px): pill filters still show here. Put each filter's
     label ABOVE its pills, left-aligned, and give the two groups their own
     rows so nothing is cramped. (Below 769px it becomes the dropdowns.) */
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-group-block,
  .filter-group-block.filter-type {
    flex: 1 1 auto;
    flex-direction: column;   /* label on its own line above the pills */
    align-items: flex-start;  /* left-align both label and pills */
    gap: 10px;
  }
  .filter-separator {
    width: auto; height: 1px;
    align-self: stretch;
    margin: 16px 0;
  }
}

/* ---- 768px: single column + filter/table stacking ---- */
@media (max-width: 768px) {
  .tours-grid-section { padding: 40px 0 56px; }
  .departures-section { padding: 56px 0; }

  /* Cards → single column */
  .tour-cards-grid { grid-template-columns: 1fr; }

  /* Filters → swap the pill bar for two side-by-side dropdowns */
  .filter-bar { display: none; }
  .filter-selects {
    display: flex;
    gap: 12px;
    align-items: flex-end;
  }
  .filter-select-group .filter-label { margin-bottom: 2px; }

  /* Departures filter pills wrap */
  .departures-section .tours-filters { flex-wrap: wrap; margin-bottom: 32px; }
  .dep-heading { font-size: 34px; }

  /* Departures table → structured cards (kills horizontal overflow + beautifies) */
  .dep-table,
  .dep-table tbody,
  .dep-table tr { display: block; width: 100%; }
  .dep-table { table-layout: auto; }
  .dep-table thead { display: none; }

  /* Stack rows as spaced cards */
  .dep-table tbody { display: flex; flex-direction: column; gap: 16px; }

  /* Each row → a card: name|badge on top, dest, a 2-col dates|duration
     meta strip, then a full-width CTA.
     (`.dep-table tr.dep-row` so grid beats the `.dep-table tr{display:block}` above) */
  .dep-table tr.dep-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name     badge"
      "dest     dest"
      "dates    duration"
      "cta      cta";
    align-items: start;
    gap: 6px 16px;
    padding: 18px 18px 20px;
    border: 1px solid rgba(255,255,255,0.12);
    border-bottom: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
  }
  .dep-row td { display: block; padding: 0; width: auto; }
  .dep-row td[style*="width"] { width: auto !important; }

  /* Cell placement by DOM order: name, dest, dates, duration, badge, cta */
  .dep-row td:nth-child(1) { grid-area: name; align-self: center; }
  .dep-row td:nth-child(2) { grid-area: dest; }
  .dep-row td:nth-child(3) { grid-area: dates; }
  .dep-row td:nth-child(4) { grid-area: duration; text-align: right; }
  .dep-row td:nth-child(5) { grid-area: badge; align-self: center; justify-self: end; }
  .dep-cta-cell { grid-area: cta; }

  .dep-tour-name { font-size: 20px; margin-bottom: 0; }
  .dep-dest { font-size: 15px; margin-bottom: 4px; }

  /* Meta strip: labelled Dates (left) + Duration (right), divider above both */
  .dep-row td[data-label] {
    padding-top: 14px; margin-top: 8px;
    position: relative;
  }
  .dep-row td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    margin-bottom: 4px;
  }
  /* one divider spanning both meta columns (drawn from the dates cell) */
  .dep-row td:nth-child(3)::after {
    content: ""; position: absolute; top: 0; left: 0;
    width: calc(200% + 16px); height: 1px;
    background: rgba(255,255,255,0.12);
  }
  .dep-dates, .dep-duration { font-size: 16px; white-space: normal; }

  /* Full-width CTA */
  .dep-cta-cell { text-align: left; margin-top: 18px; }
  .btn-dep-book {
    display: block; width: 100%; text-align: center;
    padding: 13px 20px; font-size: 12px;
  }
}

/* ---- 480px: phone tightening ---- */
@media (max-width: 480px) {
  .card-title { font-size: 20px; }
  /* 15px here, a step under the new 16px desktop size — on a phone the card is
     full width, so four lines is a taller block than it is in a three-up grid. */
  .card-desc { font-size: 15px; }
  .dep-heading { font-size: 28px; }
  .filter-pill { white-space: normal; }
}