/* ZH Marketing, rezultati.css
   „Резултати“: едро заглавие, което изостава (visuvate.com/works), плочки, които се разширяват до панел (cominvi),
   и в панела кратък текст до екрана в прозорец (Apollo). Прозорецът .h-window и числото .h-result са от home-shell.css,
   лентата .sv-next от uslugi.css, графиката .chart от site.css. Зарежда се след тях. Поведение: assets/js/rezultati.js.
   Без JS плочките са скрити, а панелите стоят отворени един под друг. */

html:has(.rezultati) { scrollbar-gutter: stable; }

/* ---------- Едро заглавие ---------- */
.r-hero { position: relative; z-index: 0; padding-top: calc(var(--header-h) + clamp(40px, 5.7vw, 82px)); padding-bottom: clamp(30px, 4.4vw, 63px); color: var(--paper); text-align: center; }
.r-hero h1 { font-size: clamp(72px, 23vw, 132px); max-width: none; white-space: nowrap; }
@media (min-width: 700px) { .r-hero h1 { font-size: clamp(150px, 15.4vw, 222px); } }
.r-hero h1 b { color: var(--signal); font-weight: 900; }
.r-hero .zh-hero-lead { max-width: none; margin-top: clamp(14px, 1.6vw, 22px); }
/* Изоставане както на Контакти и „За нас“ (shell.css, .zh-lag) */
.r-title { --lag-range: 230px; --lag-shift: 78px; }
@media (min-width: 700px) { .r-title { --lag-range: 385px; --lag-shift: 230px; } }
@media (prefers-reduced-motion: no-preference) {
  .r-hero h1 { animation: zh-line-in 760ms var(--ease-out) both; }
  .r-hero .zh-hero-lead { animation: zh-fade-in 600ms var(--ease-out) 240ms both; }
}

/* ---------- Плочки ---------- */
.r-wrap { position: relative; z-index: 1; color: var(--paper); overflow-x: clip; }
.r-grid { display: grid; gap: 12px; }
.r-grid > li { display: grid; max-width: none; }
@media (min-width: 760px) { .r-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); } }
.r-tile {
  container-type: inline-size; display: grid; grid-template-rows: auto 1fr auto auto; justify-items: start; gap: 6px; width: 100%; min-height: 268px; padding: clamp(18px, 2vw, 26px);
  font: inherit; color: var(--paper); text-align: left; cursor: pointer; background: rgba(12, 12, 12, 0.86);
  transition: opacity 300ms var(--ease-brand), transform var(--dur-fast) var(--ease-out), border-color 300ms var(--ease-brand);
}
/* По-плътно стъкло: заглавието минава отдолу */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .r-tile { background: rgba(12, 12, 12, 0.7); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
}
@media (min-width: 760px) { .r-tile { aspect-ratio: 1; min-height: 0; } }
.r-tile:active { transform: scale(0.985); }
.r-who { min-height: 28px; font-size: 15px; line-height: 1.35; }
.r-who img { flex: none; }
.r-num { align-self: end; font-size: clamp(88px, 38cqi, 176px); font-variant-numeric: lining-nums; white-space: nowrap; }
.r-num small { font-size: 0.42em; font-weight: 800; color: var(--signal); }
.r-label { font-size: clamp(16px, 5.4cqi, 19px); font-weight: 600; line-height: 1.4; color: var(--paper-72); }
.r-more { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-top: clamp(12px, 5cqi, 22px); padding-top: 14px; border-top: 1px solid var(--glass-line); font-size: 15px; font-weight: 600; }
.r-more i { position: relative; flex: none; width: 36px; height: 36px; border-radius: var(--r-pill); background: rgba(247, 247, 247, 0.12); transition: background-color 300ms var(--ease-brand), transform 300ms var(--ease-brand); }
.r-more i::before, .r-more i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 1.5px; margin: -0.75px 0 0 -7px; background: currentColor; }
.r-more i::after { transform: rotate(90deg); }
@media (hover: hover) and (pointer: fine) {
  /* cominvi: при посочване останалите плочки избледняват */
  .r-grid:has(.r-tile:hover) .r-tile:not(:hover) { opacity: 0.5; }
  .r-tile:hover { border-color: rgba(247, 247, 247, 0.3); }
  .r-tile:hover .r-more i { background: var(--signal); transform: rotate(90deg); }
}
.r-tile:focus-visible .r-more i { background: var(--signal); }
/* Докато панелът е отворен: плочката, от която е излязъл, е скрита, а съседните се отдръпват встрани */
.r-grid.is-open .r-tile { opacity: 0; transition: opacity 320ms linear, transform 600ms var(--ease-brand); }
.r-grid.is-open li.is-src .r-tile { transition-duration: 120ms; }
@media (min-width: 760px) {
  .r-grid.is-open li.is-before .r-tile { transform: translateX(-32px); }
  .r-grid.is-open li.is-after .r-tile { transform: translateX(32px); }
}
@media (prefers-reduced-motion: no-preference) {
  .js .rezultati [data-rise] { transition-delay: calc(var(--d, 0) * 100ms); }
}

