/* ==========================================================================
   OSSA Nieruchomości — homepage sections
   ========================================================================== */

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  overflow: hidden;
}
.hero video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 50%;
}
.hero .hero-search {
  position: absolute;
  left: 50%; bottom: 122px;
  transform: translateX(-50%);
  width: 800px; max-width: calc(100vw - 2 * var(--gutter));
  color: var(--c-white);
  font-family: var(--f-ui);
}
.hero .hs-link { display: block; cursor: pointer; }
.hero .hs-box {
  display: flex;
  align-items: center;
  background: var(--c-beige-15);
  border: 1px solid rgba(255, 255, 255, 0.45);
  min-height: 96px;
  transition: background 0.3s ease;
}
.hero .hs-box:hover { background: rgba(203, 196, 188, 0.25); }
.hero .hs-main { flex: 1; padding: 1rem; display: flex; flex-direction: column; justify-content: center; }
.hero .hs-label { font-size: 16px; margin-bottom: 8px; opacity: 0.9; }
.hero .hs-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.6rem 1rem;
  font-size: 14px;
  color: var(--c-white);
  display: flex; align-items: center;
}
.hero .hs-btn {
  width: 80px; height: 96px; flex: none;
  border-left: 1px solid rgba(255, 255, 255, 0.45);
  display: flex; align-items: center; justify-content: center;
  color: var(--c-white);
}
.hero .hs-btn svg { width: 24px; height: 24px; transition: transform 0.2s ease; }
.hero .hs-link:hover .hs-btn svg { transform: scale(1.15); }

@media (max-width: 809px) {
  /* original mobile hero is a tall portrait video block (375x921) */
  .hero { height: auto; aspect-ratio: 375 / 921; min-height: 0; }
  .hero .hero-search { bottom: 30%; }
  .hero .hs-box { min-height: 84px; }
}

/* ---------- Shared section scaffolding ---------- */
.section { padding: 40px var(--gutter) 60px; }

.section .section-title { margin-bottom: 21px; }

