/* style.css - DISEÑO FINAL GLOBAL EPIKA */

:root {
    --primary: #0f62fe; /* Azul Tech Moderno */
    --primary-dark: #002d9c;
    --text-main: #161616;
    --text-secondary: #525252;
    --bg-body: #f4f7f6;
    --bg-card: #ffffff;
    --border: #e0e0e0;
    --radius: 12px;
}

/* --- RESET Y BASES --- */
* { box-sizing: border-box; }

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container { 
    max-width: 1200px; 
    margin: 40px auto; 
    padding: 0 20px;
}

/* --- CABECERA --- */
header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #001d3d 0%, #003566 100%);
    border-radius: var(--radius);
    color: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

header h1 { margin: 0; font-size: 2.5rem; letter-spacing: -1px; }
header p { opacity: 0.9; font-size: 1.1rem; margin-top: 10px; }

/* --- GRILLA DE NOTAS (LA SOLUCIÓN AL LAYOUT) --- */
.notes-grid {
    display: grid;
    /* Esto fuerza columnas de mínimo 350px. En pantalla grande caben 3 */
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    width: 100%;
}

/* --- TARJETAS (GLASS / CLEAN LOOK) --- */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden; /* Para que la imagen no se salga de las esquinas */
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    height: 100%;
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    border-color: var(--primary);
}

/* Imágenes de portada uniformes */
.note-thumbnail {
    width: 100%;
    height: 220px; /* Altura fija para uniformidad */
    object-fit: cover; /* Recorta la imagen sin deformarla */
    border-bottom: 1px solid var(--border);
}

/* Contenido interno de la tarjeta */
.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.glass-card h2 {
    font-size: 1.25rem;
    color: var(--primary-dark);
    margin: 0 0 10px 0;
    line-height: 1.4;
    font-weight: 700;
}

.note-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
    display: block;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.content-preview {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
    flex-grow: 1; /* Empuja el botón hacia abajo */
}

/* --- BOTONES --- */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    width: 100%; /* Botón ancho completo en la tarjeta */
}

.btn-primary:hover { background-color: var(--primary-dark); }

.btn-premium { /* Estilo especial para admin */
    background: #ff0055;
    color: white;
    border: none;
    padding: 12px 24px;
}
.btn-premium:hover { background: #d60047; }

/* Estilos específicos para ver_nota (Lectura) */
.cuerpo-articulo { font-size: 1.15rem; color: #333; margin-top: 30px; }
.cuerpo-articulo p { margin-bottom: 1.5em; }
.cuerpo-articulo img { border-radius: 8px; margin: 20px 0; }
.cuerpo-articulo h2, .cuerpo-articulo h3 { color: var(--primary); margin-top: 40px; }