/* ============================================================
   Hendriks Gästebuch – Custom CSS
   Tailwind via CDN ist die Basis; hier nur Ergänzungen.
   ============================================================ */

/* ── Globale Basis ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: #f0ede8;
  color: #1c1917;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; }

/* ── Page Container ── */
.page {
  max-width: 390px;
  margin: 0 auto;
  min-height: 100vh;
  background: #faf8f5;
}

/* ── Hero ── */
.hero {
  padding: 38px 22px 32px;
  text-align: center;
  background: linear-gradient(180deg, #fdfcf9 0%, #faf8f5 100%);
  border-bottom: 1px solid #ede9e4;
}

.hero-overline {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c9a96e;
  margin: 0 0 10px;
}

.hero h1 {
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 6px;
  color: #1c1917;
  line-height: 1.15;
}

.hero-address {
  font-size: 12.5px;
  color: #78716c;
  margin: 0 0 22px;
}

/* ── Demurin-Style Karte ── */
.map-card {
  width: 220px;
  margin: 0 auto 24px;
  background: #fff;
  border-radius: 6px;
  padding: 12px 12px 34px;
  box-shadow:
    0 1px 0 #e7e3de,
    0 18px 30px -10px rgba(60,40,20,0.18),
    0 32px 52px -20px rgba(60,40,20,0.12);
}

.map-inner {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 2px;
  background: #fff;
}

.map-inner svg { display: block; width: 100%; height: 100%; }

.map-label { text-align: left; margin-top: 12px; padding-left: 2px; }
.map-label-title {
  font-family: 'Playfair Display', serif;
  font-size: 13px; font-weight: 600; color: #1c1917;
}
.map-label-coords { font-size: 10px; color: #78716c; margin-top: 1px; letter-spacing: 0.04em; }

/* ── Begrüßungstext ── */
.greeting {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 15px;
  line-height: 1.75;
  color: #57534e;
  padding: 0 4px 6px;
  max-width: 320px;
  margin: 0 auto 20px;
}

.greeting-author {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  color: #a39589;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 10px;
  display: block;
}

/* ── Social Buttons ── */
.social-row {
  display: flex;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 0 10px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid #e7e3de;
  border-radius: 50px;
  padding: 7px 13px;
  font-size: 11.5px;
  font-weight: 500;
  color: #57534e;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.social-btn:hover { border-color: #c9a96e; color: #1c1917; }
.social-btn svg { opacity: 0.65; flex-shrink: 0; }

/* ── Section Header ── */
.section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a39589;
  margin: 0 0 6px;
  text-align: center;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 5px;
  color: #1c1917;
  text-align: center;
}

.section-subtitle {
  font-size: 13px;
  color: #78716c;
  margin: 0 0 18px;
  text-align: center;
  line-height: 1.55;
}

/* ── Artwork Grid ── */
.artwork-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 8px;
}

.artwork-mini {
  background: #fff;
  border-radius: 6px;
  padding: 8px 8px 12px;
  box-shadow: 0 1px 0 #ede9e4, 0 4px 10px -3px rgba(60,40,20,0.09);
  position: relative;
  transition: transform 0.15s;
}

.artwork-mini:active { transform: scale(0.97); }

.artwork-mini.is-current {
  box-shadow: 0 0 0 2px #c9a96e, 0 6px 16px -4px rgba(201,169,110,0.25);
}

.artwork-mini.is-current::before {
  content: 'Dein Einstieg';
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: #c9a96e;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 50px;
  white-space: nowrap;
}

.artwork-mini-inner {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 2px;
  background: #fff;
}

.artwork-mini-inner svg { display: block; width: 100%; height: 100%; }

.artwork-mini-label {
  font-size: 11px;
  font-weight: 600;
  color: #1c1917;
  margin-top: 7px;
  letter-spacing: 0.01em;
}

.artwork-mini-coords { font-size: 9.5px; color: #a39589; margin-top: 1px; }

/* ── Entry Cards ── */
.card {
  background: #fff;
  border: 1px solid #ede9e4;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 11px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
  font-family: 'Inter', sans-serif;
}

.entry-photo {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 10px;
  border: 1px solid #ede9e4;
}

.entry-source {
  font-size: 10.5px;
  color: #a39589;
  margin-top: 8px;
  letter-spacing: 0.02em;
}

.entry-source strong { color: #78716c; }

/* ── Form ── */
.field {
  width: 100%;
  background: #fff;
  border: 1.5px solid #e7e3de;
  border-radius: 10px;
  color: #1c1917;
  padding: 13px 15px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  display: block;
  appearance: none;
}

.field:focus {
  border-color: #c9a96e;
  box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}

.field::placeholder { color: #c4b9ad; }
textarea.field { resize: none; line-height: 1.6; }

.field-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #a39589;
  display: block;
  margin-bottom: 7px;
}

.field-label .optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #c4b9ad;
  font-size: 10px;
}

/* ── Emoji Picker ── */
.emoji-row { display: flex; gap: 6px; flex-wrap: wrap; }

.emoji-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid #e7e3de;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  user-select: none;
}

.emoji-btn:hover { border-color: #c9a96e; }

.emoji-btn.active {
  border-color: #c9a96e;
  background: #fdf6ec;
  box-shadow: 0 0 0 3px rgba(201,169,110,0.12);
}

/* ── Upload Zone ── */
.upload-zone {
  border: 1.5px dashed #d5ccc3;
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.upload-zone:hover { border-color: #c9a96e; background: #fdf9f3; }
.upload-zone input[type="file"] { display: none; }

.upload-zone.has-file { border-color: #c9a96e; background: #fdf9f3; }
.upload-zone.has-file .upload-placeholder { display: none; }
.upload-zone .upload-filename { display: none; font-size: 12.5px; color: #78716c; font-weight: 500; }
.upload-zone.has-file .upload-filename { display: block; }

/* ── Submit Button ── */
.btn-primary {
  width: 100%;
  background: #1c1917;
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  border: none;
  border-radius: 50px;
  padding: 16px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
  transition: opacity 0.15s, transform 0.1s;
  position: relative;
}

.btn-primary:hover:not(:disabled) { opacity: 0.87; }
.btn-primary:active:not(:disabled) { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}

.btn-primary.loading .btn-label { display: none; }
.btn-primary.loading .spinner { display: inline-block; }

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

/* ── Alert Messages ── */
.alert {
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 16px;
  display: none;
}

.alert.visible { display: block; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* ── Divider ── */
.divider {
  height: 1px;
  background: #ede9e4;
  margin: 30px 0;
}

/* ── Honeypot ── */
.honeypot {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  tab-index: -1;
}

/* ── Footer ── */
.page-footer {
  text-align: center;
  font-size: 11px;
  color: #c4b9ad;
  margin: 20px 0 0;
  line-height: 1.7;
}

.page-footer a {
  color: #a39589;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: #a39589;
  font-size: 13.5px;
  line-height: 1.65;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 0; }

/* ── Entry Modal ── */
.entry-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.entry-modal.open { display: flex; }

.entry-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.entry-modal-box {
  position: relative;
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 32px 24px 28px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
  z-index: 1;
  overscroll-behavior: contain;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f0ede8;
  color: #57534e;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}

.modal-close:hover { background: #e7e3de; }

.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #1c1917;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: background 0.15s;
}

.modal-prev { left: -52px; }
.modal-next { right: -52px; }

@media (max-width: 520px) {
  .modal-prev { left: -16px; }
  .modal-next { right: -16px; }
}

.modal-nav:hover { background: #fff; }

/* ── Foto-Lightbox ─────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
