/* ========================================
   RESET & BASE STYLES
   ======================================== */

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

:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #c9a959;
    --accent-hover: #b8952e;
    --accent-soft: rgba(201, 169, 89, 0.12);
    --text-dark: #1a1a2e;
    --text-mid: #555;
    --text-light: #888;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --border: #e5e5e5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent);
    color: #fff;
}

::-moz-selection {
    background: var(--accent);
    color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

.site-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.header-top {
    padding: 1rem 0;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.header-brand {
    display: flex;
    align-items: center;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.5px;
}

.site-title a {
    color: var(--accent);
    -webkit-text-fill-color: var(--accent);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    text-decoration: none;
    transition: var(--transition);
}

.site-title a:hover {
    color: var(--accent-hover);
    -webkit-text-fill-color: var(--accent-hover);
    transform: scale(1.05);
}

.site-nav {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    order: 1;
}

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-white);
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Search toggle — hidden on desktop, visible on mobile */
.search-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-white);
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
}

.search-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Hamburger button — hidden on desktop */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}

.menu-bar {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-dark);
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Hamburger → X animation */
.menu-toggle.active .menu-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active .menu-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .menu-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
    padding: 6rem 0 5rem;
    background: var(--bg-white);
    transition: background-color 0.4s ease;
}

.hero-content {
    max-width: 620px;
}

.hero-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    margin-bottom: 1.75rem;
    animation: fadeInUp 0.5s ease 0.1s both;
}

.hero-title {
    font-size: clamp(2.2rem, 4.5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    color: var(--text-dark);
    margin-bottom: 1rem;
    animation: fadeInUp 0.5s ease 0.2s both;
}

.hero-subtitle {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-mid);
    margin-bottom: 2.5rem;
    max-width: 500px;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.5s ease 0.4s both;
}

.cta-button {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: var(--accent);
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(201, 169, 89, 0.25);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201, 169, 89, 0.35);
    background: var(--accent-hover);
}

.cta-button-outline {
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-mid);
    padding: 0.75rem 1.75rem;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    transition: var(--transition);
}

.cta-button-outline:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

/* ========================================
   SEARCH BAR
   ======================================== */

.search-bar {
    position: relative;
    max-width: 480px;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.5s ease 0.35s both;
}

.header-search {
    margin-bottom: 0;
    max-width: 260px;
    animation: none;
    flex-shrink: 1;
    min-width: 0;
}

.header-search .search-input {
    padding: 0.55rem 2.5rem 0.55rem 2.2rem;
    font-size: 0.85rem;
    border-radius: 50px;
}

.header-search .search-bar-icon {
    font-size: 0.8rem;
    left: 0.85rem;
}

.header-search .search-shortcut {
    font-size: 0.6rem;
    right: 0.75rem;
    padding: 0.1rem 0.35rem;
}

.search-bar-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 2.5rem;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1.5px solid var(--border);
    border-radius: 50px;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: var(--transition);
    outline: none;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 169, 89, 0.15);
}

.search-shortcut {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    font-family: inherit;
    background: var(--bg-soft);
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.45rem;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.2s;
}

.search-clear:hover {
    color: var(--text-dark);
}

/* Search results dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 100;
}

.search-results.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

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

.search-result-item:hover {
    background: var(--accent-soft);
}

.search-result-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
}

.search-result-title mark {
    background: rgba(201, 169, 89, 0.3);
    color: inherit;
    border-radius: 2px;
    padding: 0 2px;
}

.search-result-meta {
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.search-result-category {
    font-weight: 500;
    color: var(--accent);
}

.search-result-empty,
.search-result-more {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
}

.search-result-more {
    border-top: 1px solid var(--border);
    font-style: italic;
}

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

/* ========================================
   FEATURED SECTION
   ======================================== */

.featured-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8f6f0 0%, #efe9d8 100%);
}

.featured-post {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.featured-image {
    position: relative;
    height: 400px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent) 0%, #8b7332 100%);
}

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

