/* ============================================================
   SISTEMA DE DISEÑO — DDE ATLACOMULCO
   Paleta institucional + identidad visual municipal
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables ── */
:root {
  /* Colores institucionales */
  --azul:        #1B3A6B;
  --azul-mid:    #254d8f;
  --azul-light:  #3a6fbd;
  --oro:         #C8960C;
  --oro-light:   #f0b429;
  --oro-pale:    #fdf3d8;
  --acento:      #e8f4fd;
  --verde:       #2d6a4f;
  --verde-light: #40916c;
  --blanco:      #FAFAF8;
  --gris-100:    #F4F4F0;
  --gris-200:    #E8E8E2;
  --gris-400:    #9A9A90;
  --gris-700:    #4A4A42;
  --negro:       #0F1923;

  /* Tipografía */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', monospace;

  /* Espaciado */
  --gap-xs:  0.4rem;
  --gap-sm:  0.8rem;
  --gap-md:  1.6rem;
  --gap-lg:  3.2rem;
  --gap-xl:  6.4rem;

  /* Radio */
  --r-sm:  6px;
  --r-md:  14px;
  --r-lg:  28px;
  --r-pill:100px;

  /* Sombras */
  --sombra-sm:  0 2px 8px rgba(27,58,107,.08);
  --sombra-md:  0 6px 24px rgba(27,58,107,.12);
  --sombra-lg:  0 16px 48px rgba(27,58,107,.18);
  --sombra-oro: 0 4px 20px rgba(200,150,12,.25);

  /* Transiciones */
  --t-fast:   .15s ease;
  --t-mid:    .3s ease;
  --t-slow:   .5s ease;

  /* Layout */
  --max-w:    1280px;
  --nav-h:    72px;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--blanco);
  color: var(--negro);
  line-height: 1.65;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Tipografía ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--azul);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.8rem); font-weight: 600; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.7rem); font-weight: 600; }
h4 { font-size: 1.1rem; font-weight: 600; }
p  { color: var(--gris-700); font-size: 1rem; }

.lead {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--gris-700);
  line-height: 1.7;
}

/* ── Layout helpers ── */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gap-md);
}

.section {
  padding: var(--gap-xl) 0;
}

.section--alt {
  background: var(--gris-100);
}

.section__header {
  text-align: center;
  margin-bottom: var(--gap-lg);
}

.section__eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--oro);
  background: var(--oro-pale);
  padding: .25em .9em;
  border-radius: var(--r-pill);
  margin-bottom: var(--gap-sm);
}

.section__title { margin-bottom: .5rem; }
.section__sub   { max-width: 540px; margin: 0 auto; }

/* ── Botones ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.6rem;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-size: .95rem;
  transition: all var(--t-mid);
  white-space: nowrap;
}

.btn--primary {
  background: var(--azul);
  color: #fff;
  box-shadow: var(--sombra-md);
}
.btn--primary:hover {
  background: var(--azul-mid);
  transform: translateY(-2px);
  box-shadow: var(--sombra-lg);
}

.btn--gold {
  background: var(--oro);
  color: #fff;
  box-shadow: var(--sombra-oro);
}
.btn--gold:hover {
  background: var(--oro-light);
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  color: var(--azul);
  border: 2px solid var(--azul);
}
.btn--outline:hover {
  background: var(--azul);
  color: #fff;
}

.btn--ghost {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.4);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  background: rgba(255,255,255,.25);
}

.btn--sm {
  padding: .45rem 1rem;
  font-size: .85rem;
}

.btn--lg {
  padding: 1rem 2.2rem;
  font-size: 1.05rem;
}

/* ── Cards ── */
.card {
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--sombra-sm);
  overflow: hidden;
  transition: all var(--t-mid);
}
.card:hover {
  box-shadow: var(--sombra-lg);
  transform: translateY(-4px);
}

.card__img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card__body {
  padding: var(--gap-md);
}

.card__tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--azul-light);
  background: var(--acento, #e8f4fd);
  padding: .2em .8em;
  border-radius: var(--r-pill);
  margin-bottom: var(--gap-sm);
}

.card__title {
  font-size: 1.1rem;
  margin-bottom: .5rem;
  color: var(--azul);
}

