/* Millennium Immobilien: page CSS on top of the taste-skill kit (from the client-site-rebuild base). */

/* the client's logo (a framed PNG, its own colours) */
.nav__logo img.site-logo { height: 44px; width: auto; display: block; }
@media (max-width: 639px) { .nav__logo img.site-logo { height: 36px; } }
.footer .footer__name { font-size: 48px; line-height: 1; }
@media (max-width: 639px) { .footer .footer__name { font-size: 30px; } }

/* hero photograph: the client's photos are 900px to 1600px wide, kept sharp by cover */
.hero__media img { object-position: var(--ly-pos, 50% 50%); }

/* card rows: one panel height a row */
.cards-4 .panel { --p-h: 240px; }
.cards-3 .panel { --p-h: 260px; }
.cards-4 .panel img, .cards-3 .panel img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1023px) { .cards-4 > .card { grid-column: auto / span 6; } .cards-3 > .card { grid-column: auto / span 6; } }
@media (max-width: 639px) { .cards-4 .panel, .cards-3 .panel { --p-h: 200px; } .cards-4 > .card, .cards-3 > .card { grid-column: 1 / -1; } }

/* picture wall: its own grid, 2px gap, square tiles, line to line */
.wall { display: grid; gap: 2px; grid-template-columns: repeat(var(--wall-cols, 4), minmax(0, 1fr)); }
.wall--4 { --wall-cols: 4; }
.wall--3 { --wall-cols: 3; }
.wall--2 { --wall-cols: 2; align-self: start; }
.wall__item { display: block; position: relative; overflow: clip; aspect-ratio: 4 / 3; background: var(--surface); }
.wall__img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 600ms var(--ease, ease); }
@media (hover: hover) and (pointer: fine) { .wall__item:hover .wall__img { transform: scale(1.03); } }
.wall__item:focus-visible { outline-offset: -4px; }
.wall--plans .wall__item { aspect-ratio: 1 / 1; background: #fff; }
.wall--plans .wall__img { object-fit: contain; padding: var(--s-4); }
@media (max-width: 1023px) { .wall--4 { --wall-cols: 3; } }
@media (max-width: 639px) { .wall--4, .wall--3 { --wall-cols: 2; } }

/* a map or plan shown whole */
.frame--contain .frame__img { object-fit: contain; background: #fff; }

/* reference list: names in columns */
.ref-list { columns: 4 240px; column-gap: var(--s-5); list-style: none; padding: 0; margin: 0; }
.ref-list li { break-inside: avoid; padding-block: 5px; font-size: var(--t-small); line-height: 1.45; border-bottom: 1px solid var(--line); }
@media (max-width: 639px) { .ref-list { columns: 2 150px; } }

/* small definition lists: contact lines, facts */
.contact-list, .fact-list { display: grid; gap: var(--s-4); margin-bottom: 0; }
.contact-list > div, .fact-list > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s-4); padding-bottom: var(--s-3); border-bottom: 1px solid var(--line); }
.contact-list dt, .fact-list dt { font-size: var(--t-label); font-weight: 500; color: var(--muted); padding-top: 2px; }
.contact-list dd, .fact-list dd { margin: 0; }

/* history rows: the year in the name column */
.rows--years > li { grid-template-columns: 72px minmax(0, 1fr); }
.rows--years .rows__name { font-family: var(--font-display); font-size: 20px; }
.rows--years > li > p { grid-column: 2; grid-row: 1; }

/* the enquiry form on its card */
.form-card { background: var(--g-main, var(--bg)); border-radius: var(--r-lg); padding: var(--s-7); }
.form textarea { width: 100%; min-height: 120px; font: inherit; font-size: 16px; padding: var(--s-3) var(--s-4); border: 1px solid var(--line-strong, var(--line)); border-radius: var(--r-sm); background: var(--bg); color: var(--ink); resize: vertical; }
@media (max-width: 639px) { .form-card { padding: var(--s-5); } }

/* legal pages: text pages, not screens */
main > section.legal { height: auto; min-height: 100svh; padding-top: calc(var(--nav) + var(--s-8)); }
.legal h1 { font-size: var(--t-h2); }
.legal h2 { font-size: var(--t-card); margin-top: var(--s-5); }

