/* =========================================================================
   ATBC 2026 — Components
   ========================================================================= */

/* ------------------------- Official banner ------------------------- */
/* Full-bleed conference banner; scrolls away while the nav below sticks. */
.site-banner { display: block; width: 100%; line-height: 0; background: #6e0f17; }
.site-banner img { width: 100%; height: auto; display: block; }

/* ------------------------------ Header ----------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  height: var(--header-h); display: flex; align-items: center; gap: var(--sp-5);
  max-width: 1400px; margin-inline: auto; padding-inline: var(--sp-5);
}
.brand { display: flex; align-items: center; gap: var(--sp-3); font-weight: 800; letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(145deg, var(--green-600), var(--green-800));
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.brand__mark svg { width: 24px; height: 24px; }
.brand__name { font-size: var(--fs-md); color: var(--text); line-height: 1; }
.brand__name b { color: var(--primary); }
.brand__sub { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; letter-spacing: .02em; }

.nav { display: flex; align-items: center; gap: var(--sp-1); margin-left: var(--sp-4); }
.nav a {
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); font-weight: 600;
  font-size: var(--fs-sm); color: var(--text-soft); transition: var(--transition);
}
.nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav a.is-active { color: var(--primary); background: var(--primary-soft); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }

.icon-btn {
  width: 40px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--text-soft); border: 1px solid transparent; transition: var(--transition);
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }

.header-search {
  display: flex; align-items: center; gap: var(--sp-2); height: 40px;
  padding: 0 var(--sp-3); min-width: 200px; border-radius: var(--r-full);
  background: var(--surface-3); border: 1px solid var(--border);
  color: var(--muted); font-size: var(--fs-sm); transition: var(--transition);
}
.header-search:hover { border-color: var(--border-strong); }
.header-search svg { width: 16px; height: 16px; }
.header-search kbd {
  margin-left: auto; font-family: var(--font-mono); font-size: 11px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 6px; color: var(--muted);
}

.menu-toggle { display: none; }

@media (max-width: 860px) {
  .nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: var(--sp-2);
    box-shadow: var(--shadow-md); transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: var(--transition); margin: 0; }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a { width: 100%; }
  .menu-toggle { display: grid; }
  .header-search__label, .header-search kbd { display: none; }
  .header-search { min-width: 0; width: 40px; padding: 0; justify-content: center; }
}

/* ------------------------------ Buttons ---------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: var(--sp-2); justify-content: center;
  padding: var(--sp-2) var(--sp-4); border-radius: var(--r-sm); font-weight: 600;
  font-size: var(--fs-sm); border: 1px solid var(--border); background: var(--surface);
  color: var(--text); transition: var(--transition); white-space: nowrap;
}
.btn:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-3); }
.btn--sm { padding: 6px var(--sp-3); font-size: var(--fs-xs); }
.btn--lg { padding: var(--sp-3) var(--sp-6); font-size: var(--fs-md); border-radius: var(--r-md); }

/* ------------------------------ Chips ------------------------------ */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px;
  border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 600;
  background: var(--chip-bg); color: var(--text-soft); border: 1px solid transparent;
  white-space: nowrap;
}
.chip__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip--btn { cursor: pointer; transition: var(--transition); }
.chip--btn:hover { border-color: var(--border-strong); color: var(--text); }
.chip--btn.is-active { background: var(--primary); color: var(--primary-ink); }
.chip--btn.is-active .chip__dot { box-shadow: 0 0 0 2px rgba(255,255,255,.5); }

