/* ==========================================================================
   TELEISLAS — Identidad Visual Oficial Caribeña y Tokens Editoriales
   Web Pública: FONDO BLANCO, Tipografía NOTO SERIF y 10 Colores Oficiales:
   - Verde tropical:    #91CE22
   - Verde profundo:    #038C1B
   - Amarillo tropical: #FFDA10
   - Naranja cálido:    #FDA001
   - Azul cielo:        #65C9F4
   - Azul palmera:      #067DC0
   - Azul océano:       #015CB5
   - Naranja «channel»: #D96800
   - Negro «TELEISLAS»: #000000
   - Blanco grisáceo:   #F2F4F8
   Scoped estrictamente a :root[data-theme="teleislas"]
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root[data-theme="teleislas"] {
  /* --- PALETA OFICIAL TELEISLAS (10 COLORES) --- */
  --ti-verde-tropical: #91CE22;
  --ti-verde-profundo: #038C1B;
  --ti-amarillo-tropical: #FFDA10;
  --ti-naranja-calido: #FDA001;
  --ti-azul-cielo: #65C9F4;
  --ti-azul-palmera: #067DC0;
  --ti-azul-oceano: #015CB5;
  --ti-naranja-channel: #D96800;
  --ti-negro: #000000;
  --ti-blanco-grisaceo: #F2F4F8;

  /* --- TOKENS EDITORIALES EN FONDO BLANCO --- */
  --ti-bg-primary: #ffffff;
  --ti-bg-secondary: #f8fafc;
  --ti-bg-elevated: #ffffff;
  --ti-bg-surface: #ffffff;
  --ti-bg-subtle: #f1f5f9;
  --ti-bg-glass: rgba(255, 255, 255, 0.95);

  /* Acentos tropicales y broadcast */
  --ti-accent-tropical: var(--ti-verde-tropical);
  --ti-accent-channel: var(--ti-naranja-channel);
  --ti-accent-sky: var(--ti-azul-cielo);
  --ti-accent-palm: var(--ti-azul-palmera);
  --ti-ocean-primary: var(--ti-azul-oceano);
  --ti-ocean-deep: #002d59;

  --ti-cyan-accent: var(--ti-azul-cielo);
  --ti-cyan-soft: rgba(101, 201, 244, 0.16);
  --ti-tropical-soft: rgba(145, 206, 34, 0.16);

  /* Badge de canal y vivo */
  --ti-live-red: var(--ti-naranja-channel);
  --ti-live-red-soft: rgba(217, 104, 0, 0.16);
  --ti-amber-warn: var(--ti-naranja-calido);
  --ti-yellow-accent: var(--ti-amarillo-tropical);
  --ti-emerald-ok: var(--ti-verde-profundo);

  /* Tipografía y lectura de alto contraste */
  --ti-text-primary: #0f172a;
  --ti-text-secondary: #334155;
  --ti-text-muted: #64748b;
  --ti-border: #e2e8f0;
  --ti-border-subtle: #f1f5f9;
  --ti-border-strong: var(--ti-verde-tropical);
  --ti-card-shadow: 0 4px 18px -2px rgba(15, 23, 42, 0.06), 0 1px 4px -1px rgba(15, 23, 42, 0.04);
  --ti-card-shadow-hover: 0 12px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06);

  --ti-radius-sm: 8px;
  --ti-radius-md: 12px;
  --ti-radius-lg: 16px;
  --ti-radius-xl: 20px;
  --ti-font-heading: 'Noto Serif', Georgia, 'Times New Roman', serif;
  --ti-font-body: 'Noto Serif', Georgia, serif;
  --ti-font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --ti-max-width: 1440px;
}

/* Public shell scoped variables & theme */
:root[data-theme="teleislas"] .teleislas-shell {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-elevated: #f8fafc;
  --text: #0f172a;
  --text-muted: #64748b;
  --accent: var(--ti-verde-tropical);
  --accent-strong: var(--ti-azul-oceano);
  --border: #e2e8f0;
  color-scheme: light;
  background-color: var(--ti-bg-primary);
  color: var(--ti-text-primary);
  font-family: var(--ti-font-body);
  min-height: 100vh;
}

:root[data-theme="teleislas"] body:not(:has(.admin-shell)) {
  background-color: var(--ti-bg-primary);
  color: var(--ti-text-primary);
  font-family: var(--ti-font-body);
  overflow-x: hidden;
  margin: 0;
}

