* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

html {
  scroll-behavior: smooth
}

body {
  font-family: Georgia, serif;
  background: #f4f1ec;
  color: #2c2c2c;
  overflow-x: hidden
}

img {
  max-width: 100%
}

nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(32, 31, 35, .94);
  backdrop-filter: blur(10px);
  padding: 14px 12px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .22)
}

nav a {
  display: inline-block;
  color: #fff;
  text-decoration: none;
  margin: 6px 14px;
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: clamp(12px, 2vw, 15px);
  letter-spacing: 1px;
  position: relative
}

nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 0;
  height: 2px;
  background: #d99a32;
  transition: width .25s ease
}

nav a:hover::after,
nav a.active::after {
  width: 100%
}

.home-icon svg {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  transition: transform .25s ease
}

.home-icon:hover svg {
  transform: scale(1.2)
}

.page-transition {
  animation: pageFade .45s ease both
}

.hero {
  min-height: clamp(360px, 65vh, 560px);
  background: linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .58)), url("https://images.unsplash.com/photo-1577720643272-265f09367456?auto=format&fit=crop&w=1800&q=80");
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  text-align: center;
  color: white;
  padding: 40px 18px
}

.hero-box {
  animation: fadeUp .8s ease both
}

.hero h1 {
  font-size: clamp(42px, 9vw, 92px);
  font-style: italic;
  line-height: 1.05;
  text-shadow: 4px 4px 14px rgba(0, 0, 0, .8);
  margin-bottom: 16px
}

.hero p {
  font-family: Arial, sans-serif;
  font-size: clamp(16px, 2.6vw, 21px);
  max-width: 680px;
  margin: 0 auto 28px;
  line-height: 1.5
}

.hero a,
.cta a,
.button {
  display: inline-block;
  background: linear-gradient(135deg, #d99a32, #9f6417);
  color: white;
  text-decoration: none;
  padding: 14px 30px;
  border-radius: 999px;
  font-family: Arial, sans-serif;
  font-weight: bold;
  font-size: clamp(15px, 2.5vw, 19px);
  border: 0;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .24);
  transition: transform .25s ease, box-shadow .25s ease
}

.hero a:hover,
.cta a:hover,
.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .32)
}

.section {
  width: min(1180px, calc(100% - 28px));
  margin: -55px auto 0;
  padding: clamp(32px, 5vw, 55px) clamp(14px, 3vw, 25px);
  text-align: center;
  background: rgba(255, 255, 255, .92);
  border-radius: clamp(18px, 4vw, 28px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .12);
  position: relative;
  z-index: 2
}

.section.flat {
  margin-top: 45px
}

.section h2 {
  font-size: clamp(30px, 6vw, 44px);
  margin-bottom: 12px
}

.section p {
  font-family: Arial, sans-serif;
  font-size: clamp(15px, 2.5vw, 19px);
  color: #777;
  margin-bottom: 30px;
  line-height: 1.65
}

.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px
}

.filters button {
  padding: 11px 18px;
  border: 1px solid #ddd;
  background: white;
  cursor: pointer;
  font-size: 14px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
  transition: .25s ease
}

.filters button:hover,
.filters button.active {
  background: #3c3129;
  color: white;
  transform: translateY(-2px)
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(14px, 2.5vw, 24px)
}

.card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  cursor: pointer;
  aspect-ratio: 4/3;
  min-height: 210px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, .22);
  background: #ddd
}

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

.card:hover img {
  transform: scale(1.1);
  filter: brightness(.65)
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: left;
  padding: clamp(16px, 3vw, 24px);
  color: white;
  opacity: 0;
  transition: .35s;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78))
}

.card:hover .overlay {
  opacity: 1
}

.overlay h3 {
  font-size: clamp(20px, 4vw, 26px)
}

.overlay span {
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: #f0c37b;
  text-transform: uppercase;
  letter-spacing: 1px
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
  margin-top: 28px;
  text-align: left
}

.info-card {
  background: #fff;
  border-radius: 20px;
  padding: 26px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .1);
  font-family: Arial, sans-serif
}

.info-card h3 {
  margin-bottom: 10px;
  color: #3c3129
}

.contact-form {
  display: grid;
  gap: 14px;
  max-width: 640px;
  margin: 0 auto
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 15px 16px;
  font-family: Arial, sans-serif;
  font-size: 16px;
  background: #fff
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical
}

.pagination {
  margin-top: 34px
}

.pagination span {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid #ddd;
  background: white;
  margin: 3px;
  border-radius: 8px;
  font-family: Arial, sans-serif
}

.pagination .active {
  background: #3c3129;
  color: white
}

.cta {
  margin-top: 60px;
  background: linear-gradient(rgba(19, 18, 20, .82), rgba(19, 18, 20, .9)), url("https://images.unsplash.com/photo-1518998053901-5348d3961a04?auto=format&fit=crop&w=1600&q=80");
  background-size: cover;
  background-position: center;
  color: white;
  text-align: center;
  padding: clamp(55px, 9vw, 85px) 18px
}

