/* ===========================
   CEIP AGUERE – ESTILOS GLOBALES
   =========================== */

:root {
  --primary: #1a6b3a;
  --primary-light: #2e9958;
  --accent: #f5a623;
  --accent2: #e74c3c;
  --dark: #1a2332;
  --dark2: #253045;
  --text: #2d3748;
  --text-muted: #718096;
  --bg: #f7f9fc;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.14);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Nunito', sans-serif;
  --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 80px 0; }
.section-gray { background: #eef2f7; }
.section-dark { background: var(--dark); color: var(--white); }

.section-header { text-align: center; margin-bottom: 52px; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--dark);
  line-height: 1.2;
}
.section-header.light h2 { color: var(--white); }
.section-label {
  display: inline-block;
  background: var(--accent);
  color: var(--dark);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.center-btn { text-align: center; margin-top: 44px; }

/* ===========================
   TOPBAR
   =========================== */
.topbar {
  background: var(--dark);
  color: rgba(255,255,255,0.7);
  font-size: 0.82rem;
  padding: 8px 24px;
  display: flex;
  gap: 28px;
  justify-content: center;
  flex-wrap: wrap;
}
.topbar span { display: flex; align-items: center; gap: 6px; }

/* ===========================
   HEADER
   =========================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo { display: flex; align-items: center; gap: 14px; }
.logo-icon { font-size: 2rem; }
.logo-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  display: block;
}
.logo-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  display: block;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: rgba(26,107,58,0.08);
}
.nav-cta {
  background: var(--primary);
  color: var(--white) !important;
  margin-left: 8px;
}
.nav-cta:hover { background: var(--primary-light); }

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--primary);
}

/* ===========================
   HERO
   =========================== */
   
/* Logo decorativo en el hero */
.hero-logo-deco {
  position: absolute;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: clamp(260px, 30vw, 420px);
  opacity: 0.92;
  filter: drop-shadow(0 8px 32px rgba(0,0,0,0.25));
  animation: floatLogo 5s ease-in-out infinite;
}

.hero-logo-deco img {
  width: 100%;
  height: auto;
  display: block;
}

@keyframes floatLogo {
  0%, 100% { transform: translateY(-50%) translateY(0px); }
  50%       { transform: translateY(-50%) translateY(-12px); }
}

/* Ocultar las shapes genéricas para no competir con el logo */
.hero-shapes { display: none; }

/* En móvil, el logo baja debajo del texto */
@media (max-width: 768px) {
  .hero-logo-deco {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    width: 180px;
    margin: 32px auto 0;
    animation: none;
  }
  .hero { flex-direction: column; align-items: center; padding-bottom: 40px; }
}
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, #0d3b22 0%, #1a6b3a 60%, #2e9958 100%);
}
.hero-bg {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 70% 30%, rgba(245,166,35,0.2) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(255,255,255,0.06) 0%, transparent 40%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 60px 48px;
  max-width: 640px;
}
.hero-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 900;
  color: var(--white);
  line-height: 0.9;
  margin-bottom: 28px;
}
.hero-title span { color: var(--accent); }
.hero-desc {
  color: rgba(255,255,255,0.82);
  font-size: 1.15rem;
  margin-bottom: 40px;
  max-width: 480px;
}
.hero-btns { display: flex; gap: 16px; flex-wrap: wrap; }

/* Shapes decorativas */
.hero-shapes { position: absolute; right: 0; top: 0; bottom: 0; width: 50%; pointer-events: none; }
.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
}
.shape1 { width: 500px; height: 500px; background: var(--accent); top: -100px; right: -80px; }
.shape2 { width: 300px; height: 300px; background: white; bottom: 40px; right: 120px; }
.shape3 { width: 180px; height: 180px; background: var(--accent); top: 50%; right: 340px; }

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--accent);
  color: var(--dark);
}
.btn-primary:hover { background: #e8941a; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,166,35,0.4); }
.btn-outline {
  border-color: rgba(255,255,255,0.6);
  color: var(--white);
}
.btn-outline:hover { border-color: var(--white); background: rgba(255,255,255,0.1); }
.btn-outline-white {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-outline-white:hover { background: var(--accent); color: var(--dark); }
.btn-green {
  background: var(--primary);
  color: var(--white);
}
.btn-green:hover { background: var(--primary-light); }

/* ===========================
   STATS
   =========================== */
.stats {
  background: var(--primary);
  padding: 40px 0;
}
.stats .container {
  display: flex;
  justify-content: space-around;
  gap: 24px;
  flex-wrap: wrap;
}
.stat-item { text-align: center; color: var(--white); }
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--accent);
}
.stat-label { font-size: 0.9rem; opacity: 0.85; font-weight: 600; }

/* ===========================
   CARDS ETAPAS
   =========================== */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.card {
  padding: 36px 28px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--white);
  transition: var(--transition);
  border-top: 5px solid transparent;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.card-green { border-top-color: #66bb6a; }
.card-blue { border-top-color: #42a5f5; }
.card-orange { border-top-color: var(--accent); }
.card-icon { font-size: 2.4rem; margin-bottom: 16px; }
.card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 10px;
  color: var(--dark);
}
.card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 18px; }
.card-link { color: var(--primary); font-weight: 700; font-size: 0.9rem; }
.card-link:hover { text-decoration: underline; }

