/* =============================
   Local Events Pages
   Matches ffizzi.com main site design
   ============================= */

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0F172A;
  color: #F9FAFB;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: #3B82F6; text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* Container */
.le-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top Bar */
.le-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.le-topbar-brand {
  flex-shrink: 0;
}

.lp-logo {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  display: block;
}

.le-topbar-app {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.le-topbar-app strong {
  font-size: 16px;
  font-weight: 700;
  color: #F9FAFB;
}

.le-topbar-app > span {
  font-size: 13px;
  color: #D1D5DB;
  margin-bottom: 6px;
}

.le-topbar-badges {
  display: flex;
  gap: 8px;
}

.le-topbar-badges img {
  height: 32px;
  width: auto;
  display: block;
}

/* Header */
.le-header {
  padding: 24px 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 24px;
}

.le-header h1 {
  font-size: 28px;
  font-weight: 800;
  color: #F9FAFB;
  margin-bottom: 4px;
  line-height: 1.15;
}

.le-subtitle {
  color: #D1D5DB;
  font-size: 16px;
}

.le-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* Region Selector */
.le-region-select {
  background: rgba(255, 255, 255, 0.04);
  color: #F9FAFB;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}

/* Search Bar */
.le-search-bar {
  margin-top: 16px;
}

.le-search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  color: #F9FAFB;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
}
.le-search-input::placeholder { color: #9CA3AF; }
.le-search-input:focus {
  outline: none;
  border-color: #3B82F6;
}

.le-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.le-search-chip {
  background: rgba(255, 255, 255, 0.04);
  color: #D1D5DB;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 4px 10px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.le-search-chip-remove {
  background: none;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
}

/* Region Index Grid */
.le-index { padding-bottom: 48px; }
.le-index section { margin-bottom: 32px; }
.le-index h2 {
  font-size: 20px;
  color: #D1D5DB;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.le-region-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.le-region-grid li a {
  display: block;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: #F9FAFB;
  font-size: 14px;
  transition: background 0.12s, border-color 0.12s;
}
.le-region-grid li a:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  text-decoration: none;
}

/* Section Heading (e.g. "Happening Today!") */
.le-section-heading {
  font-size: 20px;
  font-weight: 700;
  color: #F9FAFB;
  margin-bottom: 16px;
}

/* Events Grid */
.le-events-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .le-events-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  .le-events-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Event Card */
.le-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  transition: background 0.12s, border-color 0.12s, transform 0.15s, box-shadow 0.15s;
}
.le-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.le-card a {
  display: block;
  color: inherit;
}
.le-card a:hover { text-decoration: none; }

.le-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}
.le-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.le-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(16, 185, 129, 0.25));
}

.le-card-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.02);
}

.le-card-flag img {
  width: auto;
  height: 70%;
  max-width: 80%;
  object-fit: contain;
}

.le-card-content {
  padding: 10px 2px 2px;
}

.le-card-content h2 {
  font-size: 16px;
  font-weight: 700;
  color: #F9FAFB;
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.le-card-content time {
  font-size: 13px;
  color: #3B82F6;
  display: block;
  margin-bottom: 4px;
}

.le-card-location {
  font-size: 13px;
  color: #D1D5DB;
  margin-bottom: 4px;
}

.le-card-desc {
  font-size: 13px;
  color: #9CA3AF;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.le-card-category {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: #3B82F6;
  background: rgba(59, 130, 246, 0.1);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Compact List */
.le-more-events {
  margin-bottom: 32px;
}

.le-more-events h2 {
  font-size: 18px;
  color: #D1D5DB;
  margin-bottom: 12px;
}

.le-compact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.le-compact-list li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.le-compact-list li a {
  flex: 1;
  min-width: 200px;
  color: #F9FAFB;
  font-size: 14px;
}
.le-compact-list li a:hover { color: #3B82F6; }

.le-compact-date {
  font-size: 13px;
  color: #3B82F6;
  white-space: nowrap;
}

.le-compact-location {
  font-size: 13px;
  color: #9CA3AF;
  white-space: nowrap;
}

/* List Inline Ads (within compact list) — higher specificity to override .le-compact-list li */
.le-compact-list .le-list-ad {
  display: block;
  padding: 16px 0;
  border-bottom: none;
  min-height: 100px;
  width: 100%;
  overflow: hidden;
}

/* Empty State */
.le-empty-state {
  text-align: center;
  padding: 64px 16px;
  color: #9CA3AF;
  font-size: 16px;
}

/* Inline Ad */
.le-inline-ad {
  margin: 24px 0;
  min-height: 100px;
  overflow: hidden;
}

/* =============================
   Event Detail Page
   ============================= */
.le-back-link {
  font-size: 14px;
  color: #9CA3AF;
  display: inline-block;
  margin-bottom: 16px;
}
.le-back-link:hover { color: #3B82F6; }

.le-detail {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 48px;
}

.le-detail-article h1 {
  font-size: 28px;
  font-weight: 800;
  color: #F9FAFB;
  margin-bottom: 12px;
  line-height: 1.3;
}

.le-detail-meta {
  margin-bottom: 12px;
  font-size: 15px;
}

.le-detail-meta time {
  color: #3B82F6;
}

.le-detail-date-sep {
  color: #9CA3AF;
}

.le-detail-location {
  margin-bottom: 16px;
}

.le-detail-place {
  font-size: 15px;
  color: #D1D5DB;
}

.le-detail-city {
  font-size: 14px;
  color: #9CA3AF;
}

.le-detail-map-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 14px;
}

.le-detail-image {
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
}

.le-detail-image img {
  width: 100%;
  display: block;
}

.le-detail-description {
  font-size: 15px;
  line-height: 1.7;
  color: #D1D5DB;
  margin-bottom: 16px;
  white-space: pre-wrap;
}

.le-detail-category {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 13px;
  color: #3B82F6;
  background: rgba(59, 130, 246, 0.1);
  padding: 4px 12px;
  border-radius: 16px;
}

.le-detail-source {
  margin-bottom: 24px;
  font-size: 14px;
}

.le-detail-cta {
  margin-bottom: 24px;
}

.le-share-btn {
  background: #3B82F6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.le-share-btn:hover { background: #2563EB; }

/* App Download Promo */
.app-promo {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-top: 24px;
}

.app-promo p {
  font-size: 15px;
  color: #D1D5DB;
  margin-bottom: 12px;
}

.app-promo-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.app-promo-buttons img {
  height: 40px;
}

/* Footer */
.le-footer {
  padding: 24px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 32px;
  font-size: 13px;
  color: #9CA3AF;
  text-align: center;
}

.le-footer a {
  color: #9CA3AF;
}
.le-footer a:hover {
  color: #E5E7EB;
}

.le-footer p {
  margin-top: 8px;
}

/* =============================
   Responsive
   ============================= */
@media (max-width: 640px) {
  .le-header h1 { font-size: 22px; }
  .le-detail-article h1 { font-size: 22px; }
  .le-header-row { flex-direction: column; align-items: flex-start; }
  .le-region-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .le-compact-list .le-list-ad { padding-left: 12px; padding-right: 12px; }
  .le-inline-ad { padding-left: 12px; padding-right: 12px; }
}

/* Search active: hide SSR content, show filtered results */
body.le-search-active #events-container,
body.le-search-active #more-events,
body.le-search-active .le-section-heading,
body.le-search-active main > .le-inline-ad {
  display: none;
}

#search-results {
  display: none;
}

body.le-search-active #search-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  body.le-search-active #search-results { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
  body.le-search-active #search-results { grid-template-columns: repeat(3, 1fr); }
}
