/*
 * GUIDE V1 — CANDIDATE
 *
 * Scope:
 * - Guide section only
 * - Type and area filters
 * - Venue card grid
 * - Internal scrolling
 *
 * Hero and Events are locked and untouched.
 */

[data-home-section="guide"] {
  --guide-inline: clamp(12px, 2.5vw, 42px);
  --guide-top-gap: clamp(10px, 1.7vh, 20px);
  --guide-bottom-gap: clamp(10px, 1.7vh, 18px);
  --guide-filter-gap: clamp(6px, .8vw, 10px);
  --guide-card-gap: clamp(8px, 1vw, 14px);

  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  padding:
    var(--guide-top-gap)
    var(--guide-inline)
    var(--guide-bottom-gap);
}

[data-home-section="guide"] > .container,
[data-home-section="guide"] .home-section-shell,
[data-home-section="guide"] .guide-shell {
  width: min(100%, 1540px);
  height: 100%;
  min-height: 0;
  margin-inline: auto;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(10px, 1.4vh, 18px);
}

/* Filter bar */
[data-home-section="guide"] .home-filter-bar,
[data-home-section="guide"] .guide-filter-bar,
[data-home-section="guide"] .filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(10px, 2vw, 26px);
  min-width: 0;
}

[data-home-section="guide"] .filter-group,
[data-home-section="guide"] .filters-left,
[data-home-section="guide"] .filters-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--guide-filter-gap);
  min-width: 0;
}

[data-home-section="guide"] .filter-chip,
[data-home-section="guide"] .filter-button,
[data-home-section="guide"] [data-filter] {
  min-height: 34px;
  padding: 7px 13px;
  border-radius: 999px;
  line-height: 1;
  white-space: nowrap;
}

/* Venue grid */
[data-home-section="guide"] .venues-grid,
[data-home-section="guide"] .guide-grid,
[data-home-section="guide"] .home-guide-grid,
[data-home-section="guide"] .places-grid {
  min-height: 0;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;

  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-content: start;
  gap: var(--guide-card-gap);
  padding: 1px 2px 4px;
}

[data-home-section="guide"] .venue-card,
[data-home-section="guide"] .guide-card,
[data-home-section="guide"] .place-card,
[data-home-section="guide"] .home-guide-card {
  min-width: 0;
  overflow: hidden;
  border-radius: clamp(10px, 1vw, 16px);
  cursor: pointer;
  box-sizing: border-box;
}

/* Media area remains visually stable regardless of content title length. */
[data-home-section="guide"] .venue-card img,
[data-home-section="guide"] .guide-card img,
[data-home-section="guide"] .place-card img,
[data-home-section="guide"] .home-guide-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

/* Text inside cards must never force the grid wider. */
[data-home-section="guide"] .venue-card *,
[data-home-section="guide"] .guide-card *,
[data-home-section="guide"] .place-card *,
[data-home-section="guide"] .home-guide-card * {
  min-width: 0;
  box-sizing: border-box;
}

[data-home-section="guide"] .venue-card h3,
[data-home-section="guide"] .guide-card h3,
[data-home-section="guide"] .place-card h3,
[data-home-section="guide"] .home-guide-card h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Venue logo badge: owned by the Guide module, not the historical global stylesheet. */
[data-home-section="guide"] .home-guide-poster-logo {
  box-sizing: border-box;
  padding: clamp(5px, .45vw, 8px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  background: rgba(10, 8, 14, .78);
  box-shadow: 0 6px 22px rgba(0, 0, 0, .48), inset 0 0 0 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(5px);
}

[data-home-section="guide"] .home-guide-poster-logo img {
  display: block;
  border-radius: 50%;
}

[data-home-section="guide"] .home-guide-rooftop-badge {
  position: absolute;
  z-index: 4;
  top: 7px;
  right: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(245,218,151,.66);
  border-radius: 999px;
  background: rgba(8,7,10,.82);
  color: #f3d78e;
  box-shadow: 0 5px 16px rgba(0,0,0,.42);
  font-size: clamp(.48rem,.62vw,.64rem);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  backdrop-filter: blur(7px);
}

/* Complete catalogue: one horizontally scrollable row. Touch/trackpad swiping
   remains native; the overlay arrows provide an explicit desktop control. */
[data-home-section="guide"] .home-guide-carousel {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

[data-home-section="guide"] .home-guide-poster-grid {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start;
  gap: var(--guide-card-gap);
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.36) transparent;
  padding: 1px 3px 8px;
}

[data-home-section="guide"] .home-guide-poster-card {
  flex: 0 0 calc((100% - (8 * var(--guide-card-gap))) / 9) !important;
  width: auto !important;
  scroll-snap-align: start;
}

[data-home-section="guide"] .home-guide-scroll-button {
  position: absolute;
  z-index: 12;
  top: 50%;
  width: 40px;
  height: 54px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 999px;
  background: rgba(7,5,10,.82);
  color: #fff;
  box-shadow: 0 8px 26px rgba(0,0,0,.55);
  backdrop-filter: blur(9px);
  font: 300 2.25rem/1 Arial, sans-serif;
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity .18s ease, transform .18s ease, background .18s ease;
}
[data-home-section="guide"] .home-guide-scroll-prev { left: 7px; }
[data-home-section="guide"] .home-guide-scroll-next { right: 7px; }
[data-home-section="guide"] .home-guide-scroll-button:hover:not(:disabled) {
  background: rgba(28,19,37,.95);
  transform: translateY(-50%) scale(1.06);
}
[data-home-section="guide"] .home-guide-scroll-button:disabled { opacity: .22; cursor: default; }
[data-home-section="guide"] .home-guide-scroll-button[hidden] { display: none !important; }

@media (min-width: 1700px) {
  [data-home-section="guide"] .home-guide-poster-card { flex-basis: calc((100% - (10 * var(--guide-card-gap))) / 11) !important; }
}
@media (min-width: 1000px) and (max-width: 1299px) {
  [data-home-section="guide"] .home-guide-poster-card { flex-basis: calc((100% - (7 * var(--guide-card-gap))) / 8) !important; }
}
@media (max-width: 999px) {
  [data-home-section="guide"] .home-guide-poster-card { flex-basis: calc((100% - (5 * var(--guide-card-gap))) / 6) !important; }
}
@media (max-width: 700px) {
  [data-home-section="guide"] .home-guide-poster-card { flex-basis: calc((100% - (4 * var(--guide-card-gap))) / 5) !important; }
  [data-home-section="guide"] .home-guide-scroll-button { width: 34px; height: 46px; font-size: 1.9rem; }
}
@media (max-width: 520px) {
  [data-home-section="guide"] .home-guide-poster-card { flex-basis: calc((100% - (3 * var(--guide-card-gap))) / 4) !important; }
}

/* V45 — fill the available height first, then continue horizontally.
   Column-wrapping makes the number of rows adapt naturally to screen height. */
[data-home-section="guide"] .home-guide-poster-grid {
  display: flex !important;
  flex-flow: column wrap !important;
  align-content: flex-start !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scroll-snap-type: x proximity;
}

[data-home-section="guide"] .home-guide-poster-card {
  flex: 0 0 clamp(108px, 18vh, 164px) !important;
  width: auto !important;
  height: clamp(108px, 18vh, 164px) !important;
  aspect-ratio: 4 / 5 !important;
  scroll-snap-align: start;
}

@media (max-width: 1023px) {
  [data-home-section="guide"] .home-guide-poster-card {
    flex-basis: clamp(94px, 17vh, 142px) !important;
    height: clamp(94px, 17vh, 142px) !important;
  }
}

@media (max-width: 520px) {
  [data-home-section="guide"] .home-guide-poster-card {
    flex-basis: clamp(82px, 16vh, 122px) !important;
    height: clamp(82px, 16vh, 122px) !important;
  }
}

/* Laptop */
@media (min-width: 1024px) and (max-width: 1365px) {
  [data-home-section="guide"] .venues-grid,
  [data-home-section="guide"] .guide-grid,
  [data-home-section="guide"] .home-guide-grid,
  [data-home-section="guide"] .places-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  [data-home-section="guide"] .venues-grid,
  [data-home-section="guide"] .guide-grid,
  [data-home-section="guide"] .home-guide-grid,
  [data-home-section="guide"] .places-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 767px) {
  [data-home-section="guide"] {
    --guide-inline: 8px;
    --guide-top-gap: 8px;
    --guide-card-gap: 7px;
  }

  [data-home-section="guide"] .home-filter-bar,
  [data-home-section="guide"] .guide-filter-bar,
  [data-home-section="guide"] .filter-row {
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  [data-home-section="guide"] .filter-group,
  [data-home-section="guide"] .filters-left,
  [data-home-section="guide"] .filters-right {
    flex-wrap: nowrap;
  }

  [data-home-section="guide"] .filter-chip,
  [data-home-section="guide"] .filter-button,
  [data-home-section="guide"] [data-filter] {
    min-height: 31px;
    padding: 6px 10px;
    font-size: .72rem;
  }

  [data-home-section="guide"] .venues-grid,
  [data-home-section="guide"] .guide-grid,
  [data-home-section="guide"] .home-guide-grid,
  [data-home-section="guide"] .places-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Very narrow phones */
@media (max-width: 340px) {
  [data-home-section="guide"] .venues-grid,
  [data-home-section="guide"] .guide-grid,
  [data-home-section="guide"] .home-guide-grid,
  [data-home-section="guide"] .places-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
