/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Helvetica Neue", sans-serif;
    background: #000;
    color: #fff;
    display: flex;
    height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    width: 200px;
    background: #000;
    color: #f0f;
    padding: 20px;
    position: fixed;
    height: 100%;
    transition: transform 0.3s ease-in-out;
    z-index: 1000;
}

.sidebar h1 {
    font-size: 1.5em;
    margin-bottom: 20px;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav ul li {
    margin: 10px 0;
}

.sidebar nav ul li a {
    color: #f0f;
    text-decoration: none;
    transition: color 0.3s;
}

.sidebar nav ul li a:hover {
    color: #fff;
}

.main-content {
    margin-left: 200px;
    width: calc(100% - 200px);
    overflow-y: auto;
}

.gallery.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: auto; /* was 250px; let aspect-ratio control height */
    gap: 10px;
    padding: 20px;
}

.gallery .item {
    position: relative;
    border-radius: 8px;
    overflow: hidden; /* clip overlay + scaled image neatly */
}

.gallery .item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
    border-radius: inherit;
    display: block;
    position: relative;
    z-index: 1;
}

/* Make iframes behave like images in cards */
.gallery .item iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    border-radius: inherit;
    position: relative;
    z-index: 1;
}

/* Dark gradient overlay on hover */
.gallery .item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0.25) 45%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 15; /* above image, below text */
}

.gallery .item:hover::after {
    opacity: 1;
}

/* Caption becomes overlay text on desktop */
.caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 14px;
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 20;
    text-align: left;
    margin-top: 0;
    pointer-events: none; /* allow clicks to pass through to video */
}

.gallery .item:hover .caption,
.gallery .item:focus-within .caption {
    opacity: 1;
    transform: translateY(0);
}

