/* ==========================================================================
   Skin Social Gallery — gallery.css
   Scoped under .ssg-gallery to avoid conflicts with Blocksy + Elementor
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset & Container
   -------------------------------------------------------------------------- */
.ssg-gallery *,
.ssg-gallery *::before,
.ssg-gallery *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.ssg-gallery {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
  font-family: "Lato", sans-serif;
  color: #1E1E1E;
}

/* --------------------------------------------------------------------------
   Page Heading
   -------------------------------------------------------------------------- */
.ssg-gallery__heading {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 36px;
  line-height: 1.2;
  text-align: center;
  color: #3A393C;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Subheading
   -------------------------------------------------------------------------- */
.ssg-gallery__subheading {
  font-family: "Lato", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
  color: #1E1E1E;
  margin-bottom: 36px;
}

/* --------------------------------------------------------------------------
   Filter Bar
   -------------------------------------------------------------------------- */
.ssg-filters {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
  padding-bottom: 4px;

  /* Hide scrollbar — all browsers */
  scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE / Edge */
}

.ssg-filters::-webkit-scrollbar {
  display: none; /* Chrome / Safari / Opera */
}

/* --------------------------------------------------------------------------
   Filter Buttons
   -------------------------------------------------------------------------- */
.ssg-filters__btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  background: none !important;
  font-family: "Lato", sans-serif !important;
  font-weight: 400 !important;
  font-size: 11px !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: #999 !important;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1 !important;
  padding-bottom: 4px !important;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.ssg-filters__btn:hover {
  color: #1E1E1E !important;
  background: none !important;
}

.ssg-filters__btn.is-active,
.ssg-filters__btn[aria-pressed="true"] {
  color: #1E1E1E !important;
  border-bottom-color: #1E1E1E !important;
  font-weight: 600 !important;
  background: none !important;
}

/* --------------------------------------------------------------------------
   Gallery Grid
   -------------------------------------------------------------------------- */
.ssg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.ssg-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ssg-card:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

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

/* --------------------------------------------------------------------------
   Card Image
   -------------------------------------------------------------------------- */
.ssg-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* --------------------------------------------------------------------------
   Card Label
   -------------------------------------------------------------------------- */
.ssg-card__label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 36px 16px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  color: #ffffff;
  text-transform: uppercase;
  text-align: left;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Modal Overlay
   -------------------------------------------------------------------------- */
.ssg-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.97);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 24px;
}

.ssg-modal.is-open {
  opacity: 1;
  visibility: visible;
}

/* Body scroll lock */
.ssg-modal-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Modal Content
   -------------------------------------------------------------------------- */
.ssg-modal__content {
  position: relative;
  width: 90%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* --------------------------------------------------------------------------
   Close Button
   -------------------------------------------------------------------------- */
.ssg-modal__close {
  position: absolute;
  top: -40px;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease;
}

.ssg-modal__close:hover {
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Modal Title
   -------------------------------------------------------------------------- */
.ssg-modal__title {
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: #ffffff;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   Modal Body — Main Image + Thumbnails Grid
   -------------------------------------------------------------------------- */
.ssg-modal__body {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  width: 100%;
  align-items: start;
}

.ssg-modal__main-image {
  border-radius: 8px;
  overflow: hidden;
}

.ssg-modal__main-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  object-position: center;
}

/* Thumbnails strip — vertical on desktop, horizontal on mobile */
.ssg-modal__thumbs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) transparent;
}

.ssg-modal__thumbs::-webkit-scrollbar {
  width: 4px;
}

.ssg-modal__thumbs::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
}

.ssg-modal__thumb {
  width: 120px;
  height: 120px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
  opacity: 0.6;
}

.ssg-modal__thumb:hover {
  opacity: 0.85;
}

.ssg-modal__thumb.is-active {
  border-color: #E7C5C5;
  opacity: 1;
}

.ssg-modal__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Hide thumbs strip when only 1 image */
.ssg-modal__thumbs:empty {
  display: none;
}

.ssg-modal__body--single {
  grid-template-columns: 1fr;
}

/* --------------------------------------------------------------------------
   CTA Button
   -------------------------------------------------------------------------- */
.ssg-modal__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background: #E7C5C5;
  border: none;
  border-radius: 30px;
  font-family: "Poppins", sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  color: #3A393C;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.ssg-modal__cta:hover {
  background: #ddb5b5;
  transform: translateY(-1px);
}

.ssg-modal__cta:active {
  transform: translateY(0);
}

/* ==========================================================================
   Responsive — Tablet / Large Mobile (@media max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .ssg-gallery {
    padding: 40px 16px;
  }

  .ssg-gallery__heading {
    font-size: 28px;
    margin-bottom: 10px;
  }

  .ssg-gallery__subheading {
    font-size: 15px;
    margin-bottom: 24px;
  }

  .ssg-filters {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    margin-bottom: 24px;
  }

  .ssg-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ssg-card__label {
    font-size: 12px;
  }

  .ssg-modal {
    padding: 16px;
    align-items: center;
    overflow-y: auto;
  }

  .ssg-modal__content {
    width: 100%;
    gap: 16px;
  }

  .ssg-modal__close {
    top: -36px;
    font-size: 24px;
    width: 24px;
    height: 24px;
  }

  .ssg-modal__title {
    font-size: 16px;
  }

  .ssg-modal__body {
    grid-template-columns: 1fr;
  }

  .ssg-modal__thumbs {
    flex-direction: row;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .ssg-modal__thumb {
    width: 80px;
    height: 80px;
  }

  .ssg-modal__cta {
    padding: 12px 24px;
    font-size: 13px;
  }
}

/* ==========================================================================
   Responsive — Small Mobile (@media max-width: 375px)
   ========================================================================== */
@media (max-width: 375px) {
  .ssg-gallery {
    padding: 28px 12px;
  }

  .ssg-gallery__heading {
    font-size: 22px;
  }

  .ssg-gallery__subheading {
    font-size: 14px;
  }

  .ssg-filters__btn {
    padding: 6px 14px;
    font-size: 13px;
  }

  .ssg-grid {
    gap: 12px;
  }

  .ssg-card__label {
    font-size: 11px;
    padding: 28px 12px 10px;
  }

  .ssg-modal__title {
    font-size: 14px;
  }

  .ssg-carousel__arrow {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .ssg-carousel__dot {
    width: 8px;
    height: 8px;
  }

  .ssg-modal__cta {
    padding: 10px 20px;
    font-size: 12px;
  }
}
