/* ============================================================
   TiVo Advertiser Hub — page-specific styles
   Builds on css/case-study.css. Classes are prefixed .tv-.
   Accents come from the TiVo style guide (blue #00A7E1, cobalt #1F40C9,
   pink #E54099, lime #91DE1C) and stay secondary to the portfolio design.
   ============================================================ */

.tv-page {
  --cs-gradient: linear-gradient(90deg, #00a7e1 0%, #1f40c9 50%, #e54099 100%);
  --cs-accent: #91de1c;
  --tv-blue: #00a7e1;
  --tv-pink: #e54099;
  --tv-lime: #91de1c;
}

/* ------ Hero title: the template's large h1 is nowrap (sized for one word); let this longer title wrap ------ */
.tv-hero h1.large {
  white-space: normal;
  overflow-wrap: break-word;
}

/* ------ Hero: browser-framed walkthrough ------ */
.tv-browser {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: calc(var(--cs-radius) + 6px);
  background: #0a0a0c;
  box-shadow: 0 30px 80px -40px rgba(31, 64, 201, 0.55), 0 20px 60px -40px rgba(229, 64, 153, 0.45);
}
.tv-browser .cs-caption { padding: 0 0.6rem 0.6rem; }
.tv-browser__bar {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 0.4rem 0.6rem 1rem;
}
.tv-browser__dots { display: inline-flex; gap: 0.6rem; }
.tv-browser__dots i {
  width: 1rem; height: 1rem;
  border-radius: 50%;
  background: #2a2a2e;
}
.tv-browser__url {
  flex: 1;
  max-width: 36rem;
  padding: 0.4rem 1.2rem;
  border-radius: 99px;
  background: #16161a;
  color: #8e93a1;
  font: normal 500 1.2rem/1.4 var(--_font-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-browser .cs-caption__label { color: #fff; }

/* ------ Challenge cards ------ */
.tv-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin: 0;
  list-style: none;
}
@media only screen and (min-width: 768px)  { .tv-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media only screen and (min-width: 1200px) { .tv-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.6rem; } }
.tv-card {
  position: relative;
  display: flex;
  gap: 1.6rem;
  align-items: flex-start;
  padding: 2.4rem;
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-radius);
  background: var(--base-tint);
  transition: border-color 0.4s ease;
}
.tv-card::before {
  content: "";
  position: absolute;
  left: 0; top: 2.4rem; bottom: 2.4rem;
  width: 2px;
  background: var(--cs-gradient);
  transform: scaleY(0);
  transform-origin: top center;
  transition: transform 0.6s var(--cs-ease);
}
.tv-card:hover { border-color: rgba(128, 128, 128, 0.35); }
.tv-card:hover::before { transform: scaleY(1); }
.tv-card__index {
  flex: none;
  color: var(--t-medium);
  font: normal 600 1.2rem/1.9 var(--_font-accent);
}
.tv-card__text {
  margin: 0;
  color: var(--t-bright);
  font: normal 600 1.8rem/1.35 var(--_font-default);
  letter-spacing: -0.03rem;
}

/* ------ Intro copy beside section manifests ------ */
.tv-intro { max-width: 48rem; margin-top: 2rem; }
@media only screen and (min-width: 1200px) { .tv-intro { margin-top: 5.4rem; } }

/* ------ Hotspot demo ------ */
.tv-hotspots { position: relative; }
.tv-hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  transform: translate(-50%, -50%);
}
.tv-hotspot__btn {
  position: relative;
  display: block;
  width: 3.4rem;
  height: 3.4rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 0.5rem rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: background-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s var(--cs-ease);
}
.tv-hotspot__btn::after {           /* pulse ring (disabled for reduced motion) */
  content: "";
  position: absolute;
  inset: -0.5rem;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  animation: tv-pulse 2.2s ease-out infinite;
}
.tv-hotspot__btn:hover,
.tv-hotspot__btn[aria-expanded="true"] {
  background: var(--tv-lime);
  box-shadow: 0 0 0 0.6rem rgba(145, 222, 28, 0.35), 0 0 2.4rem rgba(145, 222, 28, 0.6);
  transform: scale(1.08);
}
.tv-hotspot__btn:focus-visible {
  outline: 2px solid var(--tv-lime);
  outline-offset: 5px;
}
@keyframes tv-pulse {
  0%   { transform: scale(0.9); opacity: 0.9; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* panels: overlaid on the frame (desktop), stacked below it (phones) */
.tv-hotspots__panels {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  aspect-ratio: 1380 / 776;
  pointer-events: none;
  z-index: 3;
}
.tv-hotspot__panel {
  position: absolute;
  left: calc(var(--x) + 2.8rem);
  top: var(--y);
  width: min(26rem, 40%);
  padding: 1.6rem 1.8rem;
  border-radius: 1.2rem;
  background: #fff;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  transform: translateY(-50%);
  pointer-events: auto;
  animation: tv-panel-in 0.35s var(--cs-ease);
}
.tv-hotspot__panel--left {
  left: auto;
  right: calc(100% - var(--x) + 2.8rem);
}
.tv-hotspot__panel[hidden] { display: none; }
.tv-hotspot__panel p {
  margin: 0;
  color: #3a3c42;
  font: normal 400 1.4rem/1.45 var(--_font-default);
}
.tv-hotspot__panel .tv-hotspot__title {
  margin-bottom: 0.6rem;
  color: #121212;
  font: normal 700 1.6rem/1.2 var(--_font-default);
}
@keyframes tv-panel-in {
  from { opacity: 0; transform: translateY(calc(-50% + 8px)); }
  to   { opacity: 1; transform: translateY(-50%); }
}
@media only screen and (max-width: 767px) {
  .tv-hotspot__btn { width: 2.8rem; height: 2.8rem; }
  .tv-hotspots__panels {
    position: static;
    aspect-ratio: auto;
    pointer-events: auto;
  }
  .tv-hotspot__panel,
  .tv-hotspot__panel--left {
    position: static;
    width: auto;
    margin-top: 1.2rem;
    transform: none;
    animation-name: tv-panel-up;
  }
  @keyframes tv-panel-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
  }
}

/* ------ ACF module "file tree" ------ */
.tv-tree {
  padding: 2.8rem;
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-radius);
  background: var(--base-tint);
}
.tv-tree__path {
  margin: 0 0 1.6rem;
  color: var(--t-medium);
  font: normal 600 1.2rem/1.4 var(--_font-accent);
  text-transform: uppercase;
}
.tv-tree__list { margin: 0; padding: 0; list-style: none; }
.tv-tree__list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1.6rem;
  padding: 1.2rem 0 1.2rem 1.8rem;
  border-bottom: 1px solid var(--cs-line);
  position: relative;
}
.tv-tree__list li::before {         /* tree connector */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 50%;
  width: 1rem;
  border-left: 1px solid rgba(128, 128, 128, 0.4);
  border-bottom: 1px solid rgba(128, 128, 128, 0.4);
}
.tv-tree__list code,
.tv-tree__note code {
  color: var(--t-bright);
  font: normal 500 1.4rem/1.4 var(--_font-accent);
  background: none;
  padding: 0;
}
.tv-tree__list span {
  color: var(--t-medium);
  font: normal 400 1.4rem/1.4 var(--_font-default);
}
.tv-tree__note {
  margin: 1.6rem 0 0;
  color: var(--t-medium);
  font: normal 400 1.3rem/1.5 var(--_font-default);
}
.tv-tree__note code { font-size: 1.3rem; }

