/*
 * Events Listing Page
 * @package Altojive
 */

/* ── HERO ───────────────────────────────────────────────── */
.evpage-hero {
  background: var(--navy);
  padding: var(--sp-12) 0 var(--sp-16);
  text-align: center;
}
.evpage-hero__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: #fff;
  margin-bottom: var(--sp-6);
  line-height: 1.2;
}

/* Search pill — white on navy */
.evpage-search {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--r-full);
  max-width: 620px;
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.evpage-search__input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px var(--sp-3);
  font-size: var(--text-base);
  font-family: var(--font-body);
  color: var(--text-primary);
  background: transparent;
  min-width: 0;
}
.evpage-search__input::placeholder { color: var(--text-muted); }
.evpage-search__clear {
  flex-shrink: 0;
  color: var(--text-muted);
  padding: var(--sp-2);
  border-radius: var(--r-full);
  transition: color var(--t-fast);
}
.evpage-search__clear:hover { color: var(--text-primary); }
.evpage-search__div { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; margin: 0 var(--sp-1); }
.evpage-search__loc {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 14px var(--sp-5);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-body);
  white-space: nowrap;
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.evpage-search__loc:hover { background: var(--grey-50); }

/* ── BODY LAYOUT ─────────────────────────────────────────── */
.evpage-body { padding: var(--sp-8) 0 var(--sp-20); background: var(--bg-page); }
.evpage-layout { display: grid; grid-template-columns: 240px 1fr; gap: var(--sp-8); align-items: start; }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.filters-sidebar {
  background: #fff;
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--navbar-h) + var(--sp-4));
}
.filters-sidebar__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: var(--sp-5);
  color: var(--text-primary);
}
.active-filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); min-height: 0; }
.af-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600;
  padding: 3px var(--sp-2) 3px var(--sp-3);
  background: var(--navy); color: #fff;
  border-radius: var(--r-full);
}
.af-pill__x { display: flex; align-items: center; cursor: pointer; opacity: .7; transition: opacity var(--t-fast); }
.af-pill__x:hover { opacity: 1; }

.fgroup { margin-bottom: var(--sp-5); }
.fgroup__title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-primary); margin-bottom: var(--sp-3);
}
.fcheck {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 5px 0; cursor: pointer;
  font-size: var(--text-sm); color: var(--text-secondary);
  transition: color var(--t-fast);
}
.fcheck:hover { color: var(--text-primary); }
.fcheck input[type="checkbox"] {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  accent-color: var(--navy); cursor: pointer; flex-shrink: 0;
}
.fdate { padding-top: var(--sp-1); }
.fdate input[type="date"] {
  width: 100%;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm); font-family: var(--font-body);
  border: 1.5px solid var(--border); border-radius: var(--r-md);
  outline: none; color: var(--text-primary);
  transition: border-color var(--t-fast); margin-top: var(--sp-2);
  display: none;
}
.fdate input[type="date"].is-visible { display: block; }
.fdate input[type="date"]:focus { border-color: var(--navy); }
.fdivider { height: 1px; background: var(--grey-100); margin: var(--sp-4) 0; }
.fmore {
  font-size: var(--text-sm); font-weight: 600; color: var(--navy);
  margin-top: var(--sp-2); padding: 0; cursor: pointer;
  transition: opacity var(--t-fast);
}
.fmore:hover { opacity: .7; }
.js-clear-filters { display: none !important; }
.js-clear-filters.is-visible { display: flex !important; }

/* ── SORT BAR ─────────────────────────────────────────────── */
.ev-main { position: relative; min-height: 400px; }
.sort-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-5);
}
.sort-bar__count { font-size: var(--text-sm); color: var(--text-muted); }
.sort-bar__right { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-sm); color: var(--text-secondary); }
.sort-bar__right .form-select { width: auto; padding: var(--sp-2) 36px var(--sp-2) var(--sp-3); font-size: var(--text-sm); height: auto; }

/* ── EVENT LIST GRID (2 col) ──────────────────────────────── */
.ev-list-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
  transition: opacity var(--t-base);
}
.ev-list-grid.is-loading { opacity: .4; pointer-events: none; }

/* Loading spinner */
.grid-spinner-wrap {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(247,248,250,.7);
  border-radius: var(--r-xl);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base); z-index: 5;
}
.grid-spinner-wrap.is-visible { opacity: 1; pointer-events: all; }
.grid-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--grey-200); border-top-color: var(--navy);
  border-radius: var(--r-full);
  animation: ev-spin .7s linear infinite;
}
@keyframes ev-spin { to { transform: rotate(360deg); } }

