/* Guestbook module styles. To remove the guestbook: delete this file's
   <link>, js/guestbook.js's <script>, the #guestbook section in
   index.html, functions/api/guestbook.js, and the guestbook-photo code
   in functions/api/messages.js + public/js/messages.js +
   public/css/messages.css (the `photo`/`photo_type` columns in
   schema.sql can stay — they're unused if the guestbook is gone). */

.guestbook {
  background-color: var(--paper);
  padding: var(--space-section-y) 24px;
  box-sizing: border-box;
  scroll-margin-top: 90px;
}

.guestbook-inner {
  max-width: var(--width-form);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.guestbook-head p {
  margin: 0;
  font-size: var(--size-body);
  line-height: 1.65;
  font-weight: 300;
  color: var(--ink-muted);
  max-width: 420px;
  text-wrap: pretty;
}

.guestbook-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: clamp(24px, 5vw, 40px);
  box-shadow: 0 1px 2px rgba(59, 52, 50, 0.05), 0 16px 40px -20px rgba(59, 52, 50, 0.18);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.field input,
.field textarea {
  font: inherit;
  font-size: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-input);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px var(--blush);
}

.field.has-error input {
  border-color: var(--rose);
}

.field textarea {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.5;
  resize: vertical;
  overflow-wrap: break-word;
}

.field-error {
  font-size: 14px;
  color: var(--rose-deep);
  line-height: 1.5;
}

.field input[type="file"] {
  padding: 10px;
  font-size: 14px;
  color: var(--ink-muted);
}

.field input[type="file"]::file-selector-button {
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.04em;
  padding: 8px 16px;
  margin-right: 12px;
  border: none;
  border-radius: 999px;
  background: var(--sage-deep);
  color: var(--paper);
  cursor: pointer;
  transition: background .2s;
}

.field input[type="file"]::file-selector-button:hover {
  background: var(--sage-deep-hover);
}

.gb-photo-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  max-width: 100%;
  background: var(--paper);
  border-radius: var(--radius-input);
  border: 1px solid var(--line);
  overflow: hidden;
}

.gb-photo-preview {
  display: block;
  width: auto;
  height: auto;
  max-width: 160px;
  max-height: 160px;
  object-fit: contain;
}

.btn-guestbook {
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.08em;
  min-height: 52px;
  border: none;
  border-radius: 999px;
  background: var(--rose-deep);
  color: var(--paper);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .25s, transform .2s;
}

.btn-guestbook:hover {
  background: var(--rose-deep-hover);
  transform: translateY(-2px);
}

.btn-guestbook:active {
  transform: translateY(0) scale(0.98);
}

.btn-guestbook:disabled {
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .btn-guestbook:hover,
  .btn-guestbook:active {
    transform: none;
  }
}

.btn-guestbook.is-sending {
  background: var(--rose);
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 252, 248, .4);
  border-top-color: var(--paper);
  display: inline-block;
  animation: gb-spin 900ms linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .btn-spinner {
    animation-duration: 1.4s;
  }
}

@keyframes gb-spin {
  to { transform: rotate(360deg); }
}

.guestbook-thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  background: var(--sage-tint);
  border-radius: var(--radius-card);
  padding: clamp(40px, 8vw, 64px) 28px;
}

.thanks-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sage-deep);
}

.guestbook-thanks h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(34px, 7vw, 44px);
  line-height: 1.1;
}

.guestbook-thanks p {
  margin: 0;
  font-size: var(--size-body);
  line-height: 1.65;
  font-weight: 300;
  color: var(--ink-soft);
  max-width: 360px;
  text-wrap: pretty;
}

.btn-link {
  font: inherit;
  font-size: 14px;
  letter-spacing: 0.06em;
  background: none;
  border: none;
  color: var(--sage-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  min-height: 44px;
  padding: 0 12px;
}

.guestbook-error-banner {
  font-size: 14px;
  color: var(--rose-deep);
  text-align: center;
}
