:root {
    --bg: #f8f8f8;
    --text: #222;
    --accent: #444;
    --hero-bg: #fff;
    --border: #ddd;
    --nav-bg: #f8f8f8;
    --highlight: #000;
    --img-placeholder: #eaeaea;
    --gallery-columns: 3;
    --gallery-gutter: 16px;
}

@media (max-width: 900px) {
    :root {
        --gallery-columns: 2;
    }
}

@media (max-width: 600px) {
    :root {
        --gallery-columns: 1;
    }
}

body.dark {
    --bg: #1e1e1e;
    --text: #e4e4e4;
    --accent: #aaa;
    --hero-bg: #2b2b2b;
    --border: #444;
    --nav-bg: #1e1e1e;
    --highlight: #fff;
    --img-placeholder: #2a2a2a;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    max-width: 760px;
    margin: 0 auto;
    padding: 2rem;
    transition: background 0.3s ease, color 0.3s ease;
}

h1,
h2,
h3 {
    font-weight: 600;
    color: var(--highlight);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.2rem;
}

a {
    color: var(--highlight);
    text-decoration: underline;
}

.hero {
    background: var(--hero-bg);
    padding: 2rem;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-top: -2rem;
    margin-bottom: 4rem;
}

.card {
    background: var(--hero-bg);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.6s ease;
    opacity: 0;
    transform: translateY(20px);
}

.card.revealed {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.entry-separator {
    margin: 1rem auto;
    text-align: center;
    font-size: 1.2rem;
    color: var(--border);
}

.gallery {
    width: 100%;
    margin: 0;
}

.gallery-grid {
    margin-top: 2rem;
    display: block;
    /* not grid */
    width: 100%;
}

.grid-sizer,
.gallery-item {
    width: calc((100% - (var(--gallery-columns) - 1) * var(--gallery-gutter)) / var(--gallery-columns));
}

@media (max-width: 900px) {

    .grid-sizer,
    .gallery-item {
        width: calc(50% - 8px);
        /* 2 columns */
    }
}

@media (max-width: 600px) {

    .grid-sizer,
    .gallery-item {
        width: 100%;
        /* 1 column */
    }
}

.gallery-item {
    position: relative;
    /*width: 100%;
    max-width: 300px;*/
    margin-bottom: var(--gallery-gutter);
    border-radius: 6px;
    overflow: hidden;
    background: var(--img-placeholder);
    animation: pulse 1.5s infinite ease-in-out;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.gallery-item img.loaded {
    opacity: 1;
}

.img-wrapper {
    background: var(--img-placeholder);
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    transition: background 0.4s ease;
}

.img-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.img-wrapper img.loaded {
    opacity: 1;
}

.img-wrapper.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

body.dark .img-wrapper.loading {
    animation: pulse-dark 1.5s ease-in-out infinite;
}

.ck-content figure.image {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 1.5rem 0;
}

.ck-content figure.image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    max-width: 100%;
}

.ck-content .img-wrapper {
    display: block;
    width: 100%;
    max-width: 100%;
    background: var(--img-placeholder);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.ck-content .img-wrapper img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.ck-content .img-wrapper img.loaded {
    opacity: 1;
}

.ck-content .image-style-align-left,
.ck-content .image-style-align-center,
.ck-content .image-style-align-right {
    all: unset;
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--highlight);
    color: var(--bg);
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 50%;
    text-decoration: none;
    display: none;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.back-to-top:hover {
    opacity: 0.8;
}

body.scrolled .back-to-top {
    display: block;
}

.nav-toggle {
    position: fixed;
    top: 2rem;
    left: 0;
    background: #e2e2e2;
    color: #555;
    font-size: 1.3rem;
    font-weight: bold;
    padding: 0.4rem 0.8rem;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border: none;
    cursor: pointer;
    z-index: 1001;
    box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, background 0.2s ease, color 0.2s ease;
}

body.nav-open .nav-toggle {
    transform: translateX(260px);
}

.slide-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100%;
    background: var(--bg);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.05);
    padding: 2rem 1.5rem;
    overflow-y: auto;
    transform: translateX(-95%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

body.nav-open .slide-nav {
    transform: translateX(0);
}

.slide-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.slide-nav li {
    margin-bottom: 1rem;
}

.slide-nav a {
    color: var(--accent);
    font-size: 0.95rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dark-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--accent);
    cursor: pointer;
    z-index: 1000;
}

@keyframes pulse {

    0%,
    100% {
        background-color: #eaeaea;
    }

    50% {
        background-color: #dcdcdc;
    }
}

@keyframes pulse-dark {

    0%,
    100% {
        background-color: #2a2a2a;
    }

    50% {
        background-color: #3a3a3a;
    }
}