/* Bernard Haus — Guestbook
 * Vintage-leather book modal, aged-paper entries, handwriting comments.
 * Designed to match the existing palette (cream / bark / ember).
 */

/* ===== Modal backdrop ===== */
.gb-backdrop {
  position: fixed; inset: 0;
  background: rgba(20,12,5,0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.gb-backdrop.active { opacity: 1; pointer-events: auto; }

/* ===== The book ===== */
.gb-book {
  position: relative;
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  background:
    radial-gradient(ellipse at top, #fbf6ec 0%, #f1e8d6 60%, #e8dcc4 100%);
  border-radius: 4px 6px 6px 4px;
  box-shadow:
    0 30px 80px rgba(0,0,0,0.5),
    0 0 0 1px rgba(74,55,40,0.15),
    inset 12px 0 24px -10px rgba(74,55,40,0.18);
  overflow: hidden;
  display: flex; flex-direction: column;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.gb-backdrop.active .gb-book { transform: scale(1) translateY(0); }
/* Spine on the left edge */
.gb-book::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 22px;
  background: linear-gradient(to right,
    #4a3728 0%,
    #3a2a1c 35%,
    rgba(74,55,40,0.18) 95%,
    transparent 100%);
  pointer-events: none;
}

/* ===== Header ===== */
.gb-head {
  padding: 1.5rem 2rem 0.8rem 3rem;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(74,55,40,0.18);
}
.gb-eyebrow {
  font-family: 'Jost', sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #8c7b6b;
  margin-bottom: 0.4rem;
}
.gb-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 400;
  color: #4a3728;
  letter-spacing: 0.04em;
  margin: 0 0 0.2rem;
}
.gb-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #6b5243;
  margin-bottom: 1rem;
}
.gb-close {
  position: absolute;
  top: 0.75rem; right: 0.85rem;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid rgba(74,55,40,0.25);
  border-radius: 50%;
  font-size: 1.2rem;
  color: #4a3728;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: all 0.2s;
}
.gb-close:hover {
  background: rgba(201,107,58,0.12);
  border-color: var(--ember);
  color: var(--ember);
}

/* ===== Tab strip ===== */
.gb-tabs {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.7rem 0 0;
  border-bottom: 1px solid rgba(74,55,40,0.12);
  background: transparent;
}
.gb-tab {
  background: transparent;
  border: none;
  font-family: 'Jost', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8c7b6b;
  padding: 0.5rem 0.2rem 0.85rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.gb-tab:hover { color: #4a3728; }
.gb-tab.active {
  color: #4a3728;
  border-bottom-color: var(--ember);
}

/* ===== Scrollable body ===== */
.gb-body {
  flex: 1;
  overflow-y: auto;
  padding: 2rem 2.5rem 2.5rem 3.2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(74,55,40,0.3) transparent;
}
.gb-body::-webkit-scrollbar { width: 8px; }
.gb-body::-webkit-scrollbar-track { background: transparent; }
.gb-body::-webkit-scrollbar-thumb {
  background: rgba(74,55,40,0.25);
  border-radius: 4px;
}

.gb-pane { display: none; }
.gb-pane.active { display: block; }

/* ===== Entries ===== */
.gb-loading,
.gb-empty {
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  color: #8c7b6b;
  padding: 3rem 1rem;
  font-size: 1.05rem;
}

.gb-entry {
  position: relative;
  padding: 1.5rem 0 1.8rem;
  border-bottom: 1px dashed rgba(74,55,40,0.22);
  animation: gbFadeIn 0.6s ease both;
}
.gb-entry:last-child { border-bottom: none; }

@keyframes gbFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gb-entry-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.gb-entry-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 500;
  color: #4a3728;
  letter-spacing: 0.01em;
}
.gb-entry-date {
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8c7b6b;
}
.gb-entry-comment {
  font-family: 'Caveat', 'Segoe Script', cursive;
  font-size: 1.35rem;
  line-height: 1.55;
  color: #2c1f14;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ===== Form pane ===== */
.gb-form { display: flex; flex-direction: column; gap: 1.1rem; }
.gb-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.gb-field { display: flex; flex-direction: column; gap: 0.4rem; }
.gb-field.full { grid-column: 1 / -1; }
.gb-field label {
  font-family: 'Jost', sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8c7b6b;
}
.gb-field label .gb-optional {
  text-transform: none;
  letter-spacing: 0.05em;
  font-style: italic;
  color: #b3a692;
  margin-left: 0.4rem;
}
.gb-field input,
.gb-field select,
.gb-field textarea {
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(74,55,40,0.25);
  border-radius: 3px;
  padding: 0.65rem 0.85rem;
  font-family: 'Jost', sans-serif;
  font-size: 0.95rem;
  color: #2c1f14;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.gb-field textarea {
  font-family: 'Caveat', 'Segoe Script', cursive;
  font-size: 1.25rem;
  line-height: 1.5;
  min-height: 140px;
  resize: vertical;
}
.gb-field input:focus,
.gb-field select:focus,
.gb-field textarea:focus {
  border-color: var(--ember);
  background: rgba(255,255,255,0.85);
}
.gb-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  opacity: 0;
}
.gb-submit {
  align-self: flex-start;
  padding: 0.85rem 2.2rem;
  background: var(--ember);
  color: white;
  border: none;
  border-radius: 3px;
  font-family: 'Jost', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.gb-submit:hover { background: #b55a2e; transform: translateY(-1px); }
.gb-submit:disabled { background: #b3a692; cursor: not-allowed; transform: none; }

.gb-form-msg {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  padding: 0.8rem 1rem;
  border-radius: 3px;
  margin-top: 0.5rem;
}
.gb-form-msg.success {
  background: rgba(74,103,65,0.12);
  color: #3a5232;
  border: 1px solid rgba(74,103,65,0.3);
}
.gb-form-msg.error {
  background: rgba(181,74,46,0.12);
  color: #8a3a23;
  border: 1px solid rgba(181,74,46,0.3);
}

/* ===== Mobile ===== */
@media (max-width: 600px) {
  .gb-backdrop { padding: 0.5rem; }
  .gb-book { max-height: 96vh; border-radius: 3px; }
  .gb-head { padding: 1.2rem 2.5rem 0.6rem; }
  .gb-body { padding: 1.5rem 1.2rem 2rem 2rem; }
  .gb-form-row { grid-template-columns: 1fr; gap: 1rem; }
  .gb-entry-comment { font-size: 1.2rem; }
  .gb-entry-name { font-size: 1.2rem; }
  .gb-tabs { gap: 1rem; }
}