.featured-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.9);
}

.featured-content {
    padding: 3rem;
}

.featured-category {
    display: inline-block;
    background: var(--accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 24px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.featured-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.2;
}

.featured-excerpt {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.featured-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.featured-date,
.featured-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.featured-link {
    display: inline-block;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    transition: var(--transition);
}

.featured-link:hover {
    background: var(--accent-hover);
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   POSTS SECTION
   ======================================== */

.posts-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 400;
}

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

/* ========================================
   POST CARD
   ======================================== */

.post-card {
    height: 100%;
}

.post-card-wrapper {
    height: 100%;
}

.post-hero {
    margin: 2rem auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    aspect-ratio: 16 / 9;
    max-height: 300px;
    max-width: 800px;
    display: block;
    position: relative;
    z-index: 1;
}

.post-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Post Content Styling */
.post-content {
    font-size: 1.05rem;
    line-height: 2;
    color: var(--text-dark);
    clear: both;
    max-width: 100%;
    letter-spacing: 0.3px;
}

.post-content p {
    margin-bottom: 2rem;
    line-height: 2;
    font-size: 1.05rem;
    letter-spacing: 0.4px;
    color: var(--text-dark);
}

.post-content h1 {
    font-size: 2.75rem;
    font-weight: 900;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.15;
    color: var(--text-dark);
    letter-spacing: -0.8px;
}

.post-content h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 3.5rem;
    margin-bottom: 2rem;
    line-height: 1.25;
    color: var(--text-dark);
    padding-bottom: 0;
    border-bottom: none;
    letter-spacing: -0.4px;
}

.post-content h3 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    color: var(--text-dark);
    letter-spacing: -0.3px;
}

.post-content h4 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--text-dark);
    letter-spacing: -0.2px;
}

.post-content h5,
.post-content h6 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.post-content ul,
.post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2.5rem;
}

.post-content ul {
    list-style-type: disc;
}

.post-content ol {
    list-style-type: decimal;
}

.post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.95;
    color: var(--text-dark);
}

.post-content li ul,
.post-content li ol {
    margin-top: 0.75rem;
    margin-bottom: 0rem;
}

.post-content li li {
    margin-bottom: 0.5rem;
}

.post-content blockquote {
    border-left: 5px solid var(--accent);
    padding-left: 2rem;
    margin: 2rem 0;
    color: var(--text-light);
    font-style: italic;
    background: var(--bg-light);
    padding: 1.5rem 1.5rem 1.5rem 2rem;
    border-radius: 6px;
    line-height: 1.95;
    font-size: 1.05rem;
}

.post-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    color: #d63384;
}

.post-content pre {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
    line-height: 1.7;
    margin-top: 1rem;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: var(--text-dark);
    border-radius: 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
}

.post-content table thead {
    background: var(--accent);
    color: white;
}

.post-content table th,
.post-content table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.post-content table tbody tr:hover {
    background: var(--bg-light);
}

/* Table of Contents Styling */
.toc,
[class*="toc"],
[id*="contents"] {
    background: transparent;
    border-left: 0;
    padding: 0;
    margin-top: 0;
    margin-bottom: 1rem;
    border-radius: 0;
    clear: both;
    position: relative;
    z-index: 1;
    font-size: inherit;
}

.toc ul,
[class*="toc"] ul,
[id*="contents"] ul {
    list-style-type: none;
    padding-left: 1.25rem;
    margin: 0 0 0.5rem;
}

.toc li,
[class*="toc"] li,
[id*="contents"] li {
    margin-bottom: 0.25rem;
    line-height: 1.6;
    font-size: inherit;
    color: var(--text-dark);
}

