/* STAGE35AA_MIESZKANIE_INDEX_LOCATION_GALLERY_SOURCE
   Czysty szablon inwestycji mieszkaniowej. Jeden właściciel wizualny: .dh-mi-index. */

body.dh-mi-index-page {
  margin: 0;
  background: #f7f6f1;
}

.dh-mi-index {
  --dh-mi-bg: #f7f6f1;
  --dh-mi-ink: #101a14;
  --dh-mi-muted: rgba(16, 26, 20, 0.68);
  --dh-mi-green: #06452f;
  --dh-mi-border: rgba(16, 26, 20, 0.12);
  --dh-mi-card: rgba(255, 255, 255, 0.88);
  --dh-mi-shadow: 0 24px 70px rgba(12, 28, 18, 0.10);
  box-sizing: border-box;
  width: min(1320px, calc(100% - 72px));
  margin: 0 auto;
  padding: 28px 0 20px;
  color: var(--dh-mi-ink);
  background: var(--dh-mi-bg);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.dh-mi-index__hero,
.dh-mi-index__copy,
.dh-mi-index__media,
.dh-mi-index__media-img,
.dh-mi-index__eyebrow,
.dh-mi-index__title,
.dh-mi-index__lead,
.dh-mi-index__actions,
.dh-mi-index__button,
.dh-mi-index__button-icon,
.dh-mi-index__stats,
.dh-mi-index__stat,
.dh-mi-index__stat-value,
.dh-mi-index__stat-label,
.dh-mi-index__section,
.dh-mi-index__section-head,
.dh-mi-index__section-copy,
.dh-mi-index__section-title,
.dh-mi-index__pills,
.dh-mi-index__pill,
.dh-mi-index__units,
.dh-mi-index__unit,
.dh-mi-index__unit-media,
.dh-mi-index__unit-img,
.dh-mi-index__unit-status,
.dh-mi-index__unit-body,
.dh-mi-index__unit-title,
.dh-mi-index__unit-meta,
.dh-mi-index__unit-price,
.dh-mi-index__unit-link,
.dh-mi-index__unit-link-icon,
.dh-mi-index__location,
.dh-mi-index__location-copy,
.dh-mi-index__location-title,
.dh-mi-index__location-text,
.dh-mi-index__location-list,
.dh-mi-index__location-media,
.dh-mi-index__location-img,
.dh-mi-index__location-gallery,
.dh-mi-index__location-gallery-item,
.dh-mi-index__location-gallery-img,
.dh-mi-index__location-map,
.dh-mi-index__location-map-img,
.dh-mi-index__location-map-link,
.dh-mi-index__list-item,
.dh-mi-index__info,
.dh-mi-index__info-card,
.dh-mi-index__info-title,
.dh-mi-index__info-list {
  box-sizing: border-box;
}

.dh-mi-index__title,
.dh-mi-index__section-title,
.dh-mi-index__location-title,
.dh-mi-index__info-title,
.dh-mi-index__unit-title,
.dh-mi-index__stat-value {
  margin: 0;
  color: var(--dh-mi-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.055em;
}

.dh-mi-index__hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(350px, 0.82fr) minmax(620px, 1.38fr);
  align-items: center;
  gap: 0;
  background: var(--dh-mi-bg);
}

.dh-mi-index__copy {
  min-width: 0;
  padding: 20px 36px 10px 0;
  position: relative;
  z-index: 3;
  background: var(--dh-mi-bg);
}

.dh-mi-index__eyebrow {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--dh-mi-green);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.dh-mi-index__eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
}

.dh-mi-index__title {
  max-width: 500px;
  font-size: clamp(3.25rem, 4.5vw, 5.2rem);
  line-height: 0.92;
}

.dh-mi-index__lead {
  max-width: 500px;
  margin: 18px 0 0;
  color: var(--dh-mi-muted);
  font-size: 0.98rem;
  line-height: 1.62;
}

.dh-mi-index__actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.dh-mi-index__button {
  min-height: 50px;
  padding: 0 26px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #fff;
  background: var(--dh-mi-green);
  border: 1px solid var(--dh-mi-green);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 18px 42px rgba(6, 69, 47, 0.18);
}

