/* Responsive Gallery Grid */
.gallery {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  /* Default: 2 columns */
  box-sizing: border-box;
  width: 100%;
  margin: 0 auto;
}

@media (min-width: 900px) {
  .gallery {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
  }
}

@media (min-width: 1200px) {
  .gallery {
    grid-template-columns: repeat(4, minmax(220px, 1fr));
  }
}

@media (max-width: 700px) {
  .gallery {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding: 0.7rem 0.2rem;
  }
}

/* Ensure images fill their grid cell and remain proportional */
.gallery img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.4s cubic-bezier(.4,1,.6,1);
  display: block;
  background: #f8f8f8;
}
/* =============================
   Minimalist Gallery Layout
   ============================= */

/* Layout */

.gallery-item {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.gallery-item a {
  display: block;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
}

/* Image effects */
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  aspect-ratio: 3/4;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(.4,1,.6,1);
  background: #f8f8f8;
}

.gallery-item:hover img,
.gallery-item:focus-within img {
  transform: scale(1.05);
}

/* Title styling */
.gallery-title {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 500;
  font-family: 'Lato', 'Segoe UI', Arial, sans-serif;
  line-height: 1.3;
  letter-spacing: 0.01em;
  background: none;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  #gallery {
    --gallery-columns: 3;
    --gallery-gap: 1.2rem;
  }
}

@media (max-width: 900px) {
  #gallery {
    --gallery-columns: 2;
    --gallery-gap: 1rem;
    padding: 1.2rem 0.5rem;
  }
}

@media (max-width: 768px) {
  #gallery {
    --gallery-columns: 1;
    --gallery-gap: 0.7rem;
    padding: 0.7rem 0.2rem;
  }
  .gallery-item img {
    aspect-ratio: 4/3;
  }
  .gallery-title {
    font-size: 1rem;
    margin-top: 0.6rem;
  }
}
.gallery {
    display: grid;
    gap: .5rem; /* Space between images */
    box-sizing: border-box;
}

.gallery .parent-caption {
    width: 100%;
    height: 100%;
    overflow: hidden; /* Hides any overflow */
    display: block!important;
}

.effect-zoom .parent-caption:hover img {
  transform: scale(1.15); /* Adjust the scale as needed */
}

.gallery p {
    display: block; /* To ensure it's a block-level element */
    margin-block-start: 0; /* Sets the top margin (block-start) to 0 */
    margin-block-end: 0; /* Sets the bottom margin (block-end) to 0 */
    margin-inline-start: 0; /* Sets the left margin (inline-start) to 0 */
    margin-inline-end: 0; /* Sets the right margin (inline-end) to 0 */
    unicode-bidi: normal; /* Sets the bidirectional text algorithm to normal */
  }

.gallery img {
    width: 100%;
    height: 100%; /* Ensures the image fills the container */
    object-fit: cover; /* Crops the image to fit the container while preserving the aspect ratio */
    transition: transform 0.5s ease;
  }

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Adjust minmax value as needed */
  grid-template-rows: 250px; /* Creates 3 rows of automatic height */
}

.grid-1 {
  grid-template-columns: repeat(1, auto); /* Adjust minmax value as needed */
  grid-template-rows: auto;
}


.grid-2 {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  grid-auto-rows: 350px;
}

@media (max-width: 600px) {
  .grid-2 {
    grid-template-columns: 1fr;
    grid-auto-rows: 1fr;
  }
}

/*
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
grid-template-rows: repeat(3, auto);
*/