@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&family=IBM+Plex+Mono:wght@400;500;700&family=IBM+Plex+Sans:wght@400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    line-height: 1.5;
    color: #111;
    background: #f0e6d6;  /* Color papel manila / pantalla osciloscopio viejo */
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    border-left: 8px solid #c41e3a;  /* Rojo instrumentación */
    border-right: 8px solid #c41e3a;
}

h1, h2, h3, .card-content h2 {
    font-family: 'Orbitron', 'Eurostile', 'DIN', sans-serif;
    font-weight: 700;
    letter-spacing: 1px;
}

.global-actions {
    display: flex;
    justify-content: center;
    gap: 2em;
    margin: 2em 0;
    flex-wrap: wrap;
    align-items: center;
}

.global-actions .language-switch {
    margin: 0;
}

.global-actions .nav-link {
    /* Mantiene el estilo base de .nav-link pero con ajustes para global-actions */
    padding: 10px 24px;
    font-size: 1.1em;
}

/* Variante especial para enlaces de acción global (como el CV) */
.nav-link.cv-link {
    background: #c41e3a;
}

.nav-link.cv-link:hover {
    background: #a0182e; /* Rojo más oscuro para hover */
}


.container {
    background: #fffaf0;
    padding: 40px;
    margin-top: 20px;
    border: 2px solid #333;
    box-shadow: 8px 8px 0 #888;
}

header {
    text-align: center;
    margin-bottom: 50px;
    border-bottom: 3px solid #c41e3a;
    padding-bottom: 30px;
}

h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #003366;  /* Azul profundo de manual técnico */
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
    font-weight: bold;
}

.description {
    font-size: 1.2rem;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    background: #e6f2ff;
    padding: 15px;
    border-left: 4px solid #003366;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.project-card {
    background: #ffffff;
    border-radius: 0;
    border: 2px solid #333;
    padding: 25px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    display: block;
    height: 100%;
    position: relative;
}

.project-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 8px 8px 0 #c41e3a;
    border-color: #c41e3a;
}

/* Etiqueta tipo chapa metálica */
.card-content h2 {
    font-size: 1.5rem;
    color: #003366;
    margin-bottom: 15px;
    font-weight: 700;
    border-bottom: 2px solid #c41e3a;
    padding-bottom: 8px;
    display: inline-block;
}

.card-content p {
    color: #222;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Tags como botones de instrumento */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.tech-tags span {
    background: #003366;
    color: #fff;
    padding: 6px 14px;
    border-radius: 0;
    font-size: 0.85rem;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    border: 1px solid #111;
    text-transform: uppercase;
}

footer {
    text-align: center;
    padding-top: 30px;
    border-top: 3px solid #c41e3a;
    color: #555;
    font-size: 0.95rem;
    font-weight: bold;
}

footer a {
    color: #003366;
    text-decoration: none;
    border-bottom: 1px dotted #003366;
}

footer a:hover {
    color: #c41e3a;
}

.navigation {
    margin-top: 20px;
    padding: 15px 0;
    border-top: 2px solid #c41e3a;
    border-bottom: 2px solid #c41e3a;
}

.nav-link {
    display: inline-block;
    background: #003366;
    color: #fff;
    padding: 10px 20px;
    text-decoration: none;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: bold;
    border: 1px solid #111;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #c41e3a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 #888;
}

.content-wrapper {
    margin-top: 30px;
}

.content-wrapper h2 {
    color: #003366;
    border-bottom: 2px solid #c41e3a;
    padding-bottom: 10px;
    margin-top: 40px;
}

.content-wrapper h3 {
    color: #003366;
    margin-top: 30px;
}

.content-wrapper blockquote {
    border-left: 4px solid #c41e3a;
    padding-left: 20px;
    margin-left: 0;
    background: #f8f8f8;
    padding: 15px;
    border: 1px solid #ddd;
}

.content-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border: 2px solid #003366;
    box-shadow: 3px 3px 0 #888;
}

