/*
Theme Name: Decide Rocafort
Description: Plataforma de participación ciudadana de Rocafort
Version: 1.0
Text Domain: decide
*/

/* =========================================================
   TOKENS — paleta + sistema tipográfico
   ========================================================= */
:root {
  /* Tipografía */
  --font-sans:   'Instrument Sans', system-ui, sans-serif;
  --font-serif:  'Instrument Serif', Georgia, serif;

  /* Pesos */
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  /* Escala de tamaño */
  --text-xs:   .75rem;     /* 12px — labels, badges */
  --text-sm:   .875rem;    /* 14px — meta, pie de nota */
  --text-base: 1rem;       /* 16px — nav, botones */
  --text-body: 1.125rem;   /* 18px — cuerpo */
  --text-lead: 1.25rem;    /* 20px — intro, subtítulos */
  --text-xl:   1.5rem;     /* 24px — títulos de tarjeta */
  --text-2xl:  2rem;       /* 32px — títulos de sección h2 */
  --text-3xl:  2.75rem;    /* 44px — h1 interior */
  --text-hero: clamp(2.75rem, 5vw, 4.5rem); /* hero */

  /* Altura de línea */
  --leading-tight:  1.15;
  --leading-normal: 1.6;
  --leading-loose:  1.75;


  /* Verde salvia (acento principal, nav activo, hover) */
  --color-primary:      #5b9279;
  /* Verde brillante (botones CTA, breadcrumbs) */
  --color-accent:       #9be3bf;
  /* Texto acento sobre fondo claro */
  --color-accent-dark:  #223523;
  /* Casi negro (texto principal) */
  --color-text:         #1a1f16;
  /* Fondo general */
  --color-bg:           #f7f7f7;
  /* Superficie blanca (cards, header) */
  --color-surface:      #ffffff;
  /* Beige/crema (barra inferior nav) */
  --color-warm:         #e0d9d0;
  /* Gris secundario (meta, labels) */
  --color-muted:        #383838;
  /* Borde ligero */
  --color-border:       #eaeaea;
  /* Footer fondo */
  --color-footer-bg:    #2f3e36;
  /* Footer texto */
  --color-footer-text:  #afccc2;
  /* Footer links/títulos */
  --color-footer-link:  #ceddd5;
  /* Footer borde */
  --color-footer-border:#516359;
  /* Hero / page headers */
  --color-hero-bg:      #1a1f16;

  --radius:   6px;
  --shadow:   0 2px 12px rgba(0,0,0,.08);
  --max-w:    1200px;
  --gap:      2rem;
}

/* =========================================================
   RESET / BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--fw-regular);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--leading-normal);
}

/* Jerarquía tipográfica */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: var(--fw-regular);
  line-height: var(--leading-tight);
  color: var(--color-text);
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 {
  font-family: var(--font-sans);
  font-size: var(--text-lead);
  font-weight: var(--fw-semibold);
}
h5 {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
}
h6 {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: .06em;
}
p { max-width: 72ch; }
strong { font-weight: var(--fw-semibold); }

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }

/* =========================================================
   LAYOUT HELPERS
   ========================================================= */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: 1.5rem;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }

/* =========================================================
   HEADER / NAV — fondo verde marca, todo integrado
   ========================================================= */
.site-header {
  background: var(--color-primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  min-height: 68px;
  padding-inline: 1.5rem;
}
.site-logo { display: flex; align-items: center; flex-shrink: 0; }
.site-logo img { height: 40px; width: auto; }
.site-logo a { display: flex; align-items: center; }

/* Nav */
.nav-primary { display: flex; align-items: center; }
.nav-primary ul { display: flex; gap: .15rem; list-style: none; }
.nav-primary a {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: rgba(255,255,255,.82);
  padding: .5rem .9rem;
  border-radius: var(--radius);
  transition: background .15s, color .15s;
  display: block;
  text-decoration: none;
}
.nav-primary a:hover,
.nav-primary .current-menu-item > a,
.nav-primary .current-page-ancestor > a {
  background: rgba(0,0,0,.15);
  color: #fff;
  text-decoration: none;
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: transform .2s;
}

/* =========================================================
   HERO — foto de fondo, más altura en pantallas grandes
   ========================================================= */
.hero {
  background: var(--color-hero-bg) center/cover no-repeat;
  color: #fff;
  padding: 5rem 0 4.5rem;
  text-align: center;
  position: relative;
  display: flex;
  align-items: center;
  min-height: 55vh;
}
@media (min-width: 1024px) { .hero { min-height: 72vh; padding: 7rem 0 6rem; } }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 31, 22, .68);
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: var(--text-hero);
  font-weight: var(--fw-regular);
  color: #fff;
  margin-bottom: 1.25rem;
  line-height: var(--leading-tight);
  max-width: 16ch;
  margin-inline: auto;
}
.hero p {
  font-size: var(--text-lead);
  font-weight: var(--fw-regular);
  color: rgba(255,255,255,.85);
  max-width: 52ch;
  margin-inline: auto;
  margin-bottom: 2.25rem;
  line-height: var(--leading-loose);
}
.hero .container { width: 100%; }
.hero-badge {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-dark);
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: .12em;
  padding: .3rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .9; transform: translateY(-1px); text-decoration: none; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-dark);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
}
.btn-primary:hover { background: #7dcca8; color: var(--color-accent-dark); }
.btn-outline {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.5);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
}
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,.08); }

