/* CEIP Genil — estilos base
   Paleta: azul noche (marca), verde-río (acento), sol (detalle), papel (fondo) */
:root {
  --ink: #16324f;
  --ink-soft: #274a68;
  --teal: #2e8b96;
  --teal-soft: #e4f0f0;
  --amber: #e0973a;
  --paper: #eef6f5;
  --white: #ffffff;
  --text: #1b2b34;
  --text-soft: #55666d;
  --line: #e1e7e6;
  --radius: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: 'Work Sans', -apple-system, Segoe UI, sans-serif;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, .brand-name {
  font-family: 'Fredoka', 'Work Sans', sans-serif;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  text-wrap: balance;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(30px, 4.5vw, 46px); }
h2 { font-size: clamp(24px, 3.2vw, 32px); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
.text-soft { color: var(--text-soft); }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding-block: 64px; }
.section.alt { background: var(--paper); }
.section-head { max-width: 62ch; margin-bottom: 36px; }
.eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}

/* Header */
header.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-text { line-height: 1.05; }
.brand-name { font-size: 19px; margin: 0; }
.brand-place {
  display: block;
  font-family: 'Work Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-soft);
}
nav.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
nav.main-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 14.5px;
}
nav.main-nav a:hover { color: var(--teal); text-decoration: none; }
nav.main-nav a.current { color: var(--teal); }
nav.main-nav a.btn-primary { color: #fff; }
nav.main-nav a.btn-primary:hover { color: #fff; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-soft); }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 4px 0;
}

/* Hero */
.hero {
  padding-block: 56px 72px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero p.lead { font-size: 17.5px; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.hero-art { border-radius: 20px; overflow: hidden; background: var(--teal-soft); }

/* Vídeos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.video-embed {
  position: relative;
  padding-top: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Carrusel de fotos */
.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track img {
  scroll-snap-align: start;
  height: 320px;
  width: auto;
  max-width: 85vw;
  border-radius: var(--radius);
  object-fit: cover;
  flex: 0 0 auto;
}
.carousel-nav { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.carousel-nav button {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-size: 16px;
  color: var(--ink);
}
.carousel-nav button:hover { border-color: var(--teal); color: var(--teal); }

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
a.card-link {
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, transform .15s ease;
}
a.card-link:hover {
  border-color: var(--teal);
  text-decoration: none;
  transform: translateY(-2px);
}
.card-more {
  margin-top: auto;
  padding-top: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--teal);
}
.card .icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--teal-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.card h3 { margin-bottom: 8px; }
.card p { font-size: 14.5px; color: var(--text-soft); margin-bottom: 0; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}
.stat { text-align: left; }
.stat .num {
  font-family: 'Fredoka', sans-serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  display: block;
}
.stat .label { font-size: 13.5px; color: var(--text-soft); }

/* News */
.news-item {
  border-top: 1px solid var(--line);
  padding-block: 22px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: baseline;
  flex-wrap: wrap;
}
.news-item.with-photos { align-items: flex-start; }
.news-photos { display: flex; gap: 8px; flex: 0 0 auto; }
.news-photos img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
}
.news-item .news-text { flex: 1 1 260px; }
.news-item .date {
  font-size: 12.5px;
  color: var(--teal);
  font-weight: 600;
  letter-spacing: .04em;
}
.news-item h3 { margin: 4px 0 4px; }
.news-item p { color: var(--text-soft); font-size: 14.5px; margin: 0; max-width: 60ch; }

/* Page hero (paginas internas) */
.page-hero-band {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, var(--teal-soft) 0%, #ffffff 65%);
  border-bottom: 1px solid var(--line);
}
.page-hero-graphic {
  position: absolute;
  right: 0;
  bottom: -36px;
  width: 260px;
  opacity: .55;
  pointer-events: none;
}
.page-hero-graphic svg { display: block; width: 100%; height: auto; }
.page-hero { padding-block: 44px 40px; position: relative; z-index: 1; }
.page-hero .eyebrow { margin-bottom: 12px; }
.page-hero .lead { max-width: 56ch; }
@media (max-width: 640px) {
  .page-hero-graphic { width: 160px; opacity: .35; }
}

/* Contact / address blocks */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.info-list { list-style: none; padding: 0; margin: 0; }
.info-list li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 14px;
}
.info-list li:last-child { border-bottom: 1px solid var(--line); }
.info-list .label { font-weight: 600; min-width: 120px; color: var(--ink); }

.map-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 320px;
}

.section-photo {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 28px;
}

/* Callout / placeholder notice */
.callout {
  border: 1px dashed var(--amber);
  background: #fdf5ea;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 13.5px;
  color: #7a5417;
}

/* Cofinanciación */
.cofinanciacion {
  border-top: 1px solid var(--line);
  padding-block: 22px;
  text-align: center;
}
.cofinanciacion img { margin: 0 auto; max-height: 46px; width: auto; }
.cofinanciacion p {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-soft);
}

/* Cuadrícula de fotos reales (recorte uniforme) */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.photo-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  display: block;
}

/* Carteles de programas */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.poster-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
}
.poster-card img { width: 100%; display: block; }
.poster-card .poster-caption {
  padding: 14px 16px;
  font-size: 13.5px;
  color: var(--text-soft);
}

/* Footer */
footer.site-footer {
  background: var(--ink);
  color: #cfe0e6;
  padding-block: 48px 28px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-grid h4 {
  color: #fff;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.footer-grid a, .footer-grid p { color: #b8cdd4; font-size: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-bottom {
  border-top: 1px solid #274a68;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12.5px;
  color: #8fa9b2;
}
.social-row { display: flex; gap: 12px; }
.social-row a {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid #274a68;
  display: flex; align-items: center; justify-content: center;
}

/* Responsive */
@media (max-width: 860px) {
  .hero, .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  nav.main-nav {
    position: fixed;
    inset: 62px 0 0 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 18px;
    transform: translateX(100%);
    transition: transform .25s ease;
    overflow-y: auto;
  }
  nav.main-nav.open { transform: translateX(0); }
  .nav-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
}
