/* ============================================================
   HUEJOTZINGO ONEPAGE 2025–2028
   Estilos finales responsivos y modo oscuro adaptativo
   ============================================================ */

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Noto Sans', sans-serif;
  line-height: 1.6;
  color: #333;
  background: #fff;
  overflow-x: hidden;
  transition: background .4s, color .4s;
}

/* ===== VARIABLES ===== */
:root {
  --vino: #8B1E25;
  --vino-2: #A12A32;
  --dorado: #D4AF37;
  --gris: #F7F7F7;
  --texto: #333;
  --blanco: #fff;
  --sombra: rgba(0,0,0,0.08);
}

/* ===== MODO OSCURO AUTOMÁTICO ===== */
@media (prefers-color-scheme: dark) {
  body { background: #111; color: #ddd; }
  .navbar { background: rgba(20,20,20,0.9); border-bottom-color: rgba(255,255,255,0.1); }
  .nav-links a { color: var(--dorado); }
  .nav-links a:hover, .nav-links a.active { color: #fff; }
  .section { background: #1a1a1a; color: #ddd; }
  .section.alt { background: #141414; }
  .valor-card, .mv-card, .eje-card, .modal-content {
    background: #1c1c1c; color: #eee;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
  }
  .footer { background: #000; color: #aaa; }
  #btnSubir { background: var(--dorado); color: #000; }
}

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  z-index: 999;
  transition: box-shadow .3s ease;
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: .7rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo { height: 42px; width: auto; transition: transform .3s ease; }
.nav-logo:hover { transform: scale(1.05); }
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.2rem;
}
.nav-links a {
  text-decoration: none;
  font-weight: 600;
  color: var(--vino);
  transition: color .3s;
}
.nav-links a:hover, .nav-links a.active { color: #111; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--vino);
}
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed;
    top: 70px;
    right: 0;
    width: 80vw;
    height: calc(100vh - 70px);
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateX(100%);
    transition: transform .35s ease;
    box-shadow: -5px 0 25px rgba(0,0,0,0.1);
  }
  .nav-links.open { transform: translateX(0); }
}

/* ============================================================
   HERO RESPONSIVO Y COMPATIBLE CON SAFARI
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5), rgba(0,0,0,0.4)),
              url('../img/hero.jpg') center center / cover no-repeat;
  transition: background-size 1s ease, filter 1s ease;
}

/* Efecto cinematográfico sólo en pantallas grandes */
@media (min-width: 1025px) {
  .hero {
    background-size: 105%;
  }
  .hero:hover {
    background-size: 110%;
    filter: brightness(1.05);
  }
}

/* Evitar repeticiones y saltos en móviles */
@media (max-width: 1024px) {
  .hero {
    background-attachment: scroll !important;
    background-size: cover;
    background-position: center top;
  }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 90%;
  animation: fadeInHero 1.8s ease forwards;
}

@keyframes fadeInHero {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-logo {
  width: clamp(200px, 50vw, 320px);
  margin-bottom: 1rem;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInLogo 2s ease forwards;
}

@keyframes fadeInLogo {
  to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
  font-family: 'Poppins', sans-serif;
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: 1.5px;
  margin-bottom: 0.8rem;
}

.hero p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

/* ============================================================
   BOTONES
   ============================================================ */
.cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  padding: .9rem 1.4rem;
  font-weight: 700;
  border-radius: 8px;
  transition: all .3s ease;
}
.btn-primary {
  background: var(--vino);
  color: #fff;
  box-shadow: 0 6px 14px rgba(139,30,37,.25);
}
.btn-primary:hover { background: var(--vino-2); }
.btn-ghost {
  border: 2px solid var(--dorado);
  color: var(--dorado);
}
.btn-ghost:hover { background: rgba(212,175,55,0.1); }

/* ============================================================
   SECCIONES
   ============================================================ */
.section {
  padding: 5rem 1rem;
  text-align: center;
  background: var(--blanco);
}
.section.alt { background: var(--gris); }
.section h2 {
  font-family: 'Poppins', sans-serif;
  color: var(--vino);
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  margin-bottom: 1rem;
}

/* ============================================================
   MENSAJE PRESIDENTE
   ============================================================ */
.mensaje {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 1.5rem;
}
.portrait {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}
.quote { font-size: 1.1rem; font-style: italic; }
.quote cite {
  display: block;
  margin-top: .5rem;
  font-weight: 700;
  color: var(--vino);
}
@media (max-width: 700px) {
  .mensaje { grid-template-columns: 1fr; text-align: center; }
  .portrait { margin: 0 auto; }
}

/* ============================================================
   MISIÓN / VISIÓN
   ============================================================ */
.mv-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 2rem;
}
.mv-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 25px var(--sombra);
  padding: 2rem;
  text-align: left;
  transition: transform .4s ease, box-shadow .4s ease;
}
.mv-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}
.mv-card i {
  font-size: 2rem;
  color: var(--dorado);
  margin-bottom: .5rem;
  display: block;
}
.mv-card h3 {
  font-family: 'Poppins', sans-serif;
  color: var(--vino);
  margin-bottom: 1rem;
}

