/* ═══════════════════════════════════════════════
   SCROLL-SNAP LAYOUT SYSTEM — Aprende y Juega
   Two-section vertical snap: Hero (100vh) + SEO content
   SEO-safe: No hidden content, no cloaking
   ═══════════════════════════════════════════════ */

/* ── Scroll Snap Container ── */
html.has-snap {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

/* ── Hero Section (zona jugable) ── */
.snap-hero {
    min-height: 100vh;
    min-height: 100dvh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    padding-bottom: 3.5rem;
}

.snap-hero-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 80rem;
    margin: 0 auto;
    padding: 1rem;
}

/* ── SEO Section (zona contenido) ── */
.snap-seo {
    scroll-snap-align: start;
    position: relative;
}

/* ── Scroll Indicator (bouncing chevron) ── */
.scroll-indicator {
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    animation: snap-bounce 2s ease-in-out infinite;
    opacity: 0.85;
    transition: opacity 0.3s;
}

.scroll-indicator:hover {
    opacity: 1;
}

.scroll-indicator-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.scroll-indicator-chevron {
    width: 2rem;
    height: 2rem;
    color: rgba(255, 255, 255, 0.9);
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

@keyframes snap-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

/* ── "Back to top" button in SEO zone ── */
.back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(147, 51, 234, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    border: none;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    transform: scale(1.1);
    background: rgba(147, 51, 234, 1);
}

.back-to-top svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* ── Section Divider ── */
.section-divider {
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.4) 20%, 
        rgba(255,255,255,0.6) 50%, 
        rgba(255,255,255,0.4) 80%, 
        transparent 100%
    );
    margin: 0;
    border: none;
}

/* ── Mobile Optimizations ── */
@media (max-width: 768px) {
    .snap-hero {
        padding-bottom: 3rem;
    }
    
    .snap-hero-inner {
        padding: 0.5rem;
        justify-content: flex-start;
        padding-top: 0.5rem;
    }
    
    .scroll-indicator {
        bottom: 0.5rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}

/* ── Reduce motion for accessibility ── */
@media (prefers-reduced-motion: reduce) {
    html.has-snap {
        scroll-behavior: auto;
    }
    .scroll-indicator {
        animation: none;
    }
}

/* ── Hero compact styles for fitting in 100vh ── */
.hero-title-compact {
    font-size: clamp(2rem, 6vw, 4rem);
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.hero-subtitle-compact {
    font-size: clamp(0.9rem, 2.5vw, 1.25rem);
    margin-bottom: 1rem;
    max-width: 36rem;
}

.hero-cards-grid {
    display: grid;
    gap: 1rem;
    width: 100%;
    max-width: 72rem;
}

/* Index: 3 cols for modes */
.hero-cards-grid.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

/* Materias: 2x2 grid */
.hero-cards-grid.two-cols {
    grid-template-columns: repeat(2, 1fr);
}

/* Menu pages: flexible */
.hero-cards-grid.four-cols {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .hero-cards-grid.four-cols {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero-cards-grid.three-cols {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .hero-cards-grid.two-cols {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .hero-cards-grid.four-cols {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

/* ── Compact Card Styles for Hero ── */
.hero-card {
    border-radius: 1.25rem;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.hero-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0,0,0,0.2);
}

.hero-card .card-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.hero-card .card-title {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 800;
    color: white;
    margin-bottom: 0.25rem;
}

.hero-card .card-desc {
    font-size: clamp(0.75rem, 1.5vw, 0.875rem);
    opacity: 0.9;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.hero-card .card-cta {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 700;
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .hero-card {
        padding: 1rem;
        border-radius: 1rem;
    }
    .hero-card .card-icon {
        font-size: 2.25rem;
        margin-bottom: 0.25rem;
    }
}

/* ── Nav bar compact ── */
.hero-nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.hero-nav-btn {
    background: rgba(255,255,255,0.9);
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.hero-nav-btn:hover {
    background: white;
}
