/* ============================================================
   styles.css — Plataforma Electoral FEDe 2026
   Tipografía: Chromatica (títulos) + Source Serif 4 (textos)
   Paleta: Azul #2F6FCC · Naranja #E8460A · Amarillo #F5C800
============================================================ */

/* Source Serif 4 — cargada desde Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* Chromatica — fuente local, archivos en la carpeta fonts/ */
@font-face {
  font-family: 'Chromatica';
  src: url('fonts/Chromatica-Regular.woff2') format('woff2'),
       url('fonts/Chromatica-Regular.woff')  format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Chromatica';
  src: url('fonts/Chromatica-Bold.woff2') format('woff2'),
       url('fonts/Chromatica-Bold.woff')  format('woff');
  font-weight: 700 800;
  font-style: normal;
  font-display: swap;
}

/* ─── RESET & BASE ──────────────────────────────────────── */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --blue:        #2F6FCC;
  --blue-dark:   #1a4d9a;
  --blue-light:  #e8f0fc;
  --orange:      #E8460A;
  --orange-dark: #c03a08;
  --yellow:      #F5C800;
  --green:       #3EB489;
  --gray-bg:     #F2F2F2;
  --gray-line:   #e0e0e0;
  --gray-mid:    #666;
  --gray-dark:   #1a1a1a;
  --white:       #ffffff;

  --font-main:   'Source Serif 4', Georgia, serif;
  --font-title:  'Chromatica', system-ui, sans-serif;

  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.09);
  --shadow-hover:0 8px 28px rgba(0,0,0,0.14);

  --transition:  0.18s ease;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--font-main);
  background: var(--gray-bg);
  color: var(--gray-dark);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button {
  font-family: var(--font-main);
  cursor: pointer;
}

/* ─── TÍTULO FONT (Chromatica) ───────────────────────────── */

.nav-title,
.home-header h1,
.card-name,
#profile-name,
.sector-title,
.proposal-title,
.rf-header-text h2,
.rf-card-title,
#modal-title,
.ecb-name {
  font-family: var(--font-title);
}

/* ─── LOADING SCREEN ─────────────────────────────────────── */

#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--blue);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 1.5rem;
}

.loading-logo {
  width: 80px;
  height: auto;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(0.95); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: translateX(0); }
}

.loading-text {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* ─── ERROR BANNER ───────────────────────────────────────── */

#error-banner {
  display: none;
  background: #fdecea;
  border-left: 4px solid var(--orange);
  color: #c03a08;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  max-width: 800px;
  margin: 1rem auto;
  border-radius: var(--radius-sm);
}

/* ─── NAVIGATION ─────────────────────────────────────────── */

nav {
  background: var(--gray-dark);
  border-bottom: 2px solid var(--gray-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: white;
}

.nav-logo-img {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}

.nav-wordmark { text-align: left; }
.nav-title    { font-size: 14px; font-weight: 800; letter-spacing: 0.2px; line-height: 1.2; color: white; }
.nav-subtitle { font-size: 11px; color: rgba(255,255,255,0.6); font-weight: 400; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  background: none;
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: color var(--transition);
}

.nav-link:hover { color: white; }

/* ─── METODOLOGÍA page ───────────────────────────────── */

/* ─── METODOLOGÍA PAGE — breadcrumb ─────────────────── */

#page-metodologia .breadcrumb {
  background: #d8d8d8;
  max-width: none;
  margin: 0;
  padding-top: 4.5rem;
  padding-bottom: 0.75rem;
  padding-left: max(2rem, calc((100% - 1100px) / 2 + 2rem));
  padding-right: max(2rem, calc((100% - 1100px) / 2 + 2rem));
}

/* ─── METODOLOGÍA PAGE — header & body ──────────────── */

.metodologia-header {
  background: #d8d8d8;
  color: var(--gray-dark);
  padding: 1.5rem 2rem 2.5rem;
  text-align: center;
}

.metodologia-header h1 {
  font-family: var(--font-title);
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 800;
  margin: 0;
}

.metodologia-body {
  max-width: 760px;
  margin: 3rem auto 7rem;
  padding: 0 2rem;
  font-size: 17px;
  line-height: 1.8;
}

.metodologia-body h2 {
  font-family: var(--font-title);
  font-size: clamp(17px, 2.5vw, 21px);
  font-weight: 800;
  color: var(--gray-dark);
  margin: 2.5rem 0 0.5rem;
}

.metodologia-body p {
  margin: 0.75rem 0;
  color: var(--gray-dark);
}

.metod-link {
  color: var(--blue);
  text-underline-offset: 3px;
}

.metod-link:hover { text-decoration: none; }

