/* ==========================================================================
   blog.css — YatrAmore Modular Blog Stylesheet
   ==========================================================================
   This stylesheet styles the typography-first blog listing and distraction-free
   Medium-style reading layout, integrating automatically with YatrAmore's 
   global variables and theme states.
   ========================================================================== */

/* ── 1. Blog Listing Layout ────────────────────────────────────────────── */

.blog-hero {
    min-height: 35vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 10rem 2rem 3rem;
    position: relative;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(107, 66, 38, 0.05) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(230, 220, 207, 0.5) 0%, transparent 50%);
    transition: background 0.8s ease;
}

[data-theme="dark"] .blog-hero {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(212, 196, 176, 0.02) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(18, 18, 18, 0.9) 0%, transparent 50%);
}

.blog-hero h1 {
    font-size: 3.8rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--brand-brown);
    font-weight: 700;
    letter-spacing: -1px;
}

.blog-hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.85;
    max-width: 1200px;
    margin: 0 auto;
}

/* Hero Content & Animations */
.travel-hero-content {
    max-width: 1200px;
    animation: fadeInUp 1s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.travel-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(107, 66, 38, 0.1);
    color: var(--brand-brown);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

[data-theme="dark"] .travel-hero-tag {
    background: rgba(212, 196, 176, 0.1);
}

/* Scroll indicator */
.hero-scroll-indicator {
    margin-top: 2rem;
    animation: bounce 2s infinite;
}

.hero-scroll-indicator span {
    display: block;
    width: 24px;
    height: 40px;
    border: 2px solid rgba(107, 66, 38, 0.35);
    border-radius: 12px;
    margin: 0 auto;
    position: relative;
}

[data-theme="dark"] .hero-scroll-indicator span {
    border-color: rgba(212, 196, 176, 0.35);
}

.hero-scroll-indicator span::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background: var(--brand-brown);
    border-radius: 2px;
    animation: scrollDot 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(6px);
    }
}

@keyframes scrollDot {
    0% {
        opacity: 1;
        top: 6px;
    }
    100% {
        opacity: 0;
        top: 20px;
    }
}

.blog-feed {
    max-width: 1000px;
    margin: 2rem auto 8rem;
    padding: 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* Typographic Post Cards */
.blog-card {
    position: relative;
    padding: 2.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.blog-card:hover {
    transform: translateY(-4px);
    border-color: rgba(107, 66, 38, 0.3);
    box-shadow: 0 12px 30px rgba(107, 66, 38, 0.05);
}

[data-theme="dark"] .blog-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

/* Post Metadata */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0.85;
}

.post-category {
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(107, 66, 38, 0.1);
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    color: var(--brand-brown);
}

[data-theme="dark"] .post-category {
    background: rgba(212, 196, 176, 0.1);
}

.post-meta-divider {
    color: var(--glass-border);
}

/* Post Content */
.blog-card h2 {
    font-size: 1.8rem;
    color: var(--brand-brown);
    font-weight: 700;
    line-height: 1.3;
    margin: 0.2rem 0;
}

.blog-card h2 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card h2 a:hover {
    color: var(--text-main);
}

.post-excerpt {
    font-size: 1.08rem;
    color: var(--text-main);
    line-height: 1.7;
    opacity: 0.9;
}

/* Read Link */
.read-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: var(--brand-brown);
    text-decoration: none;
    font-size: 0.95rem;
    margin-top: 0.5rem;
    width: fit-content;
    transition: all 0.3s ease;
}

/* Expand link to cover the entire card */
.read-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.read-link i {
    font-size: 0.85rem;
    transition: transform 0.3s ease;
}

/* Trigger hover effects when the whole card is hovered */
.blog-card:hover .read-link {
    color: var(--text-main);
}

.blog-card:hover .read-link i {
    transform: translateX(4px);
}


/* ── 2. Distraction-Free Reading Layout (Medium-style) ──────────────── */

.post-layout-wrapper {
    margin-top: 80px; /* Offset fixed header */
    padding: 5rem 0 3rem;
    background-color: var(--bg-main);
}

.post-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Article Header */
.post-header {
    margin-bottom: 3.5rem;
    text-align: left;
}

.post-header-tag {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--brand-brown);
    margin-bottom: 1rem;
}

.post-header h1 {
    font-size: 3rem;
    color: var(--brand-brown);
    line-height: 1.2;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.post-subtitle {
    font-size: 1.4rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 2rem;
    font-weight: 400;
    opacity: 0.9;
}

/* Author Bylines */
.post-byline {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--brand-brown);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 10px rgba(107, 66, 38, 0.05);
}

.byline-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.author-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1rem;
}