/* =========================================================
   PILLARS (4 items)
   ========================================================= */
.pillars { padding: 3rem 0; background: var(--color-surface); }
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.pillar {
  text-align: center;
  padding: 2rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.pillar-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.pillar h3 {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  margin-bottom: .4rem;
}
.pillar p { font-size: var(--text-sm); color: var(--color-muted); }

/* =========================================================
   SECTION GENERIC
   ========================================================= */
.section { padding: 4rem 0; }
.section-alt { background: var(--color-surface); }
.section-title {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: var(--fw-regular);
  color: var(--color-text);
  margin-bottom: .6rem;
}
.section-subtitle {
  font-size: var(--text-lead);
  font-weight: var(--fw-regular);
  color: var(--color-muted);
  margin-bottom: 2.5rem;
  max-width: 60ch;
}

/* =========================================================
   CARDS (procesos / áreas)
   ========================================================= */
.card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.12); transform: translateY(-3px); }
.card-img img { width: 100%; height: 200px; object-fit: cover; }
.card-body { padding: 1.5rem; }
.card-tag {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-primary);
  margin-bottom: .5rem;
}
.card-title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--fw-regular);
  margin-bottom: .6rem;
  line-height: var(--leading-tight);
}
.card-excerpt { font-size: var(--text-body); color: var(--color-muted); margin-bottom: 1rem; line-height: var(--leading-normal); }
.card-meta { font-size: var(--text-xs); font-weight: var(--fw-medium); color: var(--color-muted); text-transform: uppercase; letter-spacing: .05em; }