/* Optional: keep your existing image hover scale */
.gallery .item img:hover {
    transform: scale(1.05);
    z-index: 10;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.about, .contact {
    padding: 40px 20px;
    background: #111;
}

.about h2, .contact h2 {
    color: #f0f;
    margin-bottom: 15px;
}

.about p, .contact p {
    line-height: 1.6;
    color: #ccc;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    font-size: 2rem;
    color: #f0f;
    z-index: 1001;
    cursor: pointer;
    transition: left 0.3s ease; /* smooth shift when menu opens */
}

/* Contact social icon sizing */
.contact .social-links {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.contact .social-links .imdb-logo {
    height: 32px;   /* small social icon size */
    width: auto;    /* keep aspect ratio */
    display: block;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.contact .social-links a:hover .imdb-logo {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Globals */
:root {
    --card-min: 396px; /* desktop card width */
}

/* Mobile Styles */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: 56px; /* keep cards clear of the hamburger */
    }

    .hamburger {
        display: block;
        top: 12px;
        left: 12px;

        /* New: black background behind the icon */
        background: rgba(0, 0, 0, 0.9);
        padding: 6px 10px;
        border-radius: 8px;
        line-height: 1;
        border: 1px solid #222;
        box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    }

    /* Move hamburger to the right of the 200px sidebar when open */
    .sidebar.active ~ .hamburger {
        left: calc(200px + 12px);
    }

    /* Keep a 1-column grid; no stacking quirks */
    .gallery.grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        /* grid-auto-rows not needed on mobile */
    }

    .gallery .item { margin-bottom: 0; }

    /* Uniform cards via aspect-ratio on mobile for both images and videos */
    .gallery .item img,
    .gallery .item iframe {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        border-radius: 8px;
    }

    .caption {
        position: static;
        opacity: 1;
        transform: none;
        padding: 0;
        text-shadow: none;
        color: #ccc;
        text-align: left;
        margin-top: 5px;
        pointer-events: auto; /* captions are normal text on mobile */
    }

    .gallery .item::after { display: none; }
}

/* Desktop: sizes and ratios */
@media (min-width: 769px) {
    /* fixed card track width so media matches director cards */
    .gallery.grid {
        --card-min: 396px; /* was 330px */
        grid-template-columns: repeat(auto-fill, minmax(var(--card-min), var(--card-min)));
        justify-content: start; /* was center */
    }
    /* Default desktop ratio for all cards */
    .gallery .item {
        aspect-ratio: 16 / 9;
    }
    .gallery .item img,
    .gallery .item iframe {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

/* Make entire image card clickable (no underline, inherit color) */
.gallery .item > a {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

/* Match About/Contact background for gallery sections */
#director,
#screenwriter,
#associate-director {
    background: #111;
}

/* Headings in gallery sections (match About/Contact) */
.gallery.grid > h2 {
    grid-column: 1 / -1;  /* span full width of the grid */
    color: #f0f;
    margin: 0 0px 8px 0;
}

/* Card with side text (PC) and stacked text (Mobile) */
.gallery .item.item-with-text {
    /* override default card ratio behavior */
    aspect-ratio: auto;
    display: flex;
    gap: 16px;
    border-radius: 8px;
    overflow: hidden;
}

/* Disable hover overlay/caption for these split cards */
.gallery .item.item-with-text::after { display: none; }
.gallery .item.item-with-text .caption { display: none; }

.gallery .item.item-with-text .media {
    flex: 2 1 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.gallery .item.item-with-text .media img,
.gallery .item.item-with-text .media iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery .item.item-with-text .details {
    flex: 1 1 0;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #0d0d0d;
    border-left: 1px solid #1a1a1a;
    color: #ccc;
}
.gallery .item.item-with-text .details .title {
    color: rgb(255, 255, 255);
    margin: 0;
    font-size: 1rem;
}
.gallery .item.item-with-text .details .btn {
    margin-top: auto;
    align-self: flex-start;
    color: #fff;
    text-decoration: none;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.2s ease, transform 0.2s ease;
}
.gallery .item.item-with-text .details .btn:hover {
    background: #222;
    transform: translateY(-1px);
}

/* Mobile: stack text under media */
@media (max-width: 768px) {
    .gallery .item.item-with-text {
        display: block;
    }
    .gallery .item.item-with-text .media {
        width: 100%;
        aspect-ratio: 16 / 9;
    }
    .gallery .item.item-with-text .details {
        border-left: none;
        background: transparent;
        padding: 8px 0 0;
    }
}

/* PC: keep media as a normal card width; let text area take extra space to the right */
@media (min-width: 769px) {
    .gallery.grid {
        --card-min: 396px; /* was 330px */
        grid-template-columns: repeat(auto-fill, minmax(var(--card-min), var(--card-min)));
        justify-content: start; /* was center */
    }
    .gallery .item.item-with-text {
        grid-column: span 2;
        display: flex;
        align-items: stretch;
        aspect-ratio: auto;
    }
    .gallery .item.item-with-text .media {
        flex: 0 0 var(--card-min);
        aspect-ratio: 16 / 9;
        overflow: hidden;
    }
    .gallery .item.item-with-text .details {
        flex: 1 1 auto;
        height: 100%;
    }
}

/* Biography paragraph: max width = 2 cards */
#biography p {
    max-width: calc(var(--card-min) * 2);
    margin-right: auto;
    text-align: justify;  /* justify text */
    hyphens: auto;        /* nicer breaks */
}

/* Description text */
.desc {
    text-align: justify;
    font-style: italic;
    font-size: calc(1rem - 2pt);   /* ~1px smaller from 16px base */
    line-height: 1.5;       /* keep comfortable spacing */
    hyphens: auto;          /* nicer justification */
}

/* Subtle 5% darken and 10% desaturate on Director videos (thumbnails and playback) */
#director .item iframe {
    filter: brightness(0.95) saturate(0.7);
}

.hidden { display: none !important; }

.phone-guard { margin-top: 6px; }
.phone-guard .btn {
    background: #1a1a1a;
    color: #fff;
    border: 1px solid #2a2a2a;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
}
.phone-guard .btn.small { font-size: 0.9rem; line-height: 1; }
.phone-guard .btn:hover { background: #222; }

.phone-guard .captcha {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}
.phone-guard .captcha label { color: #ccc; font-size: 0.9rem; }
.phone-guard .captcha input {
    width: 70px;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #333;
    background: #0d0d0d;
    color: #fff;
}
.phone-guard .captcha .error { color: #ff6b6b; font-size: 0.85rem; margin-left: 4px; }

@media (max-width: 768px) {
    .phone-guard .captcha { display: block; margin: 8px 0 0; }
    .caption {
        display: none !important;
    }
}
