*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--pub-font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--pub-text);
  background:
    var(--pub-glow),
    var(--pub-bg);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

a { color: var(--pub-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--pub-font-head); margin: 0 0 0.5em; line-height: 1.2; letter-spacing: -0.02em; }

@keyframes pub-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pub-glow-shift {
  from { transform: translate3d(-2%, 0, 0) scale(1); }
  to { transform: translate3d(3%, -2%, 0) scale(1.05); }
}

/* Header */

.pub-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 72px;
  background: rgba(10, 11, 13, 0.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--pub-border);
}

.pub-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.pub-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--pub-text);
  min-width: 0;
}

.pub-brand:hover { text-decoration: none; }

.pub-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 10px;
}

.pub-brand--no-logo .pub-agency-name { font-size: 24px; }

.pub-agency-name {
  font-family: var(--pub-font-head);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pub-header-contact {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  font-size: 14px;
}

.pub-header-contact a {
  color: var(--pub-text-2);
  text-decoration: none;
  white-space: nowrap;
}

.pub-header-contact a:hover { color: var(--pub-text); text-decoration: none; }

@media (max-width: 640px) {
  .pub-header { height: auto; min-height: 64px; }
  .pub-header-inner {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .pub-agency-name { font-size: 17px; max-width: 55vw; }
  .pub-header-contact {
    width: 100%;
    flex-direction: row;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px 16px;
    font-size: 13px;
  }

  .pub-hero { min-height: min(58vh, 460px); }
  .pub-hero-inner { padding: 28px 16px 28px; }
  .pub-hero-brand { gap: 12px; margin-bottom: 12px; }
  .pub-hero-logo { width: 48px; height: 48px; border-radius: 12px; }
  .pub-hero-name { font-size: clamp(1.7rem, 8vw, 2.4rem); }
  .pub-hero-line { font-size: 0.95rem; margin-bottom: 18px; }
  .pub-hero-cta { width: 100%; justify-content: center; }

  .filter-bar {
    top: 0;
    position: sticky;
    padding: 12px 16px;
  }
  .filter-bar-inner { gap: 10px; }
  .filter-group {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .filter-pill { flex-shrink: 0; white-space: nowrap; }
  .filter-select { width: 100%; }
  .filter-count { width: 100%; margin-left: 0; }

  .listing-grid-wrap { padding: 20px 16px 40px; }
  .pc-body { padding: 14px; }
  .pc-title { font-size: 16px; }

  .detail-wrap { padding: 16px; }
  .detail-title { font-size: 22px; }
  .detail-price { font-size: 26px; }
  .gallery-main { height: 280px; }
  .gallery-main-wrap { max-height: 280px; }
  .facts-strip { gap: 12px; padding: 12px; }
  .detail-sidebar { position: static; }

  .pub-footer { padding: 28px 16px; }
  .pub-footer-powered { flex-direction: column; align-items: flex-start; }
  .legal-wrap { padding: 24px 16px 40px; }
  .legal-wrap h1 { font-size: 22px; }
}

/* Hero — brand first, one composition */

.pub-hero {
  position: relative;
  min-height: min(72vh, 640px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--pub-border);
}

.pub-hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,11,13,0.35) 0%, rgba(10,11,13,0.82) 55%, rgba(10,11,13,0.98) 100%),
    var(--pub-glow),
    var(--pub-surface);
  background-size: cover;
  background-position: center;
  transform-origin: center;
  animation: pub-glow-shift 18s ease-in-out infinite alternate;
}

.pub-hero-bg.has-cover {
  background-image:
    linear-gradient(180deg, rgba(10,11,13,0.25) 0%, rgba(10,11,13,0.78) 50%, rgba(10,11,13,0.98) 100%),
    var(--hero-cover);
  background-size: cover;
  background-position: center;
}

.pub-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  animation: pub-rise 700ms var(--pub-ease) both;
}

.pub-hero-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.pub-hero-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 14px;
  flex-shrink: 0;
}

.pub-hero-name {
  font-family: var(--pub-font-head);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
  margin: 0;
  line-height: 1.05;
}

.pub-hero-line {
  max-width: 34rem;
  margin: 0 0 24px;
  color: var(--pub-text-2);
  font-size: 1.05rem;
}

.pub-hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  background: var(--pub-gradient);
  color: #fff;
  font-family: var(--pub-font-body);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 200ms var(--pub-ease), opacity 200ms;
}

.pub-hero-cta:hover {
  text-decoration: none;
  color: #fff;
  transform: translateY(-1px);
  opacity: 0.95;
}

/* Filter bar */

.filter-bar {
  position: sticky;
  top: 72px;
  z-index: 90;
  background: rgba(17, 19, 23, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--pub-border);
  padding: 14px 24px;
}

.filter-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 13px;
  color: var(--pub-text-3);
  margin-right: 4px;
}

