/* /formats/ only: the ad format videos in a TV frame, the format tabs and the steps.
   The look of the sofads-tv-demo-view player: a light stage under the site's header.
   Loaded by that page alone (page.styles). Fonts and brand colors come from site.css. */

.fmt {
  --f-navy: #040d1f;
  --f-ink: #0d1b33;
  --f-ink-2: #44526b;
  --f-ink-3: #6b7890;
  --f-blue: #1f8efd;
  --f-blue-ink: #0b5fb8;
  --f-cyan: #2ad6fd;
  --f-line: rgba(13, 27, 51, 0.12);
  --f-card: rgba(255, 255, 255, 0.72);
  color: var(--f-ink);
  background:
    radial-gradient(60% 50% at 10% 0%, rgba(31, 142, 253, 0.16), transparent 70%),
    radial-gradient(50% 60% at 100% 100%, rgba(42, 214, 253, 0.18), transparent 70%),
    radial-gradient(40% 40% at 80% 10%, rgba(124, 92, 255, 0.1), transparent 70%),
    #f4f7fc;
  padding-block: clamp(1.25rem, 3vw, 2.5rem) clamp(2rem, 5vw, 4rem);
}
.fmt a { color: var(--f-blue-ink); }
.fmt :focus-visible { outline: 3px solid var(--f-blue); outline-offset: 3px; border-radius: 10px; }
.fmt button { font: inherit; color: inherit; }

.fmt-wrap {
  width: min(100% - 2 * var(--gutter), 105rem);
  margin-inline: auto;
}

/* ---------- Heading and tabs ---------- */

.fmt-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(1rem, 2.5vw, 2rem);
}
.fmt-kicker {
  display: block;
  font: 600 0.95rem/1 var(--font-display);
  color: var(--f-ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.fmt h1 {
  font: 800 var(--step-3)/1.05 var(--font-display);
  color: var(--f-ink);
  margin: 0;
  letter-spacing: -0.01em;
}
.fmt-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(13, 27, 51, 0.06);
  border: 1px solid var(--f-line);
}
.fmt-tabs button {
  border: 0;
  background: transparent;
  padding: 10px 22px;
  border-radius: 999px;
  font: 600 1rem/1 var(--font-display);
  color: var(--f-ink-2);
  cursor: pointer;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out);
}
.fmt-tabs button[aria-selected='true'] { background: var(--f-navy); color: #fff; }

/* ---------- The TV ---------- */

.fmt-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 24rem);
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: start;
}
.fmt-watch { min-width: 0; }

