@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

:root {
  --red: #E53935;
  --red-light: #FFEBEE;
  --text: #1a1a1a;
  --text-2: #555;
  --text-3: #888;
  --border: #e5e5e5;
  --bg: #f7f7f7;
  --white: #ffffff;
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── NAV ── */
nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--red);
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover, .nav-links a.active {
  background: var(--bg);
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s, transform 0.1s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.98); }

.btn-red    { background: var(--red); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--text-2); }
.btn-ghost  { background: transparent; color: var(--text-2); border: none; padding: 9px 14px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm     { padding: 6px 14px; font-size: 13px; }

/* ── LAYOUT ── */
.page { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.page-lg { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-sm { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ── HERO ── */
.hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 56px 20px 48px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 16px;
  color: var(--text);
}

.hero h1 span { color: var(--red); }

.hero p {
  font-size: 18px;
  color: var(--text-2);
  max-width: 480px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

/* ── SEARCH BAR ── */
.search-bar {
  display: flex;
  background: var(--white);
  border: 2px solid var(--text);
  border-radius: 100px;
  overflow: hidden;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 4px 4px 0 var(--text);
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 20px;
  font-size: 15px;
  font-family: inherit;
  background: transparent;
}

.search-bar .divider-v {
  width: 1px;
  background: var(--border);
  margin: 10px 0;
}

.search-bar button {
  background: var(--red);
  color: white;
  border: none;
  padding: 0 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.search-bar button:hover { background: #c62828; }

/* ── SECTION ── */
.section { padding: 48px 0; }
.section-sm { padding: 32px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.section-head a {
  font-size: 14px;
  color: var(--red);
  font-weight: 500;
}

/* ── EVENT CARD ── */
.event-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}

.event-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

.event-card-thumb {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  flex-shrink: 0;
}

.event-card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.event-card-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.event-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.35;
}

.event-card-group {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 8px;
}

.event-card-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
  margin-top: auto;
  flex-wrap: wrap;
}

/* ── CHIP / BADGE ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
}
.chip-red    { background: var(--red-light); color: var(--red); }
.chip-gray   { background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.chip-black  { background: var(--text); color: white; }
.chip-green  { background: #E8F5E9; color: #2e7d32; }

/* ── FILTER ROW ── */
.filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.filter-btn {
  padding: 7px 16px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}
.filter-btn:hover { border-color: var(--text-2); color: var(--text); }
.filter-btn.active { background: var(--text); color: white; border-color: var(--text); }

/* ── GRID ── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* ── FORM ── */
.form-block { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px; }
.form-block h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.form-block .sub { font-size: 13px; color: var(--text-3); margin-bottom: 20px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field label span { font-weight: 400; color: var(--text-3); }

.field input, .field select, .field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--text);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field textarea { resize: vertical; min-height: 100px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.select-wrap { position: relative; }
.select-wrap::after { content: '▾'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 11px; color: var(--text-3); }

/* ── AGE TOGGLE ── */
.age-choice {
  display: flex;
  gap: 12px;
}

.age-opt {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.age-opt:hover { border-color: var(--text-2); }
.age-opt.on { border-color: var(--text); background: var(--bg); }
.age-opt input { display: none; }
.age-opt-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.age-opt-desc { font-size: 12px; color: var(--text-3); line-height: 1.4; }

/* ── TOGGLE CHIPS ── */
.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-toggle {
  padding: 6px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--white);
  font-family: inherit;
}
.chip-toggle:hover { border-color: var(--text-2); }
.chip-toggle.on { background: var(--text); color: white; border-color: var(--text); }

/* ── TOGGLE SWITCH ── */
.toggle-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.toggle-row .info { flex: 1; }
.toggle-row .info strong { font-size: 14px; font-weight: 600; display: block; margin-bottom: 2px; }
.toggle-row .info span { font-size: 12px; color: var(--text-3); }

.switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; margin-top: 1px; }
.switch input { display: none; }
.switch-track {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s;
}
.switch-track::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  left: 3px; top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-track { background: var(--text); }
.switch input:checked + .switch-track::before { transform: translateX(18px); }

/* ── MODAL ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  animation: popIn 0.2s ease;
  position: relative;
}
@keyframes popIn { from { opacity:0; transform: scale(0.96) translateY(8px); } to { opacity:1; transform: none; } }

.modal-close { position: absolute; top: 16px; right: 16px; background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-3); }
.modal h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 4px; }
.modal .sub { font-size: 14px; color: var(--text-3); margin-bottom: 24px; }

/* ── TABS ── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 24px; gap: 4px; }
.tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-3);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--text); }

/* ── GROUP CARD ── */
.group-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.group-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.09); transform: translateY(-2px); }
.group-icon { width: 52px; height: 52px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.group-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.group-card p { font-size: 13px; color: var(--text-2); line-height: 1.45; margin-bottom: 8px; }
.group-meta { font-size: 12px; color: var(--text-3); }

/* ── CATEGORY CARD ── */
.cat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
  text-decoration: none;
}
.cat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-2px); }
.cat-icon-wrap {
  width: 44px; height: 44px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cat-card .name { font-size: 14px; font-weight: 600; color: var(--text); }
.cat-card .count { font-size: 12px; color: var(--text-3); }

/* ── FILTER DROPDOWNS ── */
.filter-dropdown { position: relative; }

.filter-drop-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s;
  white-space: nowrap;
}
.filter-drop-btn:hover { border-color: var(--text-2); }
.filter-drop-btn.active { border-color: var(--text); background: var(--text); color: white; }
.filter-drop-btn.active svg { stroke: white; }

