/* ========================================
   AVADA FILTERED GRID v1.5.2 (RESTORED)
   ======================================== */

/* ========================================
   1. BASE STYLES & VARIABLES
   ======================================== */

.afg-wrap {
  --gap: 20px;
  margin: 10px 0;
  font-family: "Gotham A", "Gotham B" !important;
  text-align: start;
  overflow: visible;
}

/* ========================================
   2. TOP FILTER BAR (Mobile-First)
   ======================================== */

.afg-top-bar {
  background: var(--afg-accent, #00e1ff);
  border-radius: 999px;
  padding: 8px 16px;
  margin: 10px 0 24px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  position: relative;
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin: 50px auto;
  padding-left: calc(8px + env(safe-area-inset-left));
  padding-right: calc(8px + env(safe-area-inset-right));
}

/* Top Filter Chips Container - Horizontal scroll */
.afg-top-filter {
  display: flex;
  flex-direction: row;
  gap: 26px;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
  overflow: visible;
}

/* Filter Chips */
.afg-chip {
  border: 0;
  padding: 12px 26px;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: all .15s ease;
  color: #000;
  font-size: 16px;
  min-height: 44px;
}

.afg-chip:hover,
.afg-chip.is-active,
.afg-chip:focus-visible {
  background: #fff;
  color: #000;
  outline: none;
}

/* ========================================
   3. LAYOUT
   ======================================== */

.afg-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--gap);
  align-items: start;
}

/* ========================================
   4. LEFT FILTER (Month Pills)
   ======================================== */

.afg-left-filter {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  position: -webkit-sticky; /* iOS Safari */
  top: 80px;
  -webkit-overflow-scrolling: touch;
}

.afg-pill {
  border: 2px solid transparent;
  text-align: center;
  width: 100%;
  max-width: 100%;
  padding: 16px 22px;
  border-radius: 100px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  transition: all .15s ease;
  box-shadow: none;
  font-size: 16px;
  color: #000;
  min-height: 44px;
}

.afg-pill:hover {
  border: 1px solid #00e1ff;
}

.afg-pill.is-active {
  background: var(--afg-accent, #00e1ff);
  color: #000;
  border-color: transparent;
}

.afg-pill.is-disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: grayscale(30%);
}

.afg-pill.is-hidden {
  display: none !important;
}

/* ========================================
   5. GRID & CARDS
   ======================================== */

.afg-grid-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 300px;
}

.afg-grid {
  display: grid;
  gap: var(--gap, 20px);
  align-items: stretch;
  width: 100%;
}

.afg-empty {
  background: #00e1ff;
  color: #fff;
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  font-weight: 800;
  margin-top: 40px;
}

/* Card Styles */
.afg-card {
  background: #fff;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  transition: background .2s ease;
  box-shadow: none;
}

