/* Base layout + core components. Component specs: design/components.jsx, design/chrome.jsx. */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ev-bg);
  color: var(--ev-ink);
  font: 500 var(--ev-fs-body)/1.5 var(--ev-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: left;
}
h1, h2 { font-size: var(--ev-fs-title); }

.ev-num { font-variant-numeric: tabular-nums; }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}
.skip-link:focus {
  clip: auto; width: auto; height: auto;
  z-index: 100; top: 8px; left: 8px;
  padding: 8px 16px;
  background: var(--ev-yellow); color: var(--ev-ink-on-yellow);
}

/* Sections — TQ: frame 1440, inline padding 5%, gap 150/50 */
.ev-section {
  width: 100%;
  max-width: var(--ev-section-max);
  margin-inline: auto;
  padding-inline: var(--ev-section-pad);
}
.ev-main > .ev-section + .ev-section { margin-top: var(--ev-section-gap); }
.ev-main { padding-block: 40px var(--ev-section-gap); }

/* Buttons — yellow = clickable primary, cypress only as decorative secondary surface */
.ev-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px;
  border: 0; border-radius: var(--ev-radius-md);
  font: 600 15px/1 var(--ev-font);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: box-shadow 0.12s ease, background 0.12s ease;
}
.ev-btn[hidden] { display: none; } /* display: inline-flex above would otherwise beat the hidden attribute. */
.ev-btn--primary { background: var(--ev-yellow); color: var(--ev-ink-on-yellow); }
.ev-btn--primary:hover { box-shadow: 0 6px 18px rgba(249, 255, 0, 0.35); }
.ev-btn--ghost { background: transparent; color: var(--ev-ink); border: 1px solid var(--ev-line-strong); }
.ev-btn--sm { padding: 9px 16px; font-size: 14px; }
.ev-btn:focus-visible { outline: 2px solid var(--ev-ink); outline-offset: 2px; }

/* Header — sticky (TQ 03), єОселя active element on the right */
.ev-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ev-surface);
  border-bottom: 1px solid var(--ev-line);
}
.ev-header__top {
  display: none;
  justify-content: space-between; align-items: center;
  padding: 8px var(--ev-section-pad);
  border-bottom: 1px solid var(--ev-line);
  font-size: 12px; color: var(--ev-ink-3);
}
.ev-header__bar {
  display: flex; align-items: center; gap: 24px;
  padding: 16px var(--ev-section-pad);
}
.ev-header__logo img { height: 40px; width: auto; }
.ev-nav { flex: 1; }
.ev-nav ul { display: none; list-style: none; margin: 0; padding: 0; gap: 26px; }
.ev-nav a { font-size: 14px; text-decoration: none; opacity: 0.8; padding-bottom: 4px; white-space: nowrap; }
.ev-nav .current-menu-item > a,
.ev-nav a[aria-current="page"] { opacity: 1; font-weight: 700; box-shadow: inset 0 -3px 0 var(--ev-yellow); }
.ev-header__actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.ev-header__phone { display: none; font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.ev-lang { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.ev-lang a { text-decoration: none; }
.ev-lang .current-lang a { font-weight: 700; color: var(--ev-ink); }

.ev-nav__phone { display: none; }
.ev-header__menu {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-right: -8px; padding: 0;
  border: 0; background: none; color: var(--ev-ink); cursor: pointer;
}
.ev-header__menu[hidden], .ev-header__menu [hidden] { display: none; }
.ev-header__menu:focus-visible { outline: 2px solid var(--ev-ink); outline-offset: 2px; }

/* Up to small laptops (the menu fits from 1150 px in uk / ru / en): the burger opens the menu as a panel under the header, with languages above and the phone below */
@media (max-width: 1149px) {
  .ev-header.is-menu-open .ev-header__top { display: flex; }
  .ev-header.is-menu-open .ev-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - 100px); overflow-y: auto;
    padding: 4px var(--ev-section-pad) 20px;
    background: var(--ev-surface); border-bottom: 1px solid var(--ev-line); box-shadow: var(--ev-shadow-md);
  }
  .ev-header.is-menu-open .ev-nav ul { display: flex; flex-direction: column; gap: 0; }
  .ev-header.is-menu-open .ev-nav a { display: block; padding: 13px 0; font-size: 16px; border-bottom: 1px solid var(--ev-line); }
  .ev-header.is-menu-open .ev-nav .current-menu-item > a,
  .ev-header.is-menu-open .ev-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--ev-yellow); padding-left: 12px; }
  .ev-header.is-menu-open .ev-nav__phone { display: block; margin-top: 8px; font-weight: 700; border-bottom: 0; opacity: 1; }
}

@media (min-width: 1150px) {
  .ev-header__top { display: flex; }
  .ev-nav ul { display: flex; }
  .ev-header__phone { display: inline-flex; }
  .ev-header__menu { display: none; }
}

