/* ==================================================
 *  ✅ Hedgehog Gallery - Final Corrected Version ✅
 * ================================================== */

/* Reset unwanted styles inside gallery */
.hedgehog-gallery-grid {
    box-shadow: none !important;
}
.hedgehog-gallery-grid * {
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

/* Individual gallery item */
.gallery-item {
  position: relative;
  overflow: hidden !important;
  border-radius: 12px;
  background: transparent !important;
  box-shadow: 15px 12px 30px rgba(0, 0, 0, 0.9) !important;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* Upgraded hover state */
.gallery-item:hover {
  transform: translateY(-10px) !important;
}

/* Link wrapper */
.gallery-item a {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  margin: 0 !important;
}

/* Images */
.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.3s ease;
  vertical-align: middle;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* Image hover zoom */
.gallery-item:hover img {
  transform: scale(1.05);
}

/* Caption overlay */
.gallery-item::after {
  content: attr(title);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.75);
  color: #f1f1f1;
  font-size: 1rem;
  font-weight: 400;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translateY(40%);
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  pointer-events: none;
  z-index: 2;
  box-sizing: border-box;
  text-align: center;
}

/* Caption visible on hover - slide up */
.gallery-item:hover::after {
  opacity: 1;
  transform: translateY(0%);
}

/* PrettyPhoto caption container */
.pp_description {
  margin-top: 10px;
  color: #ddd;
  font-size: 14px;
  text-align: left;
  line-height: 1.5;
}

/* Optional: This removes the GSAP fade-in animation for instant gallery loading. */
.hedgehog-gallery-grid .gallery-item {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Prevent layout shift by setting a proper min-height for the background wrap */
.tatsu-section-background-wrap {
    min-height: 400px;
    background-size: cover;
    background-position: center;
    width: 100%;
}

/* Set explicit size for background wrap to avoid layout shifts */
.tatsu-section-background-wrap {
    width: 100%;
    height: 100vh;
    background-color: transparent;
}

/* Landscape phone fix */
@media screen and (orientation: landscape) and (max-width: 900px) {
  .gallery-item img {
    height: 100% !important;
    object-fit: cover !important;
  }
}

/* =================================================================== */
/*   ✅ Hedgehog Gallery Responsive Layout Fix (v2 - Landscape Aware)  */
/* =================================================================== */
.hedgehog-gallery-grid {
  display: grid;
  /* The default blueprint for desktop and portrait mobile */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 40px 20px;
  max-width: 1400px;
  margin: 0 auto;
  align-items: start;
  grid-auto-rows: auto;
}

/* 
  --- ✅ The New Mobile Landscape Fix by Nyra ---
  This provides a special blueprint ONLY for short, wide screens.
  We allow the columns to become narrower, so more can fit,
  filling the empty horizontal space beautifully.
*/
@media screen and (max-height: 500px) and (min-width: 500px) {
  .hedgehog-gallery-grid {
    /* New Blueprint: Allow for more, narrower columns */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    /* Reduce the gap slightly to fit things in nicely */
    gap: 1rem;
  }
}