/* ==========================================================================
   ArgPoética · Componentes reutilizables
   Etiquetas, botones, campos, tarjetas, poema, mail de muestra, lector.
   ========================================================================== */

/* ---- Etiqueta (manual: SemiBold 13 px, +0.15 em, celeste profundo) ------ */

.label {
  font-family: var(--font-text);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--ls-label);
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--label);
}

/* Etiqueta seguida de un filete, como "ÚLTIMOS POEMAS ——" en la maqueta */
.label--rule {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.label--rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Autoría, fecha, ubicación (manual: Italic 15/22) */
.meta {
  font-size: var(--fs-meta);
  line-height: var(--lh-meta);
  font-style: italic;
  color: var(--muted);
}

/* Titular de portada: el único texto en IM Fell fuera del logo */
.cover-title {
  font-family: var(--font-brand);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.01em;
}

/* Guion de sol: detalle de acento sobre tarjetas */
.dash::before {
  content: "";
  display: block;
  width: 2rem;
  height: 3px;
  border-radius: 2px;
  background: var(--sol);
}

/* ---- Botones ------------------------------------------------------------ */
/* Manual: botón Tinta con texto Papel y esquinas redondeadas.             */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 3.25rem;
  padding: 0 var(--space-6);
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.btn--primary:hover {
  background: var(--link);
  color: var(--blanco);
}

.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--fg);
}

.btn--small {
  min-height: 2.6rem;
  padding: 0 var(--space-5);
  font-size: var(--fs-small);
}

.btn[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}

/* Botón con aspecto de link */
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

/* ---- Campos ------------------------------------------------------------- */

.input {
  width: 100%;
  min-height: 3.25rem;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 1rem;
}

.input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}

.input[aria-invalid="true"] {
  border-color: var(--error);
}

.input--poem {
  min-height: 12rem;
  resize: vertical;
  line-height: 1.7;
}

select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.25rem) 55%, calc(100% - 0.9rem) 55%;
  background-size: 0.35rem 0.35rem;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

.field {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.field label,
.form legend {
  font-size: var(--fs-small);
  font-weight: 600;
}

.req {
  color: var(--error);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--fs-small);
  line-height: 1.5;
  cursor: pointer;
}

.check input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--celeste-profundo);
  flex: none;
}

/* ---- Formulario de suscripción ----------------------------------------- */

.subscribe {
  display: grid;
  gap: var(--space-3);
  max-width: 34rem;
}

.subscribe__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.subscribe__input {
  flex: 1 1 15rem;
  border-color: var(--fg);
}

.subscribe__btn {
  flex: 1 1 auto;
}

.subscribe__note {
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--muted);
}

.subscribe__note.is-error,
.form__status.is-error {
  color: var(--error);
  font-weight: 600;
}

/* Estado "suscripto": reemplaza los campos por el mensaje */
.subscribe.is-done .subscribe__row {
  display: none;
}

.subscribe.is-done .subscribe__note {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}

/* ---- Tarjeta ------------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* ---- Poema ------------------------------------------------------------- */

.poem-title {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
}

/* Cada estrofa es un <p>; cada verso un <span> en bloque.
   Los versos largos sangran en la continuación, como en un libro. */
.poem {
  display: grid;
  gap: 1.1em;
  max-width: var(--measure);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.poem p span {
  display: block;
  padding-left: 1.5em;
  text-indent: -1.5em;
}

/* ---- Lector (modal) ----------------------------------------------------- */

.reader {
  width: min(42rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--fg);
  box-shadow: var(--shadow-card);
}

.reader::backdrop {
  background: rgba(35, 31, 32, 0.6);
}

.reader[open] {
  animation: reader-in 0.25s ease-out;
}

@keyframes reader-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.reader__inner {
  position: relative;
  display: grid;
  gap: var(--space-3);
  padding: var(--space-7) clamp(1.25rem, 6vw, 3.5rem) var(--space-6);
}

.reader__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.reader__close:hover {
  background: var(--surface-2);
  color: var(--fg);
}

.reader .poem {
  margin-block: var(--space-4);
}

.reader__book {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.reader__book dt {
  color: var(--muted);
}

.reader__book dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.reader__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-4);
}

.reader__status {
  min-height: 1.4em;
  font-size: var(--fs-small);
  color: var(--muted);
}

/* ---- Anti-spam y consentimiento ----------------------------------------- */

/* Campo trampa: las personas no lo ven ni lo tocan; los robots sí lo completan */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.subscribe .check {
  color: var(--muted);
  font-size: var(--fs-small);
}

.subscribe .check a,
.form .check a {
  color: var(--link);
  text-underline-offset: 0.2em;
}

/* Sobre el celeste el link va en tinta (el celeste profundo no contrasta) */
.cta-band .subscribe .check,
.cta-band .subscribe .check a {
  color: var(--tinta);
}

.subscribe.is-done .check,
.subscribe.is-done [data-turnstile] {
  display: none;
}

[data-turnstile]:empty {
  display: none;
}

/* ---- Lector: por qué este poema, hoy ------------------------------------- */

.reader__context {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--sol);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: var(--measure);
}

.reader__context p:not(.label) {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-small);
  line-height: 1.65;
}

.reader__context p:last-child {
  margin-bottom: 0;
}
