/* =========================================================
   RDZA I DROGA — dziennik pokładowy starego włóczęgi
   Paleta: tektura / papier / smar / rdza / dżins
   ========================================================= */

:root {
  --piach:   #cdb996;   /* tło zapasowe: piach */
  --papier:  #e6dcc3;   /* kartka dziennika */
  --print:   #f1ead8;   /* ramka odbitki fotograficznej */
  --smar:    #261f15;   /* atrament / przepracowany olej */
  --tekst:   #33291c;   /* tekst na papierze */
  --rdza:    #9a431c;   /* rdza na błotniku */
  --dzins:   #4f6a80;   /* spłowiały drelich, tusz pieczątki */
  --noc:     #1b1610;   /* wnętrze warsztatu po zmroku */
  --noc-tekst: #d8ccb2;

  --f-display: "Brygada 1918", Georgia, serif;
  --f-body: "IBM Plex Serif", Georgia, serif;
  --f-mono: "IBM Plex Mono", "Courier New", monospace;
  --f-hand: "Caveat", cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  color: var(--tekst);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;

  background-color: var(--piach); /* zapas, gdyby zdjęcie się nie wczytało */
}

/* tło: wrak przy jeziorze, wyblakły pod piaskowo-rdzawą mgiełką */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(165deg,
      rgba(211, 191, 154, 0.86) 0%,
      rgba(198, 168, 124, 0.82) 55%,
      rgba(160, 96, 52, 0.72) 100%),
    url("img/background.jpg");
  background-size: cover;
  background-position: center 60%;
  filter: sepia(0.35) saturate(0.8) brightness(1.06);
}

/* ziarno — kurz na wszystkim */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; }

/* =================== HERO =================== */

.hero {
  position: relative;
  min-height: 92vh;
  overflow: hidden;
  background: var(--noc);
}

.hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: saturate(0.82) contrast(1.04) sepia(0.12);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(15deg, rgba(27, 22, 16, 0.92) 0%, rgba(27, 22, 16, 0.45) 45%, rgba(27, 22, 16, 0) 70%),
    linear-gradient(rgba(154, 67, 28, 0.10), rgba(154, 67, 28, 0.10));
}

.hero-stamp {
  position: absolute;
  z-index: 2;
  top: clamp(1.2rem, 4vw, 3rem);
  right: clamp(1.2rem, 4vw, 3rem);
  transform: rotate(5deg);
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.7;
  color: rgba(230, 220, 195, 0.85);
  border: 2px dashed rgba(230, 220, 195, 0.55);
  padding: 0.7rem 1rem;
}

.hero-title {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 92vh;
  padding: clamp(1.5rem, 5vw, 4.5rem);
  max-width: 60rem;
}

.hero-eyebrow {
  font-family: var(--f-mono);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 0.8rem;
  color: #d9a06b;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(3.4rem, 11vw, 8.5rem);
  line-height: 0.95;
  color: var(--papier);
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.45);
  margin-bottom: 1.4rem;
}

.hero-sub {
  font-family: var(--f-body);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  color: rgba(230, 220, 195, 0.92);
  max-width: 34rem;
}

/* =================== MANIFEST =================== */

.manifest {
  background: var(--noc);
  color: var(--noc-tekst);
  padding: clamp(4rem, 9vw, 7.5rem) clamp(1.5rem, 5vw, 4.5rem);
  border-top: 3px solid var(--rdza);
}

.manifest-inner {
  max-width: 68rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.manifest-pull {
  font-family: var(--f-display);
  font-weight: 600;
  font-style: italic;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.25;
  color: var(--papier);
  border-left: 3px solid var(--rdza);
  padding-left: 1.4rem;
}

.manifest-text p + p { margin-top: 1.2em; }

.manifest-text {
  font-size: 1.05rem;
  color: var(--noc-tekst);
}

.manifest-sign {
  font-family: var(--f-hand);
  font-size: 2.6rem;
  color: var(--rdza);
  transform: rotate(-3deg);
  margin-top: 1.4rem !important;
}

/* =================== WPISY =================== */

.entries {
  padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 4vw, 3rem) clamp(5rem, 10vw, 8rem);
  max-width: 78rem;
  margin: 0 auto;
}

.entries-head {
  max-width: 46rem;
  margin: 0 auto clamp(3rem, 6vw, 5rem);
  text-align: center;
}

.entries-head h2 {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  color: var(--smar);
}

.entries-note {
  font-family: var(--f-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--rdza);
  margin-top: 0.8rem;
}

/* — kartka wpisu — */

.entry {
  background: var(--papier);
  box-shadow: 0 2px 5px rgba(56, 38, 20, 0.25), 0 14px 36px rgba(56, 38, 20, 0.22);
  margin-bottom: clamp(2.2rem, 5vw, 3.6rem);
  border-radius: 2px;
}

.entry summary {
  list-style: none;
  cursor: pointer;
  padding: clamp(1.4rem, 4vw, 3rem);
}

.entry summary::-webkit-details-marker { display: none; }

.entry summary:focus-visible {
  outline: 3px dashed var(--rdza);
  outline-offset: 4px;
}

.entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.6rem, 4vw, 3.4rem);
  align-items: center;
}

.entry--flip .entry-grid .entry-photo-wrap { order: 2; }
.entry--flip .entry-grid .entry-meta { order: 1; }

/* odbitka przyklejona taśmą */

.entry-photo-wrap {
  position: relative;
  display: block;
  background: var(--print);
  padding: 0.7rem 0.7rem 0.9rem;
  box-shadow: 0 3px 10px rgba(38, 31, 21, 0.28);
  transform: rotate(-1.4deg);
  transition: transform 0.35s ease;
}

.entry--flip .entry-photo-wrap { transform: rotate(1.2deg); }

.entry summary:hover .entry-photo-wrap,
.entry[open] .entry-photo-wrap {
  transform: rotate(0deg) scale(1.01);
}

.entry-photo-wrap::before,
.entry-photo-wrap::after {
  content: "";
  position: absolute;
  width: 6.5rem;
  height: 1.7rem;
  background: linear-gradient(rgba(214, 199, 160, 0.75), rgba(196, 178, 135, 0.65));
  box-shadow: 0 1px 3px rgba(38, 31, 21, 0.2);
  opacity: 0.9;
}

.entry-photo-wrap::before {
  top: -0.8rem;
  left: -1.6rem;
  transform: rotate(-38deg);
}

.entry-photo-wrap::after {
  bottom: -0.7rem;
  right: -1.6rem;
  transform: rotate(-42deg);
}

.entry-photo {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  filter: saturate(0.88) sepia(0.08);
}

.photo-caption {
  display: block;
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #6e6455;
  padding-top: 0.55rem;
  text-align: right;
}

/* — meta: pieczątka, tytuł, cytat — */

.entry-meta { display: block; }

.entry-stamp {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dzins);
  border: 1.5px solid currentColor;
  padding: 0.35rem 0.7rem;
  transform: rotate(-1deg);
  margin-bottom: 1.3rem;
}

.entry-title {
  display: block;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.15;
  color: var(--smar);
  margin-bottom: 1.3rem;
}

.entry-quote { display: block; }

.entry-quote .quote-text {
  display: block;
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.45;
  color: var(--rdza);
}

.entry-quote cite {
  display: block;
  font-family: var(--f-mono);
  font-style: normal;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--tekst);
  margin-top: 0.8rem;
}

.entry-quote .work { font-style: italic; }

/* — otwórz / złóż — */

.entry-toggle {
  display: inline-block;
  margin-top: 1.6rem;
  font-family: var(--f-mono);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rdza);
  border-bottom: 2px dashed var(--rdza);
  padding-bottom: 0.25rem;
}

.entry summary:hover .entry-toggle { border-bottom-style: solid; }

.toggle-close { display: none; }
.entry[open] .toggle-open { display: none; }
.entry[open] .toggle-close { display: inline; }