/* Strict insulation: Never allow theme tokens to pollute the TrastCMS Admin Shell */
:root[data-theme="teleislas"] body:has(.admin-shell),
:root[data-theme="teleislas"] .admin-shell {
  background-color: #f5f7fb !important;
  color: #111827 !important;
  color-scheme: light !important;
  --surface: #ffffff !important;
  --surface-soft: #f5f7fb !important;
  --surface-muted: #eef1f7 !important;
  --text: #111827 !important;
  --muted: #667085 !important;
  --line: #e4e7ec !important;
}

:root[data-theme="teleislas"] .admin-shell * {
  color-scheme: light;
}

:root[data-theme="teleislas"] .ti-container {
  width: 100%;
  max-width: var(--ti-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 2.5vw, 2.25rem);
  padding-right: clamp(1rem, 2.5vw, 2.25rem);
  box-sizing: border-box;
}

:root[data-theme="teleislas"] .ti-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--ti-border-subtle);
}

:root[data-theme="teleislas"] .ti-section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0;
  font-family: var(--ti-font-heading);
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ti-text-primary);
}

:root[data-theme="teleislas"] .ti-section-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 1.25em;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--ti-verde-tropical) 0%, var(--ti-azul-oceano) 100%);
}

:root[data-theme="teleislas"] .ti-section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ti-azul-oceano);
  font-family: var(--ti-font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.18s ease, transform 0.18s ease;
}

:root[data-theme="teleislas"] .ti-section-link:hover {
  color: var(--ti-verde-tropical);
  transform: translateX(2px);
}

/* Clean flat broadcast buttons */
:root[data-theme="teleislas"] .ti-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.625rem 1.2rem;
  border-radius: var(--ti-radius-sm);
  font-family: var(--ti-font-sans);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

:root[data-theme="teleislas"] .ti-btn:focus-visible {
  outline: 2px solid var(--ti-verde-tropical);
  outline-offset: 2px;
}

:root[data-theme="teleislas"] .ti-btn-live {
  background: linear-gradient(135deg, var(--ti-naranja-channel) 0%, var(--ti-naranja-calido) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(217, 104, 0, 0.28);
}

:root[data-theme="teleislas"] .ti-btn-live:hover {
  background: linear-gradient(135deg, #b85700 0%, var(--ti-naranja-channel) 100%);
  transform: translateY(-1px);
}

:root[data-theme="teleislas"] .ti-btn-primary {
  background-color: var(--ti-azul-oceano);
  color: #ffffff;
  border-color: var(--ti-azul-oceano);
}

:root[data-theme="teleislas"] .ti-btn-primary:hover {
  background-color: var(--ti-azul-palmera);
  border-color: var(--ti-azul-palmera);
}

:root[data-theme="teleislas"] .ti-btn-secondary {
  background-color: var(--ti-bg-subtle);
  color: var(--ti-text-primary);
  border-color: var(--ti-border);
}

:root[data-theme="teleislas"] .ti-btn-secondary:hover {
  background-color: #e2e8f0;
  border-color: var(--ti-verde-tropical);
}

/* Tropical Brand Logo Image Styling */
:root[data-theme="teleislas"] .ti-brand-img {
  height: 48px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

:root[data-theme="teleislas"] .ti-brand-img--footer {
  height: 54px;
  max-width: 240px;
}

:root[data-theme="teleislas"] .ti-brand-img--mobile {
  height: 38px;
  max-width: 170px;
}

/* Live pulsing dot with channel identity */
@keyframes ti-live-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.45;
    transform: scale(1.22);
  }
}

:root[data-theme="teleislas"] .ti-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: #ffffff;
  animation: ti-live-pulse 1.6s infinite ease-in-out;
}

:root[data-theme="teleislas"] .ti-live-dot--red {
  background-color: var(--ti-naranja-channel);
}

/* Smart TV & Large Screen Optimization (>= 1920px) */
@media (min-width: 1920px) {
  :root[data-theme="teleislas"] {
    --ti-max-width: 1760px;
    font-size: 18px;
  }

  :root[data-theme="teleislas"] .ti-btn {
    min-height: 54px;
    padding: 0.85rem 1.6rem;
    font-size: 1rem;
  }

  :root[data-theme="teleislas"] .ti-brand-img {
    height: 56px;
    max-width: 260px;
  }
}
