:root {
    --bg: #faf9f7;
    --card: #ffffff;
    --accent: #2b8aef;
    --muted: #6b7280;
    --text: #0f172a;
    --radius: 12px;
    --container: 1100px;
}

/* Reset y base */
* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
    background: var(--bg);
    color: var(--text);
}

body.modal-open {
    overflow: hidden;
}

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 1.25rem;
}

/* Navbar fija y estilizada */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
    z-index: 1000;
}

.espacio {
    padding-left: 25px;
    padding-right: 25px;
}

body {
    padding-top: 80px;
}

.brand {
    font-weight: 700;
    letter-spacing: 0.2px;
    text-decoration: none;
    color: var(--text);
}

.brand span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--muted);
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}

.nav-links a:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    font-size: 1.25rem;
}

/* Header y hero */
.site-header {
    background: linear-gradient(90deg, rgba(43, 138, 239, 0.06), rgba(43, 138, 239, 0.02));
}

.hero {
    display: grid;
    grid-template-columns: 1fr 480px;
    gap: 2rem;
    align-items: center;
    padding: 2rem 0;
}

.hero-content h1 {
    font-size: 2rem;
    margin: 0 0 0.5rem;
}

.lead {
    color: var(--muted);
    margin-bottom: 1rem;
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Botones */
.btn {
    display: inline-block;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    line-height: 1.5;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

.btn.primary {
    background: var(--accent);
    color: white;
    border-color: transparent;
}

.btn.primary:hover {
    background: #1e6bd8;
}

.btn.outline {
    border-color: var(--accent);
    color: var(--accent);
}

.highlights {
    display: flex;
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius);
}

/* Secciones */
.sobre,
.cursos,
.equipo,
.contacto {
    padding: 2rem 0;
}

.sobre-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.sobre article,
.course-card,
.teacher-card,
.contact-form,
.contact-info,
.mission,
.modal-dialog {
    background: var(--card);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

/* Cursos */
.filters {
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
}

.filters select {
    appearance: none;
    background: var(--card) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%232b8aef" viewBox="0 0 16 16"><path d="M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592c.86 0 1.319 1.013.753 1.658l-4.796 5.482a1 1 0 0 1-1.506 0z"/></svg>') no-repeat right 0.75rem center/12px;
    border: 1px solid #d5d5da;
    border-radius: 8px;
    padding: 0.6rem 2rem 0.6rem 0.8rem;
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.filters select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 138, 239, 0.15);
    outline: none;
}

.courses-grid,
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 320px);
    /* ancho fijo de tarjeta */
    justify-content: center;
    /* centra las tarjetas */
    gap: 1.5rem;
}

.course-card {
    max-width: 320px;
    width: 100%;
    height: 420px;
    /* altura fija de tarjeta */
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.course-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius);
}

.card-body {
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}


.card-body h4 {
    margin: 0.25rem 0;
}

.card-excerpt {
    color: var(--muted);
    margin: 0.5rem 0 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* líneas visibles */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-actions {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
}


/* Equipo / Profesores */
.teacher-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.teacher-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.teacher-card img {
    width: auto;
    height: 190px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.teacher-card h3 {
    margin: 0.5rem 0 0.25rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.teacher-card p {
    color: var(--muted);
    font-size: 0.95rem;
}


.mission {
    margin-top: 1rem;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.5);
    padding: 1rem;
}

.modal[aria-hidden="false"] {
    display: flex;
}

.modal-dialog {
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    /* NUNCA sobrepasa la pantalla */
    position: relative;
    display: flex;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    right: 12px;
    top: 8px;
    z-index: 10;
    background: none;
    border: 0;
    font-size: 1.5rem;
    cursor: pointer;
}
/* AJUSTE DE MODAL */
.modal-curso {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.5);
    padding: 1rem;
}

.modal-curso[aria-hidden="false"] {
    display: flex;
}

.modal-curso-dialog {
    max-width: 720px;
    width: 100%;
    max-height: 90vh; /* límite pantalla */
    display: flex;
    flex-direction: column;
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
}

.modal-curso-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.modal-curso-imagen img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
}

.modal-curso-body {
    padding: 1rem;
    overflow-y: auto; /* scroll interno */
    flex: 1; /* ocupa espacio disponible */
}
.modal-curso-footer {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Botón Aula Virtual */
#aulaVirtualBtn {
    padding: 0.6rem 1.2rem;
    /* más espacio arriba/abajo */
    border-radius: 6px;
    border: none;
    background: var(--accent);
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

#aulaVirtualBtn:hover {
    background-color: #1e6bd8;
}

#aulaVirtualBtn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(43, 138, 239, 0.3);
}

/* Footer */
.site-footer {
    padding: 1rem 0;
    background: transparent;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    margin-top: 2rem;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Responsive */
@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .courses-grid,
    .team-grid,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        right: 1rem;
        top: 64px;
        background: var(--card);
        padding: 1rem;
        border-radius: 8px;
        box-shadow: 0 12px 30px rgba(2, 6, 23, 0.08);
    }

    .nav-toggle {
        display: block;
    }

    #aulaVirtualBtn {
        width: 100%;
        text-align: center;
        margin: 0.25rem 0;
    }
}



/* Redes Sociales */
.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    padding: 1rem;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.social-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.social-card img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.social-card span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    text-align: center;
}

/* Colores personalizados por red */
.social-card.instagram:hover {
    background: linear-gradient(45deg, #f9ce34, #ee2a7b, #6228d7);
    color: white;
}

.social-card.whatsapp:hover {
    background: #25D366;
    color: white;
}

.social-card.youtube:hover {
    background: #ff0000;
    color: white;
}

.social-card.behance:hover {
    background: #0057ff;
    color: white;
}



.teacher-no-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f2f2f2;
    color: #777;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin: 0 auto 1rem;
}
