/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Prata:wght@400&display=swap');

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    letter-spacing: 0.5px;
}

/* Header Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-weight: 400;
    line-height: 1.2;
}

h1 {
    font-family: 'Prata', serif;
    font-weight: 400;
    font-size: 3rem;
}

h2 {
    font-family: 'Prata', serif;
    font-weight: 400;
    font-size: 2.5rem;
}

h3 {
    font-family: 'Prata', serif;
    font-weight: 400;
    font-size: 2rem;
}

h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
}

/* ==========================================================================
   Root Variables
   ========================================================================== */
:root {
  --primary-color: #8f4c73;
  --primary-hover: #631641;
  --dark-purple: #631641;
  --medium-purple: #7a3960;
  --green: #2F855A;
  --text-dark: #333;
  --text-light: #666;
  --bg-light: #f3f3f3;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
}

/* ==========================================================================
   Gallery Section - Desktop
   ========================================================================== */

/* Base gallery styles */
.wpd-gallery {
    width: 100%;
    background-color: #fff;
}

/* Container for content centering and max-width */
.wpd-gallery__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 10rem 2rem 6rem;
}

/* Header styles */
.wpd-gallery__header {
    text-align: center;
    margin-bottom: 4rem;
}

.wpd-gallery__title {
    font-family: 'Prata', serif;
    font-size: 3rem;
    font-weight: 400;
    color: var(--text-dark);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: var(--spacing-md);
}

/* Purple underline effect for title */
.wpd-gallery__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--primary-color);
}

.wpd-gallery__subtitle {
    font-family: 'Poppins', sans-serif;
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-light);
}

/* Gallery grid layout */
.wpd-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

/* Individual gallery item styles */
.wpd-gallery__item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.wpd-gallery__item:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.wpd-gallery__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Loading state styles */
.wpd-gallery__item.loading {
    background-color: #f0f0f0;
    animation: loadingPulse 1.5s infinite;
}

@keyframes loadingPulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.8; }
    100% { opacity: 0.6; }
}

/* Lightbox styles */
.wpd-gallery__lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.wpd-gallery__lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.wpd-gallery__lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.wpd-gallery__lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 10px;
    transition: transform 0.3s ease;
}

.wpd-gallery__lightbox-close:hover {
    transform: scale(1.1);
}

/* Pagination styles */
.wpd-gallery__pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: var(--spacing-xl);
}

.wpd-gallery__pagination-numbers {
    display: flex;
    gap: 0.5rem;
}

.wpd-gallery__pagination-button,
.wpd-gallery__pagination-number {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.wpd-gallery__pagination-number.active {
    background-color: var(--primary-color);
    color: white;
}

.wpd-gallery__pagination-button:hover:not(:disabled),
.wpd-gallery__pagination-number:hover:not(.active) {
    color: var(--primary-color);
    background-color: rgba(143, 76, 115, 0.1);
}

.wpd-gallery__pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   Responsive Styles (1200px and below)
   ========================================================================== */

@media (max-width: 1200px) {
    .wpd-gallery__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==========================================================================
   Tablet Responsive Styles (1024px and below)
   ========================================================================== */

@media (max-width: 1024px) {
    .wpd-gallery__container {
        padding: 11.5rem 1.5rem 5rem;
    }

    .wpd-gallery__title {
        font-size: 2.5rem;
    }
}

/* ==========================================================================
   Mobile Responsive Styles (768px and below)
   ========================================================================== */

@media (max-width: 768px) {
    .wpd-gallery__container {
        padding: 10.5rem 1rem 4rem;
    }

    .wpd-gallery__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .wpd-gallery__header {
        margin-bottom: 3rem;
    }

    .wpd-gallery__title {
        font-size: 2rem;
        padding-bottom: 1rem;
    }

    .wpd-gallery__title::after {
        width: 80px;
    }

    .wpd-gallery__subtitle {
        font-size: 1.125rem;
    }

    /* Responsive pagination */
    .wpd-gallery__pagination {
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: var(--spacing-lg);
    }
    
    .wpd-gallery__pagination-numbers {
        order: 2;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .wpd-gallery__pagination-button {
        order: 1;
    }
}

/* ==========================================================================
   Small Mobile Responsive Styles (480px and below)
   ========================================================================== */

@media (max-width: 480px) {
    .wpd-gallery__container {
        padding: 9rem 1rem 3rem;
    }

    .wpd-gallery__grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .wpd-gallery__title {
        font-size: 1.75rem;
        padding-bottom: 0.875rem;
    }

    .wpd-gallery__title::after {
        width: 60px;
        height: 2px;
    }

    .wpd-gallery__subtitle {
        font-size: 1rem;
    }

    .wpd-gallery__header {
        margin-bottom: 2rem;
    }

    /* Lightbox adjustments for small screens */
    .wpd-gallery__lightbox-close {
        top: -30px;
        font-size: 1.5rem;
    }
}