/* ============================================================
   styles.css — Shared styles for all pages
   Merged from the former main.css + main2.css.
   Page-specific overrides live in index.css / gallery.css /
   portfolio.css and must be loaded AFTER this file.
   ============================================================ */

/* ---------- Base ---------- */
html {
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}
html::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

@supports (view-transition-name: auto) {
    html {
        view-transition-name: page-transition;
    }
}

body {
    font-family: "Karla", sans-serif;
    margin: 0;
    padding: 0;
    background-color: rgba(24, 24, 24);
    background-size: cover;
    color: rgb(222, 222, 222);
}

/* ---------- Header ---------- */
header {
    background-color: rgba(24, 24, 24, 0.7);
    color: white;
    padding: 1em 0;
    text-align: center;
}
.site-header {
    position: relative;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0);
    color: rgb(224, 224, 224);
    padding: 0;
    padding-top: 0em;
    padding-bottom: 4em;
    font-family: "Montserrat", sans-serif;
    letter-spacing: 0.30em;
    font-weight: 200;
    text-align: center;
}
header h1 a {
    color: inherit;
    text-decoration: none;
}
header h1 a:hover {
    color: inherit;
    text-decoration: none;
}

/* ---------- Layout ---------- */
section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    box-sizing: border-box;
}

/* ---------- Navigation ---------- */
nav {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(24, 24, 24, 0.9);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: clamp(0.80em, 2vw, 1em);
}
nav a {
    color: rgb(224, 224, 224);
    padding: 1em;
    text-decoration: none;
    white-space: nowrap;
}
/* Site title, pushed to the left */
.site-title {
    margin-right: auto;
    display: flex;
    align-items: center;
    padding-left: 1.5em;
    letter-spacing: 0.15em;
}
.site-title h3 {
    margin: 0;
    color: inherit;
    font-size: 1.17em;
    font-weight: bold;
}
nav a:hover {
    background-color: #55555589;
}

/* ---------- Mobile navigation ---------- */
.nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 0.2rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    position: relative;
}
.nav-toggle span::before,
.nav-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
}
.nav-toggle span::before {
    top: -6px;
}
.nav-toggle span::after {
    top: 6px;
}
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem 1.25rem;
}
.nav-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}
body.nav-open .site-nav {
    display: none !important;
}
.nav-overlay .overlay-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 420px;
    text-align: center;
    padding: 1rem 0;
}
.nav-overlay .overlay-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    padding: 0.85rem 0.75rem;
    border-radius: 0.15rem;
    background: transparent;
    transition: 0.15s ease, transform 0.15s ease;
}
.overlay-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}
/* The site title is hidden inside the mobile overlay */
.nav-overlay .site-title {
    display: none;
}
@media (max-width: 820px) {
    nav {
        background-color: transparent;
    }
    .site-nav .site-title {
        margin-right: 0;
        padding-left: 0;
        text-align: center;
        width: 100%;
        justify-content: center;
    }
    .nav-overlay .site-title,
    .overlay-nav .site-title {
        margin-right: 0;
        padding-left: 0;
        text-align: center;
        width: auto;
        justify-content: center;
    }
    .nav-toggle {
        display: flex;
    }
    .site-nav {
        display: none;
    }
}

/* ---------- Image grids ---------- */
.image-grid {
    display: grid;
    gap: 1.2rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 2fr));
    align-items: start;
}
.image-grid img {
    width: 100%;
    height: 220px;
    display: block;
    border-radius: 3px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.2s;
}
.image-grid img:hover {
    transform: scale(1.02);
}
/* Stills: natural height, roughly twice as large in the grid */
#stills .image-grid img {
    height: auto;
    object-fit: contain;
}
#stills .image-grid {
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 1.4rem;
}

/* ---------- Lightbox ---------- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}
.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}
.lightbox-content {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 40px;
    box-sizing: border-box;
}
.lightbox-img {
    max-width: calc(100vw - 120px);
    max-height: calc(80vh - 40px);
    width: auto;
    height: auto;
    border-radius: 0px;
    object-fit: contain;
    display: block;
}
.lightbox-caption {
    margin-top: 0.75rem;
    color: #ddd;
    text-align: center;
    font-size: 1rem;
    max-width: 100%;
    line-height: 1.5;
    white-space: normal;
    word-wrap: break-word;
}
.lightbox-close {
    position: fixed;
    top: 20px;
    right: 40px;
    z-index: 2500;
    font-size: 40px;
    color: white;
    background: transparent;
    cursor: pointer;
    font-weight: bold;
    transition: color 0.3s;
}
.lightbox-close:hover {
    color: #ccc;
}
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2500;
    background: transparent;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 1.25em;
    transition: color 0.3s;
}
.lightbox-nav:hover {
    color: #ccc;
}
.lightbox-nav:disabled {
    opacity: 0;
    cursor: default;
    pointer-events: none;
}
#lightboxPrev {
    left: 0;
}
#lightboxNext {
    right: 0;
}
@media (max-width: 2150px) {
    .lightbox {
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 20px;
    }
    .lightbox-content {
        padding: 20px 20px 10px;
        width: 100%;
        box-sizing: border-box;
    }
    .lightbox-img {
        max-width: calc(80vw - 40px);
        max-height: calc(60vh - 40px);
    }
    .lightbox-nav {
        position: fixed;
        transform: translateY(-50%);
        margin: 0;
        width: auto;
        font-size: 32px;
        padding: 1em;
    }
    .lightbox-controls {
        display: flex;
        justify-content: center;
        gap: 12px;
        width: 100%;
        margin-top: 0px;
    }
    .lightbox-close {
        top: 10px;
        right: 10px;
        font-size: 32px;
    }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- Social links ---------- */
.social-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
}
.social-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
    align-items: center;
}
.social-links li {
    margin: 0;
}
.social-links li:hover {
    scale: 1.1;
}

/* ---------- Contact ---------- */
#contact {
    max-width: none;
    margin-top: 5.5em;
    padding-top: 1.5em;
    padding-bottom: 1.5em;
    position: relative;
    overflow: hidden;
    background-color: transparent;
    text-decoration: none;
}
#contact a,
#contact a:visited,
#contact a:hover,
#contact a:focus,
#contact a:active {
    color: inherit;
    text-decoration: none;
}
.contact-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    will-change: transform;
    transform: translateZ(0);
}

/* ---------- Footer ---------- */
#copyright {
    position: static;
    left: 50%;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 1em 0;
    font-size: 0.9em;
    color: #aaa;
    z-index: 10;
}

/* ---------- View transitions ---------- */
@view-transition {
    navigation: auto;
}
::view-transition-group(#gallery, #stills, #posters, #contact) {
    animation-duration: 0.35s;
    animation-timing-function: ease;
}
