@font-face { font-family: 'Zilla Slab'; font-weight: 400; font-display: swap; src: url('/fonts/zilla-slab-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Zilla Slab'; font-weight: 700; font-display: swap; src: url('/fonts/zilla-slab-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }

:root {
  --papel: #f3ede0;
  --caja: #fffdf8;
  --tinta: #1d1d1b;
  --tinta-suave: #5b574f;
  --linea: #d8cfbd;
  --naranja: #ff7a1a;
  --naranja-osc: #c8550a;
  --azul: #1f4fa3;
  --sombra: 3px 3px 0 #1d1d1b;
  --radio: 4px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papel);
  background-image: radial-gradient(rgba(29, 29, 27, 0.05) 1px, transparent 1px);
  background-size: 6px 6px;
  color: var(--tinta);
  font: 15px/1.5 Inter, system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--azul); }
a:hover { color: var(--naranja-osc); }
h1, h2, h3 { font-family: 'Zilla Slab', Georgia, serif; line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; display: block; }

/* ---------- barra y pie ---------- */
.barra {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .6rem 1.25rem; background: var(--tinta); color: var(--papel);
  position: sticky; top: 0; z-index: 5;
}
.logo { font: 700 1.7rem/1 'Zilla Slab', serif; color: var(--papel); text-decoration: none; letter-spacing: -.02em; }
.logo .punto { color: var(--naranja); }
.logo:hover { color: #fff; }
.barra-nav { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.barra-nav a { color: var(--papel); text-decoration: none; font-size: .9rem; padding: .3rem .6rem; border: 1px solid rgba(243, 237, 224, .35); border-radius: var(--radio); }
.barra-nav a:hover { border-color: var(--naranja); color: #fff; }
.barra-nav a.destacado { background: var(--naranja); border-color: var(--naranja); color: var(--tinta); font-weight: 600; }

.app { width: 100%; max-width: 1060px; margin: 0 auto; padding: 1.25rem; flex: 1; }
.pie { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: 1rem 1.25rem; font-size: .8rem; color: var(--tinta-suave); border-top: 1px solid var(--linea); }
.cargando { color: var(--tinta-suave); text-align: center; padding: 3rem 0; }

/* ---------- cajas y botones ---------- */
.caja { background: var(--caja); border: 1.5px solid var(--tinta); border-radius: var(--radio); box-shadow: var(--sombra); padding: 1rem 1.1rem; margin-bottom: 1.25rem; }
.caja-titulo { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; border-bottom: 1px dashed var(--linea); padding-bottom: .4rem; margin-bottom: .75rem; }
.caja-titulo h2, .caja-titulo h3 { margin: 0; }
.chico { font-size: .82rem; color: var(--tinta-suave); }
.aviso { background: #fff3e6; border: 1.5px dashed var(--naranja-osc); border-radius: var(--radio); padding: .75rem .9rem; margin-bottom: 1rem; }
.error { color: #b3261e; font-weight: 600; }
.ok { color: #2e7d32; font-weight: 600; }

.boton, button {
  font: 600 .92rem/1 Inter, sans-serif; cursor: pointer;
  background: var(--caja); color: var(--tinta);
  border: 1.5px solid var(--tinta); border-radius: var(--radio);
  padding: .6rem .9rem; box-shadow: 2px 2px 0 var(--tinta);
  text-decoration: none; display: inline-flex; align-items: center; gap: .35rem;
}
.boton:hover, button:hover { background: #fff; color: var(--tinta); }
.boton:active, button:active { transform: translate(2px, 2px); box-shadow: none; }
.boton.principal, button.principal { background: var(--naranja); }
.boton.principal:hover, button.principal:hover { background: #ff8c3a; }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 2px 2px 0 var(--tinta); }
.enlace { background: none; border: 0; box-shadow: none; padding: 0; color: var(--azul); text-decoration: underline; font: inherit; font-size: .82rem; }
.enlace:hover { background: none; color: var(--naranja-osc); }
.enlace:active { transform: none; }
.acciones { display: flex; flex-wrap: wrap; gap: .5rem; margin: .75rem 0; }

label { display: block; font-weight: 600; font-size: .88rem; margin: .65rem 0 .25rem; }
input[type=text], textarea {
  width: 100%; font: inherit; color: var(--tinta); background: #fff;
  border: 1.5px solid var(--tinta); border-radius: var(--radio); padding: .55rem .65rem;
}
textarea { min-height: 5.5rem; resize: vertical; }
input:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid var(--naranja); outline-offset: 1px; }
.fila { display: flex; gap: .5rem; align-items: stretch; }
.fila input { flex: 1; }
.check { display: flex; gap: .45rem; align-items: center; font-weight: 400; }

/* ---------- inicio ---------- */
.portada { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.25rem; align-items: start; }
.portada h1 { font-size: 2.4rem; }
.portada h1 em { font-style: normal; color: var(--naranja-osc); }
.lista-ritual { margin: 0 0 1rem; padding-left: 1.1rem; }
.lista-ritual li { margin-bottom: .3rem; }
.grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .85rem; }
.miniatura { display: block; text-decoration: none; color: var(--tinta); background: #fff; border: 1px solid var(--linea); padding: .35rem .35rem .45rem; box-shadow: 2px 2px 0 rgba(29, 29, 27, .18); transition: transform .12s; }
.miniatura:hover { transform: rotate(-1deg) scale(1.02); color: var(--tinta); }
.miniatura img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; background: #ddd; }
.miniatura span { display: block; font-size: .78rem; margin-top: .3rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.miniatura b { color: var(--naranja-osc); }

/* ---------- flog ---------- */
.flog { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1.25rem; align-items: start; }
.foto-del-dia .fecha-larga { font: 700 .82rem/1 Inter, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: var(--naranja-osc); }
.marco { background: #fff; padding: .6rem .6rem 1.4rem; border: 1px solid var(--linea); box-shadow: 0 2px 0 var(--linea); margin: .5rem auto 1rem; max-width: 680px; }
.marco img { width: 100%; height: auto; }
.foto-titulo { font-size: 1.6rem; margin: 0 0 .35rem; }
.foto-texto { white-space: pre-wrap; overflow-wrap: anywhere; }
.cancion { display: inline-flex; gap: .4rem; align-items: center; font-size: .85rem; background: var(--tinta); color: var(--papel); padding: .3rem .6rem; border-radius: 999px; margin-bottom: .75rem; }
.cancion::before { content: '♪'; color: var(--naranja); }
.navegar { display: flex; justify-content: space-between; gap: .5rem; font-size: .9rem; margin-top: .5rem; }

.firmame { font: 700 1.25rem/1 'Zilla Slab', serif; }
.firma { border-top: 1px dashed var(--linea); padding: .65rem 0; overflow-wrap: anywhere; }
.firma:first-child { border-top: 0; }
.firma-cabeza { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.firma-nick { font-weight: 700; }
.firma-msj { white-space: pre-wrap; margin: .2rem 0 0; }
.colores { display: flex; gap: .4rem; flex-wrap: wrap; margin: .35rem 0 .2rem; }
.colores button { width: 1.8rem; height: 1.8rem; padding: 0; border-radius: 50%; box-shadow: none; border: 2px solid var(--caja); outline: 1.5px solid var(--tinta); }
.colores button[aria-pressed=true] { outline: 3px solid var(--naranja); }

.perfil-nick { font: 700 1.5rem/1.1 'Zilla Slab', serif; overflow-wrap: anywhere; }
.contador { display: inline-flex; gap: 2px; margin: .25rem 0 .5rem; }
.contador span { background: var(--tinta); color: #7CFF6B; font: 700 1rem/1 'Courier New', monospace; padding: .3rem .28rem; border-radius: 2px; min-width: 1.15rem; text-align: center; }
.amigos { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.amigos li { display: flex; gap: .6rem; align-items: center; }
.amigos img, .amigos .sin-foto { width: 56px; height: 42px; object-fit: cover; border: 1px solid var(--linea); background: #e8e1d2; flex: none; }
.amigos .nuevo { color: #2e7d32; font-size: .72rem; font-weight: 700; }
.archivo { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.archivo a { position: relative; display: block; border: 2px solid transparent; }
.archivo a[aria-current=page] { border-color: var(--naranja); }
.archivo img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.archivo small { position: absolute; right: 2px; bottom: 2px; background: rgba(29, 29, 27, .8); color: #fff; font-size: .65rem; padding: 0 .25rem; border-radius: 2px; }

/* ---------- subir ---------- */
.subir { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.vista-previa { background: #fff; border: 1.5px dashed var(--tinta-suave); min-height: 240px; display: grid; place-items: center; text-align: center; color: var(--tinta-suave); padding: .6rem; }
.vista-previa canvas { max-width: 100%; height: auto; display: block; }
.elegir-foto { position: relative; overflow: hidden; }
.elegir-foto input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.llave-link { font-family: 'Courier New', monospace; font-size: .8rem; background: #fff; border: 1px solid var(--linea); padding: .5rem; overflow-wrap: anywhere; user-select: all; }
.oculta-marca { background: #fde7e5; color: #8c1d18; padding: .2rem .5rem; border-radius: var(--radio); font-size: .8rem; font-weight: 600; display: inline-block; margin-bottom: .5rem; }

@media (max-width: 820px) {
  .portada, .flog, .subir { grid-template-columns: 1fr; }
  .portada h1 { font-size: 1.9rem; }
  .app { padding: .9rem; }
  .barra { padding: .5rem .9rem; }
  .caja { box-shadow: 2px 2px 0 var(--tinta); }
}