.metod-experts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 1.25rem 0 0.5rem;
}

.metod-expert-sector {
  background: var(--gray-bg);
  border: 1px solid var(--gray-line);
  border-radius: 6px;
  padding: 1rem 1.25rem;
}

.metod-expert-sector h3 {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-mid);
  margin: 0 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.metod-sector-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.metod-expert-sector ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.metod-expert-sector li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-dark);
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--gray-line);
}

.metod-expert-sector li:last-child { border-bottom: none; }

.chip-alerta {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
  background: #fef9e7;
  border: 1px solid #d4a017;
  color: #a07010;
}

.chip-amenaza {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
  background: #fdecea;
  border: 1px solid #c0392b;
  color: #922b21;
}

/* ─── PAGES ──────────────────────────────────────────────── */

.page { display: none; }
.page.active { display: block; }

/* ─── HOME — header ──────────────────────────────────────── */

.home-header {
  background: transparent;
  padding: 6rem 2rem 5.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.dot-grid {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  pointer-events: none;
  overflow: hidden;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-dark);
  background: #f5f5f5;
  pointer-events: auto;
  cursor: pointer;
}

.home-header-content {
  display: inline-block;
  background: #f2f2f2;
  color: var(--gray-dark);
  padding: 2rem 3rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.year-badge {
  display: inline-block;
  background: var(--yellow);
  color: var(--gray-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.home-header h1 {
  font-size: clamp(22px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 0.75rem;
  line-height: 1.15;
}

.home-header p {
  font-size: clamp(14px, 2vw, 17px);
  opacity: 0.82;
  max-width: 520px;
  margin: 0 auto;
  font-weight: 400;
}

/* ─── HOME — instructions ────────────────────────────────── */

.home-instructions {
  text-align: center;
  font-family: var(--font-main);
  font-size: 28px;
  font-weight: 400;
  color: var(--gray-dark);
  padding: 2.5rem 1rem 0;
}

/* ─── HOME — candidates grid ─────────────────────────────── */

.candidates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 2.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
}

.candidate-card {
  background: var(--white);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--gray-line);
  display: flex;
  flex-direction: column;
  text-align: left;
}

.candidate-card:hover,
.candidate-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.card-accent {
  height: 5px;
  width: 100%;
  flex-shrink: 0;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  flex: 1;
  align-items: flex-start;
}

.card-left {
  width: 100%;
}

.card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.65rem;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
}

.card-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.card-initials { display: block; }

.card-name {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 3px;
  color: var(--gray-dark);
}

.card-party {
  font-size: 11px;
  color: var(--gray-mid);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 10px;
}

.card-right {
  flex: 1;
  min-width: 0;
}

.card-bio {
  font-size: 11.5px;
  color: var(--gray-mid);
  line-height: 1.6;
}

.card-cta {
  display: block;
  width: calc(100% - 2.5rem);
  margin: 0 1.25rem 1.25rem;
  background: #f2f2f2;
  color: var(--gray-dark);
  border: 1.5px solid var(--gray-dark);
  border-radius: 0;
  padding: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  box-shadow: 3px 3px 0 0 var(--gray-dark);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card-cta:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 var(--gray-dark);
}

/* ─── PROFILE — header (neo-brutalist) ──────────────────── */

.profile-header {
  color: var(--gray-dark);
  overflow: hidden;
  padding: 0;
  margin: 0.5rem 0 1.5rem 0;
}

.profile-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.profile-top {
  display: flex;
  align-items: stretch;
  min-height: 300px;
  background: var(--white);
  border: 1px solid #d5d5d5;
  padding: 0 2rem;
}

.profile-photo-col {
  width: 30%;
  flex-shrink: 0;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}

#profile-avatar {
  width: 100%;
  height: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -2px;
  overflow: hidden;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.profile-info {
  flex: 1;
  min-width: 0;
  padding: 2.5rem 2rem 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#profile-name {
  font-size: clamp(26px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1px;
}

.profile-party-vp {
  display: flex;
  gap: 2.5rem;
  align-items: stretch;
}

.profile-party-col {
  display: flex;
  align-items: center;
}

.profile-vp-col {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.profile-vp-label {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  opacity: 0.7;
}

#profile-vp {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  padding: 0;
  background: none;
}

.profile-party-logo {
  height: 100%;
  display: flex;
  align-items: center;
}

.profile-party-logo img {
  height: 60px;
  width: auto;
  background: white;
  padding: 6px 0;
  display: block;
}

.profile-edu-bio {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--gray-line);
}

#profile-edu {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.9;
}

