/* ===================================
   NIVEL SECUNDARIO
=================================== */

.content-wrapper:has(.secondary-page) {
    background: transparent;
    border-top: 0;
    box-shadow: none;
    padding: 0;
}

.secondary-page {
    display: grid;
    gap: 34px;
}

.secondary-hero {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.65fr);
    gap: 24px;
    align-items: stretch;
}

.secondary-hero-content,
.secondary-hero-media,
.secondary-section {
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(74, 11, 0, 0.09);
}

.secondary-hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 430px;
    color: #ffffff;
    background:
        linear-gradient(145deg, rgba(74, 11, 0, 0.96), rgba(140, 21, 0, 0.88)),
        url("../img/Carousel/portada2.jpg") center / cover;
    padding: clamp(28px, 5vw, 54px);
    overflow: hidden;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.16);
}

.secondary-hero h1 {
    max-width: 760px;
    font-size: clamp(2.25rem, 5vw, 4.3rem);
    font-weight: 800;
    line-height: 1.05;
    margin: 18px 0 16px;
}

.secondary-hero p {
    max-width: 650px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    line-height: 1.72;
    margin: 0;
}

.secondary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 800;
    text-decoration: none;
    transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease;
}

.secondary-btn:hover,
.secondary-btn:focus {
    transform: translateY(-2px);
}

.secondary-btn.primary {
    color: var(--color-principal);
    background: #ffffff;
}

.secondary-btn.secondary {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.secondary-hero-media {
    min-height: 430px;
    overflow: hidden;
    background: #f3eee9;
}

.secondary-hero-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

.secondary-section {
    background: #ffffff;
    border: 1px solid rgba(140, 21, 0, 0.12);
    padding: clamp(24px, 4vw, 38px);
}

.section-heading {
    display: grid;
    grid-template-columns: minmax(0, 0.72fr) minmax(280px, 0.48fr);
    gap: 24px;
    align-items: end;
    margin-bottom: 24px;
}

.section-heading.compact {
    display: block;
}

.section-kicker {
    display: block;
    color: #9d5142;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.section-heading h2,
.graduate-copy h2 {
    color: var(--color-texto-oscuro);
    font-size: clamp(1.8rem, 3.8vw, 2.8rem);
    font-weight: 800;
    line-height: 1.12;
    margin: 0;
}

.section-heading p,
.graduate-copy p {
    color: #625350;
    line-height: 1.7;
    margin: 0;
}

.objectives-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.objective-card {
    min-height: 190px;
    border-radius: 8px;
    background: #fffdfc;
    border: 1px solid rgba(140, 21, 0, 0.12);
    padding: 20px;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.objective-card:hover {
    transform: translateY(-4px);
    border-color: rgba(140, 21, 0, 0.24);
    box-shadow: 0 16px 30px rgba(74, 11, 0, 0.09);
}

.objective-card.wide {
    grid-column: span 2;
}

.objective-card i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--color-principal), var(--color-acento));
    border-radius: 50%;
    margin-bottom: 16px;
}

.objective-card h3 {
    color: var(--color-texto-oscuro);
    font-size: 1.08rem;
    font-weight: 800;
    margin: 0 0 10px;
}

.objective-card p {
    color: #625350;
    line-height: 1.62;
    margin: 0;
}

.split-section {
    display: grid;
    grid-template-columns: minmax(280px, 0.54fr) minmax(0, 0.9fr);
    gap: 26px;
    align-items: start;
}

.graduate-list {
    display: grid;
    gap: 12px;
}

.graduate-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border-radius: 8px;
    background: #fff8f6;
    border: 1px solid rgba(140, 21, 0, 0.12);
    padding: 12px;
}

.graduate-item i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    color: var(--color-principal);
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 8px 18px rgba(74, 11, 0, 0.08);
}

.graduate-item span {
    color: #4d3935;
    font-weight: 700;
    line-height: 1.45;
}

.secondary-gallery {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 180px;
    gap: 12px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f3eee9;
    margin: 0;
}

.gallery-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-item.wide {
    grid-column: span 2;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
    transition: transform 0.35s ease;
}

.gallery-item:hover img {
    transform: scale(1.04);
}

.study-section {
    scroll-margin-top: 120px;
}

.study-tabs {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
}

.study-tab-list {
    display: grid;
    gap: 10px;
    align-content: start;
}

.study-tab {
    width: 100%;
    border: 1px solid rgba(140, 21, 0, 0.14);
    border-radius: 8px;
    color: var(--color-texto-oscuro);
    background: #fffdfc;
    padding: 12px 14px;
    font-weight: 800;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.study-tab:hover,
.study-tab:focus {
    border-color: rgba(140, 21, 0, 0.32);
}

.study-tab.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--color-principal), var(--color-acento));
    border-color: transparent;
}

.study-content {
    min-height: 320px;
    border-radius: 8px;
    background: #fff8f6;
    border: 1px solid rgba(140, 21, 0, 0.12);
    padding: 22px;
}

.study-content h3 {
    color: var(--color-texto-oscuro);
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 0 16px;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.subject-grid li {
    position: relative;
    color: #4d3935;
    background: #ffffff;
    border: 1px solid rgba(140, 21, 0, 0.1);
    border-radius: 8px;
    padding: 10px 12px 10px 34px;
    font-weight: 700;
}

.subject-grid li::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-acento);
    transform: translateY(-50%);
}

.secondary-btn:focus-visible,
.study-tab:focus-visible {
    outline: 3px solid rgba(140, 21, 0, 0.22);
    outline-offset: 4px;
}

.secondary-hero .secondary-btn:focus-visible {
    outline-color: rgba(255, 255, 255, 0.68);
}

@media (max-width: 1199px) {
    .secondary-hero {
        grid-template-columns: 1fr;
    }

    .secondary-hero-media {
        min-height: 320px;
    }

    .objectives-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .section-heading,
    .split-section,
    .study-tabs {
        grid-template-columns: 1fr;
    }

    .secondary-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .study-tab-list {
        display: flex;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .study-tab {
        min-width: 130px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .secondary-page {
        gap: 22px;
    }

    .secondary-hero-content {
        min-height: auto;
    }

    .secondary-actions {
        flex-direction: column;
    }

    .secondary-btn {
        width: 100%;
    }

    .objectives-grid {
        grid-template-columns: 1fr;
    }

    .objective-card.wide {
        grid-column: auto;
    }

    .secondary-gallery {
        grid-auto-rows: 170px;
    }

    .gallery-item.large,
    .gallery-item.wide {
        grid-column: span 2;
        grid-row: span 1;
    }

    .subject-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .section-badge {
        font-size: 0.72rem;
        padding: 7px 13px;
    }

    .secondary-section {
        padding: 18px;
    }

    .secondary-gallery {
        grid-template-columns: 1fr;
    }

    .gallery-item.large,
    .gallery-item.wide {
        grid-column: auto;
    }
}
