/* =====================================================================
   Farewell landing — Cafetería Centro Elena
   ===================================================================== */

:root {
  --espresso: #2b1d14;
  --roast: #4a3020;
  --coffee: #7a5236;
  --crema: #c8955a;
  --crema-soft: #e9cfa8;
  --milk: #f6efe4;
  --paper: #fffaf2;
  --ink: #2b1d14;
  --ink-soft: #6a584b;
  --line: #e3d6c3;
  --ok: #2f6b3d;
  --ok-bg: #e5f1e4;
  --err: #9b2c1f;
  --err-bg: #f8e3df;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(43, 29, 20, .06), 0 8px 24px rgba(43, 29, 20, .08);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--milk);
  color: var(--ink);
  font: 400 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--coffee); }

h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}

h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .85em 1.6em;
  border: 0;
  border-radius: 999px;
  background: var(--espresso);
  color: var(--paper);
  font: 500 1rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover { background: var(--roast); transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn:focus-visible { outline: 3px solid var(--crema); outline-offset: 3px; }

.btn--light { background: var(--paper); color: var(--espresso); }
.btn--light:hover { background: var(--crema-soft); }

.btn--small { padding: .55em 1.1em; font-size: .9rem; }
.btn--ghost { background: transparent; color: var(--espresso); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn--ghost:hover { background: var(--paper); }
.btn--danger { background: transparent; color: var(--err); box-shadow: inset 0 0 0 1.5px #e7c2bb; }
.btn--danger:hover { background: var(--err-bg); }

.linklike {
  background: none; border: 0; padding: 0;
  color: inherit; font: inherit; text-decoration: underline; cursor: pointer;
}

/* ---------- Hero (compact) ---------- */

.hero {
  background:
    radial-gradient(ellipse 70% 80% at 50% 0%, rgba(200, 149, 90, .25), transparent 70%),
    var(--espresso);
  color: var(--paper);
  text-align: center;
  /* Bottom padding leaves room for the cards that overlap the header */
  padding: 24px 16px 92px;
}

.hero__inner { max-width: 760px; margin: 0 auto; }

.hero__logo {
  height: 44px;
  width: auto;
  margin: 0 auto 18px;
  /* The original logo is designed for a light background */
  background: var(--paper);
  padding: 6px 14px;
  border-radius: 8px;
}

.kicker {
  margin: 0 0 .35em;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--crema);
}

.hero__title {
  font-size: clamp(2.2rem, 6.5vw, 3.6rem);
  font-weight: 400;
  margin: 0;
}
@media (max-width: 480px) {
  .kicker { letter-spacing: .1em; font-size: .7rem; }
}

.hero__title em { font-style: italic; color: var(--crema-soft); }

.hero__lead {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  max-width: 46ch;
  margin: .6em auto 0;
  color: var(--crema-soft);
}

/* ---------- Top block: form + letter ---------- */

main { padding: 0 16px; }

.top {
  max-width: 1080px;
  margin: -72px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: "letter write";
  gap: 28px;
  align-items: start;
}
.write  { grid-area: write; }
.letter { grid-area: letter; }

@media (max-width: 860px) {
  .top {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "write" "letter";
    max-width: 600px;
  }
}

/* ---------- Form card ---------- */

.write {
  position: sticky;
  top: 16px;
  scroll-margin-top: 16px;
}
@media (max-width: 860px) { .write { position: static; } }

.write__card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(43, 29, 20, .08), 0 18px 40px rgba(43, 29, 20, .16);
  border-top: 6px solid var(--crema);
  padding: clamp(20px, 3.5vw, 30px);
}

.write__head { margin-bottom: 18px; }
.write__head h2 { font-size: clamp(1.6rem, 3.6vw, 2rem); margin-bottom: .2em; }
.write__head p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

.write__wall-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-weight: 500;
  font-size: .95rem;
}

.form { display: grid; gap: 14px; }

.field { display: grid; gap: 5px; }
.field__label { font-weight: 500; font-size: .95rem; }
.field__label small { font-weight: 400; color: var(--ink-soft); }
.field__hint { justify-self: end; font-size: .8rem; color: var(--ink-soft); margin-top: -2px; }

