/* ==========================================================================
   ABC Tour — /destinations.php (category page: Northern Malaysia)
   Hero "at a glance" well · Northern Peninsular region panel · trip-style
   category cards · destination grid with a CSS-only (:target) style filter.
   Shared pieces (dest-card, feature, chip, wa-band…) come from components.css.
   ========================================================================== */

/* ---------- Hero ---------- */
.dest-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 72px);
}
.dest-hero .breadcrumb ol { padding: 0; }   /* shared .breadcrumb ol keeps the UA list padding */
.dest-hero .page-hero__title { margin-top: clamp(22px, 3vw, 36px); }

/* "At a glance" pressed well holding raised rings (reference DATA rings) */
.glance {
  padding: clamp(20px, 3vw, 34px);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--inset);
}
.glance__rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.glance__rings li { display: grid; justify-items: center; gap: 12px; }
.glance .ring { --size: clamp(80px, 22vw, 118px); }
.glance .ring__value { font-size: calc(var(--size) * .3); letter-spacing: -.02em; }
.glance__label {
  font-family: var(--font-display); font-size: .72rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2);
}
.glance__facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px;
  margin-top: 26px; padding-top: 22px;
  border-top: 1.5px dashed rgb(var(--shadow-dark));
}
.glance__fact { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; }
.glance__icon {
  grid-row: span 2; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--accent); box-shadow: var(--raise-sm);
}
.glance__icon .icon { width: 19px; height: 19px; }
.glance__fact-label { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); line-height: 1.3; }
.glance__fact-value { font-family: var(--font-display); font-size: 1.1rem; font-weight: 800; color: var(--ink); line-height: 1.25; }

@media (max-width: 900px) {
  .dest-hero__grid { grid-template-columns: 1fr; }
}

/* ---------- Region panel (dark indigo, image left) ---------- */
/* Tight top (sits under the hero) but full bottom padding: the next section's top padding is 0
   (.section + .section), so this alone sets the gap down to "Browse by trip style". */
.region-sec { padding-bottom: var(--section); }
.region-panel {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center; gap: clamp(20px, 3.4vw, 48px);
  padding: 14px; border-radius: var(--r-xl);
  background: var(--panel); color: var(--on-panel); box-shadow: var(--panel-shadow);
}
.region-panel::before {
  content: ""; position: absolute; width: 420px; height: 420px; right: -150px; top: -190px; border-radius: 50%;
  background: radial-gradient(circle, rgb(142 60 255 / .38), transparent 66%); pointer-events: none;
}
.region-panel__media {
  position: relative; align-self: stretch; min-height: 300px; overflow: hidden;
  border-radius: calc(var(--r-xl) - 10px); background: var(--panel-2);
}
.region-panel__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.region-panel__badge { position: absolute; top: 14px; left: 14px; }
.region-panel__badge .icon { color: var(--accent); }

.region-panel__body {
  position: relative; display: flex; flex-direction: column; gap: 18px; min-width: 0;
  padding: clamp(14px, 2.4vw, 30px) clamp(14px, 3vw, 40px) clamp(14px, 2.4vw, 30px) 0;
}
.region-panel__title { font-size: var(--fs-2xl); font-weight: 800; }
.region-panel__text { color: var(--on-panel-2); max-width: 50ch; }

/* North → south mini route (reference A/B/C list) */
.region-route { --route-gap: 10px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--route-gap); margin-block: 4px; }
.region-route li {
  position: relative; display: grid; gap: 2px; min-width: 0;
  padding: 34px 14px 14px; border-radius: var(--r);
  background: rgb(0 0 0 / .16); box-shadow: var(--panel-inset);
}
.region-route__dot {
  position: absolute; top: 14px; left: 14px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--grad-cool); box-shadow: 0 0 0 4px rgb(75 184 238 / .2);
}
.region-route li:not(:last-child)::after {   /* dashed link from this stop's dot to the next one */
  content: ""; position: absolute; top: 19px; left: 34px; right: calc(-1 * var(--route-gap) - 6px);
  border-top: 2px dashed rgb(255 255 255 / .22);
}
.region-route__place { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; color: #fff; overflow-wrap: anywhere; }
.region-route__state { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-sm); color: var(--on-panel-2); }
.region-route__state .icon { flex: none; width: 14px; height: 14px; color: var(--cyan); }