#profile-bio {
  font-size: 13.5px;
  line-height: 1.65;
  opacity: 0.82;
  margin: 0;
}

/* ─── BREADCRUMB ─────────────────────────────────────────── */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1.5rem 0;
  max-width: 1100px;
  margin: 0 auto;
  font-size: 16px;
  margin-top: 3rem;
}

.breadcrumb-link {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 16px;
  font-family: var(--font-main);
  padding: 0;
  cursor: pointer;
}

.breadcrumb-link:hover { text-decoration: underline; }

.breadcrumb-sep { color: var(--gray-mid); }

.breadcrumb-current {
  color: var(--gray-mid);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── OTROS CANDIDATOS ───────────────────────────────────── */

#otros-candidatos-section {
  padding: 2rem 2rem 2.5rem;
  border-top: 2px solid var(--gray-line);
  background: #e4e4e4;
}

.otros-inner { max-width: 1100px; margin: 0 auto; }

.otros-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--gray-dark);
  text-align: center;
}

.otros-grid {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  justify-content: center;
}

.otro-card {
  flex: 0 0 130px;
  background: var(--white);
  border: 1.5px solid var(--gray-line);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  text-align: center;
  overflow: hidden;
}

.otro-card:hover,
.otro-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  outline: none;
}

.otro-photo {
  width: 100%;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  overflow: hidden;
}

.otro-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.otro-info {
  padding: 8px 8px 10px;
}

.otro-name {
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-dark);
  margin-bottom: 2px;
}

.otro-party {
  font-size: 10.5px;
  color: var(--gray-mid);
  line-height: 1.3;
}

/* ─── COMPARE BANNER ─────────────────────────────────────── */

#compare-banner {
  display: none;
  background: var(--blue-light);
  color: var(--gray-dark);
  border-bottom: 1px solid var(--blue-dark);
  border-top: 1px solid var(--blue-dark);
  text-align: center;
  padding: 10px 1rem;
  font-size: 13px;
  font-weight: 700;
}

#compare-banner.visible { display: block; }

/* ─── PROFILE ACTIONS ────────────────────────────────────── */

.proposals-compare-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}

.proposals-profile-link-row {
  display: flex;
  justify-content: center;
  padding: 3rem 0;
}

#compare-select {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border-radius: 0;
  border: 2px solid var(--gray-dark);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-main);
  background: white;
  color: var(--gray-dark);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231a1a1a' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

#compare-select:focus {
  outline: none;
  border-color: var(--blue);
}

.compare-btn {
  background: none;
  color: #666;
  border: 1px solid #d0d0d0;
  padding: 10px 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.compare-btn:hover {
  background: #f2f2f2;
}

.profile-link-btn {
  background: #f2f2f2;
  color: var(--gray-dark);
  border: 1.5px solid var(--gray-dark);
  border-radius: 0;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 3px 3px 0 0 var(--gray-dark);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}

.profile-link-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 var(--gray-dark);
}

#clear-compare-btn {
  display: none;
  background: none;
  color: var(--gray-dark);
  border: none;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#clear-compare-btn:hover {
  text-decoration: underline;
}

/* ─── EXPERTOS PANEL ─────────────────────────────────────── */

.expertos-panel {
  border-bottom: 1px solid var(--gray-line);
  background: var(--gray-bg);
  padding: 1.5rem 2rem;
}

.expertos-panel-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.expertos-panel-title {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-dark);
  margin: 0 0 1rem;
}

.expertos-panel-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem 2rem;
}

.ep-expert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

.ep-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  cursor: default;
}

.ep-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-dark);
  line-height: 1.2;
}

.ep-role {
  font-size: 12px;
  color: var(--gray-mid);
  line-height: 1.2;
}

.ep-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--gray-dark);
  color: white;
  border-radius: 6px;
  padding: 8px 12px;
  min-width: 180px;
  z-index: 50;
  pointer-events: none;
}


.ep-tooltip-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.ep-tooltip-role {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 2px;
  line-height: 1.3;
}

@media (min-width: 641px) {
  .ep-tooltip { display: none !important; }
}

@media (max-width: 640px) {
  .expertos-panel { padding: 1rem; }

  .expertos-panel-title { font-size: 15px; }

  .expertos-panel-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .ep-info { display: none; }

  .ep-avatar { cursor: pointer; }
}

/* ─── SECTION LABELS (Filtros / Propuestas) ─────────────── */

.proposals-section-label {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 18px;
  color: var(--gray-dark);
  width: 100%;
  display: block;
  margin-bottom: 1rem;
}

