/* ==========================================================
   components.css — nav, footer, кнопки, чипи, плитки, заглушки.
   Класи .is-hover / .is-focus потрібні лише сторінці Stilbuch,
   щоб показати стани без наведення мишкою.
   ========================================================== */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* --- Skip link: видно лише при фокусі з клавіатури --- */
.skip {
  position: fixed; left: 16px; top: -80px; z-index: 100;
  padding: 14px 22px; border-radius: 999px;
  background: var(--tinte); color: var(--papier);
  font-weight: 500; font-size: 14px; letter-spacing: .09em; text-transform: uppercase;
  text-decoration: none;
  transition: top var(--t-fast) var(--ease);
}
.skip:focus-visible { top: 12px; }

/* --- Маркерне підкреслення --- */
.mark, .nav a[aria-current="page"], .nav .lang__cur {
  background: url("/assets/img/underline/u1_l.svg") no-repeat 0 100% / 100% 9px;
  padding-bottom: 8px;
}
/* 11.11 (Софія): червоне підкреслення текстових посилань (.tlink) лише ПРИ НАВЕДЕННІ, на світлому і темному; рух лише transform */
.tlink { position: relative; padding-bottom: 8px; }
.tlink::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9px;
  background: url("/assets/img/underline/u1_l.svg") no-repeat 0 100% / 100% 9px;
  transform: scaleX(0); transform-origin: left center; transition: transform .4s var(--ease);
}
.on-dark .tlink::after, .tlink--dark::after { background-image: url("/assets/img/underline/u1_d.svg"); }
.tlink:hover::after, .tlink:focus-visible::after { transform: scaleX(1); }
.tlink.is-disabled:hover::after { transform: scaleX(0); }
@media (prefers-reduced-motion: reduce) { .tlink::after { transition: none; } }

/* --- NAV: фіксована, завжди видима --- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--nav-h);
  padding: 0 var(--gutter);
  background: rgba(242, 238, 229, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(17, 17, 17, .12);
}
.nav__logo {
  display: inline-flex; align-items: center; min-height: 44px;
  font-family: var(--font-display); text-transform: uppercase; text-decoration: none;
  font-size: 22px; line-height: var(--lh-display); letter-spacing: .01em;
}
.nav__short { display: none; }
.nav__links { display: flex; align-items: center; gap: clamp(2px, 1.4vw, 22px); }
.nav__links a, .nav .lang a, .nav .lang__cur, .nav__cv {
  display: inline-flex; align-items: center; min-height: 44px;
  padding: 0 clamp(6px, .9vw, 12px);
  font-size: var(--fs-label); font-weight: 500; letter-spacing: .09em;
  text-transform: uppercase; line-height: var(--lh-label); text-decoration: none; white-space: nowrap;
}
.nav a[aria-current="page"], .nav .lang__cur {
  background-position: 12px calc(50% + 14px);
  background-size: calc(100% - 24px) 9px;
  padding-bottom: 0;
}
.nav .lang { display: inline-flex; align-items: center; }
.nav .lang__cur { color: var(--rot); font-weight: 500; }
.nav .lang__sep { height: 18px; width: 1px; background: var(--tinte); }
.nav__cv .short { display: none; }
.nav__links a:hover, .nav__links a.is-hover, .nav .lang a:hover { color: var(--rot); }

/* Вимкнене резюме (поки PDF нема) */
.is-disabled, [aria-disabled="true"] { opacity: .38; pointer-events: none; cursor: default; }

/* Мобільне меню: все в один ряд */
@media (max-width: 820px) {
  :root { --nav-h: 56px; }
  .nav { gap: 4px; padding: 0 12px; }
  .nav__full { display: none; }
  .nav__short { display: inline; }
  .nav__logo { font-size: 20px; padding-right: 4px; }
  .nav__links { gap: 0; }
  .nav__links a, .nav .lang a, .nav .lang__cur, .nav__cv {
    padding: 0 5px; letter-spacing: .03em; font-size: 12px;
  }
  .nav a[aria-current="page"], .nav .lang__cur {
    background-position: 5px calc(50% + 13px);
    background-size: calc(100% - 10px) 7px;
  }
  .nav__cv .long { display: none; }
  .nav__cv .short { display: inline; }
}
/* Дуже вузькі екрани: логотип зверху, меню другим рядком */
@media (max-width: 380px) {
  :root { --nav-h: 100px; }
  .nav { flex-wrap: wrap; align-content: center; justify-content: center; row-gap: 0; }
  .nav__logo { width: 100%; justify-content: center; }
  .nav__links { width: 100%; justify-content: center; }
}

