@charset "UTF-8";

/* =========================================
   1. VARIABLES Y BASE
   ========================================= */
:root {
    --oecsa-azul: #0a2e4d;
    --oecsa-verde: #c1d72e;
    --oecsa-verde-hover: #aabd26;
    --bg-body: #f4f4f4;
    --bg-white: #ffffff;
    --texto: #333333;
    --texto-suave: #666666;
    --borde: #e1e4e8;
    --rojo: #d32f2f;
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    color: var(--texto);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.6;
}

/* =========================================
   2. ENCABEZADO (HEADER)
   ========================================= */
header {
    background: var(--bg-white);
    padding: 15px 25px;
    border-bottom: 3px solid var(--oecsa-verde);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header-left {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 20px;
}

.header-logo {
    height: 60px;
    width: auto;
}

header h1 {
    margin: 0;
    color: var(--oecsa-azul);
    font-size: 1.5rem;
    text-align: center;
}

.top-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

/* =========================================
   3. NAVEGACIÓN (NAVBAR)
   ========================================= */
nav {
    display: flex;
    justify-content: center;
    background: var(--bg-white);
    border-bottom: 1px solid var(--borde);
    flex-wrap: wrap;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}

nav > div {
    padding: 15px 25px;
    font-weight: 600;
    color: var(--texto);
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

nav > div:hover {
    background-color: #f8f9fa;
    color: var(--oecsa-azul);
    border-bottom-color: var(--oecsa-verde);
}

/* Submenús */
.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--borde);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 1000;
    border-radius: 0 0 6px 6px;
}

.dropdown.active .submenu { display: block; }

.submenu a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--texto);
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.submenu a:hover {
    background: #f0f4f8;
    color: var(--oecsa-azul);
}

/* =========================================
   4. LAYOUT GENERAL
   ========================================= */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.column {
    background: var(--bg-white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    flex: 1;
    min-width: 300px;
}

/* =========================================
   5. NOTICIAS (CARRUSEL MEJORADO)
   ========================================= */
h2 {
    color: var(--oecsa-azul);
    border-bottom: 2px solid var(--oecsa-azul);
    padding-bottom: 8px;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Contenedor Principal Carrusel */
#noticias-carrusel {
    position: relative;
    overflow: hidden; /* Corta lo que sobresale */
    width: 100%;
    height: 600px; /* Altura fija aumentada */
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid var(--borde);
    margin-bottom: 30px;
}

#noticia-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
    height: 100%;
}

/* Item individual del carrusel */
.noticia-item {
    min-width: 100%;
    height: 100%;
    padding: 20px 50px; /* Espacio lateral para las flechas */
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Alinea contenido arriba */
    overflow-y: auto; /* Scroll interno si el texto es kilométrico */
    box-sizing: border-box;
}

/* Caja de contenido de la noticia */
.noticia-box {
    background-color: var(--bg-white);
    max-width: 800px;
    width: 100%;
    /* Si es una noticia normal fuera del carrusel: */
    border: 1px solid var(--borde);
    border-left: 4px solid var(--oecsa-verde);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 6px;
}

/* Dentro del carrusel quitamos el borde extra */
#noticias-carrusel .noticia-box {
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
}

.noticia-box h3 {
    color: var(--oecsa-azul);
    font-size: 1.6rem;
    text-align: center;
    margin-top: 0;
    margin-bottom: 15px;
}

.noticia-box p {
    font-size: 1rem;
    margin-bottom: 15px;
    text-align: justify;
}

/* CONTROL DE IMÁGENES (CRÍTICO) */
.noticia-box img {
    display: block;
    margin: 0 auto 15px auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    
    /* Reglas para que no rompa el diseño */
    max-width: 100%;      
    max-height: 350px;    /* Altura máxima permitida */
    width: auto;
    height: auto;
    object-fit: contain;  /* Ajuste perfecto sin recortes */
    background-color: #eee;
}

/* Flechas Carrusel */
#prevNoticia, #nextNoticia {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 46, 77, 0.6);
    border: none;
    color: #fff;
    font-size: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 5px;
}

#prevNoticia:hover, #nextNoticia:hover {
    background: var(--oecsa-verde);
    color: var(--oecsa-azul);
}

#prevNoticia { left: 10px; }
#nextNoticia { right: 10px; }

/* =========================================
   6. REACCIONES
   ========================================= */
.reacciones-container {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.reacciones-botones {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.reaccion-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    color: #555;
}

.reaccion-btn:hover { transform: scale(1.1); background: #fff; }

.reaccion-btn.activa {
    background-color: var(--oecsa-verde);
    border-color: var(--oecsa-verde-hover);
    color: var(--oecsa-azul);
    font-weight: bold;
}

.reaccion-count { font-size: 0.85rem; }
.usuarios-reaccion { font-size: 0.8rem; color: var(--texto-suave); }

/* =========================================
   7. FORMULARIOS Y BOTONES
   ========================================= */
.login-box {
    width: 350px;
    margin: 80px auto;
    background: var(--bg-white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    border-top: 5px solid var(--oecsa-verde);
}

.logo-login { max-width: 150px; margin-bottom: 20px; }

input, select, textarea {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn, button, .top-controls a {
    display: inline-block;
    background-color: var(--oecsa-verde);
    color: var(--oecsa-azul);
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.3s;
    text-align: center;
    font-size: 0.95rem;
}

.btn:hover, button:hover, .top-controls a:hover {
    background-color: var(--oecsa-verde-hover);
}

.btn-secondary {
    background-color: #e0e0e0;
    color: #333;
}
.btn-secondary:hover { background-color: #d0d0d0; }

/* Responsive */
@media (max-width: 768px) {
    header { flex-direction: column; text-align: center; }
    .header-left { flex-direction: column; }
    .top-controls { width: 100%; margin-top: 10px; }
    nav { flex-direction: column; }
    nav > div { width: 100%; border-bottom: 1px solid #eee; }
    .submenu { position: static; box-shadow: none; border-left: 3px solid var(--oecsa-verde); }
    #noticias-carrusel { height: 500px; }
    .noticia-item { padding: 15px 30px; }
    .noticia-box img { max-height: 250px; }
}