/**
 * FACPCE Normas Web - Estilos Principales
 *
 * Estructura de este archivo:
 * 1. Variables CSS (colores, tipografía, espaciado)
 * 2. Reset y base
 * 3. Layout general
 * 4. Componentes
 * 5. Utilities
 * 6. Responsive
 */

/* ============================================
   1. VARIABLES CSS
   ============================================ */

:root {
    /* Colores principales */
    --color-primary: #0066cc;
    --color-secondary: #333333;
    --color-accent: #ff6b35;

    /* Colores de texto */
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-white: #ffffff;

    /* Colores de fondo */
    --color-bg: #ffffff;
    --color-bg-light: #f5f5f5;
    --color-bg-dark: #222222;

    /* Tipografía */
    --font-primary: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-secondary: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Tamaños de fuente */
    --font-size-base: 16px;
    --font-size-small: 14px;
    --font-size-large: 18px;
    --font-size-h1: 2.5rem;
    --font-size-h2: 2rem;
    --font-size-h3: 1.5rem;

    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;

    /* Contenedor */
    --container-width: 1400px;

    /* Bordes */
    --border-radius: 4px;
    --border-color: #e0e0e0;
}

/* ============================================
   2. RESET Y BASE
   ============================================ */

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

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
}

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

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-accent);
}

/* Títulos - Usar fuente secundaria */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-secondary);
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-text);
}

/* ============================================
   3. LAYOUT GENERAL
   ============================================ */

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.site-main {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-sm);
    min-height: 60vh;
}

/* Reducir white space en mobile */
@media (max-width: 768px) {
    .site-main {
        padding: 1.5rem 0.75rem;
    }

    .container {
        padding: 0 0.75rem;
    }
}

/* ============================================
   4. COMPONENTES
   ============================================ */

/* Header */
.site-header {
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--border-color);
    padding: var(--spacing-sm) 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-wrapper > :last-child {
    margin-left: auto;
}

.site-branding {
    flex: 0 0 auto;
}

.site-name {
    font-size: var(--font-size-h3);
    font-weight: bold;
    color: var(--color-secondary);
}

/* Navegación */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: var(--spacing-md);
}

.main-navigation a {
    color: var(--color-text);
    font-weight: 500;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.post-card {
    background: var(--color-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-content {
    padding: var(--spacing-sm);
}

.post-title {
    font-size: var(--font-size-h3);
    margin-bottom: var(--spacing-xs);
}

/* Footer */
.site-footer {
    background-color: #1a1a1a;
    color: #e0e0e0;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-branding .logo-img {
    max-width: 200px;
    height: auto;
    margin-bottom: 0.75rem;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.footer-links h4,
.footer-contact h4 {
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin-bottom: 0.5rem;
}

.footer-menu a {
    color: #d0d0d0;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-menu a:hover {
    color: #ffffff;
}

.footer-contact address {
    font-style: normal;
    color: #d0d0d0;
    line-height: 1.8;
}

.footer-contact address strong {
    color: #ffffff;
    display: block;
    margin-bottom: 0.25rem;
}

.footer-contact a {
    color: #d0d0d0;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contact a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
}

.footer-legal {
    font-size: 0.8rem;
    color: #a0a0a0;
    margin-bottom: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

.copyright {
    font-size: 0.8rem;
    color: #808080;
    margin: 0;
}

/* Responsive footer */
@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .footer-branding {
        grid-column: 1 / -1;
    }
}

@media (max-width: 576px) {
    .site-footer {
        padding: 2rem 0 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-branding {
        grid-column: 1;
        text-align: center;
    }

    .footer-branding .logo-img {
        max-width: 180px;
    }

    .footer-links,
    .footer-contact {
        text-align: left;
    }
}

/* ============================================
   5. UTILITIES
   ============================================ */

.read-more {
    display: inline-block;
    margin-top: var(--spacing-sm);
    font-weight: 500;
}

/* ============================================
   6. RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        display: none;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }
}
