/* =============================================
   Katakata Blog - Premium Dark Theme v2.0
   A sleek, modern design for tech enthusiasts
   ============================================= */

:root {
    /* Dark Theme Palette */
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-card: #21262d;
    --bg-card-hover: #30363d;

    /* Accent Colors - Vibrant Cyan/Teal */
    --accent: #58a6ff;
    --accent-glow: rgba(88, 166, 255, 0.4);
    --accent-gradient: linear-gradient(135deg, #58a6ff 0%, #3fb950 100%);

    /* Text Colors */
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;

    /* Borders & Shadows */
    --border-color: rgba(240, 246, 252, 0.1);
    --border-color-hover: rgba(88, 166, 255, 0.4);
    --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px var(--accent-glow);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* Light Theme Override */
body[data-theme="light"] {
    --bg-primary: #f6f8fa;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --border-color: rgba(0, 0, 0, 0.1);
    --border-color-hover: rgba(88, 166, 255, 0.5);
    --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    line-height: 1.6;
}

/* =============================================
   Reading Progress Bar
   ============================================= */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: var(--accent-gradient);
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* =============================================
   Header
   ============================================= */
.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
}

.brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: color 0.2s;
}

.brand:hover {
    color: var(--accent);
}

.brand span {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.back-link {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.back-link:hover {
    color: var(--accent);
    background: rgba(88, 166, 255, 0.1);
}

/* =============================================
   Breadcrumb Navigation
   ============================================= */
.breadcrumb {
    max-width: 900px;
    margin: 1rem auto 0;
    padding: 0 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--text-muted);
}

.breadcrumb-current {
    color: var(--accent);
    font-weight: 500;
}

/* =============================================
   Hero Section with Particles
   ============================================= */
.hero-section {
    text-align: center;
    padding: 2rem 1.5rem 1.5rem;
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

#particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 8s ease-in-out infinite;
}

@keyframes float-particle {

    0%,
    100% {
        opacity: 0;
        transform: translateY(100px) scale(0);
    }

    10% {
        opacity: 0.6;
    }

    50% {
        opacity: 0.3;
    }

    90% {
        opacity: 0;
        transform: translateY(-100px) scale(1);
    }
}

.hero-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.8rem;
    background: var(--accent-gradient);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    animation: gradient-shift 4s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.hero-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* =============================================
   Scroll Fade-In Animation
   ============================================= */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delay for cards */
.article-card:nth-child(1) {
    transition-delay: 0s;
}

.article-card:nth-child(2) {
    transition-delay: 0.1s;
}

.article-card:nth-child(3) {
    transition-delay: 0.2s;
}

.article-card:nth-child(4) {
    transition-delay: 0.3s;
}

.article-card:nth-child(5) {
    transition-delay: 0.4s;
}

.article-card:nth-child(6) {
    transition-delay: 0.5s;
}

/* =============================================
   Skeleton Loading
   ============================================= */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    display: flex;
    gap: 1.5rem;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-thumb {
    width: 180px;
    height: 120px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-md);
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    border-radius: 4px;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

.skeleton-line.short {
    width: 40%;
}

.skeleton-line.medium {
    width: 70%;
}

.skeleton-line.long {
    width: 90%;
}

@keyframes skeleton-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@media (max-width: 600px) {
    .skeleton-card {
        flex-direction: column;
    }

    .skeleton-thumb {
        width: 100%;
        height: 160px;
    }
}

/* =============================================
   Filter Bar
   ============================================= */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.filter-bar button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1.4rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.25s ease;
}

.filter-bar button:hover {
    background: var(--bg-card);
    border-color: var(--border-color-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.filter-bar button.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: 600;
    box-shadow: 0 4px 14px var(--accent-glow);
}

/* =============================================
   Search & Sort Row
   ============================================= */
.search-sort-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    max-width: 600px;
    margin: 0 auto 1.5rem;
    padding: 0 1rem;
}

.search-container {
    flex: 1;
    max-width: 400px;
}