.proposals-sector-label {
  font-family: var(--font-title);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 800;
  line-height: 1.1;
  color: var(--gray-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  padding-left: 1rem;
  margin: 1.5rem 0 2rem;
}


.proposals-sector-label img {
  width: 32px;
  height: 32px;
  display: block;
}

/* ─── FILTER BAR ─────────────────────────────────────────── */

.filter-bar {
  display: none;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  align-items: flex-end;
  padding-bottom: 2rem;
  margin-bottom: 1.25rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gray-mid);
}

.filter-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-tag {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 400;
  padding: 3px 10px;
  border: 1.5px solid var(--gray-line);
  background: white;
  color: var(--gray-dark);
  cursor: pointer;
  border-radius: 0 20px 20px 0;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}

.filter-tag:hover { border-color: var(--gray-dark); }

.filter-tag.active {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: white;
}

.filter-tag.filter-alert-amarillo {
  background: #fef9e7;
  border-color: #d4a017;
  color: #a07010;
}

.filter-tag.filter-alert-amarillo.active {
  background: #f39c12;
  border-color: #f39c12;
  color: white;
}

.filter-tag.filter-alert-rojo {
  background: #fdecea;
  border-color: #c0392b;
  color: #922b21;
}

.filter-tag.filter-alert-rojo.active {
  background: #e74c3c;
  border-color: #e74c3c;
  color: white;
}

.filter-clear {
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-mid);
  background: none;
  border: 1.5px solid var(--gray-line);
  padding: 4px 12px;
  cursor: pointer;
  align-items: center;
  gap: 4px;
  transition: color var(--transition), border-color var(--transition);
}

.filter-clear:hover {
  color: var(--gray-dark);
  border-color: var(--gray-dark);
}

.proposal-row.proposal-filtered-out { display: none; }
.sector-tab-hidden { display: none !important; }

/* ─── SECTOR TAB BUTTONS (filter bar) ───────────────────── */

.filter-group-sectors {
  width: 100%;
}

.filter-sector-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.sector-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 16px;
  flex: 1;
  min-width: 0;
  background: white;
  border: 2px solid var(--gray-line);
  border-radius: 0;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.sector-tab-btn .sector-tab-icon img {
  width: 28px;
  height: 28px;
  display: block;
  transition: filter var(--transition);
}

.sector-tab-btn .sector-tab-name {
  font-family: var(--font-title);
  font-size: clamp(9px, 2.2vw, 11px);
  font-weight: 700;
  color: var(--gray-dark);
  transition: color var(--transition);
  white-space: nowrap;
}

.sector-tab-btn:hover {
  border-color: #bdbdbd;
}

.sector-tab-btn.active {
  background: #e0e0e0;
  border-color: #bdbdbd;
}

/* ─── PROFILE SECTOR SUMMARY ─────────────────────────────── */

.profile-sector-summary {
  margin-bottom: 0;
  padding-bottom: 1.5rem;
}

/* ─── POSICIONES TABLE ───────────────────────────────────── */

.posiciones-table {
  background: #f5f2ec;
  padding: 0 1.25rem;
  margin: 0.5rem 0 1.5rem;
}

.posicion-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  align-items: baseline;
}

.posicion-row:last-child {
  border-bottom: none;
}

.posicion-row.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

.posicion-pregunta {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 600;
  color: #888;
  line-height: 1.3;
}

.posicion-respuesta {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-dark);
  line-height: 1.3;
}

.posicion-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 3px;
  font-family: var(--font-title);
  font-size: 8px;
  font-weight: 800;
  color: white;
  letter-spacing: 0.3px;
  margin-top: 1px;
}

@media (max-width: 640px) {
  .posiciones-table {
    padding: 0 1rem;
  }

  .posicion-row,
  .posicion-row.three-col {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.75rem 0;
  }

  .posicion-pregunta {
    font-size: 13px;
  }

  .posicion-respuesta {
    font-size: 14px;
    padding-bottom: 0.2rem;
  }

}

.pss-col-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.pss-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.pss-cols.two-col {
  grid-template-columns: 1fr 1fr;
}

.pss-col {
  background: white;
  padding: 1.25rem 0.5rem;
}

.pss-empty {
  color: var(--gray-mid);
  font-size: 14px;
  font-style: italic;
}

.filter-empty-state {
  padding: 1rem 1.25rem;
  color: var(--gray-mid);
  font-size: 13px;
  font-style: italic;
}

/* ─── PROPOSALS CONTAINER ────────────────────────────────── */

.proposals-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 0;
}

.proposals-content-block {
  background: white;
  padding: 1.75rem 2rem 2rem;
}

.proposals-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.proposals-container.two-col {
  grid-template-columns: 1fr 1fr;
}

