/**
 * Capnis Photo Gallery Detail — Modern High-End Grid & Lightbox
 */

.capnis-photo-detail-section {
    background-color: var(--capnis-surface-2, #f8fafc);
    padding-top: clamp(60px, 7vw, 110px);
    padding-bottom: clamp(70px, 8vw, 130px);
    position: relative;
    width: 100%;
    transition: background-color 0.3s ease;
}

html.capnis-dark .capnis-photo-detail-section {
    background-color: #0c0f17;
}

/* Section Header */
.capnis-pd-header-wrap {
    text-align: center;
    max-width: 780px;
    margin: 0 auto clamp(40px, 5vw, 70px);
}

.capnis-pd-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 999px;
    background: rgba(14, 76, 135, 0.08);
    color: #0e4c87;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 18px;
}

html.capnis-dark .capnis-pd-eyebrow {
    background: rgba(255, 255, 255, 0.08);
    color: #93c5fd;
}

.capnis-pd-title {
    font-size: clamp(28px, 3.8vw, 48px);
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.03em;
    line-height: 1.16;
    margin-bottom: 16px;
}

html.capnis-dark .capnis-pd-title {
    color: #f8fafc;
}

.capnis-pd-subtitle {
    font-size: clamp(15px, 1.2vw, 18px);
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 0;
}

html.capnis-dark .capnis-pd-subtitle {
    color: #94a3b8;
}

/* Filter / Stats Bar */
.capnis-pd-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 24px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

html.capnis-dark .capnis-pd-toolbar {
    background: #131824;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.capnis-pd-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

html.capnis-dark .capnis-pd-count-badge {
    color: #cbd5e1;
}

.capnis-pd-count-badge svg {
    color: #0e4c87;
}

html.capnis-dark .capnis-pd-count-badge svg {
    color: #60a5fa;
}

.capnis-pd-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.capnis-pd-btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 999px;
    color: #0f172a;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid transparent;
    transition: all 0.25s ease;
    text-decoration: none;
    cursor: pointer;
}

.capnis-pd-btn-sm:hover {
    background: #0f172a;
    color: #ffffff;
}

html.capnis-dark .capnis-pd-btn-sm {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
}

html.capnis-dark .capnis-pd-btn-sm:hover {
    background: #ffffff;
    color: #0f172a;
}

/* Photo Gallery Grid */
.capnis-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

@media (max-width: 991px) {
    .capnis-photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 575px) {
    .capnis-photo-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Individual Photo Card */
.capnis-photo-card {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
}

html.capnis-dark .capnis-photo-card {
    background: #131824;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.capnis-photo-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(14, 76, 135, 0.3);
}

html.capnis-dark .capnis-photo-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    border-color: rgba(96, 165, 250, 0.4);
}

/* Image Container */
.capnis-photo-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #0f172a;
}

.capnis-photo-thumb-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.capnis-photo-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.capnis-photo-card:hover .capnis-photo-thumb-img {
    transform: scale(1.06);
}

/* Index Pill Badge */
.capnis-photo-idx-pill {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    padding: 4px 12px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hover Overlay & Action */
.capnis-photo-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.65) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 3;
    pointer-events: none;
}

.capnis-photo-card:hover .capnis-photo-hover-overlay {
    opacity: 1;
}

.capnis-photo-zoom-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ffffff;
    color: #0f172a;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.8);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease, color 0.25s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.capnis-photo-card:hover .capnis-photo-zoom-btn {
    transform: scale(1);
}

.capnis-photo-hover-text {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    transform: translateY(8px);
    transition: transform 0.35s ease;
}

.capnis-photo-card:hover .capnis-photo-hover-text {
    transform: translateY(0);
}

/* Card Body Content */
.capnis-photo-card-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.capnis-photo-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.capnis-photo-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #0e4c87;
}

html.capnis-dark .capnis-photo-tag {
    color: #60a5fa;
}

.capnis-photo-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.35;
    transition: color 0.25s ease;
}

html.capnis-dark .capnis-photo-title {
    color: #f8fafc;
}

.capnis-photo-title a {
    color: inherit;
    text-decoration: none;
}

.capnis-photo-title a:hover {
    color: #0e4c87;
}

html.capnis-dark .capnis-photo-title a:hover {
    color: #93c5fd;
}

/* Ghost Button in Hero */
.capnis-ref-btn--ghost {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.capnis-ref-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #ffffff !important;
    color: #ffffff !important;
}

/* Empty State */
.capnis-photo-empty {
    text-align: center;
    padding: 80px 20px;
    background: #ffffff;
    border-radius: 24px;
    border: 1px dashed rgba(15, 23, 42, 0.15);
    max-width: 600px;
    margin: 0 auto;
}

html.capnis-dark .capnis-photo-empty {
    background: #131824;
    border-color: rgba(255, 255, 255, 0.12);
}

.capnis-photo-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(14, 76, 135, 0.08);
    color: #0e4c87;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

html.capnis-dark .capnis-photo-empty-icon {
    background: rgba(255, 255, 255, 0.08);
    color: #93c5fd;
}

/* Other Galleries Showcase */
.capnis-other-galleries-section {
    padding-top: 20px;
    padding-bottom: clamp(60px, 6vw, 100px);
    background-color: var(--capnis-surface-2, #f8fafc);
}

html.capnis-dark .capnis-other-galleries-section {
    background-color: #0c0f17;
}

.capnis-other-album-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    height: 280px;
    background: #0f172a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    display: block;
    text-decoration: none;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.capnis-other-album-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.2);
}

.capnis-other-album-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.capnis-other-album-card:hover .capnis-other-album-img {
    transform: scale(1.08);
}

.capnis-other-album-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.85) 100%);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 2;
}

.capnis-other-album-badge {
    align-self: flex-start;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 999px;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
}

.capnis-other-album-title {
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 6px;
    line-height: 1.3;
}

.capnis-other-album-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8125rem;
    font-weight: 600;
    transition: color 0.25s ease;
}

.capnis-other-album-card:hover .capnis-other-album-cta {
    color: #ffffff;
}

/* Custom Magnific Popup Styling */
.mfp-capnis-gallery {
    background: rgba(10, 15, 25, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mfp-capnis-gallery .mfp-figure::after {
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    border-radius: 12px;
}

.mfp-capnis-gallery .mfp-bottom-bar {
    margin-top: 12px;
}

.mfp-capnis-gallery .mfp-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
}

.mfp-capnis-gallery .mfp-counter {
    color: #94a3b8;
    font-weight: 600;
}

.mfp-capnis-gallery .mfp-arrow {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    margin-top: -30px;
    transition: background 0.25s ease;
}

.mfp-capnis-gallery .mfp-arrow:hover {
    background: rgba(255, 255, 255, 0.25);
}
