/**
 * Memorias de Sangre, Magia y Acero — estilos para layout Tailwind
 * Navegación móvil, panel y pie de página unificado
 */

/* Spoiler de cronología: estilo redactado + texto borroso (en proceso, se revelará con el tiempo) */
.cronica-spoiler {
  border: 1px solid rgba(212, 17, 17, 0.25);
  border-radius: 0.5rem;
  background: #0a0a0c;
  padding: 1rem 1.25rem;
  user-select: none;
  overflow: hidden;
}

/* Mientras está redactado: el texto se ve pero borroso, no se puede leer */
.cronica-spoiler.redacted .cronica-spoiler-content {
  filter: blur(8px);
  pointer-events: none;
}

/* Para revelar en el futuro: quitar la clase .redacted del contenedor */
.cronica-spoiler:not(.redacted) .cronica-spoiler-content {
  filter: none;
  pointer-events: auto;
  user-select: text;
}

/* Panel de navegación móvil (nuevo header) */
.nav-mobile-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.2s;
}

.nav-mobile-panel.is-open {
  max-height: 80vh;
  opacity: 1;
}

/* Dropdown en la tarjeta de portada para Dinastias y linajes */
.hero-dynasty-dropdown {
  position: relative;
}

.hero-dynasty-menu {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.hero-dynasty-item {
  border: 1px solid rgba(212, 17, 17, 0.25);
  border-radius: 0.4rem;
  background: rgba(212, 17, 17, 0.05);
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
  padding: 0.35rem 0.3rem;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hero-dynasty-item:hover,
.hero-dynasty-item:focus-visible {
  background: rgba(212, 17, 17, 0.15);
  border-color: rgba(212, 17, 17, 0.4);
  color: #d41111;
  outline: none;
}

.hero-dynasty-item-active {
  background: rgba(212, 17, 17, 0.2);
  border-color: rgba(212, 17, 17, 0.45);
  color: #d41111;
}

@media (hover: hover) and (pointer: fine) {
  .hero-dynasty-dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 0.55rem;
  }

  .hero-dynasty-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 0;
    padding: 0.5rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(212, 17, 17, 0.25);
    background: #0a0a0c;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 60;
  }

  .hero-dynasty-dropdown:hover .hero-dynasty-menu,
  .hero-dynasty-dropdown:focus-within .hero-dynasty-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }
}

/* Dropdown desktop para Dinastias y linajes */
@media (min-width: 1024px) {
  .nav-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
  }

  .nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  .nav-dropdown-toggle::after {
    content: "";
    width: 0;
    height: 0;
    border-left: 0.26rem solid transparent;
    border-right: 0.26rem solid transparent;
    border-top: 0.34rem solid currentColor;
    opacity: 0.85;
    transform: translateY(1px);
  }

  .nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 12rem;
    padding: 0.4rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(212, 17, 17, 0.25);
    background: #0a0a0c;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    z-index: 60;
  }

  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-dropdown-item {
    display: block;
    border-radius: 0.45rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #cbd5e1;
    transition: background-color 0.15s ease, color 0.15s ease;
  }

  .nav-dropdown-item:hover,
  .nav-dropdown-item:focus-visible {
    background: rgba(212, 17, 17, 0.12);
    color: #d41111;
    outline: none;
  }

  .nav-dropdown-item-active {
    background: rgba(212, 17, 17, 0.14);
    color: #d41111;
    font-weight: 700;
  }
}

/* Pie de página (mantener estructura actual) */
.site-footer {
  background: #0a0a0c;
  border-top: 1px solid rgba(212, 17, 17, 0.2);
  padding: 2rem 1rem;
  margin-top: auto;
}

.site-footer .footer-content {
  max-width: 80rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 600px) {
  .site-footer .footer-content {
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  }
}

.site-footer .footer-section h4 {
  font-size: 0.9rem;
  color: #d41111;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.site-footer .footer-section p,
.site-footer .footer-section a {
  color: #94a3b8;
  font-size: 0.9rem;
  text-decoration: none;
}

.site-footer .footer-section a:hover {
  color: #d41111;
}

.site-footer .footer-section ul {
  list-style: none;
}

.site-footer .footer-section ul li {
  margin-bottom: 0.25rem;
}

.site-footer .footer-social-inline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.site-footer .footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #94a3b8;
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.2s;
}