/* Footer — cypress is decorative (TQ 01) */
.ev-footer {
  background: var(--ev-cypress);
  color: var(--ev-ink-on-dark);
  padding: 64px var(--ev-section-pad) 28px;
}
.ev-footer__grid {
  display: grid; gap: 40px;
  max-width: var(--ev-section-max); margin-inline: auto;
}
.ev-footer__title { font-size: 18px; font-weight: 800; margin-bottom: 14px; }
.ev-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ev-footer a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.ev-footer a:hover { color: #fff; }
.ev-footer__office { display: grid; gap: 4px; font-size: 14px; }
.ev-footer__office + .ev-footer__office { margin-top: 14px; }
.ev-footer__line { display: flex; gap: 8px; align-items: flex-start; }
.ev-footer__line > svg { flex: none; margin-top: 2px; opacity: 0.7; }
.ev-footer__line > .ev-schedule { color: rgba(255, 255, 255, 0.8); }
.ev-schedule > span { display: block; }
.ev-footer__bottom {
  max-width: var(--ev-section-max); margin: 56px auto 0;
  padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.18);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-size: 12px; color: rgba(255, 255, 255, 0.65);
}
@media (min-width: 1024px) {
  .ev-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; }
}

.ev-footer__link {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: rgba(255, 255, 255, 0.8);
}
.ev-footer__link:hover { color: #fff; }

/* Cookie banner (plan §8) — fixed card, no layout shift; buttons are the only yellow */
.ev-cookie {
  position: fixed; z-index: 60;
  left: 16px; right: 16px; bottom: 16px;
  max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 22px;
  background: var(--ev-surface); color: var(--ev-ink);
  border-radius: var(--ev-radius-lg);
  box-shadow: var(--ev-shadow-lg);
  font-size: 14px; font-weight: 500; line-height: 1.5;
}
.ev-cookie[hidden], .ev-cookie [hidden] { display: none; }
.ev-cookie__title { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.ev-cookie__text { margin: 0; color: var(--ev-ink-2); }
.ev-cookie__text a { color: inherit; }
.ev-cookie__prefs { display: grid; gap: 12px; margin-top: 16px; }
.ev-cookie__opt { display: flex; align-items: flex-start; gap: 10px; color: var(--ev-ink-2); cursor: pointer; }
.ev-cookie__opt input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--ev-ink); }
.ev-cookie__opt strong { display: block; color: var(--ev-ink); }
.ev-cookie__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.ev-cookie__actions .ev-btn { flex: 1 1 auto; }
@media (min-width: 768px) {
  .ev-cookie { left: 24px; right: auto; bottom: 24px; width: 520px; }
}

/* Cards / surfaces */
.ev-card {
  background: var(--ev-surface);
  border-radius: var(--ev-radius-lg);
  box-shadow: var(--ev-shadow-sm);
  overflow: hidden;
}

/* Favorites / compare toggles (assets/js/shortlist.js). Pressed = active state → yellow (TQ) */
.ev-toggle[aria-pressed="true"] { background: var(--ev-yellow); color: var(--ev-ink-on-yellow); border-color: transparent; }
.ev-toggle[data-ev-list="favorites"][aria-pressed="true"] .ev-icon { fill: currentColor; }
.ev-toggle[hidden] { display: none; }

.ev-header__list {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; color: var(--ev-ink); text-decoration: none;
}
.ev-header__list:hover { background: var(--ev-bg); }
.ev-header__list:focus-visible { outline: 2px solid var(--ev-ink); outline-offset: 2px; }
.ev-header__count {
  position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--ev-radius-pill); background: var(--ev-ink); color: var(--ev-ink-on-dark);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.ev-header__count[hidden] { display: none; }

.ev-toast {
  position: fixed; z-index: 70; left: 50%; bottom: 24px; max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: var(--ev-radius-md);
  background: var(--ev-ink); color: var(--ev-ink-on-dark); font-size: 14px; font-weight: 600;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.ev-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* Property ID — the number clients quote and realtors search by: a dark chip (a label, not clickable → no yellow) */
.ev-id {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px;
  background: var(--ev-ink); color: var(--ev-ink-on-dark); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap;
}
.ev-id--lg { padding: 6px 12px; font-size: 15px; }

/* Agency social links in the footer */
.ev-social { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.ev-footer .ev-social { display: flex; } /* .ev-footer ul is a grid (link lists); the icons go in a row. */
.ev-footer .ev-social a {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: var(--ev-ink-on-dark);
}
.ev-footer .ev-social a:hover { background: var(--ev-yellow); color: var(--ev-ink-on-yellow); }
.ev-footer .ev-social a:focus-visible { outline: 2px solid var(--ev-ink-on-dark); outline-offset: 2px; }

.ev-print-only { display: none; }
