/**
 * Custom Styles - Andreas Stehn Photography
 */

/* ========================================
   Base Styles
   ======================================== */

:root {
    --bg-primary: #0B0D10;
    --bg-surface: #12151A;
    --text-primary: #F2F2F2;
    --text-secondary: #B0B6BF;
    --accent: #C9A46A;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* ========================================
   Justified Gallery Overrides
   ======================================== */

.justified-gallery {
    background: transparent !important;
}

.justified-gallery > a,
.justified-gallery > div {
    cursor: pointer;
}

.justified-gallery > a > img,
.justified-gallery > div > img {
    transition: transform 0.4s ease, filter 0.4s ease;
}

.justified-gallery > a:hover > img,
.justified-gallery > div:hover > img {
    transform: scale(1.03);
    filter: brightness(1.1);
}

/* Disable image interactions for deterrence */
.gallery-item img {
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: none;
}

.gallery-item {
    overflow: hidden;
}

/* Single/few images - ensure minimum size */
.justified-gallery.jg-entry-visible .gallery-item:only-child,
.justified-gallery .gallery-item:first-child:nth-last-child(1) {
    min-height: 500px !important;
}

/* Center gallery when few images */
.justified-gallery {
    display: flex;
    flex-wrap: wrap;
}

/* ========================================
   Category Filters
   ======================================== */

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem 0;
}

.category-chip {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.category-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

/* ========================================
   Lightbox
   ======================================== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    -webkit-user-drag: none;
    user-drag: none;
    -webkit-user-select: none;
    user-select: none;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 101;
}

.lightbox-close:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

/* ========================================
   Age Gate
   ======================================== */

.age-gate {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 13, 16, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.age-gate.hidden {
    display: none;
}

.age-gate-content {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

.age-gate-content p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.age-gate-btn {
    padding: 0.75rem 2rem;
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.age-gate-btn:hover {
    background: #d4af75;
    transform: translateY(-1px);
}

/* ========================================
   Loading Spinner
   ======================================== */

.loader {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.loader::after {
    content: '';
    width: 2rem;
    height: 2rem;
    border: 2px solid var(--text-secondary);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   Form Styles
   ======================================== */

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-btn {
    padding: 0.75rem 2rem;
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-btn:hover {
    background: #d4af75;
}

.form-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========================================
   Flash Messages
   ======================================== */

.flash {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.flash-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.flash-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ========================================
   Responsive Adjustments
   ======================================== */

@media (max-width: 768px) {
    .lightbox-nav {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .lightbox-close {
        width: 2.5rem;
        height: 2.5rem;
    }
}
