/* MBZ — Ethereal Grounding — shared styles */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  background-color: #fbf9f4;
  color: #1b1c19;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: "Manrope", system-ui, sans-serif;
  max-width: 100%;
  overflow-x: clip;
}

/* Never let long German compounds push the layout sideways ------------- */
h1, h2, h3, h4, p, li, a, blockquote, label {
  overflow-wrap: break-word;
  hyphens: auto;
}
h1, h2, h3 { -webkit-hyphens: auto; }

/* Viewport-height shells that survive the iOS browser chrome ---------- */
.hero-shell { min-height: 92vh; }
@supports (min-height: 100dvh) {
  .hero-shell { min-height: 92dvh; }
}

/* Grain / paper-texture overlay (subtle) ------------------------------- */
.texture-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  z-index: 1;
}

.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 1;
  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.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  transition: opacity 0.4s ease;
}
body[data-grain="off"] .grain-overlay { opacity: 0; }

/* Editorial card -------------------------------------------------------- */
.editorial-card {
  border: 1px solid #e4e2dd;
  padding: 24px;
  background-color: #fbf9f4;
}
@media (min-width: 768px) {
  .editorial-card { padding: 40px; }
}

.ghost-border {
  border: 0.5px solid #e9c176;
}

/* Scroll fade-in animation --------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.1s cubic-bezier(.2,.7,.2,1), transform 1.1s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Material Symbols — explicit family so the ligature never leaks as text.
   The stylesheet URL uses display=block, so glyphs are hidden until loaded. */
.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  font-feature-settings: 'liga';
  -moz-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* Mobile menu (slide-down sheet) -------------------------------------- */
#mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
  background-color: #fbf9f4;
  z-index: 60;
  transform: translateY(-100%);
  visibility: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: transform 0.5s cubic-bezier(.2,.7,.2,1), visibility 0s linear 0.5s;
  display: flex;
  flex-direction: column;
  padding: 96px 32px 32px;
}
#mobile-menu.is-open { transform: translateY(0); visibility: visible; transition: transform 0.5s cubic-bezier(.2,.7,.2,1), visibility 0s; }
@supports (height: 100dvh) {
  #mobile-menu { height: 100dvh; }
}

/* Mobile refinements --------------------------------------------------- */
@media (max-width: 767px) {
  /* Full-viewport SVG noise is a real repaint cost on iOS — drop it */
  .grain-overlay, .texture-overlay { display: none; }
  /* 120px section rhythm is too much at 375px */
  .py-section-padding { padding-top: 64px; padding-bottom: 64px; }
  /* Tap targets */
  .cal-day { font-size: 16px; }
  .time-slot { padding: 14px 8px; }
  #cookie-banner { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}

/* Hero overlay tuning -------------------------------------------------- */
.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 50%, transparent 30%, rgba(251,249,244,0.55) 100%),
    linear-gradient(to bottom, rgba(251,249,244,0.10), rgba(251,249,244,0.45));
  pointer-events: none;
}

/* Cookie banner -------------------------------------------------------- */
#cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  max-width: 560px;
  margin: 0 auto;
  background-color: #ffffff;
  border: 1px solid #e4e2dd;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 8px 30px rgba(20,20,15,0.06);
  transform: translateY(140%);
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1);
}
#cookie-banner.is-open { transform: translateY(0); }

