﻿/* --- ESTILO MAESTRO (JMB ELEGANT) --- */
/* 
   Aquí defines la "paleta" de colores globales.
   Si cambias estos valores, cambias el tema completo sin tocar el resto del CSS.
*/
:root {
    --bg-color: #0f172a;       /* Color de fondo principal (body) */
    --card-bg: #1e293b;        /* Fondo de las tarjetas (.card) */
    --text-main: #f8fafc;      /* Texto principal (blanco suave) */
    --text-secondary: #94a3b8; /* Texto secundario (gris) */
    --accent: #38bdf8;         /* Color de acento (botones, links, detalles) */
    --hover-bg: #334155;       /* Fondo de las tarjetas al pasar el mouse */
}

/* 
   RESETEO BÁSICO:
   Quita márgenes y paddings por defecto y mejora el cálculo de tamaños.
*/
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

/* 
   ESTILO GENERAL DEL BODY:
   - Fondo oscuro
   - Tipografía moderna
   - Relleno lateral para que no quede pegado a la orilla.
*/
body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.6;
    padding: 2rem;
}

/* 
   CONTENEDOR PRINCIPAL:
   - Limita el ancho del contenido
   - Centra todo horizontalmente
*/
.container { 
    max-width: 1000px; 
    margin: 0 auto; 
}

/* ===== ENCABEZADO ===== */

/* 
   Header superior del sitio (título + subtítulo)
   - Línea inferior para separar visualmente.
*/
header {
    margin-bottom: 3rem;
    border-bottom: 1px solid #334155;
    padding-bottom: 1rem;
}

/* 
   Título principal (JMB Projects)
*/
h1 { 
    font-size: 2.5rem; 
    font-weight: 700; 
    letter-spacing: -1px; 
}

/* 
   Parte del título que dice "Projects" en color de acento.
*/
h1 span { 
    color: var(--accent); 
}

/* 
   Subtítulo bajo el h1.
*/
p.subtitle { 
    color: var(--text-secondary); 
    font-size: 1.1rem; 
    margin-top: 0.5rem; 
}

/* ===== GRID DE TARJETAS ===== */

/* 
   .grid organiza las tarjetas en columnas flexibles:
   - auto-fit + minmax hace que se adapten a pantallas pequeñas y grandes.
*/
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem; /* Espacio entre tarjetas */
}

/* ===== TARJETAS ===== */

/* 
   .card es cada módulo (Dev, Chess, Life OS, etc.)
   - Fondo oscuro
   - Bordes redondeados
   - Sombra ligera
   - Se comporta como bloque clickeable (link o div)
*/
.card {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: 12px;
    text-decoration: none;      /* Quita subrayado si es <a> */
    color: inherit;             /* Usa el color del texto del padre */
    transition: all 0.3s ease;  /* Animación suave para hover */
    border: 1px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    cursor: pointer;            /* Mano al pasar el mouse */
}

/* 
   Efecto al pasar el mouse:
   - Levanta un poco la tarjeta
   - Cambia color de fondo
   - Marca el borde con color de acento
*/
.card:hover {
    transform: translateY(-5px);
    background-color: var(--hover-bg);
    border-color: var(--accent);
}

/* 
   Estados de enfoque para navegación con teclado: alineados con hover.
*/
.card:focus-visible,
.back-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

/* 
   Título dentro de la tarjeta.
*/
.card h2 { 
    margin-bottom: 0.5rem; 
    color: var(--text-main); 
    font-size: 1.5rem; 
}

/* 
   Texto descriptivo dentro de la tarjeta.
*/
.card p { 
    color: var(--text-secondary); 
    font-size: 0.95rem; 
}

/* 
   .tag: texto tipo "Ver proyectos", "Privado", etc.
   - Mayúsculas
   - Más separación arriba
*/
.tag {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== BOTÓN VOLVER (para páginas internas) ===== */

/* 
   .back-btn se usa si quieres un enlace tipo "← Volver al panel"
*/
.back-btn {
    display: inline-block;
    margin-bottom: 2rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600; 
}

/* 
   Hover del botón volver.
*/
.back-btn:hover { 
    color: var(--accent); 
}

/* ===== IMÁGENES DENTRO DE TARJETAS ===== */

/* 
   Si en alguna tarjeta agregas una imagen (<img>):
   - Ocupa todo el ancho
   - Bordes redondeados
   - Misma altura en todas para un layout uniforme.
*/
.card img {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 15px;
    object-fit: cover;
    height: 180px; /* Altura fija para que todas se vean iguales */
}

/* ===== ACADEMY: BIBLIOTECA (BUSCADOR + LISTA) ===== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.section-title {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.search-bar {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid #334155;
    background-color: var(--card-bg);
    color: var(--text-main);
    font-size: 1rem;
}

.search-bar::placeholder {
    color: var(--text-secondary);
}

.search-bar:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.item {
    background-color: var(--card-bg);
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.item-main h3 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.item-meta {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 0.8rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-main);
    background-color: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: rgba(56, 189, 248, 0.25);
    border-color: var(--accent);
}

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

.card.card-static {
    cursor: default;
}

.article section {
    margin-top: 1.25rem;
}
