/* Editorial Minimalist Travel Portal Theme */

:root {
    /* Colors */
    --color-primary: #D97706;
    --color-primary-dark: #B45309;
    
    --color-bg: #FFFFFF;
    --color-white: #FFFFFF;
    --color-text-main: #111827;
    --color-text-light: #6B7280;
    --color-border: #E5E7EB;
    
    /* Typography */
    --font-sans: 'Inter', 'Noto Sans Thai', sans-serif;
    
    /* Layout */
    --border-radius: 8px;
}

/* Dark Mode Overrides */
html.dark {
    --color-bg: #0c0a09; /* stone-950 */
    --color-white: #0c0a09; /* swap white elements to dark */
    --color-text-main: #d6d3d1; /* stone-300 */
    --color-text-light: #a8a29e; /* stone-400 */
    --color-border: #292524; /* stone-800 */
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

/* Layout Utilities */
.site-wrapper {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

/* Modern Header Styles */
.site-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 40px;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    height: 80px;
}

.brand-anchor {
    display: flex;
    align-items: center;
}
.brand-anchor a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-text-main);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.global-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}
.global-nav ul.nav { 
    margin: 0; 
    padding: 0; 
    list-style: none !important; 
    display: flex; 
    gap: 2rem; 
}
.global-nav ul.nav li {
    display: inline-block;
}
.global-nav ul.nav li a { 
    display: block; 
    padding: 10px 0; 
    color: var(--color-text-light); 
    font-weight: 500; 
    font-size: 15px;
    transition: color 0.2s ease; 
}
.global-nav ul.nav li a:hover,
.global-nav ul.nav li.nav-current a { 
    color: var(--color-text-main); 
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}
.header-subscribe-btn {
    background: var(--color-primary);
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    white-space: nowrap;
}
.header-subscribe-btn:hover {
    background: var(--color-primary-dark);
    color: white;
}
.search-btn {
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
}
.search-btn:hover {
    color: var(--color-primary);
}
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-main);
    padding: 8px;
}

/* Featured Article Hero */
.featured-article {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-bottom: 60px;
    padding-bottom: 40px;
}
.featured-image-link {
    display: block;
    overflow: hidden;
    margin-bottom: 30px;
    aspect-ratio: 21/9;
    background: #f3f4f6;
}
.featured-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.featured-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}
.featured-tag {
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 12px;
}
.featured-title {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--color-text-main);
}
.featured-excerpt {
    font-size: 18px;
    color: var(--color-text-light);
    margin-bottom: 24px;
}
.featured-meta {
    font-size: 14px;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* Main Dashboard (Single Column) */
.dashboard-module {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 60px;
    width: 100%;
}
.dashboard-main {
    width: 100%;
}

/* Horizontal Post Cards */
.post-card-horizontal {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    padding-bottom: 30px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--color-border);
}
.post-card-horizontal:last-child {
    border-bottom: none;
}
.post-card-image-link {
    display: block;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #f3f4f6;
}
.post-card-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.post-card-image-link:hover img {
    transform: scale(1.05);
}
.post-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.post-card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}
.post-card-title a {
    color: var(--color-text-main);
}
.post-card-title a:hover {
    color: var(--color-primary);
}
.post-card-excerpt {
    font-size: 15px;
    color: var(--color-text-light);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Sidebar Widgets */
.sidebar-widget {
    margin-bottom: 40px;
}
.sidebar-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-main);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-text-main);
}
.category-list {
    list-style: none;
    padding: 0;
}
.category-list li a {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    color: var(--color-text-main);
    border-bottom: 1px solid var(--color-border);
    font-size: 15px;
    font-weight: 500;
}
.category-list li a:hover {
    color: var(--color-primary);
}
.social-links {
    display: flex;
    gap: 15px;
}
.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-main);
    transition: all 0.2s;
}
.social-link:hover {
    background: var(--color-text-main);
    color: #fff;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
    margin-top: 20px;
}
.btn-page {
    background: #fff;
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 14px;
}
.btn-page:hover:not(.disabled) {
    border-color: var(--color-text-main);
    color: var(--color-text-main);
}
.btn-page.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.page-number {
    font-size: 14px;
    color: var(--color-text-light);
    font-weight: 500;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 60px 20px;
    text-align: center;
    background: #fff;
    color: var(--color-text-light);
}
.site-footer a { color: var(--color-primary); }

