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

/* Variables */
:root {
    --text: #333;
    --bg: #fcfbf7;
    --accent: #44755c;
    --accent-light: #b7cfbc;
    --light-gray: #f2f1eb;
    --mid-gray: #878778;
    --dark-gray: #555550;
}

/* Base styles */
html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family: "Libre Baskerville", Georgia, "Times New Roman", serif;
    color: var(--text);
    background: var(--bg);
    max-width: 42rem;
    margin: 0 auto;
    padding: 1rem;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Lora", Georgia, serif;
    margin: 1.5rem 0 0.75rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    font-weight: 700;
}

h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.4rem;
}

h4,
h5,
h6 {
    font-size: 1.1rem;
}

p,
ul,
ol {
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

blockquote {
    margin: 1.5rem 0;
    padding: 0.5rem 0 0.5rem 1.5rem;
    border-left: 3px solid var(--accent-light);
    font-style: italic;
    color: var(--dark-gray);
}

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

a:hover {
    text-decoration: underline;
}

/* Header */
header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

/* Header container */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Hamburger menu button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--accent);
    position: relative;
    transition: background-color 0.3s;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--accent);
    transition: transform 0.3s;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

/* Menu toggle animation */
.menu-open .hamburger {
    background-color: transparent;
}

.menu-open .hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.menu-open .hamburger::after {
    transform: rotate(-45deg);
    bottom: 0;
}

/* Responsive navigation */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-out;
    }

    .main-nav.show {
        display: block;
        max-height: 500px;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        margin-top: 1rem;
    }

    nav ul li {
        width: 100%;
        padding: 0.75rem 0;
        border-top: 1px solid var(--light-gray);
    }

    nav ul li:first-child {
        border-top: none;
    }

    nav ul li a {
        display: block;
        padding: 0.25rem 0;
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    .main-nav {
        display: block !important;
        max-height: none !important;
    }
}

.site-title {
    text-decoration: none;
}

.site-title h1 {
    color: var(--accent);
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    list-style: none;
    margin-top: 1rem;
}

/* Main content */
article header {
    margin-bottom: 2rem;
}

article header h1 {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* Global list adjustments - tighter spacing */
article ul,
article ol,
.content ul,
.content ol,
.page-content ul,
.page-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

article li,
.content li,
.page-content li {
    margin-bottom: 0.5rem;
    /* Tighter spacing */
}

/* Nested lists */
article li>ul,
article li>ol,
.content li>ul,
.content li>ol,
.page-content li>ul,
.page-content li>ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Preserve posts list spacing - special case */
ul.posts-list {
    list-style: none;
    padding-left: 0;
}

ul.posts-list li {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
}

time {
    color: var(--mid-gray);
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.post-meta {
    margin-bottom: 0.75rem;
}

/* First paragraph styling for storytelling */
article p:first-of-type {
    font-size: 1.15rem;
    line-height: 1.7;
}

/* Taxonomy (tags, categories) */

.taxonomy.tags {
    margin-top: 0.75rem;
}

.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    background: var(--light-gray);
    border-radius: 3px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--dark-gray);
}

.tag:hover {
    background: #e5e5e5;
    text-decoration: none;
}

/* Code */
pre {
    padding: 1rem;
    overflow-x: auto;
    background: var(--light-gray);
    border-radius: 4px;
    margin: 1.5rem 0;
}

code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.9rem;
}

p code {
    background: var(--light-gray);
    padding: 0.15rem 0.3rem;
    border-radius: 3px;
}

/* Media */
img,
video {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

figure {
    margin: 2rem 0;
}

figcaption {
    margin-top: 0.5rem;
    color: var(--mid-gray);
    font-size: 0.9rem;
    text-align: center;
}

.embed-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 1.5rem 0;
}

.embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.post-banner {
    width: 100%;
    height: auto;
    object-fit: cover;
    margin: 1rem 0 1.5rem 0;
}

/* Posts list */
.posts-list {
    list-style: none;
}

.posts-list li {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 2rem;
}

/* Content lists - tighter spacing */
.content ul,
.content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.content li {
    margin-bottom: 0.5rem;
    /* Reduced from default */
}

/* Nested lists */
.content li>ul,
.content li>ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    color: var(--accent);
    line-height: 1.2;
}

.post-date {
    color: var(--mid-gray);
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

.post-excerpt {
    margin: 1rem 0;
}

/* Search styles */
.search-container {
    margin: 2rem 0;
}

.search-form {
    display: flex;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 4px 0 0 4px;
    font-family: inherit;
}

.search-button {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-family: inherit;
}

.search-button:hover {
    background: var(--accent-light);
    color: var(--text);
}

.search-results {
    margin-top: 1.5rem;
}

.search-result {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--light-gray);
}

.search-result:last-child {
    border-bottom: none;
}

.search-result-title {
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.search-result-date {
    color: var(--mid-gray);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.search-highlight {
    background-color: rgba(183, 207, 188, 0.3);
    padding: 0 0.2rem;
}

/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
    color: var(--dark-gray);
    font-size: 0.9rem;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.rss-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Media queries */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    body {
        padding: 0.75rem;
    }

    nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input {
        border-radius: 4px;
        margin-bottom: 0.5rem;
    }

    .search-button {
        border-radius: 4px;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
}

.prev-page,
.next-page {
    padding: 0.5rem 1rem;
    background: var(--light-gray);
    border-radius: 4px;
    text-decoration: none;
}

.prev-page:hover,
.next-page:hover {
    background: var(--accent-light);
    text-decoration: none;
}

.page-number {
    color: var(--mid-gray);
    font-size: 0.9rem;
}

/* Posts list - keep as is for homepage */
.posts-list {
    list-style: none;
}

.posts-list li {
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--light-gray);
    padding-bottom: 2rem;
}

/* Content lists - tighter spacing */
.content ul,
.content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.25rem;
}

.content li {
    margin-bottom: 0.5rem;
    /* Reduced from default */
}

/* Nested lists */
.content li>ul,
.content li>ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Taxonomy list pages */
.taxonomy-list-page {
    margin-bottom: 3rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 2rem 0;
}

.tag-cloud .tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--light-gray);
    border-radius: 3px;
    transition: background 0.2s;
}

.tag-cloud .tag:hover {
    background: var(--accent-light);
    text-decoration: none;
}

.tag .count,
.category .count {
    color: var(--mid-gray);
    font-size: 0.85em;
}

.categories-list {
    margin: 2rem 0;
}

.categories-list ul {
    list-style: none;
    padding-left: 0;
}

.categories-list li {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--light-gray);
}

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

.category {
    font-size: 1.1rem;
}

/* Category styling */
.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.post-categories a.category {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.8rem;
    background-color: var(--accent-light);
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 3px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-style: normal;
    font-weight: 500;
}

.post-categories a.category:hover {
    background-color: var(--accent);
    color: white;
    text-decoration: none;
}