/* =====================================================
   IDENTIDAD VISUAL · RETROCOCHES
   ===================================================== */

/* FUENTE RETROBLOCKY */
@font-face {
    font-family: 'Retroblocky';
    src: url('../fonts/retroblocky.woff2') format('woff2'),
         url('../fonts/retroblocky.woff') format('woff'),
         url('../fonts/retroblocky.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* PALETA DE COLORES */
:root {
    --azul-logo: #0064C2;
    --azul-oscuro: #004A91;
    --azul-claro: #4F97E6;
    --blanco: #FFFFFF;
    --negro: #000000;
}

/* RESET BÁSICO */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--blanco);
    color: var(--negro);
    font-family: "Courier New", monospace;
    cursor: default;
}

a, button {
    cursor: pointer;
}

/* =====================================================
   HEADER
   ===================================================== */

.header-retro {
    background: var(--azul-logo);
    border-bottom: 4px solid #000;
}

.header-contenido {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
}

.logo-retro {
    width: 70px;
    height: 70px;
    object-fit: contain;
}

.titulo-retro {
    font-family: 'Retroblocky', monospace;
    font-size: 36px;
    letter-spacing: 4px;
    color: #fff;
    text-shadow: 2px 2px 0 #000, 4px 4px 0 var(--azul-oscuro);
    margin: 0;
}

.subtitulo {
    font-size: 14px;
    color: #e0e0e0;
}

/* =====================================================
   NAVEGACIÓN
   ===================================================== */

nav {
    background: #e0e0e0;
    border-bottom: 3px solid #000;
    padding: 10px;
    text-align: center;
}

nav a {
    color: #000;
    text-decoration: none;
    font-weight: bold;
    margin: 0 6px;
}

/* EFECTO BOTÓN RETRO */
nav a,
.boton-retro,
button,
.naipe a {
    position: relative;
}

nav a:hover,
.boton-retro:hover,
button:hover,
.naipe a:hover {
    top: 1px;
    left: 1px;
}

nav a:active,
.boton-retro:active,
button:active,
.naipe a:active {
    top: 3px;
    left: 3px;
}

nav a,
.boton-retro,
button,
.naipe a {
    transition: top 0.05s ease, left 0.05s ease;
}

/* =====================================================
   LAYOUT GENERAL
   ===================================================== */

main {
    padding: 20px;
}

.home-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 25px;
}

/* =====================================================
   SIDEBAR (ESCRITORIO)
   ===================================================== */

.sidebar {
    background: repeating-linear-gradient(
        45deg,
        #e0e0e0,
        #e0e0e0 10px,
        #d0d0d0 10px,
        #d0d0d0 20px
    );
    border: 4px solid #000;
    box-shadow: 6px 6px 0 var(--azul-oscuro);
    padding: 12px;
}

.sidebar h3 {
    background: var(--azul-logo);
    color: #fff;
    padding: 6px;
    font-size: 13px;
    text-align: center;
    border: 2px solid #000;
    margin-top: 0;
}

.globo {
    margin-top: 10px;
    background: #000;
    border: 3px inset #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* =====================================================
   BLOQUES
   ===================================================== */

.bloque {
    background: #fff;
    border: 4px solid #000;
    box-shadow: 6px 6px 0 var(--azul-oscuro);
    padding: 15px;
    margin-bottom: 25px;
}

.bloque h2,
.bloque h3 {
    border-bottom: 2px solid #000;
    padding-bottom: 6px;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--azul-logo);
}

/* =====================================================
   SEPARADOR RETRO
   ===================================================== */

.separador-retro {
    text-align: center;
    font-size: 14px;
    letter-spacing: 2px;
    margin: 30px 0;
}

.separador-retro::before {
    content: "════════════════════════════";
}

/* =====================================================
   GRID MINIATURAS
   ===================================================== */

.grid-miniaturas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

/* =====================================================
   NAIPE
   ===================================================== */

.naipe {
    background: #fff;
    border: 4px solid #000;
    box-shadow: 4px 4px 0 var(--azul-oscuro);
    padding: 6px;
    text-align: center;
}

