/* Variables y configuración base */
:root {
    /* Colores */
    --primary-color: #FF4700;
    --secondary-color: #00FFB2;
    --accent-color: #FF00E5;
    --text-color: #ffffff;
    --bg-color: #5b5b5b;
    --card-bg: #1a1a1a;
    
    /* Sombras y efectos */
    --card-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.3);
    --text-shadow: 0.125rem 0.125rem 0.25rem rgba(0,0,0,0.5);
    
    /* Espaciado */
    --container-padding: 2rem;
    --mobile-margin: 1rem;
    --card-gap: 0.5rem;
    --card-margin: 0.2rem;
    
    /* Gradientes */
    --gradient-1: linear-gradient(45deg, #1a1a1a, #2d2d2d);
    --gradient-2: linear-gradient(45deg, #00FFB2, #FF4700);
    
    /* Tamaños base */
    --container-max-width: 87.5rem;
    --card-width: min(280px, 23vw);
    --card-height: calc(var(--card-width) * 1.3);
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background-color: var(--bg-color);
}

/* Header y Navegación */
header {
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    background: var(--primary-color);
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: flex-end;
    min-height: 6.25rem;
    backdrop-filter: blur(0.3125rem);
    -webkit-backdrop-filter: blur(0.3125rem);
}

.nav-title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

nav h1 {
    font-weight: 800;
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    color: white;
    letter-spacing: 0.125rem;
    line-height: 1;
}

.main-subtitle {
    font-weight: 400;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.0625rem;
    line-height: 1.4;
    font-style: italic;
    text-align: center;
    padding: 0 2rem;
    max-width: 50rem;
    width: 100%;
    margin: 0 auto;
}

.main-subtitle.question {
    font-style: normal;
    font-weight: 500;
}

.main-subtitle strong {
    font-weight: 700;
    color: white;
}

.main-subtitle:first-of-type {
    margin: 2rem auto 1.5rem;
}

.main-subtitle:nth-of-type(2) {
    margin-bottom: 0.5rem;
}

.main-subtitle:last-of-type {
    margin-bottom: 3rem;
}

nav h2 {
    font-weight: 400;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 1px;
    margin: 0;
    line-height: 1.2;
    font-style: italic;
}

/* Contenido principal */
main {
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
}

.cards-container {
    box-sizing: border-box;
    max-width: var(--container-max-width);
    width: 100%;
    padding: 0 1vw;
    margin: 0 auto 2rem auto;
    display: flex;
    flex-wrap: wrap;
    gap: var(--card-gap);
    justify-content: center;
    align-items: center;
}

/* Cards */
.card {
    width: var(--card-width);
    height: var(--card-height);
    perspective: 1000px;
    cursor: pointer;
    margin: var(--card-margin);
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}


.card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    background-color: var(--card-bg);
}

.card-back {
    transform: rotateY(180deg);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.card-front img, .card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    filter: brightness(0.9);
    will-change: transform;
}

.card-front img {
    transform: scale(2);
}

.card:hover .card-front img {
    transform: scale(2.2);
    transition: transform 0.3s ease;
}

.card h2 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 1rem 0.5rem;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    color: white;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.8) 50%, transparent 100%);
    margin: 0;
    line-height: 0.9;
    text-shadow: var(--text-shadow);
    text-align: left;
    width: 100%;
    white-space: normal;
    word-wrap: break-word;
    hyphens: auto;
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    filter: brightness(0.7);
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.card:hover .card-back img {
    animation: simpleZoom 3s ease-in-out forwards;
}

@keyframes simpleZoom {
    from {
        transform: scale(1);
    }
    to {
        transform: scale(1.1);
    }
}

.card-back h2 {
    background: none;
    position: relative;
    padding: 0.8rem;
    font-size: 1.4rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    transform: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    text-align: left;
    white-space: normal;
    word-wrap: break-word;
    margin: 0;
    z-index: 2;
}

.card-back:hover img {
    transform: scale(1.02);
    filter: brightness(0.8);
}

.contribution {
    padding: 0.8rem;
    font-size: clamp(0.8rem, 2vw, 0.85rem);
    line-height: 1.3;
    text-align: left;
    background: rgba(0, 0, 0, 0.6);
    margin: 0;
    position: relative;
    z-index: 2;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.footer-content {
    margin: 0 auto;
    text-align: center;
    max-width: 50rem;
}

.footer-content p {
    margin-bottom: 1rem;
    font-size: clamp(0.9rem, 2vw, 1.1rem);
}

.footer-content a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.footer-content a:hover {
    color: var(--secondary-color);
    transform: scale(1.05);
}

.logotype {
    width: clamp(15%, 9vw, 9%);
    height: auto;
    margin: 1rem auto;
    transition: transform 0.3s ease;
}

.logotype img {
    width: 100%;
    height: auto;
    filter: brightness(0) invert(1);
}

.logotype:hover {
    transform: scale(1.1) rotate(5deg);
}

/* - - - Separador - - - */
.separator-f5 {
    width: 100%;
    height: 0.5rem;
    background-color: #FF4700;
    
}



/* - - - leyenda - - - */
.leyenda-container {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-top: 2.5rem;
    padding-bottom: 2rem;
  }

  .leyenda-container a {
    text-decoration: none;
  }
  
  .leyenda {
    font-size: 0.85rem;
    color: #fff;
    background: #FF4700;
    font-family: 'Poppins', 'Arial', sans-serif;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-style: italic;
    text-align: right;
    margin-right: 2vw;
    padding: 0.4em 1.2em;
    border-radius: 0.5em;
    pointer-events: none;
  }
  
  
  
  

/* Diseño responsive */
/* Pantallas medianas (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    :root {
        --container-max-width: 90rem;
        --card-width: min(220px, 23vw);
        --card-gap: 0.4rem;
        --container-padding: 1.2rem;
        --card-margin: 0.1rem;
    }
}

/* Móviles grandes (576px - 991px) */
@media (max-width: 991px) {
    :root {
        --container-padding: 1rem;
        --card-width: min(260px, 45vw);
        --card-gap: 0.5rem;
        --card-margin: 0.2rem;
    }

    .cards-container {
        padding: 0 2vw;
    }
}

/* Móviles pequeños (hasta 575px) */
@media (max-width: 575px) {
    .nav-title h1{
      font-size:1.5rem;
    }
    :root {
        --container-padding: var(--mobile-margin);
        --card-width: min(280px, 90vw);
        --card-gap: 0.4rem;
        --card-margin: 0.1rem;
    }

    .card-front img {
        transform: scale(1.8);
        object-position: center 30%;
    }

    .card:hover .card-front img {
        transform: scale(2);
    }

    .card h2 {
        font-size: 2.8rem;
        padding: 1.5rem 1.2rem 0.8rem;
        letter-spacing: -1.5px;
        line-height: 0.9;
    }

    .contribution {
        font-size: 0.85rem;
        padding: 0.6rem;
    }

    .logotype {
        width: 30%;
    }

    .footer-content p {
        font-size: 0.9rem;
    }

    .leyenda-container{ 
        justify-content: center;
    }

}

@media (max-width: 768px) {

    .leyenda-container{ 
        justify-content: center;
    }

} 