/* ============================================================
   Shared Styles — public-facing event & theater pages
   Matches the Webflow POC aesthetic (silent-theater-v3.webflow)
   Requires: tokens.css loaded first
============================================================ */

/* Self-hosted Nunito Sans — selectable as an event font (TTFs in css/Nunito_Sans/).
   Bundled so it works without an external Google Fonts request. */
@font-face { font-family: 'Nunito Sans'; font-weight: 300; font-style: normal; font-display: swap; src: url('Nunito_Sans/NunitoSans-Light.ttf') format('truetype'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 400; font-style: normal; font-display: swap; src: url('Nunito_Sans/NunitoSans-Regular.ttf') format('truetype'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 400; font-style: italic;  font-display: swap; src: url('Nunito_Sans/NunitoSans-Italic.ttf') format('truetype'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 600; font-style: normal; font-display: swap; src: url('Nunito_Sans/NunitoSans-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 700; font-style: normal; font-display: swap; src: url('Nunito_Sans/NunitoSans-Bold.ttf') format('truetype'); }
@font-face { font-family: 'Nunito Sans'; font-weight: 800; font-style: normal; font-display: swap; src: url('Nunito_Sans/NunitoSans-ExtraBold.ttf') format('truetype'); }

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

body {
  font-family: "Open Sans", sans-serif;
  background: var(--event-bg);
  background-attachment: fixed;
  color: var(--event-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease;
}

.app-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

/* ============================================================
   NAV BAR — shared by event.html (.top-hero-wrapper) and
   theater.html (.site-nav). Both render identically: sticky,
   translucent, blurred, with an optional shadow (--nav-shadow).
============================================================ */
.top-hero-wrapper,
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--nav-bg, rgba(0, 0, 0, 0.35));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--nav-shadow, none);
  transition: background .3s, box-shadow .3s;
}

.top-hero-inner,
.site-nav-inner {
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.site-nav-inner { justify-content: space-between; }

.logo-link { display: inline-flex; align-items: center; text-decoration: none; }
.logo-wrapper { display: flex; align-items: center; }
.event-logo { height: var(--event-logo-h, 32px); width: auto; object-fit: contain; }

.nav-logo-link {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--nav-text, var(--event-text));
  font-weight: 600; font-size: 15px; opacity: 0.9; transition: opacity .2s;
}
.nav-logo-link:hover { opacity: 1; }

.nav-back-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1); flex-shrink: 0; transition: background .2s;
}
.nav-back-icon:hover { background: rgba(255,255,255,0.18); }

.nav-logo { height: 32px; max-width: 140px; object-fit: contain; }
.nav-logo-text { color: var(--nav-text, var(--event-text)); font-size: 15px; font-weight: 600; text-shadow: var(--text-shadow, none); }

.nav-right { display: flex; align-items: center; gap: 12px; }

.nav-live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  background: #1e7a52; color: #ffffff; border: 1px solid rgba(255,255,255,0.18);
}

.nav-tech-label { font-size: 11px; color: color-mix(in srgb, var(--event-text) 40%, transparent); letter-spacing: 0.04em; }

/* ============================================================
   TYPOGRAPHY
============================================================ */
/* Font sizes scale with --font-scale (set per-event from the Typography setting:
   small .9 · base 1 · large 1.15 · xl 1.35). */
.text-large   { font-size: calc(20px * var(--font-scale, 1)); font-weight: 600; line-height: 1.3; color: var(--event-text); }
.text-regular { font-size: calc(15px * var(--font-scale, 1)); font-weight: 600; line-height: 1.4; color: var(--event-text); }
.text-small   { font-size: calc(12px * var(--font-scale, 1)); font-weight: 400; line-height: 1.4; color: var(--event-text); }
.light        { color: color-mix(in srgb, var(--event-text) 55%, transparent); }

/* ============================================================
   MAIN CONTENT AREA
============================================================ */
.center-wrapper {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 24px 80px;
  width: 100%;
}
.center-wrapper.align-top { display: flex; flex-direction: column; }
.center-wrapper.theater   { max-width: 760px; }

/* ============================================================
   FILTER / SEARCH BAR
============================================================ */
.filter-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: nowrap;
}

