/* Instagram-style photo viewer */
.photo-viewer-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.photo-viewer-modal.is-open {
    display: flex;
}

.photo-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
}

.photo-viewer-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    max-height: calc(100vh - 48px);
    animation: photoViewerIn 0.25s ease;
}

@keyframes photoViewerIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.photo-viewer-inner {
    position: relative;
    background: var(--color-bg-elevated, #0e1014);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
}

.photo-viewer-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.photo-viewer-close:hover {
    background: rgba(225, 29, 46, 0.85);
    transform: scale(1.05);
}

.photo-viewer-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    max-height: calc(100vh - 48px);
    overflow: hidden;
}

.photo-viewer-media {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    max-height: calc(100vh - 48px);
    overflow: hidden;
}

.photo-viewer-image-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 320px;
    max-height: calc(100vh - 48px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
    padding: 16px;
}

.photo-viewer-image {
    max-width: 100%;
    max-height: min(72vh, 820px);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
    user-select: none;
}

.photo-viewer-image-wrap.is-expanded {
    cursor: zoom-out;
    position: fixed;
    inset: 0;
    z-index: 13000;
    background: rgba(0, 0, 0, 0.96);
    padding: 24px;
    max-height: none;
    min-height: 100vh;
}

.photo-viewer-image-wrap.is-expanded .photo-viewer-image {
    max-width: 96vw;
    max-height: 96vh;
}

.photo-viewer-sidebar {
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    overflow-y: auto;
    max-height: calc(100vh - 48px);
}

.photo-viewer-header {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.photo-viewer-author {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text, #f0f2f5);
}

.photo-viewer-author:hover {
    color: var(--color-accent, #e11d2e);
}

.photo-viewer-author-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(225, 29, 46, 0.15);
    color: var(--color-accent, #e11d2e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.photo-viewer-details {
    padding: 18px;
    flex: 1;
}

.photo-viewer-title {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 1.125rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 16px;
}

.photo-viewer-title span {
    color: var(--color-text-muted, #6b7380);
    font-weight: 400;
}

.photo-award-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -8px 0 16px;
}

.photo-award-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.photo-award-badge--week {
    background: rgba(234, 179, 8, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.35);
}

.photo-award-badge--month {
    background: rgba(168, 85, 247, 0.16);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.photo-award-badge__period {
    font-weight: 500;
    opacity: 0.85;
}

.photo-viewer-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 13px;
}

.photo-viewer-meta-row .label {
    color: var(--color-text-muted, #6b7380);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.photo-viewer-meta-row .value {
    color: var(--color-text-secondary, #9aa3b2);
    text-align: right;
}

.photo-viewer-meta-row .value a {
    color: var(--color-accent, #e11d2e);
}

.photo-viewer-description {
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--color-text-secondary, #9aa3b2);
}

.photo-viewer-stats {
    display: flex;
    gap: 12px;
    padding: 0 18px 16px;
}

.photo-viewer-share {
    padding: 0 18px 16px;
}

.photo-viewer-share .btn.is-copied {
    border-color: rgba(34, 197, 94, 0.45);
    color: #86efac;
}

.photo-viewer-stat {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 12px 8px;
}

.photo-viewer-stat strong {
    display: block;
    font-size: 1.25rem;
    color: var(--color-accent, #e11d2e);
    font-family: var(--font-display, 'Oswald', sans-serif);
}

.photo-viewer-stat span {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted, #6b7380);
}

.photo-viewer-stat--full {
    flex: 1;
}

.photo-viewer-contact-hint {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: var(--color-text-muted, #6b7380);
    text-align: center;
}

.photo-viewer-contact-hint i {
    color: var(--color-accent, #e11d2e);
    margin-right: 4px;
}

.photo-contact-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(6, 7, 8, 0.88);
    backdrop-filter: blur(10px);
    z-index: 10050;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.photo-contact-modal.is-open {
    display: flex;
}

.photo-contact-modal__content {
    background: var(--color-bg-elevated, #0e1014);
    border-radius: var(--radius-xl, 24px);
    max-width: 480px;
    width: 100%;
    padding: 28px;
    border: 1px solid rgba(225, 29, 46, 0.2);
    position: relative;
}

.photo-contact-modal__content h3 {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 1.125rem;
    margin-bottom: 8px;
}

.photo-contact-modal__lead {
    color: var(--color-text-muted, #6b7380);
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.photo-contact-modal__close {
    position: absolute;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-muted, #6b7380);
}

.photo-contact-modal__field {
    margin-bottom: 14px;
}

.photo-contact-modal__field label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted, #6b7380);
    margin-bottom: 6px;
    font-weight: 600;
}

.photo-contact-modal__field input,
.photo-contact-modal__field textarea {
    width: 100%;
    box-sizing: border-box;
}

.photo-contact-modal__content .btn {
    width: 100%;
}

.photo-viewer-preview-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(6, 7, 8, 0.78);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    pointer-events: none;
}

.photo-viewer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 18px 20px;
}

.photo-viewer-actions .btn {
    width: 100%;
    margin: 0;
    padding: 10px 18px;
    justify-content: center;
}

.photo-viewer-similar {
    padding: 0 18px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 16px;
}

.photo-viewer-similar h3 {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted, #6b7380);
    margin-bottom: 10px;
}

.photo-viewer-similar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.photo-viewer-similar-item {
    aspect-ratio: 1;
    background: #000;
    border: none;
    padding: 0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: 2;
}

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

.photo-viewer-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: 80px;
}

.photo-viewer-loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(225, 29, 46, 0.2);
    border-top-color: #e11d2e;
    border-radius: 50%;
    animation: photoViewerSpin 0.8s linear infinite;
}

.photo-viewer-similar-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Standalone /foto/ page */
.photo-viewer-page {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: auto;
}

.photo-viewer-page .photo-viewer-inner {
    width: min(1100px, 100%);
}

.photo-viewer-page.is-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.photo-viewer-page.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(225, 29, 46, 0.2);
    border-top-color: #e11d2e;
    border-radius: 50%;
    animation: photoViewerSpin 0.8s linear infinite;
    z-index: 10;
}

body.photo-viewer-active main {
    visibility: hidden;
}

body.photo-viewer-active header.site-header {
    z-index: 800;
}

/* Gallery thumbnails – natural ratio preview */
.photo-thumb {
    background: #080808;
    min-height: 200px;
    max-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.photo-thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.js-photo-open {
    cursor: pointer;
}

.js-photo-open:hover .photo-thumb img,
.photo-card:hover .photo-img img {
    transform: scale(1.03);
}

@media (max-width: 900px) {
    .photo-viewer-modal {
        padding: 0;
    }

    .photo-viewer-dialog,
    .photo-viewer-inner {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .photo-viewer-body {
        grid-template-columns: 1fr;
        max-height: 100vh;
        overflow-y: auto;
    }

    .photo-viewer-media {
        max-height: 55vh;
        min-height: 240px;
    }

    .photo-viewer-image-wrap {
        max-height: 55vh;
        min-height: 240px;
    }

    .photo-viewer-image {
        max-height: 50vh;
    }

    .photo-viewer-sidebar {
        max-height: none;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
    }

    .photo-viewer-page {
        padding: 0;
    }
}

@media (max-width: 640px) {
    .photo-viewer-similar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
