/* ============================================
   MENUS - Home Page
   ============================================ */

/* ── Hero ──────────────────────────────────────────────────────────── */
.home-hero {
  padding-top: var(--space-16);
  padding-bottom: var(--space-10);
}

.home-hero__text {
  max-width: 680px;
  margin-bottom: var(--space-10);
}

.home-hero__title {
  font-family: var(--font-body);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--color-fg);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.home-hero__title em {
  font-style: italic;
  color: var(--color-accent-deep);
}

/* Card name - stronger typographic hierarchy */
.venue-card__name {
  font-family: var(--font-body);
  letter-spacing: -0.01em;
}

.home-hero__subtitle {
  font-size: var(--text-lg);
  color: var(--color-fg);
  opacity: 0.65;
  max-width: 480px;
}

/* ── Search bar ────────────────────────────────────────────────────── */
.home-search {
  max-width: 900px;
}

.home-search__inner {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.home-search__field {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.home-search__field svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-fg);
  opacity: 0.4;
  pointer-events: none;
}

.home-search__field .input {
  padding-left: 2.75rem;
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  height: 52px;
}

.home-search__select-wrap {
  position: relative;
  flex-shrink: 0;
}

.home-search__select {
  height: 52px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  background-color: var(--color-white);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23283618' stroke-width='1.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 0.9rem center;
  min-width: 140px;
}

/* ── Filter pills ──────────────────────────────────────────────────── */
.home-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background-color: var(--color-white);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-fg);
  opacity: 0.8;
  cursor: pointer;
  transition: background-color var(--transition-base),
              border-color var(--transition-base),
              color var(--transition-base),
              opacity var(--transition-base);
  min-height: 36px;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  opacity: 1;
}

.filter-pill.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  opacity: 1;
}

/* Checkmark on active pill */
.filter-pill.active::before {
  content: "";
  width: 13px;
  height: 13px;
  margin-right: 0.4rem;
  flex-shrink: 0;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ── Active filter chips ───────────────────────────────────────────── */
.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

.active-filter-chips[hidden] { display: none; }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-primary);
  background-color: var(--color-muted);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--transition-base), color var(--transition-base);
}

.filter-chip svg {
  width: 14px;
  height: 14px;
}

.filter-chip:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.filter-chip--clear {
  border-style: dashed;
  border-color: var(--color-border);
  background-color: transparent;
  color: var(--color-fg);
  opacity: 0.7;
  padding-left: 0.85rem;
}

.filter-chip--clear:hover {
  background-color: var(--color-fg);
  color: var(--color-white);
  border-color: var(--color-fg);
  opacity: 1;
}

/* ── Venue listing ─────────────────────────────────────────────────── */
.venue-listing {
  padding-top: var(--space-6);
}

.venue-listing__count {
  font-size: var(--text-sm);
  color: var(--color-fg);
  opacity: 0.5;
  margin-bottom: var(--space-8);
  min-height: 1.2em;
}

.venue-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8);
  align-items: start;
}

/* Masonry: JS sets grid-row-end span per card (desktop/tablet only).
   Scoped to the home grid (#venue-grid) only - other pages that reuse
   home.css (e.g. reviews) keep the normal auto-row grid so their cards
   never collapse to 8px when no masonry JS is present. */
@media (min-width: 641px) {
  #venue-grid.venue-grid {
    grid-auto-rows: 8px;
  }
}

/* ── Venue card ────────────────────────────────────────────────────── */
.venue-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(16px);
  transition: transform var(--transition-slow),
              box-shadow var(--transition-slow),
              opacity var(--transition-slow);
}

.venue-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.venue-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.venue-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

/* Image */
.venue-card__image-wrap {
  position: relative;
  overflow: hidden;
  height: 200px;
  flex-shrink: 0;
}

.venue-card__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-slower);
  background-color: var(--color-muted);
}


.venue-card:hover .venue-card__image-wrap img {
  transform: scale(1.05);
}

/* Open/closed badge */
.venue-badge {
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Badge on image - absolute */
.venue-card__image-wrap .venue-badge {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
}

/* Badge in meta row - inline */
.venue-card__meta .venue-badge {
  position: static;
  margin-left: auto;
}

.venue-badge--open {
  background-color: rgba(96, 108, 56, 0.9);
  color: var(--color-white);
}

.venue-badge--closed {
  background-color: rgba(40, 54, 24, 0.55);
  color: var(--color-bg);
}


/* Body */
.venue-card__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.venue-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
}

.venue-card__name {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-fg);
  line-height: 1.3;
}

.venue-card__price {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-accent-deep);
  flex-shrink: 0;
}

.venue-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.venue-card__type {
  font-size: var(--text-xs);
  background-color: var(--color-muted);
  color: var(--color-fg);
  padding: 0.2rem 0.65rem;
}

.venue-card__city {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
  color: var(--color-fg);
  opacity: 0.55;
}

.venue-card__city svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.venue-card__desc {
  font-size: var(--text-sm);
  color: var(--color-fg);
  opacity: 0.6;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
}