.card__meta {
  font-size: .82rem;
  color: var(--gris-400);
  font-family: var(--font-mono);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2em .7em;
  border-radius: var(--r-pill);
  font-size: .78rem;
  font-weight: 600;
}
.badge--green { background: #d4edda; color: #155724; }
.badge--blue  { background: #cce5ff; color: #004085; }
.badge--gold  { background: var(--oro-pale); color: var(--oro); }

/* ── Grids ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-md); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }

/* ── Flex ── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.gap-sm      { gap: var(--gap-sm); }
.gap-md      { gap: var(--gap-md); }

/* ── Separador decorativo ── */
.divider {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--oro), var(--oro-light));
  border-radius: 2px;
  margin: .75rem auto 0;
}
.divider--left { margin-left: 0; }

/* ── Pill de categoría ── */
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3em 1em;
  border-radius: var(--r-pill);
  font-size: .78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Formularios ── */
.form-group { margin-bottom: var(--gap-md); }
.form-label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: .4rem; color: var(--azul); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--gris-200);
  border-radius: var(--r-sm);
  font-size: .95rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  background: #fff;
  color: var(--negro);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--azul-light);
  box-shadow: 0 0 0 3px rgba(58,111,189,.15);
}
.form-textarea { resize: vertical; min-height: 100px; }

/* ── Alert / Notice ── */
.alert {
  padding: var(--gap-sm) var(--gap-md);
  border-radius: var(--r-sm);
  font-size: .9rem;
  border-left: 4px solid;
}
.alert--info    { background: #e8f4fd; border-color: var(--azul-light); color: var(--azul); }
.alert--warning { background: var(--oro-pale); border-color: var(--oro); color: #7a5800; }
.alert--success { background: #d4edda; border-color: var(--verde); color: var(--verde); }

/* ── Skip link accesibilidad ── */
.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  background: var(--azul);
  color: #fff;
  padding: .5rem 1rem;
  z-index: 9999;
  border-radius: 0 0 var(--r-sm) 0;
}
.skip-link:focus { top: 0; }

/* ── Visually hidden ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  border: 0;
}

/* ── Animaciones de entrada ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.anim-fade-up  { animation: fadeUp  .6s ease both; }
.anim-fade-in  { animation: fadeIn  .5s ease both; }
.anim-slide-l  { animation: slideLeft .6s ease both; }

.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.delay-4 { animation-delay: .4s; }
.delay-5 { animation-delay: .5s; }

/* ── Observador de intersección (JS la activa) ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Barra de accesibilidad ── */
.acc-bar {
  background: var(--negro);
  color: var(--gris-200);
  font-size: .78rem;
  padding: .4rem 0;
  font-family: var(--font-mono);
}
.acc-bar .container { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-sm); flex-wrap: wrap; }
.acc-bar__left, .acc-bar__right { display: flex; align-items: center; gap: var(--gap-sm); }
.acc-btn {
  background: rgba(255,255,255,.1);
  color: var(--gris-200);
  border: 1px solid rgba(255,255,255,.2);
  padding: .15em .6em;
  border-radius: 3px;
  font-size: .78rem;
  cursor: pointer;
  transition: background var(--t-fast);
}
.acc-btn:hover { background: rgba(255,255,255,.2); }

/* ── Topbar institucional ── */
.topbar {
  background: var(--azul);
  color: rgba(255,255,255,.85);
  font-size: .8rem;
  padding: .5rem 0;
  font-family: var(--font-mono);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-sm); flex-wrap: wrap; }
.topbar__left, .topbar__right { display: flex; align-items: center; gap: var(--gap-md); }
.topbar a { color: rgba(255,255,255,.85); transition: color var(--t-fast); }
.topbar a:hover { color: var(--oro-light); }
.topbar__item { display: flex; align-items: center; gap: .4rem; }
.topbar__sep { color: rgba(255,255,255,.3); }

/* ── Navbar ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 900;
  background: #fff;
  box-shadow: 0 2px 16px rgba(27,58,107,.1);
  height: var(--nav-h);
  transition: box-shadow var(--t-mid);
}
.navbar.scrolled { box-shadow: 0 4px 24px rgba(27,58,107,.18); }

.navbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
}

.navbar__brand {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar__logo-wrap {
  width: 46px;
  height: 46px;
  background: var(--azul);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.navbar__brand-text { line-height: 1.1; }
.navbar__brand-top {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--azul);
  display: block;
}
.navbar__brand-sub {
  font-family: var(--font-mono);
  font-size: .68rem;
  color: var(--gris-400);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.navbar__nav {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.nav-link {
  position: relative;
  padding: .5rem .75rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--gris-700);
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--azul);
  background: var(--gris-100);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 20px; height: 3px;
  background: var(--oro);
  border-radius: 2px;
}

/* Dropdown */
.nav-item { position: relative; }
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--sombra-lg);
  min-width: 220px;
  opacity: 0;
  pointer-events: none;
  transition: all var(--t-mid);
  border: 1px solid var(--gris-200);
  padding: .5rem 0;
  z-index: 100;
}
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  pointer-events: all;
  transform: translateX(-50%) translateY(0);
}

