* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: clamp(16px, 2vw, 18px);
    line-height: 1.7;
    color: #333;
}

.banner {
    background: url('imagenes/4854966_2522453.jpg') center/cover no-repeat;
    height: clamp(250px, 50vw, 400px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 0;
}

.banner-content {
    position: relative;
    z-index: 1;
    padding: clamp(12px, 5vw, 20px);
}

.banner h1,
.title-main {
    font-size: clamp(2rem, 8vw, 5rem);
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    color: #ffffff;
    text-align: center;
    text-transform: uppercase;
    word-break: break-word;
}

.banner p {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
}

.intro-text {
    max-width: 900px;
    margin: clamp(0.75rem, 3vw, 2rem) auto;
    text-align: center;
    font-size: clamp(1.125rem, 2.5vw, 1.5rem);
    color: #000000;
    padding: 0 clamp(1rem, 5vw, 2rem);
}

.intro-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1rem, 4vw, 1.5rem);
    max-width: 1100px;
    margin: clamp(0.75rem, 3vw, 2rem) auto;
    padding: 0 clamp(1rem, 5vw, 2rem);
}

.intro-image {
    width: 100%;
    max-width: clamp(280px, 90vw, 360px);
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

nav {
    background: #000000;
    border-top: 4px solid #ff8c00;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 clamp(0.75rem, 5vw, 20px);
}

.nav-logo {
    color: white;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: bold;
    padding: clamp(0.75rem, 2vw, 1rem) 0;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: clamp(1rem, 4vw, 2rem);
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: clamp(0.5rem, 1.5vw, 1rem) 0;
    display: block;
    transition: color 0.3s;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
}

.nav-menu a:hover {
    color: #ff8c00;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: #34495e;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    top: 100%;
    left: 0;
}

.dropdown-content a {
    padding: 12px 16px;
    border-bottom: 1px solid #2c3e50;
}

.dropdown:hover .dropdown-content {
    display: block;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    cursor: pointer;
    padding: clamp(0.5rem, 2vw, 0.75rem);
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: clamp(1rem, 5vw, 20px);
}

section {
    margin: clamp(2rem, 5vw, 4rem) 0;
}

section h2 {
    font-size: clamp(1.75rem, 6vw, 4.35rem);
    margin-bottom: clamp(1rem, 3vw, 2rem);
    color: #ff8c00;
    text-align: center;
    word-break: break-word;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(250px, 80vw, 280px), 1fr));
    gap: clamp(1rem, 3vw, 2rem);
    margin-top: clamp(1rem, 3vw, 2rem);
}

.card {
    background: white;
    border-radius: 12px;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
}

.card-icon {
    display: block;
    width: clamp(64px, 12vw, 88px);
    height: clamp(64px, 12vw, 88px);
    object-fit: contain;
    margin: 0 auto clamp(0.75rem, 2vw, 1.25rem);
}

.card .card-title {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: clamp(1.125rem, 2vw, 1.5rem);
}

.subtopics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(160px, 80vw, 200px), 1fr));
    gap: clamp(0.75rem, 2vw, 1.25rem);
    max-width: 1100px;
    margin: 0 auto clamp(2rem, 5vw, 3.5rem);
    padding: 0 clamp(0.5rem, 4vw, 1rem);
}

.subtopic-card {
    position: relative;
    aspect-ratio: 1;
    min-height: clamp(140px, 35vw, 216px);
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(0,0,0,0.04));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 3vw, 1rem);
    cursor: pointer;
    transition: transform 0.32s ease, box-shadow 0.32s ease, background-color 0.3s ease;
    touch-action: manipulation;
}

.subtopic-card:focus,
.subtopic-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 14px 28px rgba(0,0,0,0.18);
    background: rgba(255, 140, 0, 0.15);
}

.subtopic-icon {
    width: clamp(48px, 10vw, 64px);
    height: clamp(48px, 10vw, 64px);
    opacity: 1;
    filter: none;
}

.subtopic-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 140, 0, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(12%);
    transition: opacity 0.22s ease, transform 0.22s ease;
    text-align: center;
    padding: clamp(0.5rem, 3vw, 1rem);
}

.subtopic-card:hover .subtopic-overlay,
.subtopic-card:focus .subtopic-overlay {
    opacity: 1;
    transform: translateY(0);
}

@media (hover: none) and (pointer: coarse) {
    .subtopic-card.active .subtopic-overlay {
        opacity: 1;
        transform: translateY(0);
    }
}