.filter-pill {
  padding: 7px 14px;
  border: 1px solid var(--pub-border);
  border-radius: 999px;
  background: transparent;
  font-family: var(--pub-font-body);
  font-size: 13px;
  color: var(--pub-text-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.filter-pill:hover {
  border-color: var(--pub-primary);
  color: var(--pub-text);
}

.filter-pill.is-active {
  background: var(--pub-gradient);
  border-color: transparent;
  color: #fff;
}

.filter-select {
  padding: 8px 12px;
  border: 1px solid var(--pub-border);
  border-radius: 8px;
  background: var(--pub-surface);
  font-family: var(--pub-font-body);
  font-size: 13px;
  color: var(--pub-text);
  cursor: pointer;
}

.filter-count {
  margin-left: auto;
  font-size: 13px;
  color: var(--pub-text-3);
  font-family: var(--pub-font-mono);
}

@media (max-width: 768px) {
  .filter-count { width: 100%; margin-left: 0; }
}

/* Listing grid */

.listing-grid-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  scroll-margin-top: 140px;
  animation: pub-rise 560ms var(--pub-ease) both;
}

.listing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 640px) {
  .listing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .listing-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Property card — interaction container */

.prop-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pub-border);
  border-radius: var(--pub-radius);
  overflow: hidden;
  background: var(--pub-surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s var(--pub-ease), transform 0.25s var(--pub-ease);
}

.prop-card:hover {
  border-color: rgba(53,129,239,0.45);
  transform: translateY(-3px);
  text-decoration: none;
}

.pc-img-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--pub-surface-2);
  overflow: hidden;
}

.pc-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms var(--pub-ease);
}

.prop-card:hover .pc-img { transform: scale(1.04); }

.pc-img-count {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 4px 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-family: var(--pub-font-mono);
  font-size: 11px;
  border-radius: 4px;
}

.pc-price {
  position: absolute;
  bottom: 10px;
  right: 10px;
  padding: 7px 12px;
  background: rgba(10,11,13,0.82);
  border: 1px solid rgba(255,255,255,0.12);
  color: #fff;
  font-family: var(--pub-font-head);
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.pc-ribbon {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 12px;
  font-family: var(--pub-font-head);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  border-radius: 6px;
}

.pc-ribbon-verkauft   { background: #E84545; }
.pc-ribbon-vermietet  { background: #3581EF; }
.pc-ribbon-reserviert { background: #F5A623; }

.pc-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }

.pc-title {
  font-family: var(--pub-font-head);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--pub-text);
}

.pc-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  color: var(--pub-text-2);
  margin-bottom: 12px;
}

.pc-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--pub-border);
  font-size: 13px;
}

.pc-objid {
  font-family: var(--pub-font-mono);
  color: var(--pub-text-3);
}

.pc-cta {
  color: var(--pub-accent);
  font-weight: 600;
}

/* Empty state */

.no-results {
  text-align: center;
  padding: 64px 24px;
  color: var(--pub-text-2);
}

.no-results p { margin: 0 0 20px; font-size: 17px; }

/* Buttons */

.pub-btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--pub-gradient);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--pub-font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}

.pub-btn:hover { opacity: 0.9; text-decoration: none; color: #fff; }

.pub-btn--full { display: block; width: 100%; text-align: center; }

.pub-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Footer */

.pub-footer {
  margin-top: auto;
  padding: 40px 24px 28px;
  background: var(--pub-surface);
  border-top: 1px solid var(--pub-border);
}

.pub-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
}

.pub-footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--pub-text-2);
}

.pub-footer-links {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.pub-footer-links a { color: var(--pub-text-2); font-size: 14px; }
.pub-footer-links a:hover { color: var(--pub-text); }

.pub-footer-copy {
  font-size: 13px;
  color: var(--pub-text-3);
}

.pub-footer-powered {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--pub-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

.pub-footer-powered-label {
  font-size: 12px;
  color: var(--pub-text-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pub-footer-powered-brands {
  display: flex;
  align-items: center;
  gap: 18px;
}

.pub-footer-powered-brands img {
  height: 22px;
  width: auto;
  opacity: 0.9;
}

.pub-footer-powered-brands .ni-mark {
  height: 28px;
  width: 28px;
  border-radius: 7px;
}

/* Detail page */

.detail-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  animation: pub-rise 500ms var(--pub-ease) both;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--pub-text-2);
  margin-bottom: 20px;
  text-decoration: none;
}

.back-link:hover { color: var(--pub-text); text-decoration: none; }

.back-link svg { flex-shrink: 0; }

.detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 900px) {
  .detail-layout {
    grid-template-columns: 62fr 38fr;
    align-items: start;
  }
}

/* Gallery */

.gallery-main-wrap {
  position: relative;
  width: 100%;
  max-height: 520px;
  background: var(--pub-surface);
  border-radius: var(--pub-radius);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--pub-border);
}

.gallery-main {
  width: 100%;
  height: 520px;
  object-fit: cover;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(10,11,13,0.7);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-main-wrap:hover .gallery-nav { opacity: 1; }

.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }

.gallery-counter {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 4px 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-family: var(--pub-font-mono);
  font-size: 12px;
  border-radius: 4px;
}

.gallery-status {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 14px;
  font-family: var(--pub-font-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  border-radius: 8px;
}

.gallery-status-verkauft   { background: #E84545; }
.gallery-status-vermietet  { background: #3581EF; }
.gallery-status-reserviert { background: #F5A623; }

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.gallery-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.7;
  transition: opacity 0.15s, border-color 0.15s;
}

.gallery-thumb:hover { opacity: 1; }

.gallery-thumb.is-active {
  border-color: var(--pub-primary);
  opacity: 1;
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.lb-prev { left: 16px; }
.lb-next { right: 16px; }

.lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-family: var(--pub-font-mono);
  font-size: 14px;
}

/* Detail content */

.detail-title {
  font-family: var(--pub-font-head);
  font-weight: 700;
  font-size: 28px;
  margin: 20px 0 12px;
  letter-spacing: -0.03em;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-badge {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  font-family: var(--pub-font-head);
  letter-spacing: 0.04em;
}

.detail-badge-status-verkauft   { background: rgba(232,69,69,0.16); color: #E84545; }
.detail-badge-status-vermietet  { background: rgba(53,129,239,0.16); color: #3581EF; }
.detail-badge-status-reserviert { background: rgba(245,166,35,0.16); color: #F5A623; }

.detail-badge-type {
  background: var(--pub-surface);
  color: var(--pub-text-2);
  border: 1px solid var(--pub-border);
}

.detail-price {
  font-family: var(--pub-font-head);
  font-weight: 700;
  font-size: 32px;
  background: var(--pub-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 20px;
}

.facts-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 16px;
  background: var(--pub-surface);
  border: 1px solid var(--pub-border);
  border-radius: var(--pub-radius);
  margin-bottom: 28px;
}

.fact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--pub-text-2);
}

.fact-item svg {
  flex-shrink: 0;
  color: var(--pub-accent);
}

.detail-section {
  margin-bottom: 28px;
}

.detail-section h2 {
  font-family: var(--pub-font-head);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--pub-text);
}

.detail-section p {
  margin: 0;
  color: var(--pub-text-2);
  white-space: pre-wrap;
}

.privacy-box {
  padding: 16px 20px;
  background: var(--pub-surface);
  border-left: 3px solid var(--pub-primary);
  border-radius: var(--pub-radius);
  border: 1px solid var(--pub-border);
  border-left-width: 3px;
  border-left-color: var(--pub-primary);
}

.detail-map {
  width: 100%;
  height: 300px;
  border: none;
  border-radius: var(--pub-radius);
}

.detail-disclaimer {
  font-size: 13px;
  color: var(--pub-text-3);
  font-style: italic;
  margin-top: 24px;
}

/* Sidebar */

.detail-sidebar {
  position: sticky;
  top: 96px;
}

.agency-card {
  padding: 20px;
  border: 1px solid var(--pub-border);
  border-radius: var(--pub-radius);
  background: var(--pub-surface);
  margin-bottom: 20px;
}

.agency-card-logo {
  height: 60px;
  object-fit: contain;
  margin-bottom: 12px;
}

.agency-card-name {
  font-family: var(--pub-font-head);
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 10px;
}

.agency-card-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.agency-card-contact a { color: var(--pub-text-2); }
.agency-card-contact a:hover { color: var(--pub-text); }

/* Contact form */

.contact-form-wrap {
  padding: 20px;
  border: 1px solid var(--pub-border);
  border-radius: var(--pub-radius);
  background: var(--pub-surface);
}

.contact-form-label {
  font-size: 13px;
  color: var(--pub-text-3);
  margin-bottom: 16px;
  font-family: var(--pub-font-mono);
}

.form-field {
  margin-bottom: 14px;
}

.form-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--pub-text);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--pub-border);
  border-radius: 8px;
  font-family: var(--pub-font-body);
  font-size: 14px;
  color: var(--pub-text);
  background: var(--pub-bg);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--pub-primary);
}

.form-field textarea { resize: vertical; min-height: 100px; }

.form-checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--pub-text-2);
  margin-bottom: 16px;
}

.form-checkbox input { margin-top: 3px; flex-shrink: 0; }

.form-error {
  color: #E84545;
  font-size: 13px;
  margin-bottom: 12px;
}

.contact-success {
  padding: 20px;
  text-align: center;
  color: var(--pub-text-2);
  font-size: 15px;
  line-height: 1.6;
}

/* Legal pages */

.legal-wrap {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.legal-wrap h1 {
  font-family: var(--pub-font-head);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
}

.legal-content {
  color: var(--pub-text-2);
  white-space: pre-wrap;
  line-height: 1.7;
}

.legal-content p { margin: 0 0 1em; white-space: pre-wrap; }

/* Loading / error */

.page-loading,
.page-error {
  text-align: center;
  padding: 48px 24px;
  color: var(--pub-text-3);
}

.page-error { color: #E84545; }