/* ===========================
   NOTICIAS
   =========================== */
.news-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 22px;
}
.news-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.news-featured { grid-row: span 2; }
.news-img {
  height: 180px;
  flex-shrink: 0;
}
.news-featured .news-img { height: 260px; }
.news-body { padding: 22px 24px; flex: 1; display: flex; flex-direction: column; }
.news-date { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.news-body h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 8px 0 10px;
  color: var(--dark);
}
.news-body p { color: var(--text-muted); font-size: 0.9rem; flex: 1; }
.news-link { color: var(--primary); font-weight: 700; font-size: 0.88rem; margin-top: 14px; display: inline-block; }
.news-link:hover { text-decoration: underline; }

/* ===========================
   SERVICIOS
   =========================== */
.servicios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.servicio-item {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: block;
  color: var(--text);
}
.servicio-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); background: var(--primary); color: var(--white); }
.servicio-item:hover h4 { color: var(--white); }
.servicio-item:hover p { color: rgba(255,255,255,0.8); }
.servicio-icon { font-size: 2.2rem; display: block; margin-bottom: 14px; }
.servicio-item h4 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: var(--dark); }
.servicio-item p { font-size: 0.88rem; color: var(--text-muted); }

/* ===========================
   PROYECTOS
   =========================== */
.proyectos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.proyecto-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 28px 22px;
  transition: var(--transition);
}
.proyecto-card:hover { background: rgba(255,255,255,0.12); transform: translateY(-4px); }
.proyecto-tag {
  display: inline-block;
  background: var(--accent);
  color: var(--dark);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.proyecto-card h4 { color: var(--white); font-size: 1.05rem; margin-bottom: 10px; }
.proyecto-card p { color: rgba(255,255,255,0.65); font-size: 0.88rem; }

/* ===========================
   FOOTER
   =========================== */
.footer {
  background: var(--dark2);
  color: rgba(255,255,255,0.75);
  padding-top: 64px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--white);
  margin-bottom: 14px;
}
.footer-col p { font-size: 0.88rem; margin-bottom: 8px; }
.footer-col h5 { color: var(--white); font-size: 0.92rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 16px; }
.footer-col a { display: block; font-size: 0.88rem; color: rgba(255,255,255,0.65); margin-bottom: 8px; transition: var(--transition); }
.footer-col a:hover { color: var(--accent); padding-left: 4px; }

.social-links { display: flex; gap: 10px; margin-top: 16px; }
.social-link {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.7);
  transition: var(--transition);
}
.social-link:hover { border-color: var(--accent); color: var(--accent); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 20px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
  .cards-grid, .servicios-grid { grid-template-columns: repeat(2, 1fr); }
  .proyectos-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .news-featured { grid-column: span 2; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .topbar { display: none; }
  .hamburger { display: block; }
  .nav {
    display: none;
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    z-index: 999;
  }
  .nav.open { display: flex; }
  .nav-link { width: 100%; padding: 14px 16px; }
  .header-inner { padding: 12px 20px; }
  .hero-content { padding: 40px 24px; }
  .hero-title { font-size: 3.5rem; }
  .hero-shapes { display: none; }
  .cards-grid, .servicios-grid { grid-template-columns: 1fr; }
  .proyectos-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }
  .news-featured { grid-column: span 1; }
  .footer-inner { grid-template-columns: 1fr; }
  .section-header h2 { font-size: 1.8rem; }
  .stats .container { gap: 32px; }
}

/* ===========================
   PÁGINA INTERNA – HERO PEQUEÑO
   =========================== */
.page-hero {
  background: linear-gradient(135deg, #0d3b22, #1a6b3a);
  padding: 80px 24px;
  text-align: center;
  color: var(--white);
}
.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
}
.page-hero p { font-size: 1.1rem; color: rgba(255,255,255,0.8); margin-top: 12px; }
.breadcrumb { font-size: 0.82rem; color: rgba(255,255,255,0.55); margin-bottom: 12px; }
.breadcrumb a { color: var(--accent); }

/* ===========================
   ACORDEÓN FAQ
   =========================== */
.accordion { max-width: 800px; margin: 0 auto; }
.accordion-item { border-bottom: 1px solid #e2e8f0; }
.accordion-btn {
  width: 100%; text-align: left; background: none; border: none;
  padding: 20px 0; font-size: 1rem; font-weight: 700; cursor: pointer;
  color: var(--dark); display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-body);
}
.accordion-btn::after { content: '+'; font-size: 1.4rem; color: var(--primary); }
.accordion-btn.open::after { content: '−'; }
.accordion-body { display: none; padding: 0 0 18px; color: var(--text-muted); font-size: 0.95rem; }
.accordion-body.open { display: block; }

/* ===========================
   FORMULARIO CONTACTO
   =========================== */
.contact-form {
  max-width: 640px;
  margin: 0 auto;
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-group { margin-bottom: 22px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
  background: var(--bg);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-group textarea { min-height: 140px; resize: vertical; }

/* TABLE */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
thead { background: var(--primary); color: white; }
th, td { padding: 14px 18px; text-align: left; border-bottom: 1px solid #e2e8f0; }
tr:nth-child(even) { background: #f0f4f8; }
tr:hover { background: #e6f0ea; }

/* ANIMATION */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
