/* Identidad visual replicada de chiapas.microcuencas.org — misma paleta y layout para toda la red de microcuencas.org */

:root {
  --overlay-1: rgba(30, 58, 138, 0.8);   /* blue-900/80 */
  --overlay-2: rgba(20, 83, 45, 0.7);    /* green-900/70 */
  --overlay-3: rgba(30, 64, 175, 0.9);   /* blue-800/90 */

  --text-grad-1: rgb(96, 165, 250);      /* blue-400 */
  --text-grad-2: rgb(74, 222, 128);      /* green-400 */

  --pink-1: rgb(219, 39, 119);
  --pink-2: rgb(190, 24, 93);
  --pink-glow-1: rgb(236, 72, 153);
  --pink-glow-2: rgb(219, 39, 119);

  --purple-1: rgb(147, 51, 234);
  --purple-2: rgb(126, 34, 206);
  --purple-glow-1: rgb(168, 85, 247);
  --purple-glow-2: rgb(147, 51, 234);

  --cyan-1: rgb(8, 145, 178);
  --cyan-2: rgb(14, 116, 144);
  --cyan-glow-1: rgb(6, 182, 212);
  --cyan-glow-2: rgb(8, 145, 178);

  --card-bg: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 255, 255, 0.2);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  color: #fff;
  background: #0f172a;
}

a { color: inherit; }

/* ---------- Header ---------- */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.5rem;
  background: #fafafa;
  color: #111;
}

.top-bar .label {
  font-weight: 600;
  font-size: 0.95rem;
}

.top-bar .logos {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.badge {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge.inifap { background: #1f7a3f; }
.badge.tnc { background: #17506b; }
.badge.local { background: #7c2d12; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  overflow: hidden;
}

.hero .bg-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.hero .bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right bottom, var(--overlay-1), var(--overlay-2), var(--overlay-3));
}

.hero .content {
  position: relative;
  width: 100%;
  max-width: 920px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 0.3em;
}

.hero h1 .place {
  display: block;
  background: linear-gradient(to right, var(--text-grad-1), var(--text-grad-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .subtitle {
  font-size: clamp(1.05rem, 2vw, 1.4rem);
  margin: 0 0 0.6em;
}

.hero .description {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.85);
  max-width: 700px;
  margin: 0 auto 2rem;
}

/* ---------- Pill nav buttons ---------- */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  position: relative;
}

.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.9rem 1.8rem;
  border-radius: 16px;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  isolation: isolate;
}

.pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  filter: blur(14px);
  opacity: 0.55;
  z-index: -1;
}

.pill.pink { background: linear-gradient(to right, var(--pink-1), var(--pink-2)); }
.pill.pink::before { background: linear-gradient(to right, var(--pink-glow-1), var(--pink-glow-2)); }

.pill.purple { background: linear-gradient(to right, var(--purple-1), var(--purple-2)); }
.pill.purple::before { background: linear-gradient(to right, var(--purple-glow-1), var(--purple-glow-2)); }

.pill.cyan { background: linear-gradient(to right, var(--cyan-1), var(--cyan-2)); }
.pill.cyan::before { background: linear-gradient(to right, var(--cyan-glow-1), var(--cyan-glow-2)); }

/* ---------- Glass cards ---------- */
.card-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  width: 100%;
  position: relative;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: left;
  text-decoration: none;
  color: #fff;
  display: block;
  transition: transform 0.15s ease, background 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.16);
}

.card .icon { font-size: 1.6rem; margin-bottom: 0.75rem; display: block; }
.card h3 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.card p { margin: 0; font-size: 0.9rem; color: rgba(255,255,255,0.75); }

/* ---------- Footer bar ---------- */
.footer-bar {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
  padding: 0.9rem 1.5rem;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(6px);
  font-size: 0.95rem;
}

.footer-bar button {
  background: none;
  border: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: underline;
}
.footer-bar button.secondary { text-decoration: none; }

/* ---------- Content sections ---------- */
.section {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  background: #0f172a;
}

.section h2 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.section .eyebrow {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}

.section p { color: rgba(255,255,255,0.85); line-height: 1.6; }

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.resource-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.2rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  text-decoration: none;
  color: #fff;
  font-weight: 600;
}
.resource-link:hover { background: rgba(255,255,255,0.12); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 50;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  color: #111;
  border-radius: 16px;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
}

.modal h2 { margin-top: 0; font-size: 1.8rem; }
.modal .lead { color: #444; margin-bottom: 1.5rem; }

.modal-section { margin-bottom: 1.4rem; }
.modal-section h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}
.modal-section h3 .dot {
  width: 22px; height: 22px;
  border-radius: 999px;
  border: 2px solid #4f46e5;
  color: #4f46e5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}
.modal-section p, .modal-section a.doc-link { margin: 0; color: #333; }

.modal .cta {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: 10px;
  background: linear-gradient(to right, var(--purple-1), var(--cyan-1));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.modal .close-x {
  position: absolute;
  top: 1.2rem;
  right: 1.2rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #666;
}

.modal-wrapper { position: relative; }

@media (max-width: 640px) {
  .top-bar { flex-direction: column; align-items: flex-start; }
  .footer-bar { gap: 1rem; font-size: 0.85rem; flex-wrap: wrap; }
}