.toc-title,
[class*="toc"] .toc-title,
[id*="contents"] .toc-title {
    font-size: 0.85rem;
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.toc a,
[class*="toc"] a,
[id*="contents"] a {
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
}

.toc a:hover,
[class*="toc"] a:hover,
[id*="contents"] a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.toc > ul > li > a,
[class*="toc"] > ul > li > a,
[id*="contents"] > ul > li > a {
    font-weight: 600;
    font-size: inherit;
    letter-spacing: 0;
    color: inherit;
}

.toc > ul > li > ul,
[class*="toc"] > ul > li > ul,
[id*="contents"] > ul > li > ul {
    margin-top: 0.25rem;
    padding-left: 1.25rem;
}

/* Post Page Styling */
.post {
    background: var(--bg-white);
}

.post-header {
    margin-bottom: 1rem;
}

.post-title {
    font-size: 2.75rem;
    font-weight: 900;
    line-height: 1.15;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    letter-spacing: -0.8px;
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-light);
    align-items: center;
}

.post-meta time,
.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.post-card-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--bg-light);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card-wrapper:hover .post-card-image img {
    transform: scale(1.1);
}

.post-card-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, var(--accent) 0%, #8b7332 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.post-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 100%);
}

.post-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-categories {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.post-category {
    display: inline-block;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    transition: var(--transition);
}

.post-card-wrapper:hover .post-category {
    background: var(--accent);
    color: white;
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    flex-grow: 1;
}

.post-card-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.post-card-excerpt {
    font-size: 0.95rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.post-card-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
}

.post-date,
.post-author {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.read-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    border-radius: 50%;
    transition: var(--transition);
}

.read-more-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.15) rotate(45deg);
    box-shadow: var(--shadow-md);
}

/* ========================================
   SHARE BUTTON
   ======================================== */

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    color: var(--text-light);
    border: 1.5px solid var(--border);
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.share-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.share-btn--copied {
    color: #22c55e;
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
}

.share-btn--copied:hover {
    color: #22c55e;
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
}

/* Share button inside post cards */
.share-btn-card {
    padding: 0;
    border: none;
    background: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-light);
    transition: var(--transition);
}

.share-btn-card:hover {
    color: var(--accent);
    background: var(--accent-soft);
    border: none;
}

.share-btn-card.share-btn--copied {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.08);
    border: none;
}

.post-card-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Featured post share button */
.featured-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Post page share button */
.share-btn-post {
    margin-left: auto;
}

/* ========================================
   MORE ARTICLES BUTTON
   ======================================== */

.more-articles-wrapper {
    text-align: center;
    margin-top: 3rem;
}

.more-articles-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.85rem 2.2rem;
    border-radius: 8px;
    transition: var(--transition);
}

.more-articles-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.more-articles-btn i {
    transition: transform 0.3s ease;
}

.more-articles-btn:hover i {
    transform: translateX(4px);
}

/* ========================================
   ALL ARTICLES PAGE
   ======================================== */

.all-articles-page {
    padding: 2rem 0 5rem;
    min-height: 60vh;
    background: var(--bg-light);
}

.all-articles-page .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.all-articles-page .back-link:hover {
    color: var(--accent);
}

.all-articles-page .section-header {
    margin-bottom: 2.5rem;
}

/* ========================================
   PAGINATION
   ======================================== */

#paginationControls {
    margin-top: 3rem;
    text-align: center;
}

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

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover:not(.disabled):not(.active) {
    background: var(--accent-soft);
    color: var(--accent);
}

.page-btn.active {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-prev,
.page-next {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
}

.page-prev:hover:not(.disabled),
.page-next:hover:not(.disabled) {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: #fff;
}

.page-prev.disabled,
.page-next.disabled {
    background: var(--border);
    color: var(--text-light);
    opacity: 0.5;
}

.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 40px;
    color: var(--text-light);
    font-size: 1.1rem;
    letter-spacing: 2px;
}