/* ── HORIZONTAL EVENT CARD (.evh) ────────────────────────── */
.evh {
  background: #fff;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base), box-shadow var(--t-base);
  display: flex; flex-direction: column;
}
.evh:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* Thumbnail — 16:9 */
.evh__thumb-link { display: block; }
.evh__thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--grey-100);
}
.evh__thumb img {
  width: 100%; height: 100%; object-fit: cover;
  display: block; transition: transform 400ms ease;
}
.evh:hover .evh__thumb img { transform: scale(1.04); }
.evh__thumb-ph { width: 100%; height: 100%; background: linear-gradient(135deg, var(--grey-100), var(--grey-200)); }

.evh__cat {
  position: absolute; bottom: var(--sp-2); left: var(--sp-2);
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; padding: 3px 10px;
  border-radius: var(--r-full); color: #fff; pointer-events: none;
}

/* Body */
.evh__body { padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); flex: 1; }
.evh__head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.evh__date { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; min-width: 38px; }
.evh__month { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--yellow-hover); line-height: 1; }
.evh__day { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 800; line-height: 1; color: var(--text-primary); }
.evh__title {
  font-family: var(--font-display); font-size: var(--text-base); font-weight: 700;
  color: var(--text-primary); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.evh__title a { color: inherit; transition: color var(--t-fast); }
.evh__title a:hover { color: var(--navy-hover); }

.evh__meta {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-wrap: wrap; font-size: var(--text-xs); color: var(--text-muted);
}
.evh__sep { color: var(--grey-300); }
.evh__foot {
  display: flex; align-items: center; gap: var(--sp-3);
  padding-top: var(--sp-3); border-top: 1px solid var(--grey-100);
  margin-top: auto;
}
.evh__price {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--text-sm); font-weight: 600; color: var(--text-primary);
}
.evh__price.free { color: var(--green); }
.evh__count { display: flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--text-muted); }
.evh__star {
  width: 30px; height: 30px; border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); margin-left: auto; flex-shrink: 0;
  transition: all var(--t-fast);
}
.evh__star:hover, .evh__star.active { color: var(--yellow-hover); border-color: var(--yellow-hover); background: rgba(224,179,16,.08); }

/* Empty state */
.ev-empty {
  grid-column: 1/-1;
  display: flex; flex-direction: column; align-items: center;
  gap: var(--sp-4); padding: var(--sp-16) var(--sp-8); text-align: center;
}
.ev-empty__title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; }
.ev-empty__sub { font-size: var(--text-base); color: var(--text-muted); max-width: 380px; }

/* ── MOBILE FAB ──────────────────────────────────────────── */
.filter-fab {
  display: none;
  position: fixed; bottom: var(--sp-6); left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600;
  padding: var(--sp-3) var(--sp-6); border-radius: var(--r-full);
  box-shadow: var(--shadow-xl); gap: var(--sp-2); align-items: center;
  z-index: var(--z-sticky); white-space: nowrap;
  transition: background var(--t-fast);
}
.filter-fab:hover { background: var(--navy-hover); }
.filter-fab__badge {
  background: var(--yellow); color: var(--navy);
  font-size: 11px; font-weight: 700;
  width: 18px; height: 18px; border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
}
.filters-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: calc(var(--z-over) - 1);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--t-base), visibility var(--t-base);
}
/* Only intercept taps when the filter drawer is actually open */
.filters-backdrop.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .evpage-layout { grid-template-columns: 210px 1fr; }
}
@media (max-width: 900px) {
  .ev-list-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .evpage-hero__title { font-size: var(--text-2xl); }
  .evpage-layout { grid-template-columns: 1fr; }

  .filters-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: min(300px, 88vw);
    border-radius: 0; z-index: var(--z-over);
    transform: translateX(-100%);
    transition: transform var(--t-base);
    overflow-y: auto;
  }
  .filters-sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-xl); }
  .filter-fab { display: flex; }
  .sort-bar { flex-direction: column; align-items: flex-start; gap: var(--sp-2); }
}
@media (max-width: 480px) {
  .evpage-search { border-radius: var(--r-xl); overflow: hidden; flex-wrap: wrap; }
  .evpage-search__input { padding: var(--sp-3) var(--sp-4); }
  .evpage-search__div { width: 100%; height: 1px; margin: 0; }
  .evpage-search__loc { justify-content: center; padding: var(--sp-3) var(--sp-4); width: 100%; }
  .evh__foot { flex-wrap: wrap; }
}
