/**
 * ==============================================================================
 * SADRA VISUALS — ARTBOOK PHOTOGRAPHY GALLERY & STUDIO CMS
 * LAYER 6.5: TECHNICAL EXIF INSPECTION DRAWER STYLESHEET
 * ==============================================================================
 * Features:
 * 1. Desktop Slide-Over Panel (Right Edge, Hardware-Accelerated)
 * 2. Mobile-First Bottom-Sheet Adaptation (< 768px, < 480px, < 380px)
 * 3. Obsidian Frosted Glass Luxury Aesthetics with Gold Highlights
 * 4. Exposure Triangle Card Grid (Focal Length, Aperture, Shutter, ISO)
 * 5. Camera Body & Optical Lens Specifications
 * 6. Ergonomic Touch Drag Handle & >= 44px Minimum Touch Targets
 * 7. Zero Horizontal Overflow & Smooth Momentum Scrolling (-webkit-overflow-scrolling)
 */

/* 1. Backdrop Overlay */
.exif-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 12, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: var(--z-modal, 10500);
}

.exif-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto !important;
}

.exif-backdrop:not(.is-open) {
    pointer-events: none !important;
    visibility: hidden !important;
}

/* 2. Drawer Container (Desktop: Right Slide-Over Panel) */
.exif-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(440px, 92vw);
    background: rgba(10, 13, 18, 0.94);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -14px 0 45px rgba(0, 0, 0, 0.65);
    z-index: var(--z-drawer, 10600);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    color: #e2e8f0;
    overflow: hidden;
    visibility: hidden;
    pointer-events: none !important;
}

.exif-drawer.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto !important;
}

.exif-drawer:not(.is-open),
.exif-drawer:not(.is-open) * {
    pointer-events: none !important;
    visibility: hidden !important;
}

/* 3. Drag Handle for Mobile Bottom-Sheet (Hidden on Desktop) */
.exif-drag-handle {
    display: none;
    width: 38px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.22);
    margin: 10px auto 4px;
    flex-shrink: 0;
}

/* 4. Sticky Header */
.exif-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(10, 13, 18, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-shrink: 0;
    box-sizing: border-box;
}

.exif-header-title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.exif-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exif-kicker-badge {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-gold, #d4af37);
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
}

.exif-header-title {
    margin: 0;
    font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 1.15rem;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Close Button (>= 44px touch target) */
.exif-close-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.exif-close-btn:hover,
.exif-close-btn:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.exif-close-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    pointer-events: none;
}

/* 5. Scrollable Body */
.exif-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    box-sizing: border-box;
}

/* Artwork Preview Summary */
.exif-artwork-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    box-sizing: border-box;
}

.exif-thumb-wrap {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.exif-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.exif-artwork-meta {
    flex: 1;
    min-width: 0;
}

.exif-artwork-title {
    margin: 0 0 3px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.exif-artwork-subtitle {
    margin: 0;
    font-size: 0.78rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Section Headings */
.exif-section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px 0;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #94a3b8;
}

.exif-section-heading svg {
    width: 14px;
    height: 14px;
    fill: var(--color-gold, #d4af37);
}

/* 6. Exposure Triangle 2x2 Card Grid */
.exif-triangle-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.exif-metric-card {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.exif-metric-card:hover {
    border-color: rgba(212, 175, 55, 0.3);
    background: rgba(255, 255, 255, 0.05);
}

.exif-metric-label {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.exif-metric-value {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 1.15rem;
    font-weight: 600;
    color: #ffffff;
    word-break: break-word;
}

.exif-metric-value.highlight-gold {
    color: var(--color-gold, #d4af37);
}

/* 7. Equipment List (Camera & Lens) */
.exif-equipment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.exif-equipment-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    box-sizing: border-box;
}

.exif-item-icon {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-gold, #d4af37);
    flex-shrink: 0;
}

.exif-item-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.exif-item-details {
    flex: 1;
    min-width: 0;
}

.exif-item-category {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 3px;
}

.exif-item-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #f8fafc;
    word-break: break-word;
    line-height: 1.35;
}

/* 8. Geometry & Capture Details */
.exif-geometry-card {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-sizing: border-box;
}

.exif-geometry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
}

.exif-geo-key {
    color: #94a3b8;
}

.exif-geo-val {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-weight: 500;
    color: #f1f5f9;
}

.exif-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* 9. One-Click Clipboard Copy Footer */
.exif-footer {
    padding: 18px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(10, 13, 18, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-shrink: 0;
    box-sizing: border-box;
}

.exif-copy-btn {
    width: 100%;
    min-height: 46px;
    padding: 12px 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.16), rgba(212, 175, 55, 0.06));
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #f6d87e;
    font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

.exif-copy-btn:hover,
.exif-copy-btn:focus-visible {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.28), rgba(212, 175, 55, 0.12));
    border-color: rgba(212, 175, 55, 0.7);
    color: #ffffff;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}

.exif-copy-btn:active {
    transform: translateY(0);
}

.exif-copy-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ==============================================================================
 * 10. MOBILE-FIRST RESPONSIVENESS & TOUCH ERGONOMICS (< 768px, < 480px, < 380px)
 * ============================================================================== */

@media (max-width: 768px) {
    /* Transform from Right Slide-Over into Bottom-Sheet */
    .exif-drawer {
        top: auto;
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-height: 86vh;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 22px 22px 0 0;
        transform: translateY(100%);
        box-shadow: 0 -14px 45px rgba(0, 0, 0, 0.75);
    }

    .exif-drawer.is-open {
        transform: translateY(0);
    }

    /* Reveal Visual Drag Handle */
    .exif-drag-handle {
        display: block;
    }

    .exif-header {
        padding: 12px 20px 14px;
    }

    .exif-body {
        padding: 18px 20px;
        gap: 18px;
    }

    .exif-footer {
        padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 480px) {
    .exif-header-title {
        font-size: 1.05rem;
    }

    .exif-triangle-grid {
        gap: 10px;
    }

    .exif-metric-card {
        padding: 12px 14px;
    }

    .exif-metric-value {
        font-size: 1.05rem;
    }

    .exif-body {
        padding: 16px;
        gap: 16px;
    }

    .exif-footer {
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 380px) {
    .exif-triangle-grid {
        grid-template-columns: 1fr;
    }

    .exif-header-title {
        font-size: 0.98rem;
    }

    .exif-copy-btn {
        font-size: 0.82rem;
    }
}

/* Chromatic Palette & Mood in Full-View EXIF Drawer */
#exif-section-chromatic {
    display: block;
}

.exif-palette-dots,
.exif-geometry-card .photo-palette-dots.exif-palette-dots {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 !important;
    padding: 3px 8px !important;
    pointer-events: auto !important;
}

.exif-palette-dots .photo-palette-dot {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