/* Ghost Koenig Image Widths (Validation Fix) */
.kg-width-wide { width: 100%; max-width: 1040px; margin-left: auto; margin-right: auto; }
.kg-width-full { width: 100vw; max-width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; }
.kg-width-full img, .kg-width-wide img { width: 100%; height: auto; border-radius: var(--border-radius); }

/* Responsive */
@media (max-width: 900px) {
    .dashboard-module {
        flex-direction: column;
    }
    .post-card-horizontal {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .post-card-image-link {
        aspect-ratio: 16/9;
    }
    .brand-anchor a {
        font-size: 18px;
    }
    .featured-title {
        font-size: 32px;
    }
}

/* Post Container Constraints */
.post-content, 
.gh-content {
    max-width: 720px; /* Optimal line length for editorial reading */
    margin: 0 auto;
    padding: 0;
}

/* Fix image overflow */
/* Post Feature Image Wrapper & Skeleton */
.post-full-image-wrapper {
    aspect-ratio: 16/9;
    max-height: 600px;
    width: 100%;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    background: linear-gradient(to right, #f3f4f6 8%, #e5e7eb 18%, #f3f4f6 33%);
    background-size: 800px 100%;
    animation: shimmer 2s infinite linear;
}
.post-full-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gh-feature-image img,
.post-content img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    object-fit: cover;
}

/* Sidebar Ad Box */
.sidebar-ad-box {
    margin-top: 1rem;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
}

.ad-label {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 6px;
    font-weight: 600;
}

.ad-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    opacity: 0.9;
    transition: opacity 0.2s ease;
}

.ad-img:hover {
    opacity: 1;
}
@media (max-width: 768px) {
    .global-nav ul.nav {
        display: none;
    }
    .global-nav.menu-open ul.nav {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--color-white);
        border-bottom: 1px solid var(--color-border);
        padding: 10px 0;
        z-index: 50;
    }
    .header-inner {
        padding-left: 16px;
        padding-right: 16px;
    }
    .featured-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    .featured-excerpt {
        font-size: 0.9rem;
        padding: 0 8px;
    }
    .hero-fade-title {
        font-size: 1.5rem;
    }
    .hero-fade-subtitle {
        font-size: 0.95rem;
    }
    .post-full-title {
        font-size: 1.75rem !important;
    }
    .dashboard-sidebar {
        margin-top: 2rem;
        padding-top: 1.5rem;
        border-top: 1px dashed #e5e7eb;
    }
    .sidebar-ad-box img,
    .sidebar-ad-box .ad-img {
        max-height: 160px;
        object-fit: cover;
    }
    .mobile-menu-toggle {
        display: block !important;
    }
}

/* Post Header Desktop Styles */
.post-full-header {
    text-align: center;
    margin-bottom: 24px;
    padding-top: 20px;
}
.post-full-title {
    margin-bottom: 16px;
    font-size: 2.5rem;
    line-height: 1.2;
    color: var(--color-text-main);
}
.post-meta-details {
    justify-content: center;
    gap: 8px;
    border: none;
    font-size: 14px;
    color: #6b7280;
}

/* Editor (Koenig) Typography Restoration */
.gh-content {
    font-size: 1.1rem;
    line-height: 1.8;
}
.gh-content p {
    margin-bottom: 1.5em;
}
.gh-content h1, .gh-content h2, .gh-content h3, .gh-content h4, .gh-content h5, .gh-content h6 {
    margin-top: 2em;
    margin-bottom: 0.8em;
    color: var(--color-text-main);
    font-weight: 700;
    line-height: 1.3;
}
.gh-content h2 { font-size: 1.8em; }
.gh-content h3 { font-size: 1.5em; }
.gh-content h4 { font-size: 1.25em; }
.gh-content ul, .gh-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}
.gh-content li {
    margin-bottom: 0.5em;
}
.gh-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 1.2em;
    margin: 2em 0;
    font-style: italic;
    color: var(--color-text-light);
    font-size: 1.2em;
}
.gh-content a {
    color: var(--color-primary);
    text-decoration: underline;
}
.gh-content a:hover {
    color: var(--color-primary-dark);
}
.gh-content figure {
    margin: 2em 0;
}
.gh-content figcaption {
    font-size: 0.85em;
    color: var(--color-text-light);
    text-align: center;
    margin-top: 0.8em;
}
.gh-content pre {
    background: #f1f3f5;
    padding: 1.2em;
    border-radius: 8px;
    margin-bottom: 1.5em;
    overflow-x: auto;
    font-size: 0.9em;
}
.gh-content code {
    background: #f1f3f5;
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}
.gh-content hr {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 3em 0;
}