.afg-card:hover {
  background: var(--afg-accent, #00e1ff);
}

/* Card Media */
.afg-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #ddd;
  overflow: hidden;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.afg-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Card Badge */
.afg-badge {
  position: absolute;
  left: -5px;
  top: -5px;
  background: var(--afg-accent, #00e1ff);
  padding: 18px 18px;
  border-bottom-right-radius: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 16px;
  line-height: 19px;
}

/* Card Body */
.afg-body {
  padding: 16px 22px 0;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.afg-cats {
  font-size: 13px;
  letter-spacing: 2px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 6px 0 8px;
  line-height: 23px;
}

.afg-title {
  font-size: 30px;
  line-height: 1.08;
  font-weight: 800;
  margin: 4px 0 10px;
}

.afg-title a {
  color: inherit;
  text-decoration: none;
}

.afg-title a:hover {
  color: inherit;
  text-decoration: none;
}

/* Date/Time */
.afg-datetime {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 0;
  font-weight: 400;
  font-size: 11px;
}

.afg-datetime .afg-clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 99px;
  background: var(--afg-accent, #00e1ff);
  color: #000;
  flex: none;
}

.afg-datetime .afg-clock svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Card Actions */
.afg-actions {
  padding: 14px 22px 22px;
  margin-top: auto;
}

.afg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  background: var(--afg-accent, #00e1ff);
  font-size: 14px;
  letter-spacing: 4px;
  line-height: 17px;
  text-transform: uppercase;
  color: #000;
  font-weight: 800;
  text-decoration: none;
  border: 2px solid transparent;
  transition: all .15s ease;
  cursor: pointer;
  min-height: 44px;
}

.afg-btn::after {
  content: "›";
  font-weight: 800;
  display: inline-block;
  transform: translateY(-1px);
}

.afg-btn:hover {
  background: #fff;
  color: #000;
  border-color: var(--afg-accent, #00e1ff);
}

/* ========================================
   6. PAGINATION
   ======================================== */

.afg-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 24px 0 8px;
  width: 100%;
  margin-top: 24px;
}

.afg-loadmore {
  display: none;
  padding: 12px 16px;
  border-radius: 999px;
  border: 2px solid #000;
  background: #fff;
  color: #000;
  font-weight: 800;
  cursor: pointer;
}

.afg-paged {
  display: none;
}

.afg-pagination .afg-btn,
.afg-pagination .afg-loadmore {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  min-width: 180px;
  border: 2px solid var(--afg-accent, #00D0FF);
  background: var(--afg-accent, #00D0FF);
  color: #0b0f14;
  box-shadow: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .08s ease;
}

.afg-pagination .afg-btn:hover,
.afg-pagination .afg-loadmore:hover {
  background: #fff;
  color: #000;
  border-color: var(--afg-accent, #00D0FF);
  box-shadow: none;
  transform: translateY(-1px);
}

.afg-pagination .afg-btn:active,
.afg-pagination .afg-loadmore:active {
  transform: none;
}

.afg-pagination .afg-btn[disabled],
.afg-pagination .afg-btn:disabled,
.afg-pagination .afg-loadmore[disabled] {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Remove chevron from pagination buttons */
.afg-pagination .afg-btn::after {
  content: none !important;
}

.afg-pagination .afg-btn .afg-icon,
.afg-pagination .afg-btn svg {
  display: none !important;
}

/* ========================================
   7. FONT FAMILIES
   ======================================== */

.afg-wrap,
.afg-wrap .afg-cats,
.afg-wrap .afg-chip span,
.afg-wrap .afg-pill,
.afg-wrap .afg-btn {
  font-family: "Gotham A", "Gotham B", system-ui, -apple-system, Segoe UI, Roboto, sans-serif !important;
}

.afg-wrap .afg-title {
  font-family: "Anton", sans-serif !important;
  font-size: 30px;
}

/* ========================================
   8. MOBILE RESPONSIVE (≤990px)
   ======================================== */

@media (max-width: 990px) {
  /* Layout: Single column */
  .afg-layout {
    grid-template-columns: 1fr;
  }

  /* Left filter: Horizontal wrap */
  .afg-left-filter {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  /* Hide disabled month pills on mobile */
  .afg-left-filter .afg-pill.is-disabled,
  .afg-left-filter .afg-pill:disabled {
    display: none !important;
  }

  /* Chips: Full width in dropdown */
  .afg-chip {
    width: 100%;
    justify-content: center;
    display: flex;
  }
}

/* ========================================
   9. DESKTOP RESPONSIVE (≥991px)
   ======================================== */

@media (min-width: 991px) {
  /* Top bar: Restore desktop padding */
  .afg-top-bar {
    padding: 14px 24px !important;
    padding-left: calc(24px + env(safe-area-inset-left)) !important;
    padding-right: calc(24px + env(safe-area-inset-right)) !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
}

/* ========================================
   10. BROWSER FALLBACKS & COMPATIBILITY
   ======================================== */

/* Fallback for old Safari without CSS Grid support */
@supports not (display: grid) {
  .afg-layout {
    display: block;
  }

  .afg-left-filter {
    position: static;
    margin-bottom: 16px;
  }

  .afg-grid > * {
    display: block;
    margin-bottom: var(--gap, 20px);
  }
}
