/* clutterlog styles */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #1a1a1a;
    color: #f0f0f0;
    min-height: 100vh;
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px 48px;
}

/* Header */

header {
    text-align: center;
    padding: 48px 16px 40px;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    color: #ffffff;
}

header p {
    font-size: 1.05rem;
    color: #888;
    font-weight: 400;
}

/* Grid */

#grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 4px;
}

/* Grid Item */

.grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background-color: #2a2a2a;
    cursor: pointer;
}

.grid-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.grid-item:hover img {
    transform: scale(1.05);
}

/* Overlay */

.grid-item .overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 14px 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0) 100%);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.grid-item:hover .overlay {
    transform: translateY(0);
}

.overlay .item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.overlay .item-description {
    font-size: 0.75rem;
    color: #ccc;
    line-height: 1.4;
}

.overlay .item-date {
    font-size: 0.65rem;
    color: #888;
    margin-top: 6px;
}

/* Footer */

footer {
    text-align: center;
    padding: 40px 16px 24px;
    color: #666;
    font-size: 0.85rem;
}

footer a {
    color: #888;
    text-decoration: none;
}

footer a:hover {
    color: #f0f0f0;
}

/* Responsive adjustments */

@media (max-width: 600px) {
    header {
        padding: 32px 12px 28px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    #grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 3px;
    }
}

/* Lightbox */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox[hidden] {
    display: none;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.lightbox-controls {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1010;
    display: flex;
    gap: 6px;
}

.lightbox-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #555;
    border-radius: 6px;
    background: rgba(30, 30, 30, 0.85);
    color: #ddd;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    padding: 0;
}

.lightbox-btn:hover {
    background: rgba(60, 60, 60, 0.95);
    color: #fff;
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1010;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1010;
    width: 48px;
    height: 80px;
    border: none;
    background: rgba(30, 30, 30, 0.6);
    color: #ccc;
    font-size: 2.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    border-radius: 8px;
    padding: 0;
    line-height: 1;
}

.lightbox-nav:hover {
    background: rgba(60, 60, 60, 0.85);
    color: #fff;
}

.lightbox-prev {
    left: 16px;
}

.lightbox-next {
    right: 16px;
}

.lightbox-content {
    position: relative;
    z-index: 1005;
    max-width: calc(100vw - 140px);
    max-height: calc(100vh - 100px);
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: calc(100vh - 100px);
    display: block;
    transform-origin: center center;
    transition: transform 0.15s ease;
}

.lightbox-content.zoomed {
    cursor: grab;
}

.lightbox-content.zoomed img,
.lightbox-content.zoomed video {
    max-width: none;
    max-height: none;
}

.lightbox-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1010;
    padding: 16px 80px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    text-align: center;
    pointer-events: none;
}

.lightbox-info .lightbox-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.lightbox-info .lightbox-date {
    font-size: 0.75rem;
    color: #999;
}

/* Lightbox responsive */

@media (max-width: 600px) {
    .lightbox-controls {
        top: 10px;
        left: 10px;
        gap: 4px;
    }

    .lightbox-btn {
        width: 32px;
        height: 32px;
        font-size: 0.95rem;
    }

    .lightbox-nav {
        width: 36px;
        height: 60px;
        font-size: 1.8rem;
    }

    .lightbox-prev {
        left: 6px;
    }

    .lightbox-next {
        right: 6px;
    }

    .lightbox-content {
        max-width: calc(100vw - 80px);
        max-height: calc(100vh - 80px);
    }

    .lightbox-content img,
    .lightbox-content video {
        max-height: calc(100vh - 80px);
    }

    .lightbox-info {
        padding: 12px 50px;
    }
}
