/* ==========================================================================
   OSSA — static content pages (about, contact, services, join-us, legal…)
   ========================================================================== */

/* Full-bleed page hero (image or video) */
.page-hero {
  position: relative;
  height: 70vh;
  min-height: 420px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.page-hero--video { height: 100vh; }
.page-hero .ph-img, .page-hero video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.page-hero .ph-overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.25);
}
.page-hero .ph-title {
  position: relative;
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 44px;
  line-height: 1.1;
  color: var(--c-white);
  margin: 0 var(--gutter) 60px;
}
.page-hero .ph-center {
  position: relative;
  width: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  gap: 14px;
  margin-bottom: 0;
  align-self: center;
}
.page-hero .ph-center .ph-title { margin: 0; }
.page-hero .ph-sub { color: var(--c-white-70); }
@media (max-width: 809px) {
  .page-hero .ph-title { font-size: 30px; margin-bottom: 40px; }
}

/* Simple heading block for pages without hero */
.static-head { padding: 140px var(--gutter) 20px; }
.static-head .sh-sub { max-width: 760px; margin-top: 16px; }

/* About — hero copy on the right, stacked office text, value cards with tall
   photos and justified text, a 3-photo gallery row behind "Pokaż więcej",
   a rounded greyscale map and the testimonials as a quoted list */
.about-hero { height: 100vh; min-height: 640px; align-items: flex-end; }
.about-hero .ah-copy {
  position: relative; margin: 0 50px calc(26vh + 15px) auto;
  width: 650px; max-width: calc(100% - 2 * var(--gutter));
  text-align: right; color: var(--c-white);
}
.about-hero .ph-title { font-size: 50px; margin: 0; }
.about-hero .ah-lead { font-family: var(--f-ui); font-size: 18px; line-height: 1.4; margin-top: 25px; color: rgba(255, 255, 255, 0.9); }
.ao-body { display: flex; flex-direction: column; gap: 14px; margin-top: 19px; }
.about-values .section-title { margin-bottom: 14px; }
.av-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 50px; }
.av-card { display: flex; flex-direction: column; gap: 0; min-width: 0; }
/* original: 418px black tile (389 / 410 / 389 tall) with the photo zoomed 1.05 inside */
.av-card .av-media { aspect-ratio: 418 / 389; overflow: hidden; background: #000; }
.av-card:nth-child(2) .av-media { aspect-ratio: 418 / 410; }
.av-card .av-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.05); }
.av-card h5 { color: #000; font-size: 20px; margin-top: 11px; }
.av-card p { text-align: justify; margin-top: 10px; }
.about-gallery { padding-top: 13px; padding-bottom: 10px; }
@media (min-width: 810px) { .about-values { padding-top: 16px; padding-bottom: 0; } }
.ag-grid { display: grid; grid-template-columns: 435fr 450fr 450fr; gap: 10px; }
.ag-grid img { width: 100%; height: 228px; object-fit: cover; }
.ag-grid .ag-more { display: none; }
.about-gallery.is-expanded .ag-grid .ag-more { display: block; height: 259px; }
.about-map .map-frame { aspect-ratio: 1325 / 522; border-radius: 10px; overflow: hidden; }
.about-map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1); }
.about-testimonials .section-title { text-align: center; margin-bottom: 69px; }
.at-list { display: flex; flex-direction: column; }
.about-testimonials .testimonial { position: relative; margin: 0; padding: 61px 50px 32px; border: 0; border-bottom: 1px solid rgba(82, 82, 82, 0.75); border-radius: 0; background: none; box-shadow: none; }
.about-testimonials .testimonial .tq { font-family: var(--f-copy); font-size: 16px; line-height: 20.8px; color: var(--c-text-70); text-align: justify; white-space: pre-line; }
.about-testimonials .testimonial .ta { font-family: var(--f-ui); font-size: 12px; color: var(--c-text-70); text-align: right; margin-top: 0; line-height: 16.8px; }
/* original: grey 25px quote glyphs, top-right 21px under the rule, bottom-left 9px above the next */
.tq-mark { position: absolute; display: inline-flex; align-items: center; justify-content: center; width: 25px; height: 25px; color: rgba(82, 82, 82, 0.8); }
.tq-mark svg { width: 18px; height: 14px; }
.tq-mark--top { top: 21px; right: 10px; }
.tq-mark--bottom { bottom: 9px; left: 10px; }

