/* QTV design polish (2026-10-07)
   Last stylesheet in the cascade. Keeps the brand (ink/paper, Georgia display,
   red accent) and only fixes consistency, legibility and mobile density. */

:root{
  --qp-display:Georgia,"Times New Roman",serif;
  --qp-gutter:clamp(16px,4vw,24px);
  --qp-section-y:clamp(48px,7vw,96px);
}

/* ---------- 1. One display typeface for every page title ---------- */
.ranking-page-hero h1,
.qhf-page-hero h1,
.qnv-hero h1,
.ranking-page-head h2,
.ranking-page-section h2,
.ranking-method-note h2{
  font-family:var(--qp-display);
  font-weight:700;
  letter-spacing:-.045em;
}
.ranking-page-hero h1{line-height:.98;text-wrap:balance}
.section-title,.page-hero h1,.qhf-card h3{text-wrap:balance}

/* Every hero eyebrow uses the brand kicker style */
.ranking-page-hero .eyebrow,
.qhf-page-hero .eyebrow,
.qnv-hero .eyebrow{
  color:var(--red);
  font-size:11px;
  font-weight:900;
  letter-spacing:.14em;
  text-transform:uppercase;
}

/* Readable measure for long intro copy on wide screens */
.section-intro,.ranking-page-hero p,.qhf-page-hero p{max-width:68ch}

/* ---------- 2. Person photos never leak alt text ---------- */
.person-list-photo,.municipality-person-photo,.person-photo,.person-card-photo,.qpp-photo{
  background:#2a2a2c;
  color:#fff;
  overflow:hidden;
  flex-shrink:0;
}
.person-list-photo img,.municipality-person-photo img,.person-photo img,.person-card img,.person-card-photo img,.qpp-photo img{
  color:transparent;      /* hides alt text if the remote image fails */
  font-size:0;
  object-fit:cover;
}
.qp-initials{
  display:flex;align-items:center;justify-content:center;
  width:100%;height:100%;
  font-weight:900;letter-spacing:.02em;font-size:15px;color:#fff;
  background:#2a2a2c;
}