.cta h2 {
  font-size: clamp(30px, 6vw, 46px);
  margin-bottom: 15px
}

.cta p {
  font-family: Arial, sans-serif;
  font-size: clamp(16px, 2.8vw, 21px);
  margin-bottom: 28px
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .88);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 20px
}

.lightbox.active {
  display: flex
}

.lightbox img {
  max-width: 96vw;
  max-height: 84vh;
  border-radius: 18px
}

.close {
  position: absolute;
  top: 16px;
  right: 22px;
  font-size: 42px;
  color: white;
  cursor: pointer;
  font-family: Arial, sans-serif
}

@keyframes pageFade {
  from {
    opacity: 0;
    transform: translateY(10px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(35px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@media (hover:none) {
  .overlay {
    opacity: 1
  }

  .card img {
    filter: brightness(.78)
  }
}

@media (max-width:480px) {
  nav {
    padding: 10px 6px
  }

  nav a {
    margin: 5px 8px
  }

  .section {
    width: calc(100% - 18px);
    margin-top: -35px
  }

  .section.flat {
    margin-top: 28px
  }

  .filters button {
    flex: 1 1 calc(50% - 10px)
  }

  .card {
    min-height: 220px
  }
}


.footer {
  margin-top: 60px;
  background: linear-gradient(135deg, #1c1b1f, #0f0e11);
  color: #ddd;
  padding: 50px 20px 20px
}

.footer-container {
  max-width: 1180px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 30px
}

.footer-col h3 {
  color: #fff;
  margin-bottom: 15px;
  font-size: 20px
}

.footer-col p,
.footer-col a {
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #aaa;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  line-height: 1.6;
  transition: .3s
}

.footer-col a:hover {
  color: #d99a32;
  transform: translateX(4px)
}

.footer-bottom {
  margin-top: 35px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  text-align: center;
  font-size: 13px;
  color: #777
}

.admin-page {
  min-height: calc(100vh - 80px)
}

.admin-section {
  max-width: 980px
}

.admin-form {
  display: grid;
  gap: 16px;
  max-width: 720px;
  margin: 28px auto 40px;
  text-align: left
}

.admin-form label {
  font-family: Arial, sans-serif;
  font-weight: bold;
  color: #3c3129
}

.admin-form input,
.admin-form textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid #ddd;
  border-radius: 16px;
  padding: 14px 16px;
  font-family: Arial, sans-serif;
  font-size: 16px;
  background: #fff
}

.admin-form textarea {
  min-height: 130px;
  resize: vertical
}

.login-form {
  max-width: 440px
}

.alert {
  max-width: 720px;
  margin: 18px auto;
  padding: 14px 18px;
  border-radius: 14px;
  font-family: Arial, sans-serif;
  text-align: left
}

.alert.error {
  background: #ffe9e9;
  color: #8a1c1c
}

.alert.success {
  background: #e8f7ed;
  color: #176b34
}

.admin-list {
  display: grid;
  gap: 18px;
  margin-top: 30px;
  text-align: left
}

.admin-work {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  align-items: center;
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .1);
  font-family: Arial, sans-serif
}

.admin-work img {
  width: 150px;
  height: 110px;
  object-fit: cover;
  border-radius: 14px
}

.admin-work h3 {
  font-family: Georgia, serif;
  font-size: 24px;
  margin-bottom: 8px;
  color: #2c2c2c
}

.admin-work p {
  margin: 5px 0;
  color: #555;
  font-size: 15px
}

.admin-work small {
  color: #888
}

@media(max-width:620px) {
  .admin-work {
    grid-template-columns: 1fr
  }

  .admin-work img {
    width: 100%;
    height: 220px
  }

  .admin-form {
    margin-top: 22px
  }
}

.card.is-hidden {
  display: none;
}

.overlay p {
  font-family: Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, .88);
  margin-top: 8px;
  margin-bottom: 0;
}

.empty-gallery {
  grid-column: 1 / -1;
  padding: 30px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .75);
  border: 1px dashed rgba(60, 49, 41, .3);
}

/* Admin edit mode */
.admin-work {
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  border: 2px solid transparent;
}

.admin-work:hover,
.admin-work.selected {
  transform: translateY(-2px);
  border-color: #d99a32;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
}

.admin-work.selected {
  background: #fff8ed;
}

.current-image {
  text-align: left;
  padding: 14px;
  border: 1px solid #ead7bc;
  background: #fff8ed;
  border-radius: 14px;
}

.current-image img {
  display: block;
  width: 160px;
  max-width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  margin: 8px 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
}

.current-image p,
.current-image small {
  margin: 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button.secondary {
  background: #f3eee7;
  color: #3c3129;
  box-shadow: none;
}


.admin-filter-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 8px auto 24px;
  font-family: Arial, sans-serif;
}

.admin-filter-panel strong {
  color: #3c3129;
  margin-right: 4px;
}

.admin-filter {
  padding: 9px 16px;
  border: 1px solid #ddd;
  background: #fff;
  color: #3c3129;
  border-radius: 999px;
  cursor: pointer;
  font-family: Arial, sans-serif;
  font-weight: bold;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .07);
  transition: .25s ease;
}

