:root {
    color-scheme: light;
    --violet-800: #3c2c63;
    --violet-600: #5e4b8a;
    --violet-500: #7c5dd4;
    --violet-200: #e7ddff;
    --neutral-50: #f7f5ff;
    --neutral-900: #1a1330;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--neutral-50);
    color: var(--neutral-900);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--violet-600);
}

.page {
    width: min(1100px, 100%);
    margin: 0 auto;
    padding: clamp(1.5rem, 4vw, 3rem) 1.5rem 4rem;
}

.hero {
    text-align: center;
    margin-bottom: 2rem;
}

.hero img {
    width: 100%;
    height: auto;
    border-radius: 1rem;
    box-shadow: none;
    border: none;
    display: block;
}

.panel {
    background: white;
    border-radius: 1.25rem;
    padding: clamp(0.4rem, 1vw, 0.75rem) clamp(0.85rem, 2vw, 1.4rem);
    margin-bottom: 1.25rem;
    box-shadow: 0 12px 30px rgba(60, 44, 99, 0.08);
    border: 1px solid rgba(92, 71, 119, 0.12);
}

.panel-title {
    font-size: clamp(1.3rem, 2vw, 1.5rem);
    margin: 0 0 0.5rem;
    color: var(--violet-800);
}

.career-header {
    margin-bottom: clamp(1rem, 3vw, 1.5rem);
}

.career-title {
    margin: 0;
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    color: var(--violet-800);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.75rem;
}

.career-plan {
    font-weight: inherit;
    color: inherit;
    font-size: inherit;
}

.button-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.md3-button {
    background: var(--violet-600);
    color: #fff;
    border: none;
    border-radius: 0.9rem;
    padding: 0.95rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 10px 30px rgba(92, 71, 119, 0.25);
    width: 100%;
}

.md3-button span {
    flex: 1;
    text-align: left;
}

.md3-button svg {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

.md3-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(92, 71, 119, 0.35);
}

.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 1rem;
    border: 1px solid rgba(92, 71, 119, 0.2);
    box-shadow: 0 25px 60px rgba(60, 44, 99, 0.18);
    padding: 0.75rem;
    z-index: 20;
}

.dropdown-content a {
    display: block;
    padding: 0.65rem 0.8rem;
    border-radius: 0.7rem;
    text-decoration: none;
    color: var(--neutral-900);
    font-weight: 500;
}

.dropdown-content a:hover {
    background: var(--violet-200);
}

.dropdown-content.show {
    display: block;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: #faf8ff;
    border-radius: 1.2rem;
    padding: 1.2rem;
    border: 1px solid rgba(92, 71, 119, 0.1);
}

.info-card h3 {
    margin: 0 0 0.6rem;
    font-size: 1.05rem;
    color: var(--violet-600);
}

.data-list {
    display: grid;
    gap: 0.5rem;
}

.data-list div {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(92, 71, 119, 0.15);
}

.data-list div:last-child {
    border-bottom: none;
}

.data-list dt {
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--violet-600);
}

.data-list dd {
    margin: 0;
    font-size: 1rem;
    color: var(--neutral-900);
    font-weight: 600;
}

figure {
    margin: 0 0 2rem;
}

.media-card {
    margin: 0;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
}

.media-card img {
    width: 100%;
    height: auto;
    border-radius: 0.9rem;
}

.media-card figcaption {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: var(--violet-600);
    text-align: center;
}

.quote {
    border-left: 4px solid var(--violet-500);
    padding-left: 1rem;
    margin: 0 0 1rem;
    font-weight: 600;
    color: var(--violet-800);
    font-size: clamp(1.3rem, 2vw, 1.5rem);
}

.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-list li {
    margin-bottom: 0.5rem;
}

.image-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 7, 20, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 1000;
}

/* Flechas de navegación */
.nav-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 999px;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1010;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.nav-arrow:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 3px;
}

.nav-arrow--prev {
    left: 1.5rem;
}

.nav-arrow--next {
    right: 1.5rem;
}

.nav-arrow svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--violet-800);
}

/* Contador de imágenes */
.nav-counter {
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.image-overlay.show {
    display: flex;
}

.overlay-content {
    position: relative;
    width: min(900px, 100%);
    max-height: 90vh;
}

.overlay-content img {
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 1.2rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    transition: opacity 0.25s ease-out, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center center;
    will-change: transform;
}

/* Cursor para indicar que se puede hacer zoom */
.image-overlay.show .overlay-content img {
    cursor: zoom-in;
}

.image-overlay.show .overlay-content img.zoomed {
    cursor: grab;
}

.image-overlay.show .overlay-content img.zoomed:active {
    cursor: grabbing;
}

/* Animación de entrada de imagen */
.overlay-content img.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

.overlay-content img.fade-in {
    opacity: 1;
    transform: scale(1);
}

/* Indicador de zoom */
.zoom-indicator {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.9);
    color: var(--violet-800);
    padding: 0.5rem 0.85rem;
    border-radius: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.zoom-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.overlay-buttons {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.5rem;
    z-index: 1020;
}

.close-overlay, .download-overlay, .reset-zoom {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 999px;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.close-overlay:hover, .download-overlay:hover, .reset-zoom:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.reset-zoom svg {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--violet-600);
}

.reset-zoom.hidden {
    display: none;
}

.download-overlay svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--violet-600);
}

