/* =============================================================
   Dirección de Educación y Cultura — Municipalidad de Naranjal
   Hoja de estilos principal
   ============================================================= */

:root {
  --bg:           #FBF7EF;
  --bg-alt:       #F2EADC;
  --bg-card:      #FFFFFF;
  --primary:      #C75B12;
  --primary-dark: #8E3F0A;
  --primary-soft: #F4DEC4;
  --gold:         #D4A017;
  --text:         #2A2520;
  --text-soft:    #5A4F45;
  --text-muted:   #8A7E70;
  --border:       #E5D8C0;
  --border-soft:  #EFE6D2;
  --green:        #4A7C2A;
  --blue:         #2C5F8D;
  --shadow:       0 2px 14px rgba(60, 35, 5, 0.07);
  --radius:       6px;
  --radius-lg:    10px;
  --max-w:        1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--primary-dark); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary); text-decoration: underline; }

h1, h2, h3, h4 { font-family: 'Georgia', 'Times New Roman', serif; color: var(--text); line-height: 1.25; font-weight: 700; }
h1 { font-size: 2.2rem; margin-bottom: .8rem; }
h2 { font-size: 1.75rem; margin-bottom: .7rem; }
h3 { font-size: 1.25rem; margin-bottom: .5rem; }
h4 { font-size: 1.05rem; margin-bottom: .4rem; }
p  { margin-bottom: 1rem; color: var(--text-soft); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Barra superior utilitaria ===== */
.topbar {
  background: var(--primary-dark);
  color: #fff;
  font-size: .85rem;
  padding: 6px 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.topbar a { color: #fff; }
.topbar .topbar-info span { margin-right: 14px; opacity: .92; }
.topbar .topbar-social a { margin-left: 10px; opacity: .85; }
.topbar .topbar-social a:hover { opacity: 1; text-decoration: none; }

/* ===== Header principal ===== */
.site-header {
  background: var(--bg-card);
  border-bottom: 3px solid var(--primary);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--primary); background: #fff; }
.brand-text h1 {
  font-size: 1.15rem;
  font-family: 'Georgia', serif;
  margin: 0;
  color: var(--primary-dark);
  letter-spacing: .3px;
}
.brand-text p {
  font-size: .82rem;
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== Navegación ===== */
nav.main-nav ul { list-style: none; display: flex; gap: 2px; }
nav.main-nav li a {
  display: block;
  padding: 10px 14px;
  font-weight: 600;
  font-size: .92rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .4px;
  border-radius: var(--radius);
  transition: all .15s ease;
}
nav.main-nav li a:hover,
nav.main-nav li a.active {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1.5px solid var(--primary);
  color: var(--primary-dark);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 1.2rem;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 460px;
  background: linear-gradient(rgba(40, 25, 5, 0.55), rgba(40, 25, 5, 0.5)),
              url('https://images.unsplash.com/photo-1503676260728-1c00da094a0b?w=1600&q=80&auto=format');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  color: #fff;
  text-align: center;
  padding: 70px 20px;
}
.hero-content { max-width: 880px; margin: 0 auto; }
.hero h2 {
  font-size: 2.6rem;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
  margin-bottom: 18px;
}
.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,.95);
  max-width: 720px;
  margin: 0 auto 28px;
}
.hero-eyebrow {
  display: inline-block;
  background: var(--gold);
  color: #2A2520;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 30px;
  margin-bottom: 20px;
}

/* ===== Botones ===== */
.btn {
  display: inline-block;
  padding: 12px 26px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .8px;
  font-size: .9rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all .2s ease;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn.btn-secondary { background: transparent; border: 2px solid #fff; }
.btn.btn-secondary:hover { background: #fff; color: var(--primary-dark); }
.btn.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary-dark); }
.btn.btn-outline:hover { background: var(--primary); color: #fff; }

/* ===== Secciones ===== */
.section { padding: 70px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  text-align: center;
  margin-bottom: 14px;
  position: relative;
  padding-bottom: 14px;
}
.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--primary);
  margin: 14px auto 0;
  border-radius: 3px;
}
.section-subtitle {
  text-align: center;
  font-size: 1.05rem;
  color: var(--text-soft);
  max-width: 720px;
  margin: 0 auto 50px;
}

/* ===== Cards / Grid ===== */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 22px rgba(60,35,5,.13); }
.card-img {
  aspect-ratio: 16/10;
  background: var(--primary-soft);
  background-size: cover;
  background-position: center;
}
.card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.card-tag {
  display: inline-block;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: .72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 30px;
  margin-bottom: 10px;
  align-self: flex-start;
}
.card h3 { margin-bottom: 8px; font-size: 1.15rem; }
.card-meta { font-size: .82rem; color: var(--text-muted); margin-bottom: 10px; }
.card-link { margin-top: auto; padding-top: 14px; font-weight: 600; font-size: .9rem; }
.card-link::after { content: ' →'; }

/* ===== Estadísticas ===== */
.stats {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 55px 0;
}
.stat-item { text-align: center; padding: 12px; }
.stat-item .stat-number {
  font-family: 'Georgia', serif;
  font-size: 2.8rem;
  font-weight: 700;
  display: block;
  line-height: 1.1;
  color: var(--gold);
}
.stat-item .stat-label {
  text-transform: uppercase;
  letter-spacing: 1.4px;
  font-size: .82rem;
  margin-top: 8px;
  opacity: .92;
}

/* ===== Sub-hero / banner de página interna ===== */
.page-banner {
  background: linear-gradient(rgba(135, 60, 10, 0.85), rgba(199, 91, 18, 0.75)),
              url('https://images.unsplash.com/photo-1497486751825-1233686d5d80?w=1600&q=80&auto=format');
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 65px 20px 50px;
  text-align: center;
}
.page-banner h2 { color: #fff; font-size: 2.1rem; margin-bottom: 8px; }
.page-banner .breadcrumb { font-size: .85rem; opacity: .9; }
.page-banner .breadcrumb a { color: #fff; text-decoration: underline; }

/* ===== Bloques de contenido ===== */
.content-block { background: var(--bg-card); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: 32px; box-shadow: var(--shadow); }
.content-block + .content-block { margin-top: 24px; }
.content-block h3 { color: var(--primary-dark); border-bottom: 2px solid var(--primary-soft); padding-bottom: 8px; margin-bottom: 16px; }
.content-block ul { margin-left: 22px; margin-bottom: 14px; }
.content-block ul li { color: var(--text-soft); margin-bottom: 6px; }

/* ===== Listado de noticias ===== */
.news-item {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow);
}
.news-item .news-img { aspect-ratio: 4/3; background-size: cover; background-position: center; border-radius: var(--radius); }
.news-item h3 { font-size: 1.25rem; margin-bottom: 6px; }
.news-item h3 a { color: var(--text); }
.news-item h3 a:hover { color: var(--primary); }
.news-item .news-meta { color: var(--text-muted); font-size: .85rem; margin-bottom: 10px; }
.news-item .news-meta span { margin-right: 14px; }

/* ===== Tabla FONACIDE ===== */
.fonacide-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.fonacide-table th, .fonacide-table td { padding: 14px 18px; text-align: left; border-bottom: 1px solid var(--border-soft); }
.fonacide-table th { background: var(--primary-dark); color: #fff; font-weight: 600; text-transform: uppercase; font-size: .85rem; letter-spacing: .5px; }
.fonacide-table tr:hover td { background: var(--bg-alt); }
.fonacide-table td a { font-weight: 600; }
.fonacide-table tr:last-child td { border-bottom: none; }

/* ===== Galería ===== */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 30px; }
.gallery .gallery-item { aspect-ratio: 4/3; background-size: cover; background-position: center; border-radius: var(--radius); cursor: pointer; transition: transform .2s ease; }
.gallery .gallery-item:hover { transform: scale(1.02); }

/* ===== Formulario / Contacto ===== */
.contact-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; }
.contact-info { background: var(--bg-card); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--border-soft); }
.contact-info h3 { color: var(--primary-dark); margin-bottom: 16px; }
.contact-info .info-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.contact-info .info-icon {
  width: 38px; height: 38px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.contact-info .info-row p { margin: 0; }
.contact-info .info-row strong { color: var(--text); display: block; margin-bottom: 2px; }

.form { background: var(--bg-card); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--border-soft); }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; color: var(--text); }
.form-row input, .form-row textarea, .form-row select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  background: var(--bg);
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(199,91,18,.15); }
.form-row textarea { min-height: 130px; resize: vertical; }