/* 1. Remove default theme top spacing from main container */
main,
.site-main,
.gh-main {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* 2. Ensure header has no bottom margin pushing main down */
header,
.gh-navigation,
.gh-head {
    margin-bottom: 0 !important;
}

/* Full-viewport width container to prevent side gaps */
.hero-fade-wrapper {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-top: 0 !important;
    padding: 1.5rem 1rem; /* py-6 */
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background 0.5s ease;
}
@media (min-width: 768px) {
    .hero-fade-wrapper {
        padding: 2.5rem 1rem; /* md:py-10 */
    }
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 247, 237, 0.4); /* orange-50/40 */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Vector Background Moods */
.bg-mood-travel {
    background-color: #fce7d2;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.83v58.34h-58.34l-.83-.83A29.952 29.952 0 0 0 0 29.742 29.952 29.952 0 0 0 29.742 0h24.885zM56 2l-.829-.829H30.285A27.95 27.95 0 0 1 2 29.742a27.95 27.95 0 0 1 28.285 28.285h24.886l.829-.829V2z' fill='%23f9d5b0' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
}
.bg-mood-tech {
    background-color: #e0f2fe; /* sky-100 */
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='1' fill='%23bae6fd'/%3E%3C/svg%3E");
}
.bg-mood-lifestyle {
    background-color: #f0fdf4; /* green-50 */
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20.5V18H0v-2h20v-2H0v-2h20v-2H0V8h20V6H0V4h20V2H0V0h22v20h2V0h2v20h2V0h2v20h2V0h2v20h2v2H20v-1.5z' fill='%23bbf7d0' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
}

/* Inner content constraint so typography stays aligned with page grid */
.hero-fade-content {
    max-width: 672px; /* max-w-2xl */
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.hero-glass-panel {
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2rem 1.5rem; /* px-6 py-8 */
    border-radius: 1.5rem; /* rounded-3xl */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem; /* gap-4 */
    position: relative;
    z-index: 10;
}
@media (min-width: 768px) {
    .hero-glass-panel {
        padding: 3rem 2.5rem; /* md:px-10 md:py-12 */
    }
}
html.dark .hero-glass-panel {
    background-color: rgba(28, 25, 23, 0.75); /* Dark mode glass */
}

.hero-fade-title {
    color: var(--color-text-main); 
    font-size: 1.5rem; /* text-2xl */
    font-weight: 700; /* font-bold */
    line-height: 1.2;
    margin: 0;
}
@media (min-width: 768px) {
    .hero-fade-title {
        font-size: 1.875rem; /* md:text-3xl */
    }
}

.hero-fade-subtitle {
    color: var(--color-text-light);
    font-size: 0.875rem; /* text-sm */
    font-weight: 500;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .hero-fade-subtitle {
        font-size: 1rem; /* md:text-base */
    }
}



/* Style for primary tag link in post view */
.post-header-tag {
    display: inline-flex;
    align-items: center;
    background-color: #fef3c7; /* Soft amber/orange accent tint */
    color: #d97706;            /* Brand orange text */
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 9999px;     /* Pill shape */
    text-decoration: none;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.post-header-tag:hover {
    background-color: #fde68a;
    color: #b45309;
}

/* Tag Sections (Homepage) */
.tag-section {
    margin-bottom: 3.5rem;
    background: #FFFDF9;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid rgba(231, 229, 228, 0.8);
    width: 100%;
}

.tag-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1f2937;
    padding-bottom: 12px;
    margin-bottom: 24px;
}

.tag-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag-section-view-all {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}
.tag-section-view-all:hover {
    opacity: 0.8;
}

.tag-post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .tag-post-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .tag-post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .tag-section {
        padding: 1.5rem 1rem;
    }
}
@media (max-width: 480px) {
    .tag-post-grid {
        grid-template-columns: 1fr;
    }
}

.tag-post-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e7e5e4;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}
.tag-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.tag-post-image {
    aspect-ratio: 16/10;
    display: block;
    overflow: hidden;
    /* Skeleton Loading Effect */
    background: #f3f4f6;
    background: linear-gradient(to right, #f3f4f6 8%, #e5e7eb 18%, #f3f4f6 33%);
    background-size: 800px 100%;
    animation: shimmer 2s infinite linear;
}
.tag-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.tag-post-card:hover .tag-post-image img {
    transform: scale(1.05);
}
.tag-post-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-post-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.tag-badge {
    align-self: flex-start;
    background: #fef3c7;
    color: var(--color-primary);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.tag-post-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 6px;
    line-height: 1.4;
}
.tag-post-title a {
    color: inherit;
    text-decoration: none;
}
.tag-post-title a:hover {
    color: #d97706;
}

.tag-post-excerpt {
    font-size: 0.85rem;
    color: #4b5563;
    line-height: 1.4;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tag-post-meta {
    font-size: 0.8rem;
    color: #9ca3af;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Style B: Featured Lead + Side Minis */
.tag-style-b-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 24px;
}
.tag-lead-card .tag-post-image {
    aspect-ratio: 16/9;
    max-height: 400px;
}
.tag-lead-card .tag-post-title {
    font-size: 1.5rem;
}
.tag-mini-stack {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    height: 100%;
}
.tag-mini-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e7e5e4;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    height: auto;
    padding: 12px;
    gap: 16px;
}
.tag-mini-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.tag-mini-image {
    flex: 0 0 112px;
    height: 112px;
    border-radius: 8px;
    overflow: hidden;
    /* Skeleton Loading Effect */
    background: #f3f4f6;
    background: linear-gradient(to right, #f3f4f6 8%, #e5e7eb 18%, #f3f4f6 33%);
    background-size: 800px 100%;
    animation: shimmer 2s infinite linear;
}
.tag-mini-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.tag-mini-card:hover .tag-mini-image img {
    transform: scale(1.05);
}
.tag-mini-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.tag-badge-small {
    align-self: flex-start;
    background: #fef3c7;
    color: var(--color-primary);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 8px;
}

/* In-Feed Sponsored Ad */
.in-feed-ad {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--color-bg); 
    border: 1px dashed var(--color-border);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 3.5rem;
    gap: 16px;
    width: 100%;
    min-height: 80px; /* CLS fix */
}
.in-feed-ad:empty {
    position: relative;
    background-color: transparent;
}
.in-feed-ad:empty::after {
    content: "Support our site. Contact for advertising.";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    color: var(--color-text-light);
}
.in-feed-ad-content {
    display: flex;
    align-items: center;
    gap: 16px;
}
.in-feed-ad-badge {
    background: #fef3c7;
    color: var(--color-primary);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 4px;
}
.in-feed-ad-text {
    font-size: 0.95rem;
    color: #4b5563;
    margin: 0;
}
.in-feed-ad-btn {
    background: var(--color-primary);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s;
}
.in-feed-ad-btn:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

/* Footer Grid */
.site-footer {
    background: #1f2937;
    color: #f3f4f6;
    padding: 3rem 0;
    border-top: 1px solid #374151;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 32px;
    }
}
.footer-col h3 {
    font-size: 1.125rem; /* text-lg */
    font-weight: 700; /* font-bold */
    color: #f5f5f4; /* text-stone-100 */
    margin-bottom: 1rem; /* mb-4 */
    background: transparent !important;
}
.footer-col p {
    font-size: 0.9rem;
    color: #9ca3af;
    line-height: 1.6;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-col ul li {
    margin-bottom: 12px;
}
.footer-col ul li a {
    color: #a8a29e; /* text-stone-400 */
    font-size: 0.875rem; /* text-sm */
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.footer-col ul li a:hover {
    color: #f5f5f4; /* hover:text-white */
}
.footer-col ul li a span {
    background: #292524; /* bg-stone-800 */
    color: #d6d3d1; /* text-stone-300 */
    padding: 2px 10px; /* px-2.5 py-0.5 */
    border-radius: 9999px;
    font-size: 0.75rem; /* text-xs */
    font-weight: 500;
    transition: background-color 0.2s;
}
.footer-col ul li a:hover span {
    background: #44403c; /* hover bg-stone-700 */
}
.copyright {
    margin-top: 16px;
    font-size: 0.8rem !important;
}
.social-links-footer {
    display: flex;
    gap: 12px;
}
.social-links-footer a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #374151;
    color: #ffffff;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.social-links-footer a:hover {
    background: var(--color-primary);
}

@media (max-width: 768px) {
    .in-feed-ad {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Custom Category Section Colors */
.tag-section-travel {
    background: #FAF7F2;
    border-color: rgba(253, 230, 138, 0.6);
}
.tag-section-travel .tag-badge {
    background: #fef3c7;
    color: #92400e;
}

.tag-section-lifestyle {
    background: #FFFDF9;
    border-color: rgba(231, 229, 228, 0.8);
}
.tag-section-lifestyle .tag-badge,
.tag-section-lifestyle .tag-badge-small {
    background: #ffedd5;
    color: #9a3412;
}

.tag-section-technology {
    background: #F8FAFC;
    border-color: rgba(226, 232, 240, 0.8);
}
.tag-section-technology .tag-badge {
    background: #e0f2fe;
    color: #075985;
}

/* Style C: Horizontal List */
.tag-style-c-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tag-horizontal-card {
    display: flex;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e7e5e4;
    overflow: hidden;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}
.tag-horizontal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.tag-horizontal-card .tag-post-image {
    flex: 0 0 32%;
    min-width: 250px;
    max-width: 320px;
    aspect-ratio: 16/9;
}
.tag-horizontal-card .tag-post-content {
    flex: 1;
    justify-content: center;
}

/* Responsive Overrides for B and C */
@media (max-width: 900px) {
    .tag-style-b-grid {
        grid-template-columns: 1fr;
    }
    .tag-horizontal-card {
        flex-direction: column;
    }
    .tag-horizontal-card .tag-post-image {
        flex: auto;
    }
}
@media (max-width: 600px) {
    .tag-mini-card {
        flex-direction: column;
    }
    .tag-mini-image {
        flex: auto;
        aspect-ratio: 16/9;
    }
}

/* Sticky Sidebar Ad */
.sticky-widget {
    position: sticky;
    top: 100px;
}

/* Mobile Responsive Utility Adjustments */
@media (max-width: 768px) {
    .header-subscribe-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    .brand-anchor a {
        font-size: 1.125rem;
        line-height: 1.25;
    }
    .tag-section {
        padding: 1rem;
    }
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -800px 0;
    }
    100% {
        background-position: 800px 0;
    }
}

/* Tag Archive Page */
.tag-archive-header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #1f2937; /* border-stone-800 */
}
.tag-archive-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1c1917; /* stone-900 */
    text-transform: uppercase;
    margin: 0 0 0.5rem 0;
}
.tag-archive-description {
    font-size: 1.125rem;
    color: #78716c; /* stone-500 */
    margin-bottom: 1rem;
}
.tag-archive-count {
    display: inline-block;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
}

