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

.content {
  flex: 1;
  padding: 20px 0;
}

.blog-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.blog {
    flex: 3;
    min-width: 0;
}

.post {
    background-color: var(--blog-card-bg);
    padding: 20px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--blog-border);
    box-shadow: 0 2px 4px var(--blog-card-shadow);
    border-radius: 4px;
}

.secondary a {
    color: var(--blog-link);
    text-decoration: underline;
}

.secondary a:hover {
    color: var(--blog-link-hover);
    text-decoration: none;
}

#sidebar {
    flex: 1;
    max-width: 300px;
    padding: 20px;
    background-color: var(--blog-card-bg);
    border-left: 1px solid var(--blog-border);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--blog-card-shadow);
    font-size: 0.9rem;
}

#sidebar h2,
#sidebar h3 {
    margin-top: 1vh;
    color: var(--blog-text);
}

#sidebar h2 a {
    color: var(--blog-text);
    text-decoration: none;
}

/* Search box + RSS link share the top row of the sidebar */
.sidebar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sidebar-search .search-form {
    display: flex;
    flex: 1;
    min-width: 0;
    gap: 0.25rem;
    margin: 0;
}

.sidebar-search .search-form input[type="text"] {
    flex: 1;
    min-width: 0;
    width: auto;
    margin: 0;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--blog-border);
    border-radius: 999px;
    background-color: var(--background-primary);
    color: var(--blog-text);
}

.sidebar-search .search-form input[type="submit"] {
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background-color: var(--accent-primary);
    color: var(--nav-text);
}

.sidebar-search .search-form input[type="submit"]:hover {
    background-color: var(--blog-link-hover);
}

.rss-link {
    flex-shrink: 0;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    background-color: var(--highlight);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.rss-link:hover {
    color: var(--text-primary);
    opacity: 0.85;
}

/* Blog index cards */
.post-card {
    margin-bottom: 1.25rem;
    border-radius: 8px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.post-card:hover {
    border-color: var(--accent-primary);
}

.post-card-title {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
    line-height: 1.3;
}

.post-card-title a {
    color: var(--blog-text);
    text-decoration: none;
}

.post-card-title a:hover {
    color: var(--blog-link);
}

.post-card-meta {
    margin: 0 0 0.75rem;
    color: var(--blog-meta);
    font-size: 0.85rem;
}

.post-card-excerpt {
    margin: 0.75rem 0 0;
    color: var(--blog-text);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .post-actions {
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.post-card .post-actions > a:first-child {
    color: var(--blog-link);
    font-weight: 600;
}

/* Tag pills */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Comment form styling */
#comment-form {
    margin: 2em 0;
    padding: 1em;
    background: var(--blog-card-bg);
    border: 1px solid var(--blog-border);
    border-radius: 4px;
}

#comment-form p {
    margin-bottom: 1em;
    color: var(--blog-text);
}

#comment-form label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: bold;
    color: var(--blog-text);
}

#comment-form input[type="text"],
#comment-form textarea {
    width: 100%;
    padding: 0.5em;
    border: 1px solid var(--blog-border);
    border-radius: 4px;
    background-color: var(--background-primary);
    color: var(--blog-text);
}

#comment-form .errorlist {
    color: var(--accent-secondary);
    font-size: 0.9em;
    margin: 0.25em 0;
    padding-left: 0;
    list-style: none;
}

.comment-login-prompt {
    margin: 2rem 0;
    padding: 1rem;
    background: var(--blog-card-bg);
    border: 1px solid var(--blog-border);
    border-radius: 4px;
    text-align: center;
    color: var(--blog-text);
}

.comment-login-prompt a {
    color: var(--blog-link);
    text-decoration: none;
    font-weight: 500;
}

.comment-login-prompt a:hover {
    color: var(--blog-link-hover);
    text-decoration: underline;
}

/* Other styles remain the same but using variables */
.form-field {
    margin-bottom: 1.5em;
}

.form-field label {
    display: block;
    margin-bottom: 0.5em;
    font-weight: bold;
    color: var(--blog-text);
}

.form-field input[type="text"],
.form-field textarea {
    width: 100%;
    padding: 0.75em;
    border: 1px solid var(--blog-border);
    border-radius: 4px;
    font-size: 1em;
    background-color: var(--background-primary);
    color: var(--blog-text);
}

.form-field .help-text {
    display: block;
    margin-top: 0.25em;
    color: var(--blog-meta);
    font-size: 0.9em;
}

.button {
    background-color: var(--accent-primary);
    color: white;
    padding: 0.75em 1.5em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.button:hover {
    background-color: var(--blog-link-hover);
}

.error-list {
    list-style: none;
    padding-left: 0;
    margin-top: 0.5em;
}

.error-list li {
    color: #cc0000;
    margin-bottom: 0.25em;
}

.alert {
    padding: 1em;
    margin: 1em 0;
    border-radius: 4px;
}

.alert-success {
    background: #e6ffe6;
    color: #006600;
}

.alert-error {
    background: #ffe6e6;
    color: #cc0000;
}

.form-actions {
    margin-top: 1.5em;
}

/* Like button styling */
.like-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
    transition: transform 0.2s;
    color: var(--blog-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.like-button:hover {
    transform: scale(1.2);
}

.like-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.likes-count {
    font-size: 0.9em;
    color: var(--blog-text);
}

.post-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .blog-layout {
        flex-direction: column;
    }

    #sidebar {
        max-width: none;
        border-left: none;
        border-top: 1px solid var(--blog-border);
        margin-top: 2rem;
    }
}
