/* Import Staatliches font */
@import url("https://fonts.googleapis.com/css2?family=Staatliches&display=swap");

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

.ccg-category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
  padding: 20px;
}

.ccg-category-button {
  flex: 0 0 auto;
  width: 250px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ccg-category-button:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ccg-category-thumbnail {
  width: 100%;
  height: 250px;
  overflow: hidden;
  margin-bottom: 0;
  border-radius: 8px;
  position: relative;
}

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

.ccg-category-button:hover .ccg-category-thumbnail img {
  transform: scale(1.05);
}

.ccg-category-thumbnail::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.ccg-category-title {
  font-size: 2em !important;
  margin: 0;
  text-align: center;
  font-family: "Staatliches", cursive;
  color: #fff;
  width: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 0;
  z-index: 2;
}

.font-staatliches {
  font-family: "Staatliches", cursive !important;
}

.ccg-gallery {
  display: none;
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
}

.ccg-gallery .ccg-section-title {
  font-size: 2em;
  margin: 0 0 20px;
  text-align: center;
  font-family: "Staatliches", cursive;
  color: #333;
}

.ccg-subcategories {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
}

.ccg-subcategory-thumbnail {
  width: 100%;
  min-width: 250px;
  height: 250px; /* Match parent category height */
  overflow: hidden;
  margin-bottom: 0;
  border-radius: 8px;
  position: relative;
}

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

.ccg-subcategory-button {
  flex: 1 1 200px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 20px;
  padding: 0;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  max-width: 250px; /* Match parent category max-width */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #ddd; /* Match parent category border */
}

.ccg-subcategory-button:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.ccg-subcategory-button:hover .ccg-subcategory-thumbnail img {
  transform: scale(1.05);
}

.ccg-subcategory-thumbnail::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.ccg-subcategory-button h4 {
  font-size: 2em; /* Match parent category title size */
  margin: 0;
  text-align: center;
  font-family: "Staatliches", cursive;
  color: #fff;
  width: 100%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 0;
  z-index: 2;
}

/* Gallery items styling with uniform thumbnail sizes */
.ccg-items {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.ccg-item {
  flex: 0 0 auto;
  width: 250px; /* Fixed width */
  height: 250px; /* Fixed height */
  text-align: center;
  margin-bottom: 20px;
  transition: transform 0.3s ease;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.ccg-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.ccg-item a {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.ccg-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This ensures images maintain aspect ratio while filling the container */
  transition: transform 0.3s ease;
  display: block;
}

.ccg-item a:hover img {
  transform: scale(1.05);
}

.ccg-no-image {
  font-size: 1.2em;
  color: #666;
  padding: 30px;
  background: #f5f5f5;
  border-radius: 8px;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ccg-back-button {
  display: block;
  margin: 20px auto 0;
  padding: 10px 20px;
  background-color: #ea580c;
  font-weight: bold;
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 5px;
  cursor: pointer;
  border: none;
  transition: background-color 0.3s ease;
}

.ccg-back-button:hover {
  background-color: #ee7f45;
}

/* Lightbox styling to ensure full-size images only in lightbox */
.ccg-lightbox-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 999999;
  display: none;
  justify-content: center;
  align-items: center;
}

body.ccg-lightbox-open {
  overflow: hidden;
}

.ccg-lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.ccg-lightbox-content {
  position: relative;
  width: 80%;
  max-width: 1200px;
  background-color: transparent;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000000;
}

.ccg-lightbox-image-container {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.ccg-lightbox-image {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: 80vh; /* Limit height to 80% of viewport height */
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  object-fit: contain; /* Ensure the image maintains its aspect ratio */
}

.ccg-lightbox-caption {
  font-size: 1.2em;
  margin-top: 10px;
  text-align: center;
  color: #fff;
}

.ccg-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 2em;
  cursor: pointer;
  color: #fff;
  background: transparent;
  border: none;
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  z-index: 1000001;
}

.ccg-lightbox-prev,
.ccg-lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2em;
  cursor: pointer;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  width: 40px;
  height: 60px;
  line-height: 60px;
  text-align: center;
  border-radius: 5px;
  z-index: 1000001;
}

.ccg-lightbox-prev {
  left: 10px;
}

.ccg-lightbox-next {
  right: 10px;
}

.ccg-lightbox-prev:hover,
.ccg-lightbox-next:hover,
.ccg-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.6);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ccg-category-buttons {
    justify-content: center;
  }

  .ccg-category-button {
    width: 220px;
  }

  .ccg-category-thumbnail {
    height: 220px;
  }
}

@media (max-width: 480px) {
  .ccg-category-button {
    width: 100%;
    max-width: 300px;
  }
}
