/* ============================================================
   ESTILOS PRINCIPALES — A orillas del Rio Amarguillo
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;700;800&display=swap');

/* ── Variables globales ── */
:root {
    --bg-base:        #f2f3f5;
    --bg-card:        #13131f;
    --bg-surface:     #1a1a2e;
    --bg-elevated:    #222238;
    --accent:         #1a2e3b;
    --accent-light:   #2c4a5e;
    --accent-hover:   #243d4f;
    --text-primary:   #e8eaf0;
    --text-dark:      #1a2e3b;
    --text-muted:     #0b0b0b;
    --text-h3:        #2371a5;
    --border:         rgba(26,46,59,0.15);
    --border-subtle:  rgba(255,255,255,0.07);
    --radius-sm:      6px;
    --radius-md:      12px;
    --radius-lg:      18px;
    --shadow-card:    0 4px 24px rgba(0,0,0,0.10);
    --shadow-hover:   0 8px 40px rgba(0,0,0,0.18);
    --font-display:   'Syne', sans-serif;
    --font-mono:      'Space Mono', monospace;
}

/* ── Reset & base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg-base);
    color: var(--text-dark);
    font-family: var(--font-display);
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }

/* ════════════════════════════════════════════
   NAVBAR
   ════════════════════════════════════════════ */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 200;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 56px;
    backdrop-filter: blur(12px);
}

#navbar-brand {
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

#navbar-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-link {
    color: rgba(232,234,240,0.75);
    font-family: var(--font-display);
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
}

.nav-link.active {
    border-bottom: 2px solid #fff;
    border-radius: 0;
}

/* ════════════════════════════════════════════
   HERO
   ════════════════════════════════════════════ */
#hero {
    position: relative;
    width: 100%;
    min-height: 480px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 56px; /* navbar height */
}

#hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 30, 38, 0.45);
}

#hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 60px 20px 70px;
    max-width: 700px;
}

#hero-title {
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(3rem, 8vw, 5.5rem);
    line-height: 1.1;
    letter-spacing: -1px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.4);
    margin-bottom: 20px;
}

#hero-divider {
    width: 50px;
    height: 3px;
    background: #ffffff;
    margin: 0 auto 24px;
    border-radius: 2px;
    opacity: 0.8;
}

#hero-subtitle {
    color: rgba(255,255,255,0.88);
    font-size: 1.05rem;
    line-height: 1.75;
    max-width: 520px;
    margin: 0 auto;
    font-family: var(--font-display);
    font-weight: 400;
}

/* ════════════════════════════════════════════
   SECCIÓN DEPARTAMENTOS
   ════════════════════════════════════════════ */
#departamentos-section {
    background: var(--bg-base);
    padding: 64px 40px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

#departamentos-header {
    text-align: center;
    margin-bottom: 48px;
}

#departamentos-header h2 {
    color: var(--text-dark);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2rem;
    letter-spacing: -0.5px;
    margin-bottom: 14px;
}

.section-divider {
    width: 40px;
    height: 3px;
    background: var(--accent);
    margin: 0 auto 18px;
    border-radius: 2px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

/* ── Grid de cards ── */
#grid-departamentos {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 28px;
}

/* Primeras 6 cards: 3 por fila (2 columnas cada una) */
#grid-departamentos .dept-card:nth-child(-n+6) {
    grid-column: span 2;
}

/* Últimas 2 cards: centradas, 3 columnas cada una (pirámide invertida) */
#grid-departamentos .dept-card:nth-last-child(2) {
    grid-column: 1 / 4;
}

#grid-departamentos .dept-card:nth-last-child(1) {
    grid-column: 4 / 7;
}

/* Doble imagen en la card Economía/FOL */
.dept-card-imgs {
    display: flex;
    flex-direction: row;
    height: 130px;
}

.dept-card-imgs .dept-card-img {
    flex: 1;
    height: 100%;
}

