/* =============================================================================
   contenidoEvento.css — Galería, mapa de ruta y preguntas frecuentes (F-25).
   Dos partes:
     · .ce-*            editor del panel (pestaña «Galería, ruta y FAQ»), sobre los
                        tokens del panel (tokens.css; mismo estilo que extras-panel.css).
     · .cvr-/.cvg-/.cvf- secciones públicas que generan las eventoContenidoHtml* de
                        eventoContenidoLib.php, sobre las variables --cv-* de
                        convocatoria.css (scope .cv), más el visor .cvg-visor
                        (galeriaEvento.js).
   ============================================================================= */

/* ---------- EDITOR (panel) ---------- */
.ce { position: relative; }
.ce--ocupado { cursor: progress; }
/* Los <p> del editor llevan #contenidoEventoManager: `.modulo .formulario p` de uiPanel.css
   (especificidad 0,2,1) les ponía margin-bottom 30px, .9em, peso 400 y gris, y el error salía
   gris. Con el id (1,1,0) ganan, y cada regla declara las cuatro propiedades que aquélla pisa
   (margin, color, font-size, font-weight). */
#contenidoEventoManager .ce-cargando, #contenidoEventoManager .ce-vacio { opacity: .7; padding: var(--space-3, 12px) 0; margin: 0; color: var(--text-muted, #8A8A99); font-size: 14px; font-weight: 400; }
#contenidoEventoManager .ce-error { margin: 0 0 var(--space-3, 12px); color: var(--danger-text, #D1293F); font-size: 14px; font-weight: 700; }
.ce-aviso { margin: 0 0 var(--space-4, 16px); padding: var(--space-3, 12px) var(--space-4, 16px); border-radius: var(--radius-md, 10px); font-weight: 700; font-size: 14px; border: 1px solid var(--border, rgba(127,127,140,.3)); }
.ce-aviso--error { background: var(--red-soft, rgba(252,68,95,.14)); color: var(--red, #FC445F); }
.ce-aviso--success { background: rgba(0, 226, 118, .14); color: var(--text-primary, inherit); }
.ce-aviso--info { background: var(--surface-raised, rgba(127,127,140,.12)); color: var(--text-primary, inherit); }

.ce-sec { padding: var(--space-6, 24px) 0; border-top: 1px solid var(--border-subtle, rgba(127,127,140,.2)); }
.ce-sec:first-of-type { border-top: none; }
.ce-sec__titulo { margin: 0; font-size: 16px; font-weight: 700; color: var(--text-primary, inherit); text-transform: none; text-align: left; }
#contenidoEventoManager .ce-sec__ayuda { margin: var(--space-1, 4px) 0 var(--space-4, 16px); font-size: 13px; font-weight: 400; color: var(--text-muted, #8A8A99); }
.ce-etq { display: block; margin: var(--space-4, 16px) 0 var(--space-2, 8px); font-size: 13px; font-weight: 700; color: var(--text-primary, inherit); }
.ce-etiqueta { margin-left: var(--space-2, 8px); padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; background: rgba(127,127,140,.18); color: var(--text-muted, #8A8A99); }
.ce-file { display: none; }

.ce-input { width: 100%; min-width: 0; height: var(--control-md, 40px); padding: 0 var(--space-3, 12px); border: 1px solid var(--border, rgba(127,127,140,.35)); border-radius: var(--radius-md, 10px); background: var(--surface-raised, transparent); color: var(--text-primary, inherit); font: inherit; font-size: 14px; box-sizing: border-box; }
.ce-input:focus { outline: none; box-shadow: var(--focus-ring, 0 0 0 3px rgba(0,226,118,.35)); }
.ce-textarea { height: auto; min-height: 84px; padding: var(--space-2, 8px) var(--space-3, 12px); resize: vertical; line-height: 1.45; }
.ce-campo-linea { display: flex; gap: var(--space-2, 8px); align-items: center; }
.ce-linea { display: flex; flex-wrap: wrap; gap: var(--space-2, 8px); margin-top: var(--space-4, 16px); }

.ce-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--control-md, 40px); padding: 0 var(--space-4, 16px); border: 1px solid transparent; border-radius: var(--radius-md, 10px); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; background: transparent; color: var(--text-primary, inherit); }
.ce-btn:focus-visible { outline: none; box-shadow: var(--focus-ring, 0 0 0 3px rgba(0,226,118,.35)); }
.ce-btn:disabled { opacity: .45; cursor: not-allowed; }
.ce-btn--pri { background: var(--green, #00E276); color: var(--text-on-accent, #131319); }
.ce-btn--pri:hover:not(:disabled) { background: var(--green-hover, #00c268); }
.ce-btn--sec { background: var(--surface-raised, transparent); border-color: var(--border, rgba(127,127,140,.35)); }
.ce-btn--sec:hover:not(:disabled) { border-color: var(--border-strong, rgba(127,127,140,.6)); }
.ce-btn--peligro { color: var(--red, #FC445F); }
.ce-btn--peligro:hover:not(:disabled) { background: var(--red-soft, rgba(252,68,95,.14)); }
.ce-btn--icono { width: 34px; height: 34px; padding: 0; font-size: 18px; line-height: 1; }

/* Mapa de ruta: una fila por distancia */
.ce-ruta { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "nom nom" "mini acc" "etq etq" "enl enl"; gap: var(--space-2, 8px) var(--space-3, 12px); padding: var(--space-4, 16px); margin-bottom: var(--space-3, 12px); border: 1px solid var(--border-subtle, rgba(127,127,140,.2)); border-radius: var(--radius-lg, 14px); }
.ce-ruta__nombre { grid-area: nom; font-weight: 800; font-size: 15px; }
.ce-ruta__mini { grid-area: mini; width: 96px; height: 72px; border-radius: var(--radius-md, 10px); overflow: hidden; background: rgba(127,127,140,.12); display: flex; align-items: center; justify-content: center; }
.ce-ruta__mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ce-ruta__sin { font-size: 12px; color: var(--text-muted, #8A8A99); }
.ce-ruta__acc { grid-area: acc; display: flex; flex-wrap: wrap; gap: var(--space-2, 8px); align-items: center; }
.ce-ruta > .ce-etq { grid-area: etq; margin: var(--space-2, 8px) 0 0; }
.ce-ruta > .ce-campo-linea { grid-area: enl; }

/* Galería del editor */
#contenidoEventoManager .ce-contador { margin: 0 0 var(--space-3, 12px); font-size: 13px; font-weight: 700; color: var(--text-muted, #8A8A99); }
.ce-galeria { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2, 8px); }
.ce-foto { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-md, 10px); overflow: hidden; background: rgba(127,127,140,.12); }
.ce-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ce-foto__acc { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; padding: 4px; background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,0)); }
.ce-foto__acc .ce-btn--icono { background: rgba(19,19,25,.7); color: #fff; width: 30px; height: 30px; }
.ce-foto__acc .ce-btn--peligro { color: #fff; }

/* Preguntas frecuentes del editor */
.ce-faq__item { display: flex; flex-direction: column; gap: var(--space-2, 8px); padding: var(--space-4, 16px); margin-bottom: var(--space-3, 12px); border: 1px solid var(--border-subtle, rgba(127,127,140,.2)); border-radius: var(--radius-lg, 14px); }
.ce-faq__cab { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2, 8px); }
.ce-faq__num { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted, #8A8A99); }
.ce-faq__acc { display: inline-flex; gap: 2px; }
.ce-faq__cont { align-self: flex-end; font-size: 12px; color: var(--text-muted, #8A8A99); font-variant-numeric: tabular-nums; }
.ce-faq__cont--pasado { color: var(--red, #FC445F); font-weight: 700; }

@media (min-width: 720px) {
  .ce-galeria { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ce-ruta { grid-template-columns: 120px minmax(0, 1fr); grid-template-areas: "mini nom" "mini acc" "mini etq" "mini enl"; }
  .ce-ruta__mini { width: 120px; height: 120px; }
}

/* ---------- PÚBLICO (dentro de .cv) ----------
   Las secciones que generan eventoContenidoHtmlRuta/Galeria/Faq llevan .cv-o3. Medido el
   2026-10-24 en convocatoria.css: en móvil .cv-main y .cv-aside son `display: contents` y el
   orden lo da `order`: .cv-o3 = 3, .cv-o4 = 4, .cv-o5 = 5; en evento.php la sección
   Convocatoria lleva .cv-o3, Acciones rápidas .cv-o4 y Organizador .cv-o5. A igual order
   desempata el DOM: impresas dentro de .cv-main después de Convocatoria, quedan en móvil
   detrás de ella y antes de .cv-o4/.cv-o5. En PC (`.cv-main > * { order: 0 }`) manda el DOM. */
.cv .cvr-lista { display: grid; gap: var(--space-3, 12px); }
.cv .cvr-card { padding: var(--space-4, 16px); display: flex; flex-direction: column; gap: var(--space-3, 12px); }
.cv .cvr-nombre { margin: 0; font-size: 15px; font-weight: 800; color: var(--cv-ink, #131319); }
.cv .cvr-img { display: block; border-radius: 12px; overflow: hidden; background: var(--cv-page, #F5F6F8); }
.cv .cvr-img img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: contain; }
.cv .cvr-enlace { align-self: flex-start; text-decoration: none; }
.cv .cvr-enlace .cv-ic { font-size: 16px; }

.cv .cvg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cv .cvg-item { display: block; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--cv-line, #E3E5EA); }
.cv .cvg-item img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.cv .cvg-item:hover img { transform: scale(1.03); }
.cv .cvg-item:focus-visible { outline: 3px solid var(--cv-green, #00E276); outline-offset: 2px; }
.cv .cvg-album { margin-top: var(--space-3, 12px); width: 100%; text-decoration: none; }
.cv .cvg-album .cv-ic { font-size: 18px; }

.cv .cvf-lista { padding: 0 var(--space-4, 16px); }
.cv .cvf-item { border-top: 1px solid var(--cv-line, #E3E5EA); }
.cv .cvf-item:first-child { border-top: none; }
.cv .cvf-preg { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; font-size: 14.5px; font-weight: 800; color: var(--cv-ink, #131319); }
.cv .cvf-preg::-webkit-details-marker { display: none; }
.cv .cvf-preg::after { content: "+"; flex: none; font-size: 20px; font-weight: 700; line-height: 1; color: var(--cv-green-press, #00c268); }
.cv .cvf-item[open] > .cvf-preg::after { content: "−"; }
.cv .cvf-preg:focus-visible { outline: 3px solid var(--cv-green, #00E276); outline-offset: 2px; border-radius: 6px; }
.cv .cvf-resp { padding: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--cv-t2, #5A5A66); overflow-wrap: anywhere; }
/* #0072D6 (--info-fill de tokens.css) da 4,80:1 sobre blanco (AA); el #0099FF de --cv-blue daba 3,00:1. */
.cv .cvf-resp a { color: var(--info-fill, #0072D6); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

@media (min-width: 960px) {
  .cv .cvg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .cv .cvr-lista { grid-template-columns: 1fr 1fr; }
  .cv .cvg-album { width: auto; }
}

/* ---------- Visor de la galería (fuera de .cv: se cuelga del body) ---------- */
.cvg-visor { position: fixed; inset: 0; z-index: 10000; display: none; align-items: center; justify-content: center; background: rgba(10, 10, 14, .94); touch-action: pan-y; }
.cvg-visor.is-abierto { display: flex; }
.cvg-visor__marco { position: absolute; inset: 56px 12px 56px; display: flex; align-items: center; justify-content: center; }
.cvg-visor__img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.cvg-visor__contador { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); color: #fff; font: 700 14px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.cvg-visor__btn { position: absolute; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: none; border-radius: 99px; background: rgba(255, 255, 255, .14); color: #fff; font: 400 34px/1 system-ui, sans-serif; cursor: pointer; }
.cvg-visor__btn:hover { background: rgba(255, 255, 255, .26); }
.cvg-visor__btn:focus-visible { outline: 3px solid #00E276; outline-offset: 2px; }
.cvg-visor__btn[hidden] { display: none; }
.cvg-visor__cerrar { top: 6px; right: 8px; }
.cvg-visor__prev { left: 8px; top: 50%; transform: translateY(-50%); }
.cvg-visor__next { right: 8px; top: 50%; transform: translateY(-50%); }
@media (max-width: 600px) {
  .cvg-visor__prev, .cvg-visor__next { top: auto; bottom: 6px; transform: none; }
  .cvg-visor__marco { inset: 56px 0 64px; }
}
