/* ============================================================================
   University of Michigan Athletics — SLDP preroll player
   Page identity + the "pill" control treatment.

   The player has three visual states, each of which fully replaces the
   contents of #player-container:

     1. Click-to-play   → .click-to-play-overlay        (index.html)
     2. Preroll ad      → .preroll-ad-wrapper            (preroll-manager.js)
     3. Live stream     → #sldp-player + SLDP internals  (sldp-*.min.js)

   All three render as the same rounded pill (see PILL CHROME below) so the
   handoff between states reads as one continuous control, not three UIs.
   Ad-specific rules live in css/preroll.css.

   Colors are the primary Michigan Athletics palette only (Brand Guide 08.2020):
     Maize #FFCB05 · Blue #00274C · White
   Accessible pairings used here, per the guide: maize-on-blue, white-on-blue,
   blue-on-maize. (White-on-maize is NOT an approved combination.)
   ============================================================================ */

/* =====================================================
   BRAND CONFIG — EDIT ONLY THIS SECTION
   ===================================================== */
:root {
  --bg-color:  #FEFEFE;   /* PMS 282  */
  --accent-color: #1241A7;   /* PMS 7406 */
  --text-color: #1241A7;

  /* Derived tints — alpha layers over the primaries, no new hues */
  --text-secondary: rgba(18, 65, 167, 0.72);
  --pill-bg:        rgba(255, 255, 255, 0.06);
  --pill-border:    rgba(18, 65, 167, 0.35);
  --pill-shadow:    0 10px 30px rgba(0, 0, 0, 0.35);

  /* Oswald + Montserrat are University-approved general-use typefaces
     (see "UNIVERSITY-APPROVED / General Use Typefaces" in the brand guide).
     Loaded from Google Fonts in index.html; the stacks below hold up if
     that <link> is removed. */
  --font-display: 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --font-ui: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI',
             Roboto, sans-serif;

  --content-max-width: 560px;
  --pill-height: 72px;
  --control-size: 44px;   /* round play button; also the pulse-dot lane width */
}

/* =====================================================
   BASE
   Reset is scoped to page chrome rather than applied via `*`, so it cannot
   reach inside the SLDP player's injected DOM and disturb its own layout.
   ===================================================== */
html, body, header, main, footer, h1, h2, p, div, span, button, a {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-ui);
  color: var(--text-color);
  /* The night field: solid Michigan blue with one faint stadium-light glow
     falling from above. */
  background:
    radial-gradient(1100px 560px at 50% -12%, rgba(255, 255, 255, 0.07), transparent 62%),
    var(--bg-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 64px;
}

/* =====================================================
   HEADER — the mark on the field
   The maize Block M is the primary mark and is used unbordered on a dark
   solid background, exactly as the brand guide prescribes. Do not enclose
   it in a shape, recolor it, or animate it.
   ===================================================== */
header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 40px;
}

.block-m {
  width: clamp(144px, 28vw, 208px);
  height: auto;
  display: block;
  margin-bottom: 22px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-color);
}

/* =====================================================
   MAIN
   ===================================================== */
main {
  width: 100%;
  display: flex;
  justify-content: center;
}

.player-shell {
  width: 100%;
  max-width: var(--content-max-width);
  text-align: center;
}

.stream-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-indent: 0.3em; /* re-centers tracked uppercase text */
  text-transform: uppercase;
  color: var(--accent-color);
  margin-bottom: 18px;
}

#player-container {
  width: 100%;
  min-height: var(--pill-height); /* reserve the lane; states swap without layout jump */
  position: relative;
  text-align: left;
}

/* =====================================================
   PILL CHROME — one rule, three states
   Each state's root element draws the same pill. (The ad wrapper drops the
   pill and becomes a rounded 16:9 panel when the creative is video — see
   css/preroll.css.)
   ===================================================== */
.click-to-play-overlay,
.preroll-ad-wrapper.preroll-audio-mode,
#sldp-player {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: var(--pill-height);
  padding: 14px 20px 14px 14px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  box-shadow: var(--pill-shadow);
}

/* =====================================================
   STATE 1 — CLICK-TO-PLAY
   ===================================================== */