/* Pagination */
.pagination-wrapper {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}
.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #4b5563;
}
.pagination a {
    color: var(--color-primary);
    text-decoration: none;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s;
}
.pagination a:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Category Empty State Fallback */
.category-empty-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 1rem;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px dashed #e7e5e4; /* border-stone-200 */
    border-radius: 0.75rem; /* rounded-xl */
    text-align: center;
}
.empty-icon {
    color: #d6d3d1; /* text-stone-300 */
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}
.empty-title {
    font-size: 1.125rem; /* text-lg */
    font-weight: 700;
    color: #292524; /* text-stone-800 */
    margin: 0 0 0.25rem 0;
}
.empty-subtitle {
    font-size: 0.875rem; /* text-sm */
    color: #78716c; /* text-stone-500 */
    margin: 0;
}

/* Section Icons */
.tag-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem; /* 2xl equivalent */
    font-weight: 700;
    text-transform: uppercase;
}
.section-icon {
    width: 1.5rem;
    height: 1.5rem;
}
.icon-yellow { color: #facc15; } /* text-yellow-400 */
.icon-amber { color: #d97706; } /* text-amber-600 */
.icon-orange { color: #ea580c; } /* text-orange-600 */
.icon-sky { color: #0284c7; } /* text-sky-600 */

/* Interesting Posts (Editor's Picks) */
.interesting-posts-section {
    background: #1c1917; /* stone-900 */
    color: #ffffff;
    border-radius: 1.5rem; /* 3xl */
    padding: 1.5rem; /* p-6 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}
@media (min-width: 768px) {
    .interesting-posts-section {
        padding: 2rem; /* p-8 */
    }
}
.interesting-posts-section .tag-section-title {
    color: #ffffff;
}
.interesting-post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .interesting-post-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .interesting-post-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
.interesting-post-card {
    background: #292524; /* stone-800 */
    border: 1px solid #44403c; /* stone-700 */
    border-radius: 0.75rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}
.interesting-post-card:hover {
    transform: translateY(-4px);
}
.interesting-post-image {
    aspect-ratio: 16/10;
    display: block;
    overflow: hidden;
    background: #44403c;
}
.interesting-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.interesting-post-card:hover .interesting-post-image img {
    transform: scale(1.05);
}
.interesting-post-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.interesting-post-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 0.5rem;
}
.interesting-post-title a {
    color: #f5f5f4; /* stone-100 */
    text-decoration: none;
}
.interesting-post-title a:hover {
    color: #facc15;
}

/* Reading Progress Bar */
.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px; /* h-1 */
    background: transparent;
    z-index: 50;
    pointer-events: none;
}
.reading-progress-bar {
    height: 100%;
    background: var(--color-primary);
    width: 0%;
    transition: width 0.1s ease-out;
}

/* Dark Mode Toggle Button */
.theme-toggle-btn {
    background: transparent;
    border: none;
    color: var(--color-text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s, color 0.2s;
}
.theme-toggle-btn:hover {
    background-color: var(--color-border);
}
.theme-toggle-btn.hidden {
    display: none;
}

/* ==========================================================================
   Comprehensive Dark Mode Overrides
   ========================================================================== */
   
html.dark .site-footer {
    background-color: #0c0a09;
    border-top: 1px solid #292524;
}

html.dark .tag-section-travel,
html.dark .tag-section-lifestyle,
html.dark .tag-section-technology,
html.dark .category-block {
    background-color: #1c1917 !important; /* stone-900 */
    border-color: #292524 !important; /* stone-800 */
}

html.dark .tag-section-title {
    color: #f5f5f4 !important; /* stone-100 */
}
html.dark .section-icon {
    color: #d6d3d1 !important; /* stone-300 */
}

html.dark .section-header {
    border-bottom-color: #44403c; /* stone-700 */
}

html.dark .category-empty-state {
    background-color: rgba(28, 25, 23, 0.3) !important; /* stone-900/30 */
    border-color: #44403c !important; /* stone-700 */
}

html.dark .empty-title {
    color: #e7e5e4 !important; /* stone-200 */
}

html.dark .empty-subtitle {
    color: #a8a29e !important; /* stone-400 */
}

html.dark .empty-icon {
    color: #78716c !important; /* stone-500 */
}

html.dark .hero-fade-wrapper {
    background-color: #0c0a09 !important; /* stone-950 */
    background-image: none !important;
}

html.dark .hero-glass-panel {
    background-color: #1c1917 !important; /* stone-900 */
    border: 1px solid #292524 !important; /* stone-800 */
}

html.dark .hero-fade-title {
    color: #ffffff !important;
}

html.dark .hero-fade-subtitle {
    color: #a8a29e !important;
}

html.dark .in-feed-ad {
    background-color: #1c1917 !important; /* stone-900 */
    border: none !important;
}

html.dark .in-feed-ad-text {
    color: #a8a29e !important; /* stone-400 */
}

html.dark .post-card-content {
    background-color: #1c1917 !important; /* stone-900 */
}
