/* ==================== FONTS ==================== */
@import url('https://fonts.googleapis.com/css2?family=Alfa+Slab+One&display=swap');

@font-face {
  font-family: 'Facon';
  src: url('/static/fonts/Facon.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'Wedgie Regular';
  src: url('/static/fonts/Wedgie Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;

}  

/* ==================== GLOBAL ==================== */
html, body {
  font-family: 'Wedgie Regular', sans-serif;
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #000;
  overflow-x: hidden;
}
/* ================================================= */
/* CSS CORREGIDO PARA EL HEADER (VISTA DE ORDENADOR) */
/* ================================================= */

/* Contenedor principal del header */
header {
    height: 15vh; /* Mantenemos la altura deseada */
    min-height: 80px; /* Una altura mínima por si 15vh es muy poco */
    padding: 0 2rem; /* Espaciado a los lados */
    box-sizing: border-box;
    background: #fff;
    border-bottom: 2px solid #000;
    
    /* Clave: Usamos flex para poder centrar verticalmente todo el contenido */
    display: flex;
    align-items: center; 
}

/* El contenedor de la fila (logo, titulo, etc.)
   Este es el flexbox que organiza todo horizontalmente. */
.top-header {
    display: flex;
    /* Clave: Empuja los grupos a los extremos y deja el título en medio */
    justify-content: space-between; 
    /* Clave: ALINEA TODO VERTICALMENTE A LA MISMA ALTURA */
    align-items: center; 
    width: 100%;
    gap: 1.5rem; /* Espacio entre los elementos (grupos y título) */
}

/* Grupos izquierdo y derecho (contenedores de logo, botones, etc.)
   Los hacemos flexibles para alinear sus items internos. */
.header-group {
    display: flex;
    align-items: center;
    gap: 1.5rem; /* Espacio entre el logo/botón o botón/buscador */
    flex-shrink: 0; /* Evita que los grupos se encojan y se rompan */
}

/* El Título.
   ¡MUY IMPORTANTE! Sin posicionamiento absoluto. Ahora es parte del flujo. */
h1 {
    margin: 0;
    padding: 0 1rem; /* Damos aire al título para que no se pegue a los botones */
    white-space: nowrap; /* Evita que el título se parta en dos líneas */
    font-size: clamp(1.5rem, 5vw, 3rem);
    text-shadow: 2px 2px 4px #00ff3c;
    text-align: center;
    
    /* Asegúrate de que no haya una regla 'position: absolute;' para h1 en otro lugar */
    position: static; 
}

/* Estilos para elementos específicos */
.logotipo {
    height: 10vh; /* Ajusta la altura del logo como necesites */
    min-height: 60px;
}

.search-container {
    display: flex; /* Mantenemos el buscador en una línea */
}
/* ==================== ESTILO UNIFICADO PARA BOTONES Y ENLACES DE NAVEGACIÓN ==================== */
/* Aplicamos este estilo a los botones del header y a los enlaces de nav */
.login-button,
.signup-button,
.profile-button,
.logout-button,
.nav-links a {
  display: inline-block;
  font-family: 'Wedgie Regular', sans-serif;
  font-size: clamp(1.6rem, 1.5vw, 1.2rem); /* Usamos el tamaño de nav para todos */
  padding: clamp(0.3rem, 0.8vw, 0.5rem) clamp(0.6rem, 1.2vw, 1rem);
  border: 1px solid #00ff3c;
  border-radius: 4px;
  text-decoration: none;
  color: #fff;
  background-color: #111;
  text-shadow: 1px 1px 1px #5eff00;
  transition: all 0.3s ease;
  white-space: nowrap; /* Evita que el texto se parta */
}

.login-button:hover,
.signup-button:hover,
.profile-button:hover,
.logout-button:hover,
.nav-links a:hover {
  background: #00ff3c;
  color: #111;
  font-size: clamp(2rem, 1.5vw, 1.2rem); /* Usamos el tamaño de nav para todos */
  transform: translateY(-4px);
}

/* ==================== NAV (5% altura) ==================== */
nav {
  background: #fff;
  height: 5vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #ddd;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}
/* ==================== MAIN y SECCIÓN OBJETIVO (70% altura con scroll) ==================== */
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-sizing: border-box;
    overflow-y: auto;          /* Scroll si excede 70vh */
}

#objetivo {
    height: 70vh;
    background-color: #111;
    padding: 1rem 0;
    box-sizing: border-box;
}

#objetivo h2 {
    color: #fff;
    text-align: center;
    font-family: 'Wedgie Regular';
    font-size: 2rem;
    margin-bottom: 1rem;
}

