/* ==========================================================================
   Instituto Juan Bosco - Estilos institucionales
   Paleta extraída del logo: azul marino + rojo carmesí
   ========================================================================== */

:root {
  --navy: #1B1F52;
  --navy-dark: #12153A;
  --navy-light: #2B316F;
  --red: #A81F31;
  --red-dark: #7C1624;
  --red-light: #C6394B;
  --cream: #FDFBF7;
  --gray-light: #F4F5F9;
  --gray-mid: #E4E6EE;
  --text-dark: #202333;
  --text-muted: #5B5F73;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(27, 31, 82, 0.10);
  --shadow-lg: 0 20px 45px rgba(27, 31, 82, 0.18);
  --transition: all 0.25s ease;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Nunito Sans', 'Segoe UI', sans-serif;
  color: var(--text-dark);
  background: var(--cream);
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  color: var(--navy);
  margin: 0 0 0.6em;
  line-height: 1.25;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

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

.section { padding: 80px 0; }
.section-alt { background: var(--gray-light); }
.section-header { text-align: center; max-width: 680px; margin: 0 auto 50px; }
.eyebrow {
  display: inline-block;
  color: var(--red);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  margin-bottom: 10px;
}
.section-header h2 { font-size: 2.1rem; }
.section-header p { color: var(--text-muted); font-size: 1.05rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; border-color: #fff; color: #fff; }
.btn-outline:hover { background: #fff; color: var(--navy); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-dark); transform: translateY(-2px); }
.btn-block { width: 100%; justify-content: center; }

/* ============ Top bar ============ */
.topbar {
  background: var(--navy-dark);
  color: #cfd2ec;
  font-size: 0.85rem;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.topbar a { color: #cfd2ec; }
.topbar span { display: inline-flex; align-items: center; gap: 6px; }

/* ============ Header / Nav ============ */
.site-header {
  background: #fff;
  box-shadow: 0 2px 15px rgba(0,0,0,0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}
.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: 12px; }
.brand img { height: 56px; width: auto; }
.brand-name { font-family: 'Poppins', sans-serif; font-weight: 800; color: var(--navy); font-size: 1.15rem; line-height: 1.1; }
.brand-name small { display: block; color: var(--red); font-weight: 600; font-size: 0.7rem; letter-spacing: 1px; }

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 10px 16px;
  font-weight: 600;
  color: var(--navy);
  border-radius: 8px;
  transition: var(--transition);
  font-size: 0.95rem;
}
.nav-links a:hover { background: var(--gray-light); color: var(--red); }
.nav-cta { margin-left: 10px; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 26px; height: 3px; background: var(--navy); border-radius: 2px; }

/* ============ Hero ============ */
.hero {
  position: relative;
  min-height: 640px;
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  color: #fff;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(18,21,58,0.92) 10%, rgba(27,31,82,0.75) 55%, rgba(168,31,49,0.55) 100%);
}
.hero .container { position: relative; z-index: 2; }
.hero-content { max-width: 620px; }
.hero-content .eyebrow { color: #FFD166; }
.hero-content h1 { color: #fff; font-size: 3rem; margin-bottom: 20px; }
.hero-content p { font-size: 1.15rem; color: #e7e8f5; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ============ About ============ */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-photo { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); position: relative; }
.about-photo::after {
  content: "";
  position: absolute; inset: 0;
  border: 6px solid var(--red);
  border-radius: var(--radius);
  transform: translate(16px, 16px);
  z-index: -1;
}
.about-text .lead { font-size: 1.2rem; font-weight: 700; color: var(--navy); margin-bottom: 18px; }
.about-text p { color: var(--text-muted); }

/* ============ Features / servicios ============ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 26px;
}
.feature-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 26px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  border-top: 4px solid var(--navy);
}
.feature-card:nth-child(4n+2) { border-top-color: var(--red); }
.feature-card:nth-child(4n+3) { border-top-color: #FFB100; }
.feature-card:nth-child(4n+4) { border-top-color: var(--navy-light); }
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--gray-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 18px;
}
.feature-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 0.92rem; margin: 0; }

/* ============ Courses ============ */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}
.course-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.course-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.course-card .thumb { height: 190px; overflow: hidden; }
.course-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.course-card:hover .thumb img { transform: scale(1.08); }
.course-card .body { padding: 22px 24px 26px; }
.course-card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.course-card p { color: var(--text-muted); font-size: 0.9rem; margin: 0; }
.course-tag {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============ Teachers ============ */
.teachers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 30px;
}
.teacher-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  text-align: center;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.teacher-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.teacher-card .photo { height: 240px; overflow: hidden; }
.teacher-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.teacher-card .body { padding: 22px 18px 28px; }
.teacher-card h3 { font-size: 1.05rem; margin-bottom: 4px; }
.teacher-card .role { color: var(--red); font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.teacher-card .exp { color: var(--text-muted); font-size: 0.85rem; }

/* ============ Gallery ============ */
.gallery-filters { display: flex; justify-content: center; gap: 10px; margin-bottom: 36px; flex-wrap: wrap; }
.gallery-filters button {
  border: 2px solid var(--navy);
  background: transparent;
  color: var(--navy);
  padding: 9px 22px;
  border-radius: 50px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.88rem;
}
.gallery-filters button.active,
.gallery-filters button:hover { background: var(--navy); color: #fff; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  aspect-ratio: 4/3;
  position: relative;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.gallery-item:hover img { transform: scale(1.1); }

/* ============ Hours + Appointment ============ */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.hours-card {
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 40px;
}
.hours-card h3 { color: #fff; }
.hours-row { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,0.15); }
.hours-row:last-child { border-bottom: none; }
.hours-row span:first-child { font-weight: 600; }
.hours-row span:last-child { color: #FFD166; font-weight: 700; }

.appointment-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9rem; color: var(--navy); }
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 2px solid var(--gray-mid);
  font-family: inherit;
  font-size: 0.95rem;
  transition: var(--transition);
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--red); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.alert { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 0.92rem; }
.alert-success { background: #e6f6ec; color: #1a7f4e; border: 1px solid #b7e4c7; }
.alert-error { background: #fdeaea; color: var(--red-dark); border: 1px solid #f4bcbc; }

/* ============ Footer ============ */
.site-footer { background: var(--navy-dark); color: #b9bbdb; padding: 60px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-grid h4 { color: #fff; font-size: 1rem; margin-bottom: 18px; }
.footer-grid p, .footer-grid a { color: #b9bbdb; font-size: 0.9rem; }
.footer-grid ul li { margin-bottom: 10px; }
.footer-grid a:hover { color: #fff; }
.social-row { display: flex; gap: 12px; margin-top: 16px; }
.social-row a {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.social-row a:hover { background: var(--red); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 22px; text-align: center; font-size: 0.82rem; color: #8b8ec0; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .about-grid, .two-col { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-content h1 { font-size: 2.2rem; }
}
@media (max-width: 760px) {
  .nav-links { position: fixed; top: 80px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 16px; box-shadow: 0 10px 20px rgba(0,0,0,0.08); transform: translateY(-150%); opacity: 0; transition: var(--transition); }
  .nav-links.open { transform: translateY(0); opacity: 1; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .topbar .container { justify-content: center; text-align: center; }
}
