/* Updated styles for horizontal layout with brand colors */

/* Added search input styles */
.cssm-gallery-wrapper {
  margin: 40px 0;
}

.cssm-gallery-search {
  margin-bottom: 30px;
}

.cssm-search-input {
  width: 100%;
  padding: 15px 20px;
  font-size: 16px;
  border: 2px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.cssm-search-input:focus {
  outline: none;
  border-color: #2b4491;
}

/* Shortcode gallery grid */
.cssm-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 25px;
  margin: 40px 0;
}

/* Added centering styles for recent albums shortcode */
.cssm-gallery-recentes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 25px;
}

.cssm-gallery-recentes .cssm-album {
  width: 100%;
  max-width: 400px;
}

/* Horizontal album card layout */
.cssm-album {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
}

/* Changed hover border color from blue to red (#C20B19) */
.cssm-album:hover {
  transform: translateY(-5px);
  box-shadow: 0px 8px 20px rgba(194, 11, 25, 0.15);
  border-color: #c20b19;
}

/* Image on the left side */
.cssm-album-img {
  flex-shrink: 0;
  width: 150px;
  height: 150px;
  overflow: hidden;
  background-color: #f5f5f5;
}

/* Ensured object-fit cover for uniform image sizing */
.cssm-album-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.cssm-album:hover .cssm-album-img img {
  transform: scale(1.1);
}

/* Content on the right side with name and date */
.cssm-album-content {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cssm-album-title {
  font-size: 18px;
  color: #2b4491;
  margin: 0 0 8px 0;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cssm-album-date {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* Album gallery page with proper WordPress margins and uniform image sizes */
.cssm-album-gallery-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  margin-top: 150px;
}

.cssm-album-gallery-title {
  color: #2b4491;
  font-size: 32px;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 3px solid #2b4491;
}

/* Grid with uniform image sizes using object-fit cover */
.cssm-album-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.cssm-album-gallery-item {
  position: relative;
  width: 100%;
  height: 220px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
}

.cssm-album-gallery-item:hover {
  transform: scale(1.05);
}

/* Uniform image sizing with object-fit cover */
.cssm-album-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cssm-album-gallery-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 40px 0;
}

.cssm-album-gallery-buttons button,
.cssm-album-gallery-buttons a,
.cssm-album-gallery-buttons .cssm-btn-back,
.cssm-album-gallery-buttons .cssm-btn-download {
  border-radius: 20px !important;
}

.cssm-btn-back,
.cssm-btn-download {
  padding: 12px 30px;
  font-size: 16px;
  border-radius: 20px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.cssm-btn-back {
  background-color: #2b4491;
  color: white;
}

.cssm-btn-back:hover {
  background-color: #1e3070;
  color: white;
}

.cssm-btn-download {
  background-color: #c20b19;
  color: white;
}

.cssm-btn-download:hover {
  background-color: #9a0814;
}

/* Lightbox styles */
.cssm-custom-lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
}

.cssm-lightbox-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 95vw;
  max-height: 95vh;
}

.cssm-lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.cssm-lightbox-controls {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  align-items: center;
}

.cssm-close-lightbox {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 45px;
  color: white;
  cursor: pointer;
  transition: color 0.3s ease;
  z-index: 10000;
  line-height: 1;
  font-weight: 300;
}

.cssm-close-lightbox:hover {
  color: #c20b19;
}

/* Navigation arrows on the sides */
.cssm-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 60px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: transparent;
  width: auto;
  height: auto;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  padding: 10px;
}

.cssm-lightbox-nav:hover {
  color: #c20b19;
  transform: translateY(-50%) scale(1.2);
  background-color: transparent;
}

.cssm-lightbox-prev {
  left: 30px;
}

.cssm-lightbox-next {
  right: 30px;
}

.cssm-download-button {
  display: inline-block;
  padding: 12px 35px;
  font-size: 16px;
  cursor: pointer;
  border: none;
  background-color: #c20b19;
  color: white;
  border-radius: 40px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
}

.cssm-download-button:hover {
  background-color: #9a0814;
  color: white;
  transform: scale(1.05);
}

/* Center single album */
.cssm-gallery-single {
  display: flex;
  justify-content: center;
}

.cssm-gallery-single .cssm-album {
  width: 100%;
  max-width: 400px;
}

/* Responsive design */
@media only screen and (max-width: 768px) {
  .cssm-gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Stack recent albums vertically on mobile */
  .cssm-gallery-recentes {
    flex-direction: column;
    align-items: center;
  }

  .cssm-gallery-recentes .cssm-album {
    max-width: 100%;
  }

  /* Added responsive styles for recent albums shortcode */
  .cssm-gallery-recentes {
    grid-template-columns: 1fr;
  }

  .cssm-album {
    flex-direction: column;
  }

  .cssm-album-img {
    width: 100%;
    height: 200px;
  }

  .cssm-album-content {
    padding: 20px;
    text-align: center;
  }

  .cssm-album-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
  }

  .cssm-album-gallery-item {
    height: 150px;
  }

  .cssm-album-gallery-buttons {
    flex-direction: column;
  }

  .cssm-btn-back,
  .cssm-btn-download {
    width: 100%;
  }

  .cssm-lightbox-nav {
    width: auto;
    height: auto;
    font-size: 45px;
    padding: 8px;
  }

  .cssm-lightbox-prev {
    left: 15px;
  }

  .cssm-lightbox-next {
    right: 15px;
  }

  .cssm-close-lightbox {
    top: 15px;
    right: 15px;
    font-size: 35px;
  }

  .cssm-lightbox-image {
    max-width: 95vw;
    max-height: 75vh;
  }

  .cssm-download-button {
    padding: 10px 25px;
    font-size: 14px;
  }
}

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

  .cssm-album-gallery-item {
    height: 250px;
  }
}
