/* ==========================================================================
   Immobilien Hager – Unterer Markt 34, 3335 Weyer
   DSGVO-konformes Stylesheet (ohne externe Schrift- oder CDN-Requests)
   ========================================================================== */

:root {
  --bg-page: #fafaf9;
  --bg-surface: #ffffff;
  --bg-muted: #f3f2ef;
  --bg-dark: #1c242b;
  --text-main: #1f2933;
  --text-muted: #52606d;
  --accent: #9a4a1e;
  --accent-hover: #7c3a16;
  --accent-soft: #fdf4ee;
  --border: #e4e2dd;
  --status-rented-bg: #f1f5f9;
  --status-rented-text: #475569;
  --status-rented-border: #cbd5e1;
  --status-free-bg: #ecfdf5;
  --status-free-text: #065f46;
  --status-free-border: #a7f3d0;
  --radius: 10px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.08);
  --container: 1140px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-page);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--bg-dark);
  line-height: 1.25;
  margin-top: 0;
}

h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.75rem);
  font-weight: 700;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.18s ease;
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 74px;
  gap: 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  color: var(--bg-dark);
}

.brand:hover {
  color: var(--bg-dark);
}

.brand-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  font-size: 1rem;
  color: var(--bg-dark);
  cursor: pointer;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav a {
  color: var(--text-main);
  font-weight: 500;
  font-size: 0.96rem;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.main-nav a.nav-cta {
  background: var(--accent);
  color: #ffffff;
  padding: 0.52rem 1.05rem;
  border-radius: 7px;
  border-bottom: none;
}

.main-nav a.nav-cta:hover,
.main-nav a.nav-cta.active {
  background: var(--accent-hover);
  color: #ffffff;
}

/* Hero Section */
.hero {
  padding: 3.5rem 0 4rem;
  background: linear-gradient(180deg, var(--bg-muted) 0%, var(--bg-page) 100%);
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.hero-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.65rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1.35rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.96rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--bg-dark);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--bg-dark);
  color: var(--bg-dark);
}

.hero-media {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.hero-media img {
  width: 100%;
  height: 390px;
  object-fit: cover;
}

.hero-caption {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  max-width: 720px;
  margin-bottom: 2.25rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Feature Highlights */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.highlight-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.highlight-box h3 {
  font-size: 1.08rem;
  margin-bottom: 0.4rem;
}

.highlight-box p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Unit Cards */
.units-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

.unit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.unit-card-media {
  position: relative;
  height: 240px;
  background: #e7e5e0;
  overflow: hidden;
}

.unit-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.unit-card:hover .unit-card-media img {
  transform: scale(1.03);
}

.status-badge {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.status-vermietet {
  background: var(--status-rented-bg);
  color: var(--status-rented-text);
  border-color: var(--status-rented-border);
}

.status-frei {
  background: var(--status-free-bg);
  color: var(--status-free-text);
  border-color: var(--status-free-border);
}

.unit-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.unit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.unit-list {
  margin: 0 0 1.25rem;
  padding-left: 1.15rem;
  color: var(--text-main);
  font-size: 0.95rem;
}

.unit-list li {
  margin-bottom: 0.35rem;
}

.unit-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.unit-price {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--bg-dark);
}

.unit-price small {
  display: block;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Detailed Apartment Blocks */
.detail-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.detail-header .status-badge {
  position: static;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: start;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.specs-table th,
.specs-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.specs-table th {
  width: 42%;
  color: var(--text-muted);
  font-weight: 600;
}

.mini-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.mini-gallery figure {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #eae8e3;
  cursor: pointer;
  position: relative;
}

.mini-gallery img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.mini-gallery figure:hover img {
  transform: scale(1.04);
}

/* Full Gallery & Filters */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.48rem 0.95rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--bg-dark);
  color: #ffffff;
  border-color: var(--bg-dark);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.gallery-item {
  margin: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.gallery-item.hidden {
  display: none;
}

.gallery-item img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-item figcaption {
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Image Placeholder Fallback */
.img-missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  min-height: 170px;
  background: repeating-linear-gradient(
    -45deg,
    #f4f3ef,
    #f4f3ef 10px,
    #eceae4 10px,
    #eceae4 20px
  );
  color: var(--text-muted);
  font-size: 0.82rem;
}

.img-missing code {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.74rem;
  color: var(--bg-dark);
  word-break: break-all;
}

/* Contact & Info Boxes */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg-page);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
  background: #ffffff;
}

.notice-box {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.94rem;
  margin: 1.25rem 0;
}

/* Legal Text Pages */
.legal-content {
  max-width: 820px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}

.legal-content h2 {
  margin-top: 1.75rem;
  font-size: 1.35rem;
}

.legal-content h2:first-of-type {
  margin-top: 0.5rem;
}

/* Lightbox Modal */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox.open {
  display: flex;
}

.lightbox-inner {
  max-width: 980px;
  width: 100%;
  text-align: center;
  position: relative;
}

.lightbox-inner img {
  max-height: 78vh;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  color: #e2e8f0;
  margin-top: 0.85rem;
  font-size: 0.95rem;
}

.lightbox-btn {
  position: fixed;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox-close {
  top: 1.25rem;
  right: 1.25rem;
}

.lightbox-prev {
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

/* Footer */
.site-footer {
  background: var(--bg-dark);
  color: #cbd5e1;
  padding: 3rem 0 2rem;
  margin-top: 3rem;
  font-size: 0.92rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer h3 {
  color: #ffffff;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.site-footer a {
  color: #e2e8f0;
}

.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.45rem;
}

.footer-bottom {
  padding-top: 1.35rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: #94a3b8;
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid,
  .detail-grid,
  .two-col,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .highlights-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .units-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .nav-toggle {
    display: inline-block;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 74px;
    left: 0;
    right: 0;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.25rem 1.35rem;
    gap: 0.85rem;
    box-shadow: var(--shadow-md);
  }

  .main-nav.open {
    display: flex;
  }

  .highlights-grid,
  .mini-gallery {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero-media img {
    height: 260px;
  }
}