/* ==========================================================================
   SPINELLANKA TOURISM - Blog & WhatsApp Integration CSS
   ========================================================================== */

/* Font Import for modern look */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #1A237E;
    --primary-dark: #0f1654;
    --secondary-color: #43cea2;
    --text-color: #2D3748;
    --light-bg: #F7FAFC;
    --border-color: #E2E8F0;
    --whatsapp-green: #25D366;
    --whatsapp-pulse: rgba(37, 211, 102, 0.3);
}

/* ==========================================================================
   1. Floating WhatsApp Widget Styles
   ========================================================================== */
.whatsapp-floating-widget {
    position: fixed;
    bottom: 95px; /* Floats cleanly above the currency selector */
    right: 30px;
    z-index: 2000;
    display: flex;
    align-items: center;
    direction: ltr;
}

.whatsapp-tooltip {
    background: #1A237E;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-right: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(15px);
    transition: all 0.3s ease;
    pointer-events: none;
    font-family: 'Outfit', sans-serif;
}

.whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background-color: var(--whatsapp-green);
    border-radius: 50%;
    color: #fff;
    font-size: 32px;
    box-shadow: 0 4px 18px rgba(37, 211, 102, 0.5);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.whatsapp-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0 0 var(--whatsapp-pulse);
    animation: whatsappPulse 1.8s infinite;
}

.whatsapp-floating-widget:hover .whatsapp-tooltip {
    opacity: 1;
    transform: translateX(0);
}

.whatsapp-floating-widget:hover .whatsapp-btn {
    transform: scale(1.1) rotate(10deg);
}

@keyframes whatsappPulse {
    0% {
        box-shadow: 0 0 0 0 var(--whatsapp-pulse);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* Hide on dashboard pages or specific screens if needed */
.whatsapp-floating-widget.hidden {
    display: none;
}

/* ==========================================================================
   2. Blog Page Hero Section
   ========================================================================== */
.blog-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.55)), url('../images/vi2.jpeg') no-repeat center center/cover;
    color: #fff;
    padding: 80px 20px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.blog-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.blog-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.blog-hero p {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
    line-height: 1.6;
}

/* ==========================================================================
   3. Blog Listing Container & Layout
   ========================================================================== */
.blog-container {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    font-family: 'Outfit', sans-serif;
}

.blog-main-grid {
    display: grid;
    grid-template-columns: 14fr 6fr;
    gap: 40px;
}

/* Category Filters */
.blog-categories-wrapper {
    margin-bottom: 40px;
}

.blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-pill {
    display: inline-block;
    padding: 8px 18px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-pill:hover,
.category-pill.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.15);
}

/* Post Cards Grid */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.blog-post-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 30px rgba(26, 35, 126, 0.08);
}

.blog-card-img-wrap {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    display: block;
    background: #e2e8f0;
}

.blog-card-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.blog-card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--secondary-color);
    color: #fff;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    z-index: 5;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-meta {
    font-size: 13px;
    color: #718096;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.blog-card-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--primary-color);
}

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

.blog-card-title a:hover {
    color: var(--secondary-color);
}

.blog-card-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4A5568;
    margin-bottom: 20px;
    flex-grow: 1;
}

.blog-card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    display: flex;
    justify-content: flex-start;
}

.blog-card-readmore {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: gap 0.2s ease;
}

.blog-card-readmore:hover {
    color: var(--secondary-color);
    gap: 12px;
}

/* Pagination */
.blog-pagination {
    margin-top: 50px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-num:hover,
.page-num.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.15);
}

/* ==========================================================================
   4. Blog Sidebar Widgets
   ========================================================================== */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.sidebar-widget {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--secondary-color);
}

/* Search Widget */
.search-widget-form {
    display: flex;
    gap: 8px;
}

.search-widget-input {
    flex-grow: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.search-widget-input:focus {
    border-color: var(--primary-color);
}

.search-widget-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

/* Recent Posts Widget */
.recent-post-item {
    display: flex;
    gap: 15px;
    margin-bottom: 18px;
}

.recent-post-item:last-child {
    margin-bottom: 0;
}

.recent-post-thumb {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #e2e8f0;
}

.recent-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.recent-post-link {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
    text-decoration: none;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.recent-post-link:hover {
    color: var(--secondary-color);
}

.recent-post-date {
    font-size: 12px;
    color: #718096;
}

/* WhatsApp Promo Widget */
.promo-widget {
    background: linear-gradient(135deg, #1A237E 0%, #2a5298 100%);
    color: #fff;
    text-align: center;
    border: none;
}

.promo-widget .widget-title {
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.promo-widget .widget-title::after {
    background: #fff;
}

.promo-widget p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 24px;
    line-height: 1.5;
}

.promo-whatsapp-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--whatsapp-green);
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
}

.promo-whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
    background: #20ba5a;
}

/* ==========================================================================
   5. Blog Details Page (Article View)
   ========================================================================== */
.article-header {
    margin-bottom: 30px;
}

.article-category {
    background: rgba(67, 206, 162, 0.15);
    color: var(--primary-color);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-title {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--primary-color);
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.article-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    color: #718096;
    font-size: 0.9rem;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.article-meta-row span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-featured-img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.article-body p {
    margin-bottom: 24px;
}

.article-body h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 40px 0 20px 0;
}

.article-body h3 {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 30px 0 15px 0;
}

.article-body blockquote {
    background: var(--light-bg);
    border-left: 4px solid var(--primary-color);
    padding: 20px 30px;
    margin: 30px 0;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #4A5568;
}

.article-body ul, .article-body ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

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

/* Social Share Links */
.article-share-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 50px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.share-title {
    font-weight: 700;
    font-size: 0.95rem;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

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

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s ease;
}

.share-btn.facebook { background-color: #3b5998; }
.share-btn.whatsapp { background-color: #25d366; }
.share-btn.twitter { background-color: #1da1f2; }

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

/* ==========================================================================
   6. Related Travel Packages Section
   ========================================================================== */
.related-packages-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--border-color);
}

.related-packages-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 25px;
    text-transform: capitalize;
}

.related-packages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.related-package-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.related-package-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(26, 35, 126, 0.08);
}

.related-pkg-img-wrap {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
    background: #e2e8f0;
}

.related-pkg-img-wrap img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-pkg-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.related-pkg-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--primary-color);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8rem; /* Keeps titles aligned */
}

.related-pkg-title a {
    color: inherit;
    text-decoration: none;
}

.related-pkg-title a:hover {
    color: var(--secondary-color);
}

.related-pkg-meta {
    font-size: 13px;
    color: #718096;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
}

.related-pkg-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: #007bff;
    margin-top: auto;
}

.related-pkg-footer {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.related-pkg-btn {
    display: block;
    background: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

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

/* ==========================================================================
   7. Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
    .blog-main-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .blog-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .related-packages-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 60px 15px;
    }
    
    .blog-hero h1 {
        font-size: 2.2rem;
    }
    
    .blog-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        grid-template-columns: 1fr;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .whatsapp-floating-widget {
        bottom: 75px !important;
        right: 20px !important;
    }
}

@media (max-width: 480px) {
    .related-packages-grid {
        grid-template-columns: 1fr;
    }
    
    .whatsapp-btn {
        width: 50px;
        height: 50px;
        font-size: 26px;
    }
    
    .whatsapp-tooltip {
        display: none; /* Hide on very small screens to save space */
    }
    
    .whatsapp-floating-widget {
        bottom: 70px !important;
        right: 15px !important;
    }
}
