:root {
    --primary: #ff0000;
    --primary-dark: #cc0000;
    --bg-primary: #ffffff;
    --bg-secondary: #f9f9f9;
    --bg-tertiary: #f1f1f1;
    --text-primary: #0f0f0f;
    --text-secondary: #606060;
    --text-muted: #909090;
    --border-color: #e5e5e5;
    --footer-link: #444444;
    --shadow: 0 1px 2px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #272727;
    --text-primary: #f1f1f1;
    --text-secondary: #aaaaaa;
    --text-muted: #717171;
    --border-color: #303030;
    --footer-link: #d0d0d0;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    cursor: pointer;
    font-family: inherit;
}

.main-header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

/* Centered nav links */
.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    background: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3.5s linear infinite;
}

.nav-link:hover {
    border-bottom: 2px solid var(--primary);
}

.nav-link.active {
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    ) 1;
}

/* Categories dropdown inside nav-center */
.nav-dropdown {
    position: relative;
}

.nav-dropdown .chevron {
    transition: transform 0.2s;
}

.nav-dropdown:hover .chevron {
    transform: rotate(180deg);
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

/* Right section: search + icons */
.nav-right {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 10;
}

.sns-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary);
    border: 1.5px solid transparent;
    border-radius: 30px;
    padding: 5px 14px;
    transition: box-shadow 0.25s, width 0.25s ease;
    width: 240px;
    animation: border-rainbow 4s linear infinite;
}

.sns-wrap:focus-within {
    box-shadow: 0 0 0 3px rgba(151,117,250,0.15);
    width: 300px;
}

.sns-icon {
    flex-shrink: 0;
    animation: icon-rainbow 4s linear infinite;
}

.sns-wrap:focus-within .sns-icon {
    animation: icon-rainbow 4s linear infinite;
}