@media (max-width: 1199px) {
  .av-grid { grid-template-columns: repeat(2, 1fr); gap: 30px; }
}
@media (max-width: 809px) {
  .about-hero .ah-copy { width: auto; margin-bottom: 18vh; }
  .about-hero .ph-title { font-size: 30px; }
  .about-hero .ah-lead { font-size: 16px; margin-top: 14px; }
  .av-grid, .ag-grid { grid-template-columns: 1fr; }
  /* the original's value images run 8px wider than the gutter (352px) */
  .av-card .av-media, .av-card:nth-child(2) .av-media { margin: 0 -8px; aspect-ratio: 352 / 242; }
  .ag-grid img, .about-gallery.is-expanded .ag-grid .ag-more { height: auto; aspect-ratio: 1.45; }
  .about-testimonials .testimonial { padding: 48px 20px 38px; }
  /* even spacing between the about sections (they ranged from 20px to 70px) */
  .about-office, .about-values, .about-gallery, .about-map, .about-testimonials { padding-top: 24px; padding-bottom: 24px; }
  .about-testimonials .section-title { margin-bottom: 24px; }
  .av-card + .av-card { margin-top: 8px; }
  /* justified text leaves big holes between words on a narrow screen */
  .av-card p, .about-testimonials .testimonial .tq, .svc-body .svc-p--justify { text-align: left; }
  /* service copy: every line (often a list item) gets the same small gap */
  .svc-body .svc-p + .svc-p { margin-top: 8px; }
}

/* Contact — the original runs: centred name + address, a rule, three
   icon columns (hours / email / phone), then the form, then a full-width
   greyscale map */
.contact-wrap { display: flex; flex-direction: column; }
.contact-wrap .contact-page { display: contents; }
.contact-wrap .cp-info { order: 1; padding: 171px var(--gutter) 40px; text-align: center; }
.contact-wrap .home-form { order: 2; }
.contact-wrap .cp-map { order: 3; padding: 0 var(--gutter) 60px; }
.contact-wrap .divider { display: none; }
.cp-info h4 { font-size: 40px; line-height: 1.2em; color: var(--c-text-70); }
.cp-info h2 { font-size: 28px; line-height: 1.3em; color: var(--c-black); margin-top: 10px; }
.cp-rows {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 50px;
  margin-top: 40px; padding-top: 110px;
  border-top: 1px solid var(--c-text-45);
}
.cp-row { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cp-ico { display: inline-flex; color: var(--c-text-70); margin-bottom: 6px; }
.cp-ico svg { width: 24px; height: 24px; }
.cp-row h5 { color: var(--c-black); font-size: 20px; }
.cp-row p { font-size: 16px; }
.cp-row a:hover { color: var(--c-orange); }
.contact-wrap .home-form .hf-title { text-align: left; }
.cp-map .map-frame { aspect-ratio: 1325 / 712; }
.cp-map iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 1199px) {
  .cp-rows { gap: 30px; padding-top: 70px; }
}
/* the original's mobile contact page: centred copy, rows 69px apart, full-width
   40px submit, then the tall portrait map 40px below */
@media (max-width: 809px) {
  .contact-wrap .cp-info { padding: 180px var(--gutter) 0; text-align: center; }
  .cp-info h2 { line-height: 42px; }
  .contact-wrap .cp-map { padding: 40px var(--gutter) 0; }
  /* even rhythm under the address: a rule, then icon + title + value, 40px apart */
  .cp-rows { display: flex; flex-direction: column; gap: 40px; margin-top: 36px; padding-top: 40px; border-top: 1px solid var(--c-text-30); }
  .cp-row { align-items: center; gap: 6px; }
  .cp-ico { margin-bottom: 4px; }
  .cp-map .map-frame { aspect-ratio: 335 / 712; }
  .contact-wrap .home-form { padding: 83px var(--gutter) 0; gap: 43px; }
  .contact-wrap .home-form .hf-title { text-align: left; }
  .contact-wrap .home-form form { padding: 0; }
  .contact-wrap .home-form form > .form-field:has(input), .contact-wrap .form-row { margin-left: 0; margin-right: 0; }
  .contact-wrap .home-form .form-submit { padding-top: 13px; padding-bottom: 13px; }
}

