/* ================================================================
   GÜHRER Osteopathie — shared design system
   Editorial / quiet-luxury direction
   ================================================================ */

:root {
  --bone:        #FAF7F1;
  --bone-warm:   #F4EFE6;
  --sand:        #E8DFD0;
  --sand-deep:   #D4C6B0;
  --sage:        #6D8385;
  --sage-deep:   #4A5C5E;
  --sage-soft:   #A6B4B5;
  --sage-900:    #2A3536;
  --ink:         #1F2626;
  --ink-soft:    #5A6263;
}

/* ---------- Base ---------- */
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}
[id] { scroll-margin-top: 6rem; }

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--bone-warm);
  font-weight: 400;
  line-height: 1.6;
}

/* Subtle paper-grain texture */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', system-ui, sans-serif;
  color: var(--ink);
  line-height: 1.08;
  letter-spacing: -0.015em;
}

/* Display type — light for editorial feel, with deliberate tracking */
.display {
  font-weight: 300;
  letter-spacing: -0.028em;
  line-height: 1.02;
}
.display em,
.display .italic-serif {
  font-style: italic;
  font-weight: 300;
}
/* Non-italic accent for headings — replaces decorative italic */
.display .accent {
  color: var(--sage);
  font-weight: 300;
}
.display .accent-deep {
  color: var(--sage-deep);
  font-weight: 400;
}

/* Small caps eyebrow label */
.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sage);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 1.75rem;
  height: 1px;
  background: var(--sage);
}
.eyebrow.no-rule::before { display: none; }

/* Numbered kicker, e.g. "— 02 / Philosophie" */
.kicker-num {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sage);
}
.kicker-num .num {
  color: var(--ink);
  font-weight: 700;
  margin-right: 0.4em;
}

/* Fine rules */
.rule-sage {
  width: 100%;
  height: 1px;
  background: var(--sage);
  opacity: 0.35;
}
.rule-short {
  width: 3rem;
  height: 1px;
  background: var(--sage);
}

/* Body paragraph default refinements */
.prose-body p {
  color: var(--ink-soft);
  font-size: 1.0625rem;
  line-height: 1.75;
  max-width: 62ch;
}
.prose-body p + p { margin-top: 1.1rem; }
.prose-body strong { color: var(--ink); font-weight: 600; }
.prose-body a {
  color: var(--sage-deep);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
.prose-body a:hover { color: var(--ink); }

/* Lead paragraph — sets off opening copy with a sage rule, no drop-cap ornament */
.prose-body .lede,
.prose-body p.lede {
  position: relative;
  padding-left: 1.5rem;
  font-size: 1.1875rem;
  line-height: 1.7;
  color: var(--ink);
  font-weight: 400;
}
.prose-body .lede::before {
  content: '';
  position: absolute;
  left: 0; top: 0.55em;
  width: 1px;
  height: calc(100% - 1.1em);
  background: var(--sage);
  opacity: 0.55;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.95rem 1.75rem;
  border-radius: 999px;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--sage);
  color: var(--bone);
}
.btn-primary:hover {
  background: var(--sage-deep);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -14px rgba(45,60,62,0.35);
}
.btn-ghost {
  background: transparent;
  color: var(--sage-deep);
  border-color: var(--sage);
}
.btn-ghost:hover {
  background: var(--sage);
  color: var(--bone);
}
.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--sage-deep);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--sage);
  transition: color 0.3s ease, border-color 0.3s ease;
}
.btn-link:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.btn-link .arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}
.btn-link:hover .arrow { transform: translateX(4px); }

/* ---------- Header / Nav ---------- */
#site-header {
  transition: background-color 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}
#site-header.scrolled {
  background-color: rgba(250,247,241,0.88);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow: 0 1px 0 rgba(109,131,133,0.12);
}

.nav-link {
  position: relative;
  color: var(--sage-deep);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.35rem 0;
  transition: color 0.25s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 1px;
  background-color: var(--sage);
  transition: width 0.3s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { width: 100%; }
.nav-link[aria-current="page"] { color: var(--ink); }
.nav-link[aria-current="page"]::after { width: 100%; }

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0.25rem;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  border-top: 1px solid rgba(109,131,133,0.18);
  transition: color 0.25s ease;
}
.mobile-nav-link:last-of-type { border-bottom: 1px solid rgba(109,131,133,0.18); }
.mobile-nav-link:hover { color: var(--sage); }
.mobile-nav-link[aria-current="page"] { color: var(--sage); }

.hamburger-line { transition: transform 0.3s ease, opacity 0.3s ease; }
.hamburger-active .hamburger-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger-active .hamburger-line:nth-child(2) { opacity: 0; }
.hamburger-active .hamburger-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s ease, opacity 0.35s ease;
  opacity: 0;
}
.mobile-menu.open { max-height: 90vh; opacity: 1; }