.proposals-container.two-col .proposals-col:nth-child(2) {
  animation: slideInRight 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.pss-cols.two-col .pss-col:nth-child(2) {
  animation: slideInRight 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.posicion-row.three-col .posicion-respuesta:last-child {
  animation: slideInRight 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.col-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--blue);
}

.col-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─── SECTOR BLOCKS — acordeones ─────────────────────────── */

.sector-block {
  background: var(--white);
  margin-bottom: 0.6rem;
}

.sector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}

.sector-header:hover { background: var(--gray-bg); }

.sector-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--gray-dark);
}

.sector-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
}

.sector-icon img {
  width: 32px;
  height: 32px;
  display: block;
  flex-shrink: 0;
}

.sector-chevron {
  font-size: 18px;
  color: var(--gray-mid);
  transition: transform 0.2s ease;
}

.sector-block.open .sector-chevron { transform: rotate(180deg); }

.sector-body {
  display: none;
  border-top: 1px solid var(--gray-line);
}

.sector-block.open .sector-body { display: block; }

/* ─── PROPOSALS ──────────────────────────────────────────── */

.proposal-row {
  position: relative; /* anchor for the absolutely-positioned comment panel */
  display: flex;
  align-items: flex-start;
  border-bottom: 1px solid #d0d0d0;
}

.proposal-row:last-child { border-bottom: none; }

.proposal-row.alerta-amarillo { background: #fffbea; }
.proposal-row.alerta-rojo     { background: #fff5f5; }

.proposal-item {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
}

.proposal-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.proposal-text { flex: 1; }

.proposal-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.subtema-tag {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 400;
  background: var(--blue-light);
  color: var(--blue-dark);
  padding: 2px 9px;
  border-radius: 0 20px 20px 0;
  border: 1px solid var(--blue-dark);
}

.proposal-source {
  font-size: 11px;
  color: var(--gray-mid);
  font-weight: 600;
}

.proposal-source:hover { color: var(--blue); }

.proposal-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.proposal-desc {
  font-size: 13px;
  color: var(--gray-mid);
  line-height: 1.55;
}

.proposal-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

/* ─── ALERTA & EXPERT BUTTONS ────────────────────────────── */

.alerta-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-dark);
  box-shadow: 3px 3px 0 0 var(--gray-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition), box-shadow var(--transition);
}

.alerta-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.alerta-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 var(--gray-dark);
}

.alerta-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.semaforo-amarillo { background: #f39c12; }
.semaforo-rojo     { background: #e74c3c; }
.alerta-btn.semaforo-accion { background: white; }

.expert-btn {
  width: 32px;
  height: 32px;
  background: var(--blue);
  border-radius: 50%;
  border: 2px solid var(--gray-dark);
  box-shadow: 3px 3px 0 0 var(--gray-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-title);
  color: white;
  flex-shrink: 0;
  transition: transform var(--transition), box-shadow var(--transition);
}

.expert-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 0 var(--gray-dark);
}

.expert-btn:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

.expert-btn.active {
  box-shadow: 1px 1px 0 0 var(--gray-dark);
  transform: translate(2px, 2px);
}

.expert-btn--logo {
  background: white;
  padding: 4px;
}

.expert-btn--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ecb-avatar--logo {
  background: white;
  padding: 2px;
}

.ecb-avatar--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ep-avatar--logo {
  background: white;
  padding: 4px;
}

.ep-avatar--logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ─── EXPERT COMMENT BUBBLES (inline, Google Docs style) ─ */

.proposal-comments-panel {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  width: clamp(240px, calc((100vw - 1100px) / 2 - 16px), 400px);
  margin-left: 16px;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px; /* align with proposal item top padding */
  z-index: 10;
}

.proposal-comments-panel.open {
  display: flex;
}

.expert-comment-bubble,
.alerta-comment-bubble {
  background: var(--white);
  border: 1.5px solid var(--gray-line);
  padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  animation: comment-slide-in 0.18s ease;
}

.expert-comment-bubble {
  border-left: 3px solid var(--blue);
}

.alerta-comment-bubble.semaforo-amarillo { border-left: 3px solid #f39c12; }
.alerta-comment-bubble.semaforo-rojo     { border-left: 3px solid #e74c3c; }
.alerta-comment-bubble.semaforo-accion   { border-left: 3px solid #2F6FCC; }

.acb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.acb-label {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.alerta-comment-bubble.semaforo-amarillo .acb-label { color: #f39c12; }
.alerta-comment-bubble.semaforo-rojo     .acb-label { color: #e74c3c; }
.alerta-comment-bubble.semaforo-accion   .acb-label { color: #2F6FCC; }

@keyframes comment-slide-in {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0); }
}

.ecb-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.ecb-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.ecb-meta { flex: 1; min-width: 0; }

.ecb-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-dark);
}

.ecb-role {
  font-size: 11px;
  color: var(--gray-mid);
  line-height: 1.3;
}

.ecb-close {
  background: none;
  border: none;
  font-size: 15px;
  line-height: 1;
  color: var(--gray-mid);
  cursor: pointer;
  padding: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}

.ecb-close:hover {
  background: var(--gray-bg);
  color: var(--gray-dark);
}

.ecb-text {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--gray-dark);
  margin: 0;
  padding: 0;
  border: none;
  max-height: 260px;
  overflow-y: auto;
}

.ecb-text a,
.modal-text a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.8;
}
.ecb-text a:hover,
.modal-text a:hover {
  opacity: 1;
}

/* ─── EMPTY STATE ────────────────────────────────────────── */

.empty-state {
  padding: 2rem;
  color: var(--gray-mid);
  font-size: 14px;
  font-style: italic;
  text-align: center;
}

/* ─── RED FLAGS ──────────────────────────────────────────── */

#red-flags-section {
  background: #141414;
  color: white;
  padding: 2.5rem 2rem;
  display: none;
}

.rf-inner { max-width: 1100px; margin: 0 auto; }

.rf-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1.5rem;
}

