/* ========================================
   Shared Stylesheet for makingCrime Project
   Common styles used across all pages

   Optimizations:
   - Consolidated duplicate CSS from 12 HTML files
   - Mobile-first responsive design
   - Performance optimizations (will-change, smooth scrolling)
   - Touch-friendly interactions
   - Consistent color palette via CSS variables
   ======================================== */

/* CSS Custom Properties */
:root {
    --color-primary: #9299B5;
    --color-accent: #f0d24b;
    --color-background: black;
    --color-text: white;
}

/* Base Reset */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    background-color: var(--color-background);
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--color-text);
}

/* Z-index layering for all direct children */
body > * {
    position: relative;
    z-index: 2;
}

/* Mobile optimization: smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* Mobile optimization: improve tap highlighting */
a, button {
    -webkit-tap-highlight-color: rgba(146, 153, 181, 0.3);
}

/* Mobile top bar to prevent hamburger overlap with text */
.mobile-top-bar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 70%, transparent 100%);
    z-index: 99;
    pointer-events: none;
}

/* Hamburger Menu */
.hamburger-menu {
    position: fixed;
    top: 25px;
    left: 40px;
    width: 140px;
    height: 140px;
    cursor: pointer;
    z-index: 200;
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.hamburger-menu:hover {
    opacity: 1;
    transform: scale(1.05);
}

.hamburger-menu img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Menu Panel */
.menu-panel {
    position: fixed;
    top: 160px;
    left: 40px;
    width: auto;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 150;
    padding: 20px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.menu-panel.open {
    opacity: 0.9;
    pointer-events: auto;
}

.menu-panel a,
.menu-panel button {
    display: block;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 24px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: bold;
    margin-bottom: 8px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    padding: 0;
    transition: opacity 0.3s ease;
    width: 100%;
}

.menu-panel a:hover,
.menu-panel button:hover {
    opacity: 0.7;
}

.menu-divider {
    border: none;
    border-top: 3px solid rgba(146, 153, 181, 0.8);
    margin: 4px 0;
    width: 50%;
}

/* Language flags */
.lang-flags {
    display: flex;
    gap: 0;
    align-self: flex-start;
    margin-bottom: 15px;
}

.lang-flag-btn {
    background: none;
    border: none;
    font-size: 1.4em;
    padding: 2px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    line-height: 1;
}

.lang-flag-btn.active {
    opacity: 1;
}

.lang-flag-btn:hover {
    opacity: 0.6;
}

.lang-flag-btn.active:hover {
    opacity: 1;
}

.menu-panel .lang-flag-btn {
    padding-left: 0;
    padding-right: 0;
    width: auto;
    font-size: 2em;
}

/* Site footer */
.site-footer {
    text-align: center;
    padding: 40px 20px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.site-footer a {
    color: #9299B5;
    text-decoration: none;
    font-size: 16px;
    letter-spacing: 0.08em;
    margin: 0 20px;
    transition: opacity 0.2s;
}

.site-footer a:hover {
    opacity: 0.7;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 60px 60px;
}

/* Headings */
h1 {
    font-size: 96px;
    font-weight: bold;
    margin: 0 0 20px 0;
    line-height: 1.1;
}

/* Character-by-character typing animation support */
h1 .char {
    display: inline;
    opacity: 0;
    transition: opacity 0.3s ease;
}

h1 .char.typed {
    opacity: 1;
}

/* Content */
.content {
    font-size: 24px;
    line-height: 1.6;
    font-family: "Open Sans", sans-serif;
    font-weight: 200;
    max-width: 900px;
}

.content p {
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    /* Performance optimization */
    will-change: opacity, transform;
}

.content p.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Back Link */
.back-link {
    display: inline-block;
    font-size: 32px;
    font-weight: bold;
    color: var(--color-primary);
    text-decoration: none;
    margin-top: 60px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.back-link:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

/* Gallery Grid */
.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 60px;
    margin: 60px 0 80px;
    max-width: 800px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.gallery-grid.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item {
    position: relative;
    overflow: visible;
    background-color: transparent;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* Performance optimization */
    will-change: transform;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(240, 210, 75, 0.3);
}

/* Mobile: use active state instead of hover */
@media (hover: none) and (pointer: coarse) {
    .gallery-item:active {
        transform: scale(1.02);
        box-shadow: 0 10px 30px rgba(240, 210, 75, 0.3);
    }
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    cursor: pointer;
}

/* Image Captions */
.image-caption {
    color: #999;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    font-family: "Open Sans", sans-serif;
    font-weight: 200;
    min-height: 20px;
    position: relative;
    z-index: 10;
    display: block;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 40px;
    color: white;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 1001;
}

/* ========================================
   Responsive Design - Tablet
   ======================================== */
@media screen and (max-width: 768px) {
    .mobile-top-bar {
        display: block;
        height: 100px;
    }

    .container {
        padding: 100px 30px 40px;
    }

    h1 {
        font-size: 56px;
    }

    .content {
        font-size: 20px;
    }

    .back-link {
        font-size: 28px;
    }

    .hamburger-menu {
        width: 110px;
        height: 110px;
        top: 10px;
        left: 20px;
    }

    .menu-panel {
        top: 105px;
        left: 20px;
    }

    .menu-panel a,
    .menu-panel button {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

/* ========================================
   Responsive Design - Mobile
   ======================================== */
@media screen and (max-width: 480px) {
    .mobile-top-bar {
        display: block;
        height: 85px;
    }

    .container {
        padding: 80px 20px 30px;
    }

    h1 {
        font-size: 42px;
    }

    .content {
        font-size: 18px;
    }

    .back-link {
        font-size: 24px;
    }

    .hamburger-menu {
        width: 80px;
        height: 80px;
        top: 8px;
        left: 15px;
    }


    .menu-panel {
        top: 85px;
        left: 15px;
        padding: 15px;
    }

    .menu-panel a,
    .menu-panel button {
        font-size: 18px;
        margin-bottom: 15px;
    }
}
