/* ==========================================================================
   event.halopenulisgroup.com — desain mobile-first ala aplikasi (Apple-clean)
   Kolom terpusat · hairline · translucent bar · tema manual/auto · SF/Lexend
   ========================================================================== */

/* ---- Tokens: light default ---- */
:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --elevated: #ffffff;
  --text: #1d1d1f;
  --text2: #6e6e73;
  --text3: #8e8e93;
  --hair: rgba(0,0,0,.08);
  --fill: rgba(120,120,128,.12);
  --fill-2: rgba(120,120,128,.20);
  --bar: rgba(245,245,247,.72);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.14);
  --radius: 20px;
  --radius-sm: 13px;
  --accent: #e15b3f;
  --on-accent: #ffffff;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
/* Dark tokens, shared by system-pref (unless forced light) and manual .dark */
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --bg: #000000; --card: #1c1c1e; --elevated: #2c2c2e;
    --text: #f5f5f7; --text2: #aeaeb2; --text3: #8e8e93;
    --hair: rgba(255,255,255,.10); --fill: rgba(120,120,128,.24); --fill-2: rgba(120,120,128,.36);
    --bar: rgba(28,28,30,.72);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.6);
  }
}
:root.dark {
  --bg: #000000; --card: #1c1c1e; --elevated: #2c2c2e;
  --text: #f5f5f7; --text2: #aeaeb2; --text3: #8e8e93;
  --hair: rgba(255,255,255,.10); --fill: rgba(120,120,128,.24); --fill-2: rgba(120,120,128,.36);
  --bar: rgba(28,28,30,.72);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.6);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Lexend', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.5; font-size: 16px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: calc(24px + var(--safe-bottom)); }

/* ---- Catalog top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(8px + var(--safe-top)) 12px 8px 18px; min-height: 52px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--hair);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-name { font-size: 16px; font-weight: 650; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 1px; flex: none; }

.icon-btn {
  position: relative; width: 38px; height: 38px; border: none; background: transparent;
  color: var(--text); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
.icon-btn:active { background: var(--fill); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn.dot::after {
  content: ''; position: absolute; top: 7px; right: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent); border: 1.5px solid var(--bar);
}

/* ---- Popover (filter / brand) ---- */
.pop-wrap { position: relative; display: inline-flex; }
.popover {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 216px;
  background: var(--elevated); border: 0.5px solid var(--hair); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 6px; z-index: 60;
  opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top right;
  pointer-events: none; transition: opacity .16s ease, transform .16s ease;
}
.popover.open { opacity: 1; transform: none; pointer-events: auto; }
.pop-head { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; padding: 8px 12px 5px; }
.pop-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 11px; font-size: 15.5px; font-weight: 500; color: var(--text); }
.pop-item:active { background: var(--fill); }
.pop-item.active { color: var(--accent); }
.pop-item .check { display: flex; opacity: 0; color: var(--accent); }
.pop-item.active .check { opacity: 1; }

