/* ============================================ 
   BLOG SECTION STYLES
   Dedicated CSS for Contentful Blog
   ============================================ */

.blog-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
    padding: 20px 0;
}

/* Filter Buttons */
.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(154, 46, 53, 0.4);
    color: #e0e0e0;
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-transform: uppercase;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.filter-btn:hover {
    background: rgba(154, 46, 53, 0.2);
    border-color: #ff5555;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(154, 46, 53, 0.3);
}

.filter-btn.active {
    background: #9a2e35;
    background: linear-gradient(135deg, #9a2e35 0%, #7a1e25 100%);
    color: #fff;
    border-color: #ff5555;
    box-shadow: 0 0 20px rgba(154, 46, 53, 0.6);
    transform: scale(1.05);
}

/* Light Mode Filter Buttons */
body.light-mode .filter-btn {
    background: #fff;
    color: #444;
    border-color: #ddd;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

body.light-mode .filter-btn:hover {
    border-color: #9a2e35;
    color: #9a2e35;
    background: #fff;
}

body.light-mode .filter-btn.active {
    background: #9a2e35;
    color: #fff;
    border-color: #9a2e35;
    box-shadow: 0 4px 15px rgba(154, 46, 53, 0.4);
}

/* Blog Grid */
.blog-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    min-height: 200px;
    padding: 20px 0;
}

/* Blog Cards */
.blog-card {
    background: rgba(15, 15, 15, 0.85);
    border: 1px solid rgba(154, 46, 53, 0.3);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: rgba(154, 46, 53, 0.8);
    box-shadow: 0 20px 40px rgba(154, 46, 53, 0.15);
}

body.light-mode .blog-card {
    background: #ffffff;
    border-color: #eee;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* Card Image */
.blog-card-image {
    height: 220px;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

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

/* CATEGORY TAG - Critical Styling */
.blog-category-tag {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    background: #9a2e35 !important;
    background: linear-gradient(135deg, #9a2e35 0%, #b33941 100%) !important;
    color: #ffffff !important;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
    z-index: 10 !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
}

/* Card Content */
.blog-card-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-date {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

.blog-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #ffffff;
    line-height: 1.3;
}

body.light-mode .blog-title {
    color: #1a1a1a;
}

.blog-summary {
    font-size: 1rem;
    color: #b0b0b0;
    margin-bottom: 25px;
    flex: 1;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

body.light-mode .blog-summary {
    color: #555;
}

/* READ MORE BUTTON - Critical Styling */
.blog-read-more {
    background: transparent !important;
    border: none !important;
    color: #9a2e35 !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em !important;
    padding: 10px 0 !important;
    text-align: left !important;
    transition: all 0.3s ease !important;
    align-self: flex-start !important;
    border-bottom: 2px solid transparent !important;
    font-size: 0.9rem !important;
    display: inline-block !important;
    margin-top: auto !important;
    font-family: 'Lato', sans-serif !important;
}

.blog-read-more:hover {
    color: #ff5555 !important;
    transform: translateX(5px) !important;
    text-shadow: 0 0 10px rgba(154, 46, 53, 0.4) !important;
}

body.light-mode .blog-read-more {
    color: #b33941 !important;
}

/* Detail View */
.blog-detail {
    background: rgba(15, 15, 15, 0.95);
    padding: 50px;
    border-radius: 20px;
    border: 1px solid rgba(154, 46, 53, 0.3);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    margin-top: 20px;
    animation: slideUpFade 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

body.light-mode .blog-detail {
    background: #ffffff;
    border-color: #eee;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}

.btn-back {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: #ccc;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 30px;
    margin-bottom: 30px;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-back:hover {
    background: #9a2e35;
    border-color: #9a2e35;
    color: #fff;
    transform: translateX(-5px);
}

body.light-mode .btn-back {
    background: #f5f5f5;
    color: #555;
    border-color: #ddd;
}

body.light-mode .btn-back:hover {
    background: #9a2e35;
    color: #fff;
    border-color: #9a2e35;
}

.detail-image {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

body.light-mode .detail-header {
    border-bottom-color: rgba(0,0,0,0.1);
}

.detail-category {
    color: #ff5555;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
}

body.light-mode .detail-category {
    color: #9a2e35;
}

.detail-date {
    color: #888;
    font-size: 0.95rem;
}

.blog-detail-content h1 {
    font-size: 3rem;
    margin: 0 0 40px;
    color: #fff;
    line-height: 1.2;
    font-weight: 800;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

body.light-mode .blog-detail-content h1 {
    color: #111;
    text-shadow: none;
}

.detail-body {
    font-size: 1.2rem;
    line-height: 1.9;
    color: #d0d0d0;
    max-width: 900px;
    margin: 0 auto;
}

body.light-mode .detail-body {
    color: #333;
}

.detail-body p {
    margin-bottom: 25px;
}

/* Rich Text Specific Styles */
.detail-body.rich-text h1, .detail-body.rich-text h2, .detail-body.rich-text h3 {
    margin-top: 50px;
    margin-bottom: 20px;
    color: #fff;
    line-height: 1.3;
}
body.light-mode .detail-body.rich-text h1, 
body.light-mode .detail-body.rich-text h2, 
body.light-mode .detail-body.rich-text h3 {
    color: #222;
}

.detail-body.rich-text h2 { 
    font-size: 2rem; 
    border-bottom: 2px solid #9a2e35; 
    display: inline-block; 
    padding-bottom: 10px; 
}

.detail-body.rich-text h3 { 
    font-size: 1.5rem; 
    color: #ff5555; 
}

.detail-body.rich-text ul, .detail-body.rich-text ol {
    margin-left: 20px;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.03);
    padding: 30px 30px 30px 50px;
    border-radius: 10px;
    border-left: 4px solid #9a2e35;
}

body.light-mode .detail-body.rich-text ul, 
body.light-mode .detail-body.rich-text ol {
    background: #f9f9f9;
}

.detail-body.rich-text li {
    margin-bottom: 12px;
}

.embedded-image {
    margin: 40px 0;
    text-align: center;
}
.embedded-image img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Loading */
.blog-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: #ccc;
    font-size: 1.2rem;
}

.no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: #888;
    font-size: 1.2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(154, 46, 53, 0.3);
    border-top: 4px solid #9a2e35;
    border-radius: 50%;
    margin: 0 auto 25px;
    animation: spin 1s linear infinite;
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .blog-container {
        grid-template-columns: 1fr;
    }
    .blog-detail {
        padding: 25px;
        margin-top: 10px;
    }
    .blog-detail-content h1 {
        font-size: 2rem;
    }
    .detail-body {
        font-size: 1.05rem;
    }
    .filter-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}