.click-to-play-overlay {
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.click-to-play-overlay:hover,
.click-to-play-overlay:focus-visible {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(18, 65, 167, 0.6);
}

.click-to-play-overlay:hover {
  outline: none;
}
/* Keyboard focus keeps the explicit maize outline from :focus-visible below. */

.play-button-circle {
  width: var(--control-size);
  height: var(--control-size);
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.click-to-play-overlay:hover .play-button-circle,
.click-to-play-overlay:focus-visible .play-button-circle {
  transform: scale(1.07);
  box-shadow: 0 0 0 4px rgba(18, 65, 167, 0.25), 0 2px 12px rgba(0, 0, 0, 0.35);
}

.play-button-circle svg {
  width: 20px;
  height: 20px;
  fill: var(--bg-color);
  margin-left: 2px; /* optical centering for the play glyph */
}

.click-to-play-text {
  color: var(--text-color);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* =====================================================
   STATE 3 — LIVE STREAM (SLDP control bar)
   The SLDP library injects its own DOM into #sldp-player. The rules below
   are ported from a proven production override of the same player:
     · the control bar ships ~30px tall with hidden overflow, which slices a
       44px round button into an ellipse — unclip every ancestor
     · the player sets inline zoom:2 on mobile — undo it
     · the play/pause glyph is drawn by the player via ::before — keep it
       centered by forcing transform off; we only color and frame it
   ===================================================== */
#sldp-player,
.sldp_player_wrp,
.sldp_player_wrp_audio,
.sldp_cbar,
.sldp_cbar_audio {
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
}

.sldp_player_wrp,
.sldp_player_wrp_audio {
  width: auto !important;
  background: transparent !important;
  box-shadow: none !important;
}

.sldp_cbar,
.sldp_cbar_audio {
  zoom: 1 !important;
  width: auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.sldp_play_pause_btn {
  flex: none !important;
  width: var(--control-size) !important;
  height: var(--control-size) !important;
  min-width: var(--control-size) !important;
  min-height: var(--control-size) !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--accent-color) !important;
  color: var(--bg-color) !important;
  border: 0 !important;
  border-radius: 50% !important;
  outline: none !important;
  cursor: pointer !important;
  font-size: 18px !important;
  line-height: 1 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.sldp_play_pause_btn::before {
  display: block !important;
  transform: none !important;
}

/* Volume stays available on a full-page player. To hide it (e.g. for a
   compact embed), uncomment the next line. */
/* .sldp_volume_wrp { display: none !important; } */
.sldp_volume_wrp {
  margin: 0 !important;
}

/* On-air chip. #sldp-player only exists once the stream is running, so this
   needs no scripting; the pill is a flex row and margin pushes it right. */
#sldp-player::after {
  content: '\25CF\a0\a0ON AIR';
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--accent-color);
}

/* =====================================================
   FOOTER — "Powered by StreamGuys" credit
   A small pill echoing the player chrome so the credit sits inside the page's
   visual language rather than interrupting it. The StreamGuys mark is
   full-color on a white chip (never reversed or recolored, per the SG guide).
   ===================================================== */
footer {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.sg-credit {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 7px 16px 7px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(18, 65, 167, 0.14);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.sg-credit:hover,
.sg-credit:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 0,  0, 0.35);
}

.sg-credit-chip {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(18, 65, 167, 0.14);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sg-credit-chip img {
  width: 19px;
  height: auto;
  display: block;
}

.sg-credit-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.sg-credit-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(18, 65, 167, 0.6);
}

.sg-credit-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-color);
}

/* =====================================================
   ACCESSIBILITY
   ===================================================== */
:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 480px) {
  :root {
    --pill-height: 64px;
    --control-size: 40px;
  }

  body {
    padding: 36px 16px 48px;
  }

  header {
    margin-bottom: 32px;
  }

  footer {
    margin-top: 32px;
  }

  .click-to-play-text {
    font-size: 15px;
  }

  #sldp-player::after {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .click-to-play-overlay,
  .play-button-circle,
  .sg-credit {
    transition: none;
  }
}