/* ---------- 3. Featured (red) finding card: readable territory chip ---------- */
.qhf-card:first-child .qhf-territory b{background:rgba(255,255,255,.2);color:#fff}
.qhf-card:first-child .qhf-territory span{color:rgba(255,255,255,.85)}
.qhf-card:first-child .qhf-points span{border-color:rgba(255,255,255,.45)}

/* ---------- 4. Ranking rows: breathing room and no glued numbers ---------- */
.pp5-row-meta{display:flex;flex-wrap:wrap;gap:4px 16px}
.pp5-row-meta span{white-space:nowrap}
.pp5-row-meta b{margin-right:4px}
.mrr-evidence{white-space:nowrap}

/* ---------- 5. Progressive disclosure ("Mostrar más") ---------- */
#app .qp-hidden,.qp-hidden.qp-hidden{display:none!important}
.qp-more{
  display:flex;justify-content:center;
  margin:24px auto 8px;
}
.qp-more button{
  appearance:none;cursor:pointer;
  border:1px solid currentColor;border-radius:999px;
  background:transparent;color:inherit;
  font:inherit;font-weight:800;font-size:14px;
  padding:12px 22px;min-height:44px;
}
.qp-more button:hover{background:var(--ink);color:var(--white);border-color:var(--ink)}
.section.dark .qp-more button:hover,.people-section .qp-more button:hover{background:var(--white);color:var(--ink);border-color:var(--white)}
.qp-more small{display:block;font-weight:600;opacity:.7;font-size:12px;margin-top:2px}

/* ---------- 6. Accessibility ---------- */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:3px solid var(--red);outline-offset:3px;border-radius:6px;
}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* ---------- 7. Mobile ---------- */
@media (max-width:700px){
  body{-webkit-text-size-adjust:100%}

  /* Consistent gutters and vertical rhythm */
  .section,.ranking-page-section,.ranking-page-hero{padding-left:var(--qp-gutter);padding-right:var(--qp-gutter)}
  .ranking-page-hero{padding-top:40px;padding-bottom:36px}
  .ranking-page-hero h1{font-size:clamp(2.1rem,10vw,2.9rem)}
  .section-title{font-size:clamp(30px,8.6vw,40px)}
  .section-intro,.ranking-page-hero p{font-size:16px;line-height:1.6}

  /* Hero stats under the search box stay on one tidy grid */
  .hero-meta{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px}
  .hero-meta span{white-space:nowrap}

  /* Person ranking rows (/personas) */
  .person-long-row{
    display:grid!important;
    grid-template-columns:28px minmax(0,1fr) 18px;
    grid-template-areas:"rank copy arrow" ". score score" ". meta meta";
    column-gap:12px;row-gap:6px;align-items:start;
    padding-top:18px;padding-bottom:18px;
  }
  .person-long-row .long-rank{grid-area:rank;padding-top:2px}
  .person-long-row .person-long-copy{grid-area:copy;min-width:0}
  .person-long-row .person-score{grid-area:score;display:flex;align-items:baseline;gap:8px;text-align:left}
  .person-long-row .person-score b{font-size:22px}
  .person-long-row .long-arrow{grid-area:arrow;align-self:center}
  .person-long-row .pp5-row-meta{grid-area:meta;font-size:13px}
  .person-long-row .person-list-photo{float:right;width:48px;height:48px;border-radius:50%;margin:0 0 6px 10px}

  /* Municipality rankings (/concentracion) */
  .mrr-ranking-row{
    display:grid!important;
    grid-template-columns:28px minmax(0,1fr) auto;
    grid-template-areas:"rank place arrow" ". share evidence";
    column-gap:10px;row-gap:6px;align-items:center;
    padding-top:12px;padding-bottom:12px;min-height:44px;
  }
  .mrr-ranking-row .mrr-rank{grid-area:rank;align-self:start}
  .mrr-ranking-row .mrr-place{grid-area:place;min-width:0}
  .mrr-ranking-row .mrr-place strong{display:block;line-height:1.2}
  .mrr-ranking-row .mrr-share{grid-area:share;display:flex;align-items:baseline;gap:6px;text-align:left}
  .mrr-ranking-row .mrr-share small{white-space:nowrap;display:inline;margin:0}
  .mrr-ranking-row .mrr-share strong{font-size:22px}
  .mrr-ranking-row .mrr-evidence{grid-area:evidence;justify-self:end}
  .mrr-ranking-row .long-arrow{grid-area:arrow;justify-self:end}
  .mrr-ranking-row .mrr-stat{display:none}

  /* Municipality people cards: tighter */
  .municipality-person-card{padding:18px}
  .municipality-person-card p{font-size:14px}

  /* Tap targets */
  .qhf-filter,.qhf-chip,.share-button,.municipality-share a{min-height:40px}
}

/* ---------- 8. Press tools (press-tools.js) ---------- */
.qpt-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px;margin-top:22px;padding-top:16px;border-top:1px solid rgba(127,127,127,.25);font-size:13px}
.qpt-date{color:inherit;opacity:.8}
.qpt-cite{flex-basis:100%;font-size:12px;opacity:.65}
.qpt-btn{appearance:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:9px 16px;border-radius:999px;border:1px solid currentColor;background:transparent;color:inherit;font:inherit;font-weight:800;font-size:13px;text-decoration:none}
.qpt-btn:hover{background:var(--ink);color:var(--white);border-color:var(--ink)}
.qpt-btn[disabled]{opacity:.6;cursor:progress}
.qpt-primary{background:var(--red);border-color:var(--red);color:#fff}
.qpt-primary:hover{background:var(--red-dark);border-color:var(--red-dark)}
.qpt-press{background:var(--paper);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.qpt-press-inner{max-width:var(--max);margin:0 auto}
.qpt-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:24px 0}
.qpt-stats div{background:var(--white);border:1px solid var(--line);border-radius:14px;padding:16px}
.qpt-stats strong{display:block;font-family:var(--qp-display);font-size:30px;letter-spacing:-.03em;line-height:1.05}
.qpt-stats span{display:block;margin-top:6px;font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.qpt-quote{overflow-wrap:anywhere;margin:0 0 18px;padding:18px 20px;border-left:4px solid var(--red);background:var(--white);border-radius:0 12px 12px 0;font-family:var(--qp-display);font-size:clamp(17px,2vw,20px);line-height:1.5;max-width:80ch}
.qpt-actions{display:flex;flex-wrap:wrap;gap:10px}
.qpt-note{margin-top:14px;font-size:13px;color:var(--muted);max-width:80ch}
@media (max-width:700px){.qpt-stats{grid-template-columns:1fr 1fr}.qpt-stats strong{font-size:24px}.qpt-actions .qpt-btn{flex:1 1 calc(50% - 10px)}}