/* Type badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px;
  border-radius: var(--r-full); font-size: 11px; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase; line-height: 1.4;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--oral      { color: var(--t-oral);      background: color-mix(in srgb, var(--t-oral) 13%, transparent); }
.badge--symposium { color: var(--t-symposium); background: color-mix(in srgb, var(--t-symposium) 14%, transparent); }
.badge--poster    { color: var(--t-poster);    background: color-mix(in srgb, var(--t-poster) 15%, transparent); }
.badge--ofs       { color: var(--t-ofs);       background: color-mix(in srgb, var(--t-ofs) 13%, transparent); }
.badge--workshop  { color: var(--t-workshop);  background: color-mix(in srgb, var(--t-workshop) 13%, transparent); }
.badge--course    { color: var(--t-course);    background: color-mix(in srgb, var(--t-course) 13%, transparent); }
.badge--plenary   { color: var(--t-plenary);   background: color-mix(in srgb, var(--t-plenary) 14%, transparent); }
.badge--special   { color: var(--t-special);   background: color-mix(in srgb, var(--t-special) 14%, transparent); }

/* ------------------------------ Cards ------------------------------ */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-xs); transition: var(--transition);
}
.card--pad { padding: var(--sp-5); }
a.card:hover, .card--link:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* ------------------------------ Tabs ------------------------------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: var(--r-full); border: 1px solid var(--border); }
.tabs--block { display: flex; flex-wrap: wrap; }
.tab {
  padding: 8px var(--sp-4); border-radius: var(--r-full); font-weight: 700; font-size: var(--fs-sm);
  color: var(--text-soft); transition: var(--transition); white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }
.tab small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.tab.is-active small { color: var(--primary); opacity: .8; }

/* ------------------------------ Stats ------------------------------ */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-3); }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); text-align: center; }
.stat__num { font-family: var(--font-display); font-size: var(--fs-2xl); font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -.02em; }
.stat__label { font-size: var(--fs-xs); color: var(--muted); margin-top: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* ------------------------------ Search bar ------------------------- */
.searchbar { position: relative; }
.searchbar input {
  width: 100%; height: 52px; padding: 0 var(--sp-12) 0 var(--sp-12);
  border-radius: var(--r-md); border: 1px solid var(--border); background: var(--surface);
  font-size: var(--fs-md); transition: var(--transition); box-shadow: var(--shadow-xs);
}
.searchbar input:focus { border-color: var(--primary); box-shadow: var(--ring); outline: none; }
.searchbar input::placeholder { color: var(--muted); }
.searchbar__icon { position: absolute; left: var(--sp-4); top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbar__icon svg { width: 20px; height: 20px; }
.searchbar__clear { position: absolute; right: var(--sp-3); top: 50%; transform: translateY(-50%); }

.filters { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.filter-group { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.select {
  height: 38px; padding: 0 var(--sp-8) 0 var(--sp-3); border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-soft); appearance: none; -webkit-appearance: none; transition: var(--transition);
}
.select:hover { border-color: var(--border-strong); }
.select:focus { border-color: var(--primary); box-shadow: var(--ring); outline: none; }

/* ------------------------------ Modal ------------------------------ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100; background: var(--overlay);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: var(--sp-8) var(--sp-4); overflow-y: auto; animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 760px; margin: auto;
  animation: pop .24s cubic-bezier(.2,.7,.2,1); overflow: hidden;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.modal__close { position: absolute; top: var(--sp-4); right: var(--sp-4); z-index: 2; background: var(--surface); border: 1px solid var(--border); }

/* ------------------------------ Empty ------------------------------ */
.empty { text-align: center; padding: var(--sp-12) var(--sp-4); color: var(--muted); }
.empty svg { width: 28px; height: 28px; margin: 0 auto var(--sp-3); opacity: .5; }

/* ------------------------------ Divider ---------------------------- */
.divider { height: 1px; background: var(--border); border: 0; margin-block: var(--sp-6); }

/* ------------------------------ Footer ----------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: var(--sp-16); }
.site-footer__inner { padding-block: var(--sp-8); display: flex; flex-wrap: wrap; gap: var(--sp-6); justify-content: space-between; align-items: center; }
.site-footer small { color: var(--muted); }

/* ------------------------------ Toast ------------------------------ */
.toast {
  position: fixed; bottom: var(--sp-6); left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink-900); color: var(--ink-50); padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-full); box-shadow: var(--shadow-lg); font-size: var(--fs-sm); font-weight: 600;
  z-index: 200; opacity: 0; pointer-events: none; transition: var(--transition);
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }
