/* Design system helpers (Spielraum zum Tailwind-Config) */
html {
  overflow-x: clip;
}
body {
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.scribble-underline {
  position: relative;
  display: inline-block;
}
.scribble-underline::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 8px;
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='20' viewBox='0 0 200 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 15 Q 50 5 100 15 Q 150 25 198 10' stroke='%23ffb347' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  z-index: -1;
}

.grain-overlay {
  position: relative;
}
.grain-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0.12;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.prose-blog p {
  margin-bottom: 1rem;
}
.prose-blog img {
  border-radius: 0.75rem;
  margin: 1rem 0;
  max-width: 100%;
  height: auto;
}

/* Lesefreundlicher Tagebuch-Text */
.diary-prose {
  font-family: Inter, system-ui, sans-serif;
  font-size: clamp(1.0625rem, 0.95rem + 0.4vw, 1.2rem);
  line-height: 1.8;
  color: #524535;
  max-width: 42rem;
}
.diary-prose p {
  margin-bottom: 1.25rem;
}
.diary-prose p:last-child {
  margin-bottom: 0;
}
.diary-prose a {
  color: #845400;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.diary-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
}

.admin-shell {
  min-height: 100vh;
  overflow-x: clip;
}

.admin-shell .admin-btn-secondary,
.admin-shell .admin-btn-ghost,
.admin-shell .admin-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 0.9rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
}
.admin-shell .admin-btn-secondary {
  background: #845400;
  color: #fff;
}
.admin-shell .admin-btn-ghost {
  background: #f4f3f1;
  color: #524535;
}
.admin-shell .admin-btn-danger {
  background: #fef2f2;
  color: #b91c1c;
}

/* Formularfelder immer mit sichtbarem Rahmen */
.admin-shell input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
.admin-shell textarea,
.admin-shell select {
  border: 1.5px solid #c9b8a4 !important;
  background-color: #ffffff !important;
  color: #1a1c1a;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  box-shadow: none;
  font-size: 16px !important;
  max-width: 100%;
}
.admin-shell input:focus,
.admin-shell textarea:focus,
.admin-shell select:focus {
  border-color: #845400 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.35) !important;
}
.admin-shell .tox-tinymce {
  border: 1.5px solid #c9b8a4 !important;
  border-radius: 0.75rem !important;
  max-width: 100%;
}
.admin-shell .tox-tinymce.tox-edit-focus {
  border-color: #845400 !important;
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.35) !important;
}

/* Frontend-Formulare (Gästebuch etc.) */
.form-field {
  border: 1.5px solid #c9b8a4 !important;
  background-color: #ffffff !important;
  border-radius: 0.75rem;
  font-size: 16px !important;
}
.form-field:focus {
  border-color: #845400 !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.35) !important;
}

.tox-tinymce {
  border-radius: 0.75rem !important;
}

#lightbox:not(.hidden) {
  display: flex;
}

.safe-top {
  padding-top: max(0.75rem, env(safe-area-inset-top));
}

.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