/* Map placeholder ------------------------------------------------------ */
.map-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, rgba(86,95,72,0.06), rgba(119,90,25,0.04)),
    repeating-linear-gradient(45deg, #f0eee9 0 12px, #eae8e3 12px 13px),
    repeating-linear-gradient(-45deg, transparent 0 26px, rgba(118,120,111,0.08) 26px 27px);
  overflow: hidden;
}
.map-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 60% 40%, rgba(86,95,72,0.10), transparent 60%),
    radial-gradient(circle at 30% 70%, rgba(119,90,25,0.06), transparent 50%);
}
.map-placeholder .map-pin {
  position: absolute;
  top: 48%;
  left: 52%;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.map-placeholder .map-pin .pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: #565f48;
  box-shadow: 0 0 0 6px rgba(86,95,72,0.15), 0 0 0 14px rgba(86,95,72,0.06);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(86,95,72,0.15), 0 0 0 14px rgba(86,95,72,0.06); }
  50%      { box-shadow: 0 0 0 10px rgba(86,95,72,0.20), 0 0 0 22px rgba(86,95,72,0.04); }
}
.map-placeholder .map-pin .pin-label {
  background: #ffffff;
  border: 1px solid #e4e2dd;
  padding: 6px 12px;
  border-radius: 9999px;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: #565f48;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Image placeholder ---------------------------------------------------- */
.img-placeholder {
  background:
    repeating-linear-gradient(45deg, #eae8e3 0 16px, #f0eee9 16px 32px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #76786f;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  padding: 24px;
  min-height: 160px;
}

/* Tweaks panel --------------------------------------------------------- */
#tweaks-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: #ffffff;
  border: 1px solid #e4e2dd;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(20,20,15,0.10);
  padding: 20px;
  font-family: Manrope, system-ui, sans-serif;
  display: none;
}
#tweaks-panel.is-open { display: block; }
#tweaks-panel h4 {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 20px;
  color: #565f48;
  margin: 0;
}
#tweaks-panel .row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
#tweaks-panel label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: #454840;
}
#tweaks-panel .swatches {
  display: flex;
  gap: 8px;
}
#tweaks-panel .swatch {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: 1px solid #e4e2dd;
  cursor: pointer;
  position: relative;
}
#tweaks-panel .swatch.is-active {
  outline: 2px solid #1b1c19;
  outline-offset: 2px;
}
#tweaks-panel .toggle-group {
  display: flex;
  gap: 8px;
}
#tweaks-panel .toggle-group button {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e4e2dd;
  border-radius: 8px;
  background: #fbf9f4;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #454840;
  cursor: pointer;
}
#tweaks-panel .toggle-group button.is-active {
  background: #565f48;
  color: #ffffff;
  border-color: #565f48;
}
#tweaks-panel input[type="range"] {
  width: 100%;
}
#tweaks-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 79;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  background: #565f48;
  color: #ffffff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(20,20,15,0.15);
  transition: transform 0.3s ease;
}
#tweaks-toggle:hover { transform: scale(1.05); }
#tweaks-panel.is-open ~ #tweaks-toggle { display: none; }

/* Accent variants via CSS variable bridging -------------------------- */
:root {
  --accent-secondary: #775a19;
  --accent-secondary-soft: #e9c176;
}
.text-accent-secondary { color: var(--accent-secondary) !important; }
.bg-accent-secondary { background-color: var(--accent-secondary) !important; }
.border-accent-secondary { border-color: var(--accent-secondary) !important; }
.bg-accent-secondary-soft { background-color: var(--accent-secondary-soft) !important; }

/* Calendar button states (booking) -------------------------------------*/
.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: #454840;
  transition: background 0.2s ease, color 0.2s ease;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 15px;
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.cal-day:hover { background: #f0eee9; }
.cal-day.is-selected { background: #565f48; color: #ffffff; }
.cal-day.is-disabled { color: rgba(69,72,64,0.25); cursor: not-allowed; }
.cal-day.is-disabled:hover { background: transparent; }
.cal-day.is-empty { pointer-events: none; }
.cal-day.is-today::after {
  content: "";
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: #775a19;
}

.time-slot {
  padding: 16px 8px;
  border: 1px solid rgba(198,199,189,0.5);
  border-radius: 8px;
  text-align: center;
  color: #454840;
  font-family: Manrope, system-ui, sans-serif;
  font-size: 16px;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s ease;
}
.time-slot:hover { border-color: #565f48; color: #565f48; }
.time-slot.is-selected {
  border: 2px solid #565f48;
  background: rgba(86,95,72,0.05);
  color: #565f48;
  font-weight: 600;
}
.time-slot.is-disabled {
  color: rgba(69,72,64,0.4);
  text-decoration: line-through;
  cursor: not-allowed;
}
.time-slot.is-disabled:hover { border-color: rgba(198,199,189,0.5); color: rgba(69,72,64,0.4); }

/* Footer link & smooth transitions ------------------------------------ */
a { transition: color 0.3s ease, opacity 0.3s ease; }