/* ---------- Latest offers grid ---------- */
.latest-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px var(--grid-gap);
}
@media (min-width: 1200px) { .latest-grid { column-gap: 29.5px; } }
@media (max-width: 1199px) and (min-width: 810px) { .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* original mobile shows the latest offers as one full-width column,
   tight under the hero (title +10, cards +42) with a 17px side gutter */
@media (max-width: 809px) {
  .latest-grid { grid-template-columns: minmax(0, 1fr); margin: 0 -3px; row-gap: 11px; }
  .section { padding-top: 10px; }
  .section > .section-title { text-align: center; margin-bottom: 13px; }
}

/* ---------- Premium (Starannie wyselekcjonowane oferty) ---------- */
.premium { padding: 40px var(--gutter) 80px; }
.premium .section-title { margin-bottom: 30px; }
.premium-inner { display: flex; }
.premium-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 0;
  flex: 1 1 50%;
}
.premium-tiles a { position: relative; overflow: hidden; aspect-ratio: 335 / 199; background: #000; }
.premium-tiles--two { grid-template-rows: 1fr; }
.premium-tiles--two a { aspect-ratio: 703 / 866; }
.premium-tiles img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.05);
  transition: transform 0.7s cubic-bezier(0.44, 0, 0.56, 1);
}
.premium-tiles a:hover img { transform: scale(1.12); }
.premium-tiles img { transition: opacity 0.4s ease, transform 0.7s cubic-bezier(0.44, 0, 0.56, 1); }
.premium-tiles.is-loading img { opacity: 0; }
.premium-panel {
  flex: 1 1 50%;
  background: rgba(203, 196, 188, 0.8);
  display: flex; flex-direction: column;
  align-items: stretch; justify-content: flex-start;
  padding: 62px 32px 50px;
  gap: 54px;
}
.premium-panel .t-section { text-align: center; }
.premium-panel p { text-align: left; color: var(--c-text-70); }
.premium-panel .btn { align-self: flex-start; }
@media (max-width: 1199px) {
  .premium-inner { flex-direction: column; }
  .premium-panel { padding: 40px 30px; }
}
@media (max-width: 809px) {
  /* original mobile premium: centered title, one row of two tiles, left CTA */
  .premium > .section-title { text-align: center; margin-bottom: 13px; }
  .premium-tiles { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .premium-tiles a { aspect-ratio: 254 / 200; }
  .premium-tiles a:nth-child(n + 3) { display: none; }
  .premium-panel { align-items: flex-start; padding-left: 20px; padding-right: 20px; }
  .premium-panel .t-section { white-space: nowrap; font-size: min(22px, calc((100vw - 80px) / 16)); }
  /* award logos + footer sit higher: less air between the blog list and them */
  main > .blog-list:not(.blog-page) { padding-bottom: 16px; }
  main > .awards { padding-top: 8px; }
}

/* ---------- Details sections ---------- */
.details {
  display: flex;
  align-items: center;
  gap: 60px;
  padding: 40px var(--gutter);
}

.details .d-media { flex: none; overflow: hidden; }
.details .d-media--photo { width: 469px; }
.details .d-media--photo img { width: 100%; height: auto; }
.details .d-media--video { width: 459px; height: 687px; }
.details .d-media--video video { width: 100%; height: 100%; object-fit: cover; }
.details .d-inner { max-width: 839px; display: flex; flex-direction: column; gap: 24px; }
.details .d-inner .d-content { display: flex; flex-direction: column; gap: 16px; }
.details .d-inner > .btn { align-self: flex-start; }
.details--center { justify-content: space-between; }
.details--center .d-inner { max-width: 839px; margin-left: auto; }
.details--right .d-inner { max-width: 776px; margin-left: 20px; margin-right: auto; }
.details--left .d-inner { max-width: 776px; margin-left: 60px; }

@media (max-width: 1199px) {
  .details { flex-direction: column; align-items: flex-start; gap: 32px; }
  .details .d-media--photo, .details .d-media--video { width: 100%; height: auto; }
  .details .d-media--video { max-height: 70vh; }
  .details .d-inner { margin: 0 !important; }
}
@media (max-width: 809px) {
  /* original mobile: full-bleed media blocks, indented text, media above the
     text for the "quality" section, justified copy in the selling section */
  .details { align-items: stretch; }
  .details .d-media--photo,
  .details .d-media--video { width: 100vw; margin-left: calc(-1 * var(--gutter)) !important; }
  .details .d-media--photo { height: 629px; }
  .details .d-media--photo img { height: 100%; object-fit: cover; }
  .details .d-media--video { height: 650px; max-height: none; }
  .details:has(.details--right-inner) { flex-direction: column-reverse; }
  .details .d-inner { padding: 0 20px; }
  .details .details--right-inner { padding: 0 50px; }
  .details .btn { align-self: flex-start; margin-left: 18px; }
  .details--left-inner .d-content p { text-align: justify; }
}
@media (max-width: 809px) {
  .details--left-inner .d-content p { text-align: left; }
}

/* ---------- Contact form ---------- */
.home-form {
  display: flex;
  gap: 50px;
  padding: 50px var(--gutter);
  align-items: center;
}
@media (min-width: 1200px) { main > .home-form { padding-left: max(0px, calc((100% - 1440px) / 2)); padding-right: max(0px, calc((100% - 1440px) / 2)); } }
.form-field input::placeholder, .form-field textarea::placeholder { color: #000; }
.home-form .hf-title { flex: 1 1 50%; text-align: center; }
.home-form form { flex: 1 1 50%; display: flex; flex-direction: column; }
.form-field { position: relative; border-bottom: 1px solid var(--c-text-30); }
.form-row { display: flex; gap: 40px; }
.form-row .form-field { flex: 1; }
.form-field input, .form-field textarea {
  width: 100%;
  background: transparent;
  border: none; outline: none;
  padding: 18px 0 12px;
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--c-text);
}
.form-field input, .form-field textarea { color: #000; }
.form-field textarea { resize: none; min-height: 76px; }
.home-form .form-submit {
  margin-top: 26px;
  background: var(--c-dark);
  color: var(--c-white);
  padding: 12px 20px;
  text-align: center;
  width: 100%;
  transition: opacity 0.25s ease;
}
.home-form .form-submit:hover { opacity: 0.9; }
@media (max-width: 1199px) {
  .home-form { flex-direction: column; align-items: stretch; }
  .home-form .hf-title { text-align: left; }
}
@media (max-width: 809px) {
  /* mobile: centered title, every field (name, phone + email, message) and the
     submit share the same left and right edge */
  .home-form .hf-title { text-align: center; }
  .home-form form { padding: 0 20px; }
  .home-form form > .form-field:has(input) { margin: 0; }
  .form-row { flex-direction: row; gap: 20px; margin: 0; }
  .form-row .form-field { margin: 0; }
}

/* ---------- Blog list ---------- */
.blog-list { padding: 50px var(--gutter); }
.blog-list .section-title { margin-bottom: 36px; }
@media (min-width: 1200px) { .blog-list:not(.blog-page) .section-title { margin-bottom: 8px; } }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--grid-gap);
}
.blog-card { display: flex; flex-direction: column; }
.blog-card .bc-media { overflow: hidden; aspect-ratio: 443 / 527; }
/* the original's blog photos are portrait and run ~10px past the text columns */
/* the original clips the photo to the 432px text column, zoomed 1.05 inside */
.blog-card .bc-media img { transform: scale(1.05); }
.blog-card .bc-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.44, 0, 0.56, 1);
}
.blog-card:hover .bc-media img { transform: scale(1.1); }
.blog-card .bc-date { margin-top: 16px; color: #000; }
.blog-card .bc-title { margin-top: 8px; line-height: 1.3em; }
.blog-card .bc-title a:hover { color: var(--c-orange); }
.blog-list .bl-more { display: flex; justify-content: center; margin-top: 40px; }
@media (max-width: 1199px) and (min-width: 810px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 809px) {
  .blog-grid { grid-template-columns: 1fr; }
  /* homepage blog strip: text inset 40px; the photo is clipped to the 295px column
     and zoomed 1.05 inside (the 310x369 the original reports) */
  .blog-list { padding-left: 40px; padding-right: 40px; }
  .blog-card .bc-media { aspect-ratio: 295 / 351; margin: 0; }
  .blog-card .bc-date { margin-top: 20px; }
  .blog-card .bc-title { margin-top: 6px; line-height: 20px; }
  /* the blog index page runs wider: 335x399 column at x20 (352x419 zoomed) */
  .blog-page { padding-left: 20px; padding-right: 20px; padding-top: 140px; }
  .blog-page .blog-grid { gap: 42px; }
  .blog-page .bc-media { aspect-ratio: 335 / 399; margin: 0; }
}

/* ---------- Awards strip ---------- */
.awards { display: flex; justify-content: center; padding: 18px var(--gutter) 16px; }
.awards img { height: 156px; width: auto; }
@media (max-width: 809px) { .awards img { height: 125px; } }

/* ---------- Desktop containers (placed last so they win over the base rules) ----------
   the original centres latest / premium / office in a 1340px column and the
   quality / selling blocks in the 1440px column with 70px inner padding */
@media (min-width: 1200px) {
  .details { padding: 70px max(var(--gutter), calc((100% - 1440px) / 2 + 70px)); gap: 50px; }
  .details:has(.details--left-inner) { padding-top: 17px; padding-bottom: 17px; }
  .details--center { padding-top: 70px; padding-bottom: 70px; }
  .details .d-media--photo { width: 436px; height: 602px; }
  .details .d-media--photo img { height: 100%; object-fit: contain; }
  .details .d-inner { max-width: 854px; }
  .details .details--right-inner, .details .details--left-inner { max-width: 791px; margin-left: 0 !important; }
  .details .d-inner .d-content p { color: var(--c-text-70); }
  .details .details--left-inner .d-content p { text-align: justify; }
}
@media (min-width: 1200px) {
  .section:has(> .latest-grid), .premium { padding-left: max(var(--gutter), calc((100% - 1340px) / 2)); padding-right: max(var(--gutter), calc((100% - 1340px) / 2)); }
}
@media (min-width: 1200px) {
  .details--center { padding-left: max(var(--gutter), calc((100% - 1340px) / 2)); padding-right: max(var(--gutter), calc((100% - 1340px) / 2)); }
}

/* ---------- Desktop spacing measured against the original ---------- */
@media (min-width: 1200px) {
  .premium { padding-top: 33px; }
  .details .d-inner { gap: 19px; }
  .details .d-inner .d-content { gap: 20px; }
  .details .d-inner > .btn { margin-top: 21px; }
  .details .details--left-inner > .btn { margin-top: 0; }
  .home-form .form-row { gap: 10px; }
  .home-form .form-field input, .home-form .form-field textarea { padding-left: 10px; }
  main > .home-form { padding-top: 25px; padding-bottom: 16px; align-items: flex-start; }
  main > .home-form .hf-title { margin-top: 39px; }
  .home-form .form-submit { padding-top: 13px; padding-bottom: 13px; }
  .blog-list { padding-bottom: 40px; }
  .blog-list:not(.blog-page) .section-title { margin-bottom: 4px; }
  .blog-list:not(.blog-page) .bc-media { aspect-ratio: 432 / 514; }
  .blog-card .bc-date { margin-top: 20px; }
  .blog-card .bc-title { margin-top: 6px; line-height: 20px; }
  .blog-list:not(.blog-page) .bl-more { margin-top: 11px; }
}

/* blog index: 4 columns of 316px, photo clipped to the column (1.05 zoom), centred title */
@media (min-width: 1200px) {
  .blog-page { padding: 123px var(--gutter) 87px; }
  .blog-page .section-title { text-align: center; margin-bottom: 15.5px; }
  .blog-page .blog-grid { grid-template-columns: repeat(4, 1fr); column-gap: 30px; row-gap: 36.5px; }
  .blog-page .bc-media { aspect-ratio: 316 / 376; }
}
