/* Foro icorso - hoja de estilos unica (solo ASCII) */

:root {
  --papel: #fbf8f2;
  --superficie: #fffdf9;
  --tinta: #2b2520;
  --tinta-suave: #6b5e50;
  --linea: #e6dccb;
  --linea-fuerte: #cdbfa8;
  --granate: #7a2e1d;
  --granate-oscuro: #5e2215;
  --granate-suave: #f3e2d9;
  --oro: #a8761a;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
}

a { color: var(--granate); text-underline-offset: 2px; }
a:hover { color: var(--granate-oscuro); }

:focus-visible { outline: 2px solid var(--granate); outline-offset: 2px; }

img { max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.25;
  margin: 0 0 .5rem;
  overflow-wrap: anywhere;
}
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

p { margin: 0 0 1rem; }

.contenedor { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }
.contenedor-ancho { max-width: 70rem; }

.oculto {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.suave { color: var(--tinta-suave); }
.pequeno { font-size: .875rem; }

/* ---------- Cabecera del foro ---------- */

.cabecera {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  padding: 1.75rem 0 1rem;
  border-bottom: 2px solid var(--tinta);
}
.cabecera h1 { margin: 0; }
.cabecera h1 a { color: inherit; text-decoration: none; }
.cabecera p { margin: .25rem 0 0; color: var(--tinta-suave); max-width: 36rem; }

.volver { display: inline-block; margin: 1rem 0 .25rem; font-size: .925rem; }

/* ---------- Botones ---------- */

.boton, .boton-secundario, .boton-peligro {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .5rem 1rem;
  border-radius: 4px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}
.boton { background: var(--granate); color: #fff; }
.boton:hover { background: var(--granate-oscuro); color: #fff; }
.boton-secundario { background: transparent; color: var(--granate); border-color: var(--linea-fuerte); }
.boton-secundario:hover { border-color: var(--granate); color: var(--granate-oscuro); }
.boton-peligro { background: transparent; color: #9b2215; border-color: #e0b6ac; }
.boton-peligro:hover { border-color: #9b2215; }

.acciones { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }

/* ---------- Barra de herramientas ---------- */

.barra {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  align-items: center;
  padding: .85rem 0;
  border-bottom: 1px solid var(--linea);
}
.barra form { display: flex; gap: .5rem; flex: 1 1 14rem; min-width: 0; }
.barra input, .barra select { flex: 1 1 auto; min-width: 0; }

details.opciones { padding: .6rem 0; border-bottom: 1px solid var(--linea); }
details.opciones summary { cursor: pointer; color: var(--granate); font-size: .925rem; }
details.opciones form { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: flex-end; padding-top: .75rem; }
details.opciones .campo { margin: 0; }

/* ---------- Lista de discusiones ---------- */

.lista-discusiones { list-style: none; margin: 0; padding: 0; }

.discusion {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: .9rem 0;
  border-bottom: 1px solid var(--linea);
}
.discusion-cuerpo { min-width: 0; flex: 1 1 auto; }
.discusion .titulo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.075rem;
  line-height: 1.3;
  color: var(--tinta);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.discusion .titulo:hover { color: var(--granate); text-decoration: underline; }
.discusion .titulo:visited { color: #5a4f45; }

.meta { margin: .2rem 0 0; font-size: .875rem; color: var(--tinta-suave); overflow-wrap: anywhere; }
.meta strong { color: var(--tinta); font-weight: 600; }

.contador {
  flex: 0 0 auto;
  min-width: 3.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: .875rem;
  color: var(--tinta-suave);
  line-height: 1.3;
}
.contador b { display: block; font-size: 1.15rem; color: var(--tinta); }

.etiqueta-nuevo {
  display: inline-block;
  margin-left: .35rem;
  padding: .05rem .4rem;
  border-radius: 3px;
  background: var(--granate-suave);
  color: var(--granate);
  font-family: var(--sans);
  font-size: .75rem;
  font-weight: 700;
  vertical-align: .15em;
}
.estrella { color: var(--oro); margin-right: .25rem; }

.vacio { padding: 2rem 0; color: var(--tinta-suave); }

/* ---------- Paginacion ---------- */

.paginacion {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0 .5rem;
}
.paginacion .estado { width: 100%; text-align: center; font-size: .875rem; color: var(--tinta-suave); font-variant-numeric: tabular-nums; }

/* ---------- Mensaje ---------- */

.mensaje {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  background: var(--superficie);
  border: 1px solid var(--linea);
  border-radius: 6px;
}
.mensaje h1, .mensaje h2 { margin-bottom: .75rem; }

.autor { display: flex; gap: .85rem; align-items: center; margin-bottom: 1rem; }
.autor img { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; }
.autor .nombre { font-weight: 700; }
.autor .datos { font-size: .875rem; color: var(--tinta-suave); overflow-wrap: anywhere; }

.texto-mensaje { font-size: 1.025rem; line-height: 1.65; overflow-wrap: anywhere; }
.texto-mensaje img { max-width: 100%; height: auto; vertical-align: middle; }
.texto-mensaje big { font-size: 1.2em; }
.firma { margin-top: 1rem; padding-top: .75rem; border-top: 1px dashed var(--linea-fuerte); font-size: .925rem; color: var(--tinta-suave); }

/* Arbol de la discusion */
.arbol, .arbol ul { list-style: none; margin: 0; padding: 0; }
.arbol ul { margin-left: .5rem; padding-left: .85rem; border-left: 2px solid var(--linea); }
.arbol li { padding: .3rem 0; overflow-wrap: anywhere; }
.arbol .meta { display: inline; margin-left: .35rem; }
.arbol [aria-current="page"] { font-weight: 700; color: var(--tinta); }

.seccion { margin: 2rem 0; }
.seccion > h2 { padding-bottom: .4rem; border-bottom: 1px solid var(--linea); }

/* ---------- Formularios ---------- */

.formulario { display: grid; gap: 1rem; margin: 1rem 0; }
.campo { display: grid; gap: .3rem; min-width: 0; }
.campo label, .campo .etiqueta { font-weight: 600; font-size: .925rem; }
.campo .ayuda { font-size: .825rem; color: var(--tinta-suave); }
.campo-casilla { display: flex; gap: .5rem; align-items: flex-start; }
.campo-casilla input { margin-top: .3rem; width: auto; }

input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 16px;
  color: var(--tinta);
  background: #fff;
  border: 1px solid var(--linea-fuerte);
  border-radius: 4px;
  padding: .55rem .65rem;
  min-height: 44px;
}
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; min-height: 0; accent-color: var(--granate); }
textarea { min-height: 11rem; resize: vertical; line-height: 1.5; }
input[readonly] { background: var(--papel); color: var(--tinta-suave); }

.ayuda-codigos { font-size: .85rem; color: var(--tinta-suave); }
.ayuda-codigos summary { cursor: pointer; color: var(--granate); }
.ayuda-codigos ul { list-style: none; margin: .5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1rem; }
.ayuda-codigos code { font-family: inherit; background: var(--granate-suave); color: var(--tinta); padding: 0 .3rem; border-radius: 3px; }
.ayuda-codigos img { vertical-align: middle; }

/* ---------- Avisos ---------- */

.aviso { margin: 1rem 0; padding: .75rem 1rem; border-radius: 4px; border-left: 4px solid; }
.aviso-ok { background: #edf3e4; border-color: #4d7a2a; color: #2d4a17; }
.aviso-error { background: #f8e5e1; border-color: #a23b26; color: #6e2314; }

/* ---------- Tablas (panel) ---------- */

.tabla-scroll { overflow-x: auto; margin: 1rem 0; }
.tabla { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tabla th {
  text-align: left;
  font-size: .85rem;
  color: var(--tinta-suave);
  border-bottom: 2px solid var(--linea-fuerte);
  padding: .5rem;
  white-space: nowrap;
}
.tabla td { padding: .6rem .5rem; border-bottom: 1px solid var(--linea); vertical-align: top; overflow-wrap: anywhere; }
.tabla .numero { font-variant-numeric: tabular-nums; }

/* ---------- Pie ---------- */

.pie {
  margin-top: 3rem;
  padding: 1.25rem 0 2.5rem;
  border-top: 1px solid var(--linea);
  font-size: .875rem;
  color: var(--tinta-suave);
}
.pie ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: .5rem 0 0; padding: 0; }

/* ---------- Panel ---------- */

.panel-cabecera { background: #f3ece0; border-bottom: 1px solid var(--linea-fuerte); padding: .75rem 0 0; }
.panel-cabecera .contenedor { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; }
.panel-marca { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; }
.panel-marca a { color: var(--tinta); text-decoration: none; }
.panel-usuario { margin: 0; font-size: .875rem; color: var(--tinta-suave); }
.panel-usuario a { margin-left: .75rem; }
.panel-cabecera nav { width: 100%; }
.panel-menu { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: .5rem 0 0; padding: 0; }
.panel-menu a { display: inline-block; padding: .5rem 0; color: var(--tinta); text-decoration: none; border-bottom: 3px solid transparent; }
.panel-menu a:hover { color: var(--granate); }
.panel-menu a[aria-current="page"] { color: var(--granate); border-bottom-color: var(--granate); font-weight: 600; }
.panel main { padding-top: 1.5rem; padding-bottom: 3rem; }
.panel .formulario { max-width: 40rem; }
.filtros { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.filtros .campo { flex: 1 1 12rem; }

/* ---------- Ajustes ---------- */

@media (min-width: 40rem) {
  h1 { font-size: 1.9rem; }
  .discusion .titulo { font-size: 1.125rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

mark { background: #f6e6b4; color: inherit; padding: 0 .1em; }
.fragmento { margin: .35rem 0 0; font-size: .925rem; overflow-wrap: anywhere; }
