/*
Theme Name: Monte en Pie
Theme URI: https://monteenpie.org/
Author: Monte en Pie
Description: Tema oficial de Monte en Pie, con gestión de eventos, iniciativas y denuncias moderadas desde WordPress.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: monte-en-pie
*/

/* ========================================================================== 
   Monte en Pie — hoja de estilos común
   ========================================================================== */

:root {
  color-scheme: light;

  /* Marca */
  --forest-950: #0c2a20;
  --forest-900: #0f3d2c;
  --forest-700: #1f6b45;
  --forest-500: #2f8f5b;
  --forest-100: #e6f2ea;
  --forest-50:  #f3f8f5;

  --fire-700: #b5300f;
  --fire-600: #d1410f;
  --fire-500: #e8572a;
  --ember-500:#f2a007;
  --ember-100:#fdf1d9;

  /* Neutros */
  --surface:       #fcfcfb;
  --surface-alt:   #f5f2ea;
  --ink:           #171613;
  --ink-secondary: #52504a;
  --ink-muted:     #86837b;
  --border:        rgba(23,22,19,0.12);
  --border-strong: rgba(23,22,19,0.2);

  /* Estado */
  --good:     #0ca30c;
  --warning:  #b5790a;
  --critical: #b5300f;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(23,22,19,0.06), 0 1px 1px rgba(23,22,19,0.04);
  --shadow-md: 0 8px 24px rgba(15,61,44,0.10);
  --max-width: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--forest-700); text-decoration-thickness: 1.5px; }
a:hover { color: var(--fire-600); }

h1, h2, h3, h4 { line-height: 1.18; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-secondary); }
p.lead { font-size: 1.15rem; color: var(--ink); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section { padding: 64px 0; }
.section-tight { padding: 40px 0; }
.section-alt { background: var(--forest-50); }
.section-dark { background: var(--forest-950); color: #fff; }
.section-dark p { color: rgba(255,255,255,0.78); }
.section-dark h2, .section-dark h3 { color: #fff; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fire-600);
  margin-bottom: 10px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(252,252,251,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--forest-950);
  text-decoration: none;
}
.brand:hover { color: var(--forest-950); }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--forest-700), var(--forest-950));
  display: flex; align-items: center; justify-content: center;
  color: var(--ember-500);
  font-size: 1.05rem;
}
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
}
.main-nav a:hover { background: var(--forest-100); color: var(--forest-950); }
.main-nav a.active { color: var(--forest-950); background: var(--forest-100); }
.nav-cta { margin-left: 6px; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  width: 42px; height: 42px; align-items: center; justify-content: center; cursor: pointer;
}