.dh-mi-index__button--light {
  color: var(--dh-mi-ink);
  background: #fff;
  border-color: var(--dh-mi-border);
  box-shadow: none;
}

.dh-mi-index__button--outline {
  color: #fff;
  background: transparent;
  border-color: rgba(255,255,255,0.45);
  box-shadow: none;
}

.dh-mi-index__media {
  height: 520px;
  margin: 0;
  position: relative;
  overflow: hidden;
  background: var(--dh-mi-bg);
  isolation: isolate;
}

.dh-mi-index__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, var(--dh-mi-bg) 0%, rgba(247, 246, 241, 0.94) 7%, rgba(247, 246, 241, 0.62) 15%, rgba(247, 246, 241, 0.26) 24%, rgba(247, 246, 241, 0) 32%);
}

.dh-mi-index__media-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  position: relative;
  z-index: 1;
}

.dh-mi-index__stats {
  width: min(1080px, calc(100% - 180px));
  margin: -132px auto 0;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

.dh-mi-index__stat {
  min-height: 106px;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--dh-mi-border);
  border-radius: 16px;
  box-shadow: var(--dh-mi-shadow);
}

.dh-mi-index__stat-value {
  font-size: clamp(1.18rem, 1.75vw, 1.68rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.dh-mi-index__stat-label {
  color: var(--dh-mi-muted);
  font-size: 0.82rem;
  line-height: 1.15;
}

.dh-mi-index__section { margin-top: -54px; }

.dh-mi-index__section-head {
  margin-bottom: 12px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.dh-mi-index__section-title,
.dh-mi-index__location-title {
  font-size: clamp(2.1rem, 3.1vw, 3.2rem);
  line-height: 0.98;
}

.dh-mi-index__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.dh-mi-index__pill {
  min-height: 38px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--dh-mi-border);
  background: rgba(255,255,255,0.75);
  font-weight: 900;
  cursor: pointer;
}

.dh-mi-index__pill.is-active {
  color: #fff;
  background: var(--dh-mi-green);
}

.dh-mi-index__units {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.dh-mi-index__unit {
  overflow: hidden;
  border-radius: 18px;
  background: var(--dh-mi-card);
  border: 1px solid var(--dh-mi-border);
  box-shadow: 0 18px 48px rgba(12, 28, 18, 0.08);
}

.dh-mi-index__unit[hidden] { display: none; }

.dh-mi-index__unit-media {
  height: 215px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fbfaf7;
  position: relative;
}

.dh-mi-index__unit-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.dh-mi-index__unit-status {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 7px 12px;
  border-radius: 999px;
  color: #ffffff;
  background: #4b5563;
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dh-mi-index__unit.is-reserved {
  background: rgba(229, 231, 235, 0.92);
  border-color: rgba(107, 114, 128, 0.32);
  box-shadow: 0 14px 38px rgba(31, 41, 55, 0.08);
}

.dh-mi-index__unit.is-reserved .dh-mi-index__unit-media {
  background: #e5e7eb;
}

.dh-mi-index__unit.is-reserved .dh-mi-index__unit-img {
  opacity: 0.56;
  filter: grayscale(1);
}

.dh-mi-index__unit.is-reserved .dh-mi-index__unit-title,
.dh-mi-index__unit.is-reserved .dh-mi-index__unit-price {
  color: #374151;
}

.dh-mi-index__unit.is-reserved .dh-mi-index__unit-link {
  color: #374151;
  border-color: rgba(75, 85, 99, 0.32);
  background: rgba(255, 255, 255, 0.72);
}

.dh-mi-index__unit-body { padding: 22px; }

.dh-mi-index__unit-title {
  font-size: 1.32rem;
  line-height: 1.12;
}

.dh-mi-index__unit-meta {
  min-height: 42px;
  margin: 10px 0 16px;
  color: var(--dh-mi-muted);
  line-height: 1.45;
}

.dh-mi-index__unit-price {
  display: block;
  margin-bottom: 18px;
  color: var(--dh-mi-green);
  font-size: 1.35rem;
  font-weight: 950;
}

.dh-mi-index__unit-link {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--dh-mi-green);
  border: 1px solid rgba(6, 69, 47, 0.28);
  text-decoration: none;
  font-weight: 900;
  background: rgba(255,255,255,0.78);
}

.dh-mi-index__location {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 0.78fr 1.5fr;
  align-items: start;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--dh-mi-border);
  box-shadow: 0 20px 54px rgba(12, 28, 18, 0.08);
}

.dh-mi-index__location--has-map {
  grid-template-columns: 0.76fr 1.1fr 0.78fr;
}

.dh-mi-index__location-copy { padding: 20px 28px 16px; }

.dh-mi-index__location .dh-mi-index__eyebrow { margin-bottom: 10px; }

.dh-mi-index__location-title { font-size: clamp(1.8rem, 2.45vw, 2.55rem); }

.dh-mi-index__location-text {
  margin: 10px 0 0;
  font-size: 0.86rem;
  line-height: 1.38;
}

.dh-mi-index__list-item {
  color: var(--dh-mi-muted);
  font-size: 0.78rem;
  line-height: 1.34;
}

.dh-mi-index__location-list {
  margin: 10px 0 0;
  padding-left: 16px;
}

.dh-mi-index__location-media,
.dh-mi-index__location-map { min-height: 220px; }

.dh-mi-index__location-img,
.dh-mi-index__location-map-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dh-mi-index__location-media--gallery {
  padding: 5px;
  background: #fbfaf7;
}

.dh-mi-index__location-gallery {
  min-height: 210px;
  height: 210px;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.dh-mi-index__location-gallery-item {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #e7e8e1;
}

.dh-mi-index__location-gallery-item:first-child {
  grid-row: 1 / span 2;
}

.dh-mi-index__location-gallery-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.dh-mi-index__location-map {
  position: relative;
  overflow: hidden;
  background: #edf2e9;
}

.dh-mi-index__location-map-link {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--dh-mi-green);
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--dh-mi-border);
  text-decoration: none;
  font-weight: 900;
  box-shadow: 0 14px 34px rgba(12, 28, 18, 0.10);
}

.dh-mi-index__info {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.dh-mi-index__info-card {
  padding: 22px 24px;
  border-radius: 16px;
  background: rgba(255,255,255,0.88);
  border: 1px solid var(--dh-mi-border);
}

.dh-mi-index__info-title {
  margin-bottom: 9px;
  font-size: 1.24rem;
}

.dh-mi-index__info-list {
  margin: 0;
  padding-left: 18px;
  color: var(--dh-mi-muted);
  font-size: 0.82rem;
  line-height: 1.42;
}

@media (max-width: 1180px) {
  .dh-mi-index { width: min(100% - 48px, 1320px); }
  .dh-mi-index__hero,
  .dh-mi-index__location,
  .dh-mi-index__location--has-map { grid-template-columns: 1fr; }
  .dh-mi-index__copy { padding: 42px 28px 30px; }
  .dh-mi-index__media { height: 420px; }
  .dh-mi-index__stats,
  .dh-mi-index__units,
  .dh-mi-index__info { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dh-mi-index__stats { margin: 24px 0 var(--dh-mi-section-gap, 12px); } /* STAGE35CN_07B/07C: was 48px moat */
  .dh-mi-index__section { margin-top: 0; }
}

@media (max-width: 720px) {
  .dh-mi-index { width: min(100% - 28px, 1320px); padding-top: 22px; }
  .dh-mi-index__title { font-size: 3.25rem; }
  .dh-mi-index__stats,
  .dh-mi-index__units,
  .dh-mi-index__info { grid-template-columns: 1fr; }
  .dh-mi-index__section-head { align-items: stretch; flex-direction: column; }
  .dh-mi-index__location-gallery { grid-template-columns: 1fr; grid-template-rows: none; height: auto; min-height: auto; }
  .dh-mi-index__location-gallery-item,
  .dh-mi-index__location-gallery-item:first-child { min-height: 180px; grid-row: auto; }
}

/* STAGE35CN_06 — text overflow / card resilience.
   Additive only: min-width:0 lets flex/grid children shrink; overflow-wrap wraps
   text that would otherwise overflow. No existing layout property is changed. */
.dh-mi-index__unit,
.dh-mi-index__unit-body,
.dh-mi-index__stat { min-width: 0; }

.dh-mi-index__unit-title,
.dh-mi-index__unit-meta,
.dh-mi-index__unit-price,
.dh-mi-index__stat-value,
.dh-mi-index__stat-label {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.dh-mi-index__unit-status {
  max-width: calc(100% - 28px);
  overflow-wrap: anywhere;
  word-break: normal;
}

/* STAGE35CN_07B_MIESZKANIE_INDEX_GENERIC_TEMPLATE_AND_SPACING_FIX
   Spacing normalization: give the big sections one consistent vertical gap.
   Hero-overlap negatives (stats -132px / section -54px) are left untouched. */

/* STAGE35CN_07C_MIESZKANIE_INDEX_TIGHT_SECTION_SPACING_VISUAL_FIX
   07B reduced the gap technically but it still read too loose ("moat"). Tighten the section
   gap to 12px so the big white cards stack like the detail page — short, even spacing. */
.dh-mi-index { --dh-mi-section-gap: 12px; }

.dh-mi-index__location { margin-top: var(--dh-mi-section-gap); }
.dh-mi-index__info { margin-top: var(--dh-mi-section-gap); }

@media (max-width: 720px) {
  .dh-mi-index__location,
  .dh-mi-index__info { margin-top: var(--dh-mi-section-gap); }
}

/* STAGE35DA_MOKRZYSKA_LOCATION_IMAGE_FIT_START */
/*
  STAGE35DA:
  Location gallery images in MIESZKANIE_INWESTYCJA_INDEX must not be aggressively cropped.
  Mokrzyska uses wide drone/location photos, so the template has to show the full frame.
  This is a template-level rule, not an investment-specific selector.
*/

.dh-mi-index__location-media--gallery {
  background: #fbfaf7 !important;
}

.dh-mi-index__location-gallery-item {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #fbfaf7 !important;
}

.dh-mi-index__location-gallery-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #fbfaf7 !important;
}
/* STAGE35DA_MOKRZYSKA_LOCATION_IMAGE_FIT_END */

/* STAGE35DB_MOKRZYSKA_LOCATION_GALLERY_LAYOUT_START */
/*
  MIESZKANIE_INWESTYCJA_INDEX
  Location gallery layout:
  one large image + two smaller stacked images.
  This is a template-level gallery fit, not an investment-specific DOM hack.
*/

.dh-mi-index__location-media,
.dh-mi-index__location-map {
  min-height: 360px !important;
}

.dh-mi-index__location-media--gallery {
  min-height: 360px !important;
  padding: 8px !important;
  background: #fbfaf7 !important;
  overflow: hidden !important;
}

.dh-mi-index__location-gallery {
  width: 100% !important;
  min-height: 344px !important;
  height: clamp(330px, 30vw, 410px) !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1.65fr) minmax(150px, 0.78fr) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.dh-mi-index__location-gallery-item {
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border-radius: 14px !important;
  background: #e7e8e1 !important;
}

.dh-mi-index__location-gallery-item:first-child {
  grid-column: 1 !important;
  grid-row: 1 / span 2 !important;
}

.dh-mi-index__location-gallery-img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  object-position: center center !important;
}

.dh-mi-index__location-gallery-item:first-child .dh-mi-index__location-gallery-img {
  object-position: center center !important;
}

@media (max-width: 1180px) {
  .dh-mi-index__location-media,
  .dh-mi-index__location-map {
    min-height: 320px !important;
  }

  .dh-mi-index__location-gallery {
    min-height: 310px !important;
    height: clamp(300px, 42vw, 380px) !important;
  }
}

@media (max-width: 720px) {
  .dh-mi-index__location-media--gallery {
    min-height: auto !important;
  }

  .dh-mi-index__location-gallery {
    height: auto !important;
    min-height: auto !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
  }

  .dh-mi-index__location-gallery-item,
  .dh-mi-index__location-gallery-item:first-child {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .dh-mi-index__location-gallery-item:first-child {
    min-height: 260px !important;
  }

  .dh-mi-index__location-gallery-item:not(:first-child) {
    min-height: 170px !important;
  }
}
/* STAGE35DB_MOKRZYSKA_LOCATION_GALLERY_LAYOUT_END */