/* lightbox (site.js) */
.lb { position: fixed; inset: 0; z-index: 50; background: rgb(20 17 15 / .94); display: grid; place-items: center; padding: 56px 72px; }
.lb[hidden] { display: none; }
.lb img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 2px; }
.lb button { position: absolute; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgb(246 242 236 / .12); color: #f6f2ec; font-size: 24px; line-height: 1; cursor: pointer; }
.lb button:hover { background: rgb(246 242 236 / .24); }
.lb button:focus-visible { outline: 2px solid #f6f2ec; outline-offset: 2px; }
.lb__close { top: 12px; right: 12px; }
.lb__prev { left: 12px; top: calc(50% - 24px); }
.lb__next { right: 12px; top: calc(50% - 24px); }
.lb__count { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #d8d2ca; font-size: 14px; }
@media (max-width: 639px) { .lb { padding: 64px 8px; } .lb__prev, .lb__next { top: auto; bottom: 8px; } }

.footer__addr { margin: 0 0 var(--s-3); color: var(--muted); font-size: var(--t-small); line-height: 1.6; font-style: normal; }
.footer__legal { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); align-items: center; }
.footer a { overflow-wrap: anywhere; }

/* one heading size per level: portrait tiles take the card title size */
.tile > h3 { font-family: var(--font-text); font-weight: 500; font-size: var(--t-card); line-height: 1.3; letter-spacing: -0.01em; }
.tile > p { margin: 0; }

/* the client's logo (a JPG on white): in the header on its own, in the dark footer on a white tile */
.site-logo { display: block; height: 46px; width: auto; }
.site-brand--footer { display: inline-block; background: #fff; border-radius: var(--r-md, 10px); padding: 12px 16px; }
.site-brand--footer .site-logo { height: 56px; }
@media (max-width: 639px) { .site-logo { height: 36px; } .site-brand--footer .site-logo { height: 44px; } }

/* service lists: plain lines with a thin rule, two columns where there is room */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0 var(--s-6); }
.checklist > li { padding: 10px 0 10px 22px; border-bottom: 1px solid var(--line); position: relative; line-height: 1.45; }
.checklist > li::before { content: ""; position: absolute; left: 0; top: 19px; width: 10px; height: 2px; background: var(--accent); }
@media (min-width: 1024px) { .checklist--2 { grid-template-columns: 1fr 1fr; } }
.ground-inverse .checklist > li { border-color: var(--line); }
.ground-inverse .checklist > li::before { background: var(--p-inv-ink); }

/* the listings widget (Flatfox) keeps its own height */
.listings { min-height: 480px; }
.listings__note { margin-top: var(--s-5); }

/* photo frames inside splits */
.frame--fill .frame__img, .frame--photo .frame__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame--contain .frame__img { object-fit: contain; background: #fff; }

/* sub pages: on phones and tablets a section grows with what it holds */
@media (max-width: 1023px) {
  body.sub main > section:not(.hero) { height: auto; min-height: 0; display: block; }
  body.sub main > section:not(.hero) > .wrap { height: auto; }
  body.sub main > section:not(.hero) > .wrap > .fill { flex: none; }
  body.sub main > section:not(.hero) .frame--fill { min-height: 280px; height: auto; flex: none; }
  body.sub footer.closing { height: auto; display: block; }
}
/* home on phones: sections grow too, so stacked splits never run into the next one */
@media (max-width: 639px) {
  body.home main > section:not(.hero):not([data-moment]) { height: auto; min-height: 100svh; display: block; }
  body.home main > section:not(.hero):not([data-moment]) > .wrap { height: auto; }
  body.home main > section:not(.hero):not([data-moment]) > .wrap > .fill { flex: none; }
  body.home .frame--fill { min-height: 280px; }
  .form-card { margin-top: var(--s-6); }
}
/* short or mid-size desktop screens (1280x800, 1024x768): a section grows with what it holds instead of
   cutting it off; it still fills at least one screen, and a photo frame keeps a real height */
@media (min-width: 640px) and (max-height: 860px), (min-width: 1024px) and (max-width: 1279px) {
  main > section:not(.hero):not([data-moment]) { height: auto !important; min-height: calc(var(--h, 1) * 100svh); display: flex; flex-direction: column; }
  main > section:not(.hero):not([data-moment]) > .wrap { flex: 1 0 auto; height: auto; }
  main > section:not(.hero):not([data-moment]) > .wrap > .fill { flex: 1 0 auto; min-height: auto; }
  main > section:not(.hero):not([data-moment]) .frame--fill { min-height: 360px; }
  footer.closing { height: auto; min-height: 100svh; }
}
@media (min-width: 640px) and (max-width: 1023px) {
  main > section:not(.hero):not([data-moment]) { height: auto !important; min-height: calc(var(--h, 1) * 100svh); display: block; }
  main > section:not(.hero):not([data-moment]) > .wrap { height: auto; }
  main > section:not(.hero):not([data-moment]) .frame--fill { min-height: 360px; }
}

/* team tiles: portraits at one ratio, the contact lines under the role */
.team-grid .tile { --tile-ratio: 4 / 5; }
.team-grid .tile__media img { object-position: 50% 20%; }
.tile__contact { font-size: var(--t-small); }
.team--home .tile { --tile-ratio: 1 / 1; }

/* tablets (640-1023): a growing section's .fill takes its own height, so its grid never collapses to 0 */
@media (min-width: 640px) and (max-width: 1023px) {
  main > section:not(.hero):not([data-moment]) > .wrap > .fill { flex: none; min-height: 0; }
  main > section:not(.hero):not([data-moment]) .frame--fill { flex: none; }
}
/* short landscape tablets (about 1000x768): a lower photograph above the hero words, a smaller split picture */
@media (min-width: 640px) and (max-width: 1023px) and (max-height: 820px) {
  .hero--photo { --photo: 26svh; }
  .hero--split .hero__media { min-height: 180px; margin-top: var(--s-5); }
}

/* phones: a lower photograph so the hero ends inside the first screen */
@media (max-width: 639px) { .hero--photo { --photo: 36svh; } }
/* very small phones: the menu carries the main action, long words and addresses wrap */
@media (max-width: 380px) { .nav:not(.is-open) .nav__bar > .nav__actions { display: none; } }
.tile > h3, .tile > p, .contact-list dd { overflow-wrap: anywhere; hyphens: auto; }
.grid > .tile { min-width: 0; }
/* contact section: a photograph under the words fills the column down to the form's foot */
#kontakt .span-5 { align-self: stretch; display: flex; flex-direction: column; }
.kontakt__photo { flex: 1 1 0; min-height: 220px; margin-top: var(--s-5); }
.kontakt__photo .frame__img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1023px) { .kontakt__photo { flex: none; aspect-ratio: 4 / 3; } }

/* service rows: the linked name is a full tap target */
.rows .rows__name > a { display: inline-flex; align-items: center; min-height: 44px; }
/* portrait tiles: the person's name as the tile's label */
.tile__name { font-family: var(--font-text); font-weight: 500; font-size: var(--t-card); line-height: 1.3; letter-spacing: -0.01em; margin: var(--s-4) 0 0; overflow-wrap: anywhere; hyphens: auto; }
/* phones: the contact section fills exactly two screens, the photograph takes what the words leave */
@media (max-width: 639px) {
  body.home #kontakt { min-height: 200svh; display: flex; flex-direction: column; }
  body.home #kontakt > .wrap { flex: 1 0 auto; display: flex; flex-direction: column; }
  body.home #kontakt > .wrap > .fill { flex: 1 0 auto; display: flex; flex-direction: column; }
  body.home #kontakt .span-5 { flex: 1 0 auto; }
  body.home #kontakt .kontakt__photo { flex: 1 0 auto; aspect-ratio: auto; min-height: 256px; }
}
/* the listings section grows with the number of offers Flatfox shows */
main > section#angebote { height: auto !important; min-height: 100svh; }
main > section#angebote > .wrap { height: auto; }
