:root {
    --color-text: #000000;
    --color-text-hover: rgba(0, 0, 0, 0.5);
    --color-text-muted: rgba(0, 0, 0, 0.4);
    --color-bg: #ffffff;
    --color-border: rgba(0, 0, 0, 0.1);
    --spacing-unit: 1.5rem;
    --nav-width: 224px;
}

html {
    font-family:
        -apple-system, BlinkMacSystemFont, "avenir next", avenir,
        "helvetica neue", helvetica, ubuntu, roboto, noto, "segoe ui", arial,
        sans-serif;
    font-size: 16px;
    line-height: 1.4;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body {
    font-variant-ligatures: common-ligatures;
    font-feature-settings: "liga";
    background: var(--color-bg);
    color: var(--color-text);
    word-wrap: break-word;
    margin: 0 auto;
    max-width: 100%;
}

body.position-left {
    padding-left: calc(var(--spacing-unit) + var(--nav-width));
}

body.position-left .navigation-container {
    left: 0;
}

.navigation-container {
    position: fixed;
    top: 0;
    width: var(--nav-width);
    height: 100vh;
    padding: var(--spacing-unit);
}

.navigation a.index-link {
    font-weight: 600;
    flex-shrink: 0;
    flex-grow: 0;
}

.navigation a {
    display: block;
    text-indent: calc(1.5 * -0.5rem);
    padding-left: calc(1.5 * 0.5rem);
    color: inherit;
    text-decoration: none;
    transition: color 0.1s;
}

.navigation a:hover,
.navigation a:focus,
.navigation a.light {
    color: var(--color-text-hover);
}

.navigation a.light:hover {
    opacity: 0.85;
}

.social-links {
    padding-top: 1.5rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    margin-left: 0;
}

.social-links a {
    padding-left: 0.5rem;
}

.social-links a:first-child {
    padding-left: 0;
}

.social-links a {
    display: block;
    color: var(--color-text-muted);
    transition: color 0.1s;
    text-decoration: none;
    line-height: 0;
}

.social-links a:hover {
    color: rgba(0, 0, 0, 0.8);
}

.social-links svg {
    display: block;
}

.entry {
    display: flex;
}



.entry.compact + .posts {
    margin-top: -1rem;
}

.entry .contents {
    padding: 1.5rem;
    margin: 0;
    width: 1200px;
    max-width: 100%;
}

.entry h1 {
    font-size: 2em;
    margin: 0em 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.entry p {
    margin: 1.3em 0;
}

.entry a {
    color: inherit;
}

.entry h1 a {
    text-decoration: none;
}

.entry a:hover {
    color: var(--color-text-hover);
}

.entry .content-photo {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    display: block;
}

.posts {
    display: flex;
    flex-wrap: wrap;
    padding: 1rem;
    padding-right: 1.5rem;
    overflow: hidden;
}

.posts.inline {
    padding: 0;
    margin-top: 1rem;
    display: block;
}

.posts.inline .post {
    display: inline-block;
    margin: 0.5rem 0.5rem 0.5rem 0;
    max-width: 100% !important;
    max-height: none !important;
    width: auto !important;
    flex-grow: 0 !important;
}

.posts.inline .post i {
    display: none;
}

.posts.inline .post img {
    position: static;
    max-width: 100%;
    width: auto;
    height: auto;
}

.post {
    margin: 0.5rem;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.post.photo {
    cursor: zoom-in;
}

.post.photo .title {
    font-size: 0.875em;
    text-align: left;
    display: block;
    margin: calc(1.5rem / 4) 0 calc(1.5rem / 2);
}

.post:hover {
    opacity: 0.93;
}

.post:active {
    opacity: 0.87;
}

/* Default: stacked layout for all screen sizes */
.post i {
    display: none;
}

.post img {
    position: static;
    width: 100%;
    height: auto;
    vertical-align: bottom;
}

.posts .post.photo {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: none;
    flex-grow: 0;
    margin: 0 0 1rem 0;
}

/* Justified layout only on large screens */
@media screen and (min-width: 1000px) {
    .posts {
        display: flex;
        flex-wrap: wrap;
    }

    .posts .post.photo {
        display: block;
        margin: 0.5rem;
    }

    .post i {
        display: block;
    }

    .post img {
        position: absolute;
        top: 0;
        width: 100%;
        height: auto;
    }
}

/* Blog post list */
.blog-list {
    padding: 1.5rem;
}

.blog-entry {
    margin-bottom: 2rem;
}

.blog-entry h2 {
    font-size: 1.4em;
    margin: 0 0 0.25rem;
}

.blog-entry h2 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.1s;
}

.blog-entry h2 a:hover {
    color: var(--color-text-hover);
}

.blog-entry .meta {
    color: var(--color-text-muted);
    font-size: 0.875em;
    margin: 0 0 0.5rem;
}

.blog-entry .excerpt {
    margin: 0.5em 0;
}

.blog-entry .read-more,
.entry .blog-entry .read-more {
    color: rgba(0, 0, 0, 0.4) !important;
    text-decoration: none;
    transition: color 0.1s;
}

.blog-entry .read-more:hover,
.entry .blog-entry .read-more:hover {
    color: rgba(0, 0, 0, 0.7) !important;
}

/* Blog post detail */
.entry .post-content {
    line-height: 1.7;
}

.entry .post-content img {
    max-width: 100%;
    height: auto;
}

.entry .featured-image {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
}

.entry .back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: inherit;
    text-decoration: none;
    transition: color 0.1s;
}

.entry .back-link:hover {
    color: var(--color-text-hover);
}

/* Album grid on gallery page */
.album-grid {
    padding: 0 1.5rem 1.5rem 1.5rem;
}

.album-item {
    margin-bottom: 2rem;
}

.album-grid.compact {
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.album-grid.compact .album-item {
    margin-bottom: 0;
}

.album-preview-single img {
    width: 320px;
    height: 320px;
    object-fit: cover;
    margin-top: 0.5rem;
    transition: opacity 0.1s;
}

.album-preview-single:hover img {
    opacity: 0.8;
}

.album-item a {
    color: inherit;
    text-decoration: none;
    transition: color 0.1s;
}

.album-item a:hover {
    color: var(--color-text-hover);
}

.album-item h2 {
    font-size: 1.4em;
    margin: 0 0 0.25rem;
}

.album-item .meta {
    color: var(--color-text-muted);
    font-size: 0.875em;
}

.album-item .cover {
    max-width: 100%;
    height: auto;
    margin-top: 0.5rem;
}

input[name="toggle"] {
    display: none;
}

label[for="toggle"] {
    line-height: 0.333;
    cursor: pointer;
    display: block;
    float: right;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

@media screen and (min-width: 800px) {
    label[for="toggle"] {
        display: none;
    }
}

@media screen and (max-width: 800px) {
    .nav:last-of-type > a:first-of-type {
        visibility: hidden;
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s;
}

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

.lightbox-close {
    top: 0;
    right: 0;
    font-size: 3rem;
}

.lightbox-prev {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4rem;
}

.lightbox-next {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 4rem;
}

/* Album preview photos on gallery page */
.album-preview {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.album-preview::-webkit-scrollbar {
    display: none;
}

.album-preview .preview-photo {
    flex-shrink: 0;
}

.album-preview .preview-photo img {
    height: 320px;
    width: auto;
    object-fit: cover;
    transition: opacity 0.1s;
}

.album-preview .preview-photo:hover img {
    opacity: 0.8;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: var(--spacing-unit);
}

.pagination-prev,
.pagination-next {
    color: inherit;
    text-decoration: none;
    transition: color 0.1s;
}

.pagination-prev:hover,
.pagination-next:hover {
    color: var(--color-text-hover);
}

.pagination-info {
    color: var(--color-text-muted);
}

/* Footer */
.site-footer {
    padding: 2rem 1.5rem;
    text-align: left;
    color: var(--color-text-muted);
    font-size: 0.875em;
}

.site-footer p {
    margin: 0;
}

@media screen and (max-width: 800px) {
    body {
        padding-top: 4rem;
    }

    body.position-left {
        padding-left: 0;
    }

    body.position-right {
        padding-right: 0;
    }

    .navigation-container {
        width: 100%;
        height: auto;
        display: flex;
        justify-content: space-between;
        box-sizing: border-box;
        z-index: 1;
        background: #ffffff;
    }

    .navigation-container label[for="toggle"] {
        margin-left: auto;
    }

    .navigation {
        height: 2rem;
    }

    input[name="toggle"]:checked + .navigation {
        min-height: 100vh;
    }

    input[name="toggle"] + .navigation > *:not(.index-link) {
        display: none;
    }

    input[name="toggle"]:checked + .navigation > *:not(.index-link) {
        display: block;
    }

    input[name="toggle"]:checked + .navigation .social-links {
        display: flex;
    }

    .entry {
        padding: 0 0;
    }

    .nav:last-of-type > a:first-of-type {
        visibility: hidden;
    }
}
