/*
 * Diaz Immobilien — brand overrides.
 *
 * Loaded last (priority 80), so anything here wins over base.css, theme.css
 * and fonts.css. Holds the brand's design tokens (typography, colors,
 * radii, spacing), the heading/typography scale, link colors, and a
 * few defensive rules to keep the page surface flat.
 */

/* ---------- Type system ---------- */

:root {
  /* Body type — Inter at a relaxed 400 weight, like the reference sites. */
  --diaz-font-family-sans-serif: "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --diaz-font-family-serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --diaz-font-family-monospace: ui-monospace, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --diaz-font-size: 100%;
  --diaz-font-weight: 400;
  --diaz-line-height: 1.6;
  --diaz-border-radius: 0.5rem;
  --diaz-spacing: 1.1rem;

  /* Brand-tinted neutrals — clean off-white surface, near-black text. */
  --diaz-background-color: #ffffff;
  --diaz-color: #1a1a1a;
  --diaz-muted-color: #6b6b6b;
  --diaz-muted-border-color: #ececea;
  --diaz-h1-color: #1a1a1a;
  --diaz-h2-color: #1a1a1a;
  --diaz-h3-color: #1a1a1a;
  --diaz-h4-color: #1a1a1a;
  --diaz-h5-color: #1a1a1a;
  --diaz-h6-color: #6b6b6b;
  --diaz-card-background-color: #ffffff;
  --diaz-card-border-color: #ececea;
  --diaz-card-box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
                          0 8px 24px -12px rgba(15, 23, 42, 0.06);
  --diaz-card-sectioning-background-color: #fafaf8;

  --diaz-form-element-background-color: #ffffff;
  --diaz-form-element-border-color: #d4d4d2;
  --diaz-form-element-color: #1a1a1a;
  --diaz-form-element-placeholder-color: #a0a09e;
  --diaz-form-element-active-background-color: #ffffff;
  --diaz-form-element-active-border-color: #1a1a1a;
  --diaz-form-element-focus-color: rgba(159, 27, 45, 0.20);

  --diaz-del-color: #c43030;
}

/* Headings — h1 and h2 use Playfair Display for a premium editorial feel.
   h3–h6 stay in Inter to keep the document body type coherent. */
h1, h2 {
  font-family: var(--diaz-font-family-serif);
  font-weight: 500;
  letter-spacing: -0.005em;
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: 0.6em;
}
h3, h4, h5, h6 {
  font-family: var(--diaz-font-family-sans-serif);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 0.6em;
}
h1 {
  font-size: clamp(1.875rem, 1.5rem + 1.5vw, 2.625rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
}
h2 {
  font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
  font-weight: 500;
  line-height: 1.2;
}
h3 {
  font-size: 1.25rem;
  font-weight: 600;
}
h4 { font-size: 1.0625rem; font-weight: 600; }
h5 { font-size: 0.9375rem; font-weight: 600; }
h6 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--diaz-muted-color);
}

p, li, dd {
  color: var(--diaz-color);
}

/* Body type — slightly larger, more open line-height, narrow max-width
   for editorial-style measure. Pico's default 16/1.5 is too dense. */