/* ---- Backdrop ---- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.28); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.backdrop.open { opacity: 1; pointer-events: auto; }

/* ---- Search modal (top sheet) ---- */
.search-modal {
  position: fixed; top: 0; left: 0; right: 0; z-index: 70;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--hair);
  padding: calc(10px + var(--safe-top)) 16px 14px;
  transform: translateY(-115%); transition: transform .28s cubic-bezier(.32,.72,0,1);
}
.search-modal.open { transform: none; }
.search-modal-inner { max-width: 480px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.search-field { flex: 1; display: flex; align-items: center; gap: 9px; background: var(--fill); border-radius: 12px; padding: 11px 14px; color: var(--text3); }
.search-field input { flex: 1; border: none; outline: none; background: transparent; font: inherit; font-size: 17px; color: var(--text); min-width: 0; }
.search-field input::placeholder { color: var(--text3); }
.search-cancel { border: none; background: transparent; color: var(--accent); font: inherit; font-size: 16px; font-weight: 500; cursor: pointer; padding: 6px 2px; white-space: nowrap; }

/* ---- Section header (grouped list) ---- */
.section-head { padding: 22px 20px 2px; }
.section-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.section-head .count { font-size: 13px; font-weight: 500; color: var(--text3); margin-left: 7px; }

/* ---- Feed of event cards ---- */
.feed { padding: 12px 20px 4px; display: flex; flex-direction: column; gap: 16px; }

/* ---- Infinite scroll sentinel ---- */
.load-more { display: flex; justify-content: center; align-items: center; padding: 24px 0 10px; min-height: 44px; }
.spinner { width: 24px; height: 24px; border: 2.5px solid var(--fill); border-top-color: var(--accent); border-radius: 50%; animation: es-spin .7s linear infinite; }
@keyframes es-spin { to { transform: rotate(360deg); } }
.ecard { display: block; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .12s ease; }
.ecard:active { transform: scale(.985); }
.ecard-poster { aspect-ratio: 16/9; position: relative; background: var(--fill) center/cover no-repeat; }
.ecard-poster.ph { display: flex; align-items: center; justify-content: center; }
.ecard-poster.ph .ph-txt { font-size: 15px; font-weight: 600; color: var(--text2); padding: 0 24px; text-align: center; letter-spacing: -.01em; }
.badge {
  position: absolute; top: 12px; left: 12px; font-size: 12px; font-weight: 600; letter-spacing: -.01em;
  padding: 5px 11px; border-radius: 100px; background: rgba(255,255,255,.82); color: #1d1d1f;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: inline-flex; align-items: center; gap: 5px;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live { color: #34c759; } .badge.active { color: #0a84ff; } .badge.done { color: #8e8e93; }
:root.dark .badge, :root:not(.light) .badge { }
@media (prefers-color-scheme: dark) { :root:not(.light) .badge { background: rgba(44,44,46,.72); color: #f5f5f7; } }
:root.dark .badge { background: rgba(44,44,46,.72); color: #f5f5f7; }
.ecard-body { padding: 14px 16px 16px; }
.ecard-brand { font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .01em; text-transform: uppercase; }
.ecard-title { font-size: 18px; font-weight: 650; letter-spacing: -.02em; margin: 3px 0 0; line-height: 1.25; }
.ecard-meta { font-size: 13.5px; color: var(--text2); margin-top: 6px; }
.ecard-cta { font-size: 14px; font-weight: 600; color: var(--accent); margin-top: 12px; display: inline-flex; align-items: center; gap: 4px; }
.ecard-cta.muted { color: var(--text3); }

.empty { text-align: center; padding: 80px 30px; color: var(--text3); }
.empty svg { opacity: .5; margin-bottom: 14px; }
.empty p { font-size: 15px; margin: 0; }

/* ---- Simple nav bar (detail / info pages) ---- */
.navbar {
  position: sticky; top: 0; z-index: 40;
  padding: calc(8px + var(--safe-top)) 10px 8px; min-height: 44px;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--hair);
  display: flex; align-items: center; gap: 6px;
}
.navbar .title { font-size: 17px; font-weight: 600; letter-spacing: -.02em; margin: 0 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.navbar .nav-btn { width: 38px; height: 38px; border-radius: 50%; border: none; background: transparent; color: var(--accent); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.navbar .nav-btn:active { background: var(--fill); }
.navbar .nav-btn.right { color: var(--text); }

/* ---- Detail ---- */
.detail { padding: 0 0 104px; }
.hero { padding: 12px 20px 0; }
.hero-poster { aspect-ratio: 16/9; width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--fill) center/cover no-repeat; box-shadow: var(--shadow); }
.hero-poster.ph { display: flex; align-items: center; justify-content: center; color: var(--text2); font-weight: 600; letter-spacing: -.01em; padding: 0 24px; text-align: center; }
.dhead { padding: 20px 20px 0; }
.dhead .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dhead h1 { font-size: 26px; font-weight: 700; letter-spacing: -.03em; margin: 0; line-height: 1.15; flex: 1 1 auto; }
.badge-static { position: static; background: var(--fill); }
:root.dark .badge-static, .badge-static { }
.dhead .meta { color: var(--text2); font-size: 14px; margin-top: 8px; }
.dhead .meta b { color: var(--text); font-weight: 600; }

.article { padding: 18px 20px 8px; font-size: 16px; color: var(--text); }
.article > *:first-child { margin-top: 0; }
.article h1, .article h2, .article h3 { letter-spacing: -.02em; line-height: 1.25; margin: 1.5em 0 .4em; font-weight: 650; }
.article h1 { font-size: 21px; } .article h2 { font-size: 19px; } .article h3 { font-size: 17px; }
.article p { margin: 0 0 .85em; }
.article ul, .article ol { margin: 0 0 1em; padding-left: 1.25em; }
.article li { margin: .3em 0; }
.article li::marker { color: var(--accent); }
.article a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.article blockquote { margin: 1em 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--accent); color: var(--text2); }
.article img { border-radius: var(--radius-sm); margin: 1em 0; }
.article .muted-empty { color: var(--text3); }

/* ---- Sticky bottom CTA ---- */
.ctabar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 12px 20px calc(14px + var(--safe-bottom));
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--hair);
}
.ctabar .inner { max-width: 480px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.ctabar .inner.col { flex-direction: column; align-items: stretch; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 16px; font-weight: 600; letter-spacing: -.01em; padding: 14px 22px; border-radius: 14px;
  border: none; cursor: pointer; transition: transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-block { width: 100%; }
.btn-disabled { background: var(--fill); color: var(--text3); cursor: default; }
.btn-disabled:active { transform: none; }

/* ---- Countdown ---- */
.cd-label { font-size: 11.5px; color: var(--text3); text-align: center; letter-spacing: .01em; }
.countdown { display: flex; justify-content: center; gap: 18px; }
.cd-b { display: flex; flex-direction: column; align-items: center; min-width: 34px; }
.cd-b b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1; }
.cd-b i { font-size: 10px; font-style: normal; color: var(--text3); text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; }
.cd-closed { font-size: 13px; color: var(--text3); }

/* ---- Preview banner ---- */
.previewbar { background: #ffcc00; color: #3a2e00; text-align: center; font-size: 13px; font-weight: 600; padding: calc(9px + var(--safe-top)) 16px 9px; }

/* ---- Info pages ---- */
.centered { min-height: 78vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 30px; }
.centered h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 8px; }
.centered p { color: var(--text2); font-size: 15px; margin: 0 0 24px; max-width: 320px; }

/* ---- Footer ---- */
.foot { text-align: center; color: var(--text3); font-size: 13px; padding: 24px 20px; }
.foot a { color: var(--text2); }
