/* =========================================================
   Morgenland Ferienwohnung — style.css (optimized)
   Responsive, accessible, performance-minded
   ========================================================= */

:root {
  --color-bg: #ffffff;
  --color-text: #222;
  --color-muted: #6b7280;
  --color-primary: #0b7fa6;
  --color-accent: #f59e0b;
  --color-border: #e6e6e6;
  --max-width: 1200px;
  --container-padding: 16px;
  --radius: 6px;
  --focus-outline: 3px solid rgba(11,127,166,0.18);
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  font-size: 16px;
}

/* ---------- Layout containers ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}
.container.narrow { max-width: 900px; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 8px 12px;
  background: #000;
  color: #fff;
  border-radius: 6px;
  z-index: 9999;
  text-decoration: none;
}

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.logo a {
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  font-size: 1.05rem;
}

/* ---------- Navigation ---------- */
.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 12px;
  align-items: center;
}
.main-nav a {
  color: var(--color-text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 0.95rem;
}
.main-nav a:hover,
.main-nav a:focus {
  background: rgba(11,127,166,0.06);
  outline: none;
}
.main-nav a[aria-current="page"] {
  color: var(--color-primary);
  font-weight: 600;
}

/* ---------- Menu toggle ---------- */
.menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 8px;
  cursor: pointer;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
}
.menu-toggle:focus {
  outline: var(--focus-outline);
  box-shadow: 0 0 0 4px rgba(11,127,166,0.06);
}

/* Hamburger icon */
.menu-toggle .hamburger {
  display: inline-block;
  width: 28px;
  height: 20px;
  position: relative;
}
.menu-toggle .hamburger span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-text);
  transition: transform .25s ease, opacity .2s ease;
  border-radius: 2px;
}
.menu-toggle .hamburger span:nth-child(1) { top: 0; }
.menu-toggle .hamburger span:nth-child(2) { top: 9px; }
.menu-toggle .hamburger span:nth-child(3) { top: 18px; }

/* Toggle visual when open */
.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] .hamburger span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ---------- Mobile nav panel ---------- */
.main-nav { display: block; }
.main-nav .panel {
  background: #fff;
  width: 85%;
  max-width: 360px;
  height: 100vh;
  overflow: auto;
  box-shadow: -8px 0 24px rgba(0,0,0,0.2);
  transform: translateX(100%);
  transition: transform .28s ease;
  /* Ensure panel sits above overlay and content on mobile */
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 10001;
}
.main-nav .overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
  z-index: 10000;
}
.main-nav.open .overlay {
  opacity: 1;
  pointer-events: auto;
}
.main-nav.open .panel {
  transform: translateX(0);
}

/* ---------- Language switcher ---------- */
.language-switcher a {
  margin-left: 8px;
  text-decoration: none;
  color: var(--color-muted);
  font-weight: 600;
  font-size: 0.85rem;
}
.language-switcher a.active { color: var(--color-primary); }

/* ---------- Hero ---------- */
.section-hero {
  padding: 28px 0;
  background: linear-gradient(180deg, rgba(11,127,166,0.03), transparent 60%);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  align-items: center;
}
.hero-media {
  display: block;
  aspect-ratio: 3 / 2;
}
.hero-media img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

/* ---------- Typography / CTAs ---------- */
.hero-content h1 {
  margin: 0 0 8px 0;
  font-size: 1.6rem;
  line-height: 1.15;
}
.lead {
  margin: 0 0 16px 0;
  color: var(--color-muted);
}

.btn {
  display: inline-block;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-secondary {
  background: #fff;
  color: var(--color-text);
  border-color: var(--color-border);
}

/* ---------- Sections ---------- */
.section {
  padding: 28px 0;
  border-bottom: 1px solid var(--color-border);
}
.section .container h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

/* ---------- Forms ---------- */
form { max-width: 720px; }
.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
label {
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--color-muted);
}
input, textarea, select {
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  background: #fff;
  color: var(--color-text);
}
textarea { resize: vertical; min-height: 96px; }
input:focus, textarea:focus, select:focus {
  outline: var(--focus-outline);
  border-color: var(--color-primary);
}

/* =========================================================
   GALLERY — Airbnb Luxe Style (updated)
   ========================================================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-auto-rows: 120px; /* kompakter, stabilere Reihenhöhe */
  gap: 16px;
  margin: 0;
  padding: 0;
  /* Optional Masonry-like behavior: uncomment to enable */
  /* grid-auto-flow: dense; */
}

.gallery-grid figure { margin: 0; }

.gallery-item picture,
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center; /* zentriert den Bildausschnitt */
  display: block;
  border-radius: var(--radius);
}

/* Konsistente Klasse: vertical (statt portrait) */
.gallery-item.vertical {
  grid-row: span 2;
}

/* Fokus für Galerie-Links (bessere Tastatur-Navigation) */
.gallery-item a:focus {
  outline: var(--focus-outline);
  box-shadow: 0 0 0 4px rgba(11,127,166,0.06);
  border-radius: calc(var(--radius) - 2px);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 20px 0;
  background: #fff;
  border-top: 1px solid var(--color-border);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.footer-nav ul {
  display: flex;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer-nav a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.95rem;
}

/* ---------- Utilities ---------- */
.text-muted { color: var(--color-muted); }
.center { text-align: center; }
.small { font-size: 0.9rem; color: var(--color-muted); }
.hidden { display: none; }

/* ---------- Accessibility ---------- */
.sr-only {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
:focus { outline: none; }
:focus-visible { outline: var(--focus-outline); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .main-nav ul { gap: 8px; }
}

@media (max-width: 700px) {
  .header-inner { padding: 10px; }
  .menu-toggle { display: inline-flex; }
  .gallery-grid { grid-template-columns: 1fr; }
  .container { padding: 0 12px; }
  .logo a { font-size: 1rem; }
  .main-nav ul { display: block; }
  .main-nav .panel ul { padding: 1rem; }
  .main-nav .panel li { border-bottom: 1px solid var(--color-border); }
  .main-nav .panel a { display: block; padding: 12px 0; }
}

/* Desktop: ensure panel behaves like normal nav */
@media (min-width: 701px) {
  .main-nav { display: block !important; }

  .main-nav .panel {
    position: static;
    right: auto;
    top: auto;
    bottom: auto;
    height: auto;
    width: auto;
    max-width: none;
    transform: none !important;
    box-shadow: none;
    background: transparent;
    overflow: visible;
    z-index: auto;
  }

  .main-nav .overlay {
    display: none;
    pointer-events: none;
    opacity: 0;
  }

  .main-nav .panel ul,
  .main-nav ul {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    padding: 0;
    margin: 0;
  }

  .main-nav .panel a,
  .main-nav a {
    display: inline-block;
    padding: 8px 10px;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- Print ---------- */
@media print {
  .site-header,
  .site-footer,
  .language-switcher,
  .hero-ctas,
  .map-placeholder {
    display: none;
  }
  body {
    color: #000;
    background: #fff;
  }
  a::after {
    content: " (" attr(href) ")";
    font-size: 0.85rem;
    color: #000;
  }
}