.pagination-info {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

/* ========================================
   ABOUT SECTION
   ======================================== */

.about-section {
    padding: 80px 0;
    background: white;
}

.about-content {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.about-content > p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    padding: 2rem;
    border-radius: var(--radius);
    background: var(--bg-light);
    text-align: center;
    transition: var(--transition);
}

.feature-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

.feature-item i {
    font-size: 2.5rem;
    color: var(--accent);
    -webkit-text-fill-color: var(--accent);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    margin-bottom: 1rem;
}

.feature-item h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.feature-item p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ========================================
   CONTACT SECTION
   ======================================== */

.contact-section {
    padding: 80px 0;
    background: var(--bg-light);
    text-align: center;
}

.contact-content {
    max-width: 600px;
    margin: 0 auto;
}

.contact-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    min-width: 120px;
}

.social-link i {
    font-size: 2rem;
    color: var(--accent);
    -webkit-text-fill-color: var(--accent);
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
}

.social-link span {
    font-weight: 600;
    font-size: 0.95rem;
}

.social-link:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
}

/* ========================================
   FOOTER
   ======================================== */

.site-footer {
    background: var(--primary);
    color: #e0e0e0;
    padding: 4rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #a0a0a0;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #a0a0a0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #808080;
    font-size: 0.9rem;
}

/* ========================================
   POST PAGE (article view)
   ======================================== */

.post-page {
    padding: 2rem 0 5rem;
    background: var(--bg-white);
    min-height: 60vh;
}

.post-page .container {
    max-width: 900px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    padding: 0.5rem 0;
    margin-bottom: 2rem;
    transition: var(--transition);
}

.back-link i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.back-link:hover {
    color: var(--accent);
}

.back-link:hover i {
    transform: translateX(-3px);
}

.post-page .post {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
}

.post-page .post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.post-page .post-title {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.post-page .post-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

.post-page .post-meta i {
    color: var(--accent);
    font-size: 0.8rem;
}

.post-page .post-hero {
    margin: 0 -3rem 2.5rem;
    max-width: none;
    max-height: 350px;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
}

.post-page .post-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-page .post-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-dark);
    letter-spacing: 0.2px;
}

.post-page .post-content p {
    margin-bottom: 1.75rem;
    line-height: 1.9;
}

.post-page .post-content h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    letter-spacing: -0.5px;
}

.post-page .post-content h2 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    letter-spacing: -0.3px;
}

.post-page .post-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.post-page .post-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.post-page .post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

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

.post-page .post-content blockquote {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--accent);
    background: var(--bg-light);
    border-radius: 0 8px 8px 0;
    color: var(--text-mid);
    font-style: italic;
    line-height: 1.8;
}

.post-page .post-content pre {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    line-height: 1.6;
}

.post-page .post-content code {
    background: var(--bg-light);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.88em;
    color: var(--accent-hover);
}

.post-page .post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.9rem;
}

.post-page .post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
}

.post-page .post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.95rem;
}

.post-page .post-content table thead {
    background: var(--accent);
    color: #fff;
}

.post-page .post-content table th,
.post-page .post-content table td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.post-page .post-content table tbody tr:hover {
    background: var(--bg-light);
}

.post-page .post-content ul,
.post-page .post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-page .post-content li {
    margin-bottom: 0.4rem;
    line-height: 1.8;
}

