.portfolio-main {
  position: relative;
}

.single-post .portfolio-main-content {
  width: 100%;
}

.portfolio-main-scroll {
  overflow-x: scroll;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.portfolio-main-scroll::-webkit-scrollbar {
  display: none;
}

.portfolio-main-scroll::-webkit-scrollbar-track {
  background-color: #f5f5f5;
}

.portfolio-main-scroll::-webkit-scrollbar-thumb {
  height: 9px;
  border-radius: 20px;
  background-color: #afafaf;
}

.portfolio-main-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #9d9d9d;
}

.portfolio-main-scroll::-webkit-scrollbar:vertical {
  display: none;
}

.wp-block-image,
.wp-block-gallery,
.wp-block-gallery img {
  width: auto !important;
}

.portfolio-flex {
  display: flex;
  justify-content: space-between;
  margin: 0;
  position: relative;
}

.portfolio-main-content {
  display: flex;
  gap: 20px;
  width: max-content;
}

.portfolio-main-title {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-weight: 200;
  font-size: 30px;
  line-height: 40px;
  letter-spacing: 1.23px;
  color: #222;
  opacity: 0;
  transition: all 0.3s ease;
  text-decoration: none;
}

.portfolio-main-title:hover {
  cursor: pointer;
  opacity: 1;
}

.portfolio-main-title-link {
  text-decoration: none;
  color: #222;
}

.portfolio-main-block:hover:before {
  position: absolute;
  bottom: 45%;
  left: 50%;
  transform: translate(-45%, -45%);
  content: "";
  display: block;
  margin: auto;
  height: 0.5px;
  width: 80px;
  background: #222;
  opacity: 0;
  animation: moveLine 0.3s ease forwards;
  animation-delay: 0.4s;
}

@keyframes moveLine {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 80px;
    opacity: 1;
  }
}

.portfolio-main-block {
  position: relative;
}

.portfolio-main-block a:hover {
  z-index: 5;
}

.card-thumb,
.card-thumb img {
  transition: all 1s ease;
}

.card-thumb img {
  width: 100%;
}

.card-thumb img:hover,
.portfolio-main-block:hover img {
  opacity: 0.3;
}

.portfolio-main-block:hover > span {
  opacity: 1;
}

.card-thumb {
  background: rgba(242, 242, 242, 0.9);
}

.wp-block-gallery {
  flex-wrap: nowrap !important;
  flex-shrink: 0;
  width: max-content !important;
  white-space: nowrap !important;
  overflow-x: hidden !important;
  position: absolute;
  left: 0;
  gap: 20px !important;
}

.wp-block-image {
  width: auto !important;
}

.post-list-description {
  list-style: none;
  width: 530px;
  color: #222;
  position: absolute;
  right: -34px;
  bottom: 3vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}


.post-list-description li:nth-child(odd) {
  font-weight: 600;
  font-size: 13px;
  line-height: 16px;
  letter-spacing: 1.23px;
  text-transform: uppercase;
}

.post-list-description li:nth-child(even) {
  font-weight: 400;
  font-size: 14px;
  line-height: 26px;
  letter-spacing: 1.23px;
  margin-bottom: 18px;
}

.post-list-description li:last-child {
  margin-bottom: 0;
}

@media (min-width: 1025px) {
  
  .portfolio-main,
  .portfolio-main-content,
  .card-thumb,
  .card-thumb img {
    height: 76vh !important;
  }

  .wp-block-image {
    height: 73vh !important;
    object-fit: cover;
  }

  .wp-block-gallery {
    align-items: center;
  }
}



@media (max-width: 1024px) {
  body.single-post {
    display: block !important;
    height: auto !important;
  }

  body.single-post main {
    flex: none !important;
  }

  .portfolio-main-content {
    flex-direction: column;
    width: 100vw;
    gap: 75px;
    height: auto !important;
    min-height: 0 !important;
  }

  .portfolio-main {
    position: static !important;
    overflow: visible;
    margin-top: 75px;
    height: auto !important;
    min-height: 0 !important;
    overflow-x: hidden;
  }

  .card-thumb {
    width: 100vw;
    height: auto !important;
  }

  .card-thumb,
  .card-thumb img {
    display: block;
    width: 100vw !important;
    height: auto !important;
    min-height: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    object-fit: cover;
  }

  .portfolio-main-block {
    width: 100vw;
    height: fit-content;
  }

  .portfolio-main-title {
    z-index: 1;
    opacity: 1;
    top: 100%;
    width: 100%;
    margin-top: 30px;
    font-size: 20px;
    line-height: 40px;
    text-decoration: none;
  }

  .portfolio-main-title:after {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translate(-45%, 0);
    content: "";
    display: block;
    margin: auto;
    height: 0.5px;
    width: 80px;
    background: #222;
  }

  .portfolio-main-block:hover:before {
    opacity: 0;
    width: 0;
    animation: none;
  }

  .wp-block-gallery {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100vw !important;
    height: auto !important;
    overflow-x: visible !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    white-space: normal !important;
  }

  .wp-block-image {
    width: 100vw !important;
    height: auto !important;
    object-fit: cover;
  }

  .single-post .wp-block-gallery img {
    display: block;
    width: 100vw !important;
    height: auto !important;
    min-height: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    object-fit: cover;
  }

  .post-list-description {
    opacity: 1 !important;
    height: max-content;
    position: relative;
    width: 100%;
    top: auto;
    left: auto;
    right: auto;
    margin-top: 24px;
    z-index: 1;
  }

  /* mobile footer styles only for main portfolio grid */
  body.page-template-portfolio footer {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100%;
  }

  body.page-template-portfolio .post-navigation-link-next {
    position: static !important;
    height: auto;
    margin: 32px auto 0;
    width: 96vw;
    top: auto;
    left: auto;
    right: auto;
    text-align: right;
    z-index: 1;
  }

  body.page-template-portfolio .post-navigation-link-next a {
    display: inline-block;
    font-size: 14px;
    line-height: 17px;
    text-decoration: none;
  }

  body.page-template-portfolio footer .button {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  body:not(.single-post) .portfolio-main {
    margin-top: 8px !important;
  }
}

@media (max-width: 767px) {
  .post-list-description {
    padding-left: 24px;
    padding-right: 16px;
  }

  .post-list-description li:nth-child(odd),
  .post-list-description li:nth-child(even) {
    text-align: left;
  }
}