.site-footer .footer-social-link:hover {
  color: #d41111;
}

.site-footer .footer-social-link .material-symbols-outlined {
  font-size: 1.25rem;
}

.site-footer .footer-credits {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(212, 17, 17, 0.2);
  font-size: 0.85rem;
  color: #64748b;
}

.site-footer .footer-credits a {
  color: #d41111;
  text-decoration: none;
}

/* Sin fuentes web opcionales: tipografía y iconos de respaldo */
html.no-webfonts .font-display {
  font-family: Georgia, "Times New Roman", Times, serif;
}

html.no-webfonts .material-symbols-outlined {
  font-family: inherit !important;
  font-variation-settings: normal;
  font-feature-settings: normal;
  letter-spacing: normal;
  text-transform: none;
}

/* Banner de consentimiento de cookies */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100000;
  padding: 1rem;
  background: rgba(10, 10, 12, 0.97);
  border-top: 1px solid rgba(212, 17, 17, 0.35);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

.cookie-consent-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 900px) {
  .cookie-consent-inner {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
  }
}

.cookie-consent-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 0 0 0.5rem;
}

.cookie-consent-desc {
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.55;
  margin: 0 0 0.5rem;
}

.cookie-consent-policy-link {
  color: #d41111;
  text-decoration: underline;
  font-weight: 600;
}

.cookie-consent-policy-link:hover {
  color: #ff4d4d;
}

.cookie-consent-settings {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(212, 17, 17, 0.08);
  border: 1px solid rgba(212, 17, 17, 0.2);
}

.cookie-consent-settings-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #d41111;
  margin: 0 0 0.5rem;
}

.cookie-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  cursor: pointer;
  line-height: 1.45;
}

/* Mapa de mundo (pruebas): mantener leyenda y mapa visibles a la vez en escritorio */
@media (min-width: 1024px) {
  .map-legend-panel {
    height: 70vh;
    min-height: 400px;
    display: flex;
    flex-direction: column;
  }

  .map-legend-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
  }
}

.cookie-consent-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.cookie-consent-save-custom {
  margin-top: 0.75rem;
  width: 100%;
  max-width: 16rem;
}

.cookie-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-consent-btn {
  padding: 0.55rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s;
}

.cookie-consent-btn-primary {
  background: #d41111;
  color: #fff;
}

.cookie-consent-btn-primary:hover {
  background: #b30e0e;
}

.cookie-consent-btn-primary-alt {
  background: #334155;
  color: #fff;
}

.cookie-consent-btn-primary-alt:hover {
  background: #1e293b;
}

.cookie-consent-btn-secondary {
  background: rgba(148, 163, 184, 0.15);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.cookie-consent-btn-secondary:hover {
  background: rgba(148, 163, 184, 0.25);
}

.cookie-consent-btn-ghost {
  background: transparent;
  color: #94a3b8;
  text-decoration: underline;
}

.cookie-consent-btn-ghost:hover {
  color: #f1f5f9;
}

/* Contenedor del mapa (Leaflet) */
#map-container {
  width: 100%;
  height: 70vh;
  min-height: 400px;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(212, 17, 17, 0.2);
  background: #0a0a0c;
}

#map-container .leaflet-tile-pane,
#map-container .leaflet-map-pane,
#map-container .leaflet-pane {
  background: #0a0a0c !important;
}

#map-container .leaflet-container {
  background: #0a0a0c !important;
  cursor: grab;
}

#map-container .leaflet-container:active {
  cursor: grabbing;
}

#map-container .leaflet-control-zoom {
  border: 1px solid rgba(212, 17, 17, 0.3) !important;
  border-radius: 0.5rem;
  overflow: hidden;
}

#map-container .leaflet-control-zoom a {
  background: #1c1c24 !important;
  color: #e8e6e3 !important;
  font-weight: bold;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
}

#map-container .leaflet-control-zoom a:hover {
  background: #2a2a34 !important;
  color: #d41111 !important;
}

.leaflet-popup-content-wrapper {
  background: #1c1c24;
  color: #e8e6e3;
  border: 1px solid #2a2a34;
  border-radius: 0.5rem;
}