.content-wrapper table th {
    padding: 15px;
    border: 2px solid #c41e3a;
    vertical-align: top;
    background: #003366;
    color: #fff;
    font-weight: bold;
    text-align: left;
}

.content-wrapper table td {
    padding: 15px;
    border: 2px solid #c41e3a;
    vertical-align: top;
    background: #f8f8f8;
}

/* Estilo específico para tablas de 4 columnas */
.content-wrapper table.four-columns th,
.content-wrapper table.four-columns td {
    padding: 12px;
    text-align: center;
}

.content-wrapper table.four-columns td:nth-child(odd) {
    background: #f0f0f0;
}

.content-wrapper table.four-columns td:nth-child(even) {
    background: #f8f8f8;
}

.content-wrapper img {
    max-width: 100%;
    height: auto;
    border: 2px solid #003366;
    margin: 10px 0;
}

/* ===== ESTILOS PARA LISTAS ===== */
.content-wrapper ul,
.content-wrapper ol {
    margin: 15px 0;
    padding-left: 40px; /* Espacio para bullets/números */
    line-height: 1.6;
}

.content-wrapper li {
    margin-bottom: 8px;
    padding-left: 5px; /* Espacio entre bullet/número y texto */
}

/* Estilo específico para listas no ordenadas */
.content-wrapper ul {
    list-style-type: disc; /* Bullets tradicionales */
}

/* Estilo específico para listas ordenadas */
.content-wrapper ol {
    list-style-type: decimal; /* Números */
}

/* Para listas dentro de tablas o otros contenedores */
.content-wrapper table ul,
.content-wrapper table ol {
    padding-left: 25px; /* Menos espacio en tablas */
    margin: 10px 0;
}

.content-wrapper details {
    background: #f8f8f8;
    border: 1px solid #ddd;
    padding: 10px;
    margin: 15px 0;
}

.content-wrapper details summary {
    cursor: pointer;
    font-weight: bold;
    color: #003366;
}

.content-wrapper pre {
    background: #003366;
    color: #fff;
    padding: 15px;
    overflow-x: auto;
    border: 1px solid #111;
    font-family: 'IBM Plex Mono', monospace;
}

/* ===== RESPONSIVE PARA MÓVIL ===== */

