/* ============================================
   TRATTORIA BELLAVITA — Design System
   ============================================ */

:root {
  /* Farben — warme, erdige Trattoria-Palette */
  --bg:           #f5efe6;   /* warmes Creme */
  --bg-soft:      #ede4d3;   /* gedämpftes Sandbeige */
  --ink:          #1f1d1a;   /* fast schwarz, mit Wärme */
  --ink-soft:     #5a5751;
  --olive:        #3d4a2a;   /* tiefes Olivgrün */
  --olive-light:  #6b7a4c;
  --terracotta:   #b8553a;   /* warmes Rotbraun (Akzent) */
  --gold:         #b89968;   /* gedämpftes Gold */
  --line:         #d9cfbe;   /* Trennlinien */

  /* Typografie */
  --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --sans:  'Inter Tight', 'Helvetica Neue', sans-serif;
  --mono:  'JetBrains Mono', monospace;

  /* Layout */
  --max:   1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* ----- Headings ----- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* ----- Reusable bits ----- */
.eyebrow {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-weight: 500;
}

.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--gold);
  font-size: 0.9rem;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--gold);
  opacity: 0.5;
}

.btn {
  display: inline-block;
  padding: 1rem 2.25rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn--filled { background: var(--ink); color: var(--bg); }
.btn--filled:hover { background: var(--terracotta); border-color: var(--terracotta); }
.btn--light { border-color: var(--bg); color: var(--bg); }
.btn--light:hover { background: var(--bg); color: var(--ink); }

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 239, 230, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-family: var(--serif);
  font-size: 1.55rem;
  font-style: italic;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1;
}
.brand small {
  display: block;
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-style: normal;
  margin-top: 0.2rem;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
  align-items: center;
}
.nav-links a {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  padding: 0.25rem 0;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--terracotta);
  transition: width 0.3s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--terracotta); }

.nav-cta { padding: 0.7rem 1.5rem; font-size: 0.7rem; }

.nav-toggle {
  display: none;
  width: 28px;
  height: 28px;
  position: relative;
}
.nav-toggle span {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--ink);
  transition: all 0.3s ease;
}
.nav-toggle span:nth-child(1) { top: 8px; }
.nav-toggle span:nth-child(2) { top: 14px; }
.nav-toggle span:nth-child(3) { top: 20px; }
.nav-toggle.open span:nth-child(1) { top: 14px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 14px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav-links {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh; /* dynamic viewport height — iOS Safari */
    background: var(--bg);
    z-index: 100; /* über allem, auch über sticky header */
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: 80px var(--gutter) 2rem; /* top padding für Header-Höhe */
    transform: translateX(100%);
    transition: transform 0.4s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links li {
    width: 100%;
    border-bottom: 1px solid var(--line);
  }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a {
    display: block;
    padding: 1.25rem 0;
    font-size: 0.95rem;
    width: 100%;
  }
  /* Nav-toggle muss ÜBER dem geöffneten Menü sein, sonst kein Schließen möglich */
  .nav-toggle { display: block; position: relative; z-index: 101; }
  .nav-cta { display: none; }
  /* Body-Scroll blockieren wenn Menü offen */
  body.nav-open { overflow: hidden; }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: 4rem var(--gutter) 2rem;
  margin-top: 6rem;
}
.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(245, 239, 230, 0.15);
}
.footer-grid h4 {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.footer-brand .brand { color: var(--bg); margin-bottom: 1rem; }
.footer-brand p { font-size: 0.95rem; opacity: 0.75; max-width: 30ch; line-height: 1.7; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 0.6rem; font-size: 0.95rem; opacity: 0.85; }
.footer-grid a:hover { color: var(--gold); }
.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  opacity: 0.6;
  flex-wrap: wrap;
  gap: 1rem;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 0.5rem; font-size: 0.75rem; }
  .site-footer { padding: 3rem var(--gutter) 1.5rem; margin-top: 4rem; }
}

/* ============================================
   GLOBAL MOBILE TWEAKS
   ============================================ */

/* iOS Safari: prevent text resize on orientation change */
html { -webkit-text-size-adjust: 100%; }

/* Prevent horizontal scroll bugs */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Touch-friendly tap targets */
@media (max-width: 760px) {
  /* Header/Nav */
  .nav { padding: 0.85rem var(--gutter); }
  .brand { font-size: 1.3rem; }
  .brand small { font-size: 0.55rem; }
  .nav-toggle { padding: 8px; margin: -8px; } /* bigger touch area */

  /* Header: backdrop-filter weg auf Mobile — verursacht Stacking-Context-Bugs
     mit dem fixed Mobile-Menu und ist eh ein Performance-Killer */
  .site-header {
    background: var(--bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  /* Buttons — ensure min 44px touch target */
  .btn { padding: 0.95rem 1.75rem; font-size: 0.72rem; }

  /* Reduce excess padding */
  :root { --gutter: 1.25rem; }
}

/* Very small screens (older phones, narrow displays) */
@media (max-width: 380px) {
  :root { --gutter: 1rem; }
  .brand { font-size: 1.15rem; }
  .brand small { display: none; } /* save space */
}
