:root {
  color-scheme: light;
  --background: #f3eee6;
  --surface: #fffdf9;
  --text: #302b27;
  --muted: #766d65;
  --accent: #a8896c;
  --line: #e2d8cc;
  --success: #66795f;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #fffaf2 0, transparent 42%),
    var(--background);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.card {
  width: min(720px, 100%);
  min-height: 580px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 7vw, 72px);
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 26px 70px rgba(65, 51, 39, 0.08);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 5vw, 42px);
  font-style: italic;
  letter-spacing: -0.03em;
}

.brand-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.content {
  max-width: 540px;
  margin: 64px 0;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 7vw, 58px);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.description {
  max-width: 470px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
  padding: 12px 16px;
  color: var(--success);
  background: #f1f4ef;
  border-radius: 999px;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
}

footer {
  padding-top: 22px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
}

@media (max-width: 560px) {
  .page {
    padding: 0;
  }

  .card {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .content {
    margin: 48px 0;
  }
}

.login-card {
  min-height: 640px;
}

.login-content {
  width: 100%;
}

.login-title,
.admin-title {
  font-size: clamp(38px, 6vw, 56px);
}

.login-form {
  display: grid;
  gap: 20px;
  margin-top: 34px;
}

.login-form label {
  display: grid;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  padding: 15px 16px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  outline: none;
}

.login-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168, 137, 108, 0.13);
}

button {
  padding: 14px 20px;
  color: #ffffff;
  background: var(--text);
  border: 1px solid var(--text);
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  opacity: 0.88;
}

.button-secondary {
  color: var(--text);
  background: transparent;
  border-color: var(--line);
}

.message {
  margin-top: 24px;
  padding: 13px 15px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
}

.message-error {
  color: #7a3832;
  background: #f8ece9;
  border: 1px solid #edd1cc;
}

.message-success {
  color: #52634d;
  background: #eff4ed;
  border: 1px solid #d9e5d5;
}

.admin-page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 70px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.admin-content {
  padding: 72px 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 48px;
}

