/*
Theme Name: Inkwell
Theme URI: https://github.com/inkwell/inkwell-theme
Author: Inkwell
Author URI: https://github.com/inkwell
Description: Inkwell 是一款左右布局的极简博客主题，左侧 20% 侧边栏 + 右侧 80% 内容区，全屏自适应。SEO 友好、打开速度快、安全性高。适合个人博客、随笔、技术分享。
Version: 1.0.0
Requires at least: 5.5
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: inkwell
Tags: blog, two-columns, left-sidebar, custom-logo, custom-menu, featured-images, translation-ready, threaded-comments, rtl-language-support
*/

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

:root {
    --sidebar-bg: #1a1a2e;
    --sidebar-text: #c4c4d4;
    --sidebar-text-hover: #ffffff;
    --sidebar-accent: #e94560;
    --content-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-primary: #2d2d3a;
    --text-secondary: #6c6c7c;
    --text-muted: #9a9aae;
    --border-color: #e8e8ee;
    --accent-color: #e94560;
    --tag-bg: #f0f0f5;
    --tag-hover: #e94560;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 20%;
    --content-width: 80%;
    --font-serif: 'Noto Serif SC', Georgia, 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--content-bg);
    line-height: 1.7;
    overflow-x: hidden;
}

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

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

ul {
    list-style: none;
}

/* ==================== Accessibility ==================== */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    padding: 0.5rem 1rem;
    background: var(--accent-color);
    color: #fff;
    border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
    left: 0;
}

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

/* ==================== Layout ==================== */
.layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ==================== Sidebar (Left 20%) ==================== */
.sidebar {
    width: var(--sidebar-width);
    min-width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 2.5rem 2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* --- Logo --- */
.sidebar__logo {
    margin-bottom: 2.5rem;
    text-align: center;
}

.sidebar__logo a,
.sidebar__logo .site-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    display: block;
}

.sidebar__logo a span,
.sidebar__logo .site-title span {
    color: var(--sidebar-accent);
}

.sidebar__tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.custom-logo-link {
    display: inline-block;
    margin-bottom: 0.5rem;
}

.custom-logo {
    max-height: 60px;
    width: auto;
    border-radius: var(--radius-sm);
}

/* --- Author --- */
.author {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.author__avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    margin: 0 auto 0.8rem;
    border: 3px solid rgba(233, 69, 96, 0.3);
    overflow: hidden;
    position: relative;
}

.author__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author__name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.3rem;
}

.author__bio {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}

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

.nav__label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    padding-left: 0.5rem;
}

.nav__list li {
    margin-bottom: 2px;
}

.nav__list a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--sidebar-text);
    transition: var(--transition);
}

.nav__list a svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav__list a:hover,
.nav__list a.active,
.current-menu-item > a,
.current_page_item > a,
.current-menu-parent > a {
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text-hover);
}

.nav__list a:hover svg,
.nav__list a.active svg {
    opacity: 1;
}

/* Sub-menu */
.nav__list .sub-menu {
    margin-left: 1.5rem;
    margin-top: 2px;
}

.nav__list .sub-menu a {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
}

/* --- Categories --- */
.categories {
    margin-bottom: 2rem;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-list a {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text);
    transition: var(--transition);
}

.category-list a:hover {
    background: var(--sidebar-accent);
    color: #fff;
}

/* --- Social --- */
.social {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.social__list a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--sidebar-text);
    transition: var(--transition);
}

.social__list a:hover {
    background: var(--sidebar-accent);
    color: #fff;
    transform: translateY(-2px);
}

.social__list svg {
    width: 18px;
    height: 18px;
}

.copyright {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1rem;
    line-height: 1.6;
}

/* ==================== Content (Right 80%) ==================== */
.content {
    width: var(--content-width);
    margin-left: var(--sidebar-width);
    padding: 2.5rem 3rem;
    min-height: 100vh;
}

/* --- Mobile Toggle Button --- */
.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--sidebar-bg);
    color: #fff;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
}

.menu-toggle.is-open .icon-open {
    display: none;
}

.menu-toggle .icon-close {
    display: none;
}