#search-input {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-secondary);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

#search-input::placeholder {
    color: var(--text-muted);
}

#search-input:focus {
    background: var(--bg-card);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.sort-container {
    flex-shrink: 0;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.8rem 1.2rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    background: var(--bg-card);
    border-color: var(--accent);
    color: var(--accent);
}

.sort-icon {
    font-size: 1rem;
}

/* =============================================
   CTA Banner
   ============================================= */
.cta-banner {
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 0 1.5rem;
}

.cta-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.15) 0%, rgba(63, 185, 80, 0.15) 100%);
    border: 1px solid var(--accent);
    border-radius: var(--radius-lg);
}

.cta-banner-icon {
    font-size: 2rem;
}

.cta-banner-text {
    flex: 1;
}

.cta-banner-text strong {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
}

.cta-banner-text span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.cta-banner-btn {
    padding: 0.7rem 1.5rem;
    background: var(--accent);
    color: var(--bg-primary);
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.cta-banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px var(--accent-glow);
}

@media (max-width: 600px) {
    .search-sort-row {
        flex-direction: column;
        gap: 0.8rem;
    }

    .search-container {
        width: 100%;
        max-width: none;
    }

    .cta-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }

    .cta-banner-text {
        order: 1;
    }

    .cta-banner-icon {
        order: 0;
    }

    .cta-banner-btn {
        order: 2;
        width: 100%;
        text-align: center;
    }
}

/* =============================================
   Article List (Blog-Style Horizontal Layout)
   ============================================= */
.grid-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* Loading & Empty States */
.loading-state,
.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.reset-btn {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
}

.reset-btn:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.hidden {
    display: none !important;
}

/* =============================================
   Article Card - Horizontal Blog Style
   ============================================= */
.article-card {
    position: relative;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 1.5rem;
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all 0.25s ease;
}

.article-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateX(4px) translateY(-2px);
    box-shadow:
        -4px 0 0 var(--accent),
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 0 20px var(--accent-glow),
        inset 0 0 30px rgba(88, 166, 255, 0.03);
}

.card-thumb {
    flex-shrink: 0;
    width: 180px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .card-thumb img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 1.2rem;
    left: 1.2rem;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 1;
}

.badge.static {
    position: static;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.card-content time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: block;
    font-weight: 500;
}

.card-content h3 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 0.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.card-tags {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 500;
}

/* Mobile: Stack vertically */
@media (max-width: 600px) {
    .article-card {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .card-thumb {
        width: 100%;
        height: 160px;
    }

    .badge {
        top: 1rem;
        left: 1rem;
    }
}

/* NEW Badge */
.badge-new {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: #fff;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    animation: pulse-new 2s ease-in-out infinite;
    z-index: 2;
}

@keyframes pulse-new {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Article Count Info */
.article-count-info {
    width: 100%;
    text-align: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
}

.article-count-info strong {
    color: var(--accent);
}

/* Ad Container between articles */
.article-ad {
    width: 100%;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
    margin: 0.5rem 0;
}


/* =============================================
   Pagination
   ============================================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.pagination button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-card);
    border-color: var(--accent);
    color: var(--accent);
}

.pagination button.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 2px 10px var(--accent-glow);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

.pagination button.pagination-nav {
    width: auto;
    padding: 0 1rem;
    border-radius: 22px;
    font-size: 0.85rem;
}

.pagination-dots {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 0.3rem;
}

/* =============================================
   Footer
   ============================================= */
.blog-footer {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* =============================================
   Sidebar Navigation (Right Side)
   ============================================= */

/* Header Layout Update */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Hamburger Menu Button */
.sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
}

.sidebar-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.sidebar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.sidebar-toggle.active span:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Panel - RIGHT SIDE */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-left: 1px solid var(--border-color);
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.active {
    transform: translateX(0);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.2rem;
    background: var(--accent-gradient);
    color: var(--bg-primary);
}

.sidebar-header h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.sidebar-close {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: var(--bg-primary);
    font-size: 1rem;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sidebar-close:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: rotate(90deg);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.sidebar-section {
    padding: 0.8rem 1rem;
}

.sidebar-section h3 {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    margin: 0 0 0.6rem;
    padding-left: 0.5rem;
}

.sidebar-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-section li {
    margin-bottom: 2px;
}

.sidebar-section a,
.sidebar-section button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.55rem 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: all 0.15s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-section a:hover,
.sidebar-section button:hover {
    background: rgba(88, 166, 255, 0.1);
    color: var(--text-primary);
    padding-left: 1rem;
}

.sidebar-section a.active,
.sidebar-section button.active {
    background: rgba(88, 166, 255, 0.2);
    color: var(--accent);
    font-weight: 600;
    border-left: 3px solid var(--accent);
}

.sidebar-link-main {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem !important;
    margin: 0.5rem;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    font-size: 0.85rem !important;
}

.sidebar-link-main:hover {
    border-color: var(--accent) !important;
    box-shadow: 0 0 16px var(--accent-glow);
    padding-left: 1rem !important;
}

/* =============================================
   Article Detail Page Styles
   ============================================= */
.article-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

.article-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.article-header img.eyecatch {
    width: 100%;
    border-radius: var(--radius-md);
    margin-bottom: 2rem;
}

.article-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.article-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin: 0 0 1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.article-body {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-secondary);
}

.article-body h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-top: 3.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.article-body h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-left: 1rem;
    border-left: 4px solid var(--accent);
}

.article-body p {
    margin-bottom: 1.8rem;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-card);
}

