:root {
  --ink: #1b2e3b;
  --muted: #667a88;
  --blue: #167cba;
  --blue-dark: #0b5e90;
  --line: #dce6ec;
  --paper: #f5f8fa;
  --night: #0d2338;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", Arial, sans-serif;
}
h1, h2, p { margin-top: 0; }
button, input { font: inherit; }
button { cursor: pointer; line-height: 1; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #65b7e3;
  outline-offset: 3px;
}
.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.icon {
  display: block;
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Ekran wejścia */
.access-screen {
  display: grid;
  grid-template-columns: minmax(0, 56%) minmax(0, 44%);
  min-height: 100svh;
  color: #202a2c;
  background: #f2efe8;
}
.access-shell {
  min-width: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 30px clamp(28px, 6vw, 110px) 26px;
}
.access-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid #cfcac2;
  padding-bottom: 20px;
  color: #625e58;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
}
.access-wordmark {
  color: #202a2c;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.access-wordmark span {
  margin-left: 5px;
  font-weight: 500;
  letter-spacing: .12em;
}
.access-panel {
  width: min(100%, 580px);
  margin: auto 0;
  padding: 70px 0;
}
.access-kicker {
  margin-bottom: 24px;
  color: #705948;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .16em;
}
.access-panel h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(58px, 6.5vw, 100px);
  font-weight: 400;
  letter-spacing: -.065em;
  line-height: 1;
}
.access-panel h1 span { color: #917059; }
.access-date {
  margin: 26px 0 0;
  color: #66635e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}
.access-form {
  width: min(100%, 475px);
  margin-top: 66px;
  border-top: 1px solid #cfcac2;
  padding-top: 24px;
}
.access-form label {
  display: block;
  margin-bottom: 12px;
  color: #333b3b;
  font-size: 12px;
  font-weight: 650;
}
.password-row { display: flex; gap: 8px; }
.password-row input {
  min-width: 0;
  flex: 1;
  height: 49px;
  border: 1px solid #b7b5af;
  border-radius: 0;
  padding: 0 13px;
  color: #202a2c;
  background: #fbfaf7;
}
.password-row input::placeholder { color: #93918b; }
.password-row input:focus { border-color: #314449; }
.enter-button {
  min-width: 112px;
  height: 49px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border: 1px solid #293b3d;
  border-radius: 0;
  padding: 0 16px;
  color: #f7f5f0;
  background: #293b3d;
  font-size: 12px;
  font-weight: 700;
}
.enter-button:hover { background: #465a5a; }
.enter-button .icon { width: 17px; height: 17px; }
.access-error {
  margin: 12px 0 0;
  color: #a23b35;
  font-size: 12px;
}
.access-footnote {
  margin: 0;
  border-top: 1px solid #cfcac2;
  padding-top: 19px;
  color: #77736d;
  font-size: 11px;
}
.access-footnote span { padding: 0 6px; }
.access-visual {
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 34px clamp(25px, 3vw, 52px);
  color: #fff;
  background: #253037;
}
.access-visual::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: url("photos/P3311370.JPG") center / cover no-repeat;
  filter: grayscale(1);
}
.access-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, #0c192277, transparent 35%, #0c192299);
}
.visual-top, .visual-bottom {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .17em;
  text-shadow: 0 1px 9px #000a;
}
.visual-top {
  border-bottom: 1px solid #ffffff8c;
  padding-bottom: 20px;
}
.visual-bottom {
  border-top: 1px solid #ffffff8c;
  padding-top: 19px;
}
.visual-bottom span { padding-inline: 6px; }
.access-screen.is-leaving {
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}

/* Galeria */
.gallery-app {
  min-height: 100vh;
  background: var(--paper);
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 4px 20px #152f4210;
}
.header-inner, .gallery-content {
  width: min(calc(100% - 64px), 1120px);
  margin-inline: auto;
}
.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  color: var(--night);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.03em;
  text-decoration: none;
  white-space: nowrap;
}
.brand strong { color: var(--blue); font-weight: 800; }
.header-divider {
  width: 1px;
  height: 25px;
  background: var(--line);
}
.header-caption {
  display: grid;
  gap: 2px;
  margin-right: auto;
  color: #30475a;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.header-caption small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 450;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-left: auto;
}
.browse-button {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  padding: 0 14px;
  color: #fff;
  background: var(--blue);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.browse-button:hover { background: var(--blue-dark); }
.browse-button .icon { width: 18px; height: 18px; }
.header-close {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: #526c7e;
  background: #fff;
}
.header-close:hover { background: #eef5f9; }

.gallery-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(42px, 6vw, 75px) 0 45px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.eyebrow-line {
  width: 24px;
  height: 2px;
  background: currentColor;
}
h2 {
  margin-bottom: 15px;
  font-size: clamp(36px, 4.7vw, 60px);
  font-weight: 750;
  letter-spacing: -.055em;
  line-height: 1.08;
}
.title-period { color: var(--blue); }
.intro-description {
  max-width: 575px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.intro-counter {
  display: flex;
  align-items: center;
  gap: 13px;
  flex: none;
  border-left: 1px solid #cbdbe5;
  padding-left: 22px;
}
.intro-counter strong {
  color: var(--blue);
  font-size: 42px;
  letter-spacing: -.06em;
  line-height: 1;
}
.intro-counter span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 22px 0;
}
.series-control {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.filter-button {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 15px;
  color: #516a7b;
  background: #fff;
  font-size: 13px;
  font-weight: 650;
}
.filter-button:hover { border-color: #97b9cb; }
.filter-button.is-active {
  border-color: var(--night);
  color: #fff;
  background: var(--night);
}
.search-field {
  width: 255px;
  max-width: 100%;
  height: 40px;
  flex: 0 0 255px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: #8093a1;
  background: #fff;
}
.search-field:focus-within { border-color: var(--blue); }
.search-field .icon { width: 17px; height: 17px; }
.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}
.photo-count {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding-bottom: 72px;
}
.photo-tile {
  position: relative;
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid #dce6ec;
  border-radius: 12px;
  background: #e3ebf1;
  box-shadow: 0 4px 12px #152f420b;
  transition: box-shadow .2s ease, transform .2s ease;
}
.photo-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 30px #152f4224;
}
.photo-preview {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
}
.photo-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-number {
  position: absolute;
  left: 11px;
  bottom: 11px;
  pointer-events: none;
  border-radius: 5px;
  padding: 6px 8px;
  color: #fff;
  background: #0a1c2bca;
  font-size: 11px;
  font-weight: 700;
}
.photo-download {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ffffff55;
  border-radius: 8px;
  padding: 0;
  color: #fff;
  background: #0a1c2be0;
  opacity: 0;
}
.download-arrow {
  display: inline-block;
  font-family: Arial, sans-serif;
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
}
.photo-tile:hover .photo-download,
.photo-tile:focus-within .photo-download { opacity: 1; }
.photo-download:hover { background: var(--blue); }
.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed #c9d9e3;
  border-radius: 12px;
  padding: 42px 20px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  color: #8798a5;
  background: #fff;
  font-size: 12px;
  text-align: center;
}

/* Podgląd zdjęcia */
.lightbox {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  overflow: hidden;
  color: #fff;
  background: #081521;
}
.lightbox::backdrop { background: #040d15dc; }
.lightbox-bar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #ffffff20;
  padding: 10px clamp(14px, 3vw, 48px);
}
.lightbox-label {
  margin: 0;
  color: #c9dbe7;
  font-size: 13px;
  font-weight: 650;
}
.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.slideshow-button, .download-link, .lightbox-close {
  height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #476075;
  border-radius: 8px;
  padding: 0 12px;
  color: #e9f4fa;
  background: #152a3b;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}
.slideshow-button:hover,
.slideshow-button[aria-pressed="true"] { background: #254f6c; }
.download-link {
  border-color: var(--blue);
  color: #fff;
  background: var(--blue);
}
.download-link:hover { background: var(--blue-dark); }
.download-link .download-arrow { font-size: 18px; }
.lightbox-close .icon { width: 18px; height: 18px; }
.lightbox-close { width: 39px; padding: 0; }
.lightbox-stage {
  height: calc(100dvh - 72px);
  min-height: 0;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) 45px;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px clamp(12px, 3vw, 48px);
}
.lightbox-stage img {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  max-width: min(100%, 1100px);
  max-height: calc(100dvh - 108px);
  justify-self: center;
  object-fit: contain;
}
.lightbox-nav {
  width: 45px;
  height: 45px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #506777;
  border-radius: 8px;
  padding: 0;
  color: #fff;
  background: #193144;
  font-size: 31px;
}
.lightbox-nav:hover { background: var(--blue); }
.download-status {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 22px;
  width: max-content;
  max-width: calc(100vw - 28px);
  margin: 0;
  transform: translateX(-50%);
  border: 1px solid #36566c;
  border-radius: 8px;
  padding: 12px 16px;
  color: #fff;
  background: #153348;
  box-shadow: 0 12px 28px #0004;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 1040px) {
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .access-top > span:last-child { display: none; }
}
@media (max-width: 850px) {
  .gallery-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; flex: none; }
}
@media (max-width: 900px) {
  .access-screen { grid-template-columns: 1fr; }
  .access-shell { padding-inline: clamp(24px, 7vw, 64px); }
  .access-visual { display: none; }
}
@media (max-width: 700px) {
  .header-inner, .gallery-content {
    width: min(calc(100% - 32px), 1120px);
  }
  .header-inner { min-height: 64px; gap: 12px; }
  .header-divider, .header-caption { display: none; }
  .brand { font-size: 15px; }
  .gallery-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    padding: 44px 0 32px;
  }
  .intro-counter { border: 0; padding: 0; }
  .intro-counter strong { font-size: 32px; }
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .photo-download { opacity: 1; }
  .lightbox-bar {
    height: 102px;
    flex-wrap: wrap;
    align-content: center;
    gap: 6px;
  }
  .lightbox-label { width: 100%; }
  .lightbox-stage {
    height: calc(100dvh - 102px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 12px 62px;
  }
  .lightbox-stage img {
    max-width: 100%;
    max-height: calc(100dvh - 176px);
  }
  .lightbox-nav {
    position: absolute;
    bottom: 14px;
    width: 42px;
    height: 38px;
    font-size: 28px;
  }
  .lightbox-nav.previous { left: calc(50% - 49px); }
  .lightbox-nav.next { right: calc(50% - 49px); }
}
@media (max-width: 430px) {
  .access-shell { padding: 24px 22px; }
  .access-panel { padding: 54px 0; }
  .access-panel h1 { font-size: clamp(53px, 13vw, 69px); }
  .access-form { margin-top: 52px; }
  .password-row { flex-direction: column; }
  .password-row input, .enter-button { width: 100%; }
  .browse-button {
    width: 42px;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }
  .browse-button .icon { width: 19px; height: 19px; }
  .slideshow-button { padding: 0 8px; font-size: 11px; }
  .download-link { padding: 0 9px; }
  .photo-number {
    left: 6px;
    bottom: 6px;
    padding: 5px;
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
@media (hover: none) {
  .photo-download { opacity: 1; }
}

.photo-download .icon {
  width: 20px;
  height: 20px;
}

.download-link .icon {
  width: 18px;
  height: 18px;
}

.lightbox-nav .icon {
  width: 24px;
  height: 24px;
}