/* RETIMBRASUR · CSS común de producción
   Estilos transversales compartidos por noticias.html, ripci.html y foro.html. */

:root {
  --rt-bg: #020617;
  --rt-panel: #0f172a;
  --rt-panel-2: #1e293b;
  --rt-text: #e2e8f0;
  --rt-muted: #94a3b8;
  --rt-brand: #ff6b35;
  --rt-brand-600: #ea580c;
  --rt-blue: #60a5fa;
  --rt-green: #4ade80;
  --rt-yellow: #facc15;
  --rt-red: #f87171;
  --rt-border: rgba(255, 255, 255, .08);
  --rt-shadow: 0 20px 40px rgba(0, 0, 0, .4);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--rt-bg);
  color: var(--rt-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

/* Accesibilidad */

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 9999;
  background: var(--rt-brand);
  color: #fff;
  padding: .65rem 1rem;
  border-radius: .75rem;
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus {
  left: 8px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.focus-ring:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--rt-brand);
  outline-offset: 3px;
}

/* Navbar común */

.glass-nav {
  background: rgba(2, 6, 23, .8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.glass-nav.scrolled {
  background: rgba(2, 6, 23, .95);
}

/* Logo común: mismo estilo que foro.html */

.logo,
.logo-link {
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform .3s ease;
}

.logo:hover,
.logo-link:hover {
  transform: scale(1.05);
}

.logo-flame,
.header-logo {
  height: 32px;
  width: auto;
  display: block;
  object-fit: contain;
  background: transparent;
  padding: 0;
  border: none;
  filter: brightness(2) contrast(1.25) grayscale(1) drop-shadow(0 0 10px rgba(255, 107, 53, .3));
  transition: filter .3s ease, transform .3s ease;
}

.logo:hover .logo-flame,
.logo-link:hover .header-logo,
.group:hover .logo-flame,
.group:hover .header-logo {
  filter: brightness(1) contrast(1) grayscale(0) drop-shadow(0 0 10px rgba(255, 107, 53, .5)) drop-shadow(0 0 22px rgba(255, 107, 53, .25));
  transform: scale(1.05);
}

.brand-wordmark,
.logo-text {
  display: inline-flex;
  align-items: center;
  color: #fff;
  font-family: 'Outfit', Inter, sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.6px;
  line-height: 1;
  transition: text-shadow .3s ease;
}

.brand-wordmark span,
.logo-text b {
  color: var(--rt-brand);
  font-weight: 800;
}

.logo:hover .brand-wordmark,
.logo:hover .logo-text,
.logo-link:hover .brand-wordmark,
.logo-link:hover .logo-text {
  text-shadow: 0 0 12px rgba(255, 107, 53, .3);
}

/* Fondo animado común */

.bg-animated {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-animated::before {
  content: '';
  position: absolute;
  top: -40%;
  left: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(255, 107, 53, .12) 0%, transparent 70%);
  animation: pulse-orb 8s ease-in-out infinite;
}

.bg-animated::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: -10%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(96, 165, 250, .07) 0%, transparent 70%);
  animation: pulse-orb 10s ease-in-out infinite reverse;
}

@keyframes pulse-orb {

  0%,
  100% {
    transform: scale(1) translate(0, 0);
    opacity: 1;
  }

  50% {
    transform: scale(1.1) translate(2%, 3%);
    opacity: .7;
  }
}

/* Ticker */

.alert-ticker {
  border-bottom: 1px solid rgba(255, 107, 53, .2);
}

.ticker-inner {
  display: inline-flex;
  gap: 4rem;
  white-space: nowrap;
}

/* Elementos comunes */

.region-badge {
  font-size: .7rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #94a3b8;
}

.breadcrumb-sep {
  color: rgba(255, 255, 255, .2);
}

.stat-item {
  background: rgba(15, 23, 42, .7);
  border: 1px solid rgba(255, 255, 255, .07);
  backdrop-filter: blur(8px);
}

/* Barra de progreso */

#read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  z-index: 200;
  background: linear-gradient(90deg, #ff6b35, #60a5fa);
  width: 0%;
  transition: width .1s linear;
}

/* Botón volver arriba */

#back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 107, 53, .9);
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .3s, transform .3s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(255, 107, 53, .35);
}

#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}

#back-to-top:hover {
  box-shadow: 0 6px 28px rgba(255, 107, 53, .55);
}

/* Buscadores comunes */

.no-results {
  display: none;
  text-align: center;
  padding: 48px 0;
  color: #475569;
}

.no-results.visible {
  display: block;
}

.search-wrap {
  position: relative;
}

.search-input {
  width: 100%;
  background: rgba(15, 23, 42, .8);
  border: 1px solid rgba(255, 255, 255, .1);
  color: #e2e8f0;
  border-radius: 14px;
  padding: 12px 20px 12px 46px;
  font-size: .9rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.search-input::placeholder {
  color: #475569;
}

.search-input:focus {
  border-color: rgba(255, 107, 53, .5);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, .08);
}

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #475569;
  font-size: .85rem;
  pointer-events: none;
}

.search-count {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #475569;
  font-size: .75rem;
}

/* Responsive */

@media (max-width: 600px) {

  .brand-wordmark,
  .logo-text {
    display: inline-block;
    font-size: 1.1rem;
    letter-spacing: -0.4px;
    white-space: nowrap;
  }

  .logo,
  .logo-link {
    gap: .5rem;
  }

  .logo-flame,
  .header-logo {
    height: 30px;
  }
}

/* Reducción de movimiento */

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }

  .ticker-inner {
    animation: none !important;
    transform: none !important;
  }
}

/* Fase 4C.6 - Responsive y accesibilidad visual final */
html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

:where(h1, h2, h3) {
  text-wrap: balance;
}

:where(p, li, a, button, input, textarea, select) {
  overflow-wrap: anywhere;
}

:where(a, button, input, textarea, select) {
  -webkit-tap-highlight-color: rgba(255, 107, 53, .24);
}

:where(button, [role="button"], input, select, textarea) {
  font: inherit;
}

:where(a, button):focus-visible {
  border-radius: .65rem;
}

@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

@media (max-width: 560px) {
  .skip-link:focus {
    left: 12px;
    right: 12px;
    text-align: center;
  }
}

/* Fase 4F.2 · Botón hamburguesa coherente en cabeceras internas */
.glass-nav button[data-action="toggle-mobile"] {
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(15, 23, 42, .72);
  color: #e2e8f0;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.glass-nav button[data-action="toggle-mobile"]:hover,
.glass-nav button[data-action="toggle-mobile"]:focus-visible {
  color: #fff;
  border-color: rgba(255, 107, 53, .35);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, .12);
  outline: none;
}

.glass-nav button[data-action="toggle-mobile"] i {
  color: currentColor;
}

@media (max-width: 1023px) {
  .glass-nav button[data-action="toggle-mobile"] {
    display: inline-flex;
    flex: 0 0 auto;
  }
}
