/* Gruvbox Dark */
:root {
    --bg: #282828;
    --bg1: #3c3836;
    --bg2: #504945;
    --bg3: #1d2021;
    --fg: #ebdbb2;
    --fg2: #fbf1c7;
    --muted: #928374;
    --blue: #83a598;
    --green: #b8bb26;
    --yellow: #fabd2f;
    --purple: #d3869b;
    --border: #504945;
    --border-accent: #83a598;
    --radius: 4px;
    --radius-lg: 8px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
}

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

/* Base */
html {
    font-family: "Lato", sans-serif;
    font-weight: 400;
    font-style: normal;
}

body {
    padding: var(--space-xl) 5vw;
    color: var(--fg);
    background: var(--bg);
    line-height: 1.5em;
    font-size: 1.1em;
}

a {
    color: var(--blue);
    font-weight: bold;
    text-decoration: none;
}

a:hover {
    color: var(--purple);
}

/* Layout */
.wrapper {
    width: min(800px, 100%);
    margin: 0 auto;
}

/* Header / Nav */
.header {
    width: 100%;
    margin-bottom: var(--space-xl);
    border-bottom: 4px dashed var(--border-accent);
    padding-bottom: var(--space-xl);
}

.header .name {
    font-size: 3em;
    line-height: normal;
    color: var(--green);
    font-weight: bold;
    text-align: center;
    margin-bottom: var(--space-md);
}

.header .name a {
    color: inherit;
}

.header nav {
    text-align: center;
}

.header nav a {
    margin: 0 var(--space-sm);
    font-size: 0.9em;
}

/* Main */
main {
    min-height: 60vh;
}

h1 {
    font-size: 2em;
    margin-bottom: var(--space-md);
    color: var(--fg);
}

h2 {
    font-size: 1.5em;
    margin-bottom: 12px;
    color: var(--purple);
}

p {
    margin-bottom: 15px;
}

time {
    display: block;
    color: var(--muted);
    font-size: 0.9em;
    margin-bottom: var(--space-md);
}

/* Tags (inline pills) */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.tags a {
    background: var(--blue);
    color: var(--bg);
    padding: 2px 10px;
    border-radius: var(--radius);
    font-size: 0.85em;
    font-weight: normal;
}

.tags a:hover {
    background: var(--purple);
    color: var(--bg);
}

/* Post List */
ul {
    list-style: none;
}

ul li {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px dashed var(--border);
}

ul li:last-child {
    border-bottom: none;
}

ul li a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

ul li img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius);
    flex-shrink: 0;
}

.post-item-text {
    display: flex;
    flex-direction: column;
}

.post-item-title {
    font-weight: bold;
}

/* Image Viewer (Post Page) */
.post-images {
    margin: var(--space-lg) 0;
}

.image-viewer {
    position: relative;
    background: var(--bg3);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.image-slide {
    display: none;
    text-align: center;
}

.image-slide.active {
    display: block;
}

.image-slide img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
}

.image-slide .caption {
    color: var(--fg);
    padding: 12px var(--space-md);
    margin: 0;
    font-size: 0.9em;
    opacity: 0.8;
}

.image-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px var(--space-md);
    background: var(--bg1);
}

.image-nav button {
    background: var(--green);
    color: var(--bg);
    border: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9em;
}

.image-nav button:hover {
    background: var(--yellow);
}

.image-counter {
    color: var(--fg);
    font-size: 0.9em;
    opacity: 0.7;
}

/* Post Content */
.post-content {
    margin-top: var(--space-lg);
}

.post-content img {
    border-radius: var(--radius-lg);
}

/* Gallery */
.gallery-image {
    margin-bottom: var(--space-lg);
}

.gallery-image img {
    width: 100%;
    border-radius: var(--radius-lg);
}

.gallery-image p {
    color: var(--muted);
    font-size: 0.9em;
    margin-top: var(--space-sm);
    margin-bottom: 0;
}

article {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 4px dashed var(--border-accent);
}

article:last-of-type {
    border-bottom: none;
}

article h2 {
    margin-bottom: var(--space-xs);
}

article time {
    margin-bottom: var(--space-md);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 4px dashed var(--border-accent);
}

.pagination a {
    background: var(--blue);
    color: var(--bg);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius);
}

.pagination a:hover {
    background: var(--purple);
    color: var(--bg);
}

/* Home Layout */
.home-layout {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: var(--space-xl);
}

.posts-column h2,
.tags-column h2 {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 2px solid var(--border-accent);
}

.tag-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 2px 0;
    border-bottom: 1px dashed var(--border);
}

.tag-list li:last-child {
    border-bottom: none;
}

.tag-list a {
    font-weight: normal;
}

.tag-list span {
    color: var(--muted);
    font-size: 0.85em;
}

/* Footer */
.footer {
    width: 100%;
    margin-top: var(--space-xl);
    padding-top: var(--space-xl);
    border-top: 4px dashed var(--border-accent);
    text-align: center;
    font-weight: bold;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 880px) {
    body {
        padding: 5vw;
    }
    .header {
        margin-bottom: 3vw;
        padding-bottom: 3vw;
    }
    .header .name {
        font-size: 8vw;
    }
    .home-layout {
        grid-template-columns: 1fr;
    }
}