/* Gruber Immobilientreuhand – Design-Grundlagen */

/* Lokale Schrift Inter (SIL OFL, Lizenz in assets/fonts) */
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --indigo-900: #181f52;
  --indigo-700: #2b3585;      /* Primärfarbe, abgeleitet vom Logo */
  --indigo-500: #6570c5;      /* Logo-Blau (nur für Flächen/Linien, zu hell für kleinen Text) */
  --indigo-600: #3f4aa0;      /* Logo-Blau abgedunkelt für Text */
  --indigo-100: #e8eaf8;
  --sand-50:  #faf7f1;
  --sand-100: #f3eee3;
  --terra-600: #b8532f;       /* warmer Akzent für Aktionen */
  --terra-700: #9a4425;
  --ink: #1d2033;
  --muted: #565b73;
  --line: #dcd9d0;
  --radius: 14px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 1.0625rem/1.65 var(--sans);
  color: var(--ink);
  background: var(--sand-50);
}
img { max-width: 100%; height: auto; }
a { color: var(--indigo-700); text-underline-offset: 3px; }
a:hover { color: var(--terra-700); }
:focus-visible { outline: 3px solid var(--indigo-500); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; color: var(--indigo-900); margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .5rem; }
.brand img { display: block; height: 60px; width: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; }
.main-nav a {
  display: block; padding: .55rem .9rem; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.main-nav a:hover { background: var(--indigo-100); color: var(--indigo-700); }
.main-nav a[aria-current="page"] { background: var(--indigo-700); color: #fff; }
.nav-toggle {
  display: none; font: inherit; font-weight: 600; color: var(--indigo-700);
  background: #fff; border: 2px solid var(--indigo-700); border-radius: 999px; padding: .4rem 1rem; cursor: pointer;
}

@media (max-width: 800px) {
  .nav-toggle { display: inline-block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); padding: .5rem 1rem 1rem; }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { border-radius: 10px; padding: .8rem 1rem; }
}

/* Buttons */
.btn {
  display: inline-block; padding: .85rem 1.5rem; border-radius: 999px; font-weight: 600; text-decoration: none;
  background: var(--terra-600); color: #fff; border: 2px solid var(--terra-600);
  transition: background .15s, transform .15s;
}
.btn:hover { background: var(--terra-700); border-color: var(--terra-700); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: #fff; border-color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--indigo-900); border-color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--indigo-900), var(--indigo-700)); color: #fff; padding-block: clamp(3rem, 8vw, 6rem); }
.hero h1 { color: #fff; max-width: 18ch; }
.hero p.lead { font-size: 1.25rem; max-width: 52ch; color: #e4e6f7; margin-bottom: 1.8rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--indigo-600); margin-bottom: .8rem; }
.hero .eyebrow { color: #b7bff0; }

/* Sections */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--sand { background: var(--sand-100); }
.section-head { max-width: 60ch; margin-bottom: 2rem; }

.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.card h3 { margin-bottom: .4em; }
.card p { margin: 0; color: var(--muted); }
.card .icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--indigo-100); color: var(--indigo-700);
  display: grid; place-items: center; margin-bottom: 1rem;
}
.card .icon svg { width: 24px; height: 24px; }
/* Dienstleistungs-Karten: Icon und Überschrift in einer Zeile, der Text beginnt darunter in voller Breite */
.card--service { display: grid; grid-template-columns: 46px 1fr; column-gap: 1rem; row-gap: .9rem; align-items: center; align-content: start; }
.card--service .icon { margin-bottom: 0; }
.card--service h3 { margin: 0; }
.card--service p { grid-column: 1 / -1; }

/* Ausgewogene Überschriften. Für Fliesstext bewusst keine automatische Zeilenoptimierung: sie verhält sich je nach Browser
   unterschiedlich; einzelne Wörter am Zeilenende verhindern feste Leerzeichen (&nbsp;) im Text. */
h1, h2, h3 { text-wrap: balance; }

/* Silbentrennung: nur in Fliesstext und nur auf schmalen Bildschirmen (grosse Lücken vor langen Wörtern).
   Überschriften, Knöpfe, Chips und Zahlen bleiben ungetrennt. Einzelne lange Wörter tragen zusätzlich
   weiche Trennstellen (&shy;) im Text. */
@media (max-width: 700px) {
  .lead, .section-head p, .card p, .person p, .profile p, .prose p, .prose-text p, .bullets li, .empty p {
    hyphens: auto; -webkit-hyphens: auto;
    -webkit-hyphenate-limit-before: 3; -webkit-hyphenate-limit-after: 3;
    hyphenate-limit-chars: 7 3 3;
  }
}

/* Telefonnummern nie auf zwei Zeilen umbrechen */
a[href^="tel:"] { white-space: nowrap; }

/* Personen */
.more-link { margin-top: 1.5rem; }
.people { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.person { display: flex; gap: 1.1rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.person picture { flex: none; }
.person img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; display: block; }
.person h3 { margin: 0; font-size: 1.15rem; }
.person p { margin: 0; color: var(--muted); font-size: .95rem; }

.cta { background: var(--indigo-100); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 3rem); display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.cta h2 { margin: 0 0 .3em; }
.cta p { margin: 0; color: var(--muted); }

/* Footer */
.site-footer { background: var(--indigo-900); color: #d5d8f0; padding-top: 3rem; }
.site-footer h2 { color: #fff; font-size: 1.05rem; letter-spacing: 0; margin-bottom: .6em; }
.site-footer a { color: #fff; }
.site-footer address { font-style: normal; }
.footer-logo { display: block; height: 72px; width: auto; margin-bottom: 1.5rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: 2rem; padding-block: 1.2rem; border-top: 1px solid rgba(255,255,255,.15); font-size: .9rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Unterseiten */
.page-head { background: var(--indigo-100); padding-block: clamp(2rem, 5vw, 3.5rem); }
.page-head h1 { margin-bottom: .3em; }
.page-head .lead { margin: 0; color: var(--muted); font-size: 1.15rem; max-width: 60ch; }
.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.8em; }
.crumbs { margin-bottom: 1rem; }

.profiles { display: grid; gap: 1.5rem; }
.profile { display: flex; gap: 1.5rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.profile > picture { flex: none; }
.profile > picture img { width: 150px; height: 188px; object-fit: cover; border-radius: 12px; display: block; }
.profile h2 { margin-bottom: .1em; }
.profile h3 { font-family: var(--sans); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--indigo-600); margin: 1.2em 0 .3em; }
.role { color: var(--muted); }
.features { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.features li { background: var(--indigo-100); color: var(--indigo-900); border-radius: 999px; padding: .25rem .8rem; font-size: .95rem; }
@media (max-width: 560px) { .profile { flex-direction: column; } }

.doc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; max-width: 640px; }
.doc-list a { display: flex; justify-content: space-between; gap: 1rem; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; text-decoration: none; font-weight: 500; }
.doc-list a:hover { border-color: var(--indigo-500); }
.doc-list small { color: var(--muted); font-weight: 400; white-space: nowrap; }
.doc-group { margin-top: 2.5rem; }

/* Inserate */
.listing { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.obj-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; transition: box-shadow .15s, transform .15s; }
.obj-card:hover { box-shadow: 0 8px 24px rgba(24,31,82,.12); transform: translateY(-2px); color: inherit; }
.obj-img { position: relative; aspect-ratio: 16 / 11; background: var(--sand-100); display: grid; place-items: center; }
.obj-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.obj-noimg { color: var(--muted); }
.badge { position: absolute; top: .75rem; left: .75rem; background: var(--terra-600); color: #fff; font-size: .8rem; font-weight: 700; padding: .2rem .7rem; border-radius: 999px; }
.badge--inline { position: static; display: inline-block; }
.obj-body { padding: 1.1rem 1.25rem 1.3rem; }
.obj-body h2 { font-size: 1.2rem; margin-bottom: .2em; }
.obj-ort { color: var(--muted); margin-bottom: .4em; }
.obj-facts { color: var(--muted); font-size: .95rem; margin-bottom: .6em; }
.obj-price { font-weight: 700; color: var(--indigo-700); margin: 0; font-size: 1.1rem; }
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); padding: 2.5rem 1.5rem; text-align: center; max-width: 640px; margin-inline: auto; }

.detail { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); margin-top: 1.5rem; }
@media (min-width: 900px) { .detail { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .detail-side { position: sticky; top: 100px; } }
.gallery { position: relative; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: var(--radius); background: var(--sand-100); }
.gallery-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; margin: 0; scroll-snap-align: start; aspect-ratio: 3 / 2; }
.slide a, .slide picture { display: block; width: 100%; height: 100%; }
.slide img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--indigo-900); font-size: 2rem; line-height: 1; padding: 0 0 .2rem; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.gallery-btn[hidden] { display: none; }
.gallery-btn:hover { background: #fff; color: var(--terra-700); }
.gallery-btn:disabled { opacity: .35; cursor: default; }
.gallery-prev { left: .75rem; }
.gallery-next { right: .75rem; }
.gallery-count { position: absolute; right: .75rem; bottom: .75rem; margin: 0; background: rgba(24,31,82,.8); color: #fff; font-size: .85rem; padding: .15rem .7rem; border-radius: 999px; }
.gallery-count[hidden] { display: none; }
.gallery-thumbs { list-style: none; padding: 0; margin: .75rem 0 2rem; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.gallery-thumbs a { display: block; border-radius: 10px; overflow: hidden; outline-offset: 2px; border: 2px solid transparent; }
.gallery-thumbs a[aria-current="true"] { border-color: var(--indigo-700); }
.gallery-thumbs img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; }
.gallery + .gallery-thumbs { margin-top: .75rem; }
.gallery:not(:has(+ .gallery-thumbs)) { margin-bottom: 2rem; }
.detail-side { position: sticky; top: 100px; } }
.detail-side { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.facts { margin: 0 0 1.5rem; }
.facts div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); }
.facts .sub { padding-block: .3rem; border-bottom-style: dashed; font-size: .95rem; }
.facts .sub dt { padding-left: 1rem; }
.facts .sub dd { font-weight: 500; }
.facts dd { margin: 0; font-weight: 600; text-align: right; }
.btn--block { display: block; text-align: center; }
.side-note { margin: 1rem 0 0; text-align: center; color: var(--muted); }

.prose-text p { margin: 0 0 1em; }
.bullets { margin: 0 0 1.2em; padding-left: 0; list-style: none; }
.bullets li { position: relative; padding-left: 1.6rem; margin-bottom: .45rem; }
.bullets li::before { content: ""; position: absolute; left: .2rem; top: .65em; width: .5rem; height: .5rem; border-radius: 50%; background: var(--terra-600); }

/* Karte */
.detail-main .features { margin-bottom: 2rem; }
.map-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 2rem; }
.map-address { font-weight: 600; margin-bottom: .4rem; }
.map-note { color: var(--muted); font-size: .9rem; }
.map-note[hidden], .map-box [hidden] { display: none; }
.map-actions { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.btn--small { padding: .55rem 1.1rem; font-size: .95rem; }
.map-frame { display: block; width: 100%; height: 380px; border: 0; border-radius: 10px; margin-bottom: 1rem; }

/* Formular */
.contact-grid { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; } }
.form { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 3vw, 2rem); }
.row { display: grid; gap: 1rem; }
@media (min-width: 600px) { .row--2 { grid-template-columns: 1fr 1fr; } }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; }
.opt { font-weight: 400; color: var(--muted); }
.req { color: var(--terra-600); }
.form input:not([type=checkbox]), .form select, .form textarea {
  width: 100%; font: inherit; padding: .7rem .9rem; border: 1.5px solid #b9b6ab; border-radius: 10px; background: #fff; color: var(--ink);
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--indigo-500); outline: 3px solid var(--indigo-100); }
.form [aria-invalid="true"] { border-color: #b3261e; }
.field-error { color: #b3261e; font-size: .92rem; margin: .3rem 0 0; }
.field--check label { font-weight: 400; display: flex; gap: .6rem; align-items: flex-start; }
.field--check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; }
.alert { background: var(--indigo-100); border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1.2rem; }
.alert--error { background: #fbe9e7; color: #7a1a12; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.contact-side { background: var(--sand-100); border-radius: var(--radius); padding: 1.5rem; }
.btn--outline { background: transparent; color: var(--indigo-700); border-color: var(--indigo-700); }
.btn--outline:hover { background: var(--indigo-700); border-color: var(--indigo-700); color: #fff; }

/* Teilen / Drucken */
.detail-actions[hidden] { display: none; }
.detail-actions { display: flex; gap: .6rem; margin-top: 1rem; }
.detail-actions button { flex: 1; font: inherit; font-weight: 600; color: var(--indigo-700); background: #fff; border: 2px solid var(--indigo-700); border-radius: 999px; padding: .55rem .8rem; cursor: pointer; }
.detail-actions button:hover { background: var(--indigo-700); color: #fff; }
.share-status { text-align: center; color: var(--muted); font-size: .9rem; margin: .5rem 0 0; min-height: 1.4em; }
.print-only { display: none; }

@media print {
  .site-header, .site-footer, .nav-toggle, .crumbs, .detail-actions, .detail-side .btn, .side-note, .share-status, .gallery-thumbs, .skip, .map-box { display: none !important; }
  body { background: #fff; font-size: 11pt; color: #000; }
  .wrap { width: 100%; }
  .section { padding-block: 0; }
  .detail { display: block; }
  .gallery-track { overflow: hidden; }
  .slide { flex-basis: 100%; max-height: 9cm; aspect-ratio: auto; }
  .slide:not(:first-child), .gallery-btn, .gallery-count { display: none; }
  .slide img { max-height: 9cm; margin-bottom: 1rem; }
  .detail-side { border: 0; padding: 0; margin-top: 1rem; }
  .print-only { display: block; margin-top: 1.5rem; padding-top: .6rem; border-top: 1px solid #999; font-size: 10pt; }
  a { color: inherit; text-decoration: none; }
  .features li { background: none; border: 1px solid #999; }
  h1, h2 { break-after: avoid; }
  .facts div, .features li { break-inside: avoid; }
}

picture { display: block; }
.obj-img picture { width: 100%; height: 100%; }
