/* ==========================================================================
   RW Editor — Landing 2026
   Se carga después de css/styles.css y css/nav.css (mismo sistema que la home:
   tokens, botones, chips, revelado con desenfoque, tema claro/oscuro) y añade
   solo lo propio de RW Editor. Textos: recursosworship.com/rw-editor/.
   Material: plantillas reales de la biblioteca (assets/editor/tpl) y la
   captura real del editor (assets/editor/rw-editor-preview.webp).
   --------------------------------------------------------------------------
   1. Tokens de RW Editor
   2. Hero (muro de plantillas en sus proporciones)
   3. Editor (maqueta de la página original con plantillas reales)
   4. Formatos + tira
   5. Panel «motor gráfico»
   6. Intro (un diseño en tres formatos)
   7. Cómo funciona + explorador
   8. Edición precisa (superficie que se expande)
   9. Bento: identidad y plantillas
   10. Diseña como un profesional
   11. Responsive
   12. Movimiento reducido
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
.ed-page {
  --ed-overlap: clamp(150px, 17vw, 320px);   /* cuánto se superpone el editor al hero */
  /* Colores de la interfaz real (muestreados de la captura de RW Editor) */
  --ed-ui: #0e0d12;
  --ed-ui-2: #16151b;
  --ed-ui-3: #222128;
  --ed-ui-line: rgba(255, 255, 255, 0.08);
  --ed-ui-ink: #ececf1;
  --ed-ui-muted: #8e8c98;
  --ed-select: #8b6bff;                       /* caja de selección del lienzo */
}
.ed-page section[id], .ed-page #como-funciona { scroll-margin-top: 96px; }

/* 2. Hero ------------------------------------------------------------------- */
.ed-hero {
  min-height: 0;
  padding: clamp(136px, 16vh, 176px) 0 calc(var(--ed-overlap) + clamp(56px, 6vw, 96px));
}
.ed-badge { padding-left: 6px; }
.ed-badge img { width: 24px; height: 24px; }

/* Muro: cada tarjeta respeta la proporción real de la plantilla (1:1, 9:16 o 16:9) */
.ed-wall .hero-card { width: auto; height: clamp(150px, 13.5vw, 240px); aspect-ratio: var(--ar, 1); border-radius: 14px; }

/* 3. Editor ------------------------------------------------------------------ */
.ed-stage { position: relative; z-index: 3; margin-top: calc(var(--ed-overlap) * -1); }
.ed-mock { position: relative; max-width: 1240px; margin-inline: auto; }
.ed-app {
  position: relative;
  border-radius: clamp(14px, 1.6vw, 22px);
  overflow: hidden;
  isolation: isolate;
  background: var(--ed-ui);
  color: var(--ed-ui-ink);
  font-size: 13px;
  line-height: 1.3;
  container-type: inline-size;
}
/* Borde fino por encima de todo (plano, sin sombra) */
.ed-app::after { content: ""; position: absolute; inset: 0; z-index: 5; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1); pointer-events: none; }