body { padding-top: var(--nav-h); }
main[id] { scroll-margin-top: var(--nav-h); }

/* --- Кнопка «Pille» --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 52px; padding: 16px 30px;
  border: 0; border-radius: 999px;
  background: var(--tinte); color: var(--papier);
  font-family: var(--font-text); font-weight: 500; font-size: 14px;
  letter-spacing: .09em; text-transform: uppercase; line-height: 1.2; text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn:hover, .btn.is-hover { background: var(--rot); color: var(--papier); transform: translateY(-2px); }
.btn.is-focus { outline: 2px solid var(--rot); outline-offset: 4px; }
.btn--cream { background: var(--licht); color: var(--tinte); }
.btn--cream:hover, .btn--cream.is-hover { background: var(--rot); color: var(--licht); }
.on-dark :focus-visible, .btn--cream:focus-visible, .btn--cream.is-focus { outline-color: var(--rot-nacht); }

/* --- Текстове посилання з маркером (вторинна дія) --- */
.tlink {
  display: inline-block; text-decoration: none;
  font-weight: 500; font-size: 14px; letter-spacing: .09em; text-transform: uppercase; line-height: 1.3;
}
.tlink:hover, .tlink.is-hover { color: var(--rot); }
.on-dark .tlink:hover, .tlink--dark:hover { color: var(--rot-nacht); }

