/* ==========================================================================
   OSSA Nieruchomości — base stylesheet
   Design tokens, reset, typography, shared components (header, footer,
   buttons, property cards, appear animations).
   Breakpoints (matching the original): 0–809 / 810–1199 / 1200–1439 / 1440+
   ========================================================================== */

:root {
  /* Colors (extracted from the original token set) */
  --c-bg: #f7f2f2;
  --c-white: #fff;
  --c-black: #000;
  --c-dark: #433f38;
  --c-text: #525252;
  --c-text-70: rgba(82, 82, 82, 0.7);
  --c-text-45: rgba(82, 82, 82, 0.45);
  --c-text-30: rgba(82, 82, 82, 0.3);
  --c-orange: #ed6a14;
  --c-orange-60: rgba(237, 106, 20, 0.6);
  --c-beige: #cbc4bc;
  --c-beige-60: rgba(203, 196, 188, 0.6);
  --c-beige-15: rgba(203, 196, 188, 0.15);
  --c-border: #e8e8e8;
  --c-grey-bg: #fafafa;
  --c-grey: #8c8c8c;
  --c-white-60: rgba(255, 255, 255, 0.6);
  --c-white-70: rgba(255, 255, 255, 0.7);
  --c-copy: rgba(82, 82, 82, 0.7);

  /* Fonts */
  --f-display: "OSSA Display J", "MADE Voyager PERSONAL_USE Regular", "Times New Roman", serif;
  --f-ui: "Plus Jakarta Sans", sans-serif;
  --f-body: "Inter", sans-serif;
  --f-copy: Arial, sans-serif;

  /* Layout */
  --gutter: 50px;
  --grid-gap: 30px;
  --radius-pill: 50px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  background: var(--c-bg);
  font-family: var(--f-body);
  color: var(--c-text);
  min-height: 100vh;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; background: none; border: none; cursor: pointer; color: inherit; }
input, textarea, select { font: inherit; color: inherit; }

/* ---------- Layout helpers ---------- */
.container { padding-left: var(--gutter); padding-right: var(--gutter); }
@media (max-width: 809px) {
  :root { --gutter: 20px; --grid-gap: 20px; }
}
/* On wide screens the original caps content at 1440px, centered, while section
   backgrounds stay full-bleed. Everything pads with --gutter, so one rule does it. */
@media (min-width: 1540px) {
  :root { --gutter: calc((100vw - 1440px) / 2); }
}

/* ---------- Typography presets (1:1 with original) ---------- */
/* Section title (h3) */
.t-section { font-family: var(--f-display); font-weight: 400; color: var(--c-dark); font-size: 22px; line-height: 1em; }
@media (max-width: 1439px) and (min-width: 1200px) { .t-section { font-size: 34px; } }
@media (max-width: 1199px) and (min-width: 810px)  { .t-section { font-size: 30px; } }
@media (max-width: 809px) { .t-section { font-size: 22px; line-height: 1.3em; } }

/* Large heading (h4 – contact form) */
.t-h4 { font-family: var(--f-display); font-weight: 400; color: var(--c-dark); font-size: 32px; line-height: 1.2em; }
@media (max-width: 1439px) and (min-width: 1200px) { .t-h4 { font-size: 27px; } }
@media (max-width: 1199px) and (min-width: 810px)  { .t-h4 { font-size: 28px; } }
@media (max-width: 809px) { .t-h4 { font-size: 26px; line-height: 1.5em; } }

/* Blog heading (h2) */
.t-h2 { font-family: var(--f-display); font-weight: 400; color: var(--c-dark); font-size: 29px; line-height: 1em; }
@media (max-width: 1439px) and (min-width: 1200px) { .t-h2 { font-size: 38px; } }
@media (max-width: 1199px) and (min-width: 810px)  { .t-h2 { font-size: 34px; } }
@media (max-width: 809px) { .t-h2 { font-size: 23px; line-height: 1.4em; } }

/* Card title (h5) */
.t-card { font-family: var(--f-display); font-weight: 400; color: var(--c-black); font-size: 20px; line-height: 1.3em; }
@media (max-width: 1439px) and (min-width: 1200px) { .t-card { font-size: 24px; } }
@media (max-width: 1199px) and (min-width: 810px)  { .t-card { font-size: 22px; } }
@media (max-width: 809px) { .t-card { font-size: 20px; line-height: 1.5em; } }