.dropdown__link {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem 1.2rem;
  font-size: .88rem;
  color: var(--gris-700);
  transition: background var(--t-fast), color var(--t-fast);
}
.dropdown__link:hover {
  background: var(--gris-100);
  color: var(--azul);
}
.dropdown__link span { font-size: 1rem; }

.navbar__actions {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

/* Búsqueda en navbar */
.navbar__search {
  position: relative;
}
.navbar__search-input {
  padding: .45rem 2.2rem .45rem .9rem;
  border: 1.5px solid var(--gris-200);
  border-radius: var(--r-pill);
  font-size: .85rem;
  width: 0;
  opacity: 0;
  transition: all var(--t-mid);
  pointer-events: none;
}
.navbar__search.open .navbar__search-input {
  width: 200px;
  opacity: 1;
  pointer-events: all;
}
.navbar__search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gris-400);
  cursor: pointer;
  padding: .2rem;
  font-size: 1rem;
  transition: color var(--t-fast);
}
.navbar__search-btn:hover { color: var(--azul); }

/* Hamburger */
.navbar__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: .4rem;
  cursor: pointer;
}
.navbar__hamburger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--azul);
  border-radius: 2px;
  transition: all var(--t-mid);
}

/* Footer */
.footer {
  background: var(--negro);
  color: rgba(255,255,255,.7);
  padding: var(--gap-xl) 0 0;
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--gap-lg);
  padding-bottom: var(--gap-lg);
}
.footer__logo-wrap {
  width: 52px; height: 52px;
  background: var(--azul);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  margin-bottom: var(--gap-md);
}
.footer__brand-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: .25rem;
}
.footer__brand-sub {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(255,255,255,.4);
}
.footer__desc {
  font-size: .88rem;
  line-height: 1.7;
  color: rgba(255,255,255,.55);
  margin-top: var(--gap-md);
}
.footer__col-title {
  font-family: var(--font-display);
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: var(--gap-md);
  padding-bottom: .5rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.footer__links { display: flex; flex-direction: column; gap: .6rem; }
.footer__link {
  font-size: .85rem;
  color: rgba(255,255,255,.55);
  transition: color var(--t-fast);
  display: flex; align-items: center; gap: .4rem;
}
.footer__link:hover { color: var(--oro-light); }
.footer__contact-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: var(--gap-sm);
  font-size: .85rem;
  color: rgba(255,255,255,.55);
}
.footer__contact-icon {
  flex-shrink: 0;
  color: var(--oro);
  font-size: 1rem;
  margin-top: .1rem;
}
.footer__social {
  display: flex;
  gap: var(--gap-sm);
  margin-top: var(--gap-md);
}
.footer__social-link {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: rgba(255,255,255,.6);
  transition: all var(--t-mid);
}
.footer__social-link:hover {
  background: var(--oro);
  color: #fff;
  transform: translateY(-2px);
}
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: var(--gap-md) 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  font-size: .78rem;
  color: rgba(255,255,255,.35);
  font-family: var(--font-mono);
}
.footer__bottom a { color: rgba(255,255,255,.45); transition: color var(--t-fast); }
.footer__bottom a:hover { color: var(--oro-light); }

/* WhatsApp flotante */
.wa-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
}
.wa-float__btn {
  width: 56px; height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,.45);
  font-size: 1.7rem;
  color: #fff;
  transition: all var(--t-mid);
  animation: waPulse 2s infinite;
}
.wa-float__btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(37,211,102,.6);
}
@keyframes waPulse {
  0%,100% { box-shadow: 0 4px 20px rgba(37,211,102,.45); }
  50%      { box-shadow: 0 4px 32px rgba(37,211,102,.7); }
}
.wa-float__label {
  background: var(--negro);
  color: #fff;
  font-size: .78rem;
  padding: .3em .8em;
  border-radius: var(--r-pill);
  opacity: 0;
  transform: translateX(8px);
  transition: all var(--t-mid);
  pointer-events: none;
}
.wa-float:hover .wa-float__label {
  opacity: 1;
  transform: translateX(0);
}

/* ── Accesibilidad: alto contraste ── */
body.alto-contraste {
  filter: contrast(1.5) grayscale(0.1);
}
body.fuente-grande { font-size: 18px; }
body.fuente-grande h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); }