.close-overlay svg {
    width: 1.25rem;
    height: 1.25rem;
}

@media (max-width: 640px) {
    .page {
        padding: 1.25rem clamp(1rem, 4vw, 1.75rem) 3rem;
    }

    .md3-button {
        padding: 0.85rem 1rem;
        font-size: 0.92rem;
    }

    .dropdown-content {
        position: static;
    }
}

/* Estilos para botones de biblioteca - estructura original */
.library-button-grid {
  margin: 2rem 0;
}

.library-button-grid__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.library-button {
  --button-color: #0f4c81;
  background: #fff;
  border: 2px solid var(--button-color);
  border-radius: 999px;
  color: #0f1b3f;
  text-decoration: none;
  padding: 0.75rem 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.library-button__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--button-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.library-button__icon svg {
  width: 28px;
  height: 28px;
}

.library-button__icon-letter {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.library-button:hover,
.library-button:focus-visible {
  background: var(--button-color);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.15);
}

.library-button:hover .library-button__icon,
.library-button:focus-visible .library-button__icon {
  background: #fff;
  color: var(--button-color);
}

.library-button:focus-visible {
  outline: 3px solid rgba(0, 0, 0, 0.25);
  outline-offset: 3px;
}

.library-button--facebook { --button-color: #1877f2; }
.library-button--audiovisuales { --button-color: #ff6b35; }
.library-button--sitios { --button-color: #0fa3b1; }
.library-button--recursero { --button-color: #7b5ea7; }
.library-button--alfabetizacion { --button-color: #e63946; }

@media (max-width: 900px) {
  .library-button-grid__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .library-button-grid__inner {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .library-button {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
  }
}

/* Hacer todas las imágenes clickeables */
.media-card img {
    cursor: zoom-in;
}

.careers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.career-card {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(60, 44, 99, 0.08);
    border: 1px solid rgba(92, 71, 119, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.career-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 80px rgba(60, 44, 99, 0.15);
}

.career-card h3 {
    margin: 0 0 1rem;
    color: var(--violet-800);
    font-size: 1.4rem;
}

.career-card p {
    margin: 0 0 1.5rem;
    color: var(--neutral-900);
    line-height: 1.6;
}

.career-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--violet-600);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.career-link:hover {
    color: var(--violet-800);
}

.career-link svg {
    width: 1.2rem;
    height: 1.2rem;
}

.intro-text {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--neutral-900);
}

.hidden {
    display: none;
}

/* Grid de carreras */
#carreras-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin: 2rem 0;
    justify-items: center;
}

.carrera-item {
    text-align: center;
    transition: transform 0.2s ease;
}

.carrera-item:hover {
    transform: translateY(-4px);
}

.carrera-item img {
    width: 100%;
    max-width: 250px;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.carrera-item img:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

@media (max-width: 1024px) {
    #carreras-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.carreras-heading {
    text-align: center;
    margin: 0 0 2rem;
    color: var(--violet-800);
    font-size: clamp(2rem, 4vw, 2.5rem);
}

.carreras-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
    justify-content: center;
}

.back-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.back-button,
.main-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: auto;
    min-width: 140px;
    text-decoration: none;
}

.back-button {
    max-width: 280px;
}

.main-button {
    max-width: 240px;
}

.back-button-icon {
    transform: rotate(180deg);
}

.main-button-icon {
    transform: none;
}

/* Textos responsivos */
.button-text-short {
    display: none;
}

@media (max-width: 640px) {
    .back-button-container {
        gap: 0.75rem;
    }

    .back-button,
    .main-button {
        min-width: 120px;
        padding: 0.75rem 1rem;
    }

    .button-text-long {
        display: none;
    }

    .button-text-short {
        display: inline;
    }
}

.main-button-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

@media (max-width: 640px) {
    .main-button-container .main-button {
        min-width: 120px;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 640px) {
    #carreras-grid,
    .carreras-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
        margin-top: 1rem;
    }

    .carrera-item {
        width: 100%;
    }

    .carrera-item img {
        width: 100%;
        max-width: none;
        box-shadow: none;
        border-radius: 0;
    }

    .distribution-caption {
        display: none;
    }

    /* Overlay en móvil */
    .overlay-buttons {
        top: 1rem;
        right: 1rem;
    }

    .nav-arrow {
        width: 2.5rem;
        height: 2.5rem;
    }

    .nav-arrow--prev {
        left: 0.5rem;
    }

    .nav-arrow--next {
        right: 0.5rem;
    }

    .nav-counter {
        bottom: -1.5rem;
    }
}
