/* ============================================
   CINEMATIC GALLERY UNIFIED - SchmidtArts
   Einheitliches System für alle Portfolio-Kategorien
   ============================================ */

/* CSS Custom Properties */
:root {
    --gallery-accent: #d4af37;
    --gallery-accent-rgb: 212, 175, 55;
    --gallery-dark: #0a0a0a;
    --gallery-darker: #050505;
    --gallery-transition: cubic-bezier(0.4, 0, 0.2, 1);
    --gallery-reveal-duration: 1.2s;
}

/* Category-specific accents */
[data-category="drohne"] { --category-accent: #00d4ff; }
[data-category="events"] { --category-accent: #ff6b6b; }
[data-category="portrait"] { --category-accent: #d4af37; }
[data-category="love-family"] { --category-accent: #ff8fab; }

/* ============================================
   HERO SECTION - Einheitlich für alle
   ============================================ */

.cinematic-hero {
    position: relative;
    height: 100vh;
    min-height: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--gallery-darker);
}

.cinematic-hero-bg {
    position: absolute;
    inset: -10%;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.cinematic-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(5,5,5,0.8) 0%,
        rgba(5,5,5,0.5) 40%,
        rgba(5,5,5,0.3) 60%,
        rgba(5,5,5,0.9) 100%
    );
    z-index: 1;
}

.cinematic-vignette {
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 300px rgba(0,0,0,0.9);
    z-index: 2;
    pointer-events: none;
}

/* Grain Effect */
.cinematic-grain {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Hero Content */
.cinematic-hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
    max-width: 900px;
}

.hero-label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--category-accent, var(--gallery-accent));
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
}

.hero-label.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s var(--gallery-transition);
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 400;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.hero-title .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%) rotateX(-90deg);
    transform-origin: center bottom;
}

.hero-title .char.revealed {
    opacity: 1;
    transform: translateY(0) rotateX(0);
    transition: all 1s var(--gallery-transition);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255,255,255,0.7);
    font-weight: 300;
    letter-spacing: 0.1em;
    opacity: 0;
    transform: translateY(20px);
}

.hero-subtitle.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.8s var(--gallery-transition) 0.6s;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    opacity: 0;
    animation: fadeInUp 1s ease 1.5s forwards;
}

.scroll-indicator span {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--category-accent, var(--gallery-accent)), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(0.5); opacity: 0.5; }
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   GALLERY GRID - Wow Animationen
   ============================================ */

.gallery-section {
    padding: 6rem 2rem;
    background: var(--gallery-dark);
    position: relative;
}

.gallery-header {
    text-align: center;
    margin-bottom: 4rem;
}

.gallery-header .section-label {
    font-size: 0.75rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--category-accent, var(--gallery-accent));
    display: block;
    margin-bottom: 1rem;
}

.gallery-header .section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: #fff;
    font-weight: 400;
}

/* Masonry Grid */
.cinematic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .cinematic-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Grid Item */
.cinematic-item {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: var(--gallery-darker);
    transform-style: preserve-3d;
    perspective: 1000px;
}

.cinematic-item:nth-child(3n+1) {
    aspect-ratio: 3/4;
}

.cinematic-item:nth-child(5n+3) {
    aspect-ratio: 16/9;
    grid-column: span 2;
}

@media (max-width: 768px) {
    .cinematic-item:nth-child(5n+3) {
        grid-column: span 1;
        aspect-ratio: 4/3;
    }
}

/* Image Container */
.cinematic-item-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.cinematic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--gallery-transition);
    will-change: transform;
}

/* Reveal Animation */
.cinematic-item .reveal-mask {
    position: absolute;
    inset: 0;
    background: var(--gallery-accent);
    z-index: 2;
    transform-origin: left;
    transform: scaleX(1);
}

.cinematic-item.revealed .reveal-mask {
    transform: scaleX(0);
    transition: transform var(--gallery-reveal-duration) var(--gallery-transition);
}

.cinematic-item.revealed img {
    transform: scale(1.1);
}

/* Blur-in Effect */
.cinematic-item img {
    filter: blur(10px);
    opacity: 0;
    transform: scale(1.2);
}

.cinematic-item.revealed img {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
    transition: filter 1.2s ease, opacity 1s ease, transform 1.5s var(--gallery-transition);
}

/* Hover Effects */
.cinematic-item:hover img {
    transform: scale(1.1);
}

.cinematic-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.8) 0%,
        transparent 50%
    );
    opacity: 0;
    z-index: 3;
    transition: opacity 0.5s ease;
}

.cinematic-item:hover::before {
    opacity: 1;
}

/* Glow Effect on Hover */
.cinematic-item::after {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(
        135deg,
        var(--category-accent, var(--gallery-accent)),
        transparent 50%
    );
    opacity: 0;
    z-index: -1;
    border-radius: 10px;
    transition: opacity 0.5s ease;
    filter: blur(10px);
}

.cinematic-item:hover::after {
    opacity: 0.5;
}

/* Item Info Overlay */
.cinematic-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    z-index: 4;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s var(--gallery-transition);
}

.cinematic-item:hover .cinematic-item-info {
    transform: translateY(0);
    opacity: 1;
}

