/* Портфолио homely space. Подключается после /blog/blog.css: шапка, футер,
   карточки и заголовки — оттуда, здесь только то, чего в блоге нет —
   фильтр по типу объекта, сетка фотографий и полноэкранный просмотр. */

/* ——— список ——— */
.phero h1 { grid-column: 1 / 13; font-size: clamp(56px, 10.4vw, 150px) }

.filters { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 8px }
.filters button {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 8px;
  height: 40px; padding: 13px 18px 0;
  border: 1px solid var(--cream-hair); border-radius: 20px 0 0 0;
  font-size: 12px; line-height: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-1);
  transition: border-color var(--dur-hover) var(--ease-slide), background var(--dur-hover) var(--ease-slide), color var(--dur-hover) var(--ease-slide);
}
.filters button span { font-size: 11px; letter-spacing: 0; color: var(--accent) }
.filters button:hover { border-color: var(--accent) }
.filters button[aria-pressed="true"] { background: var(--ink-1); border-color: var(--ink-1); color: var(--cream-1) }
.filters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
.pf-cat[hidden] { display: none }
.pf-cat .cards-head .count { font-size: 12px; letter-spacing: .17em; color: var(--ink-secondary); text-transform: uppercase; white-space: nowrap }
.filters + .pf-cat .cards-head, .pf-cat:first-of-type .cards-head { border-top: 0 }

.pf-card .card-body h3 { padding-right: 0 }
.pf-card img { aspect-ratio: 4 / 3 }

/* ——— объект ——— */
.pf-hero h1 { max-width: none }
/* Данные объекта. Отступы блока раньше держал лид-абзац над ним; он убран,
   поэтому раскладку и ритм задаём здесь, а не наследуем от .ameta .lede. */
.ameta dl { grid-column: 1 / 13; display: flex; flex-wrap: wrap; gap: 14px 56px; margin: 0; padding: 28px 0 44px }
.ameta dl > div { display: flex; flex-direction: column; gap: 10px }
.ameta dt { font-size: 11px; line-height: 11px; letter-spacing: .17em; text-transform: uppercase; color: var(--ink-secondary) }
.ameta dd { margin: 0; font-size: 16px; line-height: 20px; color: var(--ink-1) }
.ameta dd a { border-bottom: 1px solid var(--accent); transition: color var(--dur-hover) }
.ameta dd a:hover { color: var(--accent) }

.pf-photos { padding-top: 8px; padding-bottom: 32px }
.masonry { list-style: none; margin: 0; padding: 0; columns: 3; column-gap: 18px }
.masonry li { break-inside: avoid; margin-bottom: 18px }
.masonry a { display: block; overflow: hidden; background: var(--cream-card); cursor: zoom-in }
.masonry img { width: 100%; transition: transform .9s var(--ease-slide), opacity .3s ease }
.masonry a:hover img { transform: scale(1.025) }

.pf-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-top: 40px; padding-bottom: 8px }
.pf-pager a { display: flex; flex-direction: column; gap: 14px; padding: 26px 0; border-top: 1px solid var(--cream-hair) }
.pf-pager .next { align-items: flex-end; text-align: right }
.pf-pager .caps { display: inline-flex; gap: 10px; font-size: 12px; color: var(--ink-secondary); transition: color var(--dur-hover) }
.pf-pager .arr { color: var(--accent); letter-spacing: 0; transition: transform var(--dur-hover) var(--ease-slide) }
.pf-pager .name { font-family: Unbounded, sans-serif; font-weight: 300; font-size: clamp(20px, 2vw, 28px); line-height: 1.2; letter-spacing: -.016em; text-transform: uppercase }
.pf-pager a:hover .caps { color: var(--ink-1) }
.pf-pager .prev:hover .arr { transform: translateX(-4px) }
.pf-pager .next:hover .arr { transform: translateX(4px) }

/* ——— просмотр во весь экран ——— */
.lb {
  position: fixed; inset: 0; z-index: 250;
  background: rgba(21, 20, 19, .96); color: var(--cream-1);
  display: grid; grid-template-rows: 64px minmax(0, 1fr) 64px;
  animation: lbIn .24s ease;
  touch-action: pan-y;
}
.lb[hidden] { display: none }
@keyframes lbIn { from { opacity: 0 } to { opacity: 1 } }
.lb-top { display: flex; align-items: center; justify-content: space-between; padding: 0 24px }
.lb-count { font-size: 12px; letter-spacing: .17em; color: var(--ink-invert-quiet) }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; padding: 0 88px; min-height: 0 }
.lb-stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-drag: none }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%) }
.lb-nav.prev { left: 24px }
.lb-nav.next { right: 24px }
.lb .round svg { width: 16px; height: 16px }
.lb-cap { display: flex; align-items: center; justify-content: center; padding: 0 24px; font-size: 12px; color: var(--ink-invert-quiet); text-align: center }

/* ——— адаптив ——— */
@media (max-width: 1040px) {
  .masonry { columns: 2 }
}
@media (max-width: 640px) {
  /* Слово длинное: кегль от ширины строки, чтобы «ПОРТФОЛИО.» не переносилось. */
  .phero h1 { font-size: calc((100vw - 48px) / 8.4) }
  .filters { gap: 8px }
  .filters button { height: 36px; padding: 11px 14px 0; font-size: 11px }
  .masonry { columns: 1; column-gap: 0 }
  .masonry li { margin-bottom: 12px }
  .pf-hero h1 { font-size: 30px; line-height: 36px }
  .ameta dl { gap: 12px 36px; padding: 22px 0 32px }
  .pf-pager { grid-template-columns: 1fr; gap: 0 }
  .pf-pager .next { align-items: flex-start; text-align: left }
  .lb { grid-template-rows: 56px minmax(0, 1fr) 72px }
  .lb-stage { padding: 0 }
  .lb-nav { top: auto; bottom: -60px; transform: none }
  .lb-top { padding: 0 16px }
}
