/* =========================================================
   PEMENANG — winners announcement page
   Builds on css/styles.css (shared design system)
   ========================================================= */

.vh {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- HERO (photo banner) ---------- */
.win-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: clamp(560px, 70vh, 760px);
  padding: calc(var(--header-h) + 2.4rem) 0 3rem;
  overflow: hidden;
  color: var(--paper);
  background-image:
    linear-gradient(180deg, rgba(10, 10, 10, 0.6) 0%, rgba(10, 10, 10, 0.12) 20%, rgba(10, 10, 10, 0) 36%),
    linear-gradient(90deg, rgba(10, 10, 10, 0.94) 0%, rgba(10, 10, 10, 0.84) 30%, rgba(10, 10, 10, 0.55) 52%, rgba(10, 10, 10, 0.16) 74%, rgba(10, 10, 10, 0) 100%),
    url("../assets/banner-pengumuman.png");
  background-size: cover;
  background-position: center right;
  background-repeat: no-repeat;
}
.win-hero .eyebrow { margin-bottom: 1.1rem; }
.win-hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 1.4rem + 6vw, 6rem);
  line-height: 0.92;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin-bottom: 1.2rem;
  max-width: 14ch;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.4);
}
.win-hero__lead {
  max-width: 52ch;
  color: rgba(247, 246, 242, 0.88);
  font-size: clamp(1.02rem, 1rem + 0.4vw, 1.2rem);
  margin: 0 0 2rem;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.35);
}
.win-hero__lead strong { color: #fff; font-weight: 700; }

.win-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid rgba(247, 246, 242, 0.22);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 720px;
  background: rgba(14, 14, 14, 0.36);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.win-meta li {
  flex: 1 1 180px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1.3rem;
  border-right: 1px solid rgba(247, 246, 242, 0.16);
  background: transparent;
}
.win-meta li:last-child { border-right: 0; }
.win-meta b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.3rem, 1rem + 1.4vw, 1.9rem);
  line-height: 1;
  color: var(--paper);
}
.win-meta span {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(247, 246, 242, 0.72);
}

/* header sits over the dark photo hero at the top of this page */
.site-header[data-state="top"] .logo__word { color: var(--paper); }
.site-header[data-state="top"] .nav-toggle span { background: var(--paper); }
.nav__link[aria-current="page"] { color: var(--accent); }
body:not(.nav-open) .site-header[data-state="top"] .nav__link { color: var(--paper); }
body:not(.nav-open) .site-header[data-state="top"] .nav__link[aria-current="page"] { color: var(--gold); }

/* mobile search toggle button (in header, next to menu) */
.search-toggle {
  display: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  place-items: center;
  color: var(--ink);
}
.search-toggle svg { width: 22px; height: 22px; }
.site-header[data-state="top"] .search-toggle { color: var(--paper); }
body.search-open .search-toggle { color: var(--accent); }

/* ---------- FINDER ---------- */
.finder { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(4rem, 8vw, 6rem); }

/* sticky control bar under the fixed header */
.finder__bar {
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.1rem 0 1.2rem;
  margin-bottom: 1.6rem;
  background: rgba(247, 246, 242, 0.92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}

/* search */
.search { position: relative; }
.search__icon {
  position: absolute;
  left: 1.05rem; top: 50%;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  color: var(--muted);
  pointer-events: none;
}
.search__input {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 1rem 3rem 1rem 3rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.search__input::placeholder { color: var(--muted); }
.search__input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(226, 49, 39, 0.14);
}
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear {
  position: absolute;
  right: 0.7rem; top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--paper);
  background: var(--ink);
  display: grid;
  place-items: center;
  transition: background 0.2s var(--ease);
}
.search__clear:hover { background: var(--accent); }

/* distance tabs (underline style — primary switch) */
.tabs {
  display: flex;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  border-bottom: 2px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: none;
  padding: 0.35rem 0 0.85rem;
  font-weight: 700;
  font-size: clamp(1rem, 0.92rem + 0.5vw, 1.22rem);
  letter-spacing: 0.005em;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s var(--ease);
}
.tab small {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: super;
  margin-left: 0.25rem;
  opacity: 0.6;
}
.tab::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.28s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); }
.tab.is-active::after { transform: scaleX(1); }
.tab.is-active small { color: var(--accent); opacity: 1; }

/* category chips */
.chips { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.chip {
  padding: 0.55rem 1rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.chip small { font-weight: 700; opacity: 0.5; margin-left: 0.3rem; }
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.is-active small { opacity: 0.8; }

/* results head */
.results__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.results__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.3rem);
  text-transform: uppercase;
  line-height: 1;
}
.results__count {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}
.results__hint {
  font-size: 0.85rem;
  color: var(--muted);
  border-left: 3px solid var(--gold);
  padding-left: 0.85rem;
  margin: 0.6rem 0 0;
}