/* ===== Highlight / Convenio Box ===== */
.highlight-box {
  background: linear-gradient(135deg, #FFF6E6 0%, var(--primary-soft) 100%);
  border-left: 5px solid var(--primary);
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  margin: 24px 0;
}
.highlight-box h4 { color: var(--primary-dark); margin-bottom: 8px; }
.highlight-box p:last-child { margin-bottom: 0; }

/* ===== Footer ===== */
footer.site-footer {
  background: #2A2520;
  color: #DDD3C5;
  padding: 50px 0 0;
  margin-top: 60px;
}
.site-footer .footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 30px; }
.site-footer h4 { color: var(--gold); margin-bottom: 14px; font-family: 'Georgia', serif; font-size: 1rem; text-transform: uppercase; letter-spacing: 1.5px; }
.site-footer p, .site-footer li, .site-footer a { color: #DDD3C5; font-size: .92rem; }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: 6px; }
.footer-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.footer-brand img { width: 56px; height: 56px; border-radius: 50%; }
.footer-brand-text { font-family: 'Georgia', serif; font-size: 1.05rem; line-height: 1.2; color: #fff; }
.footer-brand-text small { display: block; font-size: .78rem; opacity: .8; font-family: inherit; font-style: italic; }
.footer-bottom { border-top: 1px solid #3D372E; padding: 18px 0; text-align: center; font-size: .82rem; opacity: .85; }
.social-links a { display: inline-block; width: 36px; height: 36px; line-height: 34px; border: 1.5px solid var(--gold); border-radius: 50%; text-align: center; margin-right: 6px; color: var(--gold); font-weight: 700; }
.social-links a:hover { background: var(--gold); color: #2A2520; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; }
  .news-item { grid-template-columns: 1fr; }
  .news-item .news-img { aspect-ratio: 16/9; }
}
@media (max-width: 700px) {
  h1, .hero h2 { font-size: 1.9rem; }
  .nav-toggle { display: block; }
  nav.main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-card); border-top: 1px solid var(--border); padding: 10px 0; box-shadow: var(--shadow); }
  nav.main-nav.open { display: block; }
  nav.main-nav ul { flex-direction: column; }
  nav.main-nav li { width: 100%; }
  nav.main-nav li a { border-radius: 0; padding: 12px 20px; }
  .site-header .container { position: relative; flex-wrap: wrap; }
  .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .site-footer .footer-grid { grid-template-columns: 1fr; }
  .topbar .topbar-info span { display: block; margin: 2px 0; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: 360px; padding: 50px 18px; }
  .hero h2 { font-size: 1.7rem; }
}