.region-panel__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px;
  margin-top: 4px; padding-top: 20px;
  border-top: 1.5px dashed rgb(255 255 255 / .16);
}
.region-panel__price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.region-panel__price small {
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--on-panel-2);
}
.region-panel__price strong { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; color: #fff; }
.region-panel__price span { font-size: var(--fs-sm); color: var(--on-panel-2); }

@media (max-width: 820px) {
  .region-panel { grid-template-columns: 1fr; gap: 0; padding: 12px; }
  .region-panel__media { min-height: 0; aspect-ratio: 2 / 1; }
  .region-panel__body { padding: 22px 10px 10px; }
}
@media (max-width: 560px) {
  .region-panel__media { aspect-ratio: 16 / 10; }
}
@media (max-width: 420px) {
  .region-route { --route-gap: 8px; }
  .region-route li { padding: 32px 10px 12px; }
  .region-route__dot { left: 10px; }
  .region-route li:not(:last-child)::after { left: 28px; }
  .region-route__place { font-size: .95rem; }
  .region-route__state { font-size: var(--fs-xs); }
}

/* ---------- Static pressed pills (labels, not links) ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--pill);
  font-size: .76rem; font-weight: 600; color: var(--ink-2);
  box-shadow: var(--inset-sm);
}
.pills .icon { width: 14px; height: 14px; color: var(--accent); }

/* ---------- Trip-style category cards ---------- */
.style-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px); }
.style-card {
  position: relative;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.style-card:hover { transform: translateY(-5px); box-shadow: var(--raise-lg); }
.style-card__main { display: grid; gap: 8px; flex: 1; }
.style-card__title { font-size: 1.2rem; font-weight: 800; }
.style-card__foot {
  display: flex; align-items: center; gap: 12px;
  margin-top: 4px; padding-top: 16px;
  border-top: 1.5px dashed rgb(var(--shadow-dark));
}
.style-card__foot .pills { flex: 1; min-width: 0; }
.style-card__go {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); color: var(--accent); box-shadow: var(--raise-sm);
  transition: background .3s, color .3s, box-shadow .3s, transform .3s var(--ease);
}
.style-card__go .icon { width: 20px; height: 20px; }
.style-card:hover .style-card__go { background: var(--grad); color: #fff; box-shadow: var(--glow); transform: translateY(2px); }

/* Tablet: one row per style (icon · text · destinations) */
@media (max-width: 900px) {
  .style-grid { grid-template-columns: 1fr; }
  .style-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px 20px; }
  .style-card__foot { display: contents; }
  .style-card__foot .pills { grid-column: 2; }
  .style-card__go { grid-column: 3; grid-row: 1 / span 2; }
  .style-card .feature__icon { grid-row: 1 / span 2; align-self: start; }
}
/* Phone: icon beside the title, text full width, destinations + arrow on their own row */
@media (max-width: 560px) {
  .style-card { grid-template-columns: auto minmax(0, 1fr); gap: 12px 14px; padding: 20px; }
  .style-card .feature__icon { grid-row: auto; width: 46px; height: 46px; border-radius: 15px; }
  .style-card .feature__icon .icon { width: 22px; height: 22px; }
  .style-card__main { display: contents; }
  .style-card .feature__text { grid-column: 1 / -1; }
  .style-card__foot {
    display: flex; grid-column: 1 / -1;
    margin-top: 2px; padding-top: 14px;
  }
  .style-card__foot .pills, .style-card__go { grid-column: auto; grid-row: auto; }
}

/* ---------- Destination grid + trip-style filter ---------- */
.dest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px); }
.dest-grid__item { display: flex; min-width: 0; transition: opacity .35s var(--ease), filter .35s var(--ease); }
.dest-grid__item > .dest-card { flex: 1; min-width: 0; }
.dest-grid .pills { margin-top: 4px; }
.dest-card__best { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--ink-2); }
.dest-card__best .icon { flex: none; width: 16px; height: 16px; color: var(--accent); }

/* Tablet: single column of horizontal cards (image left) */
@media (max-width: 1000px) and (min-width: 641px) {
  .dest-grid { grid-template-columns: 1fr; }
  .dest-grid .dest-card { flex-direction: row; align-items: stretch; }
  .dest-grid .dest-card__media { flex: 0 0 42%; aspect-ratio: auto; min-height: 260px; }
  .dest-grid .dest-card__body { padding: 10px 10px 6px 24px; }
}
@media (max-width: 640px) {
  .dest-grid { grid-template-columns: 1fr; }
}

/* Anchor targets for the filter sit right above the chips, so a jump lands on chips + cards */
.style-target { display: block; height: 0; }
.style-filter { margin-bottom: clamp(26px, 3.4vw, 40px); }
.style-filter__list > li { flex: none; }
/* --sf-* custom properties let one :target rule restyle the chip, its icon and its count */
.style-filter__chip {
  white-space: nowrap;
  background: var(--sf-bg, var(--surface)); color: var(--sf-ink, var(--ink-2)); box-shadow: var(--sf-shadow, var(--raise-sm));
}
.style-filter__chip .icon { color: var(--sf-ink, var(--accent)); }
.style-filter__chip .chip__count { color: var(--sf-ink, var(--ink-2)); background: var(--sf-count-bg, transparent); box-shadow: var(--sf-count-shadow, var(--inset-sm)); }
.style-filter__chip:hover { color: var(--sf-ink, var(--accent-text)); }

/* Active chip: "All" until a style is targeted, then the targeted style — CSS only */
.all-dests:not(:has(.style-target:target)) .style-filter__chip[href="#destinations"],
.all-dests:has(#style-islands:target) .style-filter__chip[href="#style-islands"],
.all-dests:has(#style-heritage:target) .style-filter__chip[href="#style-heritage"],
.all-dests:has(#style-nature:target) .style-filter__chip[href="#style-nature"] {
  --sf-bg: var(--grad); --sf-ink: #fff; --sf-shadow: var(--glow);
  --sf-count-bg: rgb(255 255 255 / .22); --sf-count-shadow: none;
}
/* Matching destinations move first and get a ring; the others step back (still clickable) */
.all-dests:has(#style-islands:target) .dest-grid__item:not([data-styles~="islands"]),
.all-dests:has(#style-heritage:target) .dest-grid__item:not([data-styles~="heritage"]),
.all-dests:has(#style-nature:target) .dest-grid__item:not([data-styles~="nature"]) {
  order: 1; opacity: .5; filter: grayscale(.8);
}
.all-dests:has(.style-target:target) .dest-grid__item:hover { opacity: 1; filter: none; }
.all-dests:has(#style-islands:target) .dest-grid__item[data-styles~="islands"] .dest-card,
.all-dests:has(#style-heritage:target) .dest-grid__item[data-styles~="heritage"] .dest-card,
.all-dests:has(#style-nature:target) .dest-grid__item[data-styles~="nature"] .dest-card {
  box-shadow: var(--raise), 0 0 0 3px rgb(45 91 255 / .55);
}

/* Tablet/phone: compact chips that wrap (one row on tablet, 2 × 2 on phones) so the active one is always in view */
@media (max-width: 900px) {
  .style-filter__list { gap: 8px; }
  .style-filter__chip { gap: 6px; min-height: 42px; padding: 0 12px; font-size: .8rem; }
  .style-filter__chip .icon { width: 16px; height: 16px; }
  .style-filter__chip .chip__count { min-width: 20px; height: 20px; padding: 0 5px; font-size: .68rem; }
}