/* ---------- Панел: диалог на целия екран, изрязан до правоъгълника на панела; расте от плочката (rezultati.js) ---------- */
.r-dialog {
  --r-x: max(20px, calc((100vw - 1320px) / 2)); --r-y: 20px;
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden;
  color: var(--paper); background: rgba(12, 12, 12, 0.95); clip-path: inset(var(--r-y) var(--r-x) round var(--r-card));
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .r-dialog { background: rgba(12, 12, 12, 0.8); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
}
.r-dialog::backdrop { background: rgba(12, 12, 12, 0); transition: background-color 420ms var(--ease-brand); }
.r-dialog.is-on::backdrop { background: rgba(12, 12, 12, 0.78); }
.r-in { position: absolute; inset: var(--r-y) var(--r-x); display: grid; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--glass-line); border-radius: var(--r-card); scrollbar-width: thin; scrollbar-color: rgba(247, 247, 247, 0.3) transparent; }
@media (max-width: 699px) {
  .r-dialog { --r-x: 0px; --r-y: 0px; clip-path: inset(0); }
  .r-in { border: 0; border-radius: 0; }
}
.r-close {
  grid-area: 1 / 1; position: sticky; top: 12px; z-index: 2; justify-self: end; align-self: start; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: 12px 12px 0 0; padding: 0 16px 0 18px;
  border: 0; border-radius: var(--r-pill); background: rgb(48, 48, 48); color: var(--paper); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background-color 220ms var(--ease-brand), transform var(--dur-press) var(--ease-out);
}
.r-close svg { width: 14px; height: 14px; }
.r-close:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .r-close:hover { background: var(--signal); } }
.r-body { grid-area: 1 / 1; align-self: center; display: grid; gap: clamp(32px, 4.4vw, 60px); padding: clamp(72px, 7vw, 96px) clamp(20px, 4.4vw, 64px) clamp(32px, 4.4vw, 64px); }
.r-main { display: grid; gap: clamp(32px, 4.4vw, 64px); align-items: center; }
@media (min-width: 1000px) { .r-main { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.r-copy { display: grid; justify-items: start; gap: 18px; min-width: 0; }
.r-copy h2 .n { font-size: clamp(96px, 11vw, 168px); }
.r-text { max-width: 26em; font-size: 17px; line-height: 1.6; color: var(--paper-72); }
.r-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; width: 100%; margin-top: 6px; border-top: 1px solid var(--glass-line); }
.r-facts > div { display: grid; gap: 6px; padding: 16px clamp(14px, 2vw, 26px) 0; border-left: 1px solid var(--glass-line); }
.r-facts > div:first-child { padding-left: 0; border-left: 0; }
.r-facts dt { font-size: 14px; line-height: 1.3; color: var(--paper-72); }
.r-facts dd { font-family: var(--cond); font-weight: 800; font-size: clamp(28px, 2.8vw, 38px); line-height: 1; font-variant-numeric: lining-nums; white-space: nowrap; }
@media (max-width: 479px) {
  .r-facts { grid-template-columns: 1fr; }
  .r-facts > div { grid-template-columns: 1fr auto; align-items: baseline; padding: 12px 0; border-left: 0; border-bottom: 1px solid var(--glass-line); }
}
.r-shot { display: grid; gap: 12px; min-width: 0; }
.r-shot figcaption { font-size: 14px; color: var(--paper-72); }
.r-shot .h-window { transition: transform var(--dur-base) var(--ease-out); }
.r-still { cursor: default; justify-self: start; max-width: 100%; }
.r-still img { width: auto; max-width: 100%; }
.r-still:hover, .r-still:active { transform: none; }

/* Месеците на Milano: графиката от site.css върху тъмното стъкло */
.r-months { display: grid; gap: clamp(18px, 2.4vw, 28px); padding-top: clamp(28px, 3.6vw, 48px); border-top: 1px solid var(--glass-line); }
.r-months h3 { font-size: clamp(30px, 3.4vw, 44px); }
.rezultati .chart { --plot: clamp(140px, 22vh, 220px); --mist: rgba(247, 247, 247, 0.24); --fg: var(--paper); --fg-2: var(--paper-72); view-transition-name: none; }
.rezultati .chart-col { border-radius: 4px; }
.rezultati .chart-val { font-family: var(--cond); font-weight: 800; font-size: clamp(20px, 2.2vw, 28px); line-height: 1; }
.rezultati .chart-detail { min-height: 3.2em; }
@media (max-width: 599px) { .rezultati .chart-frame { padding-right: 36px; } .rezultati .chart-month { font-size: 12px; overflow-wrap: anywhere; } }

/* Вход на съдържанието: текстът идва отляво, прозорецът пораства (cominvi) */
@media (prefers-reduced-motion: no-preference) {
  .r-dialog.is-opening [data-r-in] { animation: r-in 520ms var(--ease-out) calc(200ms + var(--i) * 55ms) both; }
  .r-dialog.is-opening [data-r-shot] { animation: r-shot 640ms var(--ease-out) 160ms both; }
  .r-dialog.is-opening .r-close { animation: zh-fade-in 300ms linear 380ms both; }
  .r-dialog.is-closing .r-in > * { opacity: 0; transition: opacity 140ms linear; }
  @keyframes r-in { from { opacity: 0; transform: translateX(-32px); } }
  @keyframes r-shot { from { opacity: 0; transform: translateX(40px) scale(0.96); } }
}

/* Целият екран: на тесен екран не се смалява до нечетимо, а се плъзга настрани */
.r-zoom { overflow-x: auto; border-radius: var(--r-cap); background: #fff; scrollbar-width: thin; }
.r-zoom:focus-visible { outline: 2px solid var(--paper); outline-offset: 4px; }
.r-proof .dialog-inner .r-zoom img { display: block; width: max(100%, 1100px); max-width: none; max-height: none; border-radius: 0; }

/* Лентата към формата */
.r-ask { margin-top: clamp(40px, 6vw, 88px); }

/* ---------- Без JS (или без <dialog>): панелите са отворени един под друг, плочките са излишни ---------- */
html:not(.js) .r-grid, .r-flat .r-grid { display: none; }
html:not(.js) .r-panels, .r-flat .r-panels { display: grid; gap: clamp(12px, 1.6vw, 20px); }
html:not(.js) .r-dialog, .r-flat .r-dialog { display: block; position: static; height: auto; overflow: visible; clip-path: none; border: 1px solid var(--glass-line); border-radius: var(--r-card); }
html:not(.js) .r-in, .r-flat .r-in { position: static; overflow: visible; border: 0; }
html:not(.js) .r-close, .r-flat .r-close { display: none; }
html:not(.js) .r-body, .r-flat .r-body { padding-top: clamp(28px, 4.4vw, 64px); }

.sharp .r-more i, .sharp .rezultati .chart-col { border-radius: 0; }
@media (prefers-reduced-motion: reduce) {
  .r-tile, .r-tile:active, .r-more i, .r-close, .r-close:active, .r-shot .h-window, .r-dialog::backdrop { transition: none; transform: none; }
  .r-grid.is-open .r-tile { transform: none; transition: none; }
}