.subtopic-name {
    color: #fff;
    font-weight: 800;
    font-size: clamp(0.875rem, 2vw, 1.12rem);
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.type-summary,
.type-summary {
    margin-top: 0.75rem;
    font-size: clamp(0.75rem, 1.5vw, 1rem);
    text-align: center;
    color: #2c3e50;
    line-height: 1.4;
}

footer {
    background: #2c3e50;
    color: white;
    padding: clamp(1.5rem, 5vw, 3rem) 0 clamp(0.5rem, 2vw, 1rem);
    margin-top: clamp(2rem, 5vw, 4rem);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 5vw, 20px);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(200px, 80vw, 250px), 1fr));
    gap: clamp(1.5rem, 4vw, 2rem);
}

.footer-section h2 {
    margin-bottom: clamp(0.75rem, 2vw, 1rem);
    color: #ffffff;
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin: clamp(0.5rem, 1vw, 0.75rem) 0;
}

.footer-section a {
    color: #ecf0f1;
    text-decoration: none;
    transition: color 0.3s;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    display: inline-block;
    padding: 0.5rem 0;
}

.footer-section a:hover {
    color: #ff8c00;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    margin-top: clamp(1.5rem, 3vw, 2rem);
    padding-top: clamp(1.5rem, 3vw, 2rem);
    border-top: 1px solid #34495e;
    font-size: clamp(0.875rem, 1.5vw, 1rem);
}

@media (max-width: 480px) {
    .title-main {
        font-size: 1.75rem;
    }

    .banner p {
        font-size: 0.875rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background-color: #2c3e50;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 1.5rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 0.75rem 0;
    }

    .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .menu-toggle {
        display: flex;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1.25rem;
    }

    .card-icon {
        width: 56px;
        height: 56px;
    }

    .subtopic-card {
        min-height: 120px;
    }

    .intro-layout {
        flex-direction: column;
    }

    section h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .banner h1,
    .title-main {
        font-size: 2.25rem;
    }

    .banner p {
        font-size: 1rem;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #2c3e50;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
        gap: 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .dropdown-content {
        position: static;
        display: none;
        box-shadow: none;
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .menu-toggle {
        display: flex;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .slider {
        height: 280px;
    }

    .slide {
        font-size: 1.3rem;
    }

    .card {
        padding: 1.5rem;
    }

    .card-icon {
        width: 64px;
        height: 64px;
    }

    .subtopic-card {
        min-height: 140px;
    }

    .intro-layout {
        flex-direction: column;
    }

    .intro-image {
        max-width: 100%;
    }

    section h2 {
        font-size: 2rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .subtopics-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .intro-layout {
        flex-direction: row;
        align-items: center;
    }

    .intro-image {
        max-width: 45%;
    }

    section h2 {
        font-size: 2.75rem;
    }

    .slider {
        height: 350px;
    }
}

@media (min-width: 1025px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .subtopics-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .intro-layout {
        flex-direction: row;
        align-items: center;
    }

    .intro-image {
        max-width: 40%;
    }

    section h2 {
        font-size: 4.35rem;
    }

    .slider {
        height: 400px;
    }
}

@media (hover: none) and (pointer: coarse) {
    .subtopic-card {
        touch-action: manipulation;
    }

    .subtopic-card.active {
        background: rgba(255, 140, 0, 0.15);
    }

    .subtopic-card.active .subtopic-overlay {
        opacity: 1;
        transform: translateY(0);
    }

    .subtopic-card:active {
        transform: scale(0.98);
    }

    .card:active {
        transform: translateY(-8px);
    }

    .menu-toggle:active {
        background: rgba(255,255,255,0.2);
    }

    .subtopic-card,
    .card,
    .menu-toggle,
    a {
        cursor: pointer;
    }
}

@media (min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .subtopic-icon,
    .card-icon {
        image-rendering: crisp-edges;
    }
}

/* Video embed styles added to keep embeds responsivos y consistentes con la estética */
.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,140,0,0), rgba(255,140,0,0.25), rgba(255,140,0,0));
    margin: clamp(1rem, 3vw, 2rem) 0;
}
.video-section {
    max-width: 1100px;
    margin: 0 auto clamp(1.25rem, 3vw, 2rem);
    padding: 0 clamp(0.5rem, 4vw, 1rem);
    text-align: center;
}
.video-section h3 {
    color: #ff8c00;
    margin-bottom: 0.75rem;
}
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    background: #000;
}
.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.video-note {
    font-size: clamp(0.8rem, 1.5vw, 0.95rem);
    color: #2c3e50;
    margin-top: 0.75rem;
}
}