.admin-filter:hover,
.admin-filter.active {
  background: #3c3129;
  color: #fff;
  transform: translateY(-2px);
}

.admin-empty-filter {
  grid-column: 1 / -1;
  text-align: center;
  padding: 22px;
  border-radius: 16px;
  background: #fff8ed;
  border: 1px dashed #d99a32;
  color: #7c5520 !important;
}

/* Poprawka filtrowania w panelu admina:
   reguła .admin-work { display: grid; } nadpisywała atrybut hidden. */
.admin-work[hidden] {
  display: none !important;
}

.admin-work.is-hidden {
  display: none !important;
}

/* Zmiana kolejności prac w panelu admina */
.admin-work {
  position: relative;
  padding-right: 74px;
}

.admin-order-controls {
  position: absolute;
  right: 16px;
  top: 16px;
  display: flex;
  gap: 6px;
  z-index: 3;
}

.order-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #3c3129;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
  transition: transform .2s ease, background .2s ease;
}

.order-button:hover {
  background: #d99a32;
  transform: translateY(-2px);
}

@media(max-width:620px) {
  .admin-work {
    padding-right: 16px;
    padding-top: 58px
  }

  .admin-order-controls {
    left: 16px;
    right: auto;
    top: 16px
  }
}

.art-modal {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, .85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}

.art-modal.active {
  display: flex;
}

.art-modal-content {
  background: #fff;
  max-width: 900px;
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border-radius: 20px;
  padding: 25px;
  position: relative;
  margin: auto;
}

.art-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

.art-grid img {
  width: 100%;
  border-radius: 12px;
}

.art-info h2 {
  margin-bottom: 10px;
}

.art-btn {
  display: inline-block;
  margin-top: 20px;
  background: linear-gradient(135deg, #d99a32, #9f6417);
  color: white;
  padding: 12px 25px;
  border-radius: 999px;
  text-decoration: none;
}

.art-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 30px;
  cursor: pointer;
}

/* mobile */
@media(max-width:700px) {
  .art-grid {
    grid-template-columns: 1fr;
  }
}

.form-message {
  max-width: 640px;
  margin: 0 auto 24px;
  padding: 14px 18px;
  border-radius: 14px;
  font-family: Arial, sans-serif;
  font-weight: 700;
}

.form-message.success {
  color: #176b32;
  background: rgba(23, 107, 50, .1);
}

.form-message.error {
  color: #9b1c1c;
  background: rgba(155, 28, 28, .1);
}

.gallery .card.is-hidden {
  display: none;
}



body.modal-open {
  overflow: hidden;
}

.art-modal {
  display: none !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  background: rgba(0, 0, 0, .85) !important;
  z-index: 99999 !important;

  justify-content: center !important;
  align-items: center !important;

  padding: 16px !important;
  overflow: hidden !important;
}

.art-modal.active {
  display: flex !important;
}

.art-modal-content {
  background: #fff;
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;

  border-radius: 20px;
  padding: 24px;
  position: relative;
  margin: 0 auto;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}

.art-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .8fr);
  gap: 24px;
  align-items: start;
}

.art-grid img {
  width: 100%;
  max-height: calc(100dvh - 110px);
  object-fit: contain;
  border-radius: 14px;
  display: block;
}

.art-close {
  position: absolute;
  top: 12px;
  right: 18px;
  border: 0;
  background: transparent;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  color: #2c2c2c;
}

@media (max-width: 700px) {
  .art-modal {
    align-items: center !important;
  }

  .art-modal-content {
    padding: 20px 16px;
  }

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

  .art-grid img {
    max-height: 45dvh;
  }
}

.page-transition {
  transform: none !important;
}

body.modal-open {
  overflow: hidden !important;
}

.art-modal {
  display: none !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 2147483647 !important;
  background: rgba(0, 0, 0, .86) !important;
  padding: 16px !important;
  overflow: hidden !important;
  align-items: center !important;
  justify-content: center !important;
}

.art-modal.active {
  display: flex !important;
}

.art-modal-content {
  position: relative !important;
  margin: 0 auto !important;
  background: #fff !important;
  width: min(900px, calc(100vw - 32px)) !important;
  max-height: calc(100dvh - 32px) !important;
  overflow-y: auto !important;
  border-radius: 20px !important;
  padding: 24px !important;
}