.article-body ul {
    background: var(--bg-card);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-md);
    list-style-type: none;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.article-body ul li {
    margin-bottom: 0.8rem;
    padding-left: 1.8em;
    position: relative;
    color: var(--text-primary);
}

.article-body ul li::before {
    content: "✔";
    color: #3fb950;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Share Button */
.share-section {
    text-align: center;
    margin: 3rem 0;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn-x {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 0.9rem 1.8rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.25s ease;
}

.share-btn-x:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(240, 246, 252, 0.2);
}


/* =============================================
   Recommended Section
   ============================================= */
.recommended-section {
    max-width: 800px;
    margin: 4rem auto 2rem;
    padding: 0 1.5rem;
}

.recommended-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.recommended-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

.recommended-grid .article-card {
    background: var(--bg-card);
}

.recommended-grid .card-thumb {
    height: 130px;
}

.recommended-grid .card-content {
    padding: 1rem;
}

.recommended-grid h3 {
    font-size: 0.95rem;
    margin-bottom: 0;
}

.recommended-grid .card-desc,
.recommended-grid .card-tags,
.recommended-grid .badge {
    display: none;
}

.recommended-grid time {
    font-size: 0.7rem;
}

/* =============================================
   Responsive Design
   ============================================= */
@media (max-width: 768px) {
    .blog-header {
        padding: 1rem;
    }

    .brand {
        font-size: 1.2rem;
    }

    .hero-section {
        padding: 3rem 1rem 2rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .grid-container {
        grid-template-columns: 1fr;
        padding: 0 1rem 3rem;
    }

    .article-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .article-title {
        font-size: 1.6rem;
    }

    .article-body h2 {
        font-size: 1.4rem;
    }
}

/* =============================================
   Glass Panel (Legacy Support)
   ============================================= */
.glass-panel {
    background: rgba(22, 27, 34, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* =============================================
   Related Articles Section
   ============================================= */
.related-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-section h2 {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    text-align: center;
}

#related-articles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.2rem;
}

.related-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.25s ease;
}

.related-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.related-card-thumb {
    position: relative;
    height: 140px;
    overflow: hidden;
}

.related-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-card:hover .related-card-thumb img {
    transform: scale(1.05);
}

.related-card-category {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--accent);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

.related-card-content {
    padding: 1rem;
}

.related-card-content time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.related-card-content h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 600px) {
    #related-articles {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   Back to Top Button
   ============================================= */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 50;
    box-shadow: 0 4px 16px rgba(88, 166, 255, 0.4);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 24px rgba(88, 166, 255, 0.6);
}

.back-to-top:active {
    transform: translateY(0);
}

/* =============================================
   Focus States (Accessibility)
   ============================================= */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    z-index: 9999;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0.5rem;
}

