/* Emirates / format mosaic. Every spacing selector outranks .ev2 *.
   Geometry belongs to slots, while crops belong to the individual formats. */
.ev2 .em-bento {
  padding-block: clamp(20px, 2.4vw, 32px) clamp(48px, 5vw, 64px);
  background: var(--bg);
  font-family: var(--font-ui);
}
.em-bento .em-bento__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.em-bento .em-bento__heading { min-width: 0; }
/* #94623c = the site's brass pulled just dark enough to hold 4.5:1 on --bg (the stock #B07A52 gives 3.2:1) */
.em-bento .em-bento__eyebrow { display: block; margin-bottom: 12px; color: #94623c; }
/* one continuous fluid scale: 44px at 801px (no 36->46 jump at the 800/801 breakpoint), 60px cap */
.em-bento .em-bento__title { font-size: clamp(44px, 4.5vw, 60px); text-wrap: balance; }
.em-bento .em-bento__title,
.em-bento .em-bento__wrap a,
.em-bento .em-bento__wrap button,
.em-bento .em-bento__wrap [tabindex] { scroll-margin-block: 110px 120px; }
.em-bento .em-bento__catalog {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  gap: 14px;
  font-weight: 400;
}
.em-bento .em-bento__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, clamp(200px, max(20vw, 256px + (100vw - 1280px) * 0.12), 330px));
  gap: 12px;
}
.em-bento .em-bento__tile {
  position: relative;
  isolation: isolate;
  display: block;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 2px;
  background: #3d3a2c;
  color: #fff;
  text-decoration: none;
}
.em-bento .em-bento__tile--tall { grid-column: 1; grid-row: 1 / 3; }
.em-bento .em-bento__tile--wide { grid-column: 2 / 4; grid-row: 2; }
.em-bento .em-bento__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--em-bento-crop, 50% 50%);
  transition: transform .45s var(--ease);
}
.em-bento .em-bento__tile[data-bento-slug="taunkhausy"] { --em-bento-crop: 75% 50%; }
.em-bento .em-bento__tile[data-bento-slug="smart"] { --em-bento-crop: 50% 72%; }
.em-bento .em-bento__tile[data-bento-slug="smart-dvushky"] { --em-bento-crop: 50% 58%; }
.em-bento .em-bento__tile[data-bento-slug="dvokimnatni"] { --em-bento-crop: 50% 60%; }
.em-bento .em-bento__tile[data-bento-slug="odnokimnatni"] { --em-bento-crop: 58% 66%; }
.em-bento .em-bento__tile[data-bento-slug="obiednannia"] { --em-bento-crop: 58% 62%; }
/* Keep the upper 45% clear; shadows protect the lettering locally. */
.em-bento .em-bento__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* top layer (≈70px) keeps the «Візуалізація» mark and the count pill legible on bright skies/windows */
  background:
    linear-gradient(to bottom, rgba(20,18,14,.36), rgba(20,18,14,.16) 36px, transparent 76px),
    linear-gradient(to top, rgba(20,18,14,.66), rgba(20,18,14,.60) 24%, rgba(20,18,14,.50) 42%, transparent 55%);
}
/* The evening facade already supplies a dark base for the caption. */
.em-bento .em-bento__tile[data-bento-slug="dvokimnatni"]::after {
  background:
    linear-gradient(to bottom, rgba(20,18,14,.30), rgba(20,18,14,.12) 36px, transparent 76px),
    linear-gradient(to top, rgba(20,18,14,.48), rgba(20,18,14,.32) 24%, transparent 55%);
}
.em-bento .em-bento__name,
.em-bento .em-bento__fact { text-shadow: 0 1px 14px rgba(20,18,14,.5), 0 1px 2px rgba(20,18,14,.8); }
.em-bento .em-bento__count {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  min-width: 88px;
  max-width: calc(100% - 32px);
  padding: 6px 11px;
  border: 1px solid rgba(226,200,150,.42);
  border-radius: 999px;
  background: rgba(42,34,24,.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.em-bento .em-bento__caption {
  position: absolute;
  z-index: 2;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.em-bento .em-bento__copy { display: block; min-width: 0; }
.em-bento .em-bento__name {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(26px, 2.2vw, 32px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0;
  /* break only when a single word cannot fit; the narrow-slot sizes below are tuned so that it never happens >=340px */
  overflow-wrap: break-word;
  width: fit-content;
  max-width: 100%;
  padding-bottom: 4px; /* leaves the hover underline below the descenders (р, у, ф) */
}
.em-bento .em-bento__fact {
  display: block;
  min-height: 18px;
  margin-top: 3px;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
  color: #f5f0e7;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.em-bento .em-bento__arrow { flex: 0 0 22px; width: 22px; height: 22px; transition: transform .35s var(--ease); }
.em-bento .em-bento__fact [data-bento-price] { letter-spacing: .03em; }
.em-bento .em-bento__render {
  position: absolute;
  right: 16px;
  top: 20px; /* vertically centred against the 29px count pill that shares the row */
  z-index: 2;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(20,18,14,.62);
  color: rgba(255,255,255,.94);
  text-shadow: 0 1px 14px rgba(20,18,14,.5), 0 1px 2px rgba(20,18,14,.8);
  font-size: 10px;
  font-weight: 400;
  line-height: 14px;
  letter-spacing: .04em;
}
.em-bento .em-bento__more {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: clamp(240px, 25vw, 320px);
  gap: 12px;
  margin-top: 12px;
}
.em-bento .em-bento__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  min-width: 0;
  min-height: 52px;
  margin-top: 12px;
  padding: 12px 18px;
  border: 1px solid #8f8a74; /* 3.06:1 on --bg (WCAG 1.4.11 non-text contrast) */
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font: 400 13px/1.4 var(--font-ui);
  letter-spacing: .035em;
  white-space: normal;
  cursor: pointer;
}
.em-bento .em-bento__more[data-bento-more-count="1"] { grid-template-columns: minmax(0, 1fr); }
/* odd number of extra formats (e.g. 3 with «Під комерцію»): the last one becomes a wide tile across the row */
.em-bento .em-bento__more .em-bento__tile--span { grid-column: 1 / -1; }
.em-bento .em-bento__tile[data-bento-slug="komertsiia"] { --em-bento-crop: 50% 74%; }
/* ~450ms after the disclosure button is pressed the freshly revealed tiles sit under the pointer: ignore pointer input,
   so a double-click/second tap cannot navigate to a format page by accident (keyboard focus is unaffected) */
.em-bento.em-bento--settle .em-bento__tile { pointer-events: none; }
.em-bento .em-bento__symbol { flex: 0 0 18px; font-size: 23px; font-weight: 300; line-height: 18px; }
.em-bento .em-bento__empty { padding-block: 28px; color: var(--ink-soft); }
.em-bento[hidden], .em-bento [hidden] { display: none !important; }
/* Progressive enhancement: content remains visible when scripts are disabled. */
.em-bento:not(.em-bento--ready) .em-bento__reveal { opacity: 1; transform: none; }
.em-bento .em-bento__reveal { transition-delay: calc(var(--i, 0) * 60ms); }
.em-bento .em-bento__tile:focus-visible,
.em-bento .em-bento__catalog:focus-visible,
.em-bento .em-bento__toggle:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.em-bento .em-bento__tile:focus-visible { opacity: 1; transform: none; }
.em-bento .em-bento__tile:focus-visible::after { box-shadow: inset 0 0 0 3px #fff; }
.em-bento .em-bento__tile:focus:not(:focus-visible),
.em-bento .em-bento__catalog:focus:not(:focus-visible),
.em-bento .em-bento__toggle:focus:not(:focus-visible) { outline: none; }
@supports not selector(:focus-visible) {
  .em-bento .em-bento__tile:focus,
  .em-bento .em-bento__catalog:focus,
  .em-bento .em-bento__toggle:focus { outline: 3px solid var(--ink); outline-offset: 3px; }
  .em-bento .em-bento__tile:focus { opacity: 1; transform: none; }
  .em-bento .em-bento__tile:focus::after { box-shadow: inset 0 0 0 3px #fff; }
}
@media (forced-colors: active) {
  .em-bento .em-bento__tile:focus-visible,
  .em-bento .em-bento__catalog:focus-visible,
  .em-bento .em-bento__toggle:focus-visible { outline: 3px solid Highlight; }
  @supports not selector(:focus-visible) {
    .em-bento .em-bento__tile:focus,
    .em-bento .em-bento__catalog:focus,
    .em-bento .em-bento__toggle:focus { outline: 3px solid Highlight; }
  }
}
/* Few remaining formats: 3 = tall + stacked; 2 = equal pair; 1 = landscape. */
.em-bento .em-bento__grid[data-bento-count="3"] { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); }
.em-bento .em-bento__grid[data-bento-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: 320px; }
.em-bento .em-bento__grid[data-bento-count="1"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: 340px; }
.em-bento .em-bento__grid[data-bento-count="0"] { display: none; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .em-bento .em-bento__count { background: #302c24; }
}
@media (hover: hover) and (pointer: fine) {
  .em-bento .em-bento__tile:hover .em-bento__image { transform: scale(1.035); }
  .em-bento .em-bento__tile:hover .em-bento__arrow { transform: translate(2px, -2px); }
  .em-bento .em-bento__toggle:hover { background: var(--panel); border-color: var(--accent); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .em-bento .em-bento__name {
    background: linear-gradient(var(--accent-2), var(--accent-2)) left bottom / 0 1px no-repeat;
    transition: background-size .5s cubic-bezier(.16,1,.3,1);
  }
  .em-bento .em-bento__tile:hover .em-bento__name { background-size: 100% 1px; }
}
@media (max-width: 1100px) {
  .em-bento .em-bento__area { display: none; }
}
@media (max-width: 800px) {
  .em-bento .em-bento__head { gap: 18px; margin-bottom: 22px; }
  .em-bento .em-bento__title { font-size: clamp(32px, 7.4vw, 44px); }
  .em-bento .em-bento__grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, clamp(150px, 24vw, 200px)) clamp(165px, 22vw, 190px);
  }
  .em-bento .em-bento__tile--wide { grid-column: 1 / -1; grid-row: 3; }
  .em-bento .em-bento__grid[data-bento-count="3"] { grid-template-rows: repeat(2, clamp(150px, 24vw, 200px)); }
  .em-bento .em-bento__grid[data-bento-count="2"] { grid-template-rows: 250px; }
  .em-bento .em-bento__grid[data-bento-count="1"] { grid-template-rows: 280px; }
  .em-bento .em-bento__caption { left: 16px; right: 16px; bottom: 22px; gap: 8px; }
  .em-bento .em-bento__name { font-size: 24px; }
  .em-bento .em-bento__more { grid-auto-rows: 250px; }
}
@media (max-width: 600px) {
  .em-bento .em-bento__grid { grid-template-rows: 150px 150px 165px; }
  .em-bento .em-bento__grid[data-bento-count="3"] { grid-template-rows: 150px 150px; }
  .em-bento .em-bento__grid, .em-bento .em-bento__more { gap: 8px; }
  .em-bento .em-bento__more { margin-top: 8px; grid-auto-rows: 220px; }
  .em-bento .em-bento__toggle { margin-top: 8px; }
  .em-bento .em-bento__count { top: 11px; left: 10px; min-width: 76px; max-width: calc(100% - 20px); padding: 5px 8px; font-size: 10px; }
  .em-bento .em-bento__caption { left: 12px; right: 12px; bottom: 22px; gap: 5px; }
  /* Stack the corner label below the pill where both cannot fit in one line. */
  .em-bento .em-bento__render { top: 42px; right: 10px; }
  /* One fluid size for every format name (so neighbours never differ): the longest word («Однокімнатні», ~5.4em)
     has to fit the narrowest caption without a mid-word break — ≈101px at 360px in a small main slot. */
  .em-bento .em-bento__name { font-size: clamp(14px, 5vw, 21px); }
  .em-bento .em-bento__arrow { flex-basis: 17px; width: 17px; height: 17px; }
  .em-bento .em-bento__fact { display: none; }
  .em-bento .em-bento__catalog { letter-spacing: .08em; }
  /* the catalog link collapses to its arrow from 600px down: the h2 then keeps a single line down to 360px */
  .em-bento .em-bento__catalog { justify-content: center; width: 44px; gap: 0; }
  .em-bento .em-bento__catalog-text { display: none; }
}
@media (max-width: 480px) {
  .em-bento .em-bento__head { align-items: flex-end; gap: 12px; }
  .em-bento .em-bento__title { font-size: clamp(28px, 8.2vw, 36px); }
  .em-bento .em-bento__eyebrow { font-size: 11px; letter-spacing: .26em; margin-bottom: 10px; }
}
@media (max-width: 360px) {
  .em-bento .em-bento__caption { left: 10px; right: 10px; gap: 4px; }
  .em-bento .em-bento__arrow { flex-basis: 14px; width: 14px; height: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .em-bento .em-bento__image,
  .em-bento .em-bento__arrow,
  .em-bento .em-bento__reveal,
  .em-bento .em-bento__catalog::after,
  .em-bento .em-bento__catalog svg { transition: none !important; }
  .em-bento .em-bento__reveal { opacity: 1 !important; transform: none !important; }
  .em-bento .em-bento__tile:hover .em-bento__image,
  .em-bento .em-bento__tile:hover .em-bento__arrow,
  .em-bento .em-bento__catalog:hover .arrow { transform: none; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .em-bento .em-bento__count,
  .em-bento .em-bento__render { background: #302c24; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
