/* ==========================================================================
   Root Variables
   ========================================================================== */
:root {
  /* Color palette */
  --bg: #F8F5F0;          /* Warm beige background */
  --text: #222;           /* Main text color */
  --muted: #6B7280;       /* Secondary / muted text */
  --primary: #3A8571;     /* Elegant green */
  --light-green: #D1EDEA; /* Soft green accent */
  --primary-dark: #144238;/* Darker green for hover states */
  --white: #FFFFFF;       /* Pure white */
  --light-grey: #F9FAFB;  /* Off-white for contrast */
  --ink: #111827;         /* Deep ink for headlines */
  --line: #E5E7EB;        /* Divider / border color */

  /* Visuals & typography */
  --shadow: 0 10px 25px rgba(17, 24, 39, .08);
  --radius: 5px;
  --radius-lg: 12px;
  --font: 'Inter', system-ui, sans-serif;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 .5rem;
}
h1 { font-size: clamp(2rem, 2.8vw + 1rem, 3.25rem); }
h2 { font-size: clamp(1.6rem, 1.6vw + 1rem, 2.2rem); }
h3 { font-size: clamp(1.1rem, 1vw + .9rem, 1.4rem); }
p  { margin: .5rem 0 1rem; }

a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

img { max-width: 100%; display: block; }

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
}

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
header {
  position: sticky;
  top: 0;
  z-index: 9999;
  background: rgba(248,245,240,.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
@supports not ((-webkit-backdrop-filter: blur(8px)) or (backdrop-filter: blur(8px))) {
  header { background: rgba(248,245,240,.97); } /* Fallback if blur unsupported */
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.brand-name {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.1;
  margin: 0;
}
.brand-name .amp { color: var(--primary); }

.logo {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: transparent; /* default: transparent to host an <img> */
  padding: 4px;
  color: var(--white);
  font-weight: 700;
}
.logo.solid { background: var(--primary); } /* opt-in filled variant */

.menu {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

/* ==========================================================================
   Mobile Navigation
   ========================================================================== */
#burger {
  display: none;
  background: var(--primary);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: .65rem 1rem;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
#burger:hover { background: var(--primary-dark); transform: scale(1.02); }

@media (max-width: 1200px) {
  #burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
  }

  /* Hide default menu, show when .open */
  .menu { display: none; }

  .menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: calc(100% + .5rem);
    left: 0; right: 0;
    margin-inline: auto;
    width: 92%;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1rem;
    animation: slideDown .25s ease forwards;
    z-index: 100;
  }

  .menu.open a {
    display: block;
    padding: .9rem 1rem;
    border-radius: var(--radius);
    color: var(--ink);
    font-weight: 500;
    transition: background .2s ease, color .2s ease;
  }
  .menu.open a:hover,
  .menu.open a:focus-visible,
  .menu.open a:active {
    background: var(--primary);
    color: #fff;
  }

  .menu.open .btn.primary { display: none !important; }

  /* Dropdown inside mobile menu toggled via JS (.dropdown.open) */
  .menu.open .dropdown-content {
    display: none;
    position: static;
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    margin-left: 1rem;
  }
  .menu.open .dropdown.open .dropdown-content { display: block; }

  .menu.open .dropdown-content a {
    padding: .6rem 1rem;
    font-size: .95rem;
    color: var(--muted);
  }

  .menu.open .lang-switch {
    margin-top: 1rem;
    justify-content: center;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero { position: relative; isolation: isolate; padding-top: 0; }

.hero-media {
  position: relative;
  height: 64vh;
  min-height: 420px;
  max-height: 780px;
  overflow: hidden;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.05) saturate(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17,24,39,.35), rgba(17,24,39,.6) 70%, rgba(17,24,39,.85));
}

.hero-content {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: end;
  padding: clamp(1rem, 3vw, 2rem);
}

.hero-card {
  width: min(980px, 96%);
  margin: 0 auto;
  background: rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 2.5vw, 2rem);
  border: 1px solid var(--line);
}

.eyebrow {
  color: var(--primary);
  letter-spacing: .08em;
  font-weight: 600;
  text-transform: uppercase;
  font-size: .8rem;
}

.lead {
  color: var(--primary-dark);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: .75rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background .2s ease, color .2s ease, transform .2s ease;
}
.btn:hover { background: var(--light-grey); }
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn.primary:hover { background: var(--primary-dark); color: #fff; }

/* ==========================================================================
   Layout Grids
   ========================================================================== */
section {
  padding: clamp(2rem, 6vw, 4rem) 0;
  scroll-margin-top: 90px;
}
.grid { display: grid; gap: 1.2rem; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 900px) {
  .cols-3, .cols-2 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Facilities / Advantages Strip
   ========================================================================== */
.strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.strip .item {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  background: var(--white);
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  will-change: transform;
}
.strip .icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1;
}
.strip .icon svg {
  width: 24px;
  height: 24px;
  fill: var(--white);
}

@media (max-width: 900px) {
  .strip { grid-template-columns: 1fr 1fr; gap: .9rem; }
}
@media (max-width: 600px) {
  .strip { grid-template-columns: 1fr; }
  .strip .item { flex-direction: row; align-items: center; text-align: left; padding: 1rem; }
  .strip .icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .strip strong { font-size: 1rem; }
  .strip span.muted { font-size: .9rem; }
}

/* ==========================================================================
   Responsive Chip (Price Badge)
   ========================================================================== */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--light-green);
  color: var(--primary-dark);
  border: 1px solid var(--light-grey);
  padding: 0.25rem 0.6rem;
  margin-block: 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  width: fit-content;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
@media (max-width: 600px) {
  .chip {
    font-size: 0.9rem;
    padding: 0.35rem 0.8rem;
    align-self: flex-start;
    margin-bottom: 1rem;
  }
}

/* ==========================================================================
   Apartment Detail + Airbnb-style Grid + Description
   ========================================================================== */
.apartment-detail { margin-top: 1rem; }

.apartment-gallery.compact {
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
}

/* Optional lead text block */
.lead-text {
  margin: 1.5rem 0;
  font-size: 1.1rem;
  line-height: 1.6;
}

.features {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: .5rem;
  margin-bottom: 2rem;
}
.features li {
  position: relative;
  padding-left: 28px; /* space for the check icon */
  line-height: 1.5;
}
.features li::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  background-color: var(--primary);
  -webkit-mask: url('/images/check.svg') no-repeat center;
  mask: url('/images/check.svg') no-repeat center;
  -webkit-mask-size: contain;
  mask-size: contain;
}