/* TOC in post page */
.post-page .toc {
    background: var(--bg-light);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.post-page .toc-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.post-page .toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.post-page .toc ul ul {
    padding-left: 1.25rem;
    margin-top: 0.25rem;
}

.post-page .toc li {
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

.post-page .toc a {
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* Post page responsive */
@media (max-width: 768px) {
    .post-page .post {
        padding: 2rem 1.5rem;
    }

    .post-page .post-title {
        font-size: 1.75rem;
    }

    .post-page .post-hero {
        margin: 0 -1.5rem 2rem;
    }

    .post-page .post-content h1 { font-size: 1.6rem; }
    .post-page .post-content h2 { font-size: 1.35rem; }
    .post-page .post-content h3 { font-size: 1.15rem; }
}

@media (max-width: 480px) {
    .post-page .post {
        padding: 1.5rem 1.25rem;
        border-radius: 8px;
    }

    .post-page .post-title {
        font-size: 1.5rem;
    }

    .post-page .post-hero {
        margin: 0 -1.25rem 1.5rem;
    }

    .post-page .post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ========================================
   DARK MODE
   ======================================== */

body.dark-mode {
    --accent: #d4b05c;
    --accent-hover: #e0c070;
    --accent-soft: rgba(212, 176, 92, 0.1);
    --text-dark: #e7e9ee;
    --text-mid: #9aa3b8;
    --text-light: #6b7590;
    --bg-white: #0d0f1a;
    --bg-light: #111627;
    --bg-card: #151b2e;
    --border: #1f2538;
    background-color: #0d0f1a;
    color: #e7e9ee;
}

body.dark-mode .site-header {
    background: #0f1322;
    border-bottom-color: #1f2538;
    box-shadow: none;
}

body.dark-mode .nav-link {
    color: #d6d9e4;
}

body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active {
    color: var(--accent);
}

body.dark-mode .theme-toggle {
    background: #151b2d;
    border-color: #2a324a;
    color: #e7e9ee;
}

body.dark-mode .featured-section {
    background: linear-gradient(135deg, #11162a 0%, #1a2036 100%);
}

body.dark-mode .featured-post {
    background: #151b2e;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

body.dark-mode .featured-title,
body.dark-mode .section-title,
body.dark-mode .post-card-title a,
body.dark-mode .feature-item h3 {
    color: #f0f2f7;
}

body.dark-mode .featured-excerpt,
body.dark-mode .section-subtitle,
body.dark-mode .post-card-excerpt,
body.dark-mode .about-content > p,
body.dark-mode .contact-text,
body.dark-mode .post-card-meta {
    color: #b5bccb;
}

body.dark-mode .featured-meta,
body.dark-mode .post-card-footer {
    border-color: #2a324a;
}

body.dark-mode .posts-section {
    background: #0d0f1a;
}

body.dark-mode .post-card-wrapper,
body.dark-mode .social-link,
body.dark-mode .feature-item {
    background: #151b2e;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

body.dark-mode .post-category {
    background: rgba(212, 176, 92, 0.1);
    color: #d4b05c;
}

/* Dark Mode Post Page */
body.dark-mode .post {
    background: #0d0f1a;
}

body.dark-mode .post-title {
    color: #f0f2f7;
}

body.dark-mode .post-meta {
    color: #9aa3b2;
}

/* Dark Mode Post Content */
body.dark-mode .post-content {
    color: #e7e9ee;
}

body.dark-mode .post-content h1,
body.dark-mode .post-content h2,
body.dark-mode .post-content h3,
body.dark-mode .post-content h4,
body.dark-mode .post-content h5,
body.dark-mode .post-content h6 {
    color: #f0f2f7;
}

body.dark-mode .post-content p {
    color: #e7e9ee;
}

body.dark-mode .post-content li {
    color: #e7e9ee;
}

body.dark-mode .post-content blockquote {
    background: #151b2e;
    border-left-color: var(--accent);
    color: #b5bccb;
}

body.dark-mode .post-content code {
    background: #151b2e;
    color: #d4b05c;
}

body.dark-mode .post-content pre {
    background: #151b2e;
    border-color: #2a324a;
    color: #e7e9ee;
}

body.dark-mode .post-content table {
    border-color: #2a324a;
}

body.dark-mode .post-content table thead {
    background: var(--accent);
}

body.dark-mode .post-content table th,
body.dark-mode .post-content table td {
    border-bottom-color: #2a324a;
    color: #e7e9ee;
}

body.dark-mode .post-content table tbody tr:hover {
    background: #151b2e;
}

body.dark-mode .toc,
body.dark-mode [class*="toc"],
body.dark-mode [id*="contents"] {
    background: transparent;
    border-left-color: transparent;
}

body.dark-mode .toc-title,
body.dark-mode [class*="toc"] .toc-title,
body.dark-mode [id*="contents"] .toc-title {
    color: #98a4c0;
}

body.dark-mode .toc a,
body.dark-mode [class*="toc"] a,
body.dark-mode [id*="contents"] a {
    color: #e7e9ee;
}

body.dark-mode .toc a:hover,
body.dark-mode [class*="toc"] a:hover,
body.dark-mode [id*="contents"] a:hover {
    color: var(--accent);
}

body.dark-mode .about-section {
    background: #0f1322;
}

body.dark-mode .contact-section {
    background: #0d0f1a;
}

body.dark-mode .social-link {
    color: #e7e9ee;
}

body.dark-mode .site-footer {
    background: #0a0d18;
}

body.dark-mode .footer-section p,
body.dark-mode .footer-section a,
body.dark-mode .footer-bottom {
    color: #9aa3b2;
}

body.dark-mode .footer-section a:hover {
    color: var(--accent);
}

body.dark-mode .post-page {
    background: #0d0f1a;
}

body.dark-mode .post-page .post {
    background: #151b2e;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

body.dark-mode .post-page .post-header {
    border-bottom-color: #2a324a;
}

body.dark-mode .post-page .back-link {
    color: #6b7590;
}

body.dark-mode .post-page .back-link:hover {
    color: var(--accent);
}

body.dark-mode .post-page .post-content code {
    background: #111627;
    color: #d4b05c;
}

body.dark-mode .post-page .post-content pre {
    background: #111627;
    border-color: #2a324a;
}

body.dark-mode .post-page .post-content blockquote {
    background: #111627;
    border-left-color: var(--accent);
    color: #b5bccb;
}

body.dark-mode .post-page .post-content h2 {
    border-bottom-color: #2a324a;
}

body.dark-mode .post-page .toc {
    background: #111627;
}

body.dark-mode .site-title a {
    color: var(--accent);
    -webkit-text-fill-color: var(--accent);
}

body.dark-mode .cta-button {
    color: #1a1a2e;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    /* Show hamburger, hide nav by default */
    .menu-toggle {
        display: flex;
    }

    .search-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-md);
        padding: 0.5rem 0;
        z-index: 99;
    }

    body.dark-mode .site-nav {
        background: #0f1322;
    }

    .site-nav.open {
        display: flex;
    }

    .header-search {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-width: 100%;
        padding: 0.5rem 1rem;
        background: var(--bg-white);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-sm);
        display: none;
    }

    body.dark-mode .header-search {
        background: #0f1322;
    }

    .header-search.mobile-visible {
        display: block;
    }

    .header-search .search-input {
        font-size: 0.95rem;
        padding: 0.7rem 2.5rem 0.7rem 2.5rem;
    }

    .header-actions {
        gap: 0.35rem;
    }

    .site-nav .nav-link {
        padding: 0.85rem 1.5rem;
        font-size: 1rem;
        border-radius: 0;
    }

    .site-nav .nav-link::after {
        display: none;
    }

    .site-nav .nav-link:hover {
        background: var(--accent-soft);
    }

    .site-header {
        position: sticky;
    }

    .header-top .container {
        position: relative;
    }

    .hero {
        padding: 4rem 0 3.5rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-ctas {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-title {
        font-size: 2rem;
    }

    .featured-post {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .featured-image {
        height: 250px;
    }

    .featured-content {
        padding: 2rem;
    }

    .featured-title {
        font-size: 1.5rem;
    }

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

    .about-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 3rem 0 2.5rem;
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

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

    .post-card-content {
        padding: 1rem;
    }

    .featured-content {
        padding: 1.5rem;
    }

    .featured-title {
        font-size: 1.25rem;
    }

    .site-title {
        font-size: 1.3rem;
    }

    .social-links {
        gap: 1rem;
    }

    .social-link {
        min-width: 100px;
        padding: 1rem;
    }
}
