/* Modern Gallery Styles */

.gallery-section {
    margin-bottom: 4rem;
}

/* --- Highlighting Illustration (Featured Section) --- */
.featured-illustration {
    margin-bottom: 3rem;
    text-align: center;
}

.highlight-image-wrapper {
    display: inline-block;
    max-width: 1000px; /* Large featured size */
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.highlight-image-wrapper:hover {
    transform: scale(1.01);
}

[data-theme="dark"] .highlight-image-wrapper {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.highlight-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.featured-caption {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
}

.featured-caption strong {
    color: var(--global-theme-color);
}

.featured-caption a {
    color: var(--link-color);
    text-decoration: underline;
}

/* --- Instagram-style Gallery Grid --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Strict 3-column instagram look */
    gap: 8px; /* Tight gaps like Instagram */
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.gallery-item {
    position: relative;
    aspect-ratio: 1 / 1; /* Perfectly square */
    overflow: hidden;
    margin-bottom: 0; /* Resetting bootstrap margins if any */
}

.gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Square crop */
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* Hover Overlay for Instagram aesthetic */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
    pointer-events: none; /* Let the link through */
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay .overlay-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 5px;
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.gallery-overlay .overlay-context {
    font-size: 0.8rem;
    transform: translateY(10px);
    transition: transform 0.3s ease;
    opacity: 0.8;
}

.gallery-item:hover .overlay-title,
.gallery-item:hover .overlay-context {
    transform: translateY(0);
}