.admin-tile {
  min-height: 250px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.admin-tile-muted {
  background: transparent;
  border-style: dashed;
}

.admin-tile-number {
  display: block;
  margin-bottom: 42px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  color: var(--accent);
}

.admin-tile h2 {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-weight: 400;
}

.admin-tile p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 680px) {
  .admin-header {
    align-items: flex-start;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-content {
    padding: 48px 0;
  }
}

.admin-section {
  margin-top: 56px;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 400;
}

.gallery-form {
  display: grid;
  grid-template-columns:
    minmax(0, 2fr)
    minmax(190px, 1fr);
  gap: 22px;
  align-items: end;
}

.field {
  display: grid;
  gap: 9px;
}

.field span,
.checkbox-field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.field input {
  width: 100%;
  padding: 14px 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
}

.field input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow:
    0 0 0 3px rgba(168, 137, 108, 0.13);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.gallery-submit {
  min-height: 48px;
}

.gallery-count {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.empty-state {
  padding: 30px;
  color: var(--muted);
  background: #faf7f2;
  border: 1px dashed var(--line);
  text-align: center;
}

.gallery-list {
  display: grid;
  gap: 14px;
}

.gallery-row {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 22px;
  background: #faf8f4;
  border: 1px solid var(--line);
}

.gallery-main h3 {
  margin: 10px 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 400;
}

.gallery-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.status-badge {
  display: inline-flex;
  padding: 6px 9px;
  color: #765f4c;
  background: #f0e7dd;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gallery-meta {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 200px;
  color: var(--muted);
  font-size: 13px;
}

.gallery-meta strong {
  color: var(--text);
}

.created-content {
  max-width: 850px;
}

.created-details {
  display: grid;
  gap: 18px;
  margin-top: 42px;
}

.created-item {
  display: grid;
  gap: 10px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.created-item > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.created-item code {
  padding: 13px;
  background: #f6f1ea;
  border-radius: 3px;
  overflow-wrap: anywhere;
}

.created-item strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 400;
}

.created-item small {
  color: var(--muted);
  line-height: 1.5;
}

.access-code-item strong {
  letter-spacing: 0.12em;
}

.created-actions {
  margin-top: 30px;
}

.button-link {
  display: inline-flex;
  padding: 14px 20px;
  color: #fff;
  background: var(--text);
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
}

.text-link {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 760px) {
  .admin-section {
    padding: 24px 18px;
  }

  .gallery-form {
    grid-template-columns: 1fr;
  }

  .gallery-row {
    flex-direction: column;
  }

  .gallery-meta {
    min-width: 0;
  }
}

.client-login-card {
  min-height: 620px;
}

.client-gallery-title {
  font-size: clamp(38px, 7vw, 58px);
}

.client-page {
  width: min(1300px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 80px;
}

.client-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.client-hero {
  padding: 90px 0 62px;
  text-align: center;
}

.client-hero h1 {
  max-width: 900px;
  margin: 0 auto;
}

.client-hero > p:last-child {
  margin: 24px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-style: italic;
}

.client-empty-gallery {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px 32px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: center;
}

.client-empty-icon {
  display: grid;
  width: 64px;
  height: 64px;
  margin: 0 auto 26px;
  place-items: center;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 50%;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
}

.client-empty-gallery h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  font-weight: 400;
}

.client-empty-gallery p {
  max-width: 570px;
  margin: 18px auto 0;
  color: var(--muted);
  line-height: 1.7;
}

.client-download-status {
  display: inline-flex;
  margin-top: 28px;
  padding: 10px 14px;
  color: var(--success);
  background: #f1f4ef;
  border-radius: 999px;
  font-size: 13px;
}

@media (max-width: 620px) {
  .client-header {
    align-items: flex-start;
  }

  .client-header button {
    padding: 10px 12px;
    font-size: 12px;
  }

  .client-hero {
    padding: 60px 0 42px;
  }

  .client-empty-gallery {
    padding: 42px 20px;
  }
}

.gallery-detail-page {
  max-width: 1100px;
  margin: 0 auto;
}

.gallery-detail-heading {
  margin-bottom: 44px;
}

.gallery-detail-heading .admin-title {
  margin-top: 16px;
}

.gallery-summary-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.summary-card {
  min-height: 170px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.summary-card > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin: 25px 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  font-weight: 400;
}

.summary-card small {
  color: var(--muted);
  line-height: 1.5;
}

.gallery-access-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px;
  background: #faf7f2;
  border: 1px solid var(--line);
}

.gallery-access-box code {
  overflow-wrap: anywhere;
}

.gallery-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.gallery-information {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
}

.gallery-information > div {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.gallery-information > div:nth-child(odd) {
  padding-right: 24px;
}

.gallery-information dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.gallery-information dd {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.gallery-actions-grid {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.gallery-action-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  color: var(--text);
  background: #faf7f2;
  border: 1px dashed var(--line);
  text-align: left;
}

.gallery-action-card:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.gallery-action-card strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  font-weight: 400;
}

.gallery-action-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.gallery-open-link {
  width: fit-content;
  margin-top: 8px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

@media (max-width: 850px) {
  .gallery-summary-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .gallery-actions-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 580px) {
  .gallery-summary-grid,
  .gallery-information {
    grid-template-columns: 1fr;
  }

  .gallery-access-box {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-access-box .button-link {
    justify-content: center;
  }

  .gallery-information > div:nth-child(odd) {
    padding-right: 0;
  }
}

.photo-upload-form {
  display: flex;
  align-items: end;
  gap: 18px;
}

.photo-file-field {
  flex: 1;
  display: grid;
  gap: 9px;
}

.photo-file-field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.photo-file-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.admin-photo-card {
  min-width: 0;
  background: #faf7f2;
  border: 1px solid var(--line);
}

.admin-photo-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ece7e0;
}

.admin-photo-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.admin-photo-description {
  display: grid;
  gap: 5px;
  padding: 13px;
}

.admin-photo-description strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-photo-description span {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 900px) {
  .admin-photo-grid {
    grid-template-columns:
      repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .photo-upload-form {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-photo-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}

/* Kafelki zdjęć i sterowanie */

.admin-photo-grid {
  display: grid !important;
  grid-template-columns:
    repeat(auto-fill, minmax(190px, 1fr)) !important;
  gap: 18px !important;
  width: 100%;
}

.admin-photo-card {
  min-width: 0;
  overflow: hidden;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.admin-photo-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eae5de;
}

.admin-photo-image img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: contain !important;
}

.admin-photo-description {
  padding: 13px 14px 10px;
}

.admin-photo-description strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-photo-description span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.admin-photo-actions {
  padding: 0 12px 13px;
}

.photo-rotate-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.photo-action-button {
  min-width: 0;
  padding: 9px 6px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
}

.photo-delete {
  margin-top: 9px;
  color: #7a3832;
  font-size: 12px;
}

.photo-delete summary {
  width: fit-content;
  cursor: pointer;
}

.photo-delete form {
  margin-top: 9px;
  padding: 10px;
  background: #f8ece9;
  border: 1px solid #edd1cc;
}

.photo-delete p {
  margin: 0 0 9px;
  line-height: 1.4;
}

.photo-delete-button {
  width: 100%;
  padding: 9px;
  background: #7a3832;
  border-color: #7a3832;
  font-size: 11px;
}

@media (max-width: 600px) {
  .admin-photo-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .photo-rotate-form {
    grid-template-columns: 1fr;
  }
}

#photos {
  scroll-margin-top: 24px;
}

.upload-progress {
  margin-top: 22px;
  padding: 18px;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.upload-progress[hidden] {
  display: none;
}

.upload-progress-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.upload-progress-heading strong {
  font-size: 14px;
}

.upload-progress-heading span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.upload-progress progress {
  width: 100%;
  height: 12px;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  appearance: none;
}

.upload-progress progress::-webkit-progress-bar {
  background: #e6ddd2;
  border-radius: 999px;
}

.upload-progress progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}

.upload-progress progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.upload-progress-error {
  color: #7a3832;
  background: #f8ece9;
  border-color: #edd1cc;
}

.photo-upload-form button:disabled {
  cursor: wait;
  opacity: 0.65;
}

@media (max-width: 600px) {
  .upload-progress-heading {
    flex-direction: column;
    gap: 5px;
  }

  .upload-progress-heading span {
    text-align: left;
  }
}

/* Galeria klienta — układ editorial masonry */

.client-gallery-summary {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.client-gallery-summary span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 13px;
  color: var(--muted);
  background: rgba(255, 253, 249, 0.75);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.client-gallery-summary strong {
  color: var(--text);
}

.client-photo-section {
  padding-bottom: 90px;
}

.client-cover-photo {
  position: relative;
  width: 100%;
  min-height: 440px;
  max-height: 780px;
  display: block;
  overflow: hidden;
  background: #e8e1d9;
  border: 1px solid var(--line);
  text-decoration: none;
}

.client-cover-photo img {
  width: 100%;
  height: 100%;
  min-height: 440px;
  max-height: 780px;
  display: block;
  object-fit: cover;
  transition:
    transform 600ms ease,
    filter 600ms ease;
}

.client-cover-photo:hover img {
  transform: scale(1.015);
  filter: brightness(0.94);
}

.client-cover-caption {
  position: absolute;
  left: 34px;
  bottom: 32px;
  display: grid;
  gap: 5px;
  padding: 16px 19px;
  color: #ffffff;
  background: rgba(39, 34, 30, 0.48);
  backdrop-filter: blur(8px);
}

.client-cover-caption small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.client-cover-caption strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 400;
}

.client-masonry-grid {
  margin-top: 16px;
  column-count: 3;
  column-gap: 16px;
}

.client-masonry-photo {
  position: relative;
  width: 100%;
  display: inline-block;
  margin: 0 0 16px;
  overflow: hidden;
  background: #e9e3dc;
  border: 1px solid var(--line);
  break-inside: avoid;
  text-decoration: none;
  vertical-align: top;
}

.client-masonry-photo img {
  width: 100%;
  height: auto;
  display: block;
  transition:
    transform 400ms ease,
    filter 400ms ease;
}

.client-masonry-photo:hover img {
  transform: scale(1.018);
  filter: brightness(0.94);
}

.client-photo-number {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  place-items: center;
  color: #ffffff;
  background: rgba(42, 37, 33, 0.58);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
}

.client-footer {
  padding: 46px 0 30px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.client-footer .brand-name {
  font-size: 28px;
}

.client-footer p {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-style: italic;
}

@media (max-width: 920px) {
  .client-masonry-grid {
    column-count: 2;
    column-gap: 12px;
  }

  .client-cover-photo,
  .client-cover-photo img {
    min-height: 390px;
  }
}

@media (max-width: 560px) {
  .client-page {
    width: min(100% - 20px, 1300px);
  }

  .client-hero {
    padding: 54px 0 38px;
  }

  .client-cover-photo,
  .client-cover-photo img {
    min-height: 320px;
    max-height: 520px;
  }

  .client-cover-caption {
    left: 15px;
    right: 15px;
    bottom: 15px;
    padding: 13px 15px;
  }

  .client-masonry-grid {
    margin-top: 8px;
    column-count: 2;
    column-gap: 8px;
  }

  .client-masonry-photo {
    margin-bottom: 8px;
  }

  .client-photo-number {
    right: 7px;
    bottom: 7px;
    min-width: 29px;
    height: 24px;
  }

  .client-photo-section {
    padding-bottom: 55px;
  }
}

@media (max-width: 380px) {
  .client-masonry-grid {
    column-count: 1;
  }
}

/* Pełnoekranowy podgląd zdjęć */

body.lightbox-open {
  overflow: hidden;
}

.client-lightbox[hidden] {
  display: none;
}

.client-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  grid-template-rows:
    minmax(0, 1fr)
    auto;
  padding: 64px 28px 20px;
  color: #ffffff;
  background: rgba(18, 16, 15, 0.97);
  backdrop-filter: blur(10px);
}

.client-lightbox-close {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 3;
  width: 42px;
  height: 42px;
  display: grid;
  padding: 0;
  place-items: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 27px;
  font-weight: 300;
  line-height: 1;
}

.client-lightbox-stage {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns:
    54px
    minmax(0, 1fr)
    54px;
  align-items: center;
  gap: 18px;
}

.client-lightbox-image-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
}

.client-lightbox-image-area img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: calc(100vh - 130px);
  display: block;
  object-fit: contain;
  opacity: 1;
  transition: opacity 180ms ease;
}

.client-lightbox-loading
  .client-lightbox-image-area img {
  opacity: 0.2;
}

.client-lightbox-spinner {
  position: absolute;
  z-index: 0;
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  opacity: 0;
  animation: twl-lightbox-spin 800ms linear infinite;
}

.client-lightbox-loading
  .client-lightbox-spinner {
  opacity: 1;
}

.client-lightbox-error
  .client-lightbox-image-area::after {
  content: "Nie udało się wczytać zdjęcia";
  position: absolute;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

@keyframes twl-lightbox-spin {
  to {
    transform: rotate(360deg);
  }
}

.client-lightbox-navigation {
  width: 50px;
  height: 50px;
  display: grid;
  padding: 0;
  place-items: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  font-size: 22px;
  font-weight: 300;
}

.client-lightbox-navigation:hover,
.client-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.16);
  opacity: 1;
}

