/* ============================================================
   LABEL — The Golden Guestbook (livre d'or)
   Loaded only by guestbook.html / fr/guestbook.html after
   main.css. Gilded note cards + the signing form.
   ============================================================ */

/* ---------- The signing form ---------- */
.gb-form {
  position: relative;
  max-width: 680px;
  margin: 0 auto 3.2rem;
  padding: 2rem 1.9rem 1.7rem;
  background:
    radial-gradient(ellipse 90% 100% at 50% 0%, rgba(201, 162, 39, 0.07), transparent 60%),
    var(--espresso);
  border: 1px solid rgba(201, 162, 39, 0.3);
  clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
}

.gb-field { position: relative; display: flex; flex-direction: column; gap: 0.45rem; margin-top: 1.1rem; }
.gb-field label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--champagne);
}
.gb-opt { color: var(--ash); font-weight: 400; letter-spacing: 0.1em; }

.gb-form textarea,
.gb-form input[type="text"],
.gb-form input:not([type]) {
  font-family: var(--sans);
  font-size: 16px; /* prevents iOS focus zoom */
  color: var(--ivory);
  background: rgba(14, 12, 9, 0.65);
  border: 1px solid rgba(201, 162, 39, 0.22);
  padding: 0.85rem 1rem;
  width: 100%;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.gb-form textarea { resize: vertical; min-height: 104px; line-height: 1.55; }
.gb-form textarea:focus-visible,
.gb-form input:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 18px rgba(201, 162, 39, 0.18);
}
.gb-form ::placeholder { color: rgba(154, 147, 138, 0.55); }

.gb-count {
  position: absolute;
  right: 0.35rem;
  bottom: -1.25rem;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ash);
  font-variant-numeric: tabular-nums;
}
.gb-count.near { color: var(--terracotta); }

.gb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.gb-row .gb-field { margin-top: 1.4rem; }

.gb-submit { margin-top: 1.5rem; min-height: 50px; }
.gb-submit[disabled] { opacity: 0.55; cursor: wait; }

.gb-legal { font-size: 0.76rem; color: var(--ash); line-height: 1.6; margin: 1rem 0 0; }
.gb-legal a { color: var(--champagne); text-decoration: underline; text-underline-offset: 3px; }
.gb-legal a:hover { color: var(--gold); }

/* ---------- The wall ---------- */
.gb-wall {
  columns: 3 280px;
  column-gap: 1.2rem;
  max-width: 1080px;
  margin: 0 auto;
}

/* ---------- A note ---------- */
.gb-note {
  position: relative;
  display: inline-block; /* column layout */
  width: 100%;
  margin: 0 0 1.2rem;
  padding: 1.7rem 1.5rem 1.3rem;
  background: var(--espresso);
  border: 1px solid rgba(201, 162, 39, 0.24);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  break-inside: avoid;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
  animation: gb-in 0.6s var(--ease) both;
}

/* Gentle handwriting tilt — alternating, desktop only */
@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  .gb-note:nth-child(3n + 1) { transform: rotate(-0.55deg); }
  .gb-note:nth-child(3n + 2) { transform: rotate(0.4deg); }
  .gb-note:hover { transform: rotate(0) translateY(-4px); }
}
.gb-note:hover {
  border-color: rgba(201, 162, 39, 0.55);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 22px rgba(201, 162, 39, 0.08);
}

/* Every sixth note is gold-washed — rhythm on the wall */
.gb-note:nth-child(6n + 4) {
  background:
    linear-gradient(160deg, rgba(201, 162, 39, 0.13), rgba(201, 162, 39, 0.03) 55%),
    var(--espresso);
  border-color: rgba(201, 162, 39, 0.45);
}

/* The opening quotation mark — gilded, oversized, behind the text */
.gb-note::before {
  content: "\201C";
  position: absolute;
  top: 0.1rem;
  left: 0.65rem;
  font-family: var(--serif);
  font-size: 4.6rem;
  line-height: 1;
  color: rgba(201, 162, 39, 0.22);
  pointer-events: none;
}

.gb-note .msg {
  position: relative;
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.62;
  color: var(--ivory);
  margin: 0 0 1.1rem;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.gb-note .sig {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(201, 162, 39, 0.18);
}
.gb-note .who {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.gb-note .where {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ash);
}
.gb-note .when {
  margin-left: auto;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: rgba(154, 147, 138, 0.7);
  font-variant-numeric: tabular-nums;
}

/* Freshly signed — a golden settle-in */
.gb-note.is-new {
  animation: gb-new 1.6s var(--ease) both;
}
@keyframes gb-new {
  0% { opacity: 0; transform: translateY(14px) scale(0.97); border-color: var(--gold); box-shadow: 0 0 34px rgba(201, 162, 39, 0.35); }
  45% { opacity: 1; transform: translateY(0) scale(1); border-color: var(--gold); box-shadow: 0 0 34px rgba(201, 162, 39, 0.35); }
  100% { border-color: rgba(201, 162, 39, 0.24); box-shadow: none; }
}
@keyframes gb-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Stagger the first screenful */
.gb-note:nth-child(1) { animation-delay: 0.05s; }
.gb-note:nth-child(2) { animation-delay: 0.12s; }
.gb-note:nth-child(3) { animation-delay: 0.19s; }
.gb-note:nth-child(4) { animation-delay: 0.26s; }
.gb-note:nth-child(5) { animation-delay: 0.33s; }
.gb-note:nth-child(6) { animation-delay: 0.4s; }

/* ---------- Empty / offline states ---------- */
.gb-empty {
  text-align: center;
  max-width: 460px;
  margin: 1rem auto 2rem;
  padding: 3rem 1.5rem;
  border: 1px dashed rgba(201, 162, 39, 0.3);
}
.gb-empty[hidden] { display: none; }
.gb-empty-mark {
  display: block;
  font-family: var(--serif);
  font-size: 3.4rem;
  line-height: 1;
  color: rgba(201, 162, 39, 0.4);
  margin-bottom: 0.6rem;
}
.gb-empty h2 { font-size: 1.5rem; margin-bottom: 0.4rem; }

/* ---------- Phone ---------- */
@media (max-width: 760px) {
  .gb-form { padding: 1.6rem 1.25rem 1.4rem; margin-bottom: 2.4rem; }
  .gb-row { grid-template-columns: 1fr; gap: 0; }
  .gb-submit { width: 100%; min-height: 52px; }
  .gb-wall { columns: 1; }
  .gb-note { margin-bottom: 1rem; padding: 1.5rem 1.3rem 1.15rem; }
  .gb-note .msg { font-size: 1.04rem; }
}
@media (min-width: 521px) and (max-width: 760px) {
  .gb-wall { columns: 2 240px; }
}

@media (prefers-reduced-motion: reduce) {
  .gb-note, .gb-note.is-new { animation: none; }
  .gb-note { transition: none; }
}
