/* ============================================================
   SHARED SECTION COMPONENTS (home, about, ...)
   Opt in per page with pageStyles: ['/css/sections.css', ...] in lib/pages.js.
   .sx            a page section        .sx--alt / .sx--dark   its backgrounds
   .sx-head       eyebrow + h2 + intro + link row
   .sx-split      two-column text / photo layout, .sx-collage the photo pair
   .sx-features   icon + title + text list     .sx-cta-card   closing call to action
   .sx-hero       inner-page hero (+ .sx-hero-sub, .sx-chips)
   .sx-tabs       filter tabs with counts (+ .sx-tab-count), .sx-count the "N items" pill
   partials/cta-card.ejs renders the closing call to action (.sx-cta / .sx-cta-card)
   ============================================================ */

/* ─── Section frame ─────────────────────────────────────────── */
.sx {
  position: relative;
  padding: clamp(64px, 8vw, 104px) 0;
  background: var(--surface);
}
.sx--alt  { background: var(--surface-alt); }
.sx--dark { background: var(--dark); color: #fff; }

.sx-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-bottom: clamp(28px, 4vw, 48px);
}
.sx-head--center { justify-content: center; text-align: center; }
.sx-eyebrow {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.sx--dark .sx-eyebrow { color: var(--accent); }
.sx-head h2 { font-size: clamp(1.75rem, 3.1vw, 2.5rem); color: var(--dark); }
.sx-head p {
  max-width: 56ch;
  margin-top: 12px;
  font-size: 1.05rem;
  line-height: var(--leading-ui);
  color: var(--text-muted);
}
.sx-head--center p { margin-left: auto; margin-right: auto; }
.sx--dark .sx-head h2 { color: #fff; }
.sx--dark .sx-head p  { color: rgba(255,255,255,0.7); }

.sx-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary);
}
.sx-link i { font-size: 0.8rem; transition: transform var(--dur-base) var(--ease-out); }
.sx--dark .sx-link { color: var(--accent); }

/* White-on-photo / dark surfaces need the gold focus ring */
.sx--dark :focus-visible,
.sx-cta-card :focus-visible { outline-color: var(--accent); }

/* ─── Inner-page hero ───────────────────────────────────────────
   Goes on a .page-hero (main.css): <section class="page-hero sx-hero">.
   .sx-hero-sub is the intro line, .sx-chips a row of glass facts under it. */
.sx-hero { min-height: 440px; }
.sx-hero--compact { min-height: 320px; }
.sx-hero h1 { color: #fff; }
.sx-hero-sub {
  max-width: 580px;
  margin-top: 12px;
  font-size: 1.1rem;
  line-height: var(--leading-ui);
  color: rgba(255,255,255,0.86);
}
.sx-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.sx-chips li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
}
.sx-chips i { color: var(--accent); font-size: 0.8rem; }

/* ─── 3. Why us ─────────────────────────────────────────────── */
.sx-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 6vw, 88px);
  align-items: center;
}
.sx-collage { position: relative; padding-bottom: 56px; padding-right: 24px; }
.sx-collage-main {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--primary-light);
}
.sx-collage-main > img,
.sx-collage-sub > img { position: absolute; inset: 0; }
.sx-collage-sub {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 44%;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 6px solid var(--surface);
  box-shadow: var(--shadow-lg);
  background: var(--primary-light);
}
.sx-badge {
  position: absolute;
  bottom: 18px;
  left: -14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 190px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-green);
}
.sx-badge strong { font-size: 1.35rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; }
.sx-badge span { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.88; }

.sx-split h2 { color: var(--dark); font-size: clamp(1.75rem, 3.1vw, 2.5rem); }
.sx-lead { margin: 16px 0 0; font-size: 1.05rem; line-height: var(--leading-read); color: var(--text-muted); }
.sx-features {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 32px;
  margin: 32px 0;
}
.sx-features li { display: flex; gap: 14px; align-items: flex-start; }
.sx-feature-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
}
.sx-features h3 { margin: 0 0 4px; font-size: 1.02rem; line-height: 1.3; color: var(--dark); letter-spacing: -0.005em; }
.sx-features p { margin: 0; font-size: 0.9rem; line-height: var(--leading-ui); color: var(--text-muted); }


