/* ===================================
   BLOG PAGE CSS
   Styles specific to blog.php
   =================================== */

/* ===== FALLBACK VARIABLES (duplicated from style.css for reliability) ===== */
:root {
    --trippal-primary: #FF7F14;
    --trippal-dark: #0A1556;
    --trippal-navy: #1B2B4B;
    --trippal-blue: #2D3A6E;
    --trippal-light-orange: #FFF5ED;
    --trippal-gray: #F5F7FA;
    --trippal-gray-light: #F9F6F1CC;
    --trippal-text: #333333;
    --trippal-text-light: #666666;
    --trippal-text-grey: #616B7D;
    --trippal-border: rgba(10, 21, 86, 0.09);
    --trippal-success: #28A745;
    --trippal-star: #FFB800;
    --trippal-white: #FFFBF8;
}

/* ===== BG CLASS FALLBACKS (in case style.css bg-trippal isn't applied) ===== */
.bg-trippal-fallback {
    background-color: #0A1556 !important;
}

/* ===== BODY ===== */
body {
    background: #FFFBF8;
    background: var(--trippal-white, #FFFBF8);
}

/* ===== HERO SECTION ===== */
.blog-hero {
    position: relative;
    min-height: 440px;
    padding: 70px 0 120px;
    overflow: hidden;
    background-color: #0A1556;
    background-color: var(--trippal-dark, #0A1556);
}

.blog-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("../image/about-hero-bg.svg");
    background-size: 100% auto;
    background-position: center bottom;
    background-repeat: no-repeat;
    opacity: 0.7;
    z-index: 0;
}

.blog-hero-dots {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255,127,20,0.15) 1px, transparent 1px);
    background-size: 30px 30px;
}

.blog-hero-content {
    position: relative;
    z-index: 2;
    padding: 20px 20px;
    text-align: center;
}

/* 18px to match .about-hero-tagline on the about page. */
.blog-hero-tagline {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: #FF7F14;
    color: var(--trippal-primary, #FF7F14);
    font-weight: 600;
    margin-bottom: 18px;
}

/* No font-size here on purpose: .about-hero-title also declares none, so both
   titles inherit the same responsive h1 size and stay in step at any width.
   The step-downs below mirror .about-hero-title's media queries (28/24/20). */
.blog-hero-title {
    font-weight: 600;
    color: #FFFBF8;
    color: var(--trippal-white, #FFFBF8);
    line-height: 1.25;
    margin-bottom: 32px;
    letter-spacing: -0.5px;
}

.blog-hero-search-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 251, 248, 0.5);
    margin-bottom: 10px;
}

.blog-search-wrap {
    max-width: 480px;
    margin: 0 auto;
}

.blog-search-box {
    position: relative;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 4px;
    transition: all 0.3s;
}

.blog-search-box:hover,
.blog-search-box:focus-within {
    border-color: rgba(255, 127, 20, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.blog-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 251, 248, 0.4);
    font-size: 14px;
    z-index: 2;
}

.blog-search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 14px 20px 14px 44px;
    color: #FFFBF8;
    color: var(--trippal-white, #FFFBF8);
    font-size: 14px;
    border-radius: 8px;
}

.blog-search-input::placeholder {
    color: rgba(255, 251, 248, 0.35);
    font-size: 13px;
}

.blog-search-input:focus {
    background: rgba(255, 255, 255, 0.04);
}

/* ===== FEATURED ARTICLE ===== */
.featured-section {
    position: relative;
    z-index: 10;
    padding: 60px 0 60px;
}

.featured-card {
    background:#FEFDFA;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(10, 21, 86, 0.08), 0 4px 12px rgba(10, 21, 86, 0.04);
    overflow: hidden;border: 1px solid #E2DDD3;
}

.featured-card-row {
    display: flex;
    min-height: 280px;
}