/* — rozłożony wpis — */

.entry-body {
  padding: 0 clamp(1.4rem, 4vw, 3rem) clamp(2rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.6rem, 4vw, 3.4rem);
  align-items: start;
  border-top: 1px dashed rgba(38, 31, 21, 0.3);
  padding-top: clamp(1.6rem, 3vw, 2.4rem);
  margin-top: 0.4rem;
}

.entry[open] .entry-body { animation: unfold 0.5s ease both; }

@keyframes unfold {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.entry-text {
  max-width: 62ch;
  font-size: 1.02rem;
}

.entry-text p + p { margin-top: 1.1em; }

.entry-text p:first-child::first-letter {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 3.1em;
  line-height: 0.8;
  float: left;
  padding-right: 0.12em;
  color: var(--rdza);
}

/* dodatkowe odbitki w galerii */

.entry-extra {
  background: var(--print);
  padding: 0.6rem 0.6rem 0.8rem;
  box-shadow: 0 3px 10px rgba(38, 31, 21, 0.28);
  transform: rotate(1.6deg);
  max-width: 26rem;
  justify-self: center;
}

.entry-extra img { filter: saturate(0.88) sepia(0.08); }

.entry-extra figcaption {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: #6e6455;
  padding-top: 0.55rem;
}

/* =================== STOPKA =================== */

.footer {
  background: var(--noc);
  color: var(--noc-tekst);
  text-align: center;
  padding: clamp(3.5rem, 8vw, 6rem) 1.5rem;
  border-top: 3px solid var(--rdza);
}

.footer-quote {
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--papier);
  margin-bottom: 1.2rem;
}

.footer-sign {
  font-family: var(--f-mono);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d9a06b;
  margin-bottom: 0.6rem;
}

.footer-small {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(216, 204, 178, 0.55);
}

.footer-author {
  font-family: var(--f-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(216, 204, 178, 0.55);
  margin-top: 0.5rem;
}

.footer-author--traveler {
  margin-top: 1.8rem;
  color: rgba(216, 204, 178, 0.75);
}

.footer-author a {
  color: #d9a06b;
  text-decoration: none;
  border-bottom: 1px dashed rgba(217, 160, 107, 0.5);
}

.footer-author a:hover {
  color: var(--papier);
  border-bottom-style: solid;
}

.footer-author a:focus-visible {
  outline: 2px dashed var(--rdza);
  outline-offset: 2px;
}

/* podpis autora zdjęcia tła — widoczny tylko tam, gdzie widać tło (sekcja wpisów) */

.photo-credit {
  position: sticky;
  bottom: 0.8rem;
  display: block;
  width: fit-content;
  margin: 2rem 0 0 auto;
  z-index: 30;
  font-family: var(--f-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(230, 220, 195, 0.55);
  background: rgba(27, 22, 16, 0.45);
  padding: 0.3rem 0.55rem;
  border-radius: 2px;
}

.photo-credit:hover {
  color: var(--papier);
  background: rgba(27, 22, 16, 0.75);
}

.photo-credit:focus-visible {
  outline: 2px dashed var(--rdza);
  outline-offset: 2px;
  color: var(--papier);
}

/* =================== RESPONSYWNOŚĆ =================== */

@media (max-width: 860px) {
  .entry-grid,
  .entry-body {
    grid-template-columns: 1fr;
  }

  .entry--flip .entry-grid .entry-photo-wrap { order: 0; }
  .entry--flip .entry-grid .entry-meta { order: 0; }

  .manifest-inner { grid-template-columns: 1fr; }

  .manifest-pull { max-width: 30rem; }

  .entry-extra { justify-self: start; }

  .hero { min-height: 76vh; }
  .hero-title { min-height: 76vh; }
}

/* =================== DOSTĘPNOŚĆ =================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .entry-photo-wrap,
  .entry summary:hover .entry-photo-wrap,
  .entry[open] .entry-photo-wrap {
    transition: none;
  }

  .entry[open] .entry-body { animation: none; }
}
