/* ============================================================
   Capa visual elegante: naranja con más presencia y animaciones
   suaves. Solo transform/opacity; respeta movimiento reducido.
   ============================================================ */

:root {
    --naranja: #e96a1b;
    --naranja-medio: #d65a10;
    --naranja-fuerte: #b2480c;
    --naranja-profundo: #9a3d09;
}

/* Barra de progreso de lectura */
.progreso-lectura {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 80;
    height: 3px;
    width: 0;
    pointer-events: none;
    background: linear-gradient(90deg, var(--naranja), #f4a269);
    transition: width 0.15s linear;
}

/* Resplandor cálido detrás de los encabezados */
.hero-glow {
    position: relative;
    isolation: isolate;
}

.hero-glow::before {
    content: "";
    position: absolute;
    inset: -8% -6% auto -6%;
    height: 75%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 0%, rgba(233, 106, 27, 0.18), transparent 65%);
    animation: respirar 9s ease-in-out infinite;
}

@keyframes respirar {
    0%, 100% {
        transform: scale(1);
        opacity: 0.75;
    }
    50% {
        transform: scale(1.07);
        opacity: 1;
    }
}

/* Aparición al hacer scroll */
.animaciones .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.animaciones .reveal.visible {
    opacity: 1;
    transform: none;
}

/* Botón naranja con más cuerpo (contraste AA con texto blanco) */
.btn-naranja {
    background: linear-gradient(135deg, #c4520b, var(--naranja-profundo)) !important;
    border-color: transparent !important;
    box-shadow: 0 12px 26px -12px rgba(233, 106, 27, 0.65) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-naranja:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    box-shadow: 0 18px 32px -14px rgba(233, 106, 27, 0.8) !important;
}

.btn-naranja:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.btn-naranja:focus-visible {
    outline: 3px solid var(--naranja-fuerte);
    outline-offset: 3px;
}

/* Subrayado animado del menú */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -4px;
    height: 2px;
    background: var(--naranja);
    transition: right 0.25s ease;
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
    right: 0;
}

/* Cabecera que se tiñe al bajar */
.header-scrolled {
    border-bottom-color: var(--naranja) !important;
    box-shadow: 0 12px 30px -20px rgba(233, 106, 27, 0.6);
}

/* Accesibilidad: sin movimiento si se solicita */
@media (prefers-reduced-motion: reduce) {
    .progreso-lectura,
    .hero-glow::before,
    .animaciones .reveal,
    .btn-naranja,
    .nav-link::after {
        animation: none !important;
        transition: none !important;
    }

    .animaciones .reveal {
        opacity: 1;
        transform: none;
    }
}

.reduced-lighting-active .hero-glow::before {
    animation: none;
}

.reduced-lighting-active .animaciones .reveal {
    opacity: 1;
    transform: none;
    transition: none;
}

/* ============================================================
   Transiciones entre páginas (View Transitions)
   La cabecera no se desvanece: viaja de una página a otra, así
   el cambio se siente continuo. Si el navegador no lo soporta,
   la navegación sigue siendo normal.
   ============================================================ */

@view-transition {
    navigation: auto;
}

body > header {
    view-transition-name: cabecera;
}

::view-transition-old(cabecera),
::view-transition-new(cabecera) {
    animation-duration: 0.28s;
    animation-timing-function: ease;
}

/* ============================================================
   Tipografía: titulares con líneas equilibradas
   ============================================================ */

h1,
h2,
.hero-titulo {
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

/* ============================================================
   Novedad: etiqueta "Nueva" (48 h) y punto del menú
   ============================================================ */

.etiqueta-nueva {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.65rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, #e96a1b, #d65a10);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.5;
    box-shadow: 0 4px 14px -6px rgba(233, 106, 27, 0.75);
}

@media (prefers-reduced-motion: no-preference) {
    .etiqueta-nueva {
        animation: latido-nueva 3.2s ease-in-out infinite;
    }
}

@keyframes latido-nueva {
    0%,
    100% {
        box-shadow: 0 4px 14px -6px rgba(233, 106, 27, 0.75);
    }
    50% {
        box-shadow: 0 4px 22px -3px rgba(233, 106, 27, 0.95);
    }
}

.punto-nuevo {
    position: absolute;
    top: -3px;
    right: -7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e96a1b;
    box-shadow: 0 0 0 2px #ffffff;
}

@media (prefers-reduced-motion: no-preference) {
    .punto-nuevo {
        animation: pulso-punto 2.6s ease-in-out infinite;
    }
}

@keyframes pulso-punto {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.75;
    }
}

.dark-mode-active .punto-nuevo {
    box-shadow: 0 0 0 2px var(--bg-primary, #0f172a);
}