.ah-info .ah-name { font-family: var(--f-display); font-weight: 400; font-size: 26px; line-height: 1.2; color: var(--c-dark); }
.ah-info .ah-desc { font-family: var(--f-display); font-size: 17px; line-height: 1.6; color: rgba(0, 0, 0, 0.6); }
/* After hours — original at 1455: centred 900px head (54px title, 18px grey intro);
   each person is a 1240x687 beige card, 615px photo on alternating sides, a
   497px text column 69px away, cards 101px apart */
.ah-person {
  display: flex; gap: 60px; align-items: center;
  padding: 50px var(--gutter);
}
.ah-person--flip { flex-direction: row-reverse; }
.ah-photo { flex: none; width: 42%; }
.ah-photo img { width: 100%; aspect-ratio: 1.2; object-fit: cover; }
.ah-info { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.ah-info .btn { align-self: flex-start; }
@media (max-width: 1199px) {
  .ah-person, .ah-person--flip { flex-direction: column; align-items: flex-start; gap: 24px; }
  .ah-photo { width: 100%; }
}
@media (min-width: 1200px) {
  .ah-head { padding: 120px 0 0; width: 900px; max-width: calc(100% - 2 * var(--gutter)); margin: 0 auto; text-align: center; }
  .ah-head h1 { font-size: 54px; line-height: 64.8px; }
  .ah-head .sh-sub { max-width: none; margin-top: 20px; font-family: var(--f-ui); font-size: 18px; line-height: 25.2px; color: #8c8c8c; }
  .ah-head + .ah-person { margin-top: 49px; }
  .ah-person, .ah-person--flip {
    width: 1240px; max-width: calc(100% - 2 * var(--gutter)); height: 687px; margin: 0 auto 101px;
    padding: 0; gap: 69px; background: rgba(203, 196, 188, 0.5);
  }
  .ah-person:last-child { margin-bottom: 51px; }
  .ah-photo { width: 615px; height: 687px; }
  .ah-photo img { width: 100%; height: 100%; aspect-ratio: auto; }
  .ah-info { flex: 0 0 497px; max-width: 497px; gap: 0; }
  .ah-info .ah-name { font-family: var(--f-display); font-weight: 400; font-size: 45px; line-height: 54px; color: var(--c-dark); }
  .ah-info .ah-desc { margin-top: 5px; font-family: var(--f-display); font-size: 20px; line-height: 32px; color: rgba(0, 0, 0, 0.6); }
  .ah-info .btn { align-self: flex-end; margin-top: 25px; padding-top: 12.5px; padding-bottom: 12.5px; }
}

/* Success page */
.success-page {
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  text-align: center;
  gap: 50px;
  padding: 243px var(--gutter) 119px;
}
/* original: 54px title, 20px black subline, square beige 292x49 button */
.success-page h1 { font-size: 54px; line-height: 64.8px; }
.success-page h5 { max-width: 600px; font-size: 20px; line-height: 26px; color: #000; }
.success-page .btn { border-radius: 0; background: var(--c-beige); color: var(--c-dark); padding: 16px 24px; }
@media (max-width: 809px) {
  .success-page { padding-top: 160px; gap: 30px; }
  .success-page h1 { font-size: 32px; line-height: 38px; }
}

/* Services — measured from the original at 1455px: full-height hero with the
   title 40px from the right edge (or centred) at a per-page height, an outlined
   "ZGŁOŚ +" pill under it, then full-width copy on a 40px gutter where every
   block keeps the gap captured from the original (inline margin-top) */
.svc-hero { height: 100vh; min-height: 640px; display: block; }
.svc-hero .sh-copy { position: absolute; left: 40px; right: 40px; top: calc(100vh * var(--sh-y)); display: flex; flex-direction: column; gap: 0; }
.svc-hero .sh-copy--right { align-items: flex-end; text-align: right; }
.svc-hero .sh-copy--center { align-items: center; text-align: center; }
.svc-hero .ph-title { margin: 0; font-size: 50px; line-height: 60px; }
.svc-hero .sh-sub { position: absolute; top: calc(100vh * var(--sh-sub-y)); width: 605px; max-width: calc(100% - 40px); text-align: right; font-family: var(--f-ui); font-size: 18px; line-height: 25.2px; color: var(--c-white); }
/* image heroes run without the dark scrim (only the video heroes keep it) */
.svc-hero:not(.page-hero--video) .ph-overlay { display: none; }
.sh-pill { margin-top: 10px; gap: 10px; padding: 12.5px 18px; color: var(--c-white); background: transparent; box-shadow: inset 0 0 0 1px var(--c-white); }
.sh-pill .sh-plus { position: relative; width: 16px; height: 16px; flex: none; }
.sh-pill .sh-plus::before, .sh-pill .sh-plus::after { content: ""; position: absolute; left: 50%; top: 50%; background: currentColor; transform: translate(-50%, -50%); }
.sh-pill .sh-plus::before { width: 12px; height: 1.5px; }
.sh-pill .sh-plus::after { width: 1.5px; height: 12px; }
/* the original caps the services copy at 1440px but keeps 40px gutters below that */
.svc-body { width: min(100% - 80px, 1440px); margin-inline: auto; padding: 0; }
.svc-body .svc-h { color: var(--c-dark); }
.svc-body .svc-h--muted { color: var(--c-text-70); }
.svc-body .svc-p { font-family: var(--f-copy); font-size: 16px; line-height: 20.8px; color: var(--c-text-70); }
.svc-body .svc-p--justify { text-align: justify; }
.svc-body .svc-p strong { font-weight: 700; }
.svc-body .svc-p:has(> br:only-child) { height: 0; overflow: hidden; margin-top: 12px; }
.svc-gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.svc-gallery img { width: 100%; aspect-ratio: 683 / 354; object-fit: cover; display: block; }
/* form: title at x80, fields 753–1376 at 1455; the gap above the title is the captured one */
.svc-form > .home-form { margin-top: calc(var(--svc-form-gap) - 64px); }
@media (min-width: 1200px) {
  .svc-form > .home-form { width: min(100% - 80px, 1440px); margin-inline: auto; padding: 25px 40px 16px; align-items: flex-start; }
  .svc-form > .home-form .hf-title { margin-top: 39px; }
  .svc-form > .home-form .form-submit { padding-top: 13px; padding-bottom: 13px; }
  .svc-form > .home-form .form-row { gap: 10px; }
  .svc-form > .home-form .form-field input, .svc-form > .home-form .form-field textarea { padding-left: 10px; }
}
/* Header variants measured on the original. Its services and thank-you pages use
   a second header component: in the 1440–1539 band it sits on a 40px gutter
   instead of the centred 1440px column (above that every header is centred), and
   its nav is spaced differently. Services pages fall back to the standard header
   at 1705px; the thank-you page keeps its own nav at every desktop width. */
@media (min-width: 1440px) and (max-width: 1539px) {
  body:has(.svc-hero) .site-header .header-inner,
  body:has(.success-page) .site-header .header-inner { margin-left: 40px; margin-right: 40px; }
}
@media (min-width: 1440px) and (max-width: 1704px) {
  /* sale / buy / interior design: 94px to the nav, then 22px between its items */
  body:has(.svc-hero:not(.svc-hero--packed)) .site-header .header-inner { gap: 94px; }
  body:has(.svc-hero:not(.svc-hero--packed)) .site-header .header-nav { gap: 22px; }
  /* rent / pricing / photography: 18px items and no dropdown chevrons */
  body:has(.svc-hero--packed) .site-header .header-nav { gap: 18px; }
  body:has(.svc-hero--packed) .site-header .header-nav .chev { display: none; }
}
@media (min-width: 1440px) {
  body:has(.success-page) .site-header .header-nav { gap: 18px; }
  body:has(.success-page) .site-header .header-nav .chev { display: none; }
}
@media (max-width: 809px) {
  .svc-hero { display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 60px; }
  .svc-hero .sh-copy { position: relative; left: auto; right: auto !important; top: auto; margin: 0 20px; }
  .svc-hero .ph-title { font-size: 30px; line-height: 36px; }
  .svc-hero .sh-sub { position: static; width: auto; font-size: 16px; line-height: 22px; margin: 12px 20px 0; text-align: right; }
  .svc-body { padding: 0 20px; }
  .svc-body > :first-child { margin-top: 40px !important; }
  .svc-gallery { grid-template-columns: 1fr; }
  .svc-form > .home-form { margin-top: 40px; }
}

/* Legal */
/* original: centred 1164px panel (beige 20%) at y173, 40/50 padding, 45px title,
   40px between sections, 20px between every line/paragraph */
/* the original's privacy panel is 80% of the viewport at every desktop width */
.legal-page { width: 80vw; max-width: 80vw; margin: 173px auto 50px; padding: 40px 50px; background: rgba(203, 196, 188, 0.2); }
.legal-page h1 { font-size: 45px; line-height: 54px; margin-bottom: 40px; }
.legal-page section { display: flex; flex-direction: column; gap: 20px; margin-bottom: 40px; }
.legal-page section:last-child { margin-bottom: 0; }
.legal-page p { color: rgba(0, 0, 0, 0.5); }
@media (max-width: 809px) { .legal-page { width: auto; max-width: none; } }
@media (max-width: 809px) { .legal-page { margin-top: 130px; padding: 30px 20px; } .legal-page h1 { font-size: 30px; line-height: 36px; margin-bottom: 30px; } }

/* services footer: the original narrows the footer column to 1123px here */
body:has(.svc-hero) .site-footer { --fpad: max(var(--gutter), calc((100% - 1123px) / 2)); }
body:has(.svc-hero) .footer-widget:first-child a:first-of-type { color: var(--c-text-70); }

/* Join Us / Add Property: 40px gutters, two 663px halves; Join Us has a framed
   1019x713 photo under the header */
/* the original's Join Us photo is 70% of the viewport */
.jf-photo { width: 70vw; max-width: calc(100% - 40px); margin: 91px auto 0; aspect-ratio: 1019 / 713; overflow: hidden; }
.jf-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (min-width: 1200px) {
  .jf-page .home-form { padding: 0 40px 80px; align-items: flex-start; }
  .jf-page .home-form .form-submit { padding-top: 13px; padding-bottom: 13px; }
  .jf-page .home-form .form-row { gap: 10px; }
  .jf-page .home-form .form-field input, .jf-page .home-form .form-field textarea { padding-left: 10px; }
  .jf-page--join .home-form { margin-top: 87px; }
  .jf-page--join .home-form .hf-title { margin-top: 65px; }
  .jf-page--add .home-form { padding-top: 227px; }
  .jf-page--add .home-form .hf-title { margin-top: 40px; }
  /* contact: title top-aligned 45px under the form top */
  .contact-wrap .home-form { align-items: flex-start; padding-top: 39px; }
  .contact-wrap .home-form .hf-title { margin-top: 45px; }
}
@media (max-width: 809px) { .jf-page--add .home-form { padding-top: 130px; } .jf-photo { margin-top: 110px; } }
/* header variants measured on the original (desktop header only) */
@media (min-width: 1440px) {
  body:has(.jf-page) .site-header:not(.is-scrolled) .header-inner { margin-top: 19px; }
}

/* ---------- Mobile layouts measured on the original at 375px ---------- */
.jf-hero { display: none; }
@media (max-width: 809px) {
  /* Join Us: video hero, right-aligned title at 52% height; form on 60px gutters */
  .jf-hero { display: block; height: 100vh; min-height: 640px; }
  .jf-hero .jf-hero-copy { position: absolute; right: 33px; left: 20px; top: 52%; text-align: right; color: var(--c-white); }
  .jf-hero .ph-title { margin: 0; font-size: 36px; line-height: 43.2px; }
  .jf-hero .jf-hero-sub { margin-top: 10px; font-family: var(--f-ui); font-size: 18px; line-height: 25.2px; }
  .jf-page--join .jf-photo { display: none; }
  .jf-page .home-form { padding: 74px 60px 40px; }
  .jf-page--add .home-form { padding-top: 170px; }
  .jf-page .home-form .hf-title { text-align: left; font-size: 26px; line-height: 39px; }
  .jf-page .home-form form { padding: 0; }
  .jf-page .home-form form > .form-field:has(input), .jf-page .form-row { margin-left: 0; margin-right: 0; }
  .jf-page--add .home-form .hf-title { display: flex; align-items: center; gap: 10px; }
  .jf-page--add .home-form .hf-title::after { content: "+"; font-family: var(--f-ui); font-size: 22px; line-height: 1; }

  /* After Hours: centred 36px title, 18px grey intro, 281x883 beige cards */
  .ah-head { padding: 200px 20px 0; text-align: center; }
  .ah-head h1 { font-size: 36px; line-height: 43.2px; }
  .ah-head .sh-sub { max-width: none; margin-top: 20px; font-family: var(--f-ui); font-size: 18px; line-height: 25.2px; color: #8c8c8c; }
  .ah-person, .ah-person--flip {
    flex-direction: column !important; align-items: stretch !important; gap: 0 !important;
    width: 281px; max-width: calc(100% - 40px); height: 883px; margin: 30px auto 0; padding: 0;
    background: rgba(203, 196, 188, 0.5);
  }
  .ah-head + .ah-person { margin-top: 91px; }
  .ah-person:last-child { margin-bottom: 30px; }
  .ah-photo { width: 100% !important; height: 437px; flex: none; }
  .ah-photo img { width: 100%; height: 100%; aspect-ratio: auto; }
  .ah-info { flex: 1; justify-content: center; padding: 0 20px; gap: 0; max-width: none; }
  .ah-info .ah-name { font-size: 28px; line-height: 42px; color: #000; }
  .ah-info .ah-desc { margin-top: 5px; font-family: var(--f-ui); font-size: 11px; line-height: 15.4px; color: #000; }
  .ah-info .btn { align-self: flex-end; margin-top: 25px; padding-top: 12.5px; padding-bottom: 12.5px; }

  /* Privacy: 300px panel at x38 with the desktop paddings kept (200px text column) */
  .legal-page { margin: 190px 38px 50px !important; padding: 40px 50px !important; }
  .legal-page h1 { font-size: 45px !important; line-height: 54px !important; margin-bottom: 40px !important; }
  .legal-page h3 { line-height: 28.6px; }
}

/* About on mobile (375): measured on the original */
@media (max-width: 809px) {
  .about-hero .ah-copy { position: absolute; left: 20px; right: 20px; top: 44.3%; margin: 0; width: auto; max-width: none; text-align: center; }
  .about-hero .ph-title { font-size: 28px; line-height: 42px; }
  .about-hero .ah-lead { margin-top: 8px; font-size: 11px; line-height: 15.4px; }
  .about-gallery [data-expander] { display: none; }
  .about-gallery .ag-grid { gap: 10px; }
  .about-gallery .ag-grid img { height: 260px; aspect-ratio: auto; }
  .about-map .map-frame { aspect-ratio: 335 / 522; }
}

/* services hero at phone width: the original's own per-page layout (from services.json) */
.sh-m { display: none; }
@media (max-width: 809px) {
  .svc-hero { display: block; padding: 0; }
  .svc-hero .sh-copy, .svc-hero .sh-sub { display: none; }
  .svc-hero .sh-m { display: block; }
  .sh-m-t { position: absolute; margin: 0; font-family: var(--f-display); font-weight: 400; text-align: right; }
  .sh-m-pill { position: absolute; margin: 0; }
}

@media (max-width: 809px) { .about-testimonials .testimonial:nth-child(n + 5) { display: none; } }