.ed-app-bar { display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 12px 0 16px; background: var(--ed-ui-2); border-bottom: 1px solid var(--ed-ui-line); }
.ed-dots { display: flex; gap: 6px; flex: none; }
.ed-dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.ed-dots i:nth-child(2) { background: #febc2e; }
.ed-dots i:nth-child(3) { background: #28c840; }
.ed-doc { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13.5px; }
.ed-doc-back { color: var(--ed-ui-muted); font-size: 20px; line-height: 1; }
.ed-doc strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-saved { flex: none; display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; background: rgba(52, 199, 89, 0.14); color: #6ee7a0; font-size: 11.5px; font-weight: 600; transition: background-color 0.3s, color 0.3s; }
.ed-saved.is-saving { background: rgba(255, 255, 255, 0.08); color: var(--ed-ui-muted); }
.ed-bar-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.ed-tool { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--ed-ui-muted); }
.ed-tool svg { width: 18px; height: 18px; }
.ed-share, .ed-download { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.ed-share { background: rgba(255, 255, 255, 0.06); }
.ed-download { background: var(--accent); color: #fff; }
.ed-download svg { width: 15px; height: 15px; }

.ed-app-body { display: grid; grid-template-columns: 76px minmax(0, 292px) minmax(0, 1fr); height: clamp(440px, 46vw, 620px); }

.ed-rail { display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; background: var(--ed-ui-2); border-right: 1px solid var(--ed-ui-line); }
.ed-rail > span { display: grid; justify-items: center; gap: 5px; padding: 9px 2px; border-radius: 10px; font-size: 10.5px; font-weight: 500; color: var(--ed-ui-muted); }
.ed-rail .ico, .ed-rail svg { width: 20px; height: 20px; }
.ed-rail .is-active { background: rgba(139, 107, 255, 0.16); color: #cfc3ff; }
.ed-rail-t { height: 20px; font-size: 17px; font-weight: 700; line-height: 20px; letter-spacing: -0.03em; }

.ed-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; padding: 14px; border-right: 1px solid var(--ed-ui-line); }
.ed-side-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.ed-side-head span { color: var(--ed-ui-muted); font-size: 18px; line-height: 1; }
.ed-search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; background: var(--ed-ui-3); color: var(--ed-ui-muted); white-space: nowrap; overflow: hidden; }
.ed-search svg { width: 16px; height: 16px; flex: none; }
.ed-search.is-typing span { color: var(--ed-ui-ink); }
.ed-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-filter { height: 28px; padding: 0 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.05); font-size: 12px; font-weight: 560; color: var(--ed-ui-muted); transition: background-color var(--t-ui), color var(--t-ui); }
.ed-filter:hover { color: var(--ed-ui-ink); }
.ed-filter[aria-selected="true"] { background: #fff; color: #141414; }
/* Filas a su alto real: lo que no cabe se recorta, como un panel con scroll */
.ed-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; align-content: start; gap: 8px; min-height: 0; overflow: hidden; padding: 3px; margin: -3px; }
.ed-thumb { position: relative; display: block; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--ed-ui-3); outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 0.25s var(--ease-ui); }
.ed-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease-quint); }
.ed-thumb:hover img { transform: scale(1.05); }
.ed-thumb.is-active { outline-color: var(--ed-select); }
.ed-thumb-tag { position: absolute; left: 6px; bottom: 6px; padding: 2px 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 10px; font-weight: 600; font-family: "Geist Mono", ui-monospace, monospace; }
.ed-grid.is-in .ed-thumb { animation: edThumbIn 0.55s var(--ease-quint) both; animation-delay: calc(var(--d, 0) * 45ms); }
@keyframes edThumbIn { from { opacity: 0; filter: blur(6px); transform: translateY(8px); } to { opacity: 1; filter: none; transform: none; } }