.rf-icon {
  background: var(--orange);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.rf-header-text h2 {
  font-size: 20px;
  font-weight: 800;
}

.rf-header-text p {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-top: 2px;
}

.rf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.rf-card {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.09);
  transition: background var(--transition);
}

.rf-card:hover { background: rgba(255,255,255,0.10); }

.rf-video-thumb {
  aspect-ratio: 16/9;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
}

.rf-video-thumb:hover { background: rgba(0,0,0,0.3); }

.rf-play-btn {
  width: 48px;
  height: 48px;
  background: var(--orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  padding-left: 3px;
  transition: transform var(--transition);
}

.rf-video-thumb:hover .rf-play-btn { transform: scale(1.08); }

.rf-card-body { padding: 14px 16px; }

.rf-badge {
  display: inline-block;
  background: var(--orange);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.rf-card-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 5px;
}

.rf-card-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

/* ─── MODAL ──────────────────────────────────────────────── */

#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  animation: modal-in 0.2s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-line);
}

#modal-icon { font-size: 20px; }

#modal-title {
  font-size: 16px;
  font-weight: 800;
  flex: 1;
  margin: 0 10px;
}

#modal-close {
  background: var(--gray-bg);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--gray-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition);
  flex-shrink: 0;
}

#modal-close:hover { background: var(--gray-line); }

.modal-body { padding: 20px; }

.modal-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--gray-dark);
}

.modal-expert-role {
  font-size: 13px;
  color: var(--gray-mid);
  margin-bottom: 14px;
  font-weight: 600;
}

.modal-quote {
  font-size: 15px;
  line-height: 1.75;
  color: var(--gray-dark);
  border-left: 3px solid var(--blue);
  padding-left: 16px;
  font-style: italic;
}

.modal-footer {
  padding: 12px 20px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--gray-line);
}

.modal-expert-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */

@media (max-width: 860px) {
  .proposals-container.two-col {
    grid-template-columns: 1fr;
  }
}

/* Single-column desktop: reserve right margin so comments don't overflow */
@media (min-width: 860px) {
  .proposals-wrapper:not(:has(.proposals-container.two-col)) .proposals-container {
    padding-right: calc(240px + 2rem);
  }
}

/* In two-column compare mode: comments drop below (no horizontal room) */
.proposals-container.two-col .proposal-row {
  flex-direction: column;
}

.proposals-container.two-col .proposal-comments-panel {
  position: static;
  width: 100%;
  margin-left: 0;
  padding: 0 18px 14px;
}