@media (max-width: 768px) {
    body {
        padding: 10px;
        border-left: 4px solid #c41e3a;
        border-right: 4px solid #c41e3a;
    }

    .container {
        padding: 20px;
        margin-top: 10px;
        box-shadow: 4px 4px 0 #888;
    }

    h1 {
        font-size: 2rem;
    }

    .description {
        font-size: 1rem;
        padding: 10px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .project-card {
        padding: 15px;
    }

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

    /* Ajustar las tablas para que sean scrollables */
    .content-wrapper table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    /* Para tablas específicas de 4 columnas */
    .content-wrapper table.four-columns {
        font-size: 0.9rem;
    }

    .content-wrapper table.four-columns th,
    .content-wrapper table.four-columns td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
        border-left: 3px solid #c41e3a;
        border-right: 3px solid #c41e3a;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .tech-tags span {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    .subtitle,
    .tech-tags span,
    .nav-link,
    pre,
    details summary {
        font-family: 'IBM Plex Mono', monospace;
    }


}

/* Para móvil */
@media (max-width: 768px) {
    /* Ajustes para listas en móvil */
    .content-wrapper ul,
    .content-wrapper ol {
        padding-left: 30px; /* Menos espacio en móvil */
    }

    .content-wrapper table ul,
    .content-wrapper table ol {
        padding-left: 20px;
    }

    /* Asegurar que el texto en las celdas se ajuste */
    .content-wrapper table td {
        white-space: normal !important; /* Forzar saltos de línea */
        word-break: break-word; /* Romper palabras largas si es necesario */
    }

    /* Para las celdas específicas con mucho texto */
    .content-wrapper table td[width="40%"],
    .content-wrapper table td[width="60%"] {
        display: block;
        width: 100% !important;
    }

    /* Para las tablas con estructura de dos columnas */
    .content-wrapper table tr {
        display: flex;
        flex-direction: column;
        margin-bottom: 20px;
    }
}

/* ===== ESTILOS PARA PDF Y DOCUMENTOS ===== */
.pdf-container {
    width: 100%;
    height: calc(100vh - 250px);
    min-height: 800px;
    margin: 2em 0;
    border: 3px solid #003366;
    box-shadow: 8px 8px 0 #888;
    background: #f8f8f8;
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.pdf-download {
    display: inline-block;
    background: #003366;
    color: #fff;
    padding: 12px 24px;
    text-decoration: none;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: bold;
    border: 2px solid #111;
    text-transform: uppercase;
    margin-top: 1em;
    transition: all 0.3s ease;
}

.pdf-download:hover {
    background: #c41e3a;
    transform: translateY(-2px);
    box-shadow: 3px 3px 0 #888;
}

.language-switch {
    display: flex;
    gap: 1em;
    margin-top: 1em;
    flex-wrap: wrap;
}

.language-btn {
    background: #003366;
    color: #fff;
    padding: 8px 16px;
    text-decoration: none;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: bold;
    border: 1px solid #111;
    border-radius: 0;
    font-size: 0.9em;
}

.language-btn.active {
    background: #c41e3a;
}

.language-btn:hover {
    background: #c41e3a;
    transform: translateY(-1px);
}

/* Responsive para PDF en móvil */
@media (max-width: 768px) {
    .global-actions {
        gap: 1em;
        margin: 1.5em 0;
    }
    
    .global-actions .nav-link {
        padding: 8px 20px;
        font-size: 1em;
    }
    
    .pdf-container {
        height: calc(100vh - 200px);
        min-height: 500px;
        margin: 1em 0;
        border-width: 2px;
        box-shadow: 4px 4px 0 #888;
    }

    .pdf-download {
        padding: 10px 20px;
        font-size: 0.9em;
    }

    .language-switch {
        gap: 0.5em;
    }

    .language-btn {
        padding: 6px 12px;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    .global-actions {
        gap: 0.8em;
        margin: 1em 0;
        flex-direction: column;
        align-items: stretch;
    }
    
    .global-actions .language-switch {
        justify-content: center;
    }
    
    .global-actions .nav-link {
        padding: 8px 16px;
        font-size: 0.95em;
        text-align: center;
    }
    
    .pdf-container {
        height: calc(100vh - 180px);
        min-height: 400px;
    }
}
/* ===== ESTILOS PARA BLOQUES DE CÓDIGO ===== */
pre[class*="language-"] {
    max-height: 600px;
    overflow-y: auto !important;
    overflow-x: auto !important;
    margin: 20px 0;
    border: 2px solid #333 !important;
    border-left: 4px solid #c41e3a !important; /* Toque de tu rojo */
    background: #272822 !important; /* Fondo de Okaidia */
    border-radius: 0 !important;
    box-shadow: 4px 4px 0 #888 !important;
    position: relative;
}

/* Barra de scroll personalizada */
pre[class*="language-"]::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

pre[class*="language-"]::-webkit-scrollbar-track {
    background: #1e1f1c;
}

pre[class*="language-"]::-webkit-scrollbar-thumb {
    background: #c41e3a;
    border: 1px solid #111;
}

pre[class*="language-"]::-webkit-scrollbar-thumb:hover {
    background: #d43f5a;
}

/* Para móvil */
@media (max-width: 768px) {
    pre[class*="language-"] {
        max-height: 300px;
        font-size: 0.85rem;
        margin: 15px -10px; /* Un poco más de margen negativo en móvil */
        border-left-width: 3px !important;
    }
}

/* Estilo para el texto del summary (para que combine) */
details summary {
    cursor: pointer;
    color: white;
    padding: 10px 15px;
    border: 1px solid #c41e3a;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: bold;
    margin: 10px 0;
}

details[open] summary {
    border-bottom: none;
    margin-bottom: 0;
}