.cinematic-item-title {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.cinematic-item-meta {
    font-size: 0.85rem;
    color: var(--category-accent, var(--gallery-accent));
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* View Button */
.cinematic-item-view {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--category-accent, var(--gallery-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    opacity: 0;
    transition: all 0.5s var(--gallery-transition);
}

.cinematic-item:hover .cinematic-item-view {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.cinematic-item-view svg {
    width: 24px;
    height: 24px;
    fill: var(--gallery-dark);
}

/* ============================================
   LIGHTBOX
   ============================================ */

.cinematic-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5,5,5,0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

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

.lightbox-container {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
}

.lightbox-image-wrapper img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    animation: kenBurns 20s ease-in-out infinite alternate;
}

@keyframes kenBurns {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* Lightbox Controls */
.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-close:hover {
    background: var(--category-accent, var(--gallery-accent));
    border-color: var(--category-accent, var(--gallery-accent));
}

.lightbox-close svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.lightbox-nav:hover {
    background: var(--category-accent, var(--gallery-accent));
}

.lightbox-nav.prev { left: 2rem; }
.lightbox-nav.next { right: 2rem; }

.lightbox-nav svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

/* Lightbox Info Panel */
.lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    transform: translateY(100%);
    transition: transform 0.5s ease;
}

.cinematic-lightbox.active .lightbox-info {
    transform: translateY(0);
}

.lightbox-title {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.lightbox-meta {
    display: flex;
    gap: 2rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
}

.lightbox-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .cinematic-hero {
        min-height: 500px;
    }
    
    .gallery-section {
        padding: 3rem 1rem;
    }
    
    .cinematic-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .lightbox-nav {
        width: 45px;
        height: 45px;
    }
    
    .lightbox-nav.prev { left: 1rem; }
    .lightbox-nav.next { right: 1rem; }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .cinematic-item img,
    .hero-title .char,
    .reveal-mask {
        transition: none !important;
        animation: none !important;
    }
    
    .cinematic-item img {
        filter: blur(0) !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */

.cinematic-item.loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        var(--gallery-darker) 0%,
        rgba(255,255,255,0.05) 50%,
        var(--gallery-darker) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    z-index: 10;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ============================================
   OPTIMIERTE BILDPOSITIONEN
   ============================================ */

/* Standard: Bildmitte */
.cinematic-item img {
    object-position: center center;
}

/* Portrait-Format Bilder: Oben ausrichten (Gesichter) */
.cinematic-item:nth-child(3n+1) img {
    object-position: center 20%;
}

/* Querformat: Mitte */
.cinematic-item:nth-child(5n+3) img {
    object-position: center center;
}

/* Kategorienspezifische Ausrichtungen */
[data-category="drohne"] .cinematic-item img {
    /* Drohnenaufnahmen: Horizont in der unteren Drittel */
    object-position: center 60%;
}

[data-category="events"] .cinematic-item img {
    /* Events: Menschen im Fokus */
    object-position: center 30%;
}

[data-category="portrait"] .cinematic-item img {
    /* Portraits: Gesichter oben */
    object-position: center 15%;
}

[data-category="love-family"] .cinematic-item img {
    /* Hochzeiten: Paare im Fokus */
    object-position: center 25%;
}

/* Lightbox: Vollständiges Bild */
.lightbox-image-wrapper img {
    object-fit: contain;
    object-position: center center;
}

/* ============================================
   OPTIMIERTE ASPECT RATIOS
   ============================================ */

/* Standard: 4:3 für Landschaften */
.cinematic-item {
    aspect-ratio: 4/3;
}

/* Portrait-Format: 3:4 für Hochformat-Bilder */
.cinematic-item:nth-child(3n+1) {
    aspect-ratio: 3/4;
}

/* Breitformat: 16:9 für Panoramen */
.cinematic-item:nth-child(5n+3) {
    aspect-ratio: 16/9;
    grid-column: span 2;
}

/* Quadratisch für Details */
.cinematic-item:nth-child(7n+2) {
    aspect-ratio: 1/1;
}

/* Kategorienspezifische Optimierungen */
[data-category="drohne"] .cinematic-item {
    /* Drohnen: Mehr Breite für Landschaften */
    aspect-ratio: 16/9;
}

[data-category="drohne"] .cinematic-item:nth-child(3n+1) {
    /* Einzelne Hochformat-Drohnenaufnahmen */
    aspect-ratio: 3/4;
}

[data-category="portrait"] .cinematic-item,
[data-category="love-family"] .cinematic-item {
    /* Portraits: Mehr Höhe für Ganzkörper */
    aspect-ratio: 3/4;
}

[data-category="portrait"] .cinematic-item:nth-child(5n+3),
[data-category="love-family"] .cinematic-item:nth-child(5n+3) {
    /* Breite Gruppenaufnahmen */
    aspect-ratio: 16/9;
    grid-column: span 2;
}

[data-category="events"] .cinematic-item {
    /* Events: Flexible Formate */
    aspect-ratio: 4/3;
}

[data-category="events"] .cinematic-item:nth-child(2n+1) {
    /* Abwechselnd Hochformat */
    aspect-ratio: 3/4;
}


/* ============================================
   GLOBALER RECHTSKLICK-SCHUTZ
   ============================================ */

/* Verhindere Text-Selektion global */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Erlaube Text-Selektion in Formularen */
input, textarea, .allow-select {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Verhindere Bild-Drag */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: auto;
}

/* Cursor für Bilder */
.cinematic-item img {
    cursor: pointer;
}

/* Rechtsklick-Schutz Toast */
.protection-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(212, 175, 55, 0.95);
    color: #000;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    white-space: normal;
    max-width: 90vw;
    width: max-content;
    max-width: min(90vw, 400px);
    text-align: center;
}

.protection-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Verhindere Kontextmenü-Cursor */
body {
    -webkit-touch-callout: none;
}

body, html {
    overflow-x: hidden;
}