body {
  font-size: 1.0625rem;  /* 17px */
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.lead {
  font-size: 1.1875rem;  /* 19px */
  font-weight: 300;
  color: var(--diaz-muted-color);
  line-height: 1.55;
  letter-spacing: -0.005em;
  max-width: 56ch;
  margin-bottom: 2rem;
}

a {
  color: var(--diaz-primary);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--diaz-primary-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Pico defaults hyperlinks to its azure (#0172ad). Force the brand red
   everywhere a link appears in body content, so the page doesn't end up
   with a mix of red CTA + blue inline links. */
.diaz-content a:not(.diaz-btn):not(.diaz-cta-btn),
.diaz-content__body a:not(.diaz-btn):not(.diaz-cta-btn) {
  color: #9F1B2D;
  text-decoration: none;
  border-bottom: 1px solid rgba(159, 27, 45, 0.25);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.diaz-content a:not(.diaz-btn):not(.diaz-cta-btn):hover,
.diaz-content__body a:not(.diaz-btn):not(.diaz-cta-btn):hover {
  color: #7F1422;
  border-bottom-color: #7F1422;
}

/* Skip-link */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 1000;
  padding: 0.5rem 1rem;
  background: var(--diaz-primary);
  color: var(--diaz-primary-inverse);
  border-radius: var(--diaz-border-radius);
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* Page wrapper for sticky footer */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }

body, main, #main, #body-wrapper, .diaz-content, .diaz-content__header, .diaz-content__body {
  background: #ffffff;
}

/* =========================================================================
 * W² 1722 landingpage
 * =========================================================================
 * Scoped under .diaz-w2-* to avoid collisions with the property detail
 * styles.

   Hero: full-bleed background image at the top (height matches the
   homepage .diaz-hero--image — clamp(540px, 78vh, 820px)) followed by a
   centered content block below the image. The content block holds the
   W² SVG logo (the title image), the page title, subtitle and primary
   CTA. The logo sits BELOW the big image, not on top of it.

   Body: page.content is wrapped in .diaz-content / .diaz-content__body so
   it uses the same 750px centered column as the other regular text pages
   (Über uns, Leistungen, AGB, etc.). The markdown tables are restyled to
   a card-grid label/value look and the bullet lists become pill chips.

   Gallery: three grouped sections that open a shared fullscreen lightbox
   in which the image is shown uncropped (object-fit: contain).
 * ========================================================================= */

/* ---- Hero (image + content) ---- */

.diaz-w2-hero {
  position: relative;
  background: #ffffff;
}
.diaz-w2-hero__image {
  position: relative;
  min-height: clamp(540px, 78vh, 820px);
  background-color: #1a1f24;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.diaz-w2-hero__content {
  /* Light cream background so the logo + headline block sits in its own
     band, visually separated from the photo above and the white body
     below. No overlay, no negative margins. */
  background: var(--diaz-card-sectioning-background-color, #fafaf8);
  border-bottom: 1px solid var(--diaz-muted-border-color);
  padding-block: clamp(2.5rem, 5vw, 4.5rem);
}
.diaz-w2-hero__inner {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.diaz-w2-hero__eyebrow {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--diaz-primary);
  background: var(--diaz-accent-soft, rgba(159, 27, 45, 0.08));
  border-radius: 999px;
}
.diaz-w2-hero__logo {
  display: block;
  width: clamp(220px, 40vw, 460px);
  max-width: 100%;
  height: auto;
  margin-top: 0.25rem;
}
.diaz-w2-hero__title {
  font-family: var(--diaz-font-family-serif);
  font-weight: 500;
  font-size: clamp(1.5rem, 1rem + 1.6vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--diaz-h1-color);
  margin: 0;
}
.diaz-w2-hero__subtitle {
  font-size: clamp(1rem, 0.9rem + 0.3vw, 1.125rem);
  font-weight: 300;
  letter-spacing: 0.01em;
  color: var(--diaz-muted-color);
  margin: 0;
  max-width: 32rem;
  line-height: 1.5;
}
.diaz-w2-hero__ctas {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* ---- Body content (markdown rendered inside .diaz-content__body) ---- */
/* The container/width comes from .diaz-content (max-width 750px,
   margin-inline: auto) defined in theme.css — same as /ueber-uns, etc. */

.diaz-w2-body {
  background: #ffffff;
}
.diaz-w2-body .diaz-content {
  padding-block: clamp(3rem, 5vw, 5.5rem);
}
.diaz-w2-body h2 {
  margin-top: 2.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--diaz-muted-border-color);
}
.diaz-w2-body > .diaz-content > .diaz-content__body > h2:first-child {
  margin-top: 0;
}
.diaz-w2-body p {
  margin-block: 0 1.4em;
}
.diaz-w2-body strong {
  color: var(--diaz-h1-color);
}

/* Tables — render as a clean 2-col label/value grid */
.diaz-w2-body table {
  display: block;
  width: 100%;
  margin: 1rem 0 1.75rem;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--diaz-card-background-color);
  border: 1px solid var(--diaz-muted-border-color);
  border-radius: var(--diaz-border-radius);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.diaz-w2-body table thead,
.diaz-w2-body table tbody,
.diaz-w2-body table tr {
  display: block;
  width: 100%;
}
.diaz-w2-body table tr {
  display: grid;
  grid-template-columns: minmax(0, 12rem) 1fr;
  border-bottom: 1px solid var(--diaz-muted-border-color);
}
.diaz-w2-body table tr:last-child {
  border-bottom: 0;
}
.diaz-w2-body table th,
.diaz-w2-body table td {
  display: block;
  padding: 0.7rem 1rem;
  text-align: left;
  border: 0;
}
.diaz-w2-body table th {
  font-weight: 500;
  color: var(--diaz-muted-color);
  background: var(--diaz-card-sectioning-background-color);
  border-right: 1px solid var(--diaz-muted-border-color);
}
.diaz-w2-body table td {
  font-weight: 500;
  color: var(--diaz-h1-color);
}
@media (max-width: 560px) {
  .diaz-w2-body table tr {
    grid-template-columns: 1fr;
  }
  .diaz-w2-body table th {
    border-right: 0;
    border-bottom: 1px solid var(--diaz-muted-border-color);
    padding-bottom: 0.4rem;
  }
}

/* Bullet lists — render as pill chips */
.diaz-w2-body ul {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.5rem;
}
.diaz-w2-body ul li {
  padding: 0.4rem 0.85rem;
  background: var(--diaz-card-sectioning-background-color);
  border: 1px solid var(--diaz-muted-border-color);
  border-radius: 999px;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--diaz-color);
}

/* Hr separators (none in current body, but defensively) */
.diaz-w2-body hr {
  border: 0;
  border-top: 1px solid var(--diaz-muted-border-color);
  margin: 2.5rem 0;
}

/* ---- Gallery (thumb grid) ---- */

.diaz-w2-bildergalerie {
  background: var(--diaz-card-sectioning-background-color);
  padding-block: clamp(3rem, 5vw, 5.5rem);
}
.diaz-w2-bildergalerie .diaz-section__header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.diaz-w2-bildergalerie .diaz-section__header .lead {
  margin-left: auto;
  margin-right: auto;
}
.diaz-w2-gallery-group {
  margin-bottom: 3rem;
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: max(1.5rem, var(--diaz-page-pad, 0px));
}
.diaz-w2-gallery-group:last-child {
  margin-bottom: 0;
}
.diaz-w2-gallery-group h3 {
  font-family: var(--diaz-font-family-serif);
  font-weight: 500;
  font-size: clamp(1.25rem, 1rem + 0.6vw, 1.5rem);
  margin: 0 0 1.25rem;
  color: var(--diaz-h1-color);
}
.diaz-w2-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.625rem;
}
.diaz-w2-gallery__item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--diaz-card-sectioning-background-color);
  border: 0;
  border-radius: calc(var(--diaz-border-radius) * 0.75);
  cursor: zoom-in;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.diaz-w2-gallery__item:hover,