.filter-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 180px;
  z-index: 50;
  overflow: hidden;
}
.filter-drop-menu.open { display: block; }

.filter-drop-item {
  padding: 10px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
  color: var(--text);
}
.filter-drop-item:hover { background: var(--bg); }
.filter-drop-item.active { font-weight: 600; color: var(--red); }

/* ── PAGE HEADER ── */
.page-head {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 24px 0;
  margin-bottom: 0;
}
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.page-head p { font-size: 14px; color: var(--text-3); margin-top: 4px; }

/* ── SIDEBAR LAYOUT ── */
.two-col { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: flex-start; }
.sidebar-block { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px; }
.sidebar-block h4 { font-size: 13px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 14px; }

/* ── EVENT LIST ITEM (browse) ── */
.event-row {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  cursor: pointer;
  transition: box-shadow 0.15s;
  margin-bottom: 10px;
}
.event-row:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.event-row-date {
  width: 52px;
  text-align: center;
  flex-shrink: 0;
}
.event-row-date .month { font-size: 11px; font-weight: 600; color: var(--red); text-transform: uppercase; letter-spacing: 0.5px; }
.event-row-date .day { font-size: 26px; font-weight: 700; line-height: 1; color: var(--text); }
.event-row-body { flex: 1; min-width: 0; }
.event-row-title { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.event-row-group { font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.event-row-meta { font-size: 12px; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; }
.event-row-action { flex-shrink: 0; }

/* ── MAP PAGE ── */
.map-layout { display: flex; height: calc(100vh - 60px); }
.map-panel { width: 380px; flex-shrink: 0; background: var(--white); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.map-panel-body { flex: 1; overflow-y: auto; }
.map-frame { flex: 1; position: relative; }
#map { width: 100%; height: 100%; }

.map-event-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.map-event-item:hover { background: var(--bg); }
.map-event-item.active { background: var(--red-light); border-left: 3px solid var(--red); }
.map-event-item-emoji { font-size: 24px; width: 36px; text-align: center; flex-shrink: 0; margin-top: 2px; }
.map-event-item-title { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.map-event-item-meta { font-size: 12px; color: var(--text-3); }

/* ── FOOTER ── */
footer {
  background: var(--text);
  color: #aaa;
  padding: 40px 20px 24px;
  margin-top: 64px;
}
.footer-inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
footer .logo { font-size: 20px; font-weight: 700; color: white; margin-bottom: 8px; }
footer p { font-size: 13px; line-height: 1.6; }
footer h4 { font-size: 12px; font-weight: 600; color: white; text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px; }
footer ul { list-style: none; }
footer ul li { margin-bottom: 8px; }
footer ul li a { font-size: 13px; color: #aaa; transition: color 0.15s; }
footer ul li a:hover { color: white; }
footer .bottom { border-top: 1px solid #333; margin-top: 32px; padding-top: 20px; font-size: 12px; color: #555; display: flex; justify-content: space-between; align-items: center; }

/* ── UTILS ── */
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: white; padding: 10px 20px;
  border-radius: 100px; font-size: 14px; font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  z-index: 9999; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}
#toast.show { opacity: 1; }

/* ── RSVP BUTTONS ── */
.rsvp-actions { display: flex; gap: 8px; margin-top: 12px; }

/* ── DIVIDER ── */
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .nav-links { display: none; }
  .map-layout { flex-direction: column; }
  .map-panel { width: 100%; height: 40vh; }
  .map-frame { height: 60vh; }
  .footer-inner { grid-template-columns: 1fr; }
}
