/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* NOS Teletekst Custom Font - required for correct box-drawing characters */
@font-face {
  font-family: 'veramonofont2web2';
  src: url('/vera-mono.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

html, body {
  height: 100%;
  background: #000;
}

body {
  position: relative;
  font-family: Helvetica, Arial, sans-serif;
  font-size: 1.2em;
  color: #fff;
  width: 100%;
  margin: 0;
}

/* App Layout */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* Content Area */
.content-area {
  flex: 1;
  overflow: auto;
  padding: 8px;
  padding-top: max(8px, env(safe-area-inset-top));
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  padding-left: max(8px, env(safe-area-inset-left));
  padding-right: max(8px, env(safe-area-inset-right));
  -webkit-overflow-scrolling: touch;
}

.teletekst-pre {
  font-family: "veramonofont2web2", monospace;
  font-size: min(calc((100vw - 16px) / 25), calc((100vh - 80px) / 28));
  white-space: pre;
  line-height: 1.4;
}

/* Landscape: center content and keep nav always visible */
@media (orientation: landscape) {
  .teletekst-pre {
    margin: 0 auto;
  }

  .nav-controls {
    position: sticky;
    bottom: 0;
    background: #000;
    z-index: 1;
  }
}

/* Link styling - exactly like original NOS */
.teletekst-pre a {
  text-decoration: none;
  color: inherit;
}

/* Status Messages */
.status-message {
  text-align: center;
  padding: 40px 20px;
  font-family: "veramonofont2web2", monospace;
  font-size: 1.2rem;
}

.hidden {
  display: none !important;
}

/* .vh class - exactly like original NOS (accessible hidden) */
.vh {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

/* Color Classes - EXACTLY like original NOS (no prefixes) */
.red { color: #f00; }
.green { color: #0f0; }
.yellow { color: #ff0; }
.blue { color: #00f; }
.magenta { color: #f0f; }
.cyan { color: #0ff; }
.white { color: #fff; }

/* Background colors - EXACTLY like original NOS */
.bg-red { background: #f00; }
.bg-green { background: #0f0; }
.bg-yellow { background: #ff0; }
.bg-blue { background: #00f; }
.bg-magenta { background: #f0f; }
.bg-cyan { background: #0ff; }
.bg-white { background: #fff; }

/* Navigation Controls */
.nav-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 16px 8px;
  font-family: "veramonofont2web2", monospace;
  font-size: calc((100vw - 16px) / 22);
}

.nav-controls.hidden {
  display: none !important;
}

.nav-btn {
  text-decoration: none;
  color: #fff;
  padding: 6px 12px;
  background: transparent;
  cursor: pointer;
  font-family: "veramonofont2web2", monospace;
  font-size: 1em;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.nav-btn.disabled {
  color: #444;
  cursor: default;
  pointer-events: none;
}

.nav-btn:active:not(.disabled) {
  background: #fff;
  color: #000;
}

.nav-page {
  color: #ff0;
  font-weight: bold;
  min-width: 5ch;
  text-align: center;
  font-family: "veramonofont2web2", monospace;
  font-size: 1em;
  background: transparent;
  border: none;
  padding: 4px 4px;
  width: 5ch;
  caret-color: #ff0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.nav-page::placeholder {
  color: #ff0;
}

.nav-page:focus {
  background: rgba(255, 255, 255, 0.1);
}