/* ─── Filter tabs with counts (tours, blog) ─────────────────────
   <div class="filter-tabs sx-tabs"> of <a class="filter-tab"><span>Label</span><span class="sx-tab-count">3</span></a>.
   One row when it fits; below the container width it becomes one swipeable
   strip (an orphan pill on a second row looks broken). The strip bleeds to the
   screen edge, and its padding keeps focus rings unclipped. */
.sx-tabs { gap: 10px; }
.sx-tabs .filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 9px 18px;
  white-space: nowrap;
}
.sx-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: var(--radius-pill);
  background: var(--surface-alt);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  font-variant-numeric: lining-nums tabular-nums;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.sx-tabs .filter-tab.active { box-shadow: var(--shadow-green); }
.sx-tabs .filter-tab.active .sx-tab-count { background: rgba(255,255,255,0.2); color: #fff; }

/* "11 itineraries": sits at the end of an .sx-head */
.sx-count {
  flex: none;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary-light);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-dark);
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
/* .sx-head p caps and spaces paragraphs; the count is not an intro line */
.sx-head .sx-count { max-width: none; margin-top: 0; font-size: 0.9rem; line-height: 1.4; color: var(--primary-dark); }

/* ─── 11. Final call to action ──────────────────────────────── */
.sx-cta { padding: clamp(48px, 6vw, 80px) 0; background: var(--surface-alt); }
.sx-cta--plain { background: var(--surface); }
.sx-cta-actions, .sx-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.sx-cta-card {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(28px, 5vw, 64px);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(90% 120% at 0% 0%, rgba(200,146,42,0.2) 0%, rgba(200,146,42,0) 55%),
    linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 100%);
  box-shadow: var(--shadow-xl);
}
.sx-cta-card h2 { color: #fff; font-size: clamp(1.7rem, 3vw, 2.4rem); }
.sx-cta-card p { margin: 14px 0 26px; max-width: 52ch; font-size: 1.02rem; line-height: var(--leading-read); color: rgba(255,255,255,0.8); }
.sx-cta-contacts { list-style: none; display: grid; gap: 12px; }
.sx-cta-contacts a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-weight: 600;
  transition: background-color var(--dur-base) ease, border-color var(--dur-base) ease, transform var(--dur-fast) var(--ease-out);
}
.sx-cta-contacts a i {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--dark);
  font-size: 1rem;
}
.sx-cta-contacts a span { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.sx-cta-contacts a small { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.62); }


/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 1240px) {
  .sx-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: -4px -24px;
    padding: 4px 48px 4px 24px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* fade the right edge so a cut-off tab reads as "more this way" */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }
  .sx-tabs::-webkit-scrollbar { display: none; }
  .sx-tabs .filter-tab { flex: none; }
}
@media (max-width: 768px) {
  .sx-tabs { margin-left: -20px; margin-right: -20px; padding-left: 20px; }
}
@media (max-width: 1024px) {
  .sx-split { grid-template-columns: minmax(0, 1fr); }
  .sx-collage { max-width: 640px; }
  .sx-cta-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .sx-features { grid-template-columns: minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 600px) {
  /* the content (title, intro, chips) is taller than the min-height here: let it size the hero and clear the bar */
  .sx-hero { height: auto; min-height: 0; padding-top: calc(var(--nav-height) + 28px); }
}
@media (max-width: 640px) {
  .sx-tabs .filter-tab { padding: 7px 10px 7px 14px; }
  .sx-cta-contacts a { padding: 14px; gap: 12px; }
  .sx-cta-contacts a span { font-size: 0.9rem; }
  .sx-collage { padding-right: 12px; }
  .sx-badge { left: -4px; bottom: 14px; padding: 12px 14px; }
}
@media (hover: hover) {
  .sx-link:hover i { transform: translateX(4px); }
  .sx-cta-contacts a:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.3); }
}
@media (prefers-reduced-motion: reduce) {
  .sx-link i { transition: none; }
}