/* ------ Workflow sequence ------ */
.tv-flow {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  margin: 0;
  list-style: none;
  counter-reset: none;
}
@media only screen and (min-width: 1200px) {
  .tv-flow { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.6rem; }
  .tv-flow::before {                /* connecting line, drawn in JS */
    content: "";
    position: absolute;
    left: calc(3rem + 2.4rem + 1.8rem);
    right: calc(3rem + 2.4rem);
    top: calc(2.4rem + 1.8rem);
    height: 1px;
    background: var(--cs-gradient);
    transform: scaleX(var(--tv-flow-progress, 1));
    transform-origin: left center;
  }
}
.tv-flow__step {
  position: relative;
  padding: 2.4rem;
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-radius);
  background: var(--base-tint);
}
.tv-flow__num {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.6rem;
  height: 3.6rem;
  margin-bottom: 2rem;
  border-radius: 50%;
  background: var(--base);
  border: 1px solid rgba(128, 128, 128, 0.35);
  color: var(--t-bright);
  font: normal 600 1.3rem/1 var(--_font-accent);
}
.tv-flow__name {
  margin: 0 0 0.6rem;
  color: var(--t-bright);
  font: normal 700 2rem/1.2 var(--_font-default);
}
.tv-flow__text {
  margin: 0;
  color: var(--t-medium);
  font: normal 400 1.5rem/1.5 var(--_font-default);
}

