/* === Overlay de Teletexto === */
#teletext-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'VT323', monospace;
  cursor: pointer;
}

#teletext-content {
  position: relative;
  width: 90%;
  max-width: 820px;
  color: var(--white);
  cursor: default;
}

/* Cabecera tipo teletexto real — franja fina de meta-info */
#teletext-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.2rem 0.1rem 0.5rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 1.1rem;
  letter-spacing: 0.12em;
}

.teletext-page {
  color: #ffff00;
}

#teletext-header-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.teletext-station {
  color: rgba(255, 255, 255, 0.5);
}

/* Botón de cierre — junto al nombre de la emisora, siempre visible */
#teletext-close {
  width: 1.8rem;
  height: 1.8rem;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid rgba(255, 68, 68, 0.6);
  color: #ff4444;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
}

#teletext-close:hover {
  background: rgba(255, 68, 68, 0.15);
  border-color: #ff4444;
}

#teletext-close:active {
  transform: scale(0.9);
}

/* Hero: logo/imagen del proyecto + título grande */
#teletext-hero {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.3rem;
}

#teletext-logo {
  position: relative;
  width: 92px;
  height: 92px;
  flex-shrink: 0;
  background: #111;
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#teletext-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#teletext-logo-letter {
  font-size: 3rem;
  color: #FFDE21;
  line-height: 1;
}

#teletext-hero-text {
  flex: 1;
  min-width: 0;
}

.teletext-title-big {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  line-height: 0.95;
  color: #ff3b3b;
  text-shadow: 2px 0 #00eaff, -2px 0 #ff00c8;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  word-break: break-word;
}

.teletext-subtitle {
  margin-top: 0.3rem;
  font-size: clamp(1.1rem, 2.2vw, 1.4rem);
  color: #ff8080;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Filas de datos — dos columnas estilo "bracket" */
#teletext-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.5rem;
}

.tt-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-top: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
}

.tt-col .teletext-label {
  min-width: 0;
}

/* Móvil / columnas estrechas: apilar en una sola columna */
@media (max-width: 640px) {
  #teletext-body {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }
  .tt-col .teletext-label {
    min-width: 110px;
  }
}

.teletext-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: clamp(1.2rem, 2.6vw, 1.9rem);
  line-height: 1.2;
}

/* Etiquetas con fondo de color */
.teletext-label {
  min-width: 160px;
  padding: 0.05rem 0.5rem;
  font-weight: normal;
  white-space: nowrap;
}

.teletext-label.cyan {
  background: #00aaaa;
  color: #000000;
}

.teletext-label.yellow {
  background: #aaaa00;
  color: #000000;
}

.teletext-label.magenta {
  background: #aa00aa;
  color: #ffffff;
}

.teletext-value {
  color: #ffffff;
  flex: 1;
}

/* Fila de descripción — barra de color a todo el ancho, como en un teletexto real */
.teletext-desc-row {
  flex-direction: column;
  gap: 0.2rem;
  margin-top: 1rem;
  padding: 0.5rem 0.8rem;
  background: #b8960a;
}

.teletext-desc-row .teletext-label {
  background: transparent;
  color: #000000;
  padding: 0;
  min-width: 0;
}

.teletext-desc-row .teletext-value {
  padding-left: 0;
  line-height: 1.35;
  color: #000000;
}

/* Pie de página */
#teletext-footer {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  color: #666666;
  text-align: center;
  animation: blink 1.8s step-end infinite;
  letter-spacing: 0.05em;
}

/* === Formulario de contacto (canal ABOUT ME) === */

/* Los inputs y textarea heredan el grid de .teletext-row —
   solo se sobreescribe lo necesario para hacerlos editables */
.cf-field {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-family: 'VT323', monospace;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.2;
  padding: 0 0.4rem;
  outline: none;
  caret-color: #00FF41;
  cursor: text;
  width: 100%;
}

.cf-field:focus {
  border-bottom-color: rgba(255, 255, 255, 0.7);
}

.cf-area {
  resize: none;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.2rem 0.4rem;
  line-height: 1.3;
  margin-top: 0.3rem;
}

.cf-area:focus {
  border-left-color: rgba(255, 255, 255, 0.7);
}

/* Fila de acción: alineada con el grid de etiquetas */
.cf-action-row {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  gap: 1.5rem;
}

.cf-submit {
  background: transparent;
  border: none;
  color: #00FF41;
  font-family: 'VT323', monospace;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  padding: 0;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: opacity 0.12s;
}

.cf-submit:hover:not(:disabled) { opacity: 0.7; }
.cf-submit:disabled              { opacity: 0.4; cursor: default; }

#cf-status {
  font-family: 'VT323', monospace;
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  letter-spacing: 0.04em;
  flex: 1;
}

#cf-status[data-type="ok"]    { color: #00FF41; }
#cf-status[data-type="error"] { color: #ff4444; }

#teletext-overlay:has(#teletext-contact:not(.hidden)) { cursor: default; }
