/* ==========================================================================
   Strony tekstowe: About, Contact, Exhibitions. Ładowany po site.css i work.css.
   ========================================================================== */

.page-flow > .text-page { flex: 1; }

.text-page {
  width: 100%;
  max-width: 2400px;
  margin: 0 auto;
  padding: clamp(20px, 4.5vw, 84px) var(--gutter-r) 0 var(--gutter-l);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  column-gap: clamp(32px, 6vw, 120px);
  align-items: start;
  animation: rise 1.2s ease .2s both;
}

/* zdanie otwierające po lewej */
.statement {
  position: sticky;
  top: clamp(120px, 11vw, 170px);
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.12;
  letter-spacing: .005em;
  max-width: 18ch;
  text-wrap: balance;
}

/* tekst po prawej */
.prose {
  max-width: 34rem;
  font-size: clamp(15.5px, 1.1vw, 18px);
  line-height: 1.8;
  color: #222;
}
.prose p + p { margin-top: 1.25em; }
.prose h3 {
  margin: 2.4em 0 .6em;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(22px, 1.8vw, 28px);
  line-height: 1.2;
  color: var(--ink);
}

/* miękko podkreślany link (ta sama kreska co w menu i na liście Work) */
.soft {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 100% calc(100% - .02em);
  padding-bottom: .12em;
  transition: background-size .6s cubic-bezier(.22, .61, .36, 1);
}
.soft:hover,
.soft:focus-visible {
  background-size: 100% 1px;
  background-position: 0% calc(100% - .02em);
}

/* ---------- Contact ---------- */
.contact-list .lead { margin-bottom: 2.2em; }
.contact-list dl > div + div { margin-top: 1.6em; }
.contact-list dt { margin-bottom: .3em; }
.contact-list dd {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(21px, 2.2vw, 34px);
  line-height: 1.25;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Contact: wstęp pod hasłem (lewa kolumna) */
.contact-intro {
  max-width: 30rem;
  margin-top: clamp(22px, 2.6vw, 44px);
  font-size: clamp(15.5px, 1.1vw, 18px);
  line-height: 1.8;
  color: #222;
}
.contact-intro p + p { margin-top: 1.1em; }

/* Contact: formularz w zdaniach. Pola to zwykłe input/select z etykietami (sr-only), wyglądają jak puste miejsca w liście. */
.photo-form { margin: 0 0 clamp(40px, 4.5vw, 72px); }
.photo-form .group-title { margin-bottom: clamp(14px, 1.6vw, 24px); }
.sentence {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(22px, 1.9vw, 30px);
  line-height: 2.15;
  color: var(--ink);
}
.sentence input,
.sentence select {
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid #bdbdba;
  border-radius: 0;
  padding: 0 .1em;
  margin: 0 0 0 .1em;
  max-width: 100%;
  outline: 0;
  vertical-align: baseline;
  transition: border-color .3s ease;
}
.sentence input::placeholder { color: var(--muted); font-style: italic; opacity: 1; }
.sentence .nb { white-space: nowrap; }
.sentence input[type="date"]::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; }
.sentence input[type="date"]:hover::-webkit-calendar-picker-indicator { opacity: .8; }
.sentence .f-name { width: 8em; }
.sentence .f-date { width: 8.4em; }
.sentence .f-detail { width: 11em; }
.sentence .f-contact { width: 11em; }
@supports (field-sizing: content) {
  .sentence input[type="text"] { field-sizing: content; width: auto; min-width: 5em; }
}
.sentence select {
  -webkit-appearance: none;
          appearance: none;
  padding-right: 1.2em;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6f6f' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .05em center;
  background-size: .8em;
}
.sentence select.is-empty { color: var(--muted); font-style: italic; }
.sentence select option { color: var(--ink); font-style: normal; font-family: var(--sans); }
.sentence input:hover,
.sentence select:hover { border-bottom-color: var(--muted); }
.sentence input:focus,
.sentence select:focus,
.sentence input:focus-visible,
.sentence select:focus-visible { border-bottom-color: var(--ink); outline: 0; }
.sentence [aria-invalid="true"] { border-bottom: 2px solid var(--ink); }