/* Rating row */
.venue-card__rating {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.venue-card__stars {
  display: flex;
  gap: 2px;
}

.venue-card__star {
  width: 13px;
  height: 13px;
  color: var(--color-accent-deep);
  flex-shrink: 0;
}

.venue-card__star--empty {
  color: var(--color-border);
}

.venue-card__rating-avg {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-fg);
}

.venue-card__rating-count {
  font-size: var(--text-xs);
  color: var(--color-fg);
  opacity: 0.5;
}

/* Amenity icons - pushed to bottom */
.venue-card__amenities {
  display: flex;
  gap: var(--space-2);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.venue-amenity {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background-color: var(--color-muted);
  color: var(--color-primary);
  transition: background-color var(--transition-base);
}

.venue-amenity:hover {
  background-color: var(--color-muted-2);
}

.venue-amenity svg {
  width: 14px;
  height: 14px;
  stroke-width: 1.5;
}

/* ── Skeleton ──────────────────────────────────────────────────────── */
.venue-card-skeleton {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
}

.venue-card-skeleton__body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* In the home masonry grid, skeletons aren't .venue-card so the JS never
   assigns them a row span - without this they'd collapse to a single 8px
   row and the footer would slam up under the loader. Give them a fixed
   span (~card height) so the grid reserves real vertical space on load. */
@media (min-width: 641px) {
  #venue-grid .venue-card-skeleton {
    grid-row: span 46;
  }
}

/* Prvo ucitavanje: dok home.js ne zameni grid, prikazi skeleton, a SSR
   kartice (za crawlere) drzi skrivene. Bez JS-a obrnuto. */
.js #venue-grid[data-ssr] > .venue-card { display: none; }
html:not(.js) #venue-grid .venue-card-skeleton { display: none; }

/* ── No results ────────────────────────────────────────────────────── */
/* When the grid holds only the empty state, drop the masonry (8px auto
   rows make the block collapse and its contents spill). Switch to a plain
   centered block so the illustration + CTA stack cleanly. */
.venue-grid--empty {
  display: block !important;
  grid-template-columns: none !important;
}

.venue-no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-16) var(--space-4) var(--space-20);
  /* Never let the (short) empty state collapse the page so the footer
     rides up - reserve a comfortable minimum so layout stays stable. */
  min-height: 420px;
  justify-content: center;
  animation: venue-empty-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes venue-empty-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.venue-no-results__art {
  width: 140px;
  height: 140px;
  margin-bottom: var(--space-6);
  color: var(--color-primary);
}

.venue-no-results__art svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

/* Gentle float on the magnifier */
.venue-no-results__art .vnr-lens {
  transform-box: fill-box;
  transform-origin: center;
  animation: vnr-float 3.4s ease-in-out infinite;
}

@keyframes vnr-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-6px) rotate(-4deg); }
}

.venue-no-results__title {
  font-family: var(--font-body);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-fg);
  margin-bottom: var(--space-2);
  letter-spacing: -0.01em;
}

.venue-no-results__text {
  font-size: var(--text-base);
  color: var(--color-fg);
  opacity: 0.6;
  max-width: 380px;
  line-height: 1.6;
  margin-bottom: var(--space-6);
}

.venue-no-results__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-md);
  background-color: var(--color-primary);
  color: var(--color-white);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color var(--transition-base), transform var(--transition-base);
}

.venue-no-results__cta:hover {
  background-color: var(--color-accent-deep);
  transform: translateY(-1px);
}

.venue-no-results__cta svg {
  width: 16px;
  height: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .venue-no-results,
  .venue-no-results__art .vnr-lens {
    animation: none;
  }
}

/* ── Load more ─────────────────────────────────────────────────────── */
.venue-listing__more {
  display: flex;
  justify-content: center;
  margin-top: var(--space-16);
}


/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .venue-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .home-hero__title {
    font-size: var(--text-4xl);
  }
  .home-search__inner {
    flex-direction: column;
  }
  .home-search__select-wrap,
  .home-search__field {
    width: 100%;
  }
  .home-search__select {
    width: 100%;
  }
  .home-search__inner .btn {
    width: 100%;
    height: 52px;
  }
}

@media (max-width: 640px) {
  .venue-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Venue logo on cards ───────────────────────────────────── */
.venue-card__logo {
  display: block;
  border-radius: var(--radius-md, 10px);
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
}
.venue-card__logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlap variant: straddles image/body boundary, above the name */
.venue-card__logo--overlap {
  position: absolute;
  top: -8px;
  left: var(--space-5, 20px);
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border: 3px solid #fff;
  box-shadow: 0 1px 10px rgba(27, 25, 15, 0.18);
}
.venue-card__body--with-logo {
  position: relative;
  padding-top: calc(var(--space-5, 20px) + 20px);
}

/* Inline variant: next to the name when the card has no cover image */
.venue-card__logo--inline {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(27, 25, 15, 0.1);
  margin-right: var(--space-2, 8px);
  align-self: center;
}