/* The PNG is 1586 × 1020; its transparent screen is x 136–1450, y 113–852 (1315 × 740, 16:9). */
.fmt-tv {
  position: relative;
  width: min(100%, calc((100vh - 13rem) * 1586 / 1020));
  aspect-ratio: 1586 / 1020;
  margin: 0 auto;
}
.fmt-screen {
  position: absolute;
  left: calc(136 / 1586 * 100%);
  top: calc(113 / 1020 * 100%);
  width: calc(1315 / 1586 * 100%);
  height: calc(740 / 1020 * 100%);
  object-fit: cover;
  background: #000;
  cursor: pointer;
}
.fmt-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 30px 40px rgba(13, 27, 51, 0.25));
}
.fmt-play {
  position: absolute;
  left: calc((136 + 1315 / 2) / 1586 * 100%);
  top: calc((113 + 740 / 2) / 1020 * 100%);
  width: clamp(56px, 8vw, 104px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  color: var(--f-navy) !important;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  transition: transform 250ms var(--ease-out);
}
.fmt-play svg { width: 44%; fill: currentColor; margin-left: 8%; }
.fmt-play:hover { transform: translate(-50%, -50%) scale(1.06); }
.fmt-play[hidden], .fmt-ended[hidden], .fmt-pill[hidden] { display: none; }
.fmt-ended {
  position: absolute;
  left: calc(136 / 1586 * 100%);
  top: calc(113 / 1020 * 100%);
  width: calc(1315 / 1586 * 100%);
  height: calc(740 / 1020 * 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(4, 13, 31, 0.55);
  backdrop-filter: blur(6px);
}
.fmt-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 0;
  background: #fff;
  color: var(--f-navy) !important;
  font: 700 1.05rem/1 var(--font-body);
  cursor: pointer;
}
.fmt-pill svg { width: 20px; height: 20px; }
.fmt-pill-primary { background: linear-gradient(135deg, var(--f-blue), var(--f-cyan)); font-family: var(--font-display); font-weight: 800; }

/* ---------- Control bar (as wide as the TV's bezel: x 120–1466 of 1586) ---------- */

.fmt-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  width: calc(min(100%, calc((100vh - 13rem) * 1586 / 1020)) * 1346 / 1586);
  margin: 14px auto 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--f-card);
  border: 1px solid var(--f-line);
  backdrop-filter: blur(10px);
}
.fmt-icon {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--f-ink) !important;
}
.fmt-icon:hover { background: rgba(13, 27, 51, 0.08); }
.fmt-icon svg { width: 22px; height: 22px; fill: currentColor; }
#fmt-toggle .i-pause, #fmt-toggle.is-playing .i-play { display: none; }
#fmt-toggle.is-playing .i-pause { display: block; }
.fmt-track {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: rgba(13, 27, 51, 0.12);
  cursor: pointer;
}
.fmt-track::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; bottom: -10px; }
.fmt-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--f-blue), var(--f-cyan)); }
.fmt-ticks span { position: absolute; top: -3px; width: 3px; height: 14px; margin-left: -1.5px; border-radius: 2px; background: var(--f-navy); opacity: 0.35; }
.fmt-time { font: 600 0.9rem/1 var(--font-display); color: var(--f-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- The steps ---------- */

.fmt-story h2 { font: 800 clamp(1.8rem, 2.6vw, 2.5rem)/1.05 var(--font-display); color: var(--f-ink); margin: 0 0 0.6rem; letter-spacing: -0.01em; }
.fmt-lede { margin: 0 0 0.6rem; font-size: 1.1rem; line-height: 1.45; color: var(--f-ink-2); }
.fmt-about { margin: 0 0 1.2rem; font-size: 0.98rem; line-height: 1.5; color: var(--f-ink-3); }
.fmt-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fmt-steps button {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  align-items: start;
  text-align: left;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: background 250ms var(--ease-out), border-color 250ms var(--ease-out);
}
.fmt-steps button:hover { background: rgba(255, 255, 255, 0.6); }
.fmt-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 800 1rem/1 var(--font-display);
  background: rgba(13, 27, 51, 0.08);
  color: var(--f-ink-2);
  transition: background 250ms var(--ease-out), color 250ms var(--ease-out);
}
.fmt-txt { font: 600 1.02rem/1.35 var(--font-body); color: var(--f-ink-2); padding-top: 7px; }
.fmt-steps code {
  display: inline-block;
  margin-top: 8px;
  font: 600 0.88rem/1 var(--font-code);
  color: var(--f-blue-ink);
  background: rgba(31, 142, 253, 0.1);
  padding: 6px 9px;
  border-radius: 8px;
}
.fmt-steps li.is-active button { background: #fff; border-color: rgba(31, 142, 253, 0.35); box-shadow: 0 12px 30px rgba(13, 27, 51, 0.1); }
.fmt-steps li.is-active .fmt-num { background: linear-gradient(135deg, var(--f-blue), var(--f-cyan)); color: var(--f-navy); }
.fmt-steps li.is-active .fmt-txt { color: var(--f-ink); }
.fmt-steps li.is-done .fmt-num { background: rgba(31, 142, 253, 0.16); color: var(--f-blue-ink); }
.fmt-note { margin: 1.3rem 0 0; font-size: 0.92rem; line-height: 1.45; color: var(--f-ink-3); }
.fmt-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; margin-top: 1.2rem; }
.fmt-cta {
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--f-blue), var(--f-cyan));
  color: var(--f-navy) !important;
  font: 800 0.95rem/1 var(--font-display);
  text-decoration: none;
  white-space: nowrap;
}
.fmt-link { font-weight: 700; }

/* ---------- Narrow screens: the steps under the TV ---------- */

@media (max-width: 68rem) {
  .fmt-stage { grid-template-columns: minmax(0, 1fr); }
  .fmt-tv { width: 100%; }
  .fmt-bar { width: calc(100% * 1346 / 1586); }
  .fmt-story { max-width: 45rem; margin-inline: auto; }
}
@media (max-width: 30rem) {
  .fmt-bar { width: 100%; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .fmt * { transition: none !important; }
}