.keep { margin-top: clamp(16px, 1.8vw, 26px); }
.keep label {
  display: flex;
  align-items: flex-start;
  gap: .8em;
  max-width: 32rem;
  font-size: clamp(13px, .95vw, 15px);
  line-height: 1.65;
  color: #222;
  cursor: pointer;
}
.keep em { font-style: normal; color: var(--muted); }
.keep input {
  -webkit-appearance: none;
          appearance: none;
  flex: none;
  width: 17px;
  height: 17px;
  margin: .2em 0 0;
  background: transparent;
  border: 1px solid var(--muted);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .25s ease, border-color .25s ease;
}
.keep input:hover { border-color: var(--ink); }
.keep input:checked {
  border-color: var(--ink);
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 76% no-repeat;
}
.keep input:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: clamp(18px, 2vw, 30px); }
.send {
  padding: .85em 2.1em;
  font-family: var(--sans);
  font-size: clamp(10.5px, .8vw, 12.5px);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 3px;
  cursor: pointer;
  transition: background-color .3s ease, color .3s ease, opacity .3s ease;
}
.send:hover,
.send:focus-visible { background: var(--ink); color: var(--paper); }
.send[disabled] { opacity: .45; cursor: default; background: transparent; color: var(--ink); }
.send-hint { font-size: clamp(13px, .95vw, 15px); color: var(--muted); }
.send-hint.is-error { color: #b3261e; }
.form-status:empty { display: none; }
.form-status { flex-basis: 100%; margin: 0; font-size: clamp(13px, .95vw, 15px); line-height: 1.5; color: var(--ink); }
.form-status a { text-decoration: underline; text-underline-offset: .18em; }
.form-note { margin-top: 1.4em; font-size: clamp(12px, .85vw, 13.5px); line-height: 1.7; color: var(--muted); max-width: 32rem; }
.form-note a:hover { color: var(--ink); }
.form-done { margin: 0 0 clamp(40px, 4.5vw, 72px); outline: 0; }
.form-done .sentence { margin-bottom: .2em; }

/* bez JavaScriptu formularz się nie wysyła, więc go nie pokazujemy (jest <noscript> z adresem) */
html:not(.js) .photo-form { display: none; }

.contact-direct {
  padding-top: clamp(26px, 3vw, 44px);
  border-top: 1px solid var(--hair);
}
.contact-direct > div + div { margin-top: 1.6em; }
.contact-direct dt { margin-bottom: .3em; }
.contact-direct dd {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(21px, 2.2vw, 34px);
  line-height: 1.25;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* ---------- Exhibitions ---------- */
.shows-page { display: block; }
.shows { max-width: 1100px; }
.show-list { list-style: none; }
.show {
  display: grid;
  grid-template-columns: minmax(150px, 240px) minmax(0, 1fr);
  column-gap: clamp(20px, 4vw, 72px);
  row-gap: 4px;
  padding: clamp(16px, 1.8vw, 28px) 0;
  border-top: 1px solid var(--hair);
}
.show-date {
  padding-top: .55em;
  font-size: clamp(10.5px, .8vw, 12.5px);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.show h4 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 2.3vw, 40px);
  line-height: 1.15;
}
.show-venue { margin-top: .25em; font-size: clamp(15px, 1.05vw, 17px); color: #222; }
.show-note,
.show-addr { margin-top: .5em; font-size: clamp(13px, .9vw, 14.5px); color: var(--muted); line-height: 1.7; }
.show-addr a:hover { color: var(--ink); }
.is-upcoming .show-date { color: var(--ink); }

/* ABOUT: zdanie + zdjęcie w lewej kolumnie.
   Cały blok jest przyklejony (sticky) i ma wysokość ekranu pod nagłówkiem; zdjęcie wypełnia resztę miejsca
   pod zdaniem i zawsze mieści się w całości (bez kadrowania). */
.about-side {
  position: sticky;
  top: clamp(120px, 11vw, 170px);
  height: calc(100svh - clamp(120px, 11vw, 170px) - 64px);
  display: flex;
  flex-direction: column;
}
.about-side .statement { position: static; flex: none; }
.about-photo {
  flex: 1 1 auto;
  min-height: 0;
  margin: clamp(22px, 2.6vw, 44px) 0 0;
  display: flex;
  flex-direction: column;
}
.about-photo .ph {
  flex: 1 1 auto;
  min-height: 0;
  container-type: size;
}
.about-photo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100cqw;
  max-height: 100cqh;
}
.about-photo figcaption {
  flex: none;
  margin-top: .7rem;
  font-size: clamp(10.5px, .78vw, 12.5px);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
/* niski ekran (np. laptop w poziomie z paskami): bez przyklejania, zdjęcie ma stały maksymalny rozmiar */
@media (max-height: 680px) {
  .about-side { position: static; height: auto; }
  .about-photo .ph { container-type: normal; flex: none; }
  .about-photo img { max-width: 100%; max-height: 60svh; }
}

/* ==========================================================================
   ROZKŁAD KSIĄŻKI (komputery z myszą, szerokość od 820 px) — tak samo jak na stronie Work
   Lewa strona: zdanie otwierające (na About ze zdjęciem). Prawa strona: tekst lub lista.
   Przez środek biegnie cienka linia. Strona się nie przewija: nagłówek u góry, stopka na dole,
   a każda połowa przewija się osobno (bez widocznego paska; gdy treść jest dłuższa niż okno, pod kolumną pojawia się strzałka).
   Telefon i ekrany dotykowe tego nie używają: kolumny jedna pod drugą, zwykłe przewijanie.
   ========================================================================== */
@media (min-width: 820px) and (hover: hover) {
  /* sama strona nigdy się nie przewija, więc linia pod nagłówkiem (pojawiająca się po przewinięciu) tu nie występuje */
  html:has(.page-flow > .text-page) { overflow: hidden; }
  .page-flow:has(> .text-page) .topbar::after { display: none; }
  .page-flow:has(> .text-page) { height: max(100svh, 480px); min-height: 0; }
  .page-flow:has(> .text-page) > .legal { margin-top: clamp(10px, 1.4vw, 20px); }

  .page-flow > .text-page {
    --spine: clamp(32px, 5vw, 96px);       /* odstęp tekstu i zdjęcia od linii */
    position: relative;
    min-height: 0;
    overflow: hidden;
    display: grid;                          /* także dla Exhibitions (.shows-page) */
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    column-gap: 0;
    align-items: stretch;
    padding-top: clamp(0px, 1.2vw, 20px);
  }

  /* linia pośrodku (grzbiet książki) */
  .text-page::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--gutter-l) + (100% - var(--gutter-l) - var(--gutter-r)) / 2);
    width: 1px;
    background: var(--hair);
    pointer-events: none;
  }

  /* obie połowy: własne przewijanie, bez paska */
  .text-page > .statement,
  .text-page > .about-side,
  .text-page > .prose,
  .text-page > .shows {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-top: 8px;
    padding-bottom: 12px;
    margin-bottom: 40px;                   /* pas pod kolumną: tu stoi strzałka „jest dalej” (js/header.js) */
  }
  .text-page > .statement::-webkit-scrollbar,
  .text-page > .about-side::-webkit-scrollbar,
  .text-page > .prose::-webkit-scrollbar,
  .text-page > .shows::-webkit-scrollbar { display: none; }

  /* lewa strona */
  .text-page > .statement,
  .text-page > .about-side { padding-right: var(--spine); }
  .statement { position: static; }
  .text-page > .statement { max-width: calc(18ch + var(--spine)); }
  .about-side { position: static; height: auto; }

  /* prawa strona */
  .text-page > .prose { max-width: calc(34rem + var(--spine)); padding-left: var(--spine); }
  .text-page > .shows { max-width: none; padding-left: var(--spine); }
}

@media (max-width: 819px) {
  .text-page { display: block; padding-top: 18px; }
  .statement { position: static; margin-bottom: 28px; max-width: none; font-size: clamp(32px, 9vw, 44px); }
  .about-side { position: static; height: auto; display: block; margin-bottom: 36px; }
  .about-side .statement { margin-bottom: 0; }
  .about-photo { margin-top: 24px; display: block; }
  .about-photo .ph { container-type: normal; }
  .about-photo img { max-width: 100%; max-height: 70svh; }
  .show { display: block; }
  .show-date { padding-top: 0; margin-bottom: .4em; }
}

@media (prefers-reduced-motion: reduce) {
  .text-page { animation: none; }
  .soft { transition: none; }
}