/* Lienzo: el tamaño se calcula con unidades del contenedor y la proporción se anima */
@property --ed-ar { syntax: "<number>"; inherits: true; initial-value: 1; }
.ed-work { position: relative; display: grid; place-items: center; min-width: 0; min-height: 0; background: #09090c; container-type: size; }
.ed-toolbar { position: absolute; top: 14px; left: 50%; z-index: 2; display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 14px; border-radius: 10px; background: var(--ed-ui-2); box-shadow: inset 0 0 0 1px var(--ed-ui-line); font-size: 12px; white-space: nowrap; transform: translateX(-50%); }
.ed-toolbar i { width: 1px; height: 14px; background: var(--ed-ui-line); }
.ed-board {
  --ed-ar: 1;
  position: relative;
  width: min(80cqw, calc(68cqh * var(--ed-ar)));
  aspect-ratio: var(--ed-ar);
  margin-top: 24px;
  background: var(--ed-ui-3);
  transition: --ed-ar 0.8s var(--ease-quint);
}
.ed-board img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; filter: blur(10px); transition: opacity 0.6s var(--ease-quint), filter 0.6s var(--ease-quint); }
.ed-board img.is-on { opacity: 1; filter: none; }
.ed-sel { position: absolute; inset: -1px; z-index: 1; border: 1.5px solid var(--ed-select); pointer-events: none; }
.ed-sel i { position: absolute; width: 10px; height: 10px; border: 1.5px solid var(--ed-select); border-radius: 2px; background: #fff; }
.ed-sel i:nth-child(1) { left: -6px; top: -6px; }
.ed-sel i:nth-child(2) { right: -6px; top: -6px; }
.ed-sel i:nth-child(3) { left: -6px; bottom: -6px; }
.ed-sel i:nth-child(4) { right: -6px; bottom: -6px; }
.ed-zoom { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: 9px; background: var(--ed-ui-2); box-shadow: inset 0 0 0 1px var(--ed-ui-line); font-size: 12px; color: var(--ed-ui-muted); }
.ed-zoom b { min-width: 3ch; text-align: center; font-weight: 600; color: var(--ed-ui-ink); font-variant-numeric: tabular-nums; }

/* Cursor de una colaboradora (la página original lo llama «Jimena») */
.ed-cursor { position: absolute; left: 0; top: 0; z-index: 7; display: flex; align-items: flex-start; color: var(--ed-select); pointer-events: none; opacity: 0; transition: transform 0.9s var(--ease-quint), opacity 0.4s var(--ease-ui); }
.ed-cursor.is-on { opacity: 1; }
.ed-cursor svg { width: 22px; height: 26px; transition: transform 0.15s var(--ease-ui); transform-origin: 3px 3px; }
.ed-cursor.is-click svg { transform: scale(0.82); }
.ed-cursor span { margin: 20px 0 0 -2px; padding: 3px 8px; border-radius: 6px; background: var(--ed-select); color: #fff; font-size: 12px; font-weight: 600; }

/* Notas flotantes de la página original (fijas, sin vaivén) */
.ed-note { position: absolute; z-index: 6; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 15px; border-radius: 999px; background: var(--panel); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.ed-note-left { left: clamp(24px, 4%, 56px); bottom: -20px; }   /* sobre el borde inferior, sin tapar el panel */
.ed-note-right { right: -20px; bottom: 16%; }
.ed-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; }
.ed-note-right svg { width: 16px; height: 16px; color: var(--accent-fg); }

/* Maqueta estrecha: lienzo arriba y una fila de miniaturas debajo */
@container (max-width: 980px) {
  .ed-app-body { grid-template-columns: 64px minmax(0, 228px) minmax(0, 1fr); }
  .ed-share { display: none; }
}
@container (max-width: 700px) {
  .ed-app-bar { gap: 10px; height: 46px; padding-left: 12px; }
  .ed-dots, .ed-tool { display: none; }
  .ed-app-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; height: auto; }
  .ed-rail, .ed-side-head, .ed-search, .ed-toolbar, .ed-zoom { display: none; }
  .ed-work { height: clamp(260px, 72cqw, 380px); }
  .ed-board { margin-top: 0; width: min(86cqw, calc(80cqh * var(--ed-ar))); }
  .ed-side { order: 2; gap: 10px; padding: 10px; border-right: 0; border-top: 1px solid var(--ed-ui-line); }
  .ed-filters { flex-wrap: nowrap; overflow: hidden; }
  .ed-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .ed-thumb { border-radius: 7px; }
  .ed-thumb-tag { display: none; }
}

/* 4. Formatos + tira ------------------------------------------------------- */
.ed-formats { padding-top: clamp(56px, 6vw, 96px); }
.ed-fmt { width: 20px; height: 20px; fill: none; stroke: #b9a5ff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ed-strip-head { display: flex; justify-content: center; margin-top: clamp(40px, 4.5vw, 72px); padding-inline: var(--gutter); }
.ed-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 7px 14px;
  border: 1px solid rgba(180, 140, 255, 0.35); border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; line-height: 1.2; text-align: center;
}
.ed-strip { --sh: clamp(200px, 17vw, 280px); margin-top: 8px; }
.ed-strip .s-card { width: calc(var(--sh) * var(--ar, 1)); }
.ed-strip .s-media { height: var(--sh); background: #1a1420; }
.ed-strip .is-story .s-meta span { display: none; }

/* 5. Panel «motor gráfico» -------------------------------------------------- */
.ed-engine { background: var(--panel); border-radius: var(--r-hero) var(--r-hero) 0 0; padding: clamp(72px, 8vw, 128px) 0 clamp(24px, 3vw, 48px); }
.ed-engine-text { max-width: 30ch; font-size: clamp(30px, 3.6vw, 54px); }
.ed-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(48px, 6vw, 88px); border-top: 1px solid var(--line-2); }
.ed-stat { display: grid; gap: 8px; align-content: start; padding: 28px 24px 0 0; }
.ed-stat + .ed-stat { padding-left: 24px; border-left: 1px solid var(--line-2); }
.ed-stat .stat-num { color: var(--ink); }

/* 6. Intro ------------------------------------------------------------------ */
.ed-intro { align-items: center; }
.ed-two-tone span { color: var(--muted-2); }
.ed-trio { position: relative; aspect-ratio: 5 / 4; border-radius: var(--r-xl); background: var(--surface); overflow: hidden; }
.ed-trio img { position: absolute; border-radius: 12px; box-shadow: 0 0 0 4px var(--surface); transition: transform 1s var(--ease-quint); }
/* La pantalla queda detrás y deja ver su título; post y story delante, en las esquinas */
.ed-trio-screen { left: 12%; top: 7%; width: 76%; }
.ed-trio-post { right: 5%; bottom: 6%; width: 33%; }
.ed-trio-story { left: 6%; bottom: 6%; width: 20%; }
.ed-trio:hover .ed-trio-post { transform: translateY(-6px); }
.ed-trio:hover .ed-trio-story { transform: translateY(-10px); }

/* 7. Cómo funciona + explorador --------------------------------------------- */
.ed-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px clamp(24px, 3vw, 48px); margin-bottom: clamp(48px, 5vw, 80px); counter-reset: none; }
.ed-steps li { display: grid; gap: 10px; align-content: start; padding-top: 22px; border-top: 1px solid var(--line-2); }
.ed-step-num { font-family: "Geist Mono", ui-monospace, monospace; font-size: 13px; color: var(--accent-fg); }
.ed-steps h3 { font-size: clamp(19px, 1.5vw, 22px); font-weight: 620; line-height: 1.2; letter-spacing: -0.02em; }
.ed-steps p { max-width: 36ch; color: var(--muted); font-size: 16px; line-height: 1.5; }
/* Todas las tarjetas comparten alto; el ancho sale de la proporción de la plantilla */
.ed-carousel { --ch: clamp(280px, 24vw, 400px); }
.ed-carousel .c-card, .ed-carousel .c-card.is-portrait { width: auto; }
.ed-carousel .c-media, .ed-carousel .c-card.is-portrait .c-media { height: var(--ch); width: calc(var(--ch) * var(--ar, 1)); aspect-ratio: auto; }
.ed-carousel .c-meta { max-width: calc(var(--ch) * var(--ar, 1)); }

/* 8. Edición precisa --------------------------------------------------------- */
.ed-precise { padding-top: 0; }  /* el explorador ya deja su espacio debajo */
.ed-shot { height: clamp(260px, 42vw, 700px); background: var(--ed-ui); }
.ed-shot img { object-position: 0 0; }
.ed-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: clamp(28px, 3vw, 44px); }
.ed-features li { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--fill); font-size: 15px; font-weight: 560; color: var(--ink-2); }
.ed-features .ico { width: 18px; height: 18px; color: var(--accent-fg); }
.ed-tt { width: 18px; text-align: center; font-size: 15px; font-weight: 700; letter-spacing: -0.03em; color: var(--accent-fg); }

/* 9. Bento --------------------------------------------------------------------- */
.ed-bento { padding-top: var(--space-xl); }
.ed-tile-ico { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--accent-soft); color: var(--accent-fg); }
.ed-brand { margin-top: auto; padding: 8px clamp(24px, 2.4vw, 36px) clamp(24px, 2.4vw, 36px); }
.ed-brand-card { display: grid; gap: 18px; padding: clamp(18px, 1.8vw, 24px); border-radius: 22px; background: var(--panel); }
.ed-brand-row { display: flex; align-items: center; gap: 14px; }
.ed-brand-logo { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; flex: none; border-radius: 14px; background: var(--accent); color: #fff; font-size: 20px; font-weight: 750; letter-spacing: -0.04em; }
.ed-brand-meta strong { display: block; font-size: 15px; font-weight: 620; }
.ed-brand-meta span { font-size: 13px; color: var(--muted); }
.ed-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ed-swatches i { aspect-ratio: 1.6; border-radius: 12px; background: var(--c); box-shadow: inset 0 0 0 1px var(--line); }
.ed-font { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.ed-font span { font-family: "Instrument Sans", var(--font); font-size: clamp(56px, 6vw, 88px); font-weight: 600; line-height: 0.9; letter-spacing: -0.03em; }
.ed-font small { font-family: "Geist Mono", ui-monospace, monospace; font-size: 12.5px; color: var(--muted); }
/* Los colores aparecen uno a uno cuando la tarjeta entra */
.js .tile .ed-swatches i { opacity: 0; transform: scale(0.85); filter: blur(4px); transition: opacity 0.6s var(--ease-quint), transform 0.6s var(--ease-quint), filter 0.6s var(--ease-quint); }
.js .tile.is-in .ed-swatches i { opacity: 1; transform: none; filter: none; }
.ed-swatches i:nth-child(2) { transition-delay: 0.07s; }
.ed-swatches i:nth-child(3) { transition-delay: 0.14s; }
.ed-swatches i:nth-child(4) { transition-delay: 0.21s; }
/* Imagen con fondo transparente: entera y apoyada abajo */
.tile-7 .ed-tile-media { border-radius: 0; }
.tile-7 .ed-tile-media img { object-fit: contain; object-position: 50% 100%; }

/* 10. Diseña como un profesional ---------------------------------------------- */
.ed-mosaic { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(8px, 1vw, 14px); padding: clamp(8px, 1vw, 14px); }
.ed-mosaic a { display: block; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--media-bg); }
.ed-mosaic img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-quint); }
.ed-mosaic a:hover img { transform: scale(1.035); }