/* ------ Language switcher demo ------ */
.tv-lang {
  padding: 2.4rem;
  border-radius: var(--cs-radius);
  background: linear-gradient(135deg, #0b1a4a 0%, #1f1140 55%, #3b0f33 100%);
  color: #fff;
}
.tv-lang__tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 2.4rem;
  padding: 0.4rem;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.35);
}
.tv-lang__tab {
  min-height: 4rem;
  padding: 0 1.8rem;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  font: normal 600 1.3rem/1 var(--_font-accent);
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.tv-lang__tab[aria-selected="true"] {
  background: var(--tv-lime);
  color: #0a0a0a;
}
.tv-lang__panel { min-height: 20rem; }
.tv-lang__panel > * { transition: opacity 0.25s ease, transform 0.25s ease; }
.tv-lang__panel.is-switching > * { opacity: 0; transform: translateY(6px); }
.tv-lang__eyebrow {
  margin: 0 0 0.4rem;
  color: var(--tv-pink);
  font: normal 600 1.4rem/1.3 var(--_font-default);
}
.tv-lang__title {
  margin: 0 0 1.2rem;
  color: #fff;
  font: normal 700 3rem/1.1 var(--_font-default);
  letter-spacing: -0.06rem;
  overflow-wrap: anywhere;
}
.tv-lang__body {
  margin: 0 0 2rem;
  color: rgba(255, 255, 255, 0.8);
  font: normal 400 1.5rem/1.5 var(--_font-default);
}
.tv-lang__btn {
  display: inline-block;
  padding: 1rem 1.8rem;
  background: #1f40c9;
  color: #fff;
  font: normal 700 1.2rem/1 var(--_font-accent);
  text-transform: uppercase;
  letter-spacing: 0.08rem;
}
.tv-lang__note {
  margin: 1.8rem 0 0;
  color: rgba(255, 255, 255, 0.6);
  font: normal 400 1.3rem/1.4 var(--_font-default);
}
.tv-lang-points { margin-top: 3rem; }

/* ------ Previous project link ------ */
.tv-prev {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 4rem;
}
.tv-prev__link {
  display: inline-flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-left: 1.8rem;
  border-left: 2px solid transparent;
  border-image: var(--cs-gradient) 1;
}
.tv-prev__label {
  color: var(--t-medium);
  font: normal 600 1.2rem/1.4 var(--_font-accent);
  text-transform: uppercase;
}
.tv-prev__name {
  color: var(--t-bright);
  font: normal 600 2.8rem/1.1 var(--_font-default);
  letter-spacing: -0.06rem;
  transition: color 0.3s ease;
}
.tv-prev__link:hover .tv-prev__name { color: var(--tv-blue); }

/* ------ Reduced motion ------ */
@media (prefers-reduced-motion: reduce) {
  .tv-hotspot__btn::after { animation: none; display: none; }
  .tv-hotspot__panel { animation: none; }
}

/* ------ Hero decoration: screen outline and ad hotspots ------ */
.tv-hero { position: relative; overflow: hidden; }
.tv-hero > .mxd-container { position: relative; z-index: 1; }
.tv-hero-deco { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.tv-screen {
  position: absolute; top: 12%; right: 5%;
  width: 34rem; height: 21rem; border-radius: 2.4rem;
  border: 1px solid rgba(0, 167, 225, 0.4);
  background: linear-gradient(135deg, rgba(0, 167, 225, 0.08), rgba(229, 64, 153, 0.06));
  transform: rotate(-8deg);
}
.tv-screen::after {       /* stand */
  content: ""; position: absolute; left: 50%; bottom: -2.4rem;
  width: 8rem; height: 1px; margin-left: -4rem;
  background: rgba(0, 167, 225, 0.4);
}
.tv-pulse {
  position: absolute; display: block;
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: var(--tv-blue); box-shadow: 0 0 20px var(--tv-blue);
}
.tv-pulse::before, .tv-pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid currentColor; color: inherit;
  animation: tv-ping 2.4s cubic-bezier(.23, .65, .74, 1.09) infinite;
}
.tv-pulse::after { animation-delay: 1.2s; }
.tv-pulse--a { top: 20%; right: 22%; color: var(--tv-blue); }
.tv-pulse--b { top: 34%; right: 9%;  color: var(--tv-pink); background: var(--tv-pink); box-shadow: 0 0 20px var(--tv-pink); }
.tv-pulse--c { top: 8%;  right: 40%; color: var(--tv-lime); background: var(--tv-lime); box-shadow: 0 0 20px var(--tv-lime); width: 1rem; height: 1rem; }
@keyframes tv-ping { from { transform: scale(1); opacity: 0.9; } to { transform: scale(4); opacity: 0; } }
@media only screen and (max-width: 767px) {
  .tv-screen { width: 20rem; height: 12.5rem; right: -5rem; }
  .tv-pulse--c { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tv-pulse::before, .tv-pulse::after { animation: none; opacity: 0; } }
