/* ════════════════════════════════════════════════════════════
   WORKS - katalog prac midjourneyart.pl
   Paleta i typografia zgodne ze strona glowna (index.html).
   Jeden plik dla hubu i wszystkich 41 stron miesiecy.
   ════════════════════════════════════════════════════════════ */

:root {
  --bg:      #090909;
  --border:  #161616;
  --text:    #efefef;
  --muted:   #686868;
  --dim:     #2a2a2a;
  --ig:      #b06ef0;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px dashed var(--ig); outline-offset: 4px; }

/* ── Gorny pasek ─────────────────────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 9, 0.88);
  backdrop-filter: blur(12px);
}

.bar-id {
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  gap: 5px;
}

.bar-id-dim { color: var(--dim); }

.bar-nav {
  display: flex;
  gap: clamp(14px, 3vw, 28px);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

.bar-nav a { transition: color 1.4s ease; }
.bar-nav a:hover { color: var(--ig); transition-duration: 0.35s; }

/* ── Ukladka ─────────────────────────────────────────────── */

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 48px) 96px;
}

/* ── Hub: naglowek ───────────────────────────────────────── */

.hub-title {
  margin: 0;
  font-size: clamp(56px, 13vw, 148px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.hub-sub {
  margin: 18px 0 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--muted);
}

.hub-lead {
  margin: 24px 0 0;
  max-width: 46ch;
  font-size: 15px;
  line-height: 1.6;
  color: #9a9a9a;
}

/* ── Nawigacja po latach i miesiacach ────────────────────── */

.yr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  align-items: baseline;
}

.yr-row--hub {
  margin: 44px 0 8px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.yr {
  font-size: clamp(18px, 2.6vw, 26px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--dim);
  transition: color 1.4s ease;
}

.yr:hover { color: var(--text); transition-duration: 0.35s; }
.yr--on { color: var(--ig); }

.switcher {
  margin: 28px 0 52px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  transition: border-color 1.4s ease, color 1.4s ease;
}

.chip:hover { color: var(--text); border-color: #333; transition-duration: 0.35s; }
.chip--on { color: var(--bg); background: var(--ig); border-color: var(--ig); }
.chip--off { color: #1e1e1e; border-color: #101010; }

/* ── Hub: karty miesiecy ─────────────────────────────────── */

.year { margin-top: 56px; }

.year-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.year-num {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.year-count {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

.mgrid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.mcard {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 2px;
  aspect-ratio: 1 / 1;
  background: #0d0d0d;
}

.mcard img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.35) brightness(0.72);
  transform: scale(1.02);
  transition: filter 1.8s ease, transform 2.2s ease;
}

.mcard:hover img,
.mcard:focus-visible img {
  filter: grayscale(0) brightness(1);
  transform: scale(1.06);
}

.mcard-meta {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(to top, rgba(9,9,9,0.92), rgba(9,9,9,0));
}

.mcard-name {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.mcard-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--muted);
}

/* ── Strona miesiaca ─────────────────────────────────────── */

.crumbs {
  display: flex;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

.crumbs a { transition: color 1.4s ease; }
.crumbs a:hover { color: var(--ig); transition-duration: 0.35s; }
.crumb-sep { color: var(--dim); }

.month-head {
  margin-top: 18px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.month-title {
  margin: 0;
  font-size: clamp(38px, 8vw, 84px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.045em;
  line-height: 1;
}

.month-year { color: var(--dim); }

.month-count {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

/* ── Post ────────────────────────────────────────────────── */

.post { margin-bottom: 56px; }

.post-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.post-title {
  margin: 0;
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.post-title--none { color: var(--dim); font-weight: 800; text-transform: uppercase; letter-spacing: 1px; font-size: 13px; }

.post-date {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  white-space: nowrap;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.tile {
  position: relative;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #0d0d0d;
  cursor: pointer;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 2.2s ease, opacity 1.6s ease;
}

.tile:hover img,
.tile:focus-visible img { transform: scale(1.05); }

.tile-vid {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(9,9,9,0.75);
  color: var(--text);
}

/* ── Przejscie do sasiednich miesiecy ────────────────────── */

.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: clamp(16px, 3vw, 22px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  transition: color 1.4s ease;
}

.pager-link--next { align-items: flex-end; text-align: right; }
.pager-link:hover { color: var(--ig); transition-duration: 0.35s; }

.pager-dir {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--muted);
}

/* ── Stopka ──────────────────────────────────────────────── */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(16px, 4vw, 48px);
  border-top: 1px solid var(--border);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

.foot a { transition: color 1.4s ease; }
.foot a:hover { color: var(--ig); transition-duration: 0.35s; }
.foot-dim { color: var(--dim); }

/* ── Lightbox ────────────────────────────────────────────── */

.lb {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 6, 0.97);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.lb[hidden] { display: none; }
.lb.is-open { opacity: 1; }

.lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(94vw, 1100px);
}

.lb-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 82vh;
}

.lb-stage img,
.lb-stage video {
  max-width: min(94vw, 1100px);
  max-height: 82vh;
  width: auto;
  height: auto;
  border-radius: 2px;
}

.lb-cap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0 16px;
  text-align: center;
}

.lb-title { font-size: 14px; line-height: 1.5; max-width: 60ch; }

.lb-date {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: color 1.4s ease, border-color 1.4s ease;
}

.lb-close:hover { color: var(--text); border-color: #333; transition-duration: 0.35s; }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 72px;
  border: none;
  background: transparent;
  color: var(--dim);
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  transition: color 1.2s ease;
}

.lb-nav:hover { color: var(--text); transition-duration: 0.35s; }
.lb-prev { left: max(4px, 2vw); }
.lb-next { right: max(4px, 2vw); }

body.lb-open { overflow: hidden; }

@media (max-width: 560px) {
  .post-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .mgrid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .lb-nav { width: 40px; font-size: 32px; }
  .post-head { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