.menu-toggle.is-open .icon-close {
    display: block;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* --- Page Header --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-header h1 span {
    color: var(--accent-color);
}

/* --- Search Box --- */
.search-box {
    position: relative;
    width: 260px;
}

.search-box input {
    width: 100%;
    padding: 0.6rem 0.8rem 0.6rem 2.4rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: var(--transition);
    font-family: var(--font-sans);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.search-box svg {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* --- Featured Post --- */
.featured {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2.5rem;
    height: 340px;
    box-shadow: var(--shadow-md);
}

.featured__bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.featured__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.85) 100%);
}

.featured__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem 2.5rem;
    color: #fff;
}

.featured__badge {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    margin-bottom: 0.8rem;
}

.featured__title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.6rem;
}

.featured__title a {
    color: #fff;
}

.featured__title a:hover {
    color: rgba(255, 255, 255, 0.85);
}

.featured__meta {
    font-size: 0.8rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* --- Post Grid --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.post-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.post-card__image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.post-card:hover .post-card__image img {
    transform: scale(1.05);
}

.post-card__no-image {
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
}

.post-card__category {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--accent-color);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-card__body {
    padding: 1.3rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card__date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.post-card__title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
}

.post-card__title a {
    color: inherit;
}

.post-card__title a:hover {
    color: var(--accent-color);
}

.post-card__excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border-color);
}

