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

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  background: #f2f2f2;
  font-family: "Athelas", bold;
  overflow-x: hidden;
  width: 100%;
}

.site-header {
  align-items: center;
  display: flex;
  justify-content: center;
  left: 0;
  mix-blend-mode: difference;
  padding: 40px 60px;
  position: fixed;
  text-transform: uppercase;
  top: 0;
  width: 100%;
  z-index: 100;
}

.site-logo {
  border-bottom: none;
  box-shadow: none;
  color: #f2f2f2;
  font-size: 1.4rem;
  font-weight: 700;
  left: 60px;
  position: absolute;
  text-decoration: none;
  text-transform: none;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 56px;
}
.site-nav a {
  color: #f2f2f2;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: opacity 0.25s ease;
}
.site-nav a:hover {
  opacity: 0.7;
}

.gallery-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 40px;
  margin-top: 130px;
  margin-bottom: 00px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 240px;
  gap: 24px;
  align-items: start;
}

.gallery-item {
  overflow: hidden;
  border-radius: 8px;
  background-color: #f5f5f5;
  cursor: default;
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
  animation: none !important;
}

.gallery-item:hover,
.gallery-item:focus,
.gallery-item:active {
  transform: none !important;
  box-shadow: none !important;
  cursor: default;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: none !important;
  transition: none !important;
  animation: none !important;
}

.gallery-item:hover img,
.gallery-item:focus img,
.gallery-item:active img {
  transform: none !important;
}

.gallery-item.item-1 {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
  background-color: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item.item-1 img {
  width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  background-color: transparent;
}

.gallery-item.item-2 {
  grid-column: 2 / 4;
  grid-row: 1 / 2;
}

@media (max-width: 1024px) {
  .site-header {
    justify-content: flex-start;
    padding: 20px 20px;
  }

  .site-logo {
    font-size: 1.3rem;
    left: auto;
    position: static;
  }

  .site-nav {
    margin-left: auto;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .site-nav a {
    font-size: 0.72rem;
    letter-spacing: 0.03em;
  }

  .gallery-page {
    max-width: 100%;
    margin: 0;
    padding: 40px 20px;
    margin-top: 100px;
    margin-bottom: 40px; /* مقدار معقول برای فاصله از پایین */
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr); /* دو ستونه */
    grid-auto-rows: auto; /* حذف مقدار ۵۰۰ پیکسل و اجازه دادن به محتوا */
    gap: 20px;
    margin-bottom: 0; /* حذف آن -۵۰۰۰ پیکسل مخرب */
  }

  /* ریست کردن تمام استایل‌های قبلی آیتم‌ها برای جلوگیری از تداخل */
  .gallery-item {
    grid-column: span 2 !important; /* بیشتر آیتم‌ها تمام عرض شوند */
    grid-row: auto !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    height: auto;
  }

  /* فاصله جزئی برای آیتم‌هایی که نیاز به تاکید دارند */
  .gallery-item.item-1 {
    width: 50%;
  }
}


@media (max-width: 500px) {
  .site-header {
    padding: 18px 16px;
    justify-content: flex-start;
  }

  .site-logo {
    font-size: 1.1rem;
    position: static;
    left: auto;
  }

  .site-nav {
    margin-left: auto;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .site-nav a {
    font-size: 0.68rem;
    letter-spacing: 0.02em;
  }

  .gallery-page {
    padding: 60px 16px 30px;
    margin-bottom: 0;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 30px;
    margin-top: 50px;
    margin-bottom: 0;
  }

  .gallery-item,
  .gallery-item.item-1,
  .gallery-item.item-2 {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    margin-top: 0 !important;
    margin-left: 0 !important;
    height: auto;
    width: 100%;
  }

  .gallery-item img,
  .gallery-item.item-1 img {
    width: 60%;
    height: auto;
    max-height: none;
    object-fit: cover;
    display: block;
  }

  .gallery-item.item-2 img {

    width: 100%;
  }
}