/* --- Чипи-фільтр (без рамок; активний = маркер + aria-pressed) --- */
.filter { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.chip {
  min-height: 44px; padding: 0 14px; border: 0; background: none; cursor: pointer;
  font-weight: 500; font-size: var(--fs-label); letter-spacing: .09em; text-transform: uppercase;
  color: var(--grau);
  transition: color var(--t-fast) var(--ease);
}
.chip:hover, .chip.is-hover { color: var(--rot); }
.chip[aria-pressed="true"] {
  color: var(--tinte);
  background: url("/assets/img/underline/u1_l.svg") no-repeat 14px calc(50% + 14px) / calc(100% - 28px) 9px;
}
.chip.is-focus { outline: 2px solid var(--rot); outline-offset: 4px; }

/* --- Заглушка зображення .ph (розмітка плитки не змінюється при заміні) --- */
.ph { position: relative; display: block; width: 100%; height: 100%; }
.ph::after {
  content: attr(data-label);
  position: absolute; left: 14px; bottom: 12px;
  font-style: italic; font-weight: 500; font-size: 10.5px; line-height: 1.2;
  letter-spacing: .09em; text-transform: uppercase;
  color: rgba(242, 238, 229, .85);
}
.ph--dark  { background: linear-gradient(160deg, #2b2e33 0%, #15171a 100%); }
.ph--beige { background: linear-gradient(160deg, #cfc7b6 0%, #b3a995 100%); }
.ph--beige::after { color: rgba(17, 17, 17, .7); }
.ph--red   { background: var(--rot-karte); }
.ph--stone { background: linear-gradient(170deg, #4a453e 0%, #1c1b19 100%); }

/* --- Плитка проєкту 4:5 --- */
.tile { position: relative; }
.tile[hidden] { display: none; }
.tile__link { display: flex; flex-direction: column; gap: 14px; text-decoration: none; }
.tile__media { position: relative; overflow: hidden; aspect-ratio: 4 / 5; border-radius: 3px; }
.tile__media > * { transition: transform var(--t-slow) var(--ease); }
.tile__link:hover .tile__media > *, .tile.is-hover .tile__media > * { transform: scale(1.02); }
/* Фото в плитці (кейс Transformation): заповнює рамку 4:5 */
.tile__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 38% 50%; }
.tile__cta {
  position: absolute; left: 14px; right: 14px; top: 14px;
  opacity: 0; transition: opacity var(--t-fast) var(--ease);
  font-weight: 500; font-size: var(--fs-label); letter-spacing: .09em; text-transform: uppercase;
  color: var(--licht);
}
.tile__link:hover .tile__cta, .tile__link:focus-visible .tile__cta, .tile.is-hover .tile__cta { opacity: 1; }
/* 07.11 (запит §7.2): мета-рядок «01 · GRAFIK, VIDEO» над назвою (номер в акценті), назва на всю ширину, нижче рядок типу проєкту */
.tile__meta { margin: 0 0 6px; font-size: var(--fs-label); font-weight: 500; letter-spacing: .09em; text-transform: uppercase; line-height: var(--lh-label); color: var(--grau); }
.tile__nr { color: var(--rot); }
.tile__title {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(1.5rem, 2.2vw, 2.25rem); line-height: var(--lh-display);
}
.tile__title { margin: 0; }
.tile__type { margin: 4px 0 0; font-size: 13px; line-height: 1.3; color: var(--rot); font-weight: 500; }

/* --- Footer --- */
.footer { position: relative; z-index: 1; padding: 40px var(--gutter) 48px; border-top: 1px solid rgba(17, 17, 17, .12); background-color: var(--papier); }
.footer__inner {
  max-width: var(--max); margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  font-size: var(--fs-label); line-height: var(--lh-label); color: var(--grau);
}
.footer__copy { margin-right: 14px; }
.footer a, .footer .lang__cur {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px;
  text-decoration: none; letter-spacing: .09em; text-transform: uppercase; font-weight: 500;
  color: var(--tinte);
}
.footer a:hover { color: var(--rot); }
.footer .lang { display: inline-flex; align-items: center; }
.footer .lang__cur { color: var(--rot); background: none; }
.footer .lang__sep { height: 18px; width: 1px; background: var(--tinte); }
.footer a[aria-current="page"] { background: url("/assets/img/underline/u1_l.svg") no-repeat 8px calc(50% + 14px) / calc(100% - 16px) 9px; }

/* --- Службова мітка «текст відсутній» (лише розробка; check.py її не пропустить) --- */
.todo { background: #c00; color: #fff; padding: 0 .4em; font: 700 12px/1.6 var(--font-text); letter-spacing: .05em; }

/* --- Рух вимкнено --- */
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn.is-hover { transform: none; }
  .tile__link:hover .tile__media > * { transform: none; }
}

/* --- Плитка: широка (перша на головній) і короткий текст --- */
.tile__text { font-size: 15px; line-height: var(--lh-text); color: var(--grau); max-width: 56ch; }

/* Найвужчі екрани (320px): трохи менші поля між пунктами меню */
@media (max-width: 340px) {
  .nav__links a, .nav .lang a, .nav .lang__cur, .nav__cv { padding: 0 3px; letter-spacing: .02em; }
  .nav a[aria-current="page"], .nav .lang__cur { background-position: 3px calc(50% + 13px); background-size: calc(100% - 6px) 7px; }
}


/* Мала галерея «Weitere Projekte» в кінці кейсів: темна смуга, приглушені мініатюри (рішення Софії 06.11) */
.mg { background: var(--nacht); color: var(--licht); padding: clamp(48px, 6vw, 88px) var(--gutter); }
.mg__head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.mg__h { margin: 0; font-family: var(--font-text); font-size: clamp(1.3rem, 1.9vw, 1.9rem); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: 1; }
.mg__all { color: inherit; font-size: 16px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; text-decoration: none; background: url(/assets/img/underline/u1_d.svg) no-repeat 0 100% / 100% 9px; padding-bottom: 8px; }
.mg__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: clamp(10px, 1.6vw, 22px); }
.mg__list--7 { grid-template-columns: repeat(7, 1fr); } /* без inline style: CSP */
@media (max-width: 820px) { .mg__list, .mg__list--7 { grid-template-columns: repeat(3, 1fr); } }
.mg__list a { display: block; color: inherit; text-decoration: none; }
.mg__img { display: block; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, .08); }
.mg .mg__img img { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; filter: grayscale(.8) brightness(.8); opacity: .7; transition: transform .4s cubic-bezier(.22, 1, .36, 1), opacity .4s, filter .4s; }
.mg__list a:hover .mg__img img, .mg__list a:focus-visible .mg__img img { filter: none; opacity: 1; transform: scale(1.04); }
.mg__t { display: block; margin-top: 10px; font-size: 16px; line-height: 1.3; opacity: 1; }
.mg__list a:hover .mg__t { text-decoration: underline; }
.mg a:focus-visible { outline: 2px solid var(--rot-nacht); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .mg__img img { transition: none; } .mg__list a:hover .mg__img img { transform: none; } }

/* SISTERS: кадр широкий, а плитка/мініатюра вузька. Зсуваємо кадрування, щоб логотип не різався */
.tile--sisters .tile__img, .mg-sisters .mg__img img, .mg-sisters .dr-more__img img { object-position: 52% 50%; }


/* ==== 07.11 паритет з прототипами (запит §6.1.3) ==== */
/* Меню й футер: при наведенні знизу вирастає лінія (scaleX, 0,5 с). Поточна сторінка вже має маркерне підкреслення. */
.nav__links a:not([aria-current="page"]), .nav__cv, .footer a:not([aria-current="page"]) { position: relative; }
.nav__links a:not([aria-current="page"])::after, .nav__cv::after, .footer a:not([aria-current="page"])::after {
  content: ""; position: absolute; left: clamp(6px, .9vw, 12px); right: clamp(6px, .9vw, 12px); bottom: 9px; height: 1px;
  background: var(--rot); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); pointer-events: none;
}
.footer a:not([aria-current="page"])::after { left: 8px; right: 8px; }
.nav__links a:not([aria-current="page"]):hover::after, .nav__links a:not([aria-current="page"]):focus-visible::after, .nav__cv:hover::after, .nav__cv:focus-visible::after,
.footer a:not([aria-current="page"]):hover::after, .footer a:not([aria-current="page"]):focus-visible::after { transform: scaleX(1); }
.lang a::after { display: none; }
/* Контакти (11.11, Софія): посилання внизу сторінки підкреслюються червоним ПРИ НАВЕДЕННІ (як меню), без світлої заливки. Підкреслення рухається лише через transform. */
.kontakt__links .tlink { position: relative; background: none; padding-bottom: 8px; }
.kontakt__links .tlink::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 9px;
  background: url("/assets/img/underline/u1_d.svg") no-repeat 0 100% / 100% 9px;
  transform: scaleX(0); transform-origin: left center; transition: transform .4s var(--ease);
}
.kontakt__links .tlink:hover::after, .kontakt__links .tlink:focus-visible::after { transform: scaleX(1); }
.kontakt__links .tlink.is-disabled:hover::after { transform: scaleX(0); }
@media (prefers-reduced-motion: reduce) {
  .nav__links a::after, .nav__cv::after, .footer a::after, .kontakt__links .tlink::after { transition: none; }
}

/* 07.11 перевірка сайту: «назад» у кейсах мало не мала клікабельної висоти (17 px); ціль торкання ≥ 44 px без зміни вигляду */
a.back, a.zn-mark, a.ct-back { display: inline-flex; align-items: center; min-height: 44px; }

/* мобільний перемикач DE|EN: ширша зона дотику (було 27 px) */
@media (max-width: 820px) { .nav .lang a, .nav .lang .lang__cur { min-width: 34px; justify-content: center; text-align: center; } }

/* 11.11 (за зауваженнями Софії): назви плиток менші; номер справа в рядку тегів, не ламає верстку */
.tile__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tile__nr { color: var(--rot); flex: none; }
.tile__title { font-size: clamp(1.15rem, 1.55vw, 1.55rem); line-height: 1.08; }

/* 11.11 (б): у верхньому меню поточна сторінка/мова без кривого маркерного підкреслення: лише червоний колір; рівна червона лінія з'являється при наведенні */
.nav a[aria-current="page"], .nav .lang__cur { background: none; color: var(--rot); }

/* Natalya (Personal Branding): похилий пост з її Instagram поверх фото, без мокапа. rotate (а не transform), щоб hover-масштаб плитки його не скидав */
.tile__ig { position: absolute; right: -9%; bottom: 7%; width: 46%; rotate: -7deg; border: 4px solid var(--papier); border-radius: 2px; overflow: hidden; box-shadow: 0 16px 30px rgba(20, 10, 10, .35); pointer-events: none; }
.tile__ig img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }
