@font-face {
  font-family: "Bedstead";
  src: url("../fonts/bedstead.otf") format("opentype");
  font-display: swap;
}

body.vaade-teletekst { background: #000; color: #fff; }
.vaade-teletekst .vaatevalik { color: #fff; font-family: "Bedstead", "VT323", monospace; font-size: 13px; }
.vaade-teletekst .vaatevalik a { color: #0ff; }
.vaade-teletekst .vaatevalik a[aria-current="page"] { color: #000; background: #ff0; text-decoration: none; }
.vaade-teletekst .proto { color: #f0f; font-family: "Bedstead", monospace; font-size: 12px; opacity: 1; max-width: 40ch; margin: 0 auto; }

/* 40 veergu peab mahtuma igale ekraanile. Bedsteadi märk on 0,6 em lai → 40 märki = 24 em. */
.tt-wrap {
  --fs: clamp(9px, calc((100vw - 16px) / 24), 26px);
  --lh: calc(var(--fs) * 1.25);
  font-family: "Bedstead", "VT323", ui-monospace, monospace;
  font-size: var(--fs);
  line-height: var(--lh);
  width: 40ch;
  margin: 0 auto;
  padding-bottom: calc(var(--lh) * 3);
  font-variant-ligatures: none;
}
.tt-screen { white-space: pre; }
.tt-row { height: var(--lh); overflow: hidden; display: flex; }
.tt-row > span { white-space: pre; height: 100%; }
.tt-row[id] { scroll-margin-top: calc(var(--lh) * 2); outline: none; }
.tt-row[id]:focus-visible { outline: 2px solid #ff0; }

/* topeltkõrgus */
.tt-dh { height: calc(var(--lh) * 2); }
.tt-dh > span { display: inline-block; height: var(--lh); transform: scaleY(2); transform-origin: top; }

/* 8 teleteksti värvi */
.f-k { color: #000; } .f-r { color: #f00; } .f-g { color: #0f0; } .f-y { color: #ff0; }
.f-b { color: #00f; } .f-m { color: #f0f; } .f-c { color: #0ff; } .f-w { color: #fff; }
.b-k { background: #000; } .b-r { background: #f00; } .b-g { background: #0f0; } .b-y { background: #ff0; }
.b-b { background: #00f; } .b-m { background: #f0f; } .b-c { background: #0ff; } .b-w { background: #fff; }

.tt-blink { animation: tt-blink 1s steps(1) infinite; }
@keyframes tt-blink { 50% { color: #000; } }

.tt-ticker { white-space: nowrap; }
.tt-ticker__track { display: inline-block; white-space: pre; animation: tt-ticker 40s linear infinite; }
@keyframes tt-ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .tt-ticker { height: auto; white-space: normal; }
  .tt-ticker__track { white-space: normal; }
}

/* fastext: neli värvilist nuppu ekraani all, kleepuvad */
.tt-fastext {
  position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  background: #000; border-top: 2px solid #000;
}
.tt-fastext a {
  display: flex; align-items: center; justify-content: center; min-height: 44px;
  text-decoration: none; font-size: var(--fs);
}
.tt-fastext a:hover { background: #222; }
