/* ============================================
   MAIN CONTAINER & LAYOUT
   ============================================ */

/* Main gallery container */
#a-647da23be2400846067483 {
  max-width: 1600px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Grid layout for articles */
.astroid-articles .row {
  margin: 0 -12px !important;
}

.astroid-article-item {
  padding: 0 12px !important;
  margin-bottom: 24px !important;
}

/* ============================================
   CARD STYLING - ENTIRE CARD CLICKABLE
   ============================================ */

.astroid-article-item .card {
  height: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  cursor: pointer;
}

.astroid-article-item .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
  border-color: #ccc;
}

/* ============================================
   IMAGE CONTAINER & CAROUSEL
   ============================================ */

.as-slideshow-media {
  height: 100%;
  overflow: hidden;
  position: relative;
}

.carousel {
  height: 100%;
}

.carousel-inner {
  height: 100%;
}

.carousel-item {
  height: 100% !important;
  position: relative;
}

.carousel-item img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center;
}

/* ============================================
   TITLE OVERLAY - INSIDE IMAGE AREA
   ============================================ */

/* Hide the original card-body */
.astroid-article-item .card-body {
  display: none !important;
}

/* Title overlay inside image */
.title-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9),
    rgba(0, 0, 0, 0.7) 70%,
    transparent
  );
  color: white;
  padding: 20px 15px 15px;
  z-index: 10;
  transition: all 0.3s ease;
}

/* Title text styling */
.astroid-article-heading {
  margin: 0;
  padding: 0;
}

.astroid-article-heading a {
  font-size: 15px;
  font-weight: 500;
  color: #f0f0f0;
  text-decoration: none;
  line-height: 1.4;
  display: block;
  transition: color 0.2s ease;
  letter-spacing: 0.3px;
}

/* Title hover effect */
.astroid-article-item:hover .title-overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95),
    rgba(0, 0, 0, 0.85) 70%,
    transparent
  );
}

.astroid-article-item:hover .astroid-article-heading a {
  color: #ffffff;
}

/* ============================================
   CLEAN GALLERY ICON
   ============================================ */

.gallery-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
}

.astroid-article-item:hover .gallery-icon {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  transform: scale(1.08);
}

/* ============================================
   LIGHTBOX STYLES
   ============================================ */

.gallery-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.97);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.gallery-lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  text-align: center;
}

.lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-close {
  position: absolute;
  top: 25px;
  right: 25px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  z-index: 100000;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.lightbox-thumbnails {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  padding: 12px;
  overflow-x: auto;
  max-width: 80vw;
  justify-content: center;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.lightbox-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.lightbox-thumbnails::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 3px;
}

.lightbox-thumbnails::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.lightbox-thumb {
  width: 68px;
  height: 50px;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.6;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.lightbox-thumb:hover,
.lightbox-thumb.active {
  opacity: 1;
  border-color: #fff;
  transform: scale(1.05);
}

.lightbox-caption {
  color: rgba(255, 255, 255, 0.9);
  margin-top: 12px;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* ============================================
   FIX FOR INTERNAL LINKS
   ============================================ */

.carousel a,
.astroid-article-heading a {
  pointer-events: none;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* 24-inch screens (1600px) */
@media (max-width: 1600px) {
  #a-647da23be2400846067483 {
    max-width: 1400px;
    margin: 35px auto;
  }

  .astroid-article-item .card {
    height: 260px;
  }

  .title-overlay {
    padding: 18px 12px 12px;
  }

  .astroid-article-heading a {
    font-size: 14.5px !important;
  }
}

/* Medium screens (1300px devices) */
@media (max-width: 1300px) {
  #a-647da23be2400846067483 {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 15px;
  }

  .astroid-article-item .card {
    height: 220px !important;
  }

  .title-overlay {
    padding: 16px 10px 10px;
  }

  .astroid-article-heading a {
    font-size: 14px !important;
    line-height: 1.3 !important;
  }

  .gallery-icon {
    width: 32px;
    height: 32px;
    font-size: 14px;
    top: 10px;
    right: 10px;
  }
}

/* Tablets (992px) */
@media (max-width: 992px) {
  #a-647da23be2400846067483 {
    max-width: 100%;
    padding: 0 15px;
  }

  .astroid-articles .row {
    margin: 0 -10px !important;
  }

  .astroid-article-item {
    padding: 0 10px !important;
    margin-bottom: 20px !important;
  }

  .astroid-article-item .card {
    height: 200px !important;
  }

  .title-overlay {
    padding: 14px 10px 10px;
  }

  .astroid-article-heading a {
    font-size: 13px !important;
  }

  .gallery-icon {
    width: 30px;
    height: 30px;
    font-size: 13px;
    top: 8px;
    right: 8px;
  }
}

/* Mobile (768px) */
@media (max-width: 768px) {
  #a-647da23be2400846067483 {
    margin: 20px auto;
    padding: 0 10px;
  }

  .astroid-article-item .card {
    height: 180px !important;
  }

  .title-overlay {
    padding: 12px 8px 8px;
  }

  .astroid-article-heading a {
    font-size: 12.5px !important;
    line-height: 1.3 !important;
  }

  .gallery-icon {
    width: 28px;
    height: 28px;
    font-size: 12px;
    top: 6px;
    right: 6px;
  }

  /* Lightbox mobile adjustments */
  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .lightbox-close {
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    font-size: 20px;
  }

  .lightbox-thumb {
    width: 55px;
    height: 40px;
  }
}

/* Small phones (480px) */
@media (max-width: 480px) {
  .astroid-article-item .card {
    height: 250px !important;
  }

  .title-overlay {
    padding: 10px 8px 8px;
  }

  .astroid-article-heading a {
    font-size: 11.5px !important;
    line-height: 1.2 !important;
  }

  .gallery-icon {
    width: 26px;
    height: 26px;
    font-size: 11px;
    top: 6px;
    right: 6px;
  }

  /* Stack items on very small screens */
  .astroid-articles .row {
    margin: 0 !important;
  }

  .astroid-article-item {
    padding: 0 8px !important;
    margin-bottom: 16px !important;
  }
}

/* Very specific device queries for pixel-perfect responsiveness */
@media (max-width: 1300px) and (max-height: 690px),
  (max-width: 1265px) and (max-height: 585px) {
  #a-647da23be2400846067483 {
    max-width: 1000px;
  }

  .astroid-article-item .card {
    height: 200px !important;
  }

  .title-overlay {
    padding: 14px 10px 10px;
  }

  .astroid-article-heading a {
    font-size: 13px !important;
  }
}