.featured-content-col {
    flex: 1;
    padding: 36px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-image-col {
    flex: 0 0 38%;
    background: linear-gradient(135deg, #FFF5ED 0%, #FFE8D6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.featured-image-icon {
    width: 80px;
    height: 80px;
    opacity: 0.25;
    color: #FF7F14;
    color: var(--trippal-primary, #FF7F14);
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: #FFE8CD;
    border: 1px solid #FF7F1459;
    color: #060E37;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    width: fit-content;
}

.category-badge.beige {
    background: #F9F3E7;
    color: #8B6914;
}

.category-badge.green {
    background: #E8F5E9;
    color: #2E7D32;
}

.category-badge.purple {
    background: #F3E5F5;
    color: #6A1B9A;
}

.category-badge.blue {
    background: #E3F2FD;
    color: #1565C0;
}

.category-badge.dark {
    background: #E8EAF6;
    color: #283593;
}

/* No font-size here for the same reason as .blog-hero-title: the about page's
   headings (.story-title, .reason-title) declare none and inherit the fluid h2
   size, so this card title stays in step with them. Step-downs match below. */
.featured-title {
    font-family: 'Sora', sans-serif;
    font-weight: 600;
    color: #0A1556;
    color: var(--trippal-dark, #0A1556);
    line-height: 42px;
    margin-bottom: 14px;
}

/* 14px to match the body copy size used by .story-desc on the about page. */
.featured-excerpt {
    font-size: 14px;
    color: #616B7D;
    color: var(--trippal-text-grey, #616B7D);
    line-height: 1.6;
    margin-bottom: 22px;
    max-width: 420px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #616B7D;
    color: var(--trippal-text-grey, #616B7D);
    margin-bottom: 22px;
    flex-wrap: wrap;    
    line-height: 24px;
    letter-spacing: 2%;
}

.article-author {
    font-weight: 700;
    color: #0A1556;
}

.article-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #616B7D;
    background: var(--trippal-text-grey, #616B7D);
    opacity: 0.5;
}

.btn-read {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: #FF7F14;
    background: var(--trippal-primary, #FF7F14);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s;
    width: fit-content;
    cursor: pointer;
}

.btn-read:hover {
    background: #E55A00;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 102, 0, 0.25);
    text-decoration: none;
}

.btn-read-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: transparent;
    color: #FF7F14;
    color: var(--trippal-primary, #FF7F14);border: 2px solid #FF7F14;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2%;
    text-transform: uppercase;
    text-decoration: none;
    transition: all 0.3s;
    width: fit-content;
    cursor: pointer;
}

.btn-read-outline:hover {
    background: #FF7F14;
    background: var(--trippal-primary, #FF7F14);
    color: white;
    text-decoration: none;
}

/* ===== MAIN CONTENT AREA ===== */
.blog-main {
    background: #FAF6ED;
    padding: 50px 0 70px;
}

.blog-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.blog-content-area {
    flex: 1;
    min-width: 0;
}

.blog-sidebar {
    flex: 0 0 300px;
    position: sticky;
    top: 100px;
}

/* ===== CATEGORY FILTERS ===== */
/* Full-width row above .blog-layout, so the tabs span the articles grid and the
   sidebar together and the row below holds both columns. */
.category-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: #FFFBF8;
    background: var(--trippal-white, #FFFBF8);border: 2px solid #E2DDD3;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 500;
    color: #0A1556;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-decoration: none;
}

.filter-btn:hover {
    border-color: #FF7F14;
    border-color: var(--trippal-primary, #FF7F14);
    color: #FF7F14;
    color: var(--trippal-primary, #FF7F14);
}

.filter-btn.active {
    background: #FFE8CD;
    color: #060E37;border: 2px solid #FF7F14;
    box-shadow: 0 2px 8px rgba(255, 127, 20, 0.2);
}

.filter-btn.active:hover {
    background: #E55A00;
    color: white;
}

/* ===== ARTICLE GRID ===== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}

.article-card {
    background: #FEFDFA;
    border-radius: 30px;
    padding: 24px;border: 1px solid #E2DDD3;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    box-shadow: 0px 2px 8px 0px #0913570D;

box-shadow: 0px 1px 2px 0px #0913570F;

}

.article-card:hover {
    box-shadow: 0 8px 24px rgba(10, 21, 86, 0.08);
    transform: translateY(-3px);
    border-color: rgba(255, 127, 20, 0.15);
}

.article-card .category-badge {
    margin-bottom: 12px;
    border: 1px solid #FF7F1459;
    font-size: 12px;
}

.article-card-title {
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #0A1556;
    color: var(--trippal-dark, #0A1556);
    line-height: 28px;
    margin-bottom: 10px;
}

.article-card-title a {
    color: inherit;
    text-decoration: none;
}

.article-card-title a:hover {
    color: #FF7F14;
    color: var(--trippal-primary, #FF7F14);
}

.article-card-excerpt {
    font-size: 14px;
    color: #616B7D;
    line-height: 24px;
    margin-bottom: 16px;
    flex: 1;
}

.article-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.article-card-meta-left {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #616B7D;
    color: var(--trippal-text-grey, #616B7D);
}

.article-card-meta-left .article-author {
    font-size: 11px;
}

.article-read-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.article-read-time i {
    font-size: 10px;
    opacity: 0.7;
}

/* ===== SIDEBAR ===== */
.sidebar-card {
    background: #FEFDFA;
    border-radius: 30px;
    padding: 24px;border: 1px solid #E2DDD3;
    margin-bottom: 22px;
    box-shadow: 0px 2px 8px 0px #0913570D;box-shadow: 0px 1px 2px 0px #0913570F;

}

.sidebar-title {
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #0A1556;
    color: var(--trippal-dark, #0A1556);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title i {
    color: #FF7F14;
    color: var(--trippal-primary, #FF7F14);
    font-size: 13px;
}

.popular-posts {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: popular;
}

.popular-posts li {
    counter-increment: popular;
    padding: 9px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.popular-posts li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.popular-posts li:first-child {
    padding-top: 0;
}

.popular-posts li::before {
    content: counter(popular);
    flex-shrink: 0;
    
    color: #060E37;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    line-height: 23px;
    font-family: 'Sora', sans-serif;
    margin-top: 1px;
}

.popular-post-link {
    font-size: 14px;
    color: #0A1556;
    font-weight: 500;
    line-height: 24px;
    letter-spacing: 2%;
    text-decoration: underline;
    text-decoration-color: #FF7F14;
    transition: color 0.2s;
}

.popular-post-link:hover {
    color: #FF7F14;
    color: var(--trippal-primary, #FF7F14);
}


/* ===== POLICIES SECTION ===== */
.policies-section {
    padding: 50px 0 70px;
    background: #FFFBF8;
}

.policies-card {
    background: #FEFDFA;
    background: var(--trippal-white, #FFFBF8);
    border-radius: 30px;
    border: 1px solid #E2DDD3;
    padding: 22px 32px;
    box-shadow: 0px 2px 8px 0px #0913570D;

box-shadow: 0px 1px 2px 0px #0913570F;

}

.policies-section-title {
    font-family: 'Sora', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #0A1556;
    line-height: 28px;
    margin-bottom: 8px;
    padding-bottom: 10px;
    border-bottom: 1px solid #E2DDD3;
}

.policy-item {
    padding: 18px 0;
    border-bottom: 1px solid #E2DDD3;
}

.policy-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.policy-item:first-child {
    padding-top: 12px;
}

.policy-title {
    font-size: 16px;
    line-height: 26px;
    font-weight: 700;
    color: #0A1556;
    color: var(--trippal-dark, #0A1556);
    margin-bottom: 6px;
}

.policy-desc {
    font-size: 14px;
    color: #616B7D;
    color: var(--trippal-text-grey, #616B7D);
    line-height: 1.6;
    padding-bottom: 0px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
    /* Matches .about-hero-title at the same breakpoint. */
    .blog-hero-title {
        font-size: 28px;
    }

    /* Matches .story-title's tablet size on the about page. */
    .featured-title {
        font-size: 20px;
    }

    .featured-card-row {
        flex-direction: column;
    }

    .featured-image-col {
        min-height: 180px;
        order: -1;
    }

    .featured-content-col {
        padding: 28px;
    }

    .blog-layout {
        flex-direction: column;
        gap: 30px;
    }

    .blog-sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .policies-card {
        padding: 22px;
    }
}

@media (max-width: 768px) {
    .blog-hero-title {
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .blog-hero {
        min-height: 380px;
        padding: 50px 0 100px;
    }

    .blog-hero-title {
        font-size: 20px;
    }

    .featured-title {
        font-size: 18px;
    }

    .featured-content-col {
        padding: 22px;
    }

    .category-filters {
        gap: 8px;
    }

    .filter-btn {
        padding: 7px 14px;
        font-size: 12px;
    }

    .article-card {
        padding: 20px;
    }

    .article-card-title {
        font-size: 15px;
    }
}

/* ===== INFINITE SCROLL (blog listing only) ===== */
/* Watched by IntersectionObserver; keeps a 1px target just below the grid. */
#blog-sentinel {
    height: 1px;
    width: 100%;
}

.blog-loader {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 26px 0 6px;
    color: var(--trippal-text-grey, #616B7D);
    font-size: 13px;
}

.blog-loader.is-active {
    display: flex;
}

.blog-loader-dots {
    display: inline-flex;
    gap: 4px;
}

.blog-loader-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--trippal-primary, #FF7F14);
    animation: blog-loader-pulse 1.2s infinite ease-in-out;
}

.blog-loader-dots i:nth-child(2) { animation-delay: 0.18s; }
.blog-loader-dots i:nth-child(3) { animation-delay: 0.36s; }

@keyframes blog-loader-pulse {
    0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
    40%           { opacity: 1;    transform: scale(1); }
}

.blog-end {
    text-align: center;
    padding: 22px 0 6px;
    color: var(--trippal-text-grey, #616B7D);
    font-size: 13px;
}

/* Respect a reduced-motion preference: the dots still show, they just stop moving. */
@media (prefers-reduced-motion: reduce) {
    .blog-loader-dots i {
        animation: none;
        opacity: 0.6;
    }
}