/* Price / widget heading (h6) */
.t-h6 { font-family: var(--f-display); font-weight: 400; color: var(--c-black); font-size: 20px; line-height: 1em; }
@media (max-width: 1199px) and (min-width: 810px) { .t-h6 { font-size: 19px; } }
@media (max-width: 809px) { .t-h6 { font-size: 18px; } }

/* Body copy (Arial 16) */
.t-copy { font-family: var(--f-copy); font-weight: 400; font-size: 16px; line-height: 1.3em; color: var(--c-copy); }

/* UI labels */
.t-btn   { font-family: var(--f-ui); font-size: 14px; line-height: 1.2em; letter-spacing: 0.05em; text-transform: uppercase; font-weight: 400; }
.t-nav   { font-family: var(--f-ui); font-size: 15px; line-height: 1.2em; text-transform: uppercase; font-weight: 400; }
.t-badge { font-family: var(--f-ui); font-size: 12px; line-height: 1.2em; text-transform: uppercase; font-weight: 400; }
.t-small { font-family: var(--f-ui); font-size: 12px; line-height: 1.4em; font-weight: 400; }
.t-meta  { font-family: var(--f-ui); font-size: 11px; line-height: 1.4em; font-weight: 400; }

/* ---------- Buttons (pill, stacked-text hover like the original) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  padding: 7.5px 18px;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}
.btn .btn-text { display: block; position: relative; overflow: hidden; }
.btn .btn-text > span {
  display: block;
  transition: transform 0.45s cubic-bezier(0.44, 0, 0.56, 1);
}
.btn .btn-text > span:last-child {
  position: absolute;
  inset: 0;
  transform: translateY(calc(100% + 9px));
}
.btn:hover .btn-text > span:first-child { transform: translateY(calc(-100% - 9px)); }
.btn:hover .btn-text > span:last-child { transform: translateY(0); }

.btn--primary { background: var(--c-dark); color: var(--c-beige); }
.site-header .btn { padding-top: 12.5px; padding-bottom: 12.5px; }
.btn--secondary { background: var(--c-beige); color: var(--c-dark); }
.btn--dark-sm { background: var(--c-dark); color: var(--c-white); border-radius: 0; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  pointer-events: none; /* inner elements re-enable */
  transition: background 0.3s ease;
}
/* once the page is scrolled the header needs its own backdrop, otherwise the
   content runs underneath it */
.site-header.is-scrolled {
  background: var(--c-bg);
  box-shadow: 0 1px 0 rgba(82, 82, 82, 0.12);
  pointer-events: auto;
}
.site-header.is-scrolled .header-inner { margin-top: 16px; margin-bottom: 16px; }
.site-header .header-inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 100px;
  margin: 30px var(--gutter) 0;
}
.header-logo { flex: none; }
.header-logo img { width: 175px; height: 63px; object-fit: contain; object-position: left center; }
.header-logo .hl-m { display: none; }
/* the original's desktop logo mark is 123x53 at x76 (nav keeps its x325 start).
   The desktop header reaches down to 1200px, where it sits on a 40px gutter. */
@media (min-width: 1200px) {
  .site-header .header-inner { margin-top: 35px; gap: 126px; }
  .header-logo { margin-left: 26px; }
  .header-logo img { width: 123px; height: 53px; }
}
.header-nav { display: flex; align-items: center; gap: 30px; flex: none; }
.header-nav .nav-item { position: relative; }
.header-nav .nav-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--c-white);
  padding-bottom: 2px;
  position: relative;
}
.header-nav .nav-link .nav-line {
  position: absolute; left: 0; bottom: -4px; height: 1px; width: 100%;
  background: currentColor;
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.35s ease;
}
.header-nav .nav-link:hover .nav-line { transform: scaleX(1); }
.header-nav .nav-link .chev { transition: transform 0.3s ease; }
.nav-item.open .nav-link .chev { transform: rotate(180deg); }

/* Dropdown */
.nav-dropdown {
  position: absolute; top: calc(100% + 14px); left: 50%; transform: translate(-50%, 8px);
  background: var(--c-white);
  border-radius: 10px;
  padding: 10px 0;
  min-width: 210px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.nav-item.open .nav-dropdown,
.nav-item:hover .nav-dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.nav-dropdown a {
  display: block; padding: 9px 22px; color: var(--c-dark);
  transition: color 0.2s ease, background 0.2s ease;
}
.nav-dropdown a:hover { color: var(--c-orange); background: var(--c-grey-bg); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; flex: none; }
.lang-switch { display: flex; align-items: center; gap: 3px; margin-right: 16px; color: var(--c-white-70); }
.lang-switch > span { margin-left: 1px; }
.lang-switch a:hover { color: var(--c-white); }

/* Dark header variant (used on inner pages without hero media) */
.site-header--dark .header-nav .nav-link,
.site-header--dark .lang-switch { color: var(--c-text-70); }
.site-header--dark .lang-switch a:hover { color: var(--c-black); }

/* Mobile header — the original collapses below 1200px */
.header-menu-btn { display: none; }
@media (max-width: 1199px) {
  .site-header .header-inner { gap: 0; justify-content: space-between; margin: 20px; }
  .header-nav, .header-actions { display: none; }
  .header-menu-btn {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--c-white);
  }
  /* original: dark #433f38 label + three 18x1 lines */
  .site-header--dark .header-menu-btn { color: var(--c-dark); }
  .header-menu-btn .lines { display: inline-flex; flex-direction: column; gap: 5px; width: 18px; }
  .header-menu-btn .lines span { height: 1px; width: 100%; background: currentColor; transition: transform .3s ease, opacity .3s ease; }
  .header-menu-btn.open .lines span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .header-menu-btn.open .lines span:nth-child(2) { opacity: 0; }
  .header-menu-btn.open .lines span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
}

/* Mobile header — the original swaps to a compact 100x100 logo mark (140px tall header) */
@media (max-width: 1199px) {
  .header-logo .hl-d { display: none; }
  .header-logo .hl-m { display: block; object-fit: cover; object-position: center; }
  .header-logo img { width: 100px; height: 100px; }
  .header-menu-btn { gap: 5px; }
  /* the sticky bar shrinks so it doesn't eat the screen while scrolling */
  .site-header.is-scrolled .header-inner { margin-top: 6px; margin-bottom: 6px; }
  .site-header.is-scrolled .header-logo img { width: 74px; height: 74px; }
}

/* Mobile menu panel — dropdown from the top like the original (bg #e8e3e3,
   page stays visible below; items uppercase 15px; subs open in white cards) */
.mobile-menu {
  position: fixed; top: 0; left: 0; right: 0; z-index: 39;
  background: rgb(232, 227, 227);
  padding: 130px var(--gutter) 36px;
  display: none;
}
.mobile-menu.open { display: block; }
.mobile-menu .mm-nav { display: flex; flex-direction: column; align-items: flex-start; }
.mobile-menu .mm-item {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 0;
  font-family: var(--f-ui); font-size: 15px; line-height: 1.2; text-transform: uppercase;
  color: var(--c-text-70);
  background: none; border: none; cursor: pointer;
}
.mobile-menu .mm-item i { font-style: normal; font-size: 13px; line-height: 1; align-self: center; transform: translateY(1px); }
.mobile-menu .mm-group { position: relative; align-self: stretch; }
.mobile-menu .mm-panel {
  display: none;
  position: absolute; left: 99px; top: 50%; transform: translateY(-50%);
  background: var(--c-white);
  border-radius: 10px;
  padding: 10px 24px;
  width: max-content;
  text-align: center;
  z-index: 2;
}
.mobile-menu .mm-group.open .mm-panel { display: block; }
.mobile-menu .mm-panel a {
  display: block; padding: 6px 0;
  font-family: var(--f-ui); font-size: 15px; text-transform: uppercase;
  color: var(--c-text-70);
}
.mobile-menu .mm-actions { display: flex; align-items: center; gap: 8px; margin-top: 28px; }
.mobile-menu .mm-lang {
  margin-left: 15px;
  font-family: var(--f-ui); font-size: 15px; text-transform: uppercase;
  color: var(--c-text-70);
  display: inline-flex; gap: 8px;
}
.mobile-menu .mm-lang a { color: var(--c-text-70); }
.mobile-menu .mm-pill {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; border-radius: 50px;
  font-family: var(--f-ui); font-size: 14px; text-transform: uppercase;
  white-space: nowrap; flex: none;
}
.mobile-menu .mm-pill--dark { background: var(--c-dark); color: var(--c-beige); padding: 0 22px; }
.mobile-menu .mm-pill--light { background: var(--c-beige); color: var(--c-dark); padding: 0 10px; }