@media (max-width: 640px) {
  nav { padding: 0 1rem; }
  .nav-subtitle { display: none; }

  .home-header { padding: 2.5rem 1rem 2rem; }

  .candidates-grid {
    grid-template-columns: 1fr;
    padding: 1.5rem 1rem;
    gap: 0.75rem;
  }

  .card-photo {
    margin-bottom: 0;
  }

  .card-name  { font-size: 20px; }
  .card-party { font-size: 13px; }

  .breadcrumb { margin-top: 0; padding: 0.75rem 1rem; }
  #page-metodologia .breadcrumb { padding-top: 2rem; }

  #otros-candidatos-section { padding: 1.5rem 1rem 3rem; }

  .otros-grid { justify-content: flex-start; }

  .profile-top { flex-direction: column; min-height: auto; }

  .profile-photo-col { width: 100%; padding-bottom: 0; }

  #profile-avatar {
    min-height: 220px;
    font-size: 48px;
  }

  .profile-info { padding: 1.5rem 0; gap: 0.75rem; }

  .profile-vp-label { line-height: 1.2; }

  #profile-name {
    font-size: clamp(32px, 8vw, 44px);
    text-align: center;
  }

  /* Stack compare controls: label on top, then select + button */
  .profile-actions {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1rem 2rem;
  }

  .profile-actions label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-mid);
  }

  #compare-select { min-width: 0; }

  #filter-bar .proposals-section-label { margin-bottom: 0; }

  .proposals-wrapper { padding: 1rem 1rem 2.5rem; }
  .proposals-content-block { padding: 0.5rem 0.75rem 2rem; }

  .proposal-row { flex-direction: column; }
  .proposal-comments-panel {
    position: static;
    width: 100%;
    margin-left: 0;
    padding: 0 18px 14px;
  }

  #red-flags-section { padding: 2rem 1rem; }

  .rf-grid { grid-template-columns: 1fr; }

  .modal { margin: 0.5rem; }
}

/* ─── HOME — sectores grid ───────────────────────────── */

.sectores-section {
  padding: 2.5rem 2rem 8rem;
}

.sectores-section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.sectores-section-title {
  font-family: var(--font-main);
  font-size: 28px;
  font-weight: 400;
  color: var(--gray-dark);
  margin-bottom: 2.5rem;
  text-align: center;
}

.sectores-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.sector-card {
  flex: 1 1 0;
  min-width: 120px;
  max-width: 200px;
  aspect-ratio: 1;
  background: var(--white);
  border-radius: 0;
  box-shadow: var(--shadow-card);
  border: none;
  padding: 1.25rem 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: box-shadow var(--transition), transform var(--transition);
  text-align: center;
}

.sector-card:hover,
.sector-card:focus-visible {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
  outline: none;
}

.sector-card-icon {
  width: 112px;
  height: 112px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sector-card-icon img {
  display: block;
  width: 90px;
  height: 90px;
  max-width: 90px;
  max-height: 90px;
  object-fit: contain;
}

.sector-card-name {
  font-family: var(--font-title);
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-dark);
  line-height: 1.2;
}

/* ─── SECTOR PAGE — breadcrumb ──────────────────────── */

#page-sector .breadcrumb {
  background: #d8d8d8;
  max-width: none;
  margin: 0;
  padding-top: 4.5rem;
  padding-left: max(2rem, calc((100% - 1100px) / 2 + 2rem));
  padding-right: max(2rem, calc((100% - 1100px) / 2 + 2rem));
}

/* ─── SECTOR PAGE — hero ─────────────────────────────── */

.sector-hero {
  background: #d8d8d8;
  padding: 2.5rem 2rem 4rem 2rem;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.sector-hero-icon {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sector-hero-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sector-hero h1 {
  font-family: var(--font-title);
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  color: var(--gray-dark);
  margin: 0;
}

/* ─── SECTOR PAGE — layout ───────────────────────────── */

.sector-main { padding: 0; }

.sector-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem 2rem;
}

/* Video column */
.sector-video-col { width: 100%; }

.sector-video-placeholder {
  background: #141414;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  color: #555;
  font-size: 13px;
  text-align: center;
  padding: 0;
  width: 100%;
}

/* Right column */
.sector-right-col {
  width: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--gray-line);
}

/* Candidate sidebar */
.sector-candidates-sidebar {
  display: flex;
  flex-direction: row;
  width: 100%;
  gap: 2px;
}

.sector-candidate-btn {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 1;
  border-radius: 0;
  overflow: hidden;
  border: none;
  cursor: pointer;
  padding: 0;
  display: block;
  opacity: 0.55;
  transition: opacity var(--transition);
}

.sector-candidate-btn:hover { opacity: 0.8; }
.sector-candidate-btn.active { opacity: 1; }

.sector-candidate-avatar {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sector-candidate-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.sector-candidate-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1rem;
}

/* Candidate info panel */
.sector-candidate-info {
  flex: 1;
  min-width: 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid transparent;
}

.sci-header { margin-bottom: 1rem; }

.sci-name {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-dark);
  line-height: 1.15;
}

.sci-party {
  font-size: 13px;
  color: var(--gray-mid);
  margin-top: 3px;
}

/* Chips */
.sci-chips-row {
  display: none;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 1.25rem;
}

.chip-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.chip-dim {
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 100px;
  font-family: var(--font-title);
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid currentColor;
  white-space: nowrap;
}