.leaflet-popup-tip {
  background: #1c1c24;
}

.leaflet-popup-content {
  margin: 0.75rem 1rem;
  min-width: 180px;
}

.leaflet-popup-content a {
  color: #d41111;
  text-decoration: none;
}

.leaflet-popup-content a:hover {
  text-decoration: underline;
}

/* Árbol genealógico por época (cronica-genealogia-test.html) */
.genealogy-shell {
  border: 1px solid rgba(173, 125, 72, 0.38);
  border-radius: 1rem;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 14% 12%, rgba(173, 125, 72, 0.16), transparent 46%),
    radial-gradient(circle at 84% 78%, rgba(80, 52, 24, 0.2), transparent 52%),
    linear-gradient(145deg, rgba(35, 27, 18, 0.96), rgba(16, 13, 10, 0.96));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.36);
}

.genealogy-kicker {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #d8ad74;
}

.genealogy-title {
  margin: 0.4rem 0 0.55rem;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1.2;
  font-weight: 800;
  color: #f9e9d1;
}

.genealogy-description {
  margin: 0;
  max-width: 50rem;
  color: #d0beaa;
  font-size: 0.94rem;
  line-height: 1.65;
}

.genealogy-controls {
  margin-top: 1.15rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.9rem;
}

.genealogy-label {
  color: #f5e8d6;
  font-size: 0.87rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.genealogy-select {
  appearance: none;
  border-radius: 0.6rem;
  border: 1px solid rgba(213, 164, 101, 0.52);
  background: linear-gradient(130deg, rgba(53, 39, 27, 0.98), rgba(32, 24, 18, 0.98));
  color: #f8efe3;
  font-size: 0.93rem;
  min-width: min(100%, 22rem);
  max-width: 100%;
  padding: 0.6rem 2rem 0.6rem 0.85rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.genealogy-select:focus-visible {
  border-color: rgba(229, 182, 122, 0.95);
  box-shadow: 0 0 0 3px rgba(183, 130, 62, 0.28);
}

.genealogy-current-view {
  margin: 0;
  color: #e7d9c7;
  font-size: 0.85rem;
  font-style: italic;
}

.genealogy-legend {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(194, 153, 104, 0.25);
  background: rgba(47, 35, 24, 0.45);
}

.genealogy-legend-item {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #f5e4cf;
  font-size: 0.84rem;
}

.genealogy-tree-host {
  margin-top: 1rem;
}

.genealogy-tree-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 0.85rem;
  border: 1px solid rgba(173, 125, 72, 0.32);
  background:
    linear-gradient(180deg, rgba(37, 28, 20, 0.7), rgba(22, 16, 12, 0.75)),
    repeating-linear-gradient(
      135deg,
      rgba(181, 140, 92, 0.06) 0,
      rgba(181, 140, 92, 0.06) 10px,
      rgba(107, 78, 46, 0.04) 10px,
      rgba(107, 78, 46, 0.04) 20px
    );
  padding: 1rem 0.75rem;
}

.genealogy-tree-stage {
  position: relative;
  isolation: isolate;
  padding: 1.15rem 1.25rem 1.35rem;
}

.genealogy-tree-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.genealogy-link {
  stroke: rgba(196, 153, 103, 0.66);
  stroke-width: 2.25;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.genealogy-link--couple {
  stroke: rgba(226, 188, 136, 0.72);
}

.genealogy-link--branch {
  stroke: rgba(178, 139, 95, 0.66);
}

.genealogy-tree-levels {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2.4rem;
}

.genealogy-level {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 1rem;
  flex-wrap: nowrap;
}

.genealogy-node {
  width: 190px;
  border-radius: 0.85rem;
  border: 1px solid rgba(189, 140, 84, 0.5);
  background:
    linear-gradient(140deg, rgba(56, 40, 26, 0.95), rgba(34, 25, 16, 0.97)),
    radial-gradient(circle at 20% 0%, rgba(255, 224, 180, 0.18), transparent 55%);
  padding: 0.72rem 0.7rem 0.68rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
  transition: border-color 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease;
}

.genealogy-node:hover {
  border-color: rgba(222, 174, 117, 0.9);
  transform: translateY(-2px);
}

.genealogy-node-name {
  margin: 0;
  color: #fff7ea;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 700;
}

.genealogy-node-subtitle {
  margin: 0.25rem 0 0;
  color: #f6d8b0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.genealogy-node-house {
  margin: 0.28rem 0 0;
  color: #c9ae8f;
  font-size: 0.79rem;
  line-height: 1.35;
}

.genealogy-node-status {
  margin: 0.58rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(198, 162, 121, 0.28);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.genealogy-node-status-text {
  color: #f2dfc7;
  font-size: 0.79rem;
  line-height: 1.3;
}

.genealogy-leaf {
  width: 0.9rem;
  height: 0.9rem;
  display: inline-block;
  border-radius: 0.1rem 0.85rem 0.1rem 0.85rem;
  transform: rotate(-34deg);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  transition: background-color 0.28s ease, filter 0.28s ease, transform 0.28s ease;
}

.genealogy-leaf--alive {
  background: linear-gradient(145deg, #9ee36d, #3f8b32);
}

.genealogy-leaf--dead {
  background: linear-gradient(145deg, #b58a57, #6b4422);
}

.genealogy-leaf--unknown {
  background: linear-gradient(145deg, #a5b2c7, #59657c);
}

.genealogy-node.is-alive {
  border-color: rgba(103, 177, 84, 0.78);
}

.genealogy-node.is-dead {
  border-color: rgba(168, 114, 71, 0.78);
}

.genealogy-node.is-unknown {
  border-color: rgba(125, 137, 156, 0.72);
}

.genealogy-node.is-alive .genealogy-leaf,
.genealogy-node.is-dead .genealogy-leaf,
.genealogy-node.is-unknown .genealogy-leaf {
  transform: rotate(-34deg) scale(1.04);
}

.genealogy-sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.genealogy-image-view {
  margin: 0;
  border-radius: 0.85rem;
  border: 1px solid rgba(173, 125, 72, 0.32);
  overflow: hidden;
  background: rgba(18, 14, 10, 0.9);
}

.genealogy-era-image {
  width: 100%;
  display: block;
}

.genealogy-image-caption {
  margin: 0;
  padding: 0.7rem 0.9rem;
  color: #d5bea3;
  font-size: 0.82rem;
  border-top: 1px solid rgba(173, 125, 72, 0.32);
}

@media (max-width: 1024px) {
  .genealogy-shell {
    padding: 1.1rem;
  }

  .genealogy-level {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .genealogy-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .genealogy-select {
    width: 100%;
    min-width: 0;
  }

  .genealogy-node {
    width: 176px;
  }
}

/* Ajustes layout 2 columnas: cronica-genealogia-test.html */
.genealogy-history-section {
  position: relative;
}

.genealogy-shell {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.genealogy-layout {
  display: grid;
  grid-template-columns: minmax(17rem, 34%) minmax(0, 66%);
  gap: 1rem;
  align-items: start;
}

.genealogy-timeline-panel,
.genealogy-tree-panel {
  border: 1px solid rgba(173, 125, 72, 0.34);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 16% 12%, rgba(173, 125, 72, 0.15), transparent 46%),
    radial-gradient(circle at 83% 86%, rgba(80, 52, 24, 0.2), transparent 54%),
    linear-gradient(145deg, rgba(35, 27, 18, 0.97), rgba(16, 13, 10, 0.96));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

.genealogy-timeline-panel {
  padding: 1rem;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.genealogy-tree-panel {
  position: sticky;
  top: 100px;
  padding: 1rem;
}

.genealogy-panel-title {
  margin: 0.45rem 0 0.5rem;
  font-size: clamp(1.22rem, 2.1vw, 1.7rem);
  line-height: 1.25;
  font-weight: 800;
  color: #faead1;
}

.genealogy-timeline-panel .genealogy-description {
  font-size: 0.9rem;
  line-height: 1.6;
}

.genealogy-era-nav {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.genealogy-era-button {
  width: 100%;
  text-align: left;
  border-radius: 0.8rem;
  border: 1px solid rgba(190, 148, 94, 0.48);
  padding: 0.72rem 0.78rem;
  background:
    linear-gradient(130deg, rgba(50, 36, 24, 0.94), rgba(31, 23, 16, 0.98)),
    radial-gradient(circle at 88% 10%, rgba(227, 185, 129, 0.12), transparent 48%);
  color: #f2dec5;
  display: grid;
  gap: 0.2rem;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.genealogy-era-button:hover {
  border-color: rgba(224, 177, 114, 0.85);
  transform: translateY(-1px);
}

.genealogy-era-button:focus-visible {
  outline: none;
  border-color: rgba(238, 189, 123, 0.95);
  box-shadow: 0 0 0 3px rgba(185, 134, 70, 0.28);
}

.genealogy-era-button.is-active {
  border-color: rgba(142, 214, 103, 0.75);
  background:
    linear-gradient(130deg, rgba(40, 48, 27, 0.95), rgba(27, 34, 20, 0.98)),
    radial-gradient(circle at 88% 10%, rgba(142, 214, 103, 0.2), transparent 52%);
  box-shadow: 0 0 0 1px rgba(142, 214, 103, 0.35), 0 10px 20px rgba(0, 0, 0, 0.24);
}

.genealogy-era-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: #fff4e2;
  line-height: 1.35;
}

.genealogy-era-date {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #d7b386;
}

.genealogy-era-description {
  font-size: 0.78rem;
  line-height: 1.45;
  color: #ceb49a;
}

.genealogy-controls--fallback {
  display: none;
}

.genealogy-tree-header {
  margin-bottom: 0.95rem;
}

.genealogy-tree-header .genealogy-title {
  margin-top: 0.35rem;
  margin-bottom: 0.45rem;
  font-size: clamp(1.35rem, 2.3vw, 1.85rem);
}

.genealogy-tree-header .genealogy-current-view {
  font-size: 0.88rem;
  color: #e8dac9;
}

.genealogy-tree-header .genealogy-legend {
  margin-top: 0.75rem;
}

.genealogy-tree-panel .genealogy-tree-host {
  margin-top: 0;
}

.genealogy-tree-panel .genealogy-tree-scroll {
  border-color: rgba(173, 125, 72, 0.38);
  background:
    linear-gradient(180deg, rgba(31, 23, 16, 0.76), rgba(20, 15, 11, 0.78)),
    repeating-linear-gradient(
      135deg,
      rgba(181, 140, 92, 0.06) 0,
      rgba(181, 140, 92, 0.06) 10px,
      rgba(107, 78, 46, 0.04) 10px,
      rgba(107, 78, 46, 0.04) 20px
    );
}

@media (max-width: 1024px) {
  .genealogy-layout {
    grid-template-columns: 1fr;
    gap: 0.95rem;
  }

  .genealogy-timeline-panel {
    max-height: none;
    overflow-y: visible;
  }

  .genealogy-tree-panel {
    position: static;
    top: auto;
  }
}

@media (max-width: 640px) {
  .genealogy-timeline-panel,
  .genealogy-tree-panel {
    padding: 0.95rem;
  }

  .genealogy-era-button {
    padding: 0.68rem 0.72rem;
  }
}

/* Ajustes finales de layout para cronica-genealogia-test.html */
.genealogy-history-section {
  width: 100%;
  max-width: min(1800px, calc(100vw - 32px));
  margin-inline: auto;
  padding-inline: clamp(12px, 2vw, 32px);
}

.genealogy-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.genealogy-era-nav {
  display: block;
  margin-top: 1rem;
}

.genealogy-era-group + .genealogy-era-group {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(173, 125, 72, 0.22);
}

.genealogy-era-group-title {
  margin: 0 0 0.7rem;
  color: #f3d8b4;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
}

.genealogy-era-group-events {
  display: grid;
  gap: 0.62rem;
}

.genealogy-timeline-panel {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.genealogy-tree-panel {
  position: static;
  top: auto;
  min-width: 0;
  width: 100%;
}

.genealogy-tree-host {
  min-width: 0;
  width: 100%;
}

.genealogy-tree-scroll {
  width: 100%;
  overflow-x: auto;
}

@media (min-width: 1400px) {
  .genealogy-layout {
    grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  .genealogy-layout {
    grid-template-columns: 1fr;
  }

  .genealogy-timeline-panel {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}