/* table */
.table-wrap { margin-top: 1.2rem; overflow-x: auto; }
.wtable { width: 100%; border-collapse: collapse; }
.wtable thead th {
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 1rem 0.8rem;
  border-bottom: 2px solid var(--ink);
}
.wtable .col-rank { width: 108px; }
.wtable .col-time { width: 168px; text-align: right; }
.wtable .col-bib { width: 110px; text-align: right; }

.wtable tbody td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.wtable tbody tr { transition: background 0.15s var(--ease); }
.wtable tbody tr:hover { background: var(--paper-2); }
.wtable tbody tr.is-top-1 { background: rgba(243, 191, 73, 0.10); }
.wtable tbody tr.is-top-1:hover { background: rgba(243, 191, 73, 0.18); }

/* rank cell */
.ranknum {
  display: inline-grid;
  place-items: center;
  min-width: 2.4rem; height: 2.4rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  background: var(--paper-2);
  color: var(--ink);
}
.ranknum.r1 { background: var(--gold); color: var(--ink); }
.ranknum.r2 { background: #d7dade; color: var(--ink); }
.ranknum.r3 { background: #e7c39b; color: var(--ink); }

/* participant cell */
.c-name { line-height: 1.25; }
.pname { display: block; font-weight: 700; font-size: 1.02rem; }
.ploc { display: block; font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.pmeta { display: none; font-size: 0.8rem; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.pcat {
  display: inline-block;
  margin-top: 0.4rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
}
.tag-fastest {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--ink);
  vertical-align: middle;
}

.c-time {
  text-align: right;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.c-bib {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* highlight matched query text */
mark { background: rgba(243, 191, 73, 0.55); color: inherit; padding: 0 1px; border-radius: 2px; }

/* empty state */
.empty {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
  padding: 2.5rem 0;
  color: var(--muted);
}
.empty strong { font-size: 1.15rem; color: var(--ink); }

.finder__note {
  margin-top: 2rem;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 74ch;
  border-top: 1px solid var(--line);
  padding-top: 1.2rem;
}
.finder__note b { color: var(--ink); font-weight: 700; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 760px) {
  .win-hero {
    min-height: auto;
    padding: calc(var(--header-h) + 2rem) 0 2.4rem;
    background-image:
      linear-gradient(180deg, rgba(10, 10, 10, 0.5) 0%, rgba(10, 10, 10, 0.72) 52%, rgba(10, 10, 10, 0.92) 100%),
      url("../assets/banner-pengumuman.png");
    background-position: 70% top;
  }
}

/* mobile: header-triggered search, scrollable chips, compact cards */
@media (max-width: 720px) {
  .finder__bar { top: var(--header-h); }

  /* search relocates to a header-triggered dropdown */
  .search-toggle { display: grid; }
  .finder__bar .search { display: none; }

  /* compact input, sized for the header dropdown */
  .search__input { padding: 0.6rem 2.5rem 0.6rem 2.5rem; font-size: 0.98rem; }
  .search__clear { width: 26px; height: 26px; font-size: 1.15rem; }

  /* backdrop-filter makes .finder__bar a containing block for fixed children;
     drop it while the overlay is open so the overlay anchors to the viewport */
  body.search-open .finder__bar { backdrop-filter: none; -webkit-backdrop-filter: none; }
  body.search-open .finder__bar .search {
    display: block;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    z-index: 60;
    padding: 0.7rem var(--gutter) 0.8rem;
    background: rgba(14, 14, 14, 0.42);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(247, 246, 242, 0.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  }
  /* icon/clear are absolute to .search itself, so its own padding above must
     be added back here or they drift away from the input's actual edges */
  body.search-open .finder__bar .search .search__icon { left: calc(var(--gutter) + 0.8rem); }
  body.search-open .finder__bar .search .search__clear { right: calc(var(--gutter) + 0.5rem); }

  /* category chips scroll horizontally */
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; white-space: nowrap; scroll-snap-align: start; }

  /* results table → compact two-line cards */
  .wtable, .wtable tbody { display: block; width: 100%; }
  .wtable thead { position: absolute; left: -9999px; }
  .wtable tbody tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.7rem 0.85rem;
    margin-bottom: 0.55rem;
    background: #fff;
  }
  .wtable tbody tr:hover { background: #fff; }
  .wtable tbody td { display: block; padding: 0; border: 0; text-align: left; }
  .wtable tbody td::before { content: none; }
  .c-rank { grid-column: 1; }
  .c-name { grid-column: 2; min-width: 0; }
  .c-time { grid-column: 3; text-align: right; font-size: 1.2rem; white-space: nowrap; }
  .wtable tbody td.c-bib { display: none; }
  .c-name .ploc { display: none; }
  .c-name .pmeta { display: block; }
  .c-name .pname { font-size: 1rem; }
  .c-name .pcat { margin-top: 0.35rem; }
}
