/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #faf9f7;
  --fg: #1c1b19;
  --muted: #8a8880;
  --border: #e0ddd8;
  --font: 'Spectral', Georgia, serif;
  --col: 660px;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-weight: 300;
  font-size: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── Nav ───────────────────────────────────────────────────────────────────── */
nav.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

nav.site-nav.scrolled {
  border-bottom-color: var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(250, 249, 247, 0.85);
}

body.dark nav.site-nav.scrolled {
  background: rgba(22, 22, 20, 0.85);
}

nav.site-nav .nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand { text-decoration: none; display: flex; align-items: center; }
.nav-brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; }

.lang-switch { display: flex; align-items: center; gap: 6px; }
.lang-switch a, .lang-switch span.current {
  font-family: var(--font); font-weight: 300; font-size: 13px;
  letter-spacing: 0.08em; color: var(--muted); text-decoration: none;
}
.lang-switch span.current { color: var(--fg); font-weight: 400; }
.lang-switch .sep { font-size: 12px; color: var(--border); }
.lang-switch a:hover { color: var(--fg); }

/* ── Post grid (strona główna) ──────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px 8px;
  padding: 32px 32px 0;
  width: 100%;
}

.post-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--fg);
  overflow: hidden;
}

.post-card-cover {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--border);
}

.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card-cover img { transform: scale(1.03); }

.post-card-placeholder {
  width: 100%;
  height: 100%;
  background: var(--border);
}

.post-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 32px 24px 4px;
}

.post-card-meta .post-date {
  font-size: 12px;
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.04em;
}

.post-card-meta .post-title {
  font-size: 20px;
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: -0.01em;
  transition: opacity 0.15s;
}

.post-card:hover .post-title { opacity: 0.55; }

.post-card-meta .post-excerpt {
  font-size: 16px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Infinite scroll ────────────────────────────────────────────────────────── */
.load-more-sentinel { height: 1px; }

.load-more-spinner {
  display: none;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 40px 0;
}

.load-more-spinner.active { display: flex; }

.load-more-spinner span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: bounce 0.9s infinite ease-in-out;
}
.load-more-spinner span:nth-child(2) { animation-delay: 0.15s; }
.load-more-spinner span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Article header ─────────────────────────────────────────────────────────  */
.article-header {
  max-width: var(--col);
  margin: 0 auto;
  padding: 48px 24px 0;
}

h1.entry-title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 300;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

.entry-date {
  font-size: 13px;
  color: var(--muted);
  font-weight: 300;
  letter-spacing: 0.03em;
}

/* ── Share ──────────────────────────────────────────────────────────────────── */
.share-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.share-row--bottom {
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 24px 40px;
}

.share-btn {
  background: none; border: none;
  font-family: var(--font); font-size: 12px; font-weight: 300;
  color: var(--muted); cursor: pointer; padding: 0;
  letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 5px;
  transition: color 0.15s;
}
.share-btn:hover { color: var(--fg); }
.share-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.share-toast { font-size: 11px; color: var(--muted); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.share-toast.show { opacity: 1; }

/* ── Single photo ───────────────────────────────────────────────────────────── */
.single-photo {
  max-width: var(--col);
  margin: 40px auto 0;
  padding: 0 24px;
  cursor: zoom-in;
}
.single-photo img { width: 100%; height: auto; display: block; }

/* ── Double photo ───────────────────────────────────────────────────────────── */
.double-photo {
  max-width: var(--col);
  margin: 40px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.double-photo-item { overflow: hidden; cursor: zoom-in; }
.double-photo-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Gallery ────────────────────────────────────────────────────────────────── */
.gallery-section { margin-top: 40px; max-width: var(--col); margin-left: auto; margin-right: auto; }

.gallery-track {
  display: flex; gap: 8px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 0 24px; cursor: grab;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track.dragging { cursor: grabbing; user-select: none; }

.gallery-item {
  flex: 0 0 auto; scroll-snap-align: start;
  width: clamp(160px, 28vw, 220px);
  max-height: 320px;
  overflow: hidden; cursor: zoom-in;
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gallery-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; align-items: center; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border); cursor: pointer; border: none; padding: 0; transition: background 0.2s, transform 0.2s; }
.dot.active { background: var(--fg); transform: scale(1.3); }

/* ── Divider ────────────────────────────────────────────────────────────────── */
.entry-divider { max-width: var(--col); margin: 40px auto 0; padding: 0 24px; border: none; }
.entry-divider::after { content: ''; display: block; height: 1px; background: var(--border); }

/* ── Entry content ──────────────────────────────────────────────────────────── */
.entry-content {
  max-width: var(--col); margin: 0 auto;
  padding: 36px 24px 48px;
}
.entry-content p {
  font-size: 19px; font-weight: 300; line-height: 1.75;
  margin-bottom: 1.4em; text-wrap: pretty;
}
.entry-content p:first-of-type::first-letter {
  font-size: 3.2em; line-height: 0.85;
  float: left; margin-right: 6px; margin-top: 4px; font-weight: 400;
}
.entry-content em { font-style: italic; }
.entry-content figure.inline-img { margin: 2em 0; cursor: zoom-in; }
.entry-content figure.inline-img img { width: 100%; aspect-ratio: 3/2; object-fit: cover; display: block; }
.entry-content figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; font-style: italic; }

/* ── Lightbox (Swiper) ──────────────────────────────────────────────────────── */
#lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 2000;
}
#lightbox.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