/* ---------- Scroll animations ---------- */
.reveal      { opacity: 0; transform: translateY(24px); transition: opacity 0.9s cubic-bezier(.16,1,.3,1), transform 0.9s cubic-bezier(.16,1,.3,1); }
.reveal-left { opacity: 0; transform: translateX(-30px); transition: opacity 0.9s cubic-bezier(.16,1,.3,1), transform 0.9s cubic-bezier(.16,1,.3,1); }
.reveal-right{ opacity: 0; transform: translateX(30px); transition: opacity 0.9s cubic-bezier(.16,1,.3,1), transform 0.9s cubic-bezier(.16,1,.3,1); }
.visible     { opacity: 1 !important; transform: translate(0,0) !important; }
.stagger-1 { transition-delay: .08s; }
.stagger-2 { transition-delay: .16s; }
.stagger-3 { transition-delay: .24s; }
.stagger-4 { transition-delay: .32s; }
.stagger-5 { transition-delay: .40s; }
.stagger-6 { transition-delay: .48s; }

/* ---------- Cards ---------- */
.editorial-card {
  background: var(--bone);
  border: 1px solid rgba(109,131,133,0.14);
  padding: 2.5rem;
  transition: border-color 0.3s ease, transform 0.4s ease, box-shadow 0.4s ease;
  position: relative;
  overflow: hidden;
}
.editorial-card:hover {
  border-color: var(--sage);
  transform: translateY(-4px);
  box-shadow: 0 22px 44px -24px rgba(74,92,94,0.25);
}
.editorial-card .card-num {
  position: absolute;
  top: 1.5rem; right: 1.75rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--sage);
  opacity: 0.7;
}
.editorial-card h3 {
  font-size: 1.625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  line-height: 1.15;
}
.editorial-card p {
  color: var(--ink-soft);
  font-size: 0.975rem;
  line-height: 1.7;
}
.editorial-card .rule-short {
  margin: 1.25rem 0;
}

/* Small decorative glyph anchor for Leistungen + Kosten cards */
.card-glyph {
  color: var(--sage);
  display: block;
  opacity: 0.9;
}
.editorial-card:hover .card-glyph { opacity: 1; }

/* ---------- Portrait frame ---------- */
.portrait-frame {
  position: relative;
  display: block;
}
.portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portrait-frame::before {
  content: '';
  position: absolute;
  inset: -1.5rem 1.5rem 1.5rem -1.5rem;
  background: var(--sand);
  z-index: -1;
  pointer-events: none;
}

/* ---------- Forms ---------- */
.form-input {
  display: block;
  width: 100%;
  padding: 0.9rem 1.15rem;
  background: var(--bone);
  border: 1px solid rgba(109,131,133,0.3);
  border-radius: 4px;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 1rem;
  color: var(--ink);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.form-input::placeholder { color: rgba(90,98,99,0.5); }
.form-input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(109,131,133,0.14);
}
.form-textarea { resize: vertical; min-height: 140px; }
.border-red-400 { border-color: #dc6a6a !important; }

.custom-checkbox {
  width: 1.1rem; height: 1.1rem;
  border: 1px solid var(--sage);
  border-radius: 2px;
  appearance: none;
  background: var(--bone);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s ease;
  position: relative;
}
.custom-checkbox:checked {
  background: var(--sage);
  border-color: var(--sage);
}
.custom-checkbox:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 4px; height: 8px;
  border: solid var(--bone);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.map-consent {
  background: var(--sand);
  color: var(--sage-deep);
}

/* ---------- Scroll-top button ---------- */
.scroll-top-btn {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}
.scroll-top-btn.show { opacity: 1; visibility: visible; }
.scroll-top-btn:hover { transform: translateY(-3px); }

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100%; left: 16px;
  z-index: 100;
  padding: 12px 24px;
  background: var(--ink);
  color: var(--bone);
  font-size: 0.875rem;
  text-decoration: none;
  transition: top 0.3s ease;
}
.skip-link:focus { top: 0; }

/* ---------- Footer specific ---------- */
.site-footer {
  background: var(--sage-900);
  color: rgba(250,247,241,0.8);
}
.site-footer a { transition: color 0.25s ease; }
.site-footer .footer-h {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--sage-soft);
  margin-bottom: 1.5rem;
}
.site-footer .footer-link {
  color: rgba(250,247,241,0.75);
  font-size: 0.9375rem;
}
.site-footer .footer-link:hover { color: var(--bone); }
.site-footer .fine {
  font-size: 0.78rem;
  color: rgba(250,247,241,0.55);
  letter-spacing: 0.04em;
}