.field input,
.field textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: .7em .85em;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { resize: vertical; min-height: 104px; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--crema);
  box-shadow: 0 0 0 4px rgba(200, 149, 90, .2);
}
/* Captcha and submit button share a row; the button wraps below on narrow cards */
.form__submit {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 14px;
}
.form__submit .field--captcha { flex: 1 1 190px; }
.btn--submit {
  flex: 1 1 180px;
  padding-block: 1em;
  font-size: 1.05rem;
  background: var(--espresso);
}

/* Honeypot */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.flash {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-weight: 500;
}
.flash--ok { background: var(--ok-bg); color: var(--ok); }
.flash--error { background: var(--err-bg); color: var(--err); }

.closed-note { text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.2rem; margin: 0; }

/* ---------- Letter ---------- */

.letter__paper {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 40px);
}
.letter__paper p { margin: 0 0 .9em; }

.letter__title {
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 400;
  color: var(--coffee);
  margin-bottom: .6em;
}

.letter__sign {
  margin: 1.3em 0 0 !important;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
}
.letter__sign span { font-style: normal; font-weight: 600; color: var(--ink); }

.photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--crema-soft);
  box-shadow: var(--shadow);
}

/* ---------- Wall ---------- */

.wall {
  max-width: 1080px;
  margin: clamp(48px, 7vw, 80px) auto 0;
  scroll-margin-top: 16px;
  padding-bottom: 40px;
}
.wall h2 { text-align: center; }
.wall__count {
  display: inline-block;
  vertical-align: middle;
  font: 700 .9rem/1 var(--sans);
  background: var(--crema-soft);
  color: var(--roast);
  padding: .45em .7em;
  border-radius: 999px;
  margin-left: .3em;
}

.wall__empty { text-align: center; color: var(--ink-soft); }

.wall__grid { columns: 3 280px; column-gap: 20px; }

.note {
  break-inside: avoid;
  margin: 0 0 20px;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 22px 22px 18px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--crema-soft);
}
.note:nth-child(3n+2) { border-top-color: var(--crema); }
.note:nth-child(3n)   { border-top-color: var(--coffee); }

.note__body {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.note__meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: .85rem;
  color: var(--ink-soft);
}
.note__name { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.note__name::before { content: "— "; color: var(--crema); }

/* ---------- Footer ---------- */

.footer {
  margin-top: 60px;
  padding: 36px 16px;
  text-align: center;
  background: var(--espresso);
  color: var(--crema-soft);
  font-size: .9rem;
}
.footer p { margin: .3em 0; }
.footer a { color: var(--crema-soft); }
.footer__credit { font-size: .8rem; opacity: .75; }

/* =====================================================================
   Admin
   ===================================================================== */

.admin__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--espresso);
  color: var(--paper);
}
.admin__brand { font-weight: 700; }
.admin__bar-actions { display: flex; gap: 18px; align-items: center; font-size: .95rem; }
.admin__bar-actions a { color: var(--crema-soft); }
.admin__bar-actions form { margin: 0; }

.admin__main { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }

.admin__card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  max-width: 460px;
  margin: 40px auto;
}
.admin__card h1 { font-family: var(--sans); font-size: 1.4rem; }
.admin__card pre {
  white-space: pre-wrap;
  word-break: break-all;
  background: var(--milk);
  padding: 12px;
  border-radius: 8px;
  font-size: .85rem;
}

.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs a {
  padding: .55em 1em;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--line);
}
.tabs a span {
  display: inline-block;
  min-width: 1.6em;
  margin-left: .3em;
  padding: .1em .45em;
  border-radius: 999px;
  background: var(--milk);
  font-size: .85em;
  text-align: center;
}
.tabs a.is-active { background: var(--espresso); color: var(--paper); box-shadow: none; }
.tabs a.is-active span { background: var(--roast); }

.bulk { margin: 0 0 18px; }

.mod {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.mod__head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mod__head time { color: var(--ink-soft); font-size: .85rem; }
.mod__body { margin: 10px 0 14px; overflow-wrap: anywhere; }
.mod__actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