/* ---------- Property card ---------- */
.prop-card { display: flex; flex-direction: column; gap: 0; position: relative; }
.prop-card .pc-media {
  position: relative;
  aspect-ratio: 1.53571;
  overflow: hidden;
}
.prop-card .pc-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.44, 0, 0.56, 1);
  transform-origin: 80% 50%;
}
.prop-card:hover .pc-media img { transform: scale(1.07); }
.prop-card .pc-cover {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0; transition: opacity 0.4s ease;
  pointer-events: none;
}
.prop-card:hover .pc-cover { opacity: 1; }
.prop-card .pc-badge {
  position: absolute; top: 20px; left: 0;
  background: var(--c-white-60);
  padding: 4px 14px;
  color: #000;
  backdrop-filter: blur(4px);
}
.prop-card .pc-agent {
  /* the original slides the listing agent in from the right edge of the photo */
  position: absolute; right: 20px; bottom: 0;
  width: 120px; height: 170px;
  overflow: hidden;
  opacity: 0; transform: translateX(60px);
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.44, 0, 0.56, 1);
}
.prop-card .pc-agent img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.prop-card:hover .pc-agent { opacity: 1; transform: translateX(0); }
.prop-card .pc-fav {
  position: absolute; top: 0; right: 1px;
  padding: 12px; border-radius: 24px;
  color: rgba(255, 255, 255, 0.8);
  z-index: 2;
  transition: color 0.25s ease, transform 0.25s ease;
}
.prop-card .pc-fav:hover { transform: scale(1.1); }
.prop-card .pc-fav.active { color: var(--c-orange); }
.prop-card .pc-fav svg { width: 24px; height: 24px; display: block; }
.prop-card .pc-fav.active svg path { fill: currentColor; }

.prop-card .pc-meta {
  display: flex; align-items: center; gap: 2px;
  color: var(--c-text-70);
  margin-top: 22px;
  min-width: 0;
}
.prop-card .pc-meta .pin { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 31px; margin-right: 4px; }
.prop-card .pc-meta > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop-card .pc-meta .sep { flex: none; width: 8px; height: 1px; background: var(--c-text-70); }
/* two lines reserved so cards stay aligned; the box follows the line height of each
   breakpoint (a fixed 52px clipped the 2nd line on phones) and keeps a sliver below
   for descenders, which Android fonts draw lower ("pokoje", "Przy") */