#objetivo > div {
    background: #000;
    border: 2px solid #00ff3c;
    padding: 5px;
    margin: 1rem auto;
    width: 90%;
    max-width: 600px;
}

#barra-recaudacion {
    background: #00ff3c;
    height: 40px;
    width: 58%;
    transition: width 1s ease-in-out;
    margin: 0 auto;
}

#objetivo p {
    text-align: center;
    font-family: monospace, sans-serif;
    color: #fff;
    margin-top: 0.5rem;
}

#objetivo table {
    border-collapse: collapse;
    width: 90%;
    margin: 1rem auto;
    font-family: sans-serif;
    color: #fff;
    text-align: center;
}

#objetivo table thead tr {
    background-color: #111;
    color: #fff;
}

#objetivo table th,
#objetivo table td {
    background-color: #111;
    font-family: 'Alfa Slab One', cursive;
    border: 1px solid #28a745;
    padding: 8px;
    text-align: center;
}

/* ==================== SLIDER (40% altura) ==================== */
.slider {
    height: 40vh;
    overflow-x: auto;
    white-space: nowrap;
    scroll-snap-type: x mandatory;
    font-family: 'Cinzel';
    box-sizing: border-box;
}

.slide-track {
    display: inline-flex;
}

.slide {
    flex: 0 0 auto;
    width: 100vw;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    scroll-snap-align: start;
    margin-right: 5px;
    padding: 20px;
    box-sizing: border-box;
    background-color: #fff;
    color: #000;
    font-family: 'Cinzel';
}

.slide-image {
    width: 45%;
    height: 100%;
    object-fit: cover;
}

.slide > div {
    width: 50%;
    padding-left: 20px;
}

.slide h2 {
    margin-bottom: 10px;
    font-family: 'Cinzel';
    color: #28a745;
}

.slide p {
    font-family: 'Cinzel';
    font-size: 1rem;
    color: #000;
}

/* ==================== ARTÍCULOS y FOOTER ==================== */
.article {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border: 1px solid #000;
    margin: 20px 0;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.article-image {
    width: 100%;
    max-width: 500px;
    object-fit: cover;
    margin-right: 20px;
}

.article-content {
    width: 100%;
    max-width: 500px;
}

.article-content h3 {
    margin-top: 0;
}

.article-content p {
    margin-bottom: 10px;
}

footer {
    background-color: #000;
    padding: 1.5rem;
    color: #FAF9F5;
    text-align: center;
    border-top: 3px solid #28a745;
    font-family: 'Facon';
    margin-top: auto;
}

footer a {
    color: #28a745;
    text-decoration: none;
    padding: 0 0.5rem;
}

footer a:hover {
    text-decoration: underline;
    color: #FAF9F5;
}

/* ==================== MEDIA QUERIES PARA MÓVIL ==================== */
@media screen and (max-width: 480px) {
    header {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        margin-bottom: 0.5rem;
    }

    .logotipo {
        width: 70px;
        margin: 0.3rem;
    }

    h1 {
        font-size: 1.5rem;
        margin: 0.3rem;
    }

    .header-buttons {
        display: flex;
        justify-content: center;
        gap: 8px;
        width: 100%;
        margin: 0.5rem 0;
    }

    .login-button,
    .signup-button,
    .profile-button,
    .logout-button {
        font-size: 0.65rem;
        padding: 3px 6px;
        margin: 2px;
        text-align: center;
    }

    .search-container {
        display: none;
    }

    nav {
        padding: 1rem 0;
        margin: 0;
    }

    nav .nav-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        justify-content: center;
        padding: 0 1rem;
    }

    .nav-links a {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        width: 100%;
        text-align: center;
    }

    .slider, .slide {
        flex-direction: column;
        height: auto;
        margin-top: 0.5rem;
    }

    .slide-image {
        width: 100%;
        height: auto;
    }

    .slide > div {
        width: 100%;
        padding-left: 0;
    }

    footer {
        padding: 0.5rem;
        font-size: 0.6rem;
    }
}

@media screen and (max-width: 768px) and (min-width: 481px) {
    nav .nav-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        justify-content: center;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
    }