.client-lightbox-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding-top: 17px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.client-lightbox-footer a {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.32);
}

@media (max-width: 700px) {
  .client-lightbox {
    padding:
      58px
      10px
      max(14px, env(safe-area-inset-bottom));
  }

  .client-lightbox-close {
    top: 10px;
    right: 12px;
    width: 39px;
    height: 39px;
  }

  .client-lightbox-stage {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .client-lightbox-image-area img {
    max-height: calc(100vh - 125px);
  }

  .client-lightbox-navigation {
    position: absolute;
    z-index: 2;
    top: 50%;
    width: 42px;
    height: 42px;
    transform: translateY(-50%);
    background: rgba(22, 19, 17, 0.55);
  }

  .client-lightbox-previous {
    left: 8px;
  }

  .client-lightbox-next {
    right: 8px;
  }

  .client-lightbox-footer {
    justify-content: space-between;
    gap: 14px;
    padding: 14px 8px 0;
  }
}

.photo-cover-form {
  margin-bottom: 8px;
}

.photo-cover-button {
  width: 100%;
  padding: 10px 8px;
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
  font-size: 11px;
}

.photo-cover-active {
  margin-bottom: 8px;
  padding: 10px 8px;
  color: #5d6c57;
  background: #edf3ea;
  border: 1px solid #d5e2d1;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Pobieranie pojedynczego zdjęcia */

.client-cover-wrap,
.client-masonry-item {
  position: relative;
}

.client-masonry-item {
  width: 100%;
  display: inline-block;
  margin: 0 0 16px;
  break-inside: avoid;
  vertical-align: top;
}

.client-masonry-item .client-masonry-photo {
  width: 100%;
  display: block;
  margin: 0;
  break-inside: auto;
}

.client-photo-download {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #332d29;
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 50%;
  box-shadow: 0 5px 18px rgba(30, 25, 21, 0.15);
  text-decoration: none;
  backdrop-filter: blur(8px);
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.client-cover-download {
  top: 16px;
  right: 16px;
}

.client-photo-download:hover {
  color: #332d29;
  background: #ffffff;
  transform: translateY(-1px);
  opacity: 1;
}

.client-photo-download svg,
.client-lightbox-download svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.client-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.client-lightbox-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.client-lightbox-download[hidden] {
  display: none;
}

@media (max-width: 560px) {
  .client-masonry-item {
    margin-bottom: 8px;
  }

  .client-photo-download {
    top: 7px;
    right: 7px;
    width: 37px;
    height: 37px;
  }

  .client-cover-download {
    top: 11px;
    right: 11px;
  }

  .client-lightbox-actions {
    gap: 13px;
  }

  .client-lightbox-footer {
    font-size: 11px;
  }
}
