.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  position: relative;
}

@media (max-width: 768px) {
  h1 {
    font-size: 4rem !important;
  }
}

@media (max-width: 390px) {
  h1 {
    font-size: 3rem !important;
  }
}

.content {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.portfolio-item {
  width: 100%;
  height: 100%;
}

.works-container {
  margin: 2rem auto 0;

  display: grid;
  grid-template-columns: 1.5fr 1fr 1.5fr;
  grid-auto-rows: auto;
  max-width: 1200px;
  gap: 16px;
  /* grid-template-columns: repeat(3, 1fr);
    gap: 40px; 
    padding: 20px; */
}

.container-item {
  padding: 0;
  text-align: center;
  border-radius: 8px;
}

@media (max-width: 992px) {
  .works-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .works-container {
    grid-template-columns: 1fr;
  }
}

.item-description {
  display: flex;
  width: 300%;
  justify-self: center;
  text-align: left;
  flex-direction: column;
  margin: 12px 6px;
  text-wrap: wrap;

  padding: 1rem;
  border-radius: 12px;
  background-color: var(--first-color);
  color: var(--second-color);
  border: 1px var(--second-color) solid;
}

@media (max-width: 1300px) {
  .item-description {
    width: 175%;
  }
}

@media (max-width: 860px) {
  .item-description {
    width: 120%;
  }
}

@media (max-width: 600px) {
  .item-description {
    width: 90%;
  }
}

.item-description h3 {
  font-size: 1.125em !important;
  text-wrap: wrap;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  /* height: auto; */
  object-fit: cover;
  cursor: pointer;
  border-radius: 12px;
  transition: 300ms ease;
}

.portfolio-item img:hover {
  transform: scale(1.03);
}

.hidden {
  display: none;
}

#pop-up-window {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1100;
}

#pop-up-window .overlay-wrap {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1101;
  background-color: rgba(0, 0, 0, 0.9);
}

#pop-up-window .content {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  width: 100%;
  height: 100%;
  z-index: 1102;
}

#pop-up-window .close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1103;
}

@media (max-width: 390px) {
  #pop-up-window .close-btn {
    top: 0.5rem;
    right: 0.5rem;
  }
}

#pop-up-window .close-btn button {
  font-size: 2rem;
  color: var(--second-color);
  background-color: transparent;
  border: none;
  cursor: pointer;
}

#pop-up-window .container-item {
  width: min(70%, 400px);
  max-height: 80%;
  font-size: 1.2rem;
  text-align: center;
  color: var(--second-color);
}

@media (max-width: 390px) {
  #pop-up-window .container-item {
    width: min(90%, 400px);
  }
}

.w-full {
  width: 100%;
}

.d-flex {
  display: flex;
}

.mt-16 {
  margin-top: 1rem;
}

.center {
  justify-content: center;
  align-items: center;
}

.basic-gap {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
}

.sm-logo {
  width: 34px;
}

.flex-item-equal {
  justify-self: stretch;
}

.self-f-start {
  justify-self: flex-start;
}

.flex-item-auto {
  justify-self: center;
}

.sm-gap {
  gap: 0.25rem;
}

/* SEARCHING */

.search-wrapper {
  width: 100%;
}

#search-input {
  justify-self: center;

  width: 250px;
  padding: 0.5em 0.6em;
  font-size: 16px;
  border: 1px solid var(--first-color);
  border-radius: 12px;
  outline: none;
  background-color: var(--second-color);
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

#search-input:focus {
  border-color: #5b9df9;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(91, 157, 249, 0.2);
}

/* END SEARCHING */

/* HASHTAGS */

.hashtag-wrapper {
  margin-top: 1.75rem;

  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hashtag-item {
  display: inline-block;
  background-color: var(--second-color);
  border: 1px var(--first-color) solid;
  padding: 0.2em 0.6em;
  border-radius: 12px;
  transition: background-color 200ms;
  cursor: pointer;
}

.hashtag-item:hover {
  background-color: #afafaf;
}

.hashtag-item.selected {
  background-color: var(--first-color);
  color: var(--second-color);
}

.popup-hashtags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1rem;
}

.popup-hashtags:first-child {
  margin-top: 0;
}

.popup-hashtag {
  display: inline-block;
  color: var(--first-color);
  background-color: var(--second-color);
  border: 1px var(--first-color) solid;
  padding: 0.2em 0.6em;
  border-radius: 12px;
  font-size: 0.9em;
}

/* END HASHTAGS */

/* PHOTO ARCHIVE STYLES */

.photo-archive {
  position: relative;
}

.archive-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.archive-overlay {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 12px;
  color: var(--second-color);
  font-size: 1.1rem;
  font-weight: 600;
}

.photo-archive:hover .archive-overlay {
  opacity: 1;
}

.archive-overlay i {
  font-size: 2.5rem;
  margin-bottom: 0.25rem;
}

.archive-overlay .photo-count {
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.9;
}

/* GALLERY MODAL STYLES */

.gallery-container {
  width: 100%;
  max-width: 1200px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.gallery-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.gallery-image-wrapper {
  position: relative;
  flex: 1;
  max-width: 900px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gallery-main-image {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gallery-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: var(--second-color);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.gallery-nav-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid var(--second-color);
  color: var(--second-color);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.gallery-nav-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.gallery-nav-btn:active {
  transform: scale(0.95);
}

.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.75rem;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1rem;
}

.gallery-thumbnail {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
  opacity: 0.7;
}

.gallery-thumbnail:hover {
  opacity: 1;
  transform: scale(1.05);
}

.gallery-thumbnail.active {
  border-color: var(--second-color);
  opacity: 1;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* RESPONSIVE GALLERY STYLES */

@media (max-width: 992px) {
  .gallery-container {
    padding: 1.5rem;
  }

  .gallery-main {
    gap: 0.5rem;
  }

  .gallery-nav-btn {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }

  .gallery-thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.5rem;
  }
}

@media (max-width: 768px) {
  .gallery-container {
    padding: 1rem;
    gap: 1rem;
  }

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

  .gallery-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    position: absolute;
    z-index: 10;
  }

  .gallery-prev {
    left: 0.5rem;
  }

  .gallery-next {
    right: 0.5rem;
  }

  .gallery-image-wrapper {
    width: 100%;
  }

  .gallery-main-image {
    max-height: 60vh;
  }

  .gallery-thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 0.5rem;
    padding: 0;
  }

  .archive-overlay {
    font-size: 1rem;
  }

  .archive-overlay i {
    font-size: 2rem;
  }
}

@media (max-width: 576px) {
  .gallery-container {
    padding: 0.75rem;
  }

  .gallery-main-image {
    max-height: 50vh;
  }

  .gallery-nav-btn {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .gallery-prev {
    left: 0.25rem;
  }

  .gallery-next {
    right: 0.25rem;
  }

  .gallery-counter {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
    bottom: 0.5rem;
  }

  .gallery-thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 0.4rem;
  }

  .archive-overlay {
    font-size: 0.9rem;
  }

  .archive-overlay i {
    font-size: 1.75rem;
  }

  .archive-overlay .photo-count {
    font-size: 0.8rem;
  }
}

@media (max-width: 390px) {
  .gallery-container {
    padding: 0.5rem;
  }

  .gallery-main-image {
    max-height: 45vh;
  }

  .gallery-thumbnails {
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
  }

  .gallery-counter {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
}

/* END GALLERY STYLES */