/**
 * carlosvaccaro.com.ar/meshtastic - Estilos secundarios unificados
 * Diseño profesional "Profesional con alma técnica"
 * Paleta: azul marino + gris, responsive, tipografía del sistema
 */

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #c8d8ec;
    background: linear-gradient(135deg, #0a1628 0%, #1a2a4a 50%, #0f1d35 100%);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: #87CEEB;
    transition: color 0.2s ease, background-color 0.2s ease;
}

a:hover {
    color: #b0d4f0;
}

/* ============================================================
   PATRÓN GEOMÉTRICO DE FONDO
   ============================================================ */
.bg-pattern {
    position: fixed;
    inset: 0;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* ============================================================
   HEADER / HERO
   ============================================================ */
.hero {
    position: relative;
    z-index: 1;
    padding: 3rem 2.5rem 2rem;
    text-align: center;
    border-bottom: 1px solid rgba(100, 149, 237, 0.12);
}

.hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    margin: 0 0 0.4rem;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #e8ecf1 0%, #87CEEB 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(0.9rem, 2vw, 1.1rem);
    color: #87CEEB;
    margin: 0 0 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-desc {
    font-size: clamp(0.9rem, 1.8vw, 1.05rem);
    color: #a0b4cc;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    color: #fff;
}

.btn-primary {
    background: linear-gradient(135deg, #1e5aa8 0%, #2a7cc7 100%);
    box-shadow: 0 4px 15px rgba(42, 124, 199, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 124, 199, 0.4);
    color: #fff;
}

.btn-secondary {
    background: linear-gradient(135deg, #3a5a7a 0%, #2a4a6a 100%);
    box-shadow: 0 4px 15px rgba(42, 74, 106, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 74, 106, 0.4);
    color: #fff;
}

.btn-descargar {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.8rem 0 1.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #2a7a5a 0%, #1e5a40 100%);
    color: #fff;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: 0 3px 10px rgba(42, 122, 90, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-descargar:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(42, 122, 90, 0.4);
    color: #fff;
}

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */
.content {
    position: relative;
    z-index: 1;
    padding: 2rem 2.5rem 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.content-narrow {
    max-width: 720px;
}

/* ============================================================
   TARJETAS / CARDS
   ============================================================ */
.card {
    background: linear-gradient(145deg, rgba(20, 40, 70, 0.8) 0%, rgba(15, 30, 55, 0.9) 100%);
    border: 1px solid rgba(100, 149, 237, 0.12);
    border-radius: 14px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.35s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.card:hover {
    border-color: rgba(100, 149, 237, 0.25);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.card h2, .card h3 {
    color: #c8d8ec;
    margin-bottom: 1rem;
    font-weight: 600;
}

.card h2 {
    font-size: 1.3rem;
}

.card h3 {
    font-size: 1.1rem;
    color: #87CEEB;
}

/* ============================================================
   TIPOGRAFÍA DE ARTÍCULO
   ============================================================ */
.article-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #a0b4cc;
    margin-bottom: 1.2rem;
    text-align: justify;
}

.article-text b,
.article-text strong {
    color: #c8d8ec;
    font-weight: 600;
}

.article-text a {
    color: #87CEEB;
    text-decoration: underline;
    text-decoration-color: rgba(135, 206, 235, 0.4);
    text-underline-offset: 3px;
}

.article-text a:hover {
    text-decoration-color: #87CEEB;
}

.article-text ul,
.article-text ol {
    margin: 0.8rem 0 0.8rem 1.5rem;
    padding-left: 1rem;
}

.article-text li {
    margin-bottom: 0.5rem;
    color: #a0b4cc;
}

.article-text li::marker {
    color: #87CEEB;
}

.article-text code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
    background: rgba(100, 149, 237, 0.12);
    color: #87CEEB;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px solid rgba(100, 149, 237, 0.2);
}

/* ============================================================
   SUBTÍTULOS DE SECCIÓN
   ============================================================ */
.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #87CEEB;
    margin: 2rem 0 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(100, 149, 237, 0.2);
}

.section-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    color: #b0d4f0;
    margin: 1.5rem 0 0.8rem;
}

/* ============================================================
   BLOQUES DE CÓDIGO (con highlight.js)
   ============================================================ */
.codigo-contenedor {
    background: #0d1a2d;
    border: 1px solid rgba(100, 149, 237, 0.15);
    border-radius: 10px;
    padding: 1px;
    margin: 1rem 0 0.5rem;
    overflow: hidden;
}

.codigo-contenedor pre {
    margin: 0;
    padding: 1.2rem;
    background: #0d1a2d;
    border-radius: 10px;
    color: #c8d8ec;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    display: block;
    width: 100%;
    box-sizing: border-box;
    max-height: 500px;
    overflow-y: auto;
    overflow-x: auto;
}

.codigo-contenedor pre::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.codigo-contenedor pre::-webkit-scrollbar-track {
    background: #0a1425;
}
.codigo-contenedor pre::-webkit-scrollbar-thumb {
    background: #2a4a6a;
    border-radius: 4px;
}
.codigo-contenedor pre::-webkit-scrollbar-thumb:hover {
    background: #3a5a7a;
}

/* Ajuste para highlight.js - tema oscuro coherente */
.hljs {
    background: transparent !important;
    padding: 0 !important;
}

/* ============================================================
   ÍNDICE / NAVEGACIÓN LATERAL
   ============================================================ */
.indice-contenedor {
    background: linear-gradient(145deg, rgba(20, 40, 70, 0.6) 0%, rgba(15, 30, 55, 0.8) 100%);
    border: 1px solid rgba(100, 149, 237, 0.12);
    border-radius: 14px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.indice-contenedor h2 {
    color: #87CEEB;
    text-align: center;
    margin-bottom: 1.2rem;
    font-size: 1.3rem;
}

.indice {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.indice-item {
    margin: 6px 0;
    border-bottom: 1px solid rgba(100, 149, 237, 0.08);
    padding-bottom: 6px;
}

.indice-item:last-child {
    border-bottom: none;
}

.indice-item a {
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    color: #a0b4cc;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none;
}

.indice-item a:hover {
    color: #87CEEB;
    background: rgba(100, 149, 237, 0.08);
    padding-left: 14px;
}

.indice-item a.destacado {
    color: #87CEEB;
    font-weight: 600;
    font-size: 1.05rem;
}

/* ============================================================
   AUDIO PLAYER
   ============================================================ */
.audio-card {
    text-align: center;
    padding: 2rem;
}

.audio-card audio {
    width: 100%;
    max-width: 500px;
    margin-top: 1rem;
    border-radius: 8px;
}

audio::-webkit-media-controls-panel {
    background: linear-gradient(145deg, #1a3a5c 0%, #0f2845 100%);
}

audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display {
    color: #c8d8ec;
}

/* ============================================================
   FOOTER / NAVEGACIÓN INFERIOR
   ============================================================ */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(100, 149, 237, 0.1);
    padding: 2rem 2.5rem;
    text-align: center;
    background: rgba(10, 22, 40, 0.5);
    margin-top: 2rem;
}

.footer-inner {
    max-width: 720px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.footer-note {
    font-size: 0.75rem;
    color: #4a5a70;
    margin: 0;
}

/* ============================================================
   RESPONSIVE: MÓVIL
   ============================================================ */
@media (max-width: 480px) {
    .hero {
        padding: 2rem 1.2rem 1.5rem;
    }
    .hero h1 {
        font-size: 1.6rem;
    }
    .content {
        padding: 1.5rem 1.2rem 2rem;
    }
    .card {
        padding: 1.2rem;
        border-radius: 10px;
    }
    .codigo-contenedor pre {
        padding: 0.8rem;
        font-size: 0.78rem;
    }
    .indice-contenedor {
        padding: 1rem;
    }
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ============================================================
   REDUCED MOTION (accesibilidad)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
    }
}

/* ============================================================
   FOCUS VISIBLE (accesibilidad)
   ============================================================ */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #87CEEB;
    outline-offset: 2px;
}


/* ============================================================
   PÁGINA PRINCIPAL / LANDING (index.html)
   Estilos exclusivos para la home de Red Meshtastic.
   No afectan a presentacion.html, programacion.html, etc.
   ============================================================ */

.categories {
    position: relative;
    z-index: 1;
    padding: 2rem 2.5rem 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Override suave del .card general solo dentro de .categories */
.categories .card {
    padding: 1.5rem;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.categories .card:hover {
    transform: translateY(-2px);
    border-color: rgba(100, 149, 237, 0.25);
}

/* Variantes de color de borde */
.card-azul   { border-color: rgba(42,  124, 199, 0.25); }
.card-verde  { border-color: rgba(46,  160, 120, 0.25); }
.card-violeta{ border-color: rgba(130, 100, 200, 0.25); }
.card-amb    { border-color: rgba(200, 160,  80, 0.25); }

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Fondos de icono según variante */
.card-azul    .card-icon { background: rgba(42,  124, 199, 0.18); }
.card-verde   .card-icon { background: rgba(46,  160, 120, 0.18); }
.card-violeta .card-icon { background: rgba(130, 100, 200, 0.18); }
.card-amb     .card-icon { background: rgba(200, 160,  80, 0.18); }

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #c8d8ec;
    margin: 0;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.95rem;
    color: #a0b4cc;
    margin: 0 0 0.9rem 0;
    line-height: 1.5;
    /* alineado con el título, no con el icono */
    padding-left: calc(52px + 1rem);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-left: calc(52px + 1rem);
}

.card-tags a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.85rem;
    background: linear-gradient(135deg, #1e5a4a 0%, #2a7a5a 100%);
    color: #fff;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
}

.card-tags a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(42, 122, 90, 0.35);
    color: #fff;
}

/* Botón de contacto / volver en el footer */
.footer-inner .btn-contact {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.6rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    background: linear-gradient(135deg, #3a5a7a 0%, #2a4a6a 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(42, 74, 106, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.footer-inner .btn-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(42, 74, 106, 0.4);
    color: #fff;
}

.footer-inner .icon {
    vertical-align: middle;
}

/* ============================================================
   RESPONSIVE: MÓVIL (landing)
   ============================================================ */
@media (max-width: 480px) {
    .categories {
        padding: 1.5rem 1.2rem 2rem;
    }
    .categories .card {
        padding: 1.2rem;
        border-radius: 10px;
    }
    .card-header h2 {
        font-size: 1.1rem;
    }
    .card-icon {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }
    .card-desc,
    .card-tags {
        padding-left: calc(44px + 0.85rem);
    }
    .card-tags a {
        font-size: 0.78rem;
        padding: 0.3rem 0.7rem;
    }
}