@media (max-width: 880px) {
  .nav-toggle { display: flex; }
  .main-nav {
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
    gap: 2px;
    display: none;
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px; }
  .nav-cta { margin-left: 0; margin-top: 6px; }
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease, color .15s ease, border-color .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-fire { background: var(--fire-600); color: #fff; }
.btn-fire:hover { background: var(--fire-700); color: #fff; }
.btn-forest { background: var(--forest-900); color: #fff; }
.btn-forest:hover { background: var(--forest-950); color: #fff; }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--forest-700); color: var(--forest-900); }
.btn-outline-light { background: transparent; border-color: rgba(255,255,255,0.4); color: #fff; }
.btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,0.08); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1100px 480px at 85% -10%, rgba(232,87,42,0.16), transparent 60%),
    linear-gradient(180deg, var(--forest-50), var(--surface) 70%);
  padding: 72px 0 56px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ember-100); color: var(--warning);
  font-size: 0.82rem; font-weight: 700;
  padding: 6px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fire-600); }

/* ---------- Stat tiles ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat-tile {
  background: var(--surface);
  padding: 26px 22px;
}
.stat-tile .value {
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  font-weight: 800;
  color: var(--forest-950);
  font-variant-numeric: proportional-nums;
  letter-spacing: -0.02em;
}
.stat-tile.is-critical .value { color: var(--fire-700); }
.stat-tile .label { font-size: 0.86rem; color: var(--ink-secondary); margin-top: 6px; }
.stat-tile .source { font-size: 0.74rem; color: var(--ink-muted); margin-top: 10px; }

/* ---------- Tarjetas ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
}
.card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--forest-100); color: var(--forest-800, var(--forest-700));
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
  margin-bottom: 4px;
}
.card h3 { margin-bottom: 2px; }
.card p { margin-bottom: 4px; font-size: 0.95rem; }
.card .card-link { font-weight: 700; font-size: 0.9rem; text-decoration: none; margin-top: auto; }

/* ---------- Listados (eventos/iniciativas/denuncias) ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px;
}
.filter-bar select, .filter-bar input[type="search"] {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
}
.filter-bar select:focus, .filter-bar input:focus { outline: 2px solid var(--forest-500); outline-offset: 1px; }

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.item-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
}
.item-card .item-photo {
  width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--forest-100);
}
.item-card .item-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.item-card .item-meta { font-size: 0.82rem; color: var(--ink-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.item-card h3 { font-size: 1.08rem; margin-bottom: 0; }
.item-card p { font-size: 0.92rem; margin-bottom: 0; }
.item-card .item-footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 6px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 999px;
  background: var(--forest-100); color: var(--forest-900);
  white-space: nowrap;
}
.badge-fire { background: var(--ember-100); color: var(--warning); }
.badge-good { background: #e4f6e4; color: var(--good); }
.badge-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--ink-secondary); }

.empty-state {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-secondary);
  background: var(--forest-50);
}
.empty-state h3 { color: var(--forest-950); }

/* ---------- Avisos / notices ---------- */
.notice {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 0.94rem;
  display: flex; gap: 12px; align-items: flex-start;
}
.notice p:last-child { margin-bottom: 0; }
.notice-icon { font-size: 1.2rem; line-height: 1; }
.notice-critical { background: #fdeeea; border-color: rgba(181,48,15,0.25); }
.notice-critical p { color: var(--fire-700); }
.notice-info { background: var(--forest-50); border-color: rgba(15,61,44,0.18); }
.notice-warning { background: var(--ember-100); border-color: rgba(178,120,10,0.3); }
.notice-warning p, .notice-warning strong { color: #7a5206; }

/* ---------- Formularios ---------- */
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.field label {
  display: block; font-weight: 700; font-size: 0.88rem; margin-bottom: 6px; color: var(--ink);
}
.field .hint { font-size: 0.8rem; color: var(--ink-muted); margin-top: 4px; }
.field input[type="text"],
.field input[type="email"],
.field input[type="date"],
.field input[type="tel"],
.field input[type="file"],
.field select,
.field textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 11px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--forest-500); outline-offset: 1px; border-color: var(--forest-500);
}
.checkbox-field { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; color: var(--ink-secondary); }
.checkbox-field input { margin-top: 3px; }

.form-msg { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); font-size: 0.9rem; display: none; }
.form-msg.show { display: block; }
.form-msg.success { background: #e4f6e4; color: #0a5c0a; }
.form-msg.error { background: #fdeeea; color: var(--fire-700); }

/* ---------- Pasos / guía ---------- */
.steps { display: grid; gap: 16px; }
.step {
  display: grid; grid-template-columns: 40px 1fr; gap: 16px;
  padding: 4px 0;
}
.step .num {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--forest-900); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem;
}
.step h4 { margin-bottom: 4px; }
.step p { font-size: 0.94rem; margin-bottom: 0; }

.accordion { border-top: 1px solid var(--border); }
.accordion-item { border-bottom: 1px solid var(--border); }
.accordion-item summary {
  cursor: pointer; list-style: none; padding: 18px 4px;
  font-weight: 700; font-size: 1.02rem; color: var(--forest-950);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary::after { content: "+"; font-size: 1.4rem; color: var(--ink-muted); font-weight: 400; }
.accordion-item[open] summary::after { content: "\2212"; }
.accordion-item .accordion-body { padding: 0 4px 20px; font-size: 0.95rem; }
.accordion-item .accordion-body p:last-child { margin-bottom: 0; }

.ccaa-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ccaa-table th, .ccaa-table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ccaa-table th { color: var(--ink-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); }
.table-wrap .ccaa-table { min-width: 640px; }

/* ---------- CTA banda ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--forest-950), var(--forest-800, var(--forest-900)));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 42px;
  display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
}
.cta-band h3 { color: #fff; margin-bottom: 6px; }
.cta-band p { color: rgba(255,255,255,0.78); margin-bottom: 0; max-width: 46ch; }

/* ---------- Footer ---------- */
.site-footer { background: var(--forest-950); color: rgba(255,255,255,0.75); padding: 52px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.footer-grid a { color: rgba(255,255,255,0.72); display: block; padding: 5px 0; text-decoration: none; font-size: 0.92rem; }
.footer-grid a:hover { color: #fff; }
.footer-brand p { color: rgba(255,255,255,0.6); font-size: 0.88rem; }
.footer-bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: 0.8rem; color: rgba(255,255,255,0.5);
}

/* ---------- Utilidades ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.max-prose { max-width: 68ch; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.divider { height: 1px; background: var(--border); border: none; margin: 48px 0; }

.emergency-banner {
  background: var(--fire-700);
  color: #fff;
  text-align: center;
  font-size: 0.86rem;
  padding: 8px 16px;
}
.emergency-banner a { color: #fff; font-weight: 800; text-decoration: underline; }

.config-warning {
  display: none;
  background: #fff4d6;
  border: 1.5px solid var(--ember-500);
  color: #6b4a04;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  margin-bottom: 16px;
}
.config-warning.show { display: block; }

/* Integración con WordPress */
.admin-bar .site-header { top: 32px; }
.mep-editor-content { padding: 32px 0 0; }
.mep-form-notice { margin-bottom: 20px; padding: 14px 16px; border-radius: 10px; font-weight: 700; }
.mep-form-notice.success { background: #e8f5eb; color: #185b2a; border: 1px solid #add7b7; }
.mep-form-notice.error { background: #fff0ed; color: #8b2318; border: 1px solid #edb4aa; }
.mep-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.item-card[hidden], .empty-state[hidden] { display: none !important; }

@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}