.prop-card .pc-title {
  margin-top: 7px; min-height: calc(2.6em + 0.15em); padding-bottom: 0.15em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.prop-card .pc-desc {
  margin-top: 9px;
  color: var(--c-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prop-card .pc-line { height: 1px; background: var(--c-border); margin-top: 15px; }
.prop-card .pc-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; }
.prop-card .pc-feats { display: flex; align-items: center; gap: 9px; color: #000; }
.prop-card .pc-feats .feat { display: inline-flex; align-items: center; gap: 5px; }
.prop-card .pc-feats .t-meta { color: #000; }
.prop-card .pc-feats svg { width: 20px; height: 20px; }

/* Mobile card metrics copied from the original (image 341x222, meta +244,
   title +267, description 4 lines from +327, price row +421, card 440) */
@media (max-width: 809px) {
  .prop-card { gap: 0; min-width: 0; }
  .prop-card .pc-meta { margin-top: 22px; }
  .prop-card .pc-title { margin-top: 8px; min-height: calc(3em + 0.15em); }
  .prop-card .pc-desc { margin-top: 8px; -webkit-line-clamp: 4; }
  .prop-card .pc-line { margin-top: 10px; }
  .prop-card .pc-bottom { margin-top: 5px; }
  /* no hover on touch, and the portrait would cover the property photo */
  .prop-card .pc-agent { display: none; }
}

/* ---------- Footer ---------- */
/* Footer — one full-width beige band like the original (beige-60 over white);
   content is capped at 1340px and centred on wide screens */
.site-footer {
  background: linear-gradient(var(--c-beige-60), var(--c-beige-60)), var(--c-white);
  --fpad: max(var(--gutter), calc((100% - 1340px) / 2));
}
.footer-card {
  min-height: 310px;
  padding: 100px var(--fpad) 30px;
  display: flex; align-items: center; gap: 0;
}
/* 158px between logo and rule; the widgets sit flush right */
.footer-card .footer-sep { margin: 0 40px 0 158px; flex: none; }
.footer-logo { flex: none; }
.footer-logo img { width: 222px; max-width: 100%; }
.footer-sep { width: 1px; height: 180px; background: var(--c-text-45); }
/* original: columns 59px apart, first link 38px under each heading; the
   contact column is spaced 36px per line, the link columns 25.6px */
.footer-widgets { display: flex; gap: 59px; flex-wrap: wrap; margin-left: auto; }
.footer-widget { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7.6px; }
.footer-widget:first-child { gap: 18px; }
.footer-widget h6 { color: var(--c-dark); margin-bottom: 10.4px; }
.footer-widget:first-child h6 { margin-bottom: 0; }
.footer-widget a { display: block; line-height: 18px; color: var(--c-text-70); transition: color 0.2s ease; }
.footer-widget:first-child a:first-of-type { color: #8c8c8c; }
.footer-widget a:hover { color: var(--c-orange); }
.footer-copy {
  min-height: 142px;
  padding: 0 var(--fpad);
  display: flex; align-items: center; gap: 24px;
  color: rgba(67, 63, 56, 0.5);
}
.footer-copy .fc-actions { display: contents; }
/* the "Zgłoś nieruchomość +" pill sits centred between copyright and icons */
.footer-copy .btn { margin: 0 auto; width: 536px; max-width: 100%; height: 42px; gap: 10px; }
.footer-copy .btn::after { content: "+"; font-size: 18px; line-height: 1; }
.footer-social { display: flex; gap: 10px; }
.footer-social a { display: inline-flex; width: 41px; height: 40px; align-items: center; justify-content: center; color: var(--c-dark); transition: opacity 0.2s ease; }
.footer-social a:hover { opacity: 0.7; }
.footer-social svg { width: 34px; height: 34px; }

@media (max-width: 1199px) {
  .footer-card { flex-direction: column; align-items: flex-start; gap: 40px; padding-top: 40px; padding-bottom: 40px; }
  .footer-sep { display: none; }
  .footer-widgets { margin-left: 0; margin-top: 0; gap: 40px; }
  .footer-widget { align-items: flex-start; text-align: left; }
  .footer-copy { flex-wrap: wrap; padding-top: 20px; padding-bottom: 20px; }
  .footer-copy .btn { margin: 0; width: auto; }
}

/* ---------- Mobile footer (original swaps to a compact nav variant) ---------- */
.footer-m { display: none; }
@media (max-width: 809px) {
  .site-footer .footer-card, .site-footer .footer-copy { display: none; }
  .footer-m { display: block; padding: 0 30px; }
  .footer-m .fm-link {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 15px 0;
    border-bottom: 1px solid var(--c-border);
    font-family: var(--f-ui); font-size: 15px; text-transform: uppercase; color: var(--c-text-70);
    background: none; text-align: left; cursor: pointer;
  }
  .footer-m .fm-toggle i { font-style: normal; font-size: 11px; color: var(--c-text-70); }
  .footer-m .fm-sub { display: none; padding-left: 16px; }
  .footer-m .fm-sub.open { display: block; }
  .footer-m .fm-sub .fm-link { font-size: 14px; }
  .footer-m .fm-cta-row { display: flex; justify-content: center; margin-top: 24px; }
  .footer-m .fm-contact { margin-top: 22px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
  .footer-m .fm-contact a, .footer-m .fm-contact p { color: var(--c-text-70); }
  .footer-m .fm-copy { margin-top: 40px; font-size: 11px; color: rgba(67, 63, 56, 0.5); }
}

/* ---------- Appear animations ---------- */
[data-appear] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.27, 0, 0.51, 1), transform 0.7s cubic-bezier(0.27, 0, 0.51, 1);
  transition-delay: var(--appear-delay, 0s);
  will-change: opacity, transform;
}
[data-appear].appeared { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-appear] { opacity: 1; transform: none; transition: none; }
}

/* ---------- Misc ---------- */
.divider { height: 1px; background: var(--c-text-45); margin: 0 var(--gutter); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* 1200–1439: the original keeps the desktop header but on a 40px gutter, with
   the nav packed to 18px and no dropdown chevrons */
@media (min-width: 1200px) and (max-width: 1439px) {
  .site-header .header-inner { margin-left: 40px; margin-right: 40px; }
  .site-header .header-nav { gap: 18px; }
  .site-header .header-nav .chev { display: none; }
}
