/* Reset and Base */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Alegreya Sans", "Helvetica Neue", Helvetica, sans-serif;
    background: #000;
    color: #eee;
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: #933;
    text-decoration: none;
}

a:hover {
    color: #c66;
}

/* Site Wrapper */
.site-wrapper {
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.site-header {
    display: flex;
    height: 100px;
    margin: 0 -1rem;
    padding: 1rem 0;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    border-right: 1px solid #333;
    border-left: 1px solid #333;
    justify-content: space-between;
}

.site-branding {
    display: flex;
    flex-direction: column;
    margin-left: 1rem;
    justify-content: center;
}

.site-title {
    font-size: 2.5rem;
    line-height: 1;
    color: #933;
}

.site-subtitle {
    font-size: 1.25rem;
    color: #aaa;
}

.site-nav {
    display: flex;
    margin-right: 1rem;
    gap: 1.5rem;
    align-self: flex-end;
}

.site-nav a {
    color: #aaa;
    font-size: 0.9rem;
}

.site-nav a:hover {
    color: #fff;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: #222;
    border: 1px solid #333;
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.dropdown-toggle:hover {
    background: #333;
    color: #fff;
}

.dropdown-toggle .arrow {
    font-size: 0.7rem;
    margin-left: 0.25rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: fit-content;
    min-width: 240px;
    max-width: 100%;
    margin-top: 0.25rem;
    z-index: 200;
    background: #222;
    border: 1px solid #333;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.dropdown-menu a {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    color: #ccc;
}

.dropdown-menu a:hover {
    background: #333;
    color: #fff;
}

.dropdown-menu .count {
    color: #666;
    font-size: 0.85rem;
}

.dropdown-menu a.dropdown-all {
    padding-bottom: 0.5rem;
    font-weight: 800;
    border-bottom: 1px solid #333;
}

/* Main Content */
.site-main {
    padding: 1rem 0;
}

/* Gallery Toolbar */
.gallery-toolbar {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 0;
    margin-top: -1rem;
}

.gallery-toolbar h1 {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0;
}

.photo-count {
    color: #666;
    font-size: 0.9rem;
    margin-right: auto;
}

/* Filter Toggle Button */
.toggle-filters {
    display: inline-flex;
    width: 135px;
    height: 35px;
    padding: 0 1rem;
    background: #222;
    border: 1px solid #333;
    border-radius: 4px;
    color: #aaa;
    cursor: pointer;
    font-size: 0.85rem;
    align-self: flex-end;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.toggle-filters:hover {
    background: #333;
    color: #fff;
}

.filtersToggleIcon {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* Filter Box */
.filter-box {
    position: absolute;
    top: calc(100% - 10px);
    right: 0;
    display: flex;
    width: fit-content;
    min-width: 360px;
    max-width: calc(100vw - 2rem);
    padding: 0.75rem;
    z-index: 100;
    background: #111;
    border: 1px solid #333;
    border-radius: 6px;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

.filter-box-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.clear-filter {
    color: #e57373;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #4a2a2a;
    border-radius: 3px;
    background: #2a1a1a;
    white-space: nowrap;
}

.clear-filter:hover {
    background: #3a2020;
    color: #ff8a80;
}

.filter-search {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.filter-search input {
    background: #222;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    color: #fff;
    font-size: 0.85rem;
    width: 150px;
}

.filter-search input:focus {
    outline: none;
    border-color: #555;
}

.filter-search input::placeholder {
    color: #666;
}

.filter-search button {
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    padding: 0.4rem 0.75rem;
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}

.filter-search button:hover {
    background: #444;
}

/* Tags Bar */
.tags-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.tag {
    background: #222;
    border: 1px solid #333;
    border-radius: 3px;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    color: #aaa;
}

.tag:hover, .tag.active {
    background: #333;
    color: #fff;
    border-color: #444;
}


/* No Photos */
.no-photos {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.no-photos a {
    display: inline-block;
    margin-top: 1rem;
}

/* Contact Sheet Grid */
.contact-sheet {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 0;
    row-gap: 10px;
}

@media (min-width: 480px) {
    .contact-sheet {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .site-wrapper {
        width: 720px;
        padding: 0;
    }
    .site-header {
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }
    .contact-sheet {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (min-width: 1200px) {
    .site-wrapper {
        width: 1140px;
    }
    .contact-sheet {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (min-width: 1580px) {
    .site-wrapper {
        width: 1500px;
    }
}

@media (min-width: 1900px) {
    .site-wrapper {
        width: 1800px;
    }
}

.photo-cell {
    cursor: pointer;
    position: relative;
    padding: 20px 10px;
    font-family: "Roboto", "Helvetica Neue", Helvetica, sans-serif;
    color: #777;
    background-color: #111;
}

.photo-cell img {
    aspect-ratio: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease, filter 0.2s ease;
    opacity: 0;
}

.photo-cell .marker-border {
    position: absolute;
    top: 15px;
    left: 5px;
    right: 5px;
    bottom: 15px;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 99;
}

.photo-cell img[src] {
    opacity: 1;
    -webkit-filter: grayscale(100%); /* Safari 6.0 - 9.0 */
    filter: grayscale(100%);
}

.photo-cell:hover img {
    -webkit-filter: grayscale(0%); /* Safari 6.0 - 9.0 */
    filter: grayscale(0%);
}

.photo-cell:hover .marker-border {
    opacity: 1;
}

.photo-cell .film-name {
    position: absolute;
    top: 5px;
    width: 100%;
    text-align: center;
    font-size: .7em;
    line-height: .7em;
    text-transform: uppercase;
}

.photo-cell .photo-number {
    position: absolute;
    bottom: 5px;
    height: 15px;
    width: 100%;
    padding-top: 5px;
    padding-left: 20px;
    text-align: center;
    font-size: .7em;
    line-height: .7em;
}

.photo-cell .photo-number::before {
    content: "";
    width: 0;
    height: 0;
    border-top: 3px solid transparent;
    border-bottom: 3px solid transparent;
    border-left: 15px solid #777;
    position: absolute;
    margin-top: 1px;
    margin-left: -20px;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-enter {
    transition: opacity 0.2s ease;
}

.lightbox-enter-start {
    opacity: 0;
}

.lightbox-leave {
    transition: opacity 0.2s ease;
}

.lightbox-leave-end {
    opacity: 0;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    opacity: 0.5;
    padding: 2rem 1rem;
    z-index: 10;
}

.lightbox-prev {
    left: 0;
}

.lightbox-next {
    right: 0;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image-wrapper {
    position: relative;
    display: inline-block;
}

.lightbox-image-wrapper img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    display: block;
}

.lightbox-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, .25) 50%, rgba(0, 0, 0, .75) 75%, rgba(0, 0, 0, .95) 100%);
    padding: 12.5rem 1.25rem 1.25rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.lightbox-image-wrapper:hover .lightbox-overlay {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-overlay-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    max-width: 60%;
}

.lightbox-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
}

.lightbox-description {
    margin: 0;
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.4;
}

.lightbox-overlay-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    text-align: right;
}

.lightbox-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-end;
}

.lightbox-tags .tag {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.lightbox-tags .tag:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox-date {
    font-size: 0.8rem;
    color: #aaa;
}

.lightbox-counter {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    color: #666;
}

/* Footer */
.site-footer {
    border-top: 1px solid #222;
    padding: 2rem 0;
    text-align: center;
    color: #555;
}

/* Utility: Hide */
[x-cloak] {
    display: none !important;
}