.diaz-w2-gallery__item:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -16px rgba(15, 23, 42, 0.35);
  outline: none;
}
.diaz-w2-gallery__item:focus-visible {
  box-shadow: 0 0 0 3px var(--diaz-primary-focus),
              0 10px 24px -16px rgba(15, 23, 42, 0.35);
}
.diaz-w2-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* thumb crop is fine — overlay is uncropped */
  transition: transform 0.3s ease;
}
.diaz-w2-gallery__item:hover img {
  transform: scale(1.04);
}

/* ---- Lightbox dialog (uncropped) ---- */

dialog.diaz-w2-lightbox {
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
}
dialog.diaz-w2-lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
dialog.diaz-w2-lightbox::backdrop {
  background: rgba(8, 12, 18, 0.92);
  backdrop-filter: blur(6px);
}
.diaz-w2-lightbox__img {
  display: block;
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain; /* KEY: never crop the image in the overlay */
  border-radius: 4px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  user-select: none;
  -webkit-user-drag: none;
}
.diaz-w2-lightbox__close,
.diaz-w2-lightbox__nav {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 28, 38, 0.55);
  color: #ffffff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  backdrop-filter: blur(6px);
  z-index: 2;
}
.diaz-w2-lightbox__close:hover,
.diaz-w2-lightbox__nav:hover {
  background: rgba(20, 28, 38, 0.7);
}
.diaz-w2-lightbox__close:focus-visible,
.diaz-w2-lightbox__nav:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
.diaz-w2-lightbox__close {
  top: 1.25rem;
  right: 1.25rem;
  font-size: 1.5rem;
}
.diaz-w2-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.25rem;
  font-weight: 300;
}
.diaz-w2-lightbox__nav:hover {
  transform: translateY(-50%) scale(1.05);
}
.diaz-w2-lightbox__nav--prev { left: 1.25rem; }
.diaz-w2-lightbox__nav--next { right: 1.25rem; }
.diaz-w2-lightbox__nav[hidden] { display: none; }

.diaz-w2-lightbox__counter {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(20, 28, 38, 0.55);
  backdrop-filter: blur(6px);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: #ffffff;
  z-index: 2;
}

/* Smaller nav buttons on narrow viewports so they don't dominate the image */
@media (max-width: 640px) {
  .diaz-w2-lightbox__close,
  .diaz-w2-lightbox__nav {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }
  .diaz-w2-lightbox__nav--prev { left: 0.5rem; }
  .diaz-w2-lightbox__nav--next { right: 0.5rem; }
  .diaz-w2-lightbox__close { top: 0.75rem; right: 0.75rem; }
  .diaz-w2-lightbox__counter { bottom: 0.75rem; }
  .diaz-w2-lightbox__img {
    max-width: 96vw;
    max-height: 84vh;
  }
}

/* Honor user motion preferences */
@media (prefers-reduced-motion: reduce) {
  .diaz-w2-gallery__item,
  .diaz-w2-gallery__item img,
  .diaz-w2-lightbox__close,
  .diaz-w2-lightbox__nav {
    transition: none;
  }
  .diaz-w2-gallery__item:hover img {
    transform: none;
  }
}

/* Body scroll lock while lightbox is open (toggled by JS) */
body.w2-lightbox-open {
  overflow: hidden;
}