/* Process cards (estado) */
.process-status {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: 100px;
  margin-bottom: .75rem;
}
.status-open   { background: #d5f5e3; color: #1e8449; }
.status-paused { background: #fef3cd; color: #856404; }
.status-closed { background: #fde8e8; color: #c0392b; }
.status-draft  { background: #f0f0f0; color: #555; }

/* =========================================================
   PROCESO DESTACADO (homepage)
   ========================================================= */
.proceso-featured {
  padding: 5rem 0;
  background: var(--color-surface);
}
@media (min-width: 1024px) { .proceso-featured { padding: 7rem 0; } }

.proceso-featured-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.proceso-featured-img {
  border-radius: calc(var(--radius) * 2);
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  aspect-ratio: 4/3;
}
.proceso-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.proceso-featured-content { }
.proceso-featured-content .hero-badge {
  background: rgba(91,146,121,.12);
  color: var(--color-primary);
  display: inline-block;
  margin-bottom: 1.25rem;
}
.proceso-featured-content h2 {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  margin-bottom: 1rem;
  line-height: var(--leading-tight);
}
.proceso-featured-content p {
  font-size: var(--text-body);
  color: var(--color-muted);
  line-height: var(--leading-loose);
  margin-bottom: 2rem;
}
.proceso-featured-content .btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.proceso-featured-content .btn-primary:hover {
  background: var(--color-accent-dark);
}
.proceso-meta-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.proceso-meta-row .process-status { margin: 0; }
.proceso-meta-deadline {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--color-muted);
}

@media (max-width: 800px) {
  .proceso-featured-inner { grid-template-columns: 1fr; gap: 2rem; }
  .proceso-featured-img { aspect-ratio: 16/9; }
}

/* =========================================================
   SINGLE PROCESO — página de detalle + votación
   ========================================================= */
.proceso-header {
  background: var(--color-hero-bg);
  color: #fff;
  padding: 4rem 0 3rem;
  position: relative;
}
.proceso-header-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,31,22,.75);
}
.proceso-header .container { position: relative; z-index: 1; }
.proceso-header h1 {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  font-weight: var(--fw-regular);
  color: #fff;
  margin-bottom: .75rem;
}
.proceso-body {
  display: grid;
  grid-template-columns: 1fr clamp(320px, 36%, 420px);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
  padding: 4rem 0;
}
.proceso-description {
  font-size: var(--text-body);
  line-height: var(--leading-loose);
  color: var(--color-text);
}
.proceso-description p + p { margin-top: 1rem; }

@media (max-width: 900px) {
  .proceso-body { grid-template-columns: 1fr; gap: 2rem; }
}

/* =========================================================
   DNI FORM (voting gate)
   ========================================================= */
.decide-gate {
  max-width: 480px;
  margin: 3rem auto;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem 2rem;
  text-align: center;
}
.decide-gate h2 {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: var(--fw-regular);
  color: var(--color-text);
  margin-bottom: .5rem;
}
.decide-gate p { color: var(--color-muted); font-size: var(--text-body); margin-bottom: 1.5rem; }

.dni-form { display: flex; flex-direction: column; gap: 1rem; }
.dni-form label { font-weight: 600; text-align: left; font-size: .9rem; }
.dni-form input[type="text"] {
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  transition: border-color .15s;
  text-align: center;
}
.dni-form input[type="text"]:focus {
  outline: none;
  border-color: var(--color-primary);
}
.decide-gate .btn { width: 100%; justify-content: center; font-size: 1rem; padding: .85rem; }

.gate-notice {
  margin-top: 1rem;
  font-size: .82rem;
  color: var(--color-muted);
  display: flex;
  align-items: flex-start;
  gap: .4rem;
  text-align: left;
}

/* Voting panel (post-verification) */
.voting-panel { max-width: 600px; margin: 0 auto; }
.vote-options { display: flex; flex-direction: column; gap: 1rem; margin: 1.5rem 0; }
.vote-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.vote-option:hover,
.vote-option.selected {
  border-color: var(--color-primary);
  background: rgba(91, 146, 121, .06);
}
.vote-option input[type="radio"] { accent-color: var(--color-primary); width: 18px; height: 18px; }
.vote-option-text { font-weight: 500; }
.vote-option-desc { font-size: .85rem; color: var(--color-muted); margin-top: .2rem; }

/* Feedback messages */
.decide-message {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: .95rem;
}
.decide-message.success { background: #d5f5e3; color: #1e8449; border: 1px solid #a9dfbf; }
.decide-message.error   { background: #fde8e8; color: #c0392b; border: 1px solid #f1948a; }
.decide-message.info    { background: #d6eaf8; color: #1a5276; border: 1px solid #85c1e9; }

/* =========================================================
   QUOTE / ALCALDE — solo texto, sin foto ni cursiva
   ========================================================= */
.alcalde-section {
  background: var(--color-primary);
  color: #fff;
  padding: 5rem 0;
  text-align: center;
}
.alcalde-inner {
  max-width: 680px;
  margin: 0 auto;
}
.alcalde-inner::before {
  content: '\201C';
  font-family: var(--font-serif);
  font-size: 5rem;
  color: var(--color-accent);
  line-height: 1;
  display: block;
  margin-bottom: .5rem;
  opacity: .7;
}
blockquote {
  font-family: var(--font-sans);
  font-style: normal;
  font-size: var(--text-body);
  font-weight: var(--fw-regular);
  line-height: var(--leading-loose);
  opacity: .88;
}
blockquote cite {
  display: block;
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: var(--fw-semibold);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-top: 1.25rem;
  opacity: .65;
}

/* =========================================================
   FOOTER — verde bosque oscuro, texto menta suave
   ========================================================= */
.site-footer { background: var(--color-footer-bg); color: var(--color-footer-text); padding: 3rem 0 1.5rem; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand .site-name {
  font-family: 'Instrument Serif', serif;
  font-weight: 400;
  color: var(--color-footer-link);
  font-size: 1.2rem;
  margin-bottom: .5rem;
}
.footer-brand p { font-size: .9rem; line-height: 1.7; }
.footer-col h4 {
  color: var(--color-footer-link);
  font-size: .82rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.footer-col li + li { margin-top: .6rem; }
.footer-col a { color: var(--color-footer-text); font-size: .9rem; }
.footer-col a:hover { color: var(--color-footer-link); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--color-footer-border);
  padding-top: 1.25rem;
  font-size: .82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-footer-text);
}
.footer-bottom a { color: var(--color-footer-text); }
.footer-bottom a:hover { color: var(--color-footer-link); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .pillars-grid,
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .alcalde-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
  .pillars-grid,
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .nav-primary { display: none; }
  .nav-primary.open {
    display: block;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--color-primary);
    padding: .75rem 1rem;
    border-top: 1px solid rgba(255,255,255,.15);
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
  }
  .nav-primary.open ul { flex-direction: column; gap: .1rem; }
  .nav-primary.open a { padding: .65rem 1rem; border-radius: var(--radius); }
  .nav-toggle { display: flex; flex-direction: column; gap: 5px; }
  .header-inner { position: relative; }
  .hero { padding: 3rem 0 2.5rem; min-height: 50vh; }
}