#lb-close {
  position: fixed;
  top: 16px; right: 20px;
  background: none; border: none;
  color: rgba(255,255,255,0.5); font-size: 24px;
  cursor: pointer; z-index: 2010; padding: 8px;
  transition: color 0.15s;
}
#lb-close:hover { color: white; }

#lb-swiper {
  width: 100vw;
  height: 100vh;
}

.lb-swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-swiper-slide img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  user-select: none;
}

/* Swiper navigation arrows — kolor biały */
#lb-swiper .swiper-button-prev,
#lb-swiper .swiper-button-next {
  color: rgba(255,255,255,0.5);
  transition: color 0.15s;
}
#lb-swiper .swiper-button-prev:hover,
#lb-swiper .swiper-button-next:hover {
  color: white;
}

/* Swiper pagination (fraction: "2 / 7") */
#lb-swiper .swiper-pagination {
  color: rgba(255,255,255,0.4);
  font-family: var(--font);
  font-size: 13px;
  letter-spacing: 0.1em;
  bottom: 20px;
}

/* ── Subscribe ──────────────────────────────────────────────────────────────── */
.subscribe-section {
  max-width: var(--col); margin: 0 auto;
  padding: 8px 24px 24px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px;
}
.subscribe-label { font-size: 13px; color: var(--muted); letter-spacing: 0.06em; font-weight: 300; }
.subscribe-form { display: flex; width: 100%; max-width: 380px; }
.subscribe-input {
  flex: 1; font-family: var(--font); font-size: 15px; font-weight: 300;
  padding: 11px 16px; border: 1px solid var(--border); border-right: none;
  background: var(--bg); color: var(--fg); outline: none;
  transition: border-color 0.15s; border-radius: 0; -webkit-appearance: none;
}
.subscribe-input:focus { border-color: var(--fg); }
.subscribe-input::placeholder { color: var(--muted); }
.subscribe-btn {
  font-family: var(--font); font-size: 13px; font-weight: 400; letter-spacing: 0.08em;
  padding: 11px 20px; background: var(--fg); color: var(--bg);
  border: 1px solid var(--fg); cursor: pointer; transition: opacity 0.15s;
  white-space: nowrap; border-radius: 0;
}
.subscribe-btn:hover { opacity: 0.75; }
.subscribe-confirm { font-size: 14px; color: var(--muted); font-weight: 300; display: none; }

/* ── Post navigation ────────────────────────────────────────────────────────── */
.post-nav {
  max-width: var(--col); margin: 0 auto;
  padding: 40px 24px 72px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.post-nav-link { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--fg); }
.post-nav-link.next { align-items: flex-end; text-align: right; }
.post-nav-dir { font-size: 12px; color: var(--muted); font-weight: 300; letter-spacing: 0.06em; }
.post-nav-title { font-size: 16px; font-weight: 300; line-height: 1.3; transition: opacity 0.15s; }
.post-nav-link:hover .post-nav-title { opacity: 0.5; }