/* =============================================
   Comprehensive Responsive Styles
   ============================================= */

/* Tablet (768px and below) */
@media (max-width: 768px) {
    .blog-header {
        padding: 0.8rem 1rem;
    }

    .brand {
        font-size: 1.2rem;
    }

    .hero-section {
        padding: 1.5rem 1rem 1rem;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-text {
        font-size: 0.9rem;
    }

    .filter-bar {
        gap: 0.4rem;
        margin-bottom: 1rem;
    }

    .filter-bar button {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .search-sort-row {
        flex-direction: column;
        gap: 0.8rem;
    }

    .search-container {
        width: 100%;
        max-width: none;
    }

    .sort-btn {
        width: 100%;
        justify-content: center;
    }

    .cta-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 0.8rem;
    }

    .cta-banner-btn {
        width: 100%;
        text-align: center;
    }

    .grid-container {
        padding: 0 1rem 3rem;
    }

    .article-card {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .card-thumb {
        width: 100%;
        height: 180px;
    }

    .card-content h3 {
        font-size: 1rem;
    }

    .card-desc {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    /* Touch-friendly buttons */
    .pagination button {
        min-width: 44px;
        min-height: 44px;
        padding: 0.6rem 0.8rem;
    }

    .pagination-nav {
        padding: 0.6rem 1rem;
    }

    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 44px;
        height: 44px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .blog-header {
        padding: 0.6rem 0.8rem;
    }

    .brand {
        font-size: 1rem;
    }

    .back-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .hero-title {
        font-size: 1.4rem;
    }

    .filter-bar button {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .article-card {
        padding: 0.8rem;
    }

    .card-thumb {
        height: 160px;
    }

    .card-content h3 {
        font-size: 0.95rem;
    }

    .card-tags {
        font-size: 0.7rem;
    }

    /* Sidebar adjustments */
    .sidebar {
        width: 100%;
        max-width: none;
    }

    /* Footer adjustments */
    .blog-footer {
        padding: 2rem 1rem;
    }

    .footer-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Back to top smaller on very small screens */
    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Large screens (1200px and above) */
@media (min-width: 1200px) {
    .hero-section {
        max-width: 800px;
    }

    .grid-container {
        max-width: 1000px;
    }

    .article-card {
        gap: 2rem;
    }

    .card-thumb {
        width: 220px;
        height: 140px;
    }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .fade-in-up {
        opacity: 1;
        transform: none;
    }

    .particle {
        animation: none;
        opacity: 0.3;
    }

    .back-to-top {
        transition: none;
    }
}

/* Print styles */
@media print {

    .blog-header,
    .sidebar,
    .sidebar-overlay,
    .filter-bar,
    .search-sort-row,
    .pagination,
    .back-to-top,
    .cta-banner,
    .article-ad {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .article-card {
        break-inside: avoid;
        background: white;
        border: 1px solid #ccc;
    }
}

/* =============================================
   Theme Toggle Button
   ============================================= */
.theme-toggle {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: rotate(15deg);
}

/* =============================================
   Tag Cloud
   ============================================= */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--accent);
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.tag-item:hover {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

/* =============================================
   Error State (with Retry)
   ============================================= */
.error-state {
    text-align: center;
    padding: 3rem 1.5rem;
}

.retry-btn {
    animation: pulse 2s infinite;
}

/* =============================================
   Previous / Next Article Navigation
   ============================================= */
.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.article-nav-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.article-nav-link:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.article-nav-link.next {
    text-align: right;
}

.article-nav-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.article-nav-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-nav-link.disabled {
    opacity: 0.5;
    pointer-events: none;
}

@media (max-width: 600px) {
    .article-nav {
        flex-direction: column;
    }
}