/* Page-specific */

.home-intro .content-two-col {
  align-items: center;
}

.section-header {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto var(--space-lg);
}

.section-header .eyebrow {
  margin-bottom: var(--space-xs);
}

.section-header h2 {
  margin-bottom: var(--space-sm);
  color: var(--color-navy-deep);
}

.legado-access {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.estatutos-content {
  max-height: 24rem;
  overflow-y: auto;
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.estatutos-content h3 {
  font-size: 1rem;
  margin: var(--space-md) 0 var(--space-xs);
  color: var(--color-primary);
}

.estatutos-content h3:first-child {
  margin-top: 0;
}

.donate-block {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
  margin-bottom: var(--space-lg);
  border-top: 4px solid var(--color-accent);
}

.donate-block h2 {
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.unete-section {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

.unete-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.pagination a {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.9rem;
}

.pagination a:hover,
.pagination a.is-active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.related-posts {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.related-posts h3 {
  margin-bottom: var(--space-md);
}

.mision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.mision-card {
  padding: var(--space-md);
  background: rgba(101, 47, 137, 0.05);
  border-radius: var(--radius);
  border-left: 3px solid var(--color-primary);
}

.mision-card h3 {
  font-size: 1rem;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.mision-card p {
  font-size: 0.9rem;
  margin: 0;
}

.hilo-section {
  scroll-margin-top: calc(var(--header-height) + 4.5rem);
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-border);
}

.hilo-section:first-of-type {
  border-top: none;
  padding-top: var(--space-md);
}

.hilo-section h2 {
  color: var(--color-primary-vivid);
  margin-bottom: var(--space-md);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}

.hilo-intro {
  margin-bottom: var(--space-lg);
  max-width: 48rem;
}

.hilo-landing .hilo-epigraph {
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
}

.hilo-landing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* ==========================================================================
   Organigrama — Órganos de dirección
   ========================================================================== */
.org-chart {
  overflow-x: auto;
  padding: var(--space-md) 0 var(--space-xs);
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.org-tree,
.org-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.org-tree {
  display: inline-block;
  text-align: center;
  min-width: 100%;
}

.org-tree ul {
  position: relative;
  padding-top: 16px;
  white-space: nowrap;
}

.org-tree li {
  position: relative;
  display: inline-block;
  vertical-align: top;
  text-align: center;
  padding: 16px 3px 0;
  white-space: normal;
}

/* Conector horizontal (mitad derecha e izquierda de cada nodo) */
.org-tree li::before,
.org-tree li::after {
  content: "";
  position: absolute;
  top: 0;
  right: 50%;
  width: 50%;
  height: 16px;
  border-top: 2px solid var(--color-border);
}

.org-tree li::after {
  right: auto;
  left: 50%;
  border-left: 2px solid var(--color-border);
}

/* Nodo único: solo baja la línea vertical desde su padre */
.org-tree li:only-child::before,
.org-tree li:only-child::after {
  display: none;
}

.org-tree li:only-child {
  padding-top: 16px;
}

/* Recorta los extremos de la línea horizontal */
.org-tree li:first-child::before,
.org-tree li:last-child::after {
  border: 0 none;
}

.org-tree li:last-child::before {
  border-right: 2px solid var(--color-border);
  border-radius: 0 6px 0 0;
}

.org-tree li:first-child::after {
  border-radius: 6px 0 0 0;
}

/* Línea vertical que conecta cada grupo de hijos con su padre */
.org-tree ul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 16px;
  border-left: 2px solid var(--color-border);
}

/* --- Rama compacta: hijos apilados en vertical (tipo bracket) --- */
.org-tree ul.org-stack {
  display: block;
  text-align: left;
  white-space: normal;
  padding-top: 16px;
}

.org-tree ul.org-stack > li {
  display: block;
  text-align: left;
  padding: 0 0 0 22px;
  margin-top: 6px;
}

.org-tree ul.org-stack > li:first-child {
  margin-top: 0;
}

/* Línea vertical continua a la izquierda de la lista */
.org-tree ul.org-stack > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: -6px;
  width: 0;
  height: calc(100% + 6px);
  border-top: 0;
  border-left: 2px solid var(--color-border);
  border-radius: 0;
}

.org-tree ul.org-stack > li:first-child::before {
  top: -16px;
  height: calc(50% + 16px);
}

.org-tree ul.org-stack > li:last-child::before {
  height: calc(50% + 6px);
}

/* Tick horizontal hacia cada chip */
.org-tree ul.org-stack > li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 16px;
  height: 0;
  border-left: 0;
  border-top: 2px solid var(--color-border);
  border-radius: 0;
}

.org-node {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 114px;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1.5px solid var(--color-border);
  background: #fff;
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.18;
  color: var(--color-navy-deep);
  box-shadow: var(--shadow-sm);
  white-space: normal;
}

.org-node span {
  font-weight: 400;
  font-size: 0.64rem;
  opacity: 0.75;
}

.org-node--sm {
  width: 84px;
  min-height: 32px;
  font-size: 0.66rem;
  padding: 5px 6px;
}

/* En listas verticales, los chips se alinean a la izquierda */
.org-tree ul.org-stack .org-node {
  text-align: left;
  align-items: flex-start;
}

.org-tree ul.org-stack .org-node--sm {
  width: 132px;
}

.org-node--gov {
  background: #e8f0fb;
  border-color: #a9c8ee;
}

.org-node--admin {
  background: #f1f1ef;
  border-color: #d4d4d0;
}

.org-node--mis {
  background: #e7f2e9;
  border-color: #b6d9bb;
}

.org-node--hilo {
  background: #e2f1ee;
  border-color: #b1d9d1;
}

.org-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.org-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.org-legend__swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--color-border);
}