/* 11. Responsive -------------------------------------------------------------- */
@media (max-width: 1200px) {
  .ed-note-right { right: -8px; }
}
@media (max-width: 900px) {
  .ed-steps, .ed-stats { grid-template-columns: 1fr; }
  .ed-stat, .ed-stat + .ed-stat { padding: 22px 0; border-left: 0; }
  .ed-stat + .ed-stat { border-top: 1px solid var(--line-2); }
  .ed-trio { aspect-ratio: 4 / 3.3; }
}
@media (max-width: 720px) {
  .ed-page { --ed-overlap: 96px; }
  .ed-note, .ed-cursor { display: none; }
}
@media (max-width: 560px) {
  .ed-wall .hero-card { width: auto; height: 118px; border-radius: 10px; }
  .ed-strip { --sh: 170px; }
  .ed-carousel { --ch: 250px; }
  .ed-features li { height: 36px; padding: 0 13px; font-size: 14px; }
}

/* 12. Movimiento reducido ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .ed-cursor { display: none; }
  .js .tile .ed-swatches i { opacity: 1; transform: none; filter: none; }
}

/* CTA final: azul noche pedido por el usuario (claro y oscuro) */
.cta.ed-cta, :root[data-theme="dark"] .cta.ed-cta { background: #06113b; }

/* Titular del hero: degradado celeste/azul (pedido del usuario) */
.text-gradient.ed-grad, :root[data-theme="dark"] .text-gradient.ed-grad { background-image: linear-gradient(100deg, #1f6bff 0%, #00a6ff 30%, #00c4cc 55%, #4cc9f0 78%, #1f6bff 100%); }
