/* --- Your Original Styles (Preserved) --- */
body {
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.03"/></svg>');
  background-size: cover;
}
.section-title::after {
  content: '';
  display: block;
  width: 64px;
  height: 4px;
  background: theme('colors.mint.500');
  margin: 10px auto 0;
  border-radius: 2px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
}

.photo-frame {
    background-color: white;
    padding: 1rem;
    padding-bottom: 4rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
    cursor: pointer;
    position: relative;
}

.photo-frame:hover {
    transform: rotate(0deg) scale(1.05) !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    z-index: 10;
}

.photo-frame img {
    width: 100%;
    height: 18rem;
    object-fit: cover;
    display: block;
}

.photo-frame .zoom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.photo-frame:hover .zoom-overlay {
    opacity: 1;
}

#modal-img {
    transition: opacity 0.2s ease-in-out;
}
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 9999px;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease-out;
    z-index: 65;
}
.modal-nav-btn:hover {
    background-color: white;
    transform: translateY(-50%) scale(1.1);
}

/* --- REFINED STYLES FOR SMOOTHER ANIMATION --- */

.gallery-grid {
    overflow: hidden;
    /* Increased duration and smoother easing for a 'peaceful' arrival */
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-grid.is-collapsed {
    /* The height is now set by a variable from JS for perfect accuracy */
    /* 27rem is a fallback in case the variable isn't set */
    max-height: var(--collapsed-height, 27rem);
}

.gallery-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 2.5rem auto 0;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background-color: #a381f3; /* theme('colors.violet.500') */
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.2);
    /* Smoother transition for the button itself */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-toggle-btn:hover {
    background-color: #d3c7e7; /* theme('colors.violet.600') */
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(139, 92, 246, 0.3);
}
.gallery-toggle-btn svg {
    margin-left: 0.75rem;
    /* Smoother rotation for the icon */
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.gallery-toggle-btn.is-toggled svg {
    transform: rotate(180deg);
}