/* Doble icono en la card Economía/FOL */
.dept-card-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: -27px auto 0;
    position: relative;
    z-index: 2;
}

.dept-card-icons .dept-card-icon {
    margin: 0;
}

.dept-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.dept-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform 0.25s, box-shadow 0.25s;
    display: flex;
    flex-direction: column;
}

.dept-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.dept-card-img {
    width: 100%;
    height: 130px;
    background-size: cover;
    background-position: center;
    background-color: #c8d6de;
    position: relative;
}

/* Icon circle over image */
.dept-card-icon {
    width: 54px;
    height: 54px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    margin: -27px auto 0;
    position: relative;
    z-index: 2;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent);
}

.dept-card-body {
    padding: 18px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.dept-card-body h3 {
    color: var(--text-dark);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.3;
    text-align: center;
}

.dept-card-body p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.55;
    text-align: center;
    flex: 1;
}

.dept-btn {
    display: inline-block;
    margin: 10px auto 0;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.82rem;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    text-align: center;
    align-self: center;
}

.dept-card:hover .dept-btn {
    background: var(--accent-light);
}

/* Botón explorar */
.btn-explorar {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    padding: 14px 36px;
    border-radius: var(--radius-md);
    transition: background 0.2s, transform 0.2s;
    letter-spacing: 0.2px;
}

.btn-explorar:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
}

/* ════════════════════════════════════════════
   PIE DE PÁGINA
   ════════════════════════════════════════════ */
#pie {
    background: var(--bg-surface);
    text-align: center;
    padding: 24px 20px;
    width: 100%;
}

#pie p {
    color: rgba(232,234,240,0.65);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    line-height: 1.8;
}

/* ════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 900px) {
    #grid-departamentos {
        grid-template-columns: repeat(2, 1fr);
    }
    #grid-departamentos .dept-card:nth-child(-n+6) {
        grid-column: span 1;
    }
    #grid-departamentos .dept-card:nth-last-child(2),
    #grid-departamentos .dept-card:nth-last-child(1) {
        grid-column: span 1;
    }
}

@media (max-width: 600px) {
    #grid-departamentos {
        grid-template-columns: 1fr;
    }
    #navbar { padding: 0 18px; }
    #navbar-links { gap: 2px; }
    .nav-link { font-size: 0.75rem; padding: 5px 8px; }
    #departamentos-section { padding: 40px 18px 60px; }
    #hero-title { font-size: 2.6rem; }
}

/* ════════════════════════════════════════════
   ESTILOS PÁGINAS INTERNAS (se mantienen)
   ════════════════════════════════════════════ */
#cabecera-proyecto {
    background: linear-gradient(135deg, #0d0d14 0%, #1a1a2e 100%);
    border-bottom: 2px solid #36C221;
    width: 100%;
    padding: 20px 30px;
    position: relative;
    overflow: hidden;
}

#cabecera-proyecto h1 {
    color: #e8eaf0;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.8rem;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

#menu-proyecto {
    background: #1a1a2e;
    border-bottom: 1px solid rgba(0, 51, 255, 0.18);
    width: 100%;
    padding: 0 30px;
    display: flex;
    align-items: center;
    height: 46px;
    gap: 4px;
    position: sticky;
    top: 0;
    z-index: 100;
}

#menu-proyecto a {
    color: #e8eaf0;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    padding: 6px 14px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

#h3-proyectos {
    color:var(--text-h3)
}
#menu-proyecto a:hover {
    color: #214fc2;
    background: rgba(28, 1, 177, 0.08);
}

#cuerpo-proyecto {
    width: 100%;
    min-height: 600px;
    padding: 36px 30px;
    background: #f2f3f5;
    color: #1a2e3b;
    animation: fadeIn 0.4s ease-out both;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f2f3f5; }
::-webkit-scrollbar-thumb { background: #c0cdd4; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #1a2e3b; }

::selection { background: #1a2e3b; color: #fff; }