#tag-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.filter-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; font-size: 13px; font-weight: 500;
  border-radius: 999px;
  background: var(--category-bg, rgba(255,255,255,0.08)); color: var(--category-text, var(--event-text));
  cursor: pointer; border: 1px solid rgba(255,255,255,0.15);
  transition: all .2s; text-decoration: none; white-space: nowrap;
}
.filter-tag:hover  { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.3); }
.filter-tag.active { background: var(--category-active-bg, var(--event-accent)); color: var(--category-active-text, #002466); border-color: transparent; font-weight: 600; }

/* Dropdown alternative to the pill filters */
.category-select {
  appearance: none; -webkit-appearance: none;
  padding: 8px 36px 8px 16px;
  font-size: 13px; font-weight: 500; font-family: inherit;
  border-radius: 999px;
  background-color: rgba(255,255,255,0.08);
  color: var(--category-text, var(--event-text));
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer; transition: all .2s; outline: none;
  /* chevron */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.category-select:hover { background-color: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.3); }
.category-select option { color: #14130f; background: #ffffff; }
.filter-tag .tag-icon { width: 14px; height: 14px; opacity: 0.7; }

.search-toggle-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0;
  background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.15); cursor: pointer;
  transition: all .2s;
}
.search-toggle-btn:hover { background: rgba(255,255,255,0.16); color: #fff; }

/* ---- Live search bar ---- */
.search-bar-wrapper { margin-bottom: 20px; }

.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}
.search-input-wrap input {
  flex: 1; background: none; border: none; outline: none;
  color: #fff; font-size: 14px; font-family: inherit;
}
.search-input-wrap input::placeholder { color: rgba(255,255,255,0.4); }

/* ============================================================
   CATEGORY LANDING — categories as buttons → per-category sub-list
============================================================ */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.category-tile {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  min-height: 96px; padding: 22px 20px;
  border-radius: var(--card-radius, 16px);
  background: var(--card-bg, rgba(255,255,255,0.06));
  border: 1px solid var(--card-border, rgba(255,255,255,0.12));
  box-shadow: var(--card-shadow, none);
  text-shadow: var(--text-shadow, none);
  color: var(--event-text, #fff); text-decoration: none;
  transition: border-color .2s, background .2s, transform .15s;
}
.category-tile:hover {
  background: var(--card-bg-hover, rgba(255,255,255,0.10));
  border-color: var(--event-accent, #5cd7f2);
  transform: translateY(-2px);
}
.category-tile-label { font-size: 18px; font-weight: 700; }
.category-tile-meta  { font-size: 13px; color: color-mix(in srgb, var(--event-text) 60%, transparent); }
.category-tile-arrow { position: absolute; right: 18px; top: 22px; color: var(--event-accent, #5cd7f2); font-size: 18px; }
.cat-live { color: #2ec27e; font-weight: 600; }
.category-back { color: var(--event-accent, #5cd7f2); text-decoration: none; font-size: 14px; font-weight: 600; cursor: pointer; }
.category-back:hover { text-decoration: underline; }
.category-current { margin-left: 12px; font-size: 14px; color: color-mix(in srgb, var(--event-text) 60%, transparent); }

/* ============================================================
   EVENT LIST CARDS — matching POC .event-card-wrapper
============================================================ */
.event-list-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.event-card-wrapper {
  background: var(--card-bg, rgba(255,255,255,0.06));
  border: 1px solid var(--card-border, rgba(255,255,255,0.12));
  border-radius: var(--card-radius, 16px);
  overflow: hidden;
  text-shadow: var(--text-shadow, none);
  transition: border-color .2s, background .2s, box-shadow .2s;
  /* consistent height regardless of sponsor presence */
  display: flex;
  flex-direction: column;
  backdrop-filter: var(--card-blur, none);
  -webkit-backdrop-filter: var(--card-blur, none);
  box-shadow: var(--card-shadow, none);
}
.event-card-wrapper:hover {
  background: var(--card-bg-hover, rgba(255,255,255,0.10));
  border-color: var(--card-border-hover, rgba(255,255,255,0.22));
}

.theater-link-wrapper { display: block; text-decoration: none; color: inherit; flex: 1; }

.event-card {
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 90px; /* ensures consistent card height */
}

.theater-title-wrapper { flex: 1; }
.theater-title-wrapper .text-regular { font-weight: 600; }
.theater-title-wrapper .text-small   { margin-top: 4px; }

.theater-location-wrapper {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  min-height: 20px; /* placeholder height even when no location */
}
.theater-location-wrapper--empty { min-height: 20px; } /* consistent spacing */
.icon-location { width: 14px; height: 14px; flex-shrink: 0; color: color-mix(in srgb, var(--event-text) 45%, transparent); }
.icon-location.w-embed { display: flex; align-items: center; justify-content: center; }

/* ---- Sponsor section — always same height ---- */
.spon-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  border-top: 1px solid rgba(255,255,255,0.08);
  min-height: 44px; /* always reserve this height for consistency */
}
.spon-wrapper--empty {
  /* empty sponsor — just a spacer divider */
  border-top: 1px solid rgba(255,255,255,0.04);
  opacity: 0;
}
.spon-link { display: inline-block; }
/* never stretch sponsor logos — preserve aspect ratio at every size */
.spon-logo { height: 22px; max-width: 100px; width: auto; object-fit: contain; }
.spon-logo.spon-sm { height: 16px; max-width: 70px; }
.spon-logo.spon-md { height: 22px; max-width: 100px; }
.spon-logo.spon-lg { height: 34px; max-width: 150px; }
.spon-name-text { font-weight: 600; font-size: 13px; }

/* ============================================================
   THEATER PLAYER PAGE
============================================================ */
.event-player-wrapper {
  /* matches the home-page session cards (.event-card-wrapper) */
  position: relative; /* anchors the top-right live-status pill */
  background: var(--card-bg, rgba(255,255,255,0.06));
  border: 1px solid var(--card-border, rgba(255,255,255,0.12));
  border-radius: var(--card-radius, 16px);
  overflow: hidden;
  text-shadow: var(--text-shadow, none);
  margin-top: 24px;
  backdrop-filter: var(--card-blur, none);
  -webkit-backdrop-filter: var(--card-blur, none);
  box-shadow: var(--card-shadow, none);
}

/* Give shadows breathing room so they don't bleed onto neighbouring elements. */
.cards-shadowed .event-list-wrapper { gap: 28px; }
.cards-shadowed .event-player-wrapper { margin-top: 34px; }
.nav-shadowed .top-hero-wrapper,
.nav-shadowed .site-nav { margin-bottom: 14px; }

/* Mobile: keep the booth card's live status pinned to its top-right corner. */
@media (max-width: 640px) {
  .event-card-wrapper { position: relative; }
  .evcard-status { position: absolute; top: 14px; right: 14px; z-index: 3; }
}

/* ---- Live / offline status — top-right of the booth player card ---- */
.live-status-banner {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  flex-direction: row-reverse;
  max-width: 260px;
  padding: 7px 13px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.3;
  box-shadow: 0 6px 20px rgba(0,0,0,0.28);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.live-status-banner .status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.live-status-banner.is-live { background: rgba(30,122,82,0.94); color: #ffffff; }
.live-status-banner.is-live .status-dot { background: #fff; animation: pulse-live 1.4s ease-in-out infinite; }
.live-status-banner.is-off { background: rgba(0,0,0,0.5); color: rgba(255,255,255,0.85); }
.live-status-banner.is-off .status-dot { background: rgba(255,255,255,0.5); }

/* "Light only" mode — just a green/red dot, no pill background or text */
.live-status-banner.status-light { background: transparent; box-shadow: none; padding: 6px; }
.live-status-banner.status-light.is-live .status-dot { background: #2ec27e; width: 14px; height: 14px; }
.live-status-banner.status-light.is-off  .status-dot { background: #e05252; width: 14px; height: 14px; animation: none; }

/* The floating corner indicator replaces the in-nav "Live" chips. */
#live-badge, #nav-live-badge { display: none !important; }

.spon-event-wrapper {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 24px;
}

.line-break { height: 1px; background: rgba(255,255,255,0.08); }

/* ---- Captions ---- */
.caption-wrapper {
  /* "captions window" — the iframe fills the whole box; the CC toggle floats
     absolutely in the top-left corner over it. */
  position: relative;
  /* extra top margin keeps the box well below the absolutely-positioned
     live-status pill (top:12px) so nothing overlaps it */
  margin: 64px 24px 4px;
  padding: 0; /* so the iframe can stretch edge-to-edge */
  /* fillable background — admins can set a specific colour (--caption-bg);
     falls back to a subtle tint of the event text colour */
  background: var(--caption-bg, color-mix(in srgb, var(--event-text, #fff) 7%, transparent));
  border: 1.5px solid color-mix(in srgb, var(--event-text, #fff) 38%, transparent);
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.05);
  min-height: 200px; /* taller box; consistent height whether enabled or not */
  overflow: hidden;  /* clip the iframe to the rounded corners */
}
.caption-text-helper {
  width: 100%; min-height: 200px; box-sizing: border-box;
  padding: 16px;
  font-size: 14px; line-height: 1.6;
  color: color-mix(in srgb, var(--event-text) 65%, transparent);
}

/* ---- Theater info ---- */
.event-info-wrapper { padding: 20px 24px; }
.event-info-wrapper .text-large   { color: var(--event-text); margin-bottom: 6px; }
.event-info-wrapper .text-regular { color: color-mix(in srgb, var(--event-text) 60%, transparent); }
.icon-embed-xxsmall { width: 14px; height: 14px; flex-shrink: 0; }

/* ---- Controls bar ---- */
.controls-wrapper {
  display: flex; align-items: center; justify-content: center; gap: 32px;
  padding: 20px 24px;
}

.control-icon-wrapper {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer;
  /* idle colour — admin-settable via --control-color, else muted site text */
  color: var(--control-color, color-mix(in srgb, var(--event-text) 60%, transparent));
  transition: color .2s, transform .2s ease;
}
.control-icon-wrapper:hover  { color: var(--control-active-color, var(--event-text)); transform: translateY(-3px) scale(1.08); }
.control-icon-wrapper:active { transform: translateY(-1px) scale(0.96); }
/* Active states — captions "on" and mute "muted" use the active colour + halo. */
.control-icon-wrapper.cc-active,
.control-icon-wrapper.muted { color: var(--control-active-color, var(--event-accent, #5cd7f2)); }
.control-icon-wrapper.cc-active .control-icons,
.control-icon-wrapper.muted .control-icons {
  background: color-mix(in srgb, var(--control-active-color, var(--event-accent, #5cd7f2)) 16%, transparent);
  box-shadow: 0 0 0 8px color-mix(in srgb, var(--control-active-color, var(--event-accent, #5cd7f2)) 16%, transparent);
  border-radius: 8px;
}

/* Control labels ("Captions" / "Mute") follow the icon color. Inherit the
   wrapper's color directly — idle via --control-color, active (hover /
   captions-on / muted) via --control-active-color. (Avoid color-mix(currentColor)
   here: using currentColor inside the `color` property resolves circularly in
   some engines and only updates after a forced repaint.) */
.control-icon-wrapper .control-label { font-size: 11px; color: inherit; }

/* secondary controls (captions, mute) */
.control-icons { width: 30px; height: 30px; }
.control-icons svg,
.control-icons img { width: 100%; height: 100%; display: block; }
/* primary control (play) — uses the active control colour */
.control-icons.play { width: 100px; height: 100px; color: var(--control-active-color, var(--event-accent)); }
/* Buffering circle shown until the booth goes live */
.play-spinner {
  width: 100%; height: 100%; border-radius: 50%; box-sizing: border-box;
  border: 6px solid color-mix(in srgb, var(--event-text, #fff) 18%, transparent);
  border-top-color: var(--control-active-color, var(--event-accent, #5cd7f2));
  animation: st-spin 0.9s linear infinite;
}
@keyframes st-spin { to { transform: rotate(360deg); } }
.control-icons.play img { object-fit: contain; }

/* ============================================================
   LOADING / EMPTY STATES
============================================================ */
.loading-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 60px 24px; color: rgba(255,255,255,0.35); font-size: 14px;
}
.empty-state {
  padding: 40px 24px; text-align: center;
  color: rgba(255,255,255,0.4); font-size: 14px;
}

/* ============================================================
   LIVE BADGE
============================================================ */
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  /* solid green stays legible on both light and dark card backgrounds */
  background: #1e7a52; color: #ffffff; white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.18);
}
.live-badge--offline {
  /* same dimensions, invisible — keeps the flex space so card height is consistent */
  background: transparent; color: transparent; border: none;
  min-width: 60px; /* approximate width of live badge */
}
/* visible muted "Offline" chip on session cards */
.live-badge--off {
  background: color-mix(in srgb, var(--event-text) 8%, transparent);
  color: color-mix(in srgb, var(--event-text) 50%, transparent);
  border: 1px solid color-mix(in srgb, var(--event-text) 16%, transparent);
}
/* "Light only" status mode — a green/red dot on session cards (matches the player) */
.live-dot-only { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.live-dot-only--on  { background: #2ec27e; animation: pulse-live 1.4s ease-in-out infinite; }
.live-dot-only--off { background: #e05252; }
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: pulse-live 1.4s ease-in-out infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 640px) {
  .top-hero-wrapper { padding: 16px 20px 14px; }
  .center-wrapper   { padding: 16px 16px 60px; }
  .event-card       { flex-direction: column; align-items: flex-start; }
  .controls-wrapper { gap: 20px; }
  .site-nav-inner   { padding: 0 16px; }
}