/* ============================================================
   VALORES
   ============================================================ */
#valores {
  position: relative;
  background-color: #f9f9f9;
  text-align: center;
  color: #333;
}
.valores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}
.valor-card {
  background: #fff;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 320px;
}
.valor-card i {
  font-size: 2.6rem;
  color: var(--dorado);
  margin-bottom: 1rem;
}
.valor-card h3 {
  font-family: 'Poppins', sans-serif;
  color: var(--vino);
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
}
.valor-card p {
  color: #444;
  font-size: .97rem;
  text-align: justify;
  text-align-last: center;
}

/* ============================================================
   EJES ESTRATÉGICOS
   ============================================================ */
#ejes { background: var(--gris); }
.ejes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.8rem;
  max-width: 1100px;
  margin: 0 auto;
}
.eje-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 15px rgba(0,0,0,0.08);
  transition: transform .3s, box-shadow .3s;
  cursor: pointer;
}
.eje-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.15); }
.eje-img {
  width: 100%;
  height: 340px;
  object-fit: cover;
}
.eje-content { padding: 1rem; }
.eje-content h3 { color: #000; font-family: 'Poppins'; font-size: 1.05rem; }

/* ============================================================
   FLIPBOOK FLOWPAPER
   ============================================================ */
.flipbook-wrapper {
  max-width: 1100px;
  margin: 3rem auto;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  height: 85vh;
}
.fp-embed { width: 100%; height: 100%; display: block; }
@media (max-width: 768px) { .flipbook-wrapper { height: 70vh; } }

/* ============================================================
   CONTACTO / FOOTER
   ============================================================ */
.social { display: flex; justify-content: center; gap: 1rem; margin-top: 1rem; }
.social a { color: var(--vino); font-size: 1.3rem; transition: color .3s; }
.social a:hover { color: #111; }
.footer { background: #111; color: #ddd; text-align: center; padding: 1rem; }

/* ============================================================
   MODALES
   ============================================================ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}
.modal-content {
  background: #fff;
  border-radius: 10px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  position: relative;
}
.close {
  position: absolute;
  top: 10px; right: 15px;
  font-size: 1.4rem;
  color: var(--vino);
  border: none; background: none;
  cursor: pointer;
}

/* ============================================================
   BOTÓN FLOTANTE
   ============================================================ */
#btnSubir {
  position: fixed;
  bottom: 25px; right: 25px;
  width: 50px; height: 50px;
  border: none;
  border-radius: 50%;
  background: var(--vino);
  color: #fff;
  font-size: 1.3rem;
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
  cursor: pointer;
  display: none;
  z-index: 2000;
  justify-content: center; align-items: center;
  transition: all 0.3s ease;
}
#btnSubir.show { display: flex; animation: fadeInUp .4s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
#btnSubir:hover { background: var(--vino-2); transform: translateY(-4px); }

/* ============================================================
   RESPONSIVE AJUSTES EXTRA
   ============================================================ */
@media (max-width: 480px) {
  .hero h1 { font-size: 1.9rem; }
  .btn { padding: .8rem 1.2rem; font-size: .9rem; }
  .valor-card, .eje-card { min-height: auto; }
  .eje-img { height: 260px; }
}