@keyframes border-rainbow {
    0%   { border-color: #ff6b6b; }
    16%  { border-color: #ffa94d; }
    33%  { border-color: #ffd43b; }
    50%  { border-color: #69db7c; }
    66%  { border-color: #4dabf7; }
    83%  { border-color: #9775fa; }
    100% { border-color: #ff6b6b; }
}

@keyframes icon-rainbow {
    0%   { color: #ff6b6b; }
    16%  { color: #ffa94d; }
    33%  { color: #ffd43b; }
    50%  { color: #69db7c; }
    66%  { color: #4dabf7; }
    83%  { color: #9775fa; }
    100% { color: #ff6b6b; }
}

.sns-wrap input {
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: var(--text-primary);
    font-family: inherit;
    flex: 1;
    min-width: 0;
}

.sns-wrap input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.sns-clear {
    background: none;
    border: none;
    padding: 2px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: 50%;
    transition: color 0.2s, background 0.15s;
    flex-shrink: 0;
}

.sns-clear:hover {
    color: var(--primary);
    background: rgba(255,0,0,0.08);
}

.sns-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    flex-shrink: 0;
    display: none;
}

.sns-spinner.active {
    display: block;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.sns-box {
    position: relative;
}

.sns-badge {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 1px 8px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    white-space: nowrap;
    z-index: 50;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Live search results state on feed */
.blog-grid.search-mode {
    animation: fadeGrid 0.25s ease;
}

.search-feed-header {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 0 0 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.search-feed-header.visible {
    display: flex;
}

.search-feed-header strong {
    color: var(--text-primary);
}

.no-search-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.no-search-results svg {
    margin: 0 auto 16px;
    opacity: 0.3;
}

.no-search-results h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

@keyframes fadeGrid {
    from { opacity: 0.4; transform: translateY(6px); }
    to   { opacity: 1;   transform: translateY(0); }
}

/* Categories dropdown */
.sub-nav-dropdown {
    position: relative;
}

.sub-nav-dropdown .chevron {
    transition: transform 0.2s;
}

.sub-nav-dropdown:hover .chevron {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    min-width: 180px;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 200;
    padding: 6px;
    animation: popupIn 0.18s ease;
}

.sub-nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 7px;
    transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 24px;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
}

.logo svg {
    color: var(--primary);
}

.logo-text-shimmer {
    font-weight: 700;
    letter-spacing: .2px;
    background: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: logo-shimmer 3.5s linear infinite;
}

@keyframes logo-shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 250% center; }
}

/* Admin icon button */
.admin-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.15s;
}

.admin-icon-link:hover {
    opacity: 0.88;
    transform: scale(1.06);
}

.search-container {
    display: none;
}

.search-form {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 40px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.search-input {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
}

.search-btn {
    padding: 10px 20px;
    background: var(--bg-tertiary);
    border: none;
    border-left: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--border-color);
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    display: none;
    box-shadow: var(--shadow-hover);
}

.search-suggestions.active {
    display: block;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 10;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    animation: icon-rainbow 4s linear infinite;
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--bg-tertiary);
}

.moon-icon { display: none; }
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }

.admin-link {
    padding: 8px 16px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.admin-link:hover {
    background: var(--primary-dark);
}

.main-content {
    min-height: calc(100vh - 140px);
}

.home-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

.sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.sidebar .sidebar-section h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    background: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3.5s linear infinite;
}

.category-list {
    list-style: none;
}

.category-list li a {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.category-list li a:hover {
    background: var(--bg-tertiary);
}

.cat-name {
    background: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3.5s linear infinite;
    font-weight: 600;
}

.cat-count {
    color: var(--text-muted);
    font-size: 12px;
}

.trending-list {
    list-style: none;
}

.trending-list li a {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
}

.trending-list li:last-child a {
    border: none;
}

.trend-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
    background: linear-gradient(135deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    );
    background-size: 250% auto;
    animation: shimmer 3.5s linear infinite;
    color: #fff;
}

.trend-info {
    display: flex;
    flex-direction: column;
}

.trend-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.trend-views {
    color: #f59e0b;
    font-size: 12px;
    font-weight: 600;
}

.main-feed {
    min-width: 0;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.feed-header h1 {
    font-size: 24px;
}

.filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 16px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

[data-theme="dark"] .filter-tab {
    color: #fff;
}

.filter-tab svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.filter-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.filter-tab.active svg {
    opacity: 1;
}

/* Card badges */
.card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    pointer-events: none;
    z-index: 2;
    backdrop-filter: blur(4px);
}

.badge-trending {
    background: rgba(220, 38, 38, 0.88);
    color: #fff;
}

.badge-popular {
    background: rgba(234, 88, 12, 0.88);
    color: #fff;
}

.badge-new {
    background: rgba(22, 163, 74, 0.88);
    color: #fff;
}

/* Views count highlight */
.views-count {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #f59e0b;
    font-weight: 700;
    font-size: 12.5px;
}

/* Grid fade when filter switching */
.blog-grid.filter-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.15s;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.blog-card {
    background: transparent;
    border-radius: 0;
    overflow: hidden;
    transition: none;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    box-shadow: none !important;
    transform: none !important;
}

.card-image {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-tertiary);
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 12px;
}

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

.blog-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 0;
    display: flex;
    gap: 12px;
}

.author-avatar-card {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 4px;
}

.card-info {
    flex: 1;
}

.card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
}

.card-meta-yt {
    font-size: 14px;
    color: var(--text-secondary);
}

.card-meta-yt .dot {
    margin: 0 4px;
}

.card-meta-yt .date {
    background: linear-gradient(90deg,#ff6b6b,#ffa94d,#ffd43b,#69db7c,#4dabf7,#9775fa,#f783ac,#ff6b6b);
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3.5s linear infinite;
    font-weight: 500;
}

.card-meta-yt .author {
    background: linear-gradient(90deg,#a78bfa,#7c3aed,#4f46e5,#7c3aed,#a78bfa);
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s linear infinite;
    font-weight: 600;
}

/* Hide elements not in YouTube style */
.card-excerpt, .card-stats, .card-meta:not(.card-meta-yt), .blog-card .category-badge {
    display: none !important;
}

.card-excerpt {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.dot {
    font-size: 4px;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.card-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.load-more-btn {
    padding: 12px 40px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    background: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3.5s linear infinite;
    box-shadow: inset 0 0 0 2px #9775fa;
}

.load-more-btn:hover {
    box-shadow: inset 0 0 0 2px #4dabf7;
    transform: scale(1.04);
}

.load-more-btn.loading .btn-text {
    display: none;
}

.load-more-btn .btn-loader {
    display: none;
}

.load-more-btn.loading .btn-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    pointer-events: none;
}

.skeleton-image {
    aspect-ratio: 16/9;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-content {
    padding: 16px;
}

.skeleton-title,
.skeleton-text,
.skeleton-meta {
    height: 16px;
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-title { width: 80%; height: 20px; }
.skeleton-text { width: 100%; }
.skeleton-meta { width: 60%; height: 12px; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.no-posts h2 {
    margin-bottom: 8px;
}

.no-posts p {
    color: var(--text-muted);
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    z-index: 200;
    width: 0;
    transition: width 0.1s;
}

.single-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 28px;
}

.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.breadcrumb a:hover {
    color: var(--text-primary);
}

.article-header {
    margin-bottom: 32px;
}

.article-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.article-category-badge {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    height: 38px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 800;
    border-radius: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
}

.article-category-badge:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
}

.article-category-inline {
    display: inline-block;
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    margin-right: 12px;
    margin-bottom: 0;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

.article-category-inline:hover {
    background: var(--primary-dark);
}

.article-title {
    font-size: 36px;
    line-height: 1.3;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.author-avatar.large {
    width: 64px;
    height: 64px;
    font-size: 24px;
}

.author-name {
    font-weight: 600;
}

.meta-stats {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.article-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    height: 38px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.07);
    transform: translate(-50%, -50%);
    transition: width 0.45s, height 0.45s;
    pointer-events: none;
}

.action-btn:hover::before {
    width: 180px;
    height: 180px;
}

.action-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 6px 16px rgba(255, 0, 0, 0.4);
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

.like-btn.active svg {
    fill: white;
}

.back-btn {
    text-decoration: none;
    color: var(--text-primary);
}

.back-btn:hover {
    color: var(--primary);
}

/* Share wrapper & popup */
.share-wrapper {
    position: relative;
}

.share-popup {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: var(--bg-primary);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.16);
    z-index: 200;
    padding: 18px;
    flex-direction: column;
    gap: 14px;
    animation: popupIn 0.2s ease;
}

.share-popup.open {
    display: flex;
}

@keyframes popupIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.share-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.share-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 20px;
    line-height: 1;
    padding: 0 4px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.share-close:hover {
    color: var(--primary);
    background: rgba(255, 0, 0, 0.06);
}

.share-copy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 4px 4px 4px 12px;
}

.share-url-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 12px;
    color: var(--text-secondary);
    outline: none;
    min-width: 0;
    font-family: inherit;
}

.share-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.share-copy-btn:hover {
    background: #cc0000;
    transform: scale(1.03);
}

.share-socials {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.share-social {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 6px;
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    background: var(--bg-secondary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
}

.share-social:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-social.twitter  { color: #1da1f2; }
.share-social.facebook { color: #1877f2; }
.share-social.linkedin { color: #0a66c2; }
.share-social.whatsapp { color: #25d366; }
.share-social.reddit   { color: #ff4500; }
.share-social.email    { color: var(--text-secondary); }

.share-social:hover { border-color: currentColor; background: var(--bg-tertiary); }

/* Table of Contents */
.toc-block {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: 12px;
    padding: 18px 22px;
    margin: 32px 0;
    transition: padding 0.25s ease;
}

.toc-block.toc-collapsed {
    padding-bottom: 18px;
}

.toc-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.toc-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-secondary);
}

.toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.toc-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255, 0, 0, 0.05);
}

.toc-toggle svg {
    transition: transform 0.25s ease;
}

.toc-block.toc-collapsed .toc-toggle svg {
    transform: rotate(180deg);
}

.toc-body {
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    max-height: 600px;
    opacity: 1;
}

.toc-block.toc-collapsed .toc-body {
    max-height: 0;
    opacity: 0;
}

.toc-block.toc-collapsed .toc-title {
    margin-bottom: 0;
}

.toc-list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.toc-list li {
    font-size: 15px;
    line-height: 1.4;
}

.toc-list li a {
    color: #f59e0b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.toc-list li a:hover {
    color: #eab308;
}

[data-theme="dark"] .toc-label {
    background: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3.5s linear infinite;
}

[data-theme="dark"] .toc-list li a {
    background: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3.5s linear infinite;
}

[data-theme="dark"] .toc-list li a:hover {
    -webkit-text-fill-color: var(--primary);
    background: none;
}

[data-theme="dark"] .toc-block {
    border-left-color: #9775fa;
}

[data-theme="dark"] .article-sidebar .sidebar-section h3 {
    background: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3.5s linear infinite;
}

.toc-list li.toc-sub {
    margin-left: 16px;
    font-size: 14px;
}

.toc-list li.toc-sub a {
    color: var(--text-secondary);
    font-weight: 400;
}

.article-image {
    margin: 32px 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.article-image img {
    width: 100%;
}

.article-content {
    font-size: 18px;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 28px;
    margin: 32px 0 16px;
    color: #f59e0b;
}

.article-content h3 {
    font-size: 22px;
    margin: 24px 0 12px;
    color: #eab308;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 24px 0;
    font-style: italic;
    color: var(--text-secondary);
}

.article-content pre {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 24px 0;
}

.article-content code {
    font-family: 'Consolas', monospace;
    font-size: 14px;
}

.article-content img {
    border-radius: var(--radius-sm);
    margin: 24px 0;
}

.article-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.share-section {
    margin-bottom: 32px;
}

.share-section h4 {
    margin-bottom: 16px;
}

.share-buttons {
    display: flex;
    gap: 12px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    transition: all 0.3s ease;
    padding: 0;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.linkedin {
    background: #0077b5;
}

.share-btn.whatsapp {
    background: #25d366;
}

.share-btn.pinterest {
    background: #bd081c;
}

.share-btn.reddit {
    background: #ff4500;
}

.share-btn.email {
    background: #777777;
}

.share-btn svg {
    display: block;
}

.author-box {
    display: flex;
    gap: 16px;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.author-box h4 {
    margin-bottom: 8px;
}

.author-box p {
    color: var(--text-secondary);
    font-size: 14px;
}

.related-posts {
    max-width: 1180px;
    margin: 48px auto 0;
    padding: 40px 24px 0;
    border-top: 2px solid var(--border-color);
}

.related-posts h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 28px;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.related-posts h2::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary) 20%, transparent 100%);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    justify-content: center;
}

.blog-card.small {
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card.small:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
    transform: translateY(-6px);
}

.blog-card.small .card-image {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.blog-card.small .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card.small:hover .card-image img {
    transform: scale(1.08);
}

.blog-card.small .placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.blog-card.small .card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.blog-card.small .card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card.small:hover .card-title {
    color: var(--primary);
}

.blog-card.small .card-date {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.card-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    gap: 8px;
}

.card-views-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #f59e0b;
    font-weight: 500;
}

.article-views-count {
    color: #f59e0b;
    font-weight: 600;
}

.inline-blog-card-meta {
    color: #f59e0b;
}

.card-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    white-space: nowrap;
}

.card-read-btn:hover {
    background: #cc0000;
    transform: scale(1.04);
}

/* Sidebar Styles */
.article-main {
    display: flex;
    flex-direction: column;
}

.article-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.sidebar-section h3 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    letter-spacing: 0.5px;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}

.trending-item:hover {
    background: transparent;
}

.trending-item:hover .trending-title {
    color: var(--primary);
}

.trending-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.trending-image {
    width: 68px;
    height: 68px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.trending-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.trending-item:hover .trending-image img {
    transform: scale(1.06);
}

.trending-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.4;
}

.trending-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.trending-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    transition: color 0.2s;
}

.trending-views {
    font-size: 11px;
    color: #f59e0b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all var(--transition);
    text-decoration: none;
    margin: 3px 2px;
}

.category-badge:hover {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .category-badge {
    background: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3.5s linear infinite;
    box-shadow: inset 0 0 0 1.5px rgba(151,117,250,0.4);
}

[data-theme="dark"] .category-badge:hover {
    background: var(--primary);
    -webkit-text-fill-color: white;
    box-shadow: none;
    animation: none;
}

.quick-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.quick-links-list li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: var(--radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.quick-links-list li a svg {
    flex-shrink: 0;
    color: var(--primary);
}

.quick-links-list li a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.quick-links-list li a:hover svg {
    color: white;
}

.ad-slot {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-slot.large {
    min-height: 300px;
}

.ad-placeholder {
    text-align: center;
}

.ad-placeholder svg {
    opacity: 0.3;
    margin-bottom: 12px;
}

.ad-placeholder p {
    font-size: 12px;
    color: var(--text-muted);
}

/* Related blogs in article */
.related-blogs-inline {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 40px 0;
    padding: 28px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.related-blogs-inline h3 {
    grid-column: 1 / -1;
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-blogs-inline h3::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

.inline-blog-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.inline-blog-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
    transform: translateY(-4px);
}

.inline-card-image-wrap {
    position: relative;
    overflow: hidden;
    height: 150px;
    background: var(--bg-tertiary);
}

.inline-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.inline-blog-card:hover .inline-card-image-wrap img {
    transform: scale(1.06);
}

.inline-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.inline-card-category {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 5px 12px;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.inline-blog-card-content {
    flex: 1;
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: space-between;
}

.inline-blog-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.inline-blog-card:hover .inline-blog-card-title {
    color: var(--primary);
}

.inline-blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.inline-blog-card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.inline-read-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 11px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s;
}

.inline-blog-card:hover .inline-read-btn {
    background: #cc0000;
    transform: scale(1.04);
}

.card-category {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    border-radius: 3px;
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.category-container,
.search-container-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.category-header,
.search-header {
    margin-bottom: 32px;
}

.category-header h1,
.search-header h1 {
    font-size: 32px;
    margin-bottom: 8px;
}

.category-desc {
    color: var(--text-secondary);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    font-weight: 500;
    margin-top: 16px;
    transition: var(--transition);
}

.btn:hover {
    background: var(--primary-dark);
}

.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
}

.error-content h1 {
    font-size: 120px;
    color: var(--primary);
    line-height: 1;
}

.error-content h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.error-content p {
    color: var(--text-muted);
}

.main-footer {
    background: linear-gradient(160deg, #0f0820 0%, #1a0a2e 50%, #0d1321 100%);
    border-top: 2px solid transparent;
    border-image: linear-gradient(90deg,#ff6b6b,#ffa94d,#ffd43b,#69db7c,#4dabf7,#9775fa,#f783ac,#ff6b6b) 1;
    margin-top: 48px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 52px 24px 40px;
}
.footer-content.has-apps { grid-template-columns: 1.7fr 1fr 1fr 1fr; }
@media (max-width: 960px) { .footer-content, .footer-content.has-apps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-content, .footer-content.has-apps { grid-template-columns: 1fr; gap: 28px; padding: 32px 18px 24px; } }

/* Brand column */
.footer-brand { display: flex; flex-direction: column; gap: 14px; }

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.footer-logo-name {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa,
        #f783ac, #ff6b6b
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: mdf-shimmer 3.5s linear infinite;
}
.footer-tagline {
    font-size: 13px;
    line-height: 1.65;
    max-width: 300px;
    background: linear-gradient(90deg,
        #f783ac, #ff6b6b, #ffa94d, #ffd43b,
        #69db7c, #4dabf7, #9775fa, #f783ac
    );
    background-size: 250% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: mdf-shimmer 5s linear infinite;
}

/* Colorful social icons */
.footer-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.footer-social-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--social-color, #ccc);
    border: 1.5px solid transparent;
    background-image:
        linear-gradient(rgba(255,255,255,0.07), rgba(255,255,255,0.07)),
        linear-gradient(90deg, #ff6b6b, #ffa94d, #ffd43b, #69db7c, #4dabf7, #9775fa, #f783ac, #ff6b6b);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-size: auto, 300% auto;
    animation: social-icon-shimmer 3s linear infinite;
    transition: transform .18s, box-shadow .18s, background-color .18s;
    text-decoration: none;
    flex-shrink: 0;
    filter: brightness(1.15);
}
.footer-social-icon:hover {
    background-image:
        linear-gradient(rgba(255,255,255,0.13), rgba(255,255,255,0.13)),
        linear-gradient(90deg, #ff6b6b, #ffa94d, #ffd43b, #69db7c, #4dabf7, #9775fa, #f783ac, #ff6b6b);
    background-size: auto, 300% auto;
    animation: social-icon-shimmer .9s linear infinite;
    color: var(--social-color, #fff);
    transform: translateY(-3px) scale(1.12);
    box-shadow: 0 6px 22px color-mix(in srgb, var(--social-color, #888) 50%, transparent);
    filter: brightness(1.3);
}

/* Footer nav columns */
.footer-section h4 {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 16px;
}
.footer-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-section ul a {
    font-size: 13.5px;
    transition: padding-left .18s;
    display: inline-block;
    text-decoration: none;
    background: linear-gradient(90deg,
        #ff6b6b, #ffa94d, #ffd43b, #69db7c,
        #4dabf7, #9775fa, #f783ac, #ff6b6b);
    background-size: 250% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: footer-link-shimmer 3.5s linear infinite;
}
.footer-section ul a:hover {
    padding-left: 5px;
    animation: footer-link-shimmer 1.2s linear infinite;
}

/* App download buttons */
.footer-app-links {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.footer-app-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid transparent;
    background-image:
        linear-gradient(rgba(255,255,255,0.07), rgba(255,255,255,0.07)),
        linear-gradient(90deg, #ff6b6b, #ffa94d, #ffd43b, #69db7c, #4dabf7, #9775fa, #f783ac, #ff6b6b);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    background-size: auto, 300% auto;
    animation: social-icon-shimmer 3.5s linear infinite;
    border-radius: 10px;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: transform .18s, box-shadow .18s;
}
.footer-app-btn svg { flex-shrink: 0; }
.footer-app-btn:hover {
    animation: social-icon-shimmer 1s linear infinite;
    transform: translateX(4px);
    box-shadow: 0 4px 16px rgba(151, 117, 250, .25);
}

/* Platform icon brand colors */
.footer-app-btn[data-platform="ios"] svg     { color: #007AFF; }
.footer-app-btn[data-platform="android"] svg { color: #01875f; }
.footer-app-btn[data-platform="windows"] svg { color: #0078d4; }
.footer-app-btn[data-platform="amazon"] svg  { color: #FF9900; }
.footer-app-btn[data-platform="custom"] svg  { color: #9775fa; }

/* ── Footer rainbow shimmer keyframes ────────────── */
@keyframes footer-link-shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 250% center; }
}
@keyframes mdf-shimmer {
    0%   { background-position: 0% center; }
    100% { background-position: 250% center; }
}
@keyframes social-icon-shimmer {
    0%   { background-position: 0% center, 0% center; }
    100% { background-position: 0% center, 300% center; }
}

.footer-bottom {
    text-align: center;
    padding: 20px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    color: rgba(255,255,255,0.45);
}

@media (max-width: 1024px) {
    .single-container {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .home-container {
        grid-template-columns: 1fr;
    }

    .home-container .sidebar {
        order: 2;
    }

    .home-container .main-feed {
        order: 1;
    }
    
    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .sidebar-section {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .search-container {
        order: 3;
        max-width: 100%;
        flex-basis: 100%;
    }
    
    .single-container {
        grid-template-columns: 1fr;
    }
    
    .article-sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    .article-title {
        font-size: 28px;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .article-content {
        font-size: 16px;
    }
    
    .related-blogs-inline {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-tabs {
        overflow-x: auto;
    }
    
    .article-actions {
        width: 100%;
    }
    
    .action-btn {
        flex: 1;
        justify-content: center;
    }
}

/* =====================
   Static Pages (Contact, Privacy, Terms)
   ===================== */

.static-page-wrap {
    min-height: 70vh;
    padding: 48px 24px;
    background: var(--bg-primary);
}

.static-page {
    max-width: 1080px;
    margin: 0 auto;
}

.static-page-narrow {
    max-width: 760px;
}

.static-page-header {
    text-align: center;
    margin-bottom: 48px;
}

.static-page-header svg {
    color: var(--primary);
    margin: 0 auto 16px;
}

.static-page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.static-page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Contact page layout */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    align-items: start;
}

.contact-form-wrap h2,
.contact-info h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.form-success {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #dcfce7;
    color: #166534;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

[data-theme="dark"] .form-success {
    background: #14532d;
    color: #86efac;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-secondary);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.08);
}

/* Captcha field */
.captcha-group {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
}
.captcha-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
}
.captcha-input {
    width: 140px;
    padding: 9px 14px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}
.captcha-input:focus { border-color: var(--primary); }

.submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
    align-self: flex-start;
}

.submit-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.contact-info {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 16px;
    padding: 28px;
}

.contact-info-items {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 28px;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.contact-info-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-info-item strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.contact-info-item span {
    font-size: 13px;
    color: var(--text-secondary);
}

.contact-social p {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.social-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: transform 0.2s, opacity 0.2s;
    text-decoration: none;
}

.social-link:hover {
    transform: translateY(-2px);
    opacity: 0.88;
}

.social-link.twitter  { background: #1da1f2; }
.social-link.facebook { background: #1877f2; }
.social-link.linkedin { background: #0077b5; }

/* Privacy & Terms */
.policy-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.policy-section {
    padding: 28px 0;
    border-bottom: 1px solid var(--border-color);
}

.policy-section:last-child {
    border-bottom: none;
}

.policy-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.policy-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.75;
    margin-bottom: 10px;
}

.policy-section p:last-child {
    margin-bottom: 0;
}

.policy-section ul {
    margin: 10px 0 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.policy-section ul li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.policy-section a {
    color: var(--primary);
    text-decoration: underline;
}

/* Categories page grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.18s;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(255, 0, 0, 0.08);
    transform: translateY(-2px);
}

.category-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(255, 0, 0, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-card-info {
    flex: 1;
    min-width: 0;
}

.category-card-info h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.category-card-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-card-count {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

.category-card-arrow {
    color: var(--text-tertiary, var(--text-secondary));
    flex-shrink: 0;
    transition: transform 0.2s;
}

.category-card:hover .category-card-arrow {
    transform: translateX(4px);
    color: var(--primary);
}

/* ── Hamburger button ───────────────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background var(--transition);
    padding: 0;
}
.hamburger:hover { background: var(--border-color); }
.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform .25s ease, opacity .2s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile overlay ─────────────────────────────────────────────────── */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 200;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .3s ease;
}
.mobile-overlay.open {
    display: block;
    opacity: 1;
}

/* ── Mobile drawer ──────────────────────────────────────────────────── */
.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 88vw;
    height: 100dvh;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
}
.mobile-drawer.open {
    transform: translateX(0);
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
.mobile-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
}
.mobile-drawer-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
}
.mobile-drawer-close:hover { background: var(--border-color); }

.mobile-drawer-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 20px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    flex-shrink: 0;
}
.mobile-drawer-search svg { color: var(--text-muted); flex-shrink: 0; }
.mobile-drawer-search input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}
.mobile-drawer-search input::placeholder { color: var(--text-muted); }

.mobile-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.mobile-nav-item:hover { background: var(--bg-tertiary); }
.mobile-nav-item.active { background: rgba(255,0,0,.1); color: var(--primary); }
.mobile-nav-item.active svg { color: var(--primary); }
.mobile-nav-item svg { color: var(--text-secondary); flex-shrink: 0; }

.mobile-nav-group {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}
.mobile-nav-group-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding: 4px 12px 8px;
}
.mobile-nav-sub {
    padding-left: 20px;
    font-size: 14px;
    font-weight: 400;
}
.mobile-nav-sub::before {
    content: '•';
    color: var(--text-muted);
    margin-right: 6px;
    font-size: 12px;
}

.mobile-drawer-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}
.mobile-admin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .2s;
}
.mobile-admin-btn:hover { opacity: .88; }

/* Navbar responsive */
@media (max-width: 1100px) {
    .nav-center { display: none; }
    .sns-box { display: none; }
    .hamburger { display: flex; }
    .admin-icon-link { display: none; }
}

/* Filter chips: stack below title on mobile */
@media (max-width: 700px) {
    .feed-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .filter-tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .filter-tabs::-webkit-scrollbar { display: none; }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 10px 16px;
    }
    .nav-right {
        flex: 1;
        justify-content: flex-end;
        gap: 8px;
    }
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ── Ad Slots ─────────────────────────────────────────── */
.site-ad { width: 100%; overflow: hidden; }
.site-ad-header { text-align: center; padding: 6px 0; }
.site-ad-footer { text-align: center; padding: 10px 0; }
.site-ad-blog-top,
.site-ad-blog-bottom { margin: 16px 0; text-align: center; }
.site-ad-blog-middle { margin: 24px 0; text-align: center; }
.site-ad-sidebar { text-align: center; }
.site-ad-between-posts { text-align: center; padding: 12px 0; }
.site-ad ins, .site-ad iframe, .site-ad img { max-width: 100%; }