.post-date-read {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Article Body Content */
.post-body {
    font-size: 1.18rem;
    line-height: 1.85;
    color: var(--text-main);
}

.post-body p {
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Enhanced Typographic elements */
.post-body h2 {
    font-size: 2rem;
    color: var(--brand-brown);
    margin: 3.5rem 0 1.2rem;
    font-weight: 700;
    line-height: 1.3;
}

.post-body h3 {
    font-size: 1.5rem;
    color: var(--brand-brown);
    margin: 2.5rem 0 1rem;
    font-weight: 600;
}

/* Medium-Style Glassmorphic Blockquotes */
.post-body blockquote {
    font-style: italic;
    font-size: 1.3rem;
    line-height: 1.7;
    color: var(--brand-brown);
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    border-left: 4px solid var(--brand-brown);
    background: var(--glass-bg);
    border-radius: 0 16px 16px 0;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.post-body ul, 
.post-body ol {
    margin: 0 0 2rem 2.5rem;
}

.post-body li {
    margin-bottom: 0.8rem;
    padding-left: 0.2rem;
}

.post-body strong {
    font-weight: 600;
    color: var(--brand-brown);
}

/* Simple Decorative Divider */
.article-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    margin: 4rem 0;
    color: var(--glass-border);
}

.article-divider span {
    width: 6px;
    height: 6px;
    background-color: var(--brand-brown);
    border-radius: 50%;
    opacity: 0.5;
}

/* Post Footer / Navigation back to Feed */
.post-footer {
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
}

.back-to-journal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--brand-brown);
    border-radius: 50px;
    color: var(--brand-brown);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(107, 66, 38, 0.05);
}

.back-to-journal-btn:hover {
    background: var(--brand-brown);
    color: white !important;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(107, 66, 38, 0.15);
}

[data-theme="dark"] .back-to-journal-btn:hover {
    color: var(--brand-dark) !important;
    background: var(--brand-brown);
}


/* ── 3. Responsive Adjustments ──────────────────────────────────────── */

@media (max-width: 768px) {
    .blog-hero {
        padding: 8rem 1.5rem 2.5rem;
    }
    
    .blog-hero h1 {
        font-size: 2.6rem;
    }
    
    .blog-feed {
        gap: 1.8rem;
        margin-bottom: 5rem;
    }
    
    .blog-card {
        padding: 1.8rem;
        border-radius: 16px;
    }
    
    .blog-card h2 {
        font-size: 1.5rem;
    }
    
    .post-layout-wrapper {
        padding: 3rem 0 6rem;
    }
    
    .post-header h1 {
        font-size: 2.2rem;
    }
    
    .post-subtitle {
        font-size: 1.15rem;
        margin-bottom: 1.5rem;
    }
    
    .post-body {
        font-size: 1.1rem;
        line-height: 1.75;
    }
    
    .post-body h2 {
        font-size: 1.6rem;
        margin: 2.5rem 0 1rem;
    }
    
    .post-body blockquote {
        font-size: 1.15rem;
        padding: 1.2rem 1.5rem;
        margin: 2rem 0;
    }
}

/* ── 4. Sticky Filter Bar ────────────────────────────────────────── */
.filter-bar-section {
    padding: 0;
    position: sticky;
    top: 86px;
    z-index: 100;
    background: rgba(253, 251, 247, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transform: translateZ(0);
}

.filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1.5rem 0;
    justify-content: center;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.4rem;
    border: 1.5px solid var(--glass-border);
    border-radius: 50px;
    background: var(--glass-bg);
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(10px);
}

.filter-btn:hover {
    border-color: var(--brand-brown);
    color: var(--brand-brown);
    background: rgba(107, 66, 38, 0.06);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--brand-brown);
    color: white;
    border-color: var(--brand-brown);
    box-shadow: 0 6px 18px rgba(107, 66, 38, 0.3);
}

[data-theme="dark"] .filter-bar-section {
    background: rgba(18, 18, 18, 0.85);
}

[data-theme="dark"] .filter-btn {
    background: rgba(45, 45, 45, 0.6);
}

[data-theme="dark"] .filter-btn:hover {
    background: rgba(212, 196, 176, 0.1);
}

/* Card Category Tags */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    position: relative;
    z-index: 2; /* Keep tags above the absolute link cover */
    background: rgba(107, 66, 38, 0.07);
    color: var(--brand-brown);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 50px;
    transition: background 0.25s ease;
}

.blog-card:hover .tag {
    background: rgba(107, 66, 38, 0.12);
}

[data-theme="dark"] .tag {
    background: rgba(212, 196, 176, 0.1);
    color: var(--brand-brown);
}

[data-theme="dark"] .blog-card:hover .tag {
    background: rgba(212, 196, 176, 0.18);
}

/* Empty State */
.blog-no-results {
    text-align: center;
    padding: 5rem 2rem;
    margin: 3rem 0;
    background: var(--glass-bg);
    border: 1px dashed var(--glass-border);
    border-radius: 20px;
    animation: fadeInUp 0.6s ease-out;
    display: none;
}

.blog-no-results i {
    font-size: 3.5rem;
    color: var(--brand-brown);
    margin-bottom: 1.5rem;
    opacity: 0.4;
}

.blog-no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

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

/* Responsive Sticky Top */
@media (max-width: 768px) {
    .filter-bar-section {
        top: 65px;
    }
}

@media (max-width: 480px) {
    .filter-bar-section {
        top: 65px;
        padding: 0.85rem 1rem;
    }

    .filter-bar {
        gap: 0.75rem;
        justify-content: flex-start;
        overflow-x: auto;
        padding: 0.5rem 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .filter-bar::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1.25rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ── 5. Read State ────────────────────────────────────────── */
.blog-card.post-read {
    opacity: 0.75;
}

.blog-card.post-read h2 a {
    color: var(--text-muted);
}

.read-badge {
    color: #4CAF50;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

[data-theme="dark"] .read-badge {
    color: #81C784;
}
