:root {
    --bg: #ffffff;
    --text: #333333;
    --heading: #333333;
    --accent: #2b6cb0;
    --secondary: #666666;
    --border: #dddddd;
    --card-background: #f8f9fa;
    --text-secondary: #666666;
}

[data-theme="dark"] {
    --bg: #262335;
    --text: #ffffff;
    --heading: #ff7edb;
    --accent: #2de2e6;
    --secondary: #a2a1a6;
    --border: #3b3354;
    --card-background: rgb(32, 30, 45);
    --text-secondary: #a2a1a6;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    color: var(--text);
    background: var(--bg);
    transition: all 0.3s ease;
}

header {
    border-bottom: 2px solid var(--accent);
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    position: relative;
}

h1 {
    margin: 0;
    font-size: 2.5rem;
    line-height: 1.1;
}

h2 {
    margin: 0.25rem 0 0 0;
    font-size: 1.25rem;
    color: var(--secondary);
    font-weight: normal;
}

@media (max-width: 768px) {
    body {
        padding: 1.5rem 1rem;
    }

    header {
        padding-right: 0;
    }
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.post-date {
    color: var(--secondary);
    font-size: 0.9rem;
}

footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.9rem;
    color: var(--secondary);
}

/* Theme toggle slider */
.theme-toggle {
    width: 56px;
    height: 28px;
    border-radius: 9999px;
    padding: 4px;
    background-color: var(--bg);
    border: 1px solid var(--text);
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    position: relative;
    display: inline-block;
    outline: none;
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.theme-toggle-slider {
    width: 20px;
    height: 20px;
    border-radius: 9999px;
    background-color: var(--text);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateX(0);
    transition: transform 0.3s ease, background-color 0.3s ease;
}

[data-theme="dark"] .theme-toggle-slider {
    transform: translateX(28px);
}

.theme-toggle-icon {
    position: absolute;
    top: 6px;
    width: 16px;
    height: 16px;
}

.theme-toggle-sun {
    left: 6px;
    color: #eab308;
}

.theme-toggle-moon {
    right: 6px;
    color: #60a5fa;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
}

h1 a {
    color: var(--heading) !important;
    text-decoration: none;
}

article {
    background: color-mix(in srgb, var(--bg) 97%, var(--accent));
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

article h3 {
    margin-top: 0;
    margin-bottom: 0;
    color: var(--heading);
}

/* Post content headings with underline decorations */
.post-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.post-content h2::after {
    content: '';
    display: block;
    width: 50%;
    height: 1px;
    background: var(--border);
    margin: 0.4rem 0 0;
}

.post-content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--secondary);
}

.post-content h3::after {
    content: '';
    display: block;
    width: 40%;
    height: 1px;
    background: var(--border);
    margin: 0.4rem 0 0;
}

.post-content h4::after {
    content: '';
    display: block;
    width: 30%;
    height: 1px;
    background: var(--border);
    margin: 0.4rem 0 0;
}

/* Image Handling */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
    margin: 0;
}

.image-gallery figure {
    margin: 0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    transition: transform 0.2s ease;
}

.image-gallery figure:hover {
    transform: scale(1.02);
}

.image-gallery img {
    display: block;
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.image-gallery figcaption {
    padding: 0.5rem;
    text-align: center;
    color: var(--text);
    background: var(--bg);
    font-size: 0.9rem;
}

/* Single image styling */
.post-content img {
    max-width: 100%;
    border-radius: 8px;
}

.post-content figure {
    margin: 1.5rem 0;
}

.post-content figcaption {
    text-align: center;
    color: var(--secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Post Excerpt */
.post-excerpt {
    margin: 0;
}

.read-more {
    margin: 0;
}

/* Post meta information styling */
.post-meta {
    margin: 0.3rem 0 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

/* Archive Navigation */
.archive-nav {
    padding: 1rem;
    background: color-mix(in srgb, var(--bg) 97%, var(--accent));
    border-radius: 8px;
    border: 1px solid var(--border);
}

.archive-nav h3 {
    margin-top: 0;
    font-size: 1.2rem;
}

.archive-nav details {
    margin: 0.5rem 0;
}

.archive-nav summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 500;
}

.archive-nav ul {
    list-style: none;
    padding-left: 1rem;
    margin: 0.5rem 0;
}

.archive-nav li {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.archive-nav li a {
    display: block;
    color: var(--text);
    text-decoration: none;
}

.archive-nav li a:hover {
    color: var(--accent);
}

/* Post Navigation */
.post-nav {
    margin-bottom: 2rem;
}

.back-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: var(--bg);
    border-radius: 4px;
    text-decoration: none;
    transition: transform 0.1s ease;
}

.back-button:hover {
    transform: scale(1.05);
    text-decoration: none;
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.previous-post,
.next-post {
    max-width: 45%;
}

.next-post {
    text-align: right;
}

/* Layout */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 2rem;
    margin-bottom: 2rem;
}

.content {
    min-width: 0;
}

.sidebar {
    position: sticky;
    top: 1rem;
    align-self: start;
}

/* Responsive layout */
@media (max-width: 768px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        margin-top: 2rem;
    }
}

/* Site Intro */
.site-intro {
    background: color-mix(in srgb, var(--bg) 97%, var(--accent));
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.site-intro p {
    margin: 0;
    font-size: 1.1rem;
}

.post-preview {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    padding: 1rem;
    background: color-mix(in srgb, var(--bg) 97%, var(--accent));
    border-radius: 8px;
    border: 1px solid var(--border);
}

.post-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.post-excerpt {
    margin: 0;
}

.post-image {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.post-image img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .post-image img {
        width: 40px;
        height: 40px;
    }
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.social-icons a:hover {
    color: #E1306C;
    text-decoration: none;
}

.social-icons p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.social-icon {
    width: 20px;
    height: 20px;
    color: currentColor;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.title-section {
    flex: 1;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .header-controls {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Tags */
.post-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: 0.75rem;
}

.tag-pill {
    display: inline-block;
    padding: 0.15em 0.6em;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--bg);
    border: 1px solid var(--accent);
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tag-pill:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

.tag-pill-active {
    background: var(--accent);
    color: #fff;
}

.tag-pill-large {
    font-size: 1.1rem;
    padding: 0.3em 1em;
}

/* Fave Kombis sidebar */
.fave-kombis {
    padding: 1rem;
    background: color-mix(in srgb, var(--bg) 97%, var(--accent));
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.fave-kombis h3 {
    margin-top: 0;
    font-size: 1.2rem;
}

.kombi-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.kombi-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.kombi-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.kombi-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kombi-type {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.kombi-links {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.kombi-links a {
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.kombi-links a:hover {
    color: var(--accent);
    text-decoration: none;
}

.kombi-social-icon {
    width: 18px;
    height: 18px;
}

/* Sidebar tags */
.tags-nav {
    padding: 1rem;
    background: color-mix(in srgb, var(--bg) 97%, var(--accent));
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

.tags-nav h3 {
    margin-top: 0;
    font-size: 1.2rem;
}

.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* Tag page */
.tag-page-header {
    margin-bottom: 2rem;
}

.tag-page-header h1 {
    margin: 1rem 0 0.5rem;
}

.tag-page-count {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}
