.spf_container {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.5rem;
  padding: 1rem;
  white-space: normal;
}

.spf_container.spf_size_small {
  grid-template-columns: repeat(5, 1fr);
}

.spf_container .spf_item {
  position: relative;
  padding-bottom: 100%;
  overflow: hidden;
}

.spf_container .spf_item img {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: all 0.2s ease-in-out;
}

.spf_container .spf_item img:hover,
.spf_container .spf_item a:focus img {
  transform: scale(1.1);
}

.spf_caption {
  font-size: 11px;
  padding: 0.5rem;
}

#spf_lightbox_container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  z-index: 99999999;
}

#spf_lightbox_image_box {
  position: fixed;
  top: 2em;
  left: 2em;
  right: calc(2em + 35%);
  bottom: 2em;
  text-align: center;
}

#spf_lightbox_image_box img {
  max-width: 100%;
  max-height: 100%;
  border: 2px solid #000;
  outline: 1px solid #ccc;
  box-sizing: border-box;
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
}

#spf_lightbox_caption {
  position: fixed;
  bottom: 11em;
  top: 7em;
  right: 2em;
  background: #222;
  color: #fff;
  padding: .5em;
  box-sizing: border-box;
  text-align: center;
  border: 1px solid #ccc;
  width: calc(35% - 4em);
  overflow-y: auto;
  text-align: left;
}

#spf_lightbox_link {
  position: fixed;
  right: 2em;
  bottom: 7em;
  background: #222;
  color: #fff;
  padding: .5em;
  width: calc(35% - 4em);
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  border: 1px solid #ccc;
}
#spf_lightbox_link:hover {
  background: #444;
}

#spf_lightbox_next > svg,
#spf_lightbox_prev > svg,
#spf_lightbox_close > svg {
  width: 3em;
  height: 3em;
  color: #fff;
}

#spf_lightbox_next:hover > svg,
#spf_lightbox_prev:hover > svg,
#spf_lightbox_close:hover > svg {
  color: #aaaaaa;
}

#spf_lightbox_next {
  position: fixed;
  right: 2em;
  transform: translateY(-50%);
  cursor: pointer;
  bottom: 1em;
}

#spf_lightbox_prev {
  position: fixed;
  transform: translateY(-50%);
  cursor: pointer;
  bottom: 1em;
  right: calc(35% - 5em);
}

#spf_lightbox_close {
  position: fixed;
  top: 2em;
  right: 2em;
  cursor: pointer;
}

@media (orientation:portrait) {
  #spf_lightbox_image_box {
    right: 2em;
    bottom: 16em;
    top: 7em;
  }

  #spf_lightbox_caption {
    top: unset;
    left: 2em;
    width: unset;
    text-align: center;
    bottom: 2em;
    height: 8.8em;
  }

  #spf_lightbox_link {
    bottom: 12em;
    right: 50%;
    translate: 50%;
    width: unset;
    max-width: calc(100% - 11em);
  }

  #spf_lightbox_prev {
    left: 2em;
    right: unset;
    bottom: 9.8em;
  }

  #spf_lightbox_next {
    bottom: 9.8em;
  }
}

@media only screen and (max-width: 768px) {
  .spf_container {
	grid-template-columns: 1fr 1fr;
	padding: 1rem 0;
  }

  .spf_container.spf_size_small {
	grid-template-columns: repeat(3, 1fr);
  }
}

@media only screen and (max-width: 480px) {
  .spf_container {
	grid-template-columns: 1fr;
  }

  .spf_container.spf_size_small {
	grid-template-columns: 1fr 1fr;
  }
}

.spf_carousel_container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
    padding: 0;
}

.spf_carousel {
    width: 100%;
    overflow: hidden;
}

.spf_carousel_track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.spf_carousel_item {
    flex: 0 0 auto;
    padding: 8px;
    box-sizing: border-box;
}

.spf_carousel_frame {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.spf_instagram_logo {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 24px;
    height: 24px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.spf_instagram_logo:hover {
    opacity: 1;
}

.spf_carousel_frame img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.spf_carousel_frame:hover img {
    transform: scale(1.02);
}

.spf_carousel_caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 20px 10px 10px;
    font-size: 14px;
    line-height: 1.4;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.spf_carousel_frame:hover .spf_carousel_caption {
    opacity: 1;
    transform: translateY(0);
}

.spf_carousel_prev,
.spf_carousel_next {
    position: absolute;
	padding: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
    opacity: 0;
}

.spf_carousel_container:hover .spf_carousel_prev,
.spf_carousel_container:hover .spf_carousel_next {
    opacity: 1;
}

.spf_carousel_prev {
    left: 10px;
}

.spf_carousel_next {
    right: 10px;
}

.spf_carousel_prev:hover,
.spf_carousel_next:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.1);
}

.spf_insta_link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
}

.spf_insta_link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.spf_carousel_frame:hover .spf_insta_link img {
    transform: scale(1.02);
}

.spf-follow {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.spf-follow div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Instagram Header */
.instagram-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    width: fit-content;
    padding: 8px;
}

.instagram-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.instagram-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.instagram-name {
    font-size: 15px;
    line-height: 20px;
    font-weight: 700;
    color: #0f1419;
    margin: 0;
}

.instagram-username {
    font-size: 15px;
    line-height: 20px;
    color: #536471;
}

.instagram-follow {
    background: #0095f6;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 16px;
    font-weight: 700;
    text-decoration: none;
    color: #fff !important;
    transition: background 0.2s ease;
}

.instagram-follow:hover {
    background: #1877f2;
}

@media (max-width: 480px) {
    .instagram-header {
        width: 100%;
    }
}

/* Responsive */
@media (hover: none) {
    .spf_carousel_prev,
    .spf_carousel_next {
        opacity: 1;
        background: rgba(0, 0, 0, 0.3);
    }
    
    .spf_carousel_prev:hover,
    .spf_carousel_next:hover {
        background: rgba(0, 0, 0, 0.5);
    }
}

@media (min-width: 1200px) {
    .spf_carousel_container {
        max-width: 95%;
    }
}

@media (max-width: 1199px) {
    .spf_carousel[data-slides="4"] .spf_carousel_item {
        width: 33.333% !important;
    }
}

@media (max-width: 991px) {
    .spf_carousel[data-slides="4"] .spf_carousel_item,
    .spf_carousel[data-slides="3"] .spf_carousel_item {
        width: 50% !important;
    }
}

@media (max-width: 767px) {
    .spf_carousel[data-slides] .spf_carousel_item {
        width: 100% !important;
    }

    .spf_carousel_prev,
    .spf_carousel_next {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }

    .spf_carousel_caption {
        font-size: 12px;
        padding: 15px 8px 8px;
    }
    
    .spf_instagram_logo {
        width: 20px;
        height: 20px;
        top: 8px;
        right: 8px;
    }
}