/* ---------- Legal / long-form content ---------- */
.legal-content {
  max-width: 720px;
}
.legal-content h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 2.75rem;
  margin-bottom: 1rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.legal-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--ink);
}
.legal-content p {
  color: var(--ink-soft);
  font-size: 0.975rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.legal-content a {
  color: var(--sage-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}
.legal-content a:hover { color: var(--ink); }
.legal-content ul {
  list-style: none;
  margin: 1rem 0 1.25rem;
  padding-left: 0;
}
.legal-content ul li {
  color: var(--ink-soft);
  font-size: 0.975rem;
  line-height: 1.7;
  padding-left: 1.25rem;
  position: relative;
  margin-bottom: 0.35rem;
}
.legal-content ul li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--sage);
}
.legal-content strong { color: var(--ink); font-weight: 600; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-left, .reveal-right { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { transition: none !important; animation: none !important; }
  body { transition: none; }
}

/* ============================================================
   Flex-gap fallback — Safari < 14.1 / older WebKit-derivatives.
   .no-flexgap is set on <html> by theme.js when feature detection
   confirms `display:flex; gap:N` collapses to zero. Modern browsers
   never see these rules. Selectors mirror the Tailwind classes
   actually used in the markup; do NOT add generic `.flex.gap-N`
   rules without :not(.flex-wrap):not(.flex-col) — those break
   wrapping/column layouts.
   ============================================================ */

/* --- Single-row flex (default direction) --- */
.no-flexgap .flex:not(.flex-wrap):not(.flex-col).gap-2 > * + *,
.no-flexgap .inline-flex:not(.flex-wrap):not(.flex-col).gap-2 > * + * { margin-left: 0.5rem; }
.no-flexgap .flex:not(.flex-wrap):not(.flex-col).gap-3 > * + *,
.no-flexgap .inline-flex:not(.flex-wrap):not(.flex-col).gap-3 > * + * { margin-left: 0.75rem; }
.no-flexgap .flex:not(.flex-wrap):not(.flex-col).gap-4 > * + *,
.no-flexgap .inline-flex:not(.flex-wrap):not(.flex-col).gap-4 > * + * { margin-left: 1rem; }
.no-flexgap .flex:not(.flex-wrap):not(.flex-col).gap-6 > * + *,
.no-flexgap .inline-flex:not(.flex-wrap):not(.flex-col).gap-6 > * + * { margin-left: 1.5rem; }
.no-flexgap .flex:not(.flex-wrap):not(.flex-col).gap-10 > * + *,
.no-flexgap .inline-flex:not(.flex-wrap):not(.flex-col).gap-10 > * + * { margin-left: 2.5rem; }

/* --- Hamburger button (flex-col, arbitrary 5px gap) --- */
.no-flexgap .hamburger-btn > * + * { margin-top: 5px; }

/* --- flex-wrap with single gap (negative-margin trick keeps wrapping clean) --- */
.no-flexgap .flex.flex-wrap.gap-4 { margin: -0.5rem; }
.no-flexgap .flex.flex-wrap.gap-4 > * { margin: 0.5rem; }
.no-flexgap .flex.flex-wrap.gap-6 { margin: -0.75rem; }
.no-flexgap .flex.flex-wrap.gap-6 > * { margin: 0.75rem; }

/* --- flex-wrap with split x/y gaps (footer link rows) --- */
.no-flexgap .flex.flex-wrap.gap-x-6.gap-y-2 { margin: -0.25rem -0.75rem; }
.no-flexgap .flex.flex-wrap.gap-x-6.gap-y-2 > * { margin: 0.25rem 0.75rem; }

/* --- Responsive direction (column on mobile, row at md/sm breakpoint) --- */
.no-flexgap .flex.flex-col.md\:flex-row.gap-4 > * + *,
.no-flexgap .flex.flex-col.sm\:flex-row.gap-4 > * + * { margin-top: 1rem; }
.no-flexgap .flex.flex-col.md\:flex-row.gap-6 > * + * { margin-top: 1.5rem; }

@media (min-width: 768px) {
  .no-flexgap .flex.flex-col.md\:flex-row.gap-4 > * + * { margin-top: 0; margin-left: 1rem; }
  .no-flexgap .flex.flex-col.md\:flex-row.gap-6 > * + * { margin-top: 0; margin-left: 1.5rem; }
}
@media (min-width: 640px) {
  .no-flexgap .flex.flex-col.sm\:flex-row.gap-4 > * + * { margin-top: 0; margin-left: 1rem; }
}

/* --- Desktop nav: hidden below lg, becomes flex at lg+ --- */
@media (min-width: 1024px) {
  .no-flexgap .lg\:flex:not(.flex-wrap):not(.flex-col).gap-10 > * + * { margin-left: 2.5rem; }
}

/* ---------- Print ---------- */
@media print {
  body::before { display: none; }
  .no-print, nav, .scroll-top-btn, .mobile-menu, #site-header { display: none !important; }
  body { background: white !important; color: black !important; font-size: 11pt; }
  h1, h2, h3 { color: black !important; page-break-after: avoid; }
  a { color: black !important; }
  section { page-break-inside: avoid; padding: 1rem 0 !important; }
  main { padding-top: 0 !important; }
}
