/* SELECCION_START: layout editorial + cards estilo grilla + modal propio */
:root {
  --sel-soft: rgba(255, 255, 255, 0.08);
  --sel-soft-2: rgba(255, 255, 255, 0.16);
  --sel-pill: #7f8185;
  --sel-header-offset: 58px;
  --sel-intro-box-max: 62ch;
}

html,
body.seleccion-page {
  margin: 0;
  padding: 0;
  background: #0e0e10;
  color: var(--ink);
}

.seleccion-page .ref2d__top {
  background: #0e0e10 !important;
  backdrop-filter: none !important;
}

@media (max-width: 800px) {
  :root {
    --sel-header-offset: 56px;
  }
}

.seleccion__layout {
  width: min(1680px, 100%);
  margin: clamp(18px, 3vw, 34px) auto clamp(96px, 14vh, 170px);
  padding: 0 clamp(16px, 3vw, 56px);
  display: grid;
  grid-template-columns: minmax(520px, 1.25fr) minmax(360px, 0.95fr);
  gap: clamp(24px, 2.8vw, 48px);
  align-items: start;
}

.seleccion__left {
  /* SELECCION_START: INSTRUCCIONES ancho caja curatorial
     - Ajusta el ancho de toda la columna izquierda aquí.
     - Ejemplo ancho fijo:
       width: 640px;
       max-width: 100%;
     - Si prefieres mantener responsive sin fijo, deja solo max-width en .seleccion__desc.
  */
  position: sticky;
  top: 76px;
  align-self: start;
  /* SELECCION_END: INSTRUCCIONES ancho caja curatorial */
}

.seleccion__intro {
  padding: 6px 0 16px;
  border-bottom: 1px solid var(--sel-soft);
  max-width: var(--sel-intro-box-max);
}

.seleccion__eyebrow {
  margin: 0 0 11px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b9bac4;
}

.seleccion__title {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.04;
  max-width: 64ch;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.01em;
}

.seleccion__desc {
  /* SELECCION_START: INSTRUCCIONES ancho texto curatorial
     - Ajusta el ancho SOLO del párrafo curatorial aquí.
     - Opciones recomendadas:
       max-width: 52ch;   (más angosto)
       max-width: 64ch;   (actual)
       max-width: 680px;  (control en px)
  */
  margin: 0;
  color: #d0d0d8;
  line-height: 1.52;
  max-width: 84ch;
  white-space: pre-line;
  /* SELECCION_END: INSTRUCCIONES ancho texto curatorial */
}

.seleccion__desc.is-enhanced {
  white-space: normal;
  max-width: var(--sel-intro-box-max);
  display: grid;
  gap: 12px;
}

.seleccion__intro-faq {
  display: grid;
  gap: 10px;
  max-width: var(--sel-intro-box-max);
}

