:root {
  --bg: #000000;
  --bg-elevated: #111111;
  --text: #f2f2f2;
  --muted: #9a9a9a;
  --line: #2a2a2a;
  --accent: #e8e8e8;
  --admin-line: #922b28;
  --error: #ff6b6b;
  --ok: #7dcea0;
  --frame: #0a0a0a;
  --max: 1250px;
  --gap: 1rem;
  font-family: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
}

.site-header-admin {
  flex-wrap: wrap;
  gap: 1rem;
  border-bottom: 5px solid var(--admin-line);
}

.admin-return {
  margin-left: auto;
  font-size: 0.9rem;
}

.site-nav-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.site-nav-main a[aria-current="page"] {
  text-decoration: underline;
}

.nav-sep {
  color: var(--muted);
}

.site-nav a {
  margin-left: 0;
  font-size: 0.95rem;
}

.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.page-title {
  font-weight: 500;
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
}

.empty {
  color: var(--muted);
}

.breadcrumb {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.gallery-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
  max-width: 40rem;
}

.breadcrumb span {
  margin: 0 0.35rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap);
}

.photo-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.photo-card:hover {
  text-decoration: none;
}

.photo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  background: var(--frame);
  border: 1px solid var(--line);
  overflow: hidden;
}

.photo-frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.photo-caption {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-list li {
  border-bottom: 1px solid var(--line);
}

.category-list a {
  display: block;
  padding: 0.9rem 0;
  font-size: 1.1rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--gap);
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.category-card:hover {
  text-decoration: none;
}

.category-card-name {
  font-size: 1rem;
}

.category-cover {
  position: relative;
}

.cover-empty {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Admin */
.admin-body {
  background: #0b0b0b;
}

.admin-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  border-bottom: 5px solid var(--admin-line);
}

.admin-main,
.admin-login {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.admin-main-wide {
  max-width: var(--max);
}

.admin-category-row {
  align-items: center;
}

.admin-category-link {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
  flex: 1;
  min-width: 0;
}

.admin-category-link:hover {
  text-decoration: none;
}

.admin-category-thumb {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  aspect-ratio: auto;
}

.admin-category-thumb img {
  max-width: 100%;
  max-height: 100%;
}

.admin-category-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.admin-category-meta .admin-list-desc {
  display: block;
}

.admin-photo-grid .admin-photo-item {
  position: relative;
  cursor: grab;
  user-select: none;
}

.admin-photo-item.is-dragging {
  opacity: 0.55;
}

.admin-photo-item .photo-frame {
  position: relative;
}

.cover-badge {
  position: absolute;
  left: 0.4rem;
  top: 0.4rem;
  background: #111;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
}

.admin-photo-controls {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.icon-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font: inherit;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.context-menu {
  position: fixed;
  z-index: 1000;
  min-width: 160px;
  background: #111;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 0.25rem 0;
}

.context-menu[hidden] {
  display: none;
}

.context-menu button {
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
  padding: 0.55rem 0.9rem;
  font: inherit;
  cursor: pointer;
}

.context-menu button:hover {
  background: #1a1a1a;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-form input,
.admin-form select,
.admin-login input {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.6rem 0.7rem;
  font: inherit;
}

.admin-form button,
.admin-login button {
  align-self: start;
  background: var(--text);
  color: #000;
  border: 0;
  padding: 0.65rem 1.1rem;
  font: inherit;
  cursor: pointer;
}

.admin-list {
  list-style: none;
  padding: 0;
}

.admin-list li,
.admin-list-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}

.admin-list code {
  color: var(--muted);
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.admin-list-desc {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

.admin-subheading {
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0 0 1rem;
}

.admin-form textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0.6rem 0.7rem;
  font: inherit;
  resize: vertical;
}

.admin-form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.button-link {
  color: var(--muted);
}

.flash {
  background: #142018;
  color: var(--ok);
  padding: 0.75rem 1rem;
  border: 1px solid #2a4a35;
}

.flash.error {
  background: #201414;
  color: var(--error);
  border-color: #4a2a2a;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.admin-links {
  list-style: none;
  padding: 0;
}

.admin-links li {
  margin: 0.75rem 0;
}

@media (max-width: 640px) {
}

/* Edycja w miejscu */
.editor-header { display: flex; align-items: center; gap: 1rem; }
.editor-header span { color: var(--muted); font-size: .8rem; }
.editor-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-bottom: 1.5rem; }
.editor-toolbar button, .editor-edit, .editor-photo-controls button, #editor-dialog button {
  background: #171717; border: 1px solid #444; border-radius: 4px; color: var(--text);
  padding: .5rem .75rem; font: inherit; font-size: .85rem; cursor: pointer;
}
.editor-toolbar button:hover, .editor-edit:hover, .editor-photo-controls button:hover, #editor-dialog button:hover { background: #292929; }
.editor-edit { margin-top: .75rem; }
.editor-photo-controls { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.editor-photo-controls button { padding: .35rem .5rem; font-size: .75rem; }
.editor-photo-controls button:disabled { opacity: .45; cursor: default; }
.editor-danger { color: #ef9995 !important; }
#editor-dialog { width: min(560px, calc(100% - 2rem)); max-height: 85vh; padding: 1.5rem; background: #111; color: var(--text); border: 1px solid #444; border-top: 5px solid var(--admin-line); border-radius: 6px; }
#editor-dialog::backdrop { background: rgb(0 0 0 / .78); }
.editor-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.editor-dialog-heading h2 { font-size: 1.25rem; font-weight: 500; margin: 0; }
#editor-dialog .admin-form { margin: 0; }
#editor-dialog input, #editor-dialog select, #editor-dialog textarea { max-width: 100%; min-width: 0; }
#editor-content > button { margin-right: .5rem; }
body:has(#editor-dialog[open]) { overflow: hidden; }

/* Strona główna: zdjęcia w naturalnych proporcjach, bez ramek. */
.home-gallery {
  columns: 3;
  column-gap: 16px;
}
.home-photo-date { position: absolute; top: 12px; left: 12px; padding: 5px 8px; border-radius: 3px; background: rgb(0 0 0 / .55); color: #ddd; font-size: 11px; line-height: 1.4; font-variant-numeric: tabular-nums; pointer-events: none; }

.home-reveal .home-photo { opacity: 0; }
.home-reveal .home-photo.is-revealed {
  opacity: 1;
  transition: opacity 1.8s ease var(--reveal-delay, 0ms);
}
.home-reveal .home-photo:focus-within { opacity: 1; transition: none; }
@media (prefers-reduced-motion: reduce) {
  .home-reveal .home-photo { opacity: 1; transition: none; }
}
.home-photo {
  position: relative;
  break-inside: avoid;
  margin: 0 0 16px;
  overflow: hidden;
  isolation: isolate;
}
.home-photo .photo-card { display: block; }
.home-photo .photo-frame {
  display: block;
  aspect-ratio: auto;
  border: 0;
  background: transparent;
}
.home-photo .photo-frame img {
  display: block;
  width: 100%;
  max-height: none;
  height: auto;
  transition: transform 350ms ease;
}
.home-photo:hover .photo-frame img { transform: scale(1.025); }
.home-photo .photo-caption {
  position: absolute;
  inset: auto 0 0;
  padding: 32px 16px 14px;
  color: #fff;
  background: linear-gradient(transparent, rgb(0 0 0 / .8));
  pointer-events: none;
}
.home-photo-editable .photo-caption { bottom: 52px; }
.home-photo .editor-photo-controls {
  position: absolute;
  inset: auto 0 0;
  margin: 0;
  padding: 36px 12px 12px;
  gap: 8px;
  background: linear-gradient(transparent, rgb(0 0 0 / .85));
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
.home-photo:hover .editor-photo-controls,
.home-photo:focus-within .editor-photo-controls {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.home-photo .editor-photo-controls button {
  padding: 8px 10px;
  min-height: 36px;
  background: rgb(15 15 15 / .8);
  border: 1px solid rgb(255 255 255 / .25);
  border-radius: 5px;
  backdrop-filter: blur(8px);
}
.home-photo .editor-photo-controls button:hover { background: #303030; }
.home-photo :focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
@media (max-width: 900px) {
  .home-gallery { columns: 2; }
}
@media (max-width: 540px) {
  .home-gallery { columns: 1; }
}
@media (hover: none), (pointer: coarse) {
  .home-photo .editor-photo-controls { opacity: 1; transform: none; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .home-photo .photo-frame img, .home-photo .editor-photo-controls { transition: none; transform: none; }
}

@media (max-width: 540px) {
}
@media (prefers-reduced-motion: reduce) {
}
.viewer-scale-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; vertical-align: middle; margin: 0 3px; }
.viewer-scale-dot.is-reduced { background: #d46767; }
.viewer-scale-dot.is-original { background: #70ba86; }


html {
  scrollbar-color: #333 #0b0b0b;
  scrollbar-width: thin;
  color-scheme: dark;
}
html::-webkit-scrollbar::-webkit-scrollbar { width: 8px; height: 8px; }
html::-webkit-scrollbar-track::-webkit-scrollbar-track { background: #0b0b0b; }
html::-webkit-scrollbar-thumb::-webkit-scrollbar-thumb { background: #333; border-radius: 8px; }
html::-webkit-scrollbar-thumb:hover::-webkit-scrollbar-thumb:hover { background: #484848; }
html::-webkit-scrollbar-corner::-webkit-scrollbar-corner { background: #0b0b0b; }


/* Kategorie jako okładki albumów. */
.categories .category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.album-tile { position: relative; min-width: 0; overflow: hidden; background: #111; isolation: isolate; }
.categories .category-card { position: relative; display: block; aspect-ratio: 3 / 2; color: #fff; overflow: hidden; }
.categories .category-cover { display: block; position: absolute; inset: 0; }
.categories .category-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 450ms ease; }
.album-tile:hover .category-cover img { transform: scale(1.035); }
.album-meta { position: absolute; inset: auto 0 0; padding: 64px 24px 22px; background: linear-gradient(transparent, rgb(0 0 0 / .78)); display: flex; flex-direction: column; gap: 6px; }
.categories .category-card-name { font-size: clamp(20px, 2vw, 30px); font-weight: 500; line-height: 1.15; overflow-wrap: anywhere; }
.album-count { font-size: 12px; color: #ccc; }
.album-tile-empty { background: linear-gradient(140deg, #1c1c1c, #0d0d0d); }
.album-tools { position: absolute; top: 14px; right: 14px; left: 14px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.album-tools button { border: 1px solid rgb(255 255 255 / .2); border-radius: 4px; padding: 9px 12px; color: #eee; background: rgb(0 0 0 / .65); backdrop-filter: blur(8px); font: inherit; font-size: 12px; cursor: pointer; }
.album-tools button:hover { background: #303030; }
.album-tile:hover .album-tools, .album-tile:focus-within .album-tools { opacity: 1; transform: none; pointer-events: auto; }
.album-tile :focus-visible { outline: 2px solid #eee; outline-offset: -3px; }
.home-reveal .album-tile { opacity: 0; }
.home-reveal .album-tile.is-revealed { opacity: 1; transition: opacity 1.8s ease var(--reveal-delay, 0ms); }
.home-reveal .album-tile:focus-within { opacity: 1; transition: none; }
@media (max-width: 900px) { .categories .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) { .categories .category-grid { grid-template-columns: minmax(0, 1fr); } .album-meta { padding: 56px 16px 16px; } }
@media (hover: none), (pointer: coarse) { .album-tools { opacity: 1; transform: none; pointer-events: auto; } }
@media (prefers-reduced-motion: reduce) { .home-reveal .album-tile { opacity: 1; transition: none; } .categories .category-cover img, .album-tools { transition: none; transform: none; } }

.site-nav-main { flex-wrap: wrap; min-width: 0; }
.home-logo { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 48px; min-height: 44px; }
.home-logo img { display: block; width: 48px; height: 40px; transition: transform 180ms ease; }
.home-logo:hover img { transform: rotate(-5deg); }
.site-nav-main a:focus-visible { outline: 2px solid #ccc; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .home-logo img { transition: none; } }


.editor-main-toolbar { gap: 6px; align-items: center; min-height: 32px; }
.editor-main-toolbar button, .editor-main-toolbar select, .editor-main-toolbar .toolbar-logout { font-size: 12px; padding: 5px 9px; line-height: 1.4; }
.editor-main-toolbar select { max-width: min(240px, 100%); background: #171717; color: #ddd; border: 1px solid #444; border-radius: 4px; }
.toolbar-photo-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.toolbar-photo-actions[hidden] { display: none; }
.editor-main-toolbar button:disabled { opacity: .45; cursor: default; }
.toolbar-logout { margin-left: auto; color: var(--muted); }
.home-photo.is-selected { outline: 2px solid var(--admin-line); outline-offset: -2px; }

/* Edycja kolejności bezpośrednio w galerii. */
.gallery-edit-hint, .gallery-order-status { color: var(--muted); font-size: 12px; }
.gallery-order-status:empty { display: none; }
[data-sortable-gallery] .home-photo { position: relative; cursor: grab; }
[data-sortable-gallery][aria-busy="true"] { opacity: .65; pointer-events: none; }
[data-sortable-gallery] .is-dragging { opacity: .4; }
[data-sortable-gallery] .drop-before { box-shadow: 0 -4px #a94545; }
[data-sortable-gallery] .drop-after { box-shadow: 0 4px #a94545; }
.photo-context-menu { position: fixed; z-index: 1000; min-width: 200px; padding: 5px; background: #191919; border: 1px solid #444; border-radius: 6px; box-shadow: 0 8px 30px #000a; }
.photo-context-menu[hidden] { display: none; }
.photo-context-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; background: transparent; border: 0; font-size: 13px; }
.photo-context-menu button:hover, .photo-context-menu button:focus-visible { background: #303030; }
.photo-context-menu button:disabled { opacity: .4; cursor: default; }

.gallery-lightbox { box-sizing: border-box; width: 96vw; max-width: 1800px; height: 94dvh; max-height: 94dvh; padding: 0; color: #ddd; background: #0d0d0d; border: 1px solid #333; border-radius: 8px; overflow: hidden; }
.gallery-lightbox::backdrop { background: rgb(0 0 0 / 88%); }
.gallery-lightbox[open] { display: flex; flex-direction: column; }
.lightbox-top { display: flex; align-items: center; gap: 20px; padding: 12px 18px; border-bottom: 1px solid #292929; flex: 0 0 auto; font-size: 13px; }
.lightbox-top a { margin-left: auto; color: #ddd; }
.lightbox-top button { font-size: 25px; padding: 0 10px; }
.lightbox-body { display: flex; flex: 1; min-height: 0; padding: 20px; gap: 24px; }
.lightbox-info { flex: 0 0 180px; font-size: 12px; color: #999; align-self: center; overflow-wrap: anywhere; }
.lightbox-info p { margin: 0 0 12px; }
.lightbox-info p:first-child { font-size: 15px; color: #ddd; }
.lightbox-stage { flex: 1; min-width: 0; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; }
.lightbox-stage img { display: block; object-fit: contain; max-width: 100%; max-height: 100%; }
.lightbox-stage button { position: absolute; top: 50%; transform: translateY(-50%); border-radius: 50%; width: 44px; height: 44px; padding: 0; font-size: 32px; line-height: 1; background: #111b; border: 1px solid #ffffff25; color: #eee; }
.lightbox-stage button:disabled { visibility: hidden; }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
.lightbox-loading { position: absolute; color: #bbb; font-size: 13px; text-align: center; }
@media (max-width: 700px) {
  .lightbox-body { flex-direction: column-reverse; padding: 10px; gap: 12px; }
  .lightbox-info { flex: 0 0 auto; align-self: stretch; display: flex; flex-wrap: wrap; gap: 6px 16px; }
  .lightbox-info p { margin: 0; }
  .lightbox-top { gap: 10px; padding: 8px; font-size: 11px; }
}

/* Wspólny podgląd zdjęć na głównej i w kategorii. */
.gallery-lightbox { background: rgb(0 0 0 / 68%); border: 0; border-radius: 0; }
.gallery-lightbox::backdrop { background: rgb(0 0 0 / 58%); }
.lightbox-top { border: 0; }
.lightbox-info { flex-basis: 240px; color: #ccc; font-size: 14px; line-height: 1.6; text-shadow: 0 1px 3px #000; }
.lightbox-info h2 { font-size: 27px; color: #fff; line-height: 1.2; margin: 0 0 28px; }
.lightbox-info h3 { font-size: 16px; color: #eee; margin: 0 0 18px; font-weight: 500; }
.lightbox-info [data-lightbox-description]:empty { display: none; }
@media (max-width: 700px) {
  .lightbox-info { flex-basis: auto; font-size: 13px; }
  .lightbox-info h2 { width: 100%; font-size: 22px; margin: 0; }
  .lightbox-info h3 { width: 100%; margin: 0; font-size: 14px; }
}

/* Narzędzia przypięte do rogów zdjęcia, również dla pionowych kadrów. */
.lightbox-top [data-lightbox-close] { margin-left: auto; }
.lightbox-body { display: flex; flex-direction: row; }
.lightbox-photo-surface { position: relative; flex: none; container-type: inline-size; }
.lightbox-photo-surface .lightbox-info { position: absolute; top: 12px; left: 12px; display: block; box-sizing: border-box; max-width: calc(100% - 200px); max-height: calc(100% - 24px); overflow: auto; padding: 14px 18px; background: rgb(0 0 0 / 72%); border-radius: 6px; color: #eee; font-size: 13px; line-height: 1.5; }
.lightbox-photo-surface .lightbox-info h2 { font-size: 24px; margin: 0 0 10px; }
.lightbox-photo-surface .lightbox-info h3 { font-size: 14px; margin: 0 0 10px; }
.lightbox-photo-surface .lightbox-info p { margin: 0 0 5px; }
.lightbox-original-button { position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; min-height: 42px; padding: 0 16px; border-radius: 6px; background: #a62d32; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: 0 3px 12px #0006; }
.lightbox-original-button:hover { background: #c23c42; color: #fff; }
.lightbox-stage > button { width: 58px; height: 58px; font-size: 46px; font-weight: 600; background: #080808e6; color: #fff; border: 2px solid #ffffffb3; box-shadow: 0 3px 15px #0009; z-index: 2; }
.lightbox-stage > button:hover { background: #a62d32; border-color: #fff; }
.lightbox-stage a:focus-visible, .lightbox-stage button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@container (max-width: 560px) {
  .lightbox-photo-surface .lightbox-info { top: 62px; left: 8px; max-width: calc(100% - 16px); max-height: calc(100% - 70px); padding: 10px 12px; font-size: 11px; }
  .lightbox-photo-surface .lightbox-info h2 { font-size: 20px; }
  .lightbox-photo-surface .lightbox-info h3 { font-size: 12px; }
  .lightbox-original-button { top: 8px; right: 8px; font-size: 12px; min-height: 38px; padding: 0 12px; }
}
@media (max-width: 700px) { .lightbox-stage > button { width: 44px; height: 44px; font-size: 34px; } .lightbox-prev { left: 4px; } .lightbox-next { right: 4px; } }

/* Stałe, kompaktowe nakładki niezależnie od proporcji zdjęcia. */
.gallery-lightbox, .gallery-lightbox::backdrop { background: #000; border: 0; border-radius: 0; }
.lightbox-photo-surface .lightbox-info { top: 20px; left: 20px; padding: 7px 9px; border-radius: 4px; font-size: 12px; line-height: 1.5; max-width: calc(100% - 184px); max-height: calc(100% - 40px); background: rgb(0 0 0 / .55); text-shadow: none; }
.lightbox-photo-surface .lightbox-info p { font-size: 12px; margin: 0 0 3px; }
.lightbox-photo-surface .lightbox-info p:last-child { margin-bottom: 0; }
.lightbox-photo-surface .lightbox-original-button { top: 20px; right: 20px; box-sizing: border-box; width: 132px; height: 32px; min-height: 32px; padding: 0; justify-content: center; font-size: 12px; line-height: 1; white-space: nowrap; border-radius: 4px; }

.photo-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 0 4px; }
.photo-tags h5 { margin: 0; font-size: 12px; font-weight: 400; line-height: 1.5; }
.photo-tags a { display: block; padding: 4px 9px; border: 1px solid #363636; border-radius: 5px; background: #171717; color: #ccc; text-decoration: none; overflow-wrap: anywhere; }
.photo-tags a:hover, .photo-tags a:focus-visible { background: #302020; border-color: #954040; color: #fff; }
.lightbox-photo-column { flex: none; max-width: 100%; min-width: 0; }
.lightbox-tags { box-sizing: border-box; max-height: 110px; overflow-y: auto; }
.lightbox-tags:empty { display: none; }
.tag-picker { border: 1px solid #333; padding: 12px; border-radius: 5px; }
.tag-picker legend { font-size: 14px; color: #ddd; }
.tag-selected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag-choice { display: inline-flex; align-items: center; gap: 6px; background: #222; padding: 3px 8px; border-radius: 4px; font-size: 12px; }
.tag-choice button { padding: 0 5px; border: 0; font-size: 18px; }

/* Niewielkie narzędzia bezpośrednio przy zdjęciu. */
.photo-item-actions { display: flex; align-items: center; gap: 36px; padding: 7px 0 2px; }
.photo-item-actions button { font-size: 10px; line-height: 1; padding: 5px 7px; border-radius: 4px; border: 1px solid #365368; background: #182733; color: #bce1ff; }
.photo-item-actions .editor-danger { color: #ef9b9b; background: #301b1f; border-color: #60313a; }
.photo-item-actions button:hover { filter: brightness(1.4); }
#editor-dialog { background: #18212a; color: #e6eef5; border: 1px solid #3c5265; border-top: 4px solid #568daf; }
.editor-dialog-heading { border-bottom: 1px solid #3c5265; margin-bottom: 18px; padding-bottom: 12px; }
#editor-dialog .admin-form > label { display: block; padding: 12px; background: #202e3b; border-radius: 7px; color: #d0e7f5; }
#editor-dialog .admin-form input:not([type=hidden]), #editor-dialog .admin-form select, #editor-dialog .admin-form textarea { box-sizing: border-box; width: 100%; background: #111a23; color: #edf4fa; border: 1px solid #496177; border-radius: 5px; padding: 10px; margin-top: 7px; }
#editor-dialog .admin-form input:focus, #editor-dialog .admin-form select:focus, #editor-dialog .admin-form textarea:focus { outline: 2px solid #74b0d6; outline-offset: 1px; }
#editor-dialog .tag-picker { background: #25332f; border-color: #4b7364; }
#editor-dialog .tag-picker legend { color: #bfe4d3; padding: 0 6px; }
#editor-dialog .tag-choice { background: #365449; color: #e4fff2; }
#editor-dialog .admin-form [type=submit] { background: #286f9b; color: #fff; border: 1px solid #5097be; padding: 11px 18px; border-radius: 6px; }
#editor-dialog .admin-form [type=submit]:hover { background: #3587b8; }
#editor-dialog .hint { color: #b6c7d4; }
.edit-photo-preview { display: block; max-width: 100%; max-height: 150px; object-fit: contain; border-radius: 5px; }

.photo-item-actions { justify-content: space-between; width: 100%; box-sizing: border-box; }
.lightbox-photo-actions:empty { display: none; }
.lightbox-stage .photo-item-actions button { position: static; transform: none; top: auto; width: auto; height: auto; min-height: 0; font-size: 10px; line-height: 1; font-weight: 400; padding: 5px 7px; border-radius: 4px; box-shadow: none; border: 1px solid #365368; background: #182733; color: #bce1ff; }
.lightbox-stage .photo-item-actions .editor-danger { color: #ef9b9b; background: #301b1f; border-color: #60313a; }
.lightbox-info [data-lightbox-category] { color: #d4e8fa; text-decoration: none; font-weight: 600; font-size: 14px; }
.lightbox-info [data-lightbox-category]:hover { color: #fff; text-decoration: underline; }

/* Zdjęcie otwiera dialog, bez linku w pasku stanu przeglądarki. */
button.photo-card[data-lightbox-photo] { width: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; text-align: left; appearance: none; cursor: zoom-in; }
button.photo-card[data-lightbox-photo] * { cursor: inherit; }
button.photo-card[data-lightbox-photo]:focus-visible { outline: 2px solid #a6cee8; outline-offset: 3px; }

/* Szeroka stopka autorska. */
.cow-footer { padding: 0 1rem 1.5rem; margin-top: 2rem; background: #000; border-top: 1px solid #242424; }
.footer-scene { min-height: 300px; display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 2rem; padding: 35px 0 15px; }
.footer-brand { display: inline-block; font-size: clamp(28px, 3vw, 42px); font-weight: 650; letter-spacing: -1.5px; color: #eee; }
.footer-brand span { color: #75b980; }
.footer-brand:hover { text-decoration: none; color: #fff; }
.footer-motto { max-width: 420px; margin: 22px 0; color: #aaa; font-size: 18px; line-height: 1.7; font-weight: 300; overflow-wrap: anywhere; }
.footer-facebook { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; color: #ccc; padding: 8px 0; }
.footer-facebook > span:first-child { display: inline-grid; place-items: center; width: 25px; height: 25px; border: 1px solid #444; border-radius: 50%; font: bold 19px Arial, sans-serif; }
.footer-facebook:not(.footer-interfoto) > span:first-child { flex-shrink: 0; background: #1877f2; border-color: #1877f2; color: #fff; }
.footer-facebook-icon { display: block; width: 10px; height: 16px; transform: translate(-1.5px, .5px); }
.footer-facebook:not(.footer-interfoto):hover > span:first-child { background: #3189fa; border-color: #3189fa; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; }
.footer-interfoto > span:first-child { border-radius: 5px; border-color: #3a7548; background: #173921; color: #d4ead7; font-size: 11px; letter-spacing: .5px; }
.footer-interfoto:hover > span:first-child { background: #215b30; border-color: #75b980; }
.footer-cow { display: block; width: 100%; height: auto; max-width: 490px; justify-self: end; opacity: .85; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; padding-top: 23px; border-top: 1px solid #202020; font-size: 12px; color: #777; }
@media (max-width: 650px) {
  .footer-scene { grid-template-columns: 1fr; gap: 0; padding-top: 35px; }
  .footer-cow { max-width: 420px; justify-self: center; }
  .footer-motto { font-size: 16px; }
  .footer-bottom { flex-wrap: wrap; }
}

/* Smukły nagłówek ze wspólnym logotypem. */
.site-header { min-height: 76px; padding: 16px 1rem; gap: 24px; justify-content: space-between; flex-wrap: wrap; }
.header-brand { flex-shrink: 0; color: #eee; font-size: 26px; font-weight: 650; line-height: 1.2; letter-spacing: -1px; }
.header-brand span { color: #75b980; }
.header-brand:hover { color: #fff; text-decoration: none; }
.site-header .site-nav-main { margin-left: auto; gap: 6px 22px; justify-content: flex-end; }
.site-header .site-nav-main a { position: relative; margin: 0; padding: 10px 0; font-size: 18px; font-weight: 300; line-height: 1.7; color: #aaa; transition: color 160ms ease; }
.site-header .site-nav-main .home-logo { padding: 0; }
.site-header .site-nav-main .home-logo::after { display: none; }
.site-header .site-nav-main a:hover, .site-header .site-nav-main a[aria-current="page"] { color: #fff; text-decoration: none; }
.site-header .site-nav-main a[aria-current="page"]::after { content: ''; position: absolute; bottom: 2px; left: 0; right: 0; height: 2px; background: #75b980; border-radius: 2px; }
.header-brand:focus-visible { outline: 2px solid #75b980; outline-offset: 6px; }
@media (max-width: 650px) {
  .site-header { gap: 10px; padding-top: 15px; padding-bottom: 12px; }
  .header-brand { font-size: 24px; }
  .site-header .site-nav-main { width: 100%; margin-left: 0; justify-content: flex-start; gap: 4px 20px; }
  .site-header .site-nav-main a { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .site-header .site-nav-main a { transition: none; } }


#editor-dialog .admin-form .category-delete-button { margin-left: auto; background: #48242a; border-color: #84434c; color: #ffd4d4; }
#editor-dialog .admin-form .category-delete-button:hover { background: #6d2c36; }