.post-card__author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.post-card__author img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.post-card__read {
    font-size: 0.78rem;
    color: var(--accent-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.post-card__read svg {
    width: 14px;
    height: 14px;
    transition: var(--transition);
}

.post-card:hover .post-card__read svg {
    transform: translateX(3px);
}

/* --- Pagination --- */
.pagination {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.pagination .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.65rem;
    line-height: 1;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.pagination .page-numbers:not(.dots):hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
    background: rgba(233, 69, 96, 0.06);
}

.pagination .page-numbers.current {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(233, 69, 96, 0.3);
}

.pagination .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
    min-width: auto;
    padding: 0 0.25rem;
    pointer-events: none;
}

.pagination .page-numbers.prev,
.pagination .page-numbers.next {
    padding: 0 0.9rem;
    font-size: 0.85rem;
}

.pagination .page-numbers.prev svg,
.pagination .page-numbers.next svg {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

/* 极端小屏：按钮缩小 */
@media (max-width: 480px) {
    .pagination .page-numbers {
        min-width: 36px;
        height: 36px;
        padding: 0 0.5rem;
        font-size: 0.8rem;
    }

    .pagination .page-numbers.prev,
    .pagination .page-numbers.next {
        padding: 0 0.7rem;
    }

    .pagination .page-numbers.prev svg,
    .pagination .page-numbers.next svg {
        width: 16px;
        height: 16px;
    }
}

/* --- Single Post --- */
.single-content-wrapper {
    padding-left: 30px;
    padding-right: 30px;
}

@media (max-width: 640px) {
    .single-content-wrapper {
        padding-left: 15px;
        padding-right: 15px;
    }
}

.single-post {

.single-post__header {
    margin-bottom: 2rem;
}

.single-post__title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.single-post__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.single-post__meta .author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.single-post__meta .author-info img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.single-post__featured {
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.single-post__featured img {
    width: 100%;
    height: auto;
}

/* --- Article Content --- */
.entry-content {
    font-size: 1rem;
    line-height: 1.9;
    color: var(--text-primary);
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    font-family: var(--font-serif);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

.entry-content h2 {
    font-size: 1.5rem;
}

.entry-content h3 {
    font-size: 1.25rem;
}

.entry-content h4 {
    font-size: 1.1rem;
}

.entry-content p {
    margin-bottom: 1.2rem;
}

.entry-content a {
    color: var(--accent-color);
    text-decoration: underline;
}

.entry-content a:hover {
    opacity: 0.8;
}

.entry-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding: 0.8rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--card-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
    font-style: italic;
}

.entry-content ul,
.entry-content ol {
    margin: 1rem 0 1.2rem 1.5rem;
}

.entry-content ul li {
    list-style: disc;
    margin-bottom: 0.4rem;
}

.entry-content ol li {
    list-style: decimal;
    margin-bottom: 0.4rem;
}

.entry-content code {
    background: var(--tag-bg);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: 'Fira Code', 'Courier New', monospace;
}

.entry-content pre {
    background: #1a1a2e;
    color: #e0e0e8;
    padding: 1.2rem 1.5rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1.5rem 0;
    line-height: 1.6;
}

.entry-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.entry-content img {
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.entry-content th,
.entry-content td {
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.8rem;
    text-align: left;
}

.entry-content th {
    background: var(--tag-bg);
    font-weight: 600;
}

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

/* --- Tags --- */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.post-tags a {
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    background: var(--tag-bg);
    color: var(--text-secondary);
}

.post-tags a:hover {
    background: var(--accent-color);
    color: #fff;
}

/* --- Author Box --- */
.author-box {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    margin-top: 2rem;
    box-shadow: var(--shadow-sm);
}

.author-box__avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.author-box__name {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.author-box__bio {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- Comments --- */
.comments-area {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

.comment-list {
    margin-bottom: 2rem;
}

.comment-body {
    padding: 1rem 1.2rem;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.5rem;
}

.comment-author img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.comment-author .fn {
    font-weight: 600;
    font-size: 0.9rem;
}

.comment-metadata {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-content {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.comment-reply-link {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-top: 0.5rem;
    display: inline-block;
}

.comment-respond {
    margin-top: 1.5rem;
}

.comment-form label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    color: var(--text-secondary);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    margin-bottom: 1rem;
    background: var(--card-bg);
    color: var(--text-primary);
    transition: var(--transition);
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form .submit {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.comment-form .submit:hover {
    background: #d63d5a;
    transform: translateY(-1px);
}

/* --- 404 Page --- */
.error-404 {
    text-align: center;
    padding: 4rem 2rem;
}

.error-404__code {
    font-family: var(--font-serif);
    font-size: 6rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
}

.error-404__text {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 1rem 0 2rem;
}

.error-404 .search-box {
    margin: 0 auto 2rem;
    max-width: 400px;
    width: 100%;
}

/* --- No Results --- */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
}

.no-results h2 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.no-results p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* --- Archive Header --- */
.archive-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.archive-header h1 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}

.archive-header .archive-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* --- Back to Top --- */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--sidebar-bg);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 50;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--accent-color);
    transform: translateY(-3px);
}

.back-to-top svg {
    width: 22px;
    height: 22px;
}

/* ==================== Responsive ==================== */
@media (max-width: 1200px) {
    .content {
        padding: 2rem 2.5rem;
    }

    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .content {
        width: 100%;
        margin-left: 0;
        padding: 2rem 1.5rem;
        padding-top: 4.5rem;
    }

    .menu-toggle {
        display: flex;
    }

    .featured {
        height: 280px;
    }

    .featured__title {
        font-size: 1.4rem;
    }

    .single-post__title {
        font-size: 1.6rem;
    }
}

@media (max-width: 640px) {
    .content {
        padding: 1.5rem 1rem;
        padding-top: 4.5rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box {
        width: 100%;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .featured {
        height: 240px;
    }

    .featured__content {
        padding: 1.5rem;
    }

    .featured__title {
        font-size: 1.2rem;
    }

    .single-post__title {
        font-size: 1.4rem;
    }

    .back-to-top {
        bottom: 1.2rem;
        right: 1.2rem;
    }
}

/* ==================== Animations ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeInUp 0.5s ease both;
}

.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.2s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }
.post-card:nth-child(6) { animation-delay: 0.3s; }

.featured {
    animation: fadeInUp 0.6s ease both;
}

/* ==================== RTL Support ==================== */
.rtl .sidebar {
    left: auto;
    right: 0;
}

.rtl .content {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

.rtl .nav__list a {
    text-align: right;
}

@media (max-width: 992px) {
    .rtl .sidebar {
        transform: translateX(100%);
    }

    .rtl .sidebar.open {
        transform: translateX(0);
    }

    .rtl .content {
        margin-right: 0;
    }
}
