:root {
  --bg: #020817;
  --bg-soft: #020817;
  --card: #0b1020;
  --accent: #38bdf8;
  --accent-soft: rgba(56,189,248,0.14);
  --text: #e5e7eb;
  --muted: #9ca3af;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --shadow: 0 18px 40px rgba(15,23,42,0.7);
  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 18px 18px 26px;
  font-family: var(--font);
  background:
    radial-gradient(circle at top, rgba(56,189,248,0.12), transparent 65%),
    radial-gradient(circle at bottom, rgba(79,70,229,0.12), transparent 65%),
    var(--bg);
  color: var(--text);
}

/* Header */

.top {
  max-width: 1240px;
  margin: 0 auto 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
}
.logo-dot {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: radial-gradient(circle at 20% 20%, #38bdf8, #6366f1);
  box-shadow: 0 0 18px rgba(56,189,248,0.8);
}
.brand-text h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}
.brand-text p {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* Filters */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
}
.field label {
  font-size: 11px;
  color: var(--muted);
}
select,
input[type="search"] {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,253,0.35);
  background-color: rgba(5,9,20,0.98);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
select:focus,
input[type="search"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(56,189,248,0.28);
}

/* Summary */

.summary-bar {
  max-width: 1240px;
  margin: 0 auto 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background-color: rgba(7,11,22,0.98);
  border: 1px solid rgba(148,163,253,0.22);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}
#eventCount {
  font-weight: 600;
  color: var(--accent);
}
.summary-bar .hint {
  color: var(--muted);
}

/* Grid & Cards */

.grid {
  max-width: 1240px;
  margin: 4px auto 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-xl);
  background: radial-gradient(circle at top left, rgba(56,189,248,0.08), transparent),
              var(--card);
  box-shadow: var(--shadow);
  border: 1px solid rgba(148,163,253,0.16);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  min-height: 260px;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 52px rgba(15,23,42,0.9);
  border-color: var(--accent);
}

.card-hero {
  width: 100%;
  height: 140px;
  border-radius: var(--radius-lg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #020817;
}

@media (min-width: 768px) {
  .card-hero {
    height: 160px;
  }
}

/* ✅ mobile: stack, search at bottom full-width */
@media (max-width: 768px) {
  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filters .field {
    width: 100%;
  }

  .filters .field-search {
    order: 3;           /* always last row */
  }
}

.card-badge-row {
  padding: 6px 12px 0;
  display: flex;
  justify-content: flex-start;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 0;
}
.card-title-wrap {
  flex: 1 1 auto;
  min-width: 0;
}
.card-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background-color: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}
.card-location {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

.card-location-inline {
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.card-body {
  padding: 6px 12px 8px;
  font-size: 12px;
  color: var(--muted);
  flex: 1 1 auto;
  line-height: 1.5;
}

.card-body .row {
  margin-bottom: 2px;
}

.card-body .snippet {
  margin-top: 4px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.tag {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 999px;
  background-color: rgba(4,7,18,1);
  color: var(--accent);
  border: 1px solid rgba(56,189,248,0.25);
}

.card-actions {
  padding: 0 12px 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}
.btn-link {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #020817;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-link.secondary {
  background: transparent;
  color: var(--muted);
  padding-left: 0;
}

.footer {
  max-width: 1240px;
  margin: 0 auto;
  font-size: 10px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sources {
  max-width: 1240px;
  margin: 6px auto 14px;
  font-size: 11px;
  color: var(--muted);
}
.sources h2 {
  font-size: 12px;
  margin-bottom: 4px;
}
.sources ul {
  margin: 0;
  padding-left: 14px;
}
.sources a {
  color: var(--accent);
  text-decoration: none;
}
.sources a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  body {
    padding: 10px;
  }
  .top {
    align-items: flex-start;
  }
}

.badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge-past {
  background: #f3f4f6;
  color: #6b7280;
}
.badge-now {
  background: #fef3c7;
  color: #b45309;
}
.badge-upcoming {
  background: #dcfce7;
  color: #15803d;
}
.badge-future {
  background: #e0f2fe;
  color: #1d4ed8;
}
.badge-unknown {
  background: #f9fafb;
  color: #9ca3af;
}

.hero {
  width: 100%;
  height: 160px;             /* ပုံအမြင့် */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  border-radius: 16px;
}

.card-x {
  background-image: url("https://images.unsplash.com/photo-1507525428034-b723cf961d3e?auto=format&fit=crop&w=1200&q=80");
}