/* Atlas Asio — componente .atlas-tree (blog + landing + /lineas/)
   Tokens: --color-surface, --color-ocre, --color-wine, --color-black,
   --color-white, --font-titles, --font-body (Identidad / custom.css / landing.css) */

.atlas-tree {
  box-sizing: border-box;
  width: min(100%, var(--hub-max, 42rem));
  max-width: 100%;
  margin: 1.1rem auto 1.4rem;
  padding: 0.85rem 1.2rem 1.1rem;
  overflow-x: auto;
  background: var(--color-surface, #f7f4f0);
  border: 1px solid rgba(26, 26, 26, 0.1);
  border-left: 4px solid var(--color-ocre, #c49a6c);
}

.atlas-tree--compact {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: min(100%, var(--hub-max, 42rem));
  margin-inline: auto;
}

.atlas-tree__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 0.9rem;
  margin: 0 0 0.75rem;
  padding: 0;
  font-family: var(--font-body, "Lato", sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(51, 51, 51, 0.7);
}

.atlas-tree__legend--band {
  margin-bottom: 0.25rem;
}

.atlas-tree__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.atlas-tree__legend-item--sire::before {
  content: "♂";
  font-family: var(--font-titles, "Oswald", sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-wine, #8b1a1a);
  -webkit-text-stroke: 0.4px currentColor;
  paint-order: stroke fill;
}

.atlas-tree__legend-item--dam::before {
  content: "♀";
  font-family: var(--font-titles, "Oswald", sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-ocre, #c49a6c);
  -webkit-text-stroke: 0.4px currentColor;
  paint-order: stroke fill;
}

.atlas-tree__legend-item--pup::before {
  content: "🐾";
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1;
  color: inherit;
  -webkit-text-stroke: 0;
}

.atlas-tree__gen {
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.atlas-tree__gen--pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  column-gap: 0.45rem;
  padding-bottom: 0.45rem;
}

.atlas-tree__gen--pair > .atlas-tree__node:first-child {
  grid-column: 1;
  width: 100%;
  justify-self: stretch;
}

.atlas-tree__gen--pair > .atlas-tree__x {
  grid-column: 2;
  align-self: center;
  justify-self: center;
}

.atlas-tree__gen--pair > .atlas-tree__node:last-of-type {
  grid-column: 3;
  width: 100%;
  justify-self: stretch;
}

.atlas-tree__gen--pair::after {
  content: "";
  position: absolute;
  left: 25%;
  right: 25%;
  bottom: 0;
  height: 1.5px;
  background: var(--color-ocre, #c49a6c);
}

.atlas-tree__gen--child,
.atlas-tree__gen--solo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.atlas-tree__gen--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  column-gap: 0.85rem;
  padding-top: 0.45rem;
}

.atlas-tree__gen--split > .atlas-tree__node {
  width: 100%;
  justify-self: stretch;
}

.atlas-tree__gen--split::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 1.5px;
  background: var(--color-ocre, #c49a6c);
}

.atlas-tree__node {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-sizing: border-box;
  min-height: 2.55rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(26, 26, 26, 0.14);
  background: var(--color-white, #fff);
  color: var(--color-black, #1a1a1a);
  font-family: var(--font-body, "Lato", sans-serif);
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: normal;
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.04);
}

.atlas-tree__node::before {
  flex-shrink: 0;
  font-family: var(--font-titles, "Oswald", sans-serif);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  -webkit-text-stroke: 0.55px currentColor;
  paint-order: stroke fill;
}

.atlas-tree__node--sire::before {
  content: "♂";
  color: var(--color-wine, #8b1a1a);
}

.atlas-tree__node--dam::before {
  content: "♀";
  color: var(--color-ocre, #c49a6c);
}

.atlas-tree__node--pup::before {
  content: "🐾";
  font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: inherit;
  -webkit-text-stroke: 0;
}

.atlas-tree__node--focus {
  border-color: var(--color-wine, #8b1a1a);
  border-width: 2px;
  font-family: var(--font-titles, "Oswald", sans-serif);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-wine, #8b1a1a);
  box-shadow: none;
}

.atlas-tree__gen--child > .atlas-tree__node--focus,
.atlas-tree__gen--solo > .atlas-tree__node--focus {
  width: auto;
  min-width: min(100%, 14rem);
  max-width: 100%;
}

.atlas-tree__x {
  color: var(--color-ocre, #c49a6c);
  font-family: var(--font-titles, "Oswald", sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  user-select: none;
  padding: 0 0.1rem;
}

.atlas-tree__note {
  font-family: var(--font-body, "Lato", sans-serif);
  font-size: 0.78rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
  color: rgba(51, 51, 51, 0.68);
  text-align: center;
}

.atlas-tree__sub {
  display: block;
  font-size: 0.78em;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(51, 51, 51, 0.72);
  line-height: 1.15;
}

.atlas-tree__label {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  line-height: 1.2;
}

.atlas-tree__node--pup .atlas-tree__sub {
  color: rgba(26, 26, 26, 0.65);
}

.atlas-tree-band__axis .atlas-tree__gen--split > .atlas-tree__node {
  min-height: 3.1rem;
}

.atlas-tree__edge {
  width: 1.5px;
  height: 0.85rem;
  margin: 0 auto;
  background: var(--color-ocre, #c49a6c);
  flex-shrink: 0;
  align-self: center;
}

.atlas-tree-caption {
  margin: -0.55rem auto 1.25rem !important;
  max-width: 42rem;
  text-align: center;
  font-size: 0.82rem !important;
  color: rgba(51, 51, 51, 0.72);
}

.atlas-tree-caption code {
  font-size: 0.9em;
}

/* Banda de varios ejes (landing / índice /lineas/)
   minmax ≥22rem: a ~900–1000px no se fuerzan 3 columnas ~278px
   (el split Ronda|Plata Bocadura queda ilegible ahí). */
.atlas-tree-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
  gap: 2rem 1.5rem;
  align-items: stretch;
  margin: 1.75rem 0 1.25rem;
}

.atlas-tree-band__axis {
  display: flex;
  flex-direction: column;
  text-align: center;
  container-type: inline-size;
  container-name: atlas-axis;
}

.atlas-tree-band__axis > h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-titles, "Oswald", sans-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--color-black, #1a1a1a);
}

.atlas-tree-band__axis > p {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: rgba(51, 51, 51, 0.75);
}

.atlas-tree-band__axis .atlas-tree {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  /* Misma caja que el eje A (3 generaciones: pair + pair + child) */
  min-height: 12.5rem;
  width: 100%;
  max-width: 100%;
  margin-top: 0.5rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem 0.95rem;
  box-sizing: border-box;
}

.atlas-tree-band__axis .atlas-tree__node {
  font-size: 0.84rem;
  min-height: 2.65rem;
  padding: 0.4rem 0.5rem;
  overflow-wrap: break-word;
  hyphens: auto;
}

.atlas-tree-band__axis .atlas-tree__node--focus {
  font-size: 0.86rem;
}

.atlas-tree-band__axis .atlas-tree__gen--split {
  column-gap: 0.55rem;
}

.atlas-tree-band__axis > a {
  font-weight: 700;
  font-size: 0.92rem;
}

/* Eje estrecho: cachorros del split en columna (legibles) */
@container atlas-axis (max-width: 20rem) {
  .atlas-tree__gen--split {
    grid-template-columns: 1fr;
    row-gap: 0.4rem;
    column-gap: 0;
  }

  .atlas-tree__gen--split::before {
    left: 35%;
    right: 35%;
  }
}

@media screen and (max-width: 40em) {
  .atlas-tree {
    width: 100%;
    padding: 0.75rem 0.7rem 0.95rem;
  }

  .atlas-tree--compact {
    width: 100%;
  }

  .atlas-tree-band {
    grid-template-columns: 1fr;
  }

  .atlas-tree__node {
    font-size: 0.8rem;
    min-height: 2.35rem;
    padding: 0.3rem 0.4rem;
  }

  .atlas-tree__node--focus {
    font-size: 0.82rem;
  }

  .atlas-tree__gen--pair::after,
  .atlas-tree__gen--split::before {
    left: 18%;
    right: 18%;
  }
}
