/*
Theme Name: Programación Sixto Méndez
Theme URI: https://programacionsixtomendez.cl
Author: Estudiantes de Programación — Colegio Sixto Méndez Parada
Author URI: https://programacionsixtomendez.cl
Description: Tema WordPress premium para la Especialidad de Programación. Fondo claro, acentos en azul #3a6bba, tipografía Inter + JetBrains Mono y fondo Letter Glitch en el hero (canvas, sin React).
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: programacion-sixto
Tags: education, custom-menu, featured-images, full-width-template, responsive, one-column
*/

:root {
  --bg: #f4f6fa;
  --bg-alt: #e8eef6;
  --surface: #ffffff;
  --ink: #1b2330;
  --muted: #7b7373;
  --primary: #3a6bba;
  --primary-hover: #2f5aa3;
  --primary-fg: #ffffff;
  --primary-soft: #e8eef8;
  --line: #d7dde8;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 0 0 1px rgba(27, 35, 48, 0.06), 0 1px 2px -1px rgba(27, 35, 48, 0.06), 0 2px 8px 0 rgba(27, 35, 48, 0.04);
  --shadow-hover: 0 0 0 1px rgba(58, 107, 186, 0.18), 0 8px 24px -8px rgba(58, 107, 186, 0.2);
  --shadow-lift: 0 18px 50px -20px rgba(27, 35, 48, 0.18);
  --radius: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
img { max-width: 100%; height: auto; display: block; outline: 1px solid rgba(27,35,48,.08); outline-offset: -1px; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { letter-spacing: -0.03em; line-height: 1.15; text-wrap: balance; margin: 0 0 0.6em; }
h1 { font-size: clamp(2rem, 4.6vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 600; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { color: var(--muted); margin: 0 0 1rem; text-wrap: pretty; }
ul { margin: 0; padding: 0; list-style: none; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--surface); padding: 0.6rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.container { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; }
.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--primary);
  margin: 0 0 0.6rem;
}
.kicker.light { color: rgba(255,255,255,.7); }

.site-header {
  position: sticky; top: 0; z-index: 50;
  transition: background .2s var(--ease), box-shadow .2s var(--ease);
}
.site-header.scrolled { background: rgba(255,255,255,.9); backdrop-filter: blur(12px); box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; color: inherit; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; outline: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-weight: 600; font-size: 15px; color: var(--ink); }
.brand-sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.main-nav { display: flex; align-items: center; gap: 0.15rem; }
.main-nav a {
  display: block; color: var(--ink); padding: 0.5rem 0.8rem; border-radius: 999px; font-size: 13.5px; font-weight: 500;
}
.main-nav a:hover, .main-nav .current-menu-item > a { background: var(--primary-soft); color: var(--primary); }
.main-nav .sub-menu {
  display: none; position: absolute; min-width: 220px; background: var(--surface); box-shadow: var(--shadow-lift);
  border-radius: 16px; padding: 0.5rem; margin-top: 0.3rem;
}
.main-nav .menu-item-has-children { position: relative; }
.main-nav .menu-item-has-children:hover > .sub-menu,
.main-nav .menu-item-has-children:focus-within > .sub-menu { display: block; }
.main-nav .sub-menu a { border-radius: 10px; }

.menu-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: var(--surface); box-shadow: var(--shadow);
  border-radius: 999px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.menu-toggle span { display: block; width: 16px; height: 1.5px; background: var(--ink); }

.hero { position: relative; min-height: calc(100dvh - 4.25rem); overflow: hidden; }
.hero-glitch { position: absolute; inset: 0; background: var(--bg-alt); }
.hero-glitch canvas { display: block; width: 100%; height: 100%; }
.hero-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle, rgba(244,246,250,0) 42%, rgba(244,246,250,.72) 78%, rgba(244,246,250,.97) 100%);
}
.hero-inner { position: relative; display: flex; align-items: center; min-height: calc(100dvh - 4.25rem); padding: 4rem 0; }
.hero-card {
  max-width: 36rem; background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-radius: 32px; padding: 2.4rem; box-shadow: var(--shadow-lift);
}
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--primary-soft); color: var(--primary);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  border-radius: 999px; padding: 0.3rem 0.8rem; margin: 0 0 1rem;
}
.hero-lede { font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.6rem 0 1.4rem; }
.hero-prompt { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin: 0; overflow-x: auto; }
.hero-prompt span { color: var(--primary); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  height: 48px; padding: 0 1.4rem; border-radius: 999px; font-weight: 500; font-size: 14px;
  border: 0; cursor: pointer; transition: transform .15s var(--ease), background .15s var(--ease);
}
.btn:active { transform: scale(0.96); }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn-on-primary { background: var(--surface); color: var(--ink); }
.btn-ghost-light { color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }

.stats { background: var(--surface); border-block: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stats-grid > div { padding: 2rem 1.4rem; border-right: 1px solid var(--line); }
.stats-grid > div:last-child { border-right: 0; }
.stats-grid strong { display: block; font-family: var(--font-mono); font-size: 1.8rem; font-weight: 500; color: var(--primary); }
.stats-grid span { color: var(--muted); font-size: 0.9rem; }

.section { padding: 5rem 0; }
.section.alt { background: var(--bg-alt); }
.section.surface { background: var(--surface); }
.section-lede { max-width: 36rem; }

.split { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.frame { background: var(--surface); padding: 8px; border-radius: 28px; box-shadow: var(--shadow); }
.frame img, .frame .img-placeholder { border-radius: 20px; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.img-placeholder {
  display: flex; align-items: center; justify-content: center; text-align: center;
  background: var(--bg-alt); color: var(--muted); font-size: 0.9rem; padding: 1.5rem;
  aspect-ratio: 16/10;
}

.year-grid { display: grid; gap: 1.2rem; margin-top: 2rem; }
@media (min-width: 900px) { .year-grid { grid-template-columns: 1fr 1fr; } }
.year-card { background: var(--surface); border-radius: 28px; padding: 1.8rem; box-shadow: var(--shadow); }
.year-label { display: flex; align-items: baseline; gap: 0.7rem; color: var(--muted); }
.year-label span { font-family: var(--font-mono); font-size: 1.8rem; color: var(--primary); font-weight: 500; }
.module-list { margin-top: 1rem; }
.module-list li + li { border-top: 1px solid var(--line); }
.module-list a { display: block; padding: 1rem 0; color: inherit; }
.module-list strong { display: block; color: var(--ink); }
.module-list span { color: var(--muted); font-size: 0.9rem; }
.module-list a:hover strong { color: var(--primary); }

.chip-wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.4rem; }
.chip {
  background: var(--surface); box-shadow: var(--shadow); border-radius: 999px;
  padding: 0.4rem 0.85rem; font-family: var(--font-mono); font-size: 12px;
}

.card-grid { display: grid; gap: 1.2rem; margin-top: 1.6rem; }
@media (min-width: 800px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.media-card { background: var(--bg); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.media-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.media-card > div { padding: 1.2rem 1.3rem 1.4rem; }
.media-card h3 { margin: 0.2rem 0 0.4rem; }
.media-card p { margin: 0; font-size: 0.92rem; }

.gallery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1.6rem; }
.gallery-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 20px; }

.cta-band {
  background: var(--primary); color: #fff; border-radius: 32px; padding: 3rem 2rem;
}
.cta-band h2, .cta-band p { color: inherit; }
.cta-band p { color: rgba(255,255,255,.8); }

.page-hero {
  background: var(--bg-alt);
  background-image: linear-gradient(to right, rgba(58,107,186,.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(58,107,186,.07) 1px, transparent 1px);
  background-size: 32px 32px;
  padding: 4rem 0 3.2rem;
  border-bottom: 1px solid var(--line);
}
.content-width { max-width: 42rem; }
.entry-content p { margin-bottom: 1rem; }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 2rem; }
.footer-grid { display: grid; gap: 2rem; padding: 3.2rem 0; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-lede { max-width: 22rem; font-size: 0.92rem; margin-top: 1rem; }
.footer-links { margin-top: 0.6rem; }
.footer-links li { margin: 0.35rem 0; font-size: 0.92rem; }
.footer-links a { color: var(--ink); }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem;
  padding: 1rem 0; font-size: 12px; color: var(--muted);
}

.will-animate { opacity: 0; transform: translateY(12px); }
.will-animate.is-in { opacity: 1; transform: none; transition: opacity .5s var(--ease), transform .5s var(--ease); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .will-animate { opacity: 1; transform: none; }
}

@media (max-width: 960px) {
  .menu-toggle { display: flex; }
  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); flex-direction: column; align-items: stretch;
    padding: 0.8rem; border-top: 1px solid var(--line);
  }
  .main-nav.is-open { display: flex; }
  .main-nav .sub-menu { position: static; display: block; box-shadow: none; padding-left: 0.8rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid > div:nth-child(2) { border-right: 0; }
  .hero-card { padding: 1.5rem; border-radius: 24px; }
}

.elementor-widget-container img { border-radius: 16px; }