/* ── Footer ─────────────────────────────────────────────────────────────────── */
footer.site-footer {
  max-width: 1400px; margin: 0 auto;
  padding: 24px 32px 48px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.footer-icons { display: flex; gap: 16px; align-items: center; }
.footer-icon { color: var(--muted); text-decoration: none; transition: color 0.15s; display: flex; align-items: center; }
.footer-icon:hover { color: var(--fg); }
.footer-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.footer-copy { font-size: 11px; color: var(--muted); font-weight: 300; letter-spacing: 0.04em; }

/* ── Dark mode ─────────────────────────────────────────────────────────────── */
body.dark {
  --bg: #161614;
  --fg: #e8e6e1;
  --muted: #6b6965;
  --border: #2a2a27;
}

body.dark .gallery-item,
body.dark .post-card-cover,
body.dark .post-card-placeholder { background: #242420; }

/* Theme toggle */
.theme-toggle {
  background: none; border: none; cursor: pointer; padding: 0;
  color: var(--muted); display: flex; align-items: center;
  transition: color 0.15s;
}
.theme-toggle:hover { color: var(--fg); }
.theme-toggle svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
body.dark .theme-toggle .icon-moon { display: none; }
body.dark .theme-toggle .icon-sun { display: block; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */

@media (max-width: 1100px) {
  .post-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  nav.site-nav .nav-inner { max-width: 100%; padding: 16px 20px; }
  footer.site-footer { max-width: 100%; padding: 20px 20px 40px; }
}

@media (max-width: 480px) {
  .post-grid { grid-template-columns: 1fr; gap: 40px 8px; padding: 0 16px; }
  .post-card-meta { padding: 12px 0 24px; }
  .mk-motto-stage { padding: 40px 4vw 20px; }
  .mk-motto { padding: 0 6vw 24px; text-wrap: balance; }
}

.post-card {
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}
.post-card:nth-last-child(-n+4) { border-bottom: none; }

@media (max-width: 1100px) {
  .post-card:nth-last-child(-n+4) { border-bottom: 1px solid var(--border); }
  .post-card:nth-last-child(-n+3) { border-bottom: none; }
}

@media (max-width: 768px) {
  .post-card:nth-last-child(-n+3) { border-bottom: 1px solid var(--border); }
  .post-card:nth-last-child(-n+2) { border-bottom: none; }
}

@media (max-width: 480px) {
  .post-card:nth-last-child(-n+2) { border-bottom: 1px solid var(--border); }
  .post-card:last-child { border-bottom: none; }
}

/* ============================================================
   MOTTO — sekcja powitalna na stronie głównej
   ============================================================ */

.mk-motto-stage{
  --mk-ink: var(--fg);
  --mk-ink-soft: var(--muted);
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 50px 8vw 20px;
  position: relative;
  will-change: transform, opacity, filter;
}

.mk-motto{
  font-family: "Spectral", Georgia, serif;
  font-weight: 300;
  color: var(--mk-ink);
  max-width: 1100px;
  text-align: center;
  line-height: 1.32;
  letter-spacing: -.005em;
  font-size: clamp(20px, 2.04vw, 27px);
  text-wrap: pretty;
  margin: 0;
  padding-bottom: 24px;
}

.mk-motto::after {
  content: '';
  display: block;
  width: 25%;
  height: 1px;
  background: var(--border);
  margin: 24px auto 0px;
}

.mk-motto .mk-line{ display:block; }

.mk-motto .mk-w{
  display:inline-block;
  opacity:0;
  transform:translateY(14px);
  filter:blur(6px);
  transition:
    opacity .9s cubic-bezier(.2,.7,.2,1),
    transform .9s cubic-bezier(.2,.7,.2,1),
    filter .9s cubic-bezier(.2,.7,.2,1);
}

.mk-motto-stage.mk-in .mk-motto .mk-w{
  opacity:1;
  transform:none;
  filter:none;
}

.mk-motto .mk-dash{
  font-style:italic;
  color:var(--mk-ink-soft);
  padding:0 .05em;
}

.mk-motto em{
  font-style:italic;
  color:var(--mk-ink-soft);
}

@media (prefers-reduced-motion: reduce){
  .mk-motto .mk-w{
    transition:opacity .4s ease;
    transform:none;
    filter:none;
  }
}