.seleccion__faq-item {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.seleccion__faq-q {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  color: #f2f3f8;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.seleccion__faq-q::-webkit-details-marker {
  display: none;
}

.seleccion__faq-q::after {
  content: "+";
  float: right;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}

.seleccion__faq-item[open] .seleccion__faq-q::after {
  content: "−";
}

.seleccion__faq-a {
  padding: 0 12px 11px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.seleccion__intro-lead {
  margin: 0;
  color: #d6d7df;
  font-size: clamp(1rem, 1.45vw, 1.12rem);
  line-height: 1.48;
  max-width: var(--sel-intro-box-max);
}

.seleccion__intro-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.seleccion__intro-panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
  padding: 12px 14px;
}

.seleccion__intro-panel h3 {
  margin: 0 0 10px;
  color: #f1f2f5;
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.seleccion__intro-rows {
  display: grid;
  gap: 0;
}

.seleccion__intro-row {
  display: grid;
  grid-template-columns: minmax(84px, 0.38fr) 1fr;
  gap: 10px;
  color: #d4d5de;
  font-size: 0.92rem;
  line-height: 1.38;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.seleccion__intro-row.is-single {
  grid-template-columns: 1fr;
  color: #ececf2;
  font-size: 1rem;
  font-weight: 500;
}

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

.seleccion__intro-k {
  color: #f5f5f8;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.seleccion__intro-v {
  color: #d4d5de;
}

.seleccion__intro-list {
  margin: 0;
  padding: 0 0 0 1.15rem;
  color: #d6d7e0;
  display: grid;
  gap: 8px;
  line-height: 1.36;
}

.seleccion__intro-list li::marker {
  color: #f2f3f7;
}

.seleccion__intro-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.seleccion__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--sel-soft-2);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  padding: 0.34rem 0.78rem;
  font-size: 0.84rem;
}

.seleccion__back:hover {
  background: rgba(255, 255, 255, 0.08);
}

.seleccion__frequency {
  display: none;
}

.seleccion__capsules {
  padding-top: 14px;
  max-width: var(--sel-intro-box-max);
}

.seleccion__capsules-title {
  margin: 0 0 12px;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b9bac4;
}

.seleccion__capsules-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.seleccion__capsule-btn {
  font: inherit;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #d7d9df;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0.44rem 1rem 0.5rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.seleccion__capsule-btn:hover { filter: brightness(1.1); }

.seleccion__capsule-btn.is-current {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
  color: #f4f5f8;
}

.seleccion__capsule-btn.is-active {
  background: #ffffff;
  border-color: #ffffff;
  color: #08080a;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
}

.seleccion__capsule-detail {
  min-height: 28px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--sel-soft);
}

.seleccion__capsule-detail-title {
  margin: 0 0 10px;
  color: #f2f3f8;
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  line-height: 1.3;
  padding: 0 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.seleccion__capsule-names { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.seleccion__capsule-name { color: #c7c9d2; font-size: 0.89rem; }
.seleccion__capsule-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.seleccion__capsule-link:hover,
.seleccion__capsule-link:focus-visible {
  color: #f2f3f7;
  border-bottom-color: rgba(255, 255, 255, 0.55);
  outline: none;
}
.seleccion__capsule-link.is-selected {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.8);
}
.seleccion__capsule-empty { margin: 0; color: #aeb0ba; font-size: 0.9rem; }

.seleccion__postscript {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 56px) 18px;
}

.seleccion__postscript-text {
  margin: 0;
  border-top: 1px solid var(--sel-soft);
  padding-top: 12px;
  color: #cfd0d8;
  font-size: 0.95rem;
  line-height: 1.45;
}

.seleccion__right { min-width: 0; padding-top: 2px; position: relative; }
.seleccion__right-head { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--sel-soft); display: grid; gap: 8px; }
.seleccion__right-kicker { margin: 0 0 8px; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: #b8b9c3; }
.seleccion__right-title { margin: 0; font-size: 1.35rem; line-height: 1.2; }
.seleccion__scroll-hint {
  margin: 0;
  width: max-content;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e8e9ef;
  font-size: 0.82rem;
  line-height: 1;
  padding: 0.4rem 0.72rem;
  cursor: pointer;
}
.seleccion__scroll-hint:hover {
  background: rgba(255, 255, 255, 0.14);
}
.seleccion__scroll-hint[hidden] {
  display: none !important;
}

.seleccion__right::after {
  content: "";
  position: absolute;
  left: 0;
  right: 12px;
  bottom: 0;
  height: 92px;
  background: linear-gradient(
    180deg,
    rgba(14, 14, 16, 0) 0%,
    rgba(14, 14, 16, 0.68) 58%,
    rgba(14, 14, 16, 0.98) 100%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.seleccion__right.is-scrollable:not(.is-at-end)::after {
  opacity: 1;
}

/* Columna con scroll de proyectos */
.seleccion__grid {
  max-height: calc(100vh - 210px);
  overflow: auto;
  padding: 2px 8px 22px 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(188, 194, 204, 0.66) rgba(132, 146, 165, 0.2);
}

.seleccion__grid::-webkit-scrollbar {
  width: 10px;
}

.seleccion__grid::-webkit-scrollbar-track {
  background: rgba(132, 146, 165, 0.16);
}

.seleccion__grid::-webkit-scrollbar-thumb {
  background: rgba(188, 194, 204, 0.66);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.seleccion__grid::-webkit-scrollbar-thumb:hover {
  background: rgba(207, 213, 223, 0.8);
}

/* SELECCION_START: cards en columna derecha con lectura tipo info */
.seleccion__grid .ref2d__view-card {
  max-width: min(680px, 100%);
  width: 100%;
  margin-inline: auto;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  overflow: visible;
  cursor: pointer;
  padding-bottom: 14px;
  transition: box-shadow 0.22s ease, border-color 0.22s ease;
}

.seleccion__grid .ref2d__view-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.seleccion__grid .ref2d__view-card.is-focus-target {
  animation: seleccionCardFocusFade 2.15s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.seleccion__grid .ref2d__view-card.is-focus-target .ref2d__view-card-figure {
  animation: seleccionFigureFocusGlow 2.15s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}

.seleccion__grid .ref2d__view-card-body { width: 100%; }
.seleccion__grid .ref2d__view-card-figure {
  position: relative;
  width: 100%;
  margin: 0;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0b0b0d;
  height: clamp(263px, 35vh, 400px);
  overflow: hidden;
}
.seleccion__grid .ref2d__view-card.is-h .ref2d__view-card-figure { aspect-ratio: auto; }
.seleccion__grid .ref2d__view-card.is-v .ref2d__view-card-figure { aspect-ratio: auto; }
.seleccion__grid .ref2d__view-card.is-sq .ref2d__view-card-figure { aspect-ratio: auto; }
.seleccion__grid .ref2d__view-card-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.seleccion__card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 12px 10px;
  display: grid;
  gap: 8px;
  background:
    linear-gradient(
      180deg,
      rgba(7, 8, 12, 0) 0%,
      rgba(7, 8, 12, 0.44) 22%,
      rgba(7, 8, 12, 0.72) 58%,
      rgba(7, 8, 12, 0.9) 100%
    );
}

.seleccion__grid .ref2d__view-card-head {
  margin-top: 0;
  padding: 0;
  border-top: 0;
}
.seleccion__card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.seleccion__grid .ref2d__view-card-head h3 { margin: 0; font-size: 0.98rem; color: rgba(255,255,255,0.98); }
.seleccion__grid .ref2d__view-card-head p { margin: 0.28rem 0 0; color: rgba(238,240,246,0.9); font-size: 0.82rem; }
.seleccion__grid .ref2d__view-card-head .seleccion__card-counter {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(230,232,240,0.92);
}
.seleccion__card-r-badge {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #f9f9fb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.28);
}
.seleccion__grid .ref2d__view-card-role { margin-top: 0.2rem; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: rgba(240,242,248,0.78); }
.seleccion__grid .ref2d__view-card-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 0; }
.seleccion__grid .ref2d__view-card-links { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; }
.seleccion__grid .ref2d__chip--link { text-decoration: none; border-color: rgba(255,255,255,0.38); }
.seleccion__grid .ref2d__chip { pointer-events: auto; }
/* SELECCION_END: cards en columna derecha con lectura tipo info */

@keyframes seleccionCardFocusFade {
  0% {
    border-bottom-color: rgba(255, 255, 255, 0.95);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.78),
      0 0 0 1px rgba(255, 255, 255, 0.28);
  }
  28% {
    border-bottom-color: rgba(255, 255, 255, 0.82);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.5),
      0 0 0 1px rgba(255, 255, 255, 0.16);
  }
  100% {
    border-bottom-color: rgba(255, 255, 255, 0.16);
    box-shadow: none;
  }
}

@keyframes seleccionFigureFocusGlow {
  0% {
    border-color: rgba(255, 255, 255, 0.94);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.72),
      0 0 0 1px rgba(255, 255, 255, 0.35),
      0 0 22px rgba(255, 255, 255, 0.24);
  }
  26% {
    border-color: rgba(255, 255, 255, 0.66);
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.45),
      0 0 12px rgba(255, 255, 255, 0.16);
  }
  100% {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
  }
}

.seleccion__empty { margin: 0; padding: 14px 0; color: #c3c4ce; }

/* Modal de selección */
.seleccion__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.56);
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.seleccion__modal {
  max-width: min(1100px, 92vw);
  width: min(1100px, 100vw - 40px);
  max-height: 88vh;
  background: #15151a;
  border: 1px solid #2a2a2e;
  border-radius: 18px;
  box-shadow: 0 30px 90px #000a;
  display: flex;
  gap: 20px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.seleccion__modal-close {
  position: absolute;
  right: 10px;
  top: 8px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #2a2a2e;
  background: #1b1b20;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.seleccion__modal-figure {
  position: relative;
  margin: 0;
  flex: 3;
  min-width: 0;
  max-height: 78vh;
  aspect-ratio: 4/3;
  background: #0a0a0a;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.seleccion__modal-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(20px) saturate(0.9) brightness(0.72);
  transform: scale(1.1);
  opacity: 0.9;
  pointer-events: none;
  z-index: 1;
  display: none;
}

.seleccion__modal-fill.is-left {
  left: 0;
  background-position: center left;
}

.seleccion__modal-fill.is-right {
  right: 0;
  background-position: center right;
}

.seleccion__modal-figure.is-v .seleccion__modal-fill {
  display: block;
}

.seleccion__modal-figure img {
  position: relative;
  z-index: 2;
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  display: block;
  transform: scale(0.9);
  transform-origin: center center;
  filter: blur(1.2px);
  transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1), filter 0.42s ease;
}

.seleccion__modal-figure.is-v img {
  object-fit: contain;
  transform: none;
  filter: none;
}

.seleccion__modal-figure img.is-zoomed {
  transform: scale(1);
  filter: blur(0);
}

.seleccion__modal-aside {
  flex: 2;
  min-width: 0;
  max-width: 390px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

.seleccion__modal-title { margin: 0 0 8px; font-size: 1.2rem; line-height: 1.25; }
.seleccion__modal-author { margin: 0 0 4px; color: var(--ink); font-size: 0.95rem; }
.seleccion__modal-role { margin: 0 0 10px; color: var(--ink-dim); font-size: 0.84rem; letter-spacing: 0.04em; text-transform: uppercase; }
.seleccion__modal-note { margin: 0 0 10px; color: #cbccd5; line-height: 1.45; font-size: 0.9rem; }
.seleccion__modal-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.seleccion__modal-tags .ref2d__chip { pointer-events: auto; text-decoration: none; }
.seleccion__modal-link {
  margin-top: auto;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  padding: 0.5rem 0.9rem;
}

.seleccion__modal-link:hover { background: rgba(255,255,255,0.16); }
.seleccion__modal-links { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.seleccion__modal-link.is-secondary {
  margin-top: 0;
  font-size: 0.88rem;
  padding: 0.42rem 0.78rem;
  background: transparent;
}

@media (max-width: 1120px) {
  .seleccion__layout { grid-template-columns: 1fr; }
  .seleccion__left { position: static; }
  .seleccion__grid { max-height: none; }
  .seleccion__intro-panels { grid-template-columns: 1fr; }
}

@media (max-width: 880px) {
  .seleccion__modal {
    flex-direction: column;
    max-height: 90vh;
    overflow: auto;
  }
  .seleccion__modal-figure { max-height: 44vh; }
  .seleccion__modal-aside { max-width: none; }
}
/* SELECCION_END: layout editorial + cards estilo grilla + modal propio */