.chip-baja       { background: #fdecea; color: #b03020; }
.chip-media-baja { background: #fef0ef; color: #c84030; }
.chip-media      { background: #fef6e4; color: #a06010; }
.chip-media-alta { background: #edfaf3; color: #1a7a42; }
.chip-alta       { background: #d5f5e3; color: #145a30; }

/* Chip info button & popup */
.chip-info-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.chip-info-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #bbb;
  background: var(--white);
  color: #888;
  font-size: 11px;
  font-style: italic;
  font-family: Georgia, serif;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: border-color var(--transition), color var(--transition);
  flex-shrink: 0;
}

.chip-info-btn:hover { border-color: #666; color: #444; }

.chip-info-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 12.5px;
  line-height: 1.6;
  width: 260px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 200;
  font-family: var(--font-main);
}

.chip-info-popup p { margin: 0 0 6px; }
.chip-info-popup p:last-child { margin-bottom: 0; }

/* Subtitle & summary */
.sci-subtitle {
  font-size: 19px;
  font-weight: 600;
  color: var(--gray-dark);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.sci-summary {
  font-size: 14px;
  color: #444;
  line-height: 1.7;
  margin-bottom: 1.75rem;
}

.sci-summary p + p { margin-top: 0.85em; }

.sci-footer { display: flex; justify-content: flex-end; }

.sci-link {
  background: none;
  border: none;
  color: var(--blue);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sci-link:hover { color: var(--blue-dark); }

.sci-empty {
  color: var(--gray-mid);
  font-size: 14px;
  padding: 2rem 0;
}

/* Ver otros sectores */
#otros-sectores-section {
  padding: 2rem 2rem 2.5rem;
  border-top: 2px solid var(--gray-line);
  background: #e4e4e4;
}

/* ─── SECTOR RESPONSIVE ──────────────────────────────── */

@media (max-width: 640px) {
  .home-instructions { font-size: 18px; padding: 3rem 1rem 0; }

  .sectores-section { padding: 1.75rem 1rem 2.5rem; }

  .sectores-section-title { font-size: 18px; }

  .sectores-grid { gap: 10px; }

  .sector-card {
    flex: 0 0 calc(50% - 5px);
    max-width: none;
    aspect-ratio: unset;
    flex-direction: column;
    text-align: center;
    padding: 1.25rem 0.75rem;
    gap: 8px;
    align-items: center;
    justify-content: center;
  }

  .sector-card-icon { width: 64px; height: 64px; }

  .sector-card-icon img {
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
  }

  .sector-card-name { font-size: 13px; }

  .sector-hero {
    padding: 1.75rem 1rem;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  .sector-hero h1 { font-size: 22px; text-align: center; }

  .sector-hero-icon { width: 42px; height: 42px; }

  .sector-layout {
    padding: 1.5rem 1rem 3rem;
    gap: 1.25rem;
  }

  #page-sector .breadcrumb { padding-top: 2rem; }

  .sector-candidates-sidebar { gap: 2px; }

  .sci-name { font-size: 18px; }

  .sci-chips-row { gap: 8px; }

  .chip { font-size: 11px; padding: 4px 9px; }

  .chip-info-popup { width: 230px; right: auto; left: 0; }

  #otros-sectores-section { padding: 2.5rem 1rem 3rem; }

  #otros-sectores-section .otros-title { font-size: 22px; }
}

/* ─── FOOTER ─────────────────────────────────────────────── */

#site-footer {
  background: #1a1a1a;
  color: rgba(255,255,255,0.75);
  padding: 3.5rem 2rem 0;
  margin-top: auto;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  align-items: start;
}

.footer-logo-link { display: inline-block; margin-bottom: 1.25rem; }

.footer-logo {
  height: 42px;
  width: auto;
  display: block;
}

.footer-tagline {
  font-size: 14px;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.footer-desc {
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1.5rem;
}

.footer-social {
  display: flex;
  gap: 16px;
  align-items: center;
}

.footer-social a {
  display: flex;
  align-items: center;
  opacity: 0.6;
  transition: opacity var(--transition);
  text-decoration: none;
}

.footer-social a:hover { opacity: 1; }

.footer-social img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.footer-col-title {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links li button {
  font-family: var(--font-main);
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  background: none;
  border: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: color var(--transition);
}

.footer-links li button:hover { color: white; }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 0 2rem;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

.footer-bottom a {
  color: rgba(255,255,255,0.55);
  text-decoration: underline;
}

.footer-bottom a:hover { color: white; }

@media (max-width: 768px) {
  #site-footer { padding: 2.5rem 1.25rem 0; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-bottom: 2rem;
  }
}

