/* === Color Theme Variables === */
:root {
    --light-bg-color: #D9D8C7;
    --dark-bg-color: #101000;
    --light-text-color: black;
    --light-muted-text-color: #36393A;
    --light-highlight-text-color: #555;
    --light-link-color: #12607c;

    --dark-text-color: #FFFFF2;
    --dark-muted-text-color: #aaaaaa;
    --dark-highlight-text-color: #2596be;
    --dark-link-color: #2596be;
    --dark-mid-bg-color: #555;
}

@media (prefers-color-scheme: light) {
    :root {
        --primary-color: var(--light-bg-color);
        --text-color: var(--light-text-color);
        --muted-text-color: var(--light-muted-text-color);
        --hover-color: var(--light-highlight-text-color);
        --link-color: var(--light-link-color);
    }
}

@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: var(--dark-bg-color);
        --secondary-color: var(--dark-mid-bg-color);
        --text-color: var(--dark-text-color);
        --muted-text-color: var(--dark-muted-text-color);
        --hover-color: var(--dark-highlight-text-color);
        --link-color: var(--dark-link-color);
    }
}

/* === Base Typography and Layout === */
html,
body {
    height: 100%;
    margin: 0;
}

.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content {
    flex: 1;
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    font-size: clamp(16px, 1.8vw, 18px);
    line-height: 1.6;
}

.content {
    padding: 20px;
    margin: 0 auto;
    max-width: 1200px;
    width: 90%;
}

@media (max-width: 768px) {
    .content {
        width: 95%;
    }
}

.content h1 {
    text-align: center;
    font-size: clamp(24px, 4vw, 36px);
}

.content h2 {
    font-size: clamp(20px, 3vw, 28px);
}

.content p {
    margin-bottom: 1.2em;
}

.content .page-date {
    color: var(--muted-text-color);
    text-align: right;
}

/* === General Image Styling === */
.content img {
    width: var(--img-width, 100%);
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px 0;
}

/* === Gallery Styling === */
.gallery {
    display: grid;
    gap: 5px;
    padding: 10px;
}

.gallery-item {
    margin: 10px;
    box-sizing: border-box;
    text-align: center;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

figcaption {
    margin-top: 4px;
    font-size: 0.9em;
    color: var(--muted-text-color);
}

/* 4 columns on desktop */
@media (min-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 2 columns on smaller screens */
@media (max-width: 1023px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* === Link Styling === */
a {
    color: var(--link-color);
}