/* tablon.css - el tablón de ideas y errores y el formulario para enviarlos */

/* ---------- Páginas ---------- */

.tablon {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 104px 16px 64px;
}

.tablon__rotulo { --tam-titular: clamp(36px, 11vw, 84px); margin-bottom: 40px; }

/* el formulario cabe entero en pantalla: cabecera baja y dos columnas */
.buzon {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 64px 16px 28px;
}

.buzon__rotulo { --tam-titular: clamp(34px, 7vw, 60px); margin-bottom: 22px; }
.buzon__rotulo .rotulo__kanji { margin-bottom: 6px; }
.buzon__rotulo .lema { max-width: none; margin-top: 12px; }

.tablon__pie { display: flex; justify-content: center; margin-top: 40px; }

/* ---------- El botón para aportar ---------- */

.aportar {
  width: min(var(--ancho-botones), 100%);
  margin: 0 auto 44px;
}

/* ---------- Filtros ---------- */

.filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.pestanas { display: flex; gap: 6px; }

.pestana {
  padding: 9px 14px 9px 17px;
  border: 0;
  background: rgba(31, 15, 28, .8);
  box-shadow: inset 0 0 0 1px rgba(217, 167, 79, .45);
  color: var(--oro);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .22em;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  transition: background .12s, color .12s;
}

.pestana:hover { background: rgba(224, 80, 46, .84); color: var(--blanco); }
.pestana[aria-pressed="true"] { background: var(--oro-vivo); color: var(--noche); box-shadow: none; }

.filtros__buscar { flex: 1 1 200px; }
.filtros select.control { width: auto; font-size: 13px; letter-spacing: .14em; }

.cuenta {
  min-height: 1.6em;
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: .22em;
  color: rgba(251, 238, 226, .55);
}

/* ---------- Controles: cajas de texto y desplegables ---------- */

.control {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(217, 167, 79, .45);
  border-radius: 0;
  background-color: rgba(20, 10, 18, .75);
  color: var(--ceniza);
  font-size: 15px;
  letter-spacing: .04em;
  line-height: 1.5;
  transition: border-color .12s, box-shadow .12s;
}

.control::placeholder { color: rgba(251, 238, 226, .36); }
.control:hover { border-color: rgba(242, 196, 98, .75); }

.control:focus {
  outline: none;
  border-color: var(--oro-vivo);
  box-shadow: 0 0 0 1px var(--oro-vivo), 0 0 14px rgba(244, 89, 58, .35);
}

textarea.control { min-height: 110px; resize: vertical; }

select.control {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23f2c462' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  cursor: var(--cursor-mano);
}

select.control option { background: var(--noche); color: var(--ceniza); }

/* ---------- Tarjeta de un aporte ---------- */

