/* Force light mode regardless of system preference */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #fff;
        --font-color: #151515;
        --invert-font-color: #fff;
        --primary-color: #1a95e0;
        --secondary-color: #727578;
        --error-color: #d20962;
        --progress-bar-background: #727578;
        --progress-bar-fill: #151515;
        --code-bg-color: #e8eff2;
    }
}

.image-grid {
    display: flex !important;
    gap: 8px;
    line-height: 0;
    height: auto;
    overflow: hidden;
}

.image-grid-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-grid a {
    display: block;
}

.image-grid img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0;
}

.album-grid {
    display: grid !important;
    column-count: unset;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    line-height: 0;
}

.album-grid a {
    display: block;
    margin-bottom: 0;
}

.album-title {
    line-height: normal;
    padding: 6px 0;
    display: block;
}

.gallery-image {
    max-height: 85vh;
    width: auto;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.photo-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0;
}

.photo-nav-btn {
    padding: 4px 0;
    text-decoration: none;
}

.photo-nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.photo-nav-disabled {
    opacity: 0.3;
}

.photo-blog-link {
    margin-top: 24px;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 4px;
}

.photo-blog-link a {
    text-decoration: none;
}

.post-content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.post-content > *:not(.post-photo-wrap) {
    flex: 0 0 100%;
}

.post-photo-wrap {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

.post-photo-thumb {
    width: 100%;
    height: auto;
    display: block;
}

.post-photo-link {
    display: block;
}

/* Hide italic captions that follow post images */
.post-photo-wrap + em {
    display: none;
}

/* Album flex grid */
.album-flex-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.album-item {
    display: block;
    line-height: 0;
}

.album-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.album-item--full {
    flex: 0 0 100%;
}

.album-item--half {
    flex: 0 0 calc(50% - 4px);
}

.album-item--third {
    flex: 0 0 calc(33.333% - 5.333px);
}

.footer .footer-inner {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.footer .footer-copyright {
    margin-left: auto;
}

.posts-list {
    padding-left: 0;
}

.posts-list .post {
    margin-bottom: 4px;
}

.posts-list .post:has(.date) {
    position: relative;
    padding-left: 130px;
}

.posts-list .post .date {
    position: absolute;
    left: 0;
    width: 130px;
}

/* Album preview on post pages */
.album-preview {
    margin-bottom: 24px;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.album-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.album-preview-title {
    font-weight: bold;
}

.album-preview-link {
    font-size: 0.85em;
    text-decoration: none;
}

.album-preview-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 6px;
    overflow: hidden;
}

.album-preview-thumb {
    display: block;
    line-height: 0;
}

.album-preview-thumb:nth-child(n+13) {
    display: none;
}

.album-preview-thumb img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .album-preview-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .album-preview-thumb:nth-child(n+7) {
        display: none;
    }
    .posts-list .post:has(.date) {
        padding-left: 0;
    }
    .posts-list .post .date {
        display: block;
        position: static;
        width: auto;
        margin-bottom: 4px;
    }
    .album-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .terminal-menu ul {
        justify-content: flex-end !important;
    }
}

@media (max-width: 480px) {
    .image-grid {
        flex-direction: column;
    }
    .album-grid {
        grid-template-columns: 1fr;
    }
    .album-item--half,
    .album-item--third {
        flex: 0 0 100%;
    }
}
