/* George Mathews Photography - Rock Gallery Styles */
/* Scoped with gm- prefix for WordPress compatibility */

/* CSS Custom Properties */
:root {
    --gm-bg-color: #0a0a0a;
    --gm-text-color: #ffffff;
    --gm-text-muted: rgba(255, 255, 255, 0.7);
    --gm-border-color: rgba(255, 255, 255, 0.1);
    --gm-transition: 0.3s ease;
    --gm-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Reset */
.gm-gallery-page {
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    font-family: var(--gm-font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #1a1a1a;
}

.gm-gallery-page *,
.gm-gallery-page *::before,
.gm-gallery-page *::after {
    box-sizing: border-box;
}

/* Hero Section */
.gm-gallery-hero {
    padding: 6rem 2rem 3rem;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    background-color: #ffffff;
}

.gm-gallery-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.gm-gallery-title {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 300;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    margin: 0;
    color: #1a1a1a;
}

.gm-gallery-description {
    font-size: clamp(0.9375rem, 2vw, 1.0625rem);
    font-weight: 300;
    line-height: 1.9;
    color: #4a4a4a;
    margin: 0;
    max-width: 800px;
}

/* Gallery Grid Section */
.gm-gallery-grid-section {
    padding: 0 1rem 4rem;
    background-color: #ffffff;
}

/* Gallery Grid - Masonry-style columns */
.gm-gallery-grid {
    column-count: 4;
    column-gap: 8px;
    max-width: 1800px;
    margin: 0 auto;
}

/* Gallery Item */
.gm-gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background-color: #f0f0f0;
    margin-bottom: 8px;
    break-inside: avoid;
}

.gm-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease, opacity var(--gm-transition);
}

.gm-gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background var(--gm-transition);
    pointer-events: none;
}

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

.gm-gallery-item:hover::after {
    background: rgba(0, 0, 0, 0.1);
}

/* Lightbox */
.gm-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.97);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--gm-transition), visibility var(--gm-transition);
}

.gm-lightbox.gm-lightbox-open {
    opacity: 1;
    visibility: visible;
}

.gm-lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gm-lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity var(--gm-transition);
}

.gm-lightbox-image.gm-loaded {
    opacity: 1;
}

/* Lightbox Close Button */
.gm-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    background: none;
    border: none;
    color: var(--gm-text-color);
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--gm-transition), transform var(--gm-transition);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.gm-lightbox-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Lightbox Navigation Buttons */
.gm-lightbox-prev,
.gm-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--gm-text-color);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--gm-transition), background var(--gm-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.gm-lightbox-prev:hover,
.gm-lightbox-next:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.gm-lightbox-prev {
    left: 1.5rem;
}

.gm-lightbox-next {
    right: 1.5rem;
}

/* Lightbox Counter */
.gm-lightbox-counter {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.875rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--gm-text-muted);
}

/* ==================== */
/* RESPONSIVE - TABLET  */
/* ==================== */
@media screen and (max-width: 1024px) {
    .gm-gallery-hero {
        padding: 5rem 2rem 2.5rem;
    }

    .gm-gallery-grid {
        column-count: 3;
        column-gap: 6px;
    }

    .gm-gallery-item {
        margin-bottom: 6px;
    }
}

/* ==================== */
/* RESPONSIVE - MOBILE  */
/* ==================== */
@media screen and (max-width: 768px) {
    .gm-gallery-hero {
        padding: 5.5rem 1.5rem 2rem;
    }

    .gm-gallery-title {
        letter-spacing: 0.25em;
    }

    .gm-gallery-description {
        font-size: 0.9rem;
        line-height: 1.8;
    }

    .gm-gallery-grid-section {
        padding: 0 0.5rem 3rem;
    }

    .gm-gallery-grid {
        column-count: 2;
        column-gap: 4px;
    }

    .gm-gallery-item {
        margin-bottom: 4px;
    }

    /* Lightbox Mobile */
    .gm-lightbox-prev,
    .gm-lightbox-next {
        width: 44px;
        height: 44px;
    }

    .gm-lightbox-prev {
        left: 0.75rem;
    }

    .gm-lightbox-next {
        right: 0.75rem;
    }

    .gm-lightbox-close {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        font-size: 2rem;
    }

    .gm-lightbox-content {
        max-width: 100vw;
        max-height: 80vh;
        padding: 0 0.5rem;
    }

    .gm-lightbox-image {
        max-height: 80vh;
    }
}

/* ====================== */
/* RESPONSIVE - SM MOBILE */
/* ====================== */
@media screen and (max-width: 480px) {
    .gm-gallery-hero {
        padding: 5rem 1rem 1.5rem;
    }

    .gm-gallery-title {
        letter-spacing: 0.2em;
    }

    .gm-gallery-hero-content {
        gap: 1rem;
    }

    .gm-gallery-description {
        font-size: 0.85rem;
    }

    .gm-gallery-grid {
        column-count: 2;
        column-gap: 4px;
    }

    .gm-lightbox-prev,
    .gm-lightbox-next {
        width: 40px;
        height: 40px;
    }

    .gm-lightbox-prev svg,
    .gm-lightbox-next svg {
        width: 18px;
        height: 18px;
    }
}

/* Accessibility - Focus Styles */
.gm-gallery-item:focus-visible {
    outline: 3px solid var(--gm-text-color);
    outline-offset: -3px;
}

.gm-lightbox-close:focus-visible,
.gm-lightbox-prev:focus-visible,
.gm-lightbox-next:focus-visible {
    outline: 2px solid var(--gm-text-color);
    outline-offset: 2px;
}

/* Reduce Motion */
@media (prefers-reduced-motion: reduce) {
    .gm-gallery-page *,
    .gm-gallery-page *::before,
    .gm-gallery-page *::after {
        transition: none !important;
    }

    .gm-gallery-item:hover img {
        transform: none;
    }
}

/* Body scroll lock when lightbox is open - prevent page shift */
body.gm-lightbox-active {
    overflow: hidden;
    padding-right: var(--gm-scrollbar-width, 0px);
}

/* Prevent any layout shifts on click */
.gm-gallery-item {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}