.aportes {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.aporte {
  display: flex;
  gap: clamp(14px, 2.5vw, 22px);
  padding: 18px clamp(16px, 3vw, 26px);
  cursor: var(--cursor-mano);
  transition: transform .2s ease;
}

.aporte:hover { transform: translateX(4px); }

.aporte__cuerpo { flex: 1 1 auto; min-width: 0; }

.aporte__titulo {
  margin: 6px 0 0;
  font-family: var(--mincho);
  font-weight: 800;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.3;
  color: var(--titular);
}

.aporte__boton {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  overflow-wrap: anywhere;
}

.aporte:hover .aporte__boton { color: var(--oro-palido); }

.aporte__resumen {
  display: -webkit-box;
  margin: 6px 0 0;
  overflow: hidden;
  font-size: 14.5px;
  color: rgba(251, 238, 226, .74);
  overflow-wrap: anywhere;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.aporte__pie {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 8px 0 0;
  font-size: 12px;
  letter-spacing: .12em;
  color: rgba(251, 238, 226, .52);
}

.con-archivos { font-weight: 900; letter-spacing: .18em; color: var(--oro-palido); }

/* ---------- Código, tipo y estado ---------- */

.cabeza {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.codigo {
  margin-right: 4px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  color: rgba(251, 238, 226, .6);
}

.tipo,
.estado {
  padding: 1px 8px 1px 10px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2em;
  white-space: nowrap;
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.tipo--idea { color: var(--noche); background: var(--oro-vivo); }
.tipo--error { color: var(--crema); background: var(--sol); }

.estado { color: var(--ceniza); background: rgba(251, 238, 226, .1); box-shadow: inset 0 0 0 1px rgba(251, 238, 226, .35); }
.estado--confirmado { color: var(--oro-palido); background: rgba(242, 196, 98, .14); box-shadow: inset 0 0 0 1px rgba(242, 196, 98, .65); }
.estado--en_curso { color: #ffd2b0; background: rgba(236, 106, 44, .24); box-shadow: inset 0 0 0 1px rgba(236, 106, 44, .85); }
.estado--resuelto { color: #aee8c2; background: rgba(110, 200, 150, .14); box-shadow: inset 0 0 0 1px rgba(130, 210, 160, .6); }
.estado--duplicado,
.estado--descartado { color: rgba(251, 238, 226, .5); background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px rgba(251, 238, 226, .18); }

/* ---------- Voto ---------- */

.voto {
  flex: none;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 58px;
  min-height: 66px;
  padding: 8px 0 6px;
  border: 0;
  background: rgba(20, 10, 18, .7);
  box-shadow: inset 0 0 0 1px rgba(217, 167, 79, .5);
  color: var(--oro);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: .04em;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: background .12s, color .12s, opacity .12s;
}

.voto svg { width: 16px; height: 16px; transition: transform .2s ease; }

.voto:hover { background: rgba(224, 80, 46, .84); color: var(--blanco); }
.voto:hover svg { transform: translateY(-2px); }

.voto[aria-pressed="true"] {
  background: var(--sol);
  box-shadow: inset 0 0 0 1px var(--oro-palido);
  color: var(--blanco);
}

.voto[aria-busy="true"] { opacity: .55; }

/* ---------- Ficha: un aporte entero ---------- */

.detalle {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 72px 16px 24px;
  background: rgba(var(--velo), .9);
}

.detalle__marco {
  position: relative;
  width: min(760px, 100%);
  animation: asomar .25s cubic-bezier(.2, .7, .2, 1);
}

@keyframes asomar { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.detalle__cerrar { position: absolute; right: 0; bottom: calc(100% + 12px); }

/* la tablilla no se desplaza (el filete se movería con ella): se desplaza el texto */
.detalle__tablilla {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 110px);
  max-height: calc(100svh - 110px);
  padding: 28px clamp(18px, 4vw, 34px) 26px;
}

.detalle__texto {
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 198, 92, .6) transparent;
}

.detalle__arriba { display: flex; gap: 18px; align-items: flex-start; }
.detalle__titulos { flex: 1 1 auto; min-width: 0; }

.detalle__titulo {
  margin: 8px 0 0;
  font-family: var(--mincho);
  font-weight: 800;
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.25;
  color: var(--titular);
  text-shadow: .05em .07em 0 rgba(193, 48, 31, .85);
  overflow-wrap: anywhere;
}

.detalle__meta { margin: 8px 0 0; font-size: 13px; letter-spacing: .1em; color: rgba(251, 238, 226, .6); }

.seccion { margin-top: 20px; }

.seccion h3,
.datos dt {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .24em;
  color: var(--oro-vivo);
}

.seccion p {
  margin: 0;
  font-size: 15.5px;
  color: rgba(251, 238, 226, .92);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.datos { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 20px 0 0; }
.datos dd { margin: 0; font-size: 15px; }

.detalle__acciones { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- Aviso breve abajo ---------- */

.brindis {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 70;
  max-width: calc(100% - 32px);
  margin: 0;
  padding: 10px 18px;
  transform: translateX(-50%);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--oro-vivo), 0 10px 30px rgba(0, 0, 0, .5);
  font-size: 14px;
  letter-spacing: .1em;
  text-align: center;
  overflow-wrap: anywhere;
}

/* ---------- Formulario ---------- */

.formulario {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px clamp(20px, 3vw, 32px);
  padding: 22px clamp(18px, 3vw, 30px) 24px;
}

.formulario > .tipos,
.formulario > .aviso,
.formulario__enviar { grid-column: 1 / -1; }

.formulario__columna { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* la descripción ocupa lo que deje libre la otra columna */
.campo.campo--crece { flex: 1 1 auto; display: flex; flex-direction: column; }
/* mide lo mismo con "una idea" que con "un error", que tiene más campos al lado */
.campo--crece textarea.control { flex: 1 1 auto; min-height: 264px; }

textarea.control--bajo { min-height: 84px; }

.formulario__enviar { display: flex; align-items: center; gap: 12px 24px; }
.formulario__enviar .boton { flex: none; width: min(var(--ancho-botones), 100%); }
.formulario__enviar .campo__ayuda { flex: 1 1 auto; }

.etiqueta {
  display: block;
  padding: 0;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .22em;
  color: var(--oro-vivo);
}

.opcional { font-weight: 500; letter-spacing: .1em; color: rgba(251, 238, 226, .5); }

.tipos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tipos legend { margin-bottom: 10px; }

.eleccion {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 10px 16px 10px 42px;
  background: rgba(20, 10, 18, .6);
  box-shadow: inset 0 0 0 1px rgba(217, 167, 79, .45);
  cursor: var(--cursor-mano);
  transition: background .12s, box-shadow .12s;
}

.eleccion input { position: absolute; opacity: 0; pointer-events: none; }

/* el rombo que se enciende al elegir */
.eleccion::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 17px;
  width: 11px;
  height: 11px;
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 2px var(--oro);
}

.eleccion:hover { box-shadow: inset 0 0 0 1px rgba(242, 196, 98, .8); }
.eleccion:has(input:checked) { background: rgba(138, 34, 24, .6); box-shadow: inset 0 0 0 2px var(--oro-vivo); }
.eleccion:has(input:checked)::before { background: var(--oro-vivo); box-shadow: 0 0 10px rgba(255, 199, 92, .8); }
.eleccion:has(input:focus-visible) { outline: 2px solid var(--oro-vivo); outline-offset: 3px; }

.eleccion strong { font-size: 16px; font-weight: 900; letter-spacing: .2em; color: var(--crema); }
.eleccion span { font-size: 13px; color: rgba(251, 238, 226, .7); }

.campo { display: grid; gap: 7px; min-width: 0; }

.campo__cabeza { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }

.campo__ayuda { margin: 0; font-size: 12.5px; letter-spacing: .04em; color: rgba(251, 238, 226, .56); }

.campo__cuenta { font-size: 11px; letter-spacing: .1em; color: rgba(251, 238, 226, .42); font-variant-numeric: tabular-nums; }

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

/* los que ya hay en el tablón con un título parecido */
.parecidos {
  margin-top: -8px;
  padding: 14px 16px;
  background: rgba(242, 196, 98, .08);
  box-shadow: inset 3px 0 0 var(--oro-vivo);
}

.parecidos > p { margin: 0 0 10px; font-size: 13px; letter-spacing: .08em; color: var(--oro-palido); }

.parecidos ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }

.parecidos a { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; text-decoration: none; }
.parecidos a:hover .parecidos__titulo { color: var(--blanco); text-decoration: underline; }
.parecidos__titulo { font-size: 14.5px; overflow-wrap: anywhere; }

.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.aviso {
  margin: 0;
  padding: 10px 14px;
  background: rgba(138, 34, 24, .6);
  box-shadow: inset 3px 0 0 var(--sol);
  font-size: 14px;
  letter-spacing: .06em;
}

.formulario[aria-busy="true"] .boton--principal { opacity: .7; pointer-events: none; }

/* ---------- Archivos: cuatro huecos en el formulario ---------- */

.ranuras {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: filter .12s;
}

/* un archivo arrastrado encima enciende todos los huecos */
.ranuras.encima { filter: drop-shadow(0 0 8px rgba(255, 199, 92, .55)); }
.ranuras.encima .ranura--vacia,
.ranuras.encima .ranura--agregar { border-color: var(--oro-vivo); background: rgba(138, 34, 24, .45); }

.ranura { position: relative; min-width: 0; }

.ranura__caja {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  border: 1px dashed rgba(217, 167, 79, .35);
  background: rgba(20, 10, 18, .45);
  color: rgba(217, 167, 79, .5);
}

.ranura--agregar .ranura__caja {
  align-content: center;
  gap: 2px;
  border: 1px dashed rgba(242, 196, 98, .8);
  background: rgba(31, 15, 28, .8);
  color: var(--oro-palido);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .2em;
  transition: background .12s, border-color .12s, color .12s;
}

.ranura--agregar .ranura__caja b { font-size: 30px; line-height: 1; font-weight: 900; }

.ranura--agregar .ranura__caja:hover,
.ranura--agregar .ranura__caja:focus-visible { border-color: var(--melocoton); background: rgba(224, 80, 46, .84); color: var(--blanco); }

.ranura--llena .ranura__caja { border: 0; box-shadow: inset 0 0 0 1px var(--oro-vivo); background: rgba(20, 10, 18, .85); }

.ranura__caja img,
.ranura__caja video { width: 100%; height: 100%; object-fit: cover; }

/* las primeras líneas de un registro */
.ranura__texto {
  align-self: stretch;
  justify-self: stretch;
  margin: 0;
  padding: 6px 7px;
  overflow: hidden;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 8.5px;
  line-height: 1.35;
  color: rgba(251, 238, 226, .7);
  white-space: pre-wrap;
  word-break: break-all;
}

/* VIDEO / LOG en la esquina de abajo */
.ranura__sello {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 0 6px 0 7px;
  background: var(--oro-vivo);
  color: var(--noche);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .16em;
}

.ranura__nombre {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: .04em;
  color: rgba(251, 238, 226, .75);
}

.ranura__nombre span:first-child { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ranura__nombre span:last-child { flex: none; color: rgba(251, 238, 226, .45); }

/* el botón de quitar: rojo y siempre a la vista */
.ranura__quitar {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-color: var(--melocoton);
  background: var(--sol);
  color: var(--blanco);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}

.ranura__quitar svg { width: 12px; height: 12px; }
.ranura__quitar:hover { background: var(--bermellon); }

/* ---------- Archivos en la ficha ---------- */

.adjuntos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pieza { position: relative; min-width: 0; }

.pieza__vista {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: rgba(20, 10, 18, .75);
  box-shadow: inset 0 0 0 1px rgba(217, 167, 79, .45);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .2em;
  color: var(--oro);
  text-decoration: none;
}

.pieza__vista img,
.pieza__vista video { width: 100%; height: 100%; object-fit: cover; }

a.pieza__vista:hover { box-shadow: inset 0 0 0 2px var(--oro-vivo); color: var(--oro-palido); }

.pieza__nombre {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  font-size: 11px;
  letter-spacing: .04em;
  color: rgba(251, 238, 226, .7);
  white-space: nowrap;
  text-overflow: ellipsis;
}


/* en la ficha, más grandes y los vídeos enteros */
.detalle .adjuntos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.detalle .pieza__vista video { object-fit: contain; background: #000; }

/* ---------- Enviado ---------- */

.hecho {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 40px clamp(18px, 4vw, 34px);
  text-align: center;
}

.hecho:focus { outline: none; }

.hecho .rotulo__kanji { margin: 0; }

.hecho h2 {
  margin: 0;
  font-family: var(--mincho);
  font-weight: 800;
  font-size: clamp(30px, 6vw, 44px);
  letter-spacing: .08em;
  color: var(--titular);
  text-shadow: .07em .085em 0 var(--titular-sombra);
}

.hecho__codigo { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: .2em; color: var(--oro-vivo); }
.hecho__codigo:empty { display: none; }
.hecho__texto { margin: 0; color: rgba(251, 238, 226, .8); letter-spacing: .06em; }

.hecho__botones { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 12px; }

/* ---------- Pantallas bajas: el formulario sigue cabiendo sin desplazarse ---------- */

@media (min-width: 821px) and (max-height: 900px) {
  .buzon { padding-top: 56px; padding-bottom: 16px; }
  .buzon__rotulo { --tam-titular: 44px; margin-bottom: 14px; }
  .buzon__rotulo .lema { display: none; }
  .formulario { row-gap: 14px; padding-top: 18px; padding-bottom: 18px; }
  .formulario__columna { gap: 12px; }
  .campo--crece textarea.control { min-height: 246px; }
  textarea.control--bajo { min-height: 64px; }
  .ranura__caja { aspect-ratio: 16 / 10; }
}

/* ---------- Móvil ---------- */

@media (max-width: 820px) {
  .buzon { padding-top: 76px; }
  .formulario { grid-template-columns: minmax(0, 1fr); }
  .formulario__enviar { flex-direction: column; align-items: stretch; text-align: center; }
  .formulario__enviar .boton { width: 100%; }
}

@media (max-width: 640px) {
  .tipos,
  .pareja { grid-template-columns: minmax(0, 1fr); }
  .filtros select.control { flex: 1 1 140px; }
  .voto { width: 50px; min-height: 60px; font-size: 15px; }
  .aporte { gap: 14px; }
}
