/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --brand: #e63946;
  --brand-dark: #c1121f;
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #212529;
  --muted: #6c757d;
  --border: #dee2e6;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}
body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Header ── */
.site-header { background: #2d2d44; color: #fff; padding: 1rem 0; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; font-weight: 700; color: #fff; letter-spacing: -0.5px; text-decoration: none; }
.logo:hover { text-decoration: none; color: var(--brand); }
.logo-img { height: 34px; width: auto; flex-shrink: 0; }
.logo-text { line-height: 1; white-space: nowrap; }
.site-header nav { display: flex; gap: 1.5rem; align-items: center; }
.site-header nav a { color: #ccc; font-size: 0.95rem; }
.site-header nav a:hover { color: #fff; text-decoration: none; }
.btn-submit { background: var(--brand); color: #fff !important; padding: 0.5rem 1.2rem; border-radius: var(--radius); font-weight: 600; }
.btn-submit:hover { background: var(--brand-dark) !important; }

/* ── Hero ── */
.hero { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%); color: #fff; padding: 4rem 0 3rem; text-align: center; }
.hero h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 0.75rem; }
.hero p { font-size: 1.1rem; color: #adb5bd; margin-bottom: 2rem; }

/* ── Search Pill ── */
.search-bar { max-width: 960px; margin: 0 auto; }
.search-pill {
  display: flex; align-items: center;
  background: #fff; border-radius: 50px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  overflow: visible; flex-wrap: wrap;
  padding: 0;
}
.sp-field {
  display: flex; align-items: center; gap: 0.4rem;
  padding: 0 1rem; flex: 1; min-width: 0; position: relative;
}
.sp-field--keyword { flex: 2; min-width: 160px; }
.sp-field--location { flex: 1.5; min-width: 140px; }
.sp-field--select { flex: 0 0 auto; padding: 0 0.5rem; }
.sp-field--category { flex: 0 0 auto; min-width: 130px; }
.sp-field--daterange { flex: 0 0 auto; min-width: 200px; }
.sp-icon { width: 16px !important; height: 16px !important; max-width: 16px; max-height: 16px; color: #9ca3af; flex-shrink: 0; display: block; }
.sp-field input {
  border: none; outline: none; background: transparent;
  font-size: 0.9rem; color: var(--text); width: 100%;
  padding: 0.9rem 0; line-height: 1;
}
.sp-field input::placeholder { color: #9ca3af; }
.sp-field select {
  border: none; outline: none; background: transparent;
  font-size: 0.88rem; color: var(--text); cursor: pointer;
  padding: 0.9rem 0.25rem; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20'%3E%3Cpath fill='%236b7280' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 4px center;
  padding-right: 20px;
}
.sp-field select:focus { outline: none; }
.sp-divider { width: 1px; height: 28px; background: #e5e7eb; flex-shrink: 0; }
.sp-btn {
  background: var(--brand); color: #fff; border: none;
  padding: 0.75rem 1.75rem; border-radius: 50px;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
  white-space: nowrap; margin: 5px 5px 5px 0; flex-shrink: 0;
}
.sp-btn:hover { background: var(--brand-dark); }
.sp-error { font-size: 0.72rem; color: var(--brand); position: absolute; bottom: 2px; left: 2.2rem; white-space: nowrap; }

/* ── Events Grid ── */
.events-section { padding: 2.5rem 0; }
.result-count { color: var(--muted); margin-bottom: 1.25rem; font-size: 0.9rem; }
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.5rem; }
.event-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform 0.15s, box-shadow 0.15s; display: flex; flex-direction: column; color: var(--text); }
.event-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); text-decoration: none; }
.event-img-wrap { position: relative; height: 210px; overflow: hidden; flex-shrink: 0; }
.event-img { width: 100%; height: 100%; object-fit: contain; background: #f1f3f5; display: block; }
.event-img-placeholder { height: 210px; flex-shrink: 0; background: linear-gradient(135deg, #1a1a2e, #0f3460); display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.logo-placeholder { height: 75px; width: auto; opacity: 0.7; }
.event-info { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; gap: 0.4rem; }
.event-category { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--brand); letter-spacing: 0.5px; }
.event-info h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.event-date, .event-location { font-size: 0.875rem; color: var(--muted); }
.event-distance { font-size: 0.8rem; color: var(--brand); font-weight: 600; }
.badge-free { display: inline-block; background: #d1fae5; color: #065f46; font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 99px; margin-top: auto; }
.badge-paid { display: inline-block; background: #fef3c7; color: #92400e; font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 99px; margin-top: auto; }

/* ── Pagination ── */
.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin-top: 2.5rem; }
.pagination a { background: var(--surface); border: 1px solid var(--border); padding: 0.5rem 1.2rem; border-radius: var(--radius); }
.pagination span { color: var(--muted); }

/* ── Empty State ── */
.empty-state { text-align: center; padding: 4rem 0; color: var(--muted); font-size: 1.1rem; }

/* ── Event Detail ── */
.event-detail { padding: 2rem 0 4rem; }
.back-link { color: var(--muted); font-size: 0.9rem; display: inline-block; margin-bottom: 1.5rem; }
.detail-hero-img { width: 100%; max-height: 480px; object-fit: contain; background: #f1f3f5; border-radius: var(--radius); margin-bottom: 2rem; display: block; }
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 2.5rem; }
.detail-main h1 { font-size: 2rem; font-weight: 800; margin: 0.5rem 0 1rem; }
.detail-description { color: var(--text); line-height: 1.8; white-space: pre-wrap; margin-bottom: 1.5rem; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.info-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
.info-card ul { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.info-card li { display: flex; flex-direction: column; gap: 0.15rem; }
.info-card strong { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.5px; }
.btn-map { display: block; margin-top: 1.25rem; background: #f1f3f5; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.65rem; text-align: center; color: var(--text); font-size: 0.9rem; }
.btn-map:hover { background: var(--border); text-decoration: none; }

/* ── Buttons ── */
.btn-primary { display: inline-block; background: var(--brand); color: #fff; padding: 0.75rem 1.75rem; border-radius: var(--radius); font-weight: 600; border: none; cursor: pointer; font-size: 1rem; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn-secondary { display: inline-block; background: var(--surface); color: var(--text); padding: 0.75rem 1.75rem; border-radius: var(--radius); font-weight: 600; border: 1px solid var(--border); cursor: pointer; font-size: 1rem; }
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-large { padding: 1rem 2.5rem; font-size: 1.05rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ── Submit Error ── */
.submit-error { background: #fff1f1; border: 1px solid #fca5a5; border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1.5rem; color: #7f1d1d; line-height: 1.6; }
.submit-error strong { display: block; margin-bottom: 0.25rem; }
.submit-error a { color: var(--brand); }

/* ── Submit Form ── */
.form-page { max-width: 780px; padding: 2.5rem 1.5rem 4rem; }
.form-page h1 { margin-bottom: 0.5rem; }
.form-intro { color: var(--muted); margin-bottom: 2rem; }
.event-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
.event-form legend { font-weight: 700; padding: 0 0.5rem; font-size: 0.95rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.form-group input, .form-group select, .form-group textarea { padding: 0.6rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; font-family: inherit; background: var(--surface); transition: border-color 0.15s; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(230,57,70,0.1); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }

/* ── Success Page ── */
.success-page { text-align: center; padding: 5rem 1.5rem; }
.success-icon { font-size: 4rem; margin-bottom: 1rem; }
.success-page h1 { font-size: 2rem; margin-bottom: 0.75rem; }
.success-page p { color: var(--muted); margin-bottom: 2rem; }
.success-actions { display: flex; gap: 1rem; justify-content: center; }

/* ── Footer ── */
.site-footer { background: #1a1a2e; color: #6c757d; text-align: center; padding: 1.5rem 0; font-size: 0.875rem; margin-top: 3rem; }
.site-footer a { color: #adb5bd; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.6rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .events-grid { grid-template-columns: 1fr; }
  .search-pill { border-radius: var(--radius); flex-direction: column; align-items: stretch; padding: 0.5rem; gap: 0; }
  .sp-field { border-bottom: 1px solid #f3f4f6; padding: 0 0.75rem; }
  .sp-field:last-of-type { border-bottom: none; }
  .sp-field--select { flex: 1; }
  .sp-field--category { min-width: unset; }
  .sp-field--daterange { min-width: unset; flex: 1; }
  .sp-divider { display: none; }
  .sp-btn { margin: 0.5rem 0 0; border-radius: var(--radius); width: 100%; padding: 0.75rem; }
}