/* Airbnb-style gallery layout */
.gallery-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: .5rem;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.main-photo { grid-row: 1 / span 4; }
.thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(4, 1fr);
  gap: .5rem;
}
.main-photo,
.thumb {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
}
.main-photo img,
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  display: block;
  transition: transform .2s ease;
}
.thumb:hover img { transform: scale(1.05); }
.thumb.more {
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
}

/* Description & heading */
.description-intro {
  margin: 0 0 2rem;
  text-align: justify;
  word-break: normal;
  overflow-wrap: normal;
  line-break: auto;
  text-wrap: pretty;
  hyphens: none;
}

.section-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
}
.section-heading .icon-inline {
  width: 36px;
  height: 36px;
}

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: 1fr; aspect-ratio: auto; }
  .thumbs { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 100px; gap: .5rem; }
  .thumb img { aspect-ratio: 1 / 1; }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  padding: 1rem;
}

.lightbox figure {
  position: relative;
  text-align: center;
  color: #fff;
  margin: 0;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,.4);
}

.lightbox figcaption {
  margin-top: .8rem;
  font-size: 1rem;
  opacity: 0.85;
  max-width: 80vw;
}

/* ===== Close Button ===== */
.lightbox .close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  font-size: 2rem;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  z-index: 10000;
}

/* ===== Navigation Buttons (Seitlich) ===== */
.lightbox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;

  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255,255,255,0.15);

  color: #fff;
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;

  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10000;
  user-select: none;
}

.lightbox .nav:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-50%) scale(1.1);
}

.lightbox .prev { left: 2rem; }
.lightbox .next { right: 2rem; }

/* Optional: etwas Schatten für Tiefe */
.lightbox .nav {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Forms / Contact
   ========================================================================== */
form { display: grid; gap: 1.2rem; }

input,
textarea {
  width: 100%;
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(28,90,78,0.1);
  outline: none;
}
textarea { min-height: 140px; resize: vertical; }

/* ==========================================================================
   Dropdown Menu & Language Switch
   ========================================================================== */
.dropdown { position: relative; display: inline-block; }

.dropbtn {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  color: inherit;
  padding: 0;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--white);
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.15);
  z-index: 10;
  border-radius: var(--radius);
  overflow: hidden;
}
.dropdown-content a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--primary-dark);
  text-decoration: none;
  font-size: 0.95rem;
}
.dropdown-content a:hover { background-color: var(--light-grey); }

/* Desktop hover; for mobile toggle .dropdown.open via JS */
.dropdown:hover .dropdown-content { display: block; }
.dropdown:hover .dropbtn { color: var(--primary-dark); }
.dropdown.open .dropdown-content { display: block; }

.lang-switch {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.lang-switch a {
  font-weight: 600;
  padding: .25rem .6rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  color: var(--muted);
  transition: all .2s ease;
}
.lang-switch a:hover { color: var(--primary); border-color: var(--line); }
.lang-switch a.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
  padding: 2rem 0;
  border-top: 1px solid var(--line);
}
.foot {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.foot .brand .logo { border-radius: var(--radius); }

.credits {
  color: var(--muted);
  font-size: .9rem;
}