.naipe img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    border: 2px solid #000;
    background: #fff;
    padding: 6px;
}

.naipe h4 {
    font-size: 13px;
    margin: 6px 0;
}

.naipe a {
    display: block;
    background: var(--azul-logo);
    color: #fff;
    text-decoration: none;
    padding: 4px;
    border: 2px solid #000;
    margin-top: 4px;
}

/* =====================================================
   FICHA · GALERÍA
   ===================================================== */

.foto-principal {
    max-width: 500px;
    width: 100%;
    margin: 0 auto 15px;
    display: block;
    border: 4px solid #000;
    box-shadow: 4px 4px 0 var(--azul-oscuro);
}

.galeria {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.galeria img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border: 2px solid #000;
    cursor: pointer;
    opacity: 0.7;
}

.galeria img:hover,
.galeria img.activa {
    opacity: 1;
    border-color: var(--azul-logo);
}

/* =====================================================
   TABLAS TÉCNICAS
   ===================================================== */

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    background: #e0e0e0;
    border: 2px solid #000;
    padding: 6px;
    width: 40%;
}

table td {
    border: 2px solid #000;
    padding: 6px;
}

/* =====================================================
   COMPARADOR
   ===================================================== */

.comparacion {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.comparacion > .bloque {
    width: 100%;
}

/* =====================================================
   FOOTER
   ===================================================== */

footer {
    background: var(--azul-logo);
    color: #fff;
    padding: 15px;
    text-align: center;
    font-size: 13px;
    border-top: 4px solid #000;
    box-shadow: inset 0 4px 0 #000;
}

footer a {
    color: #fff;
    font-weight: bold;
    text-decoration: none;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 900px) {

    .home-layout {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .grid-miniaturas {
        display: block;
    }

    .naipe {
        width: 100%;
        margin-bottom: 15px;
    }

    .naipe img {
        height: auto;
        max-height: 240px;
    }

    .comparacion {
        display: block;
    }

    nav a {
        display: inline-block;
        margin: 6px 4px;
    }

    .titulo-retro {
        font-size: 28px;
    }
}

/* ===============================
   TABLAS RESPONSIVE (MÓVIL)
   =============================== */

@media (max-width: 700px) {

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        width: 100%;
    }

    table {
        border: none;
    }

    tr {
        margin-bottom: 15px;
        border: 2px solid #000;
        box-shadow: 3px 3px 0 var(--azul-oscuro);
        padding: 8px;
        background: #fff;
    }

    th {
        background: #e0e0e0;
        border: none;
        font-weight: bold;
        padding: 6px;
    }

    td {
        border: none;
        padding: 6px;
        font-family: "Courier New", monospace;
    }
}

/* ===============================
   ANIMACIÓN SUAVE RETRO
   =============================== */

@keyframes aparecer-retro {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bloque {
    animation: aparecer-retro 0.2s ease-out;
}
/* EFECTO BOTÓN RETRO */
nav a,
.boton-retro,
button,
.naipe a {
    position: relative;
}

nav a:hover,
.boton-retro:hover,
button:hover,
.naipe a:hover {
    top: 1px;
    left: 1px;
}

nav a:active,
.boton-retro:active,
button:active,
.naipe a:active {
    top: 3px;
    left: 3px;
}

/* ===============================
   APARICIÓN SUAVE DE BLOQUES
   =============================== */

@keyframes aparecer-retro {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bloque {
    animation: aparecer-retro 0.2s ease-out;
}
/* ===============================
   NAIPE · MICRO HOVER
   =============================== */

.naipe {
    transition: transform 0.08s ease;
}

.naipe:hover {
    transform: translateY(-2px);
}

/* ===============================
   GALERÍA · FEEDBACK VISUAL
   =============================== */

.galeria img {
    transition: opacity 0.1s ease, transform 0.1s ease;
}

.galeria img:hover {
    opacity: 1;
    transform: scale(1.05);
}

/* ===============================
   TEXTURA CRT MUY SUAVE
   =============================== */

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,0,0,0.02),
        rgba(0,0,0,0.02) 1px,
        transparent 1px,
        transparent 3px
    );
    z-index: 9999;
}
