@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&family=Permanent+Marker&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
  --paper: #EAE5D9;
  --graphite: #1C1B19;
  --accent: #D9381E;
  --tape: rgba(215, 206, 182, 0.85);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: url('img/papier.jpg') center / cover no-repeat fixed;
  color: var(--graphite);
  font-family: 'Space Mono', monospace;
  line-height: 1.6;
  min-height: 100vh;
  box-shadow: inset 0 0 90px rgba(65, 55, 40, 0.18);
  position: relative;
}

/* Chropowata faktura papieru */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.45;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.45'/%3E%3C/svg%3E");
}

/* Górny pasek powrotu i nawigacji */
header {
  max-width: 1060px;
  margin: 0 auto;
  padding: 1.8rem 4vw 1.2rem 4vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 1.5px dashed rgba(28, 27, 25, 0.35);
}

.back-logo {
  font-family: 'Permanent Marker', cursive;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--graphite);
  transform: rotate(-1deg);
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--graphite);
  transition: color 0.2s;
}

nav a:hover,
nav a.active {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Główna zawartość */
.page-wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 2.5rem 4vw 5rem 4vw;
}

.page-title {
  font-family: 'Caveat', cursive;
  font-size: clamp(2.8rem, 6vw, 4.4rem);
  line-height: 1;
  margin-bottom: 0.5rem;
  transform: rotate(-0.8deg);
}

.page-lead {
  font-size: 0.92rem;
  opacity: 0.75;
  max-width: 620px;
  margin-bottom: 3rem;
}

/* SZKICOWNIK: Siatka wklejonych prac */
.sketch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 3rem 2.2rem;
  align-items: start;
}

.sketch-item {
  background: rgba(255, 255, 255, 0.35);
  border: 1.5px solid var(--graphite);
  padding: 0.85rem;
  position: relative;
  box-shadow: 4px 5px 0 rgba(28, 27, 25, 0.15);
  transition: transform 0.25s ease;
}

/* Kawałek taśmy malarskiej u góry szkicu */
.sketch-item::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 85px;
  height: 22px;
  background: var(--tape);
  border-left: 1px dashed rgba(0, 0, 0, 0.18);
  border-right: 1px dashed rgba(0, 0, 0, 0.18);
}

.sketch-item:nth-child(odd) { transform: rotate(-0.7deg); }
.sketch-item:nth-child(even) { transform: rotate(0.9deg); margin-top: 1.2rem; }
.sketch-item:hover { transform: rotate(0deg) scale(1.02); }

.sketch-item img {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid rgba(28, 27, 25, 0.3);
}

.sketch-note {
  font-family: 'Caveat', cursive;
  font-size: 1.45rem;
  margin-top: 0.7rem;
  line-height: 1.2;
}

.sketch-date {
  font-size: 0.72rem;
  opacity: 0.6;
  margin-top: 0.25rem;
}

/* PAMIĘTNIK & O AUTORZE */
.author-note {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  background: rgba(255, 255, 255, 0.32);
  border: 1.5px solid var(--graphite);
  padding: 1.8rem;
  margin-bottom: 3.5rem;
  box-shadow: 5px 6px 0 rgba(28, 27, 25, 0.15);
}

.author-note img {
  width: 100%;
  border: 1px solid var(--graphite);
}

.author-note h2 {
  font-family: 'Caveat', cursive;
  font-size: 2.3rem;
  margin-bottom: 0.6rem;
}

.diary-list {
  display: flex;
  flex-direction: column;
  gap: 2.8rem;
  border-left: 2px dashed var(--graphite);
  padding-left: 1.8rem;
}

.diary-post {
  position: relative;
  background: rgba(255, 255, 255, 0.28);
  border: 1.5px solid var(--graphite);
  padding: 1.5rem;
}

.diary-post::before {
  content: "";
  position: absolute;
  left: -2.35rem;
  top: 1.4rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--graphite);
}

.diary-post .date-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

.diary-post h3 {
  font-family: 'Caveat', cursive;
  font-size: 2rem;
  margin: 0.2rem 0 0.6rem 0;
}

.diary-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.diary-photos img {
  width: 100%;
  border: 1px solid rgba(28, 27, 25, 0.4);
}

@media (max-width: 680px) {
  .author-note { grid-template-columns: 1fr; }
  .sketch-item:nth-child(even) { margin-top: 0; }
}
/* KLIKALNE POSTY W PAMIĘTNIKU + OKNO MODALNE */
.clickable-post {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.clickable-post:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0 var(--graphite);
  background: rgba(255, 255, 255, 0.55);
}

.read-more-btn {
  display: inline-block;
  margin-top: 1rem;
  font-family: 'KrispollandHand', 'Caveat', cursive;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.clickable-post:hover .read-more-btn {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Okno otwartego wpisu */
.post-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 17, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 999;
}

.post-modal.open {
  display: flex;
}

.post-modal-sheet {
  background: url('img/papier.jpg') center / cover no-repeat, var(--paper);
  color: var(--graphite);
  border: 2px solid var(--graphite);
  box-shadow: 10px 10px 0 #000;
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.2rem;
  position: relative;
}

.modal-close-btn {
  position: sticky;
  top: 0;
  float: right;
  background: var(--accent);
  color: #fff;
  border: 1.5px solid var(--graphite);
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  z-index: 10;
}

.modal-close-btn:hover {
  background: var(--graphite);
}

.modal-title {
  font-family: 'KrispollandHand', 'Caveat', cursive;
  font-size: clamp(2.2rem, 4.5vw, 3.2rem);
  line-height: 1.05;
  margin: 0.4rem 0 1.2rem 0;
}

.modal-body p {
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.modal-gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.modal-gallery img {
  width: 100%;
  height: auto;
  border: 1.5px solid var(--graphite);
  box-shadow: 4px 4px 0 rgba(28, 27, 25, 0.2);
}