/* ==========================================================================
   Voyamore — Country Guides [voyamore_country_guides]

   Cards deliberately reuse `.vym-cz-card` from the carousel feature so
   country guides and travel-blog cards share one shape. Only the extras
   live here: the filter bar, the grid, and the country-specific card bits
   (region badge, fact chips).

   Native CSS nesting throughout. Tokens from voyamore-core.css.
   ========================================================================== */

.vym-cg {
  font-family: var(--vym-font-ui);
  color: var(--vym-text);

  /* ---- Filter bar ---- */
  & .vym-cg__filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 22px;
  }

  & .vym-cg__search {
    position: relative;
    flex: 1 1 260px;
    min-width: 220px;
    display: flex;
    align-items: center;

    & svg {
      position: absolute;
      left: 16px;
      width: 16px;
      height: 16px;
      color: var(--vym-muted);
      pointer-events: none;
    }

    & .vym-cg__search-input {
      width: 100%;
      padding: 12px 18px 12px 42px;
      border-radius: var(--vym-radius-pill);
      border: 1px solid var(--vym-border);
      background: var(--vym-surface);
      color: var(--vym-text);
      font-family: inherit;
      font-size: 14px;
      transition: border-color 0.25s var(--vym-ease), background 0.25s var(--vym-ease);

      &::placeholder { color: var(--vym-muted); }
      &:focus {
        outline: none;
        border-color: var(--vym-accent);
        background: var(--vym-bg-soft, var(--vym-surface));
      }
    }
  }

  /* The custom-select component sizes itself; just give each cell a floor. */
  & .vym-cg__cell {
    flex: 0 1 210px;
    min-width: 180px;
  }

  & .vym-cg__clear {
    flex: 0 0 auto;
    padding: 11px 18px;
    border-radius: var(--vym-radius-pill);
    border: 1px solid var(--vym-border);
    background: transparent;
    color: var(--vym-muted);
    font-family: var(--vym-font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.25s var(--vym-ease), border-color 0.25s var(--vym-ease);

    &:hover { color: var(--vym-text); border-color: var(--vym-text); }
    &[hidden] { display: none !important; }
  }

  /* ---- Result count ---- */
  & .vym-cg__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    font-size: 14px;
    color: var(--vym-muted);

    & strong {
      font-family: var(--vym-font-display);
      font-size: 22px;
      font-weight: 600;
      color: var(--vym-text);
      margin-right: 4px;
    }
  }

  /* ---- Grid ---- */
  & .vym-cg__grid {
    display: grid;
    gap: 24px;
    align-items: stretch;
  }
  & .vym-cg__grid--cols-1 { grid-template-columns: 1fr; }
  & .vym-cg__grid--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  & .vym-cg__grid--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  & .vym-cg__grid--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  /* ---- Loading state ---- */
  &.is-loading .vym-cg__grid {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s var(--vym-ease);
  }

  /* ---- Load more ---- */
  & .vym-cg__more {
    display: flex;
    justify-content: center;
    margin-top: 32px;

    & .vym-cg__load-more[hidden] { display: none !important; }
  }
}

/* ---- Empty state ---- */
.vym-cg-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--vym-border);
  border-radius: var(--vym-radius);
  color: var(--vym-muted);

  & .vym-display {
    font-family: var(--vym-font-display);
    font-size: 22px;
    color: var(--vym-text);
    margin-bottom: 8px;
  }
  & p { margin: 0; font-size: 14px; }
}

/* ==========================================================================
   Country-guide card extras — layered on top of .vym-cz-card
   ========================================================================== */

.vym-cg-card {

  /* Region badge over the media, mirroring the deal card's type tag. */
  & .vym-cg-card__region {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    background: var(--vym-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--vym-border);
    color: var(--vym-text);
    font-family: var(--font);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 5px;
  }

  /* Fact chips — currency / visa / language pulled from post meta. */
  & .vym-cg-card__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
  }

  & .vym-cg-card__fact {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--vym-radius-pill);
    border: 1px solid var(--vym-border);
    background: var(--vym-glass);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--vym-muted);
    white-space: nowrap;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .vym-cg .vym-cg__grid--cols-3,
  .vym-cg .vym-cg__grid--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .vym-cg .vym-cg__grid--cols-2,
  .vym-cg .vym-cg__grid--cols-3,
  .vym-cg .vym-cg__grid--cols-4 { grid-template-columns: 1fr; }

  .vym-cg .vym-cg__filters { gap: 10px; }
  .vym-cg .vym-cg__cell { flex: 1 1 100%; }
  .vym-cg .vym-cg__search { flex: 1 1 100%; }
}

/* ==========================================================================
   [voyamore_guide_toc] — sticky section nav for a single guide.

   Pinned with `position: fixed`, not sticky. Sticky only holds while the
   element's own parent is tall enough to scroll within, and page builders
   wrap shortcode output in a shrink-to-fit div — so it would scroll away
   immediately. Any ancestor with overflow/transform/filter breaks it too.
   The JS also portals this to <body>, which removes the last failure mode
   (fixed resolving against a transformed ancestor).
   ========================================================================== */

.vym-guide-toc {
  position: fixed;
  top: var(--vym-guide-toc-top, 66px);
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--vym-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--vym-border);
  border-bottom: 1px solid var(--vym-border);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 0.35s var(--vym-ease),
    transform 0.35s var(--vym-ease);
}
.vym-guide-toc.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* Nothing to show until the JS has found some headings. */
.vym-guide-toc[hidden] { display: none !important; }

.vym-guide-toc__inner {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 32px;
  max-width: 1240px;
  margin: 0 auto;
}
.vym-guide-toc__inner::-webkit-scrollbar { display: none; }

.vym-guide-toc__item {
  flex: 0 0 auto;
  font-family: var(--font);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--vym-muted);
  padding: 7px 13px;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
  transition:
    color 0.2s var(--vym-ease),
    background 0.2s var(--vym-ease);
}
.vym-guide-toc__item:hover { color: var(--vym-text); }
.vym-guide-toc__item.is-active {
  color: var(--vym-pill-fg);
  background: var(--vym-accent);
}

@media (max-width: 720px) {
  .vym-guide-toc { top: var(--vym-guide-toc-top-mobile, 60px); }
  .vym-guide-toc__inner { padding: 10px 22px; }
}

@media print { .vym-guide-toc { display: none !important; } }

/* ==========================================================================
   [voyamore_guide_facts] — hero Quick Facts card
   ========================================================================== */

.vym-guide-facts {
  width: 100%;
  max-width: 340px;
  background: var(--vym-surface);
  border: 1px solid var(--vym-border);
  border-radius: 20px;
  padding: 26px 26px 22px;
  box-shadow: 0 40px 80px -34px rgba(60, 45, 30, 0.28);
  font-family: var(--vym-font-ui);
}
html.dark .vym-guide-facts {
  box-shadow: 0 40px 80px -34px rgba(0, 0, 0, 0.6);
}

/* The design sits the card at a slight angle. Opt out with tilt="0" —
   and it straightens itself on narrow screens and for anyone who has
   asked for reduced motion. */
.vym-guide-facts--tilt { transform: rotate(2.5deg); }

.vym-guide-facts__heading {
  margin: 0 0 16px;
  font-family: var(--font);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--vym-accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.vym-guide-facts__heading svg { width: 15px; height: 15px; flex-shrink: 0; }

.vym-guide-facts__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--vym-border);
  font-size: 13.5px;
}
.vym-guide-facts__row:last-child { border-bottom: 0; }
.vym-guide-facts__row span   { color: var(--vym-muted); }
.vym-guide-facts__row strong { font-weight: 600; text-align: right; }

@media (max-width: 880px) {
  .vym-guide-facts { max-width: 360px; margin-inline: auto; }
  .vym-guide-facts--tilt { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .vym-guide-facts--tilt { transform: none; }
}
