/* Reset any container constraints */
body, html {
    width: 100%;
    overflow-x: hidden;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
}

/* Main content wrapper */
.main-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    box-sizing: border-box;
}

/* Category section styling */
/* Blog grid container */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Custom scrollbar for blog grid */
.blog-grid::-webkit-scrollbar {
    height: 8px;
}

.blog-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.blog-grid::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

.blog-grid::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* Loading state */
.blog-grid .loading {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background: #f9f9f9;
    border-radius: 10px;
    margin: 1rem 0;
    padding: 2rem;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.loading-text {
    color: #6c757d;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

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

.loading-spinner {
    border: 4px solid rgba(13, 110, 253, 0.1);
    border-left-color: #0d6efd;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* Blog card enhancements */
.blog-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    margin: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

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

.blog-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    color: #2c3e50;
    line-height: 1.4;
}

.blog-card p {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: auto;
}

.read-more {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.read-more:hover {
    color: #2c3e50;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .blog-grid {
        padding: 1rem;
    }
    
    .category-heading {
        font-size: 1.6rem;
        padding-left: 1rem;
    }
    
    .blog-card {
        width: 260px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 1rem 0;
    }
    
    .category-section {
        margin-bottom: 2.5rem;
        padding: 0 0.75rem;
    }
    
    .category-heading {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
        padding-left: 0.75rem;
        max-width: 100%;
    }
    
    .blog-grid {
        gap: 1rem;
        padding: 0.5rem 0.75rem;
    }
    
    .blog-card {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        width: 240px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 0.5rem 0;
    }
    
    .category-section {
        margin-bottom: 2rem;
        padding: 0 0.5rem;
    }
    
    .category-heading {
        font-size: 1.4rem;
        margin: 0 0 1rem 0;
        padding-left: 0.5rem;
    }
    
    .blog-grid {
        gap: 0.75rem;
        padding: 0.5rem;
    }
    
    .blog-card {
        width: 220px;
    }
}

/* Category Sections Container */
.categories-container {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

/* Individual Category Section */
.category-section {
    background: #fff;
    overflow: hidden;
    width: 100vw;
    margin: 0;
    padding: 2rem 0;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    max-width: none !important;
    will-change: transform; /* Optimize for animations */
    backface-visibility: hidden; /* Fix for flickering in WebKit */
}

/* Add subtle separator between categories */
.category-section:not(:last-child) {
    border-bottom: 1px solid #eee;
}

.category-section:hover {
    transform: translateX(-50%) translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Category Header */
.category-header {
    background: linear-gradient(135deg, #3498db, #2c3e50);
    padding: 1rem 2rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto 1.5rem auto;
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
}

.category-heading {
    font-size: 1.5rem;
    margin: 0;
    font-family: 'Bree Serif', serif;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

/* Category Posts Container - Full width with edge-to-edge scrolling */
.category-posts-container {
    width: 100%;
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 0 2rem;
    box-sizing: border-box;
    -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
    scrollbar-width: none;  /* Hide scrollbar for Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.category-posts-container::-webkit-scrollbar {
    display: none;
}

/* Category Navigation */
.category-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-arrow {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    outline: none;
}

.nav-arrow:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.nav-arrow:active:not(:disabled) {
    transform: scale(0.95);
}

.nav-arrow:disabled {
    opacity: 0.2;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.5);
}

.nav-arrow i {
    font-size: 1rem;
    position: relative;
    top: -1px;
}

/* Ensure buttons are clickable on top of content */
.category-nav {
    position: relative;
    z-index: 10;
}

/* Horizontal Scrollable Posts - Full width with edge padding */
.category-posts {
    display: flex;
    gap: 1.5rem;
    padding: 0 max(2rem, calc((100vw - min(1400px, 90vw)) / 2));
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    width: max-content;
    min-width: 100%;
    -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
    scrollbar-width: none;  /* Hide scrollbar for Firefox */
    box-sizing: border-box;
    position: relative;
    margin: 0;
}

/* Add some padding to the first and last items for better scroll experience */
.category-posts::before,
.category-posts::after {
    content: '';
    flex: 0 0 1px;
    width: 1px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.category-posts::-webkit-scrollbar {
    display: none;
}

/* Blog Card Styles for Horizontal Layout */
.blog-card {
    scroll-snap-align: start;
    min-width: 300px;
    max-width: 350px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
    margin: 0;
    position: relative;
}

.blog-card:first-child {
    margin-left: 0;
}

.blog-card:last-child {
    margin-right: 0;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* Ensure the first and last cards have proper spacing */
.category-posts:before,
.category-posts:after {
    content: '';
    flex: 0 0 1rem;
}

/* Responsive Adjustments */
@media (max-width: 1400px) {
    .category-header,
    .category-posts-container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 989.98px) {
    .category-header {
        padding: 0.75rem 1rem;
    }
    
    .category-heading {
        font-size: 1.3rem;
    }
    
    .nav-arrow {
        width: 28px;
        height: 28px;
    }
    
    .blog-card {
        min-width: 280px;
    }
    
    .category-posts {
        padding: 0.5rem 0.25rem 1.5rem;
        scroll-padding: 0 1rem;
    }
}

/* Blog Hero Section */
.blog-hero {
    background: #fff;
    color: #000 !important;
    text-align: center;
    padding: 120px 0 80px;
    margin-top: 0;
    position: relative;
}

.blog-hero .container {
    position: relative;
    z-index: 2;
}

.blog-hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    font-weight: 700;
    color: #000 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Bree Serif', serif;
}

.blog-hero p {
    font-size: 1.3rem;
    max-width: 700px;
    margin: 0 auto;
    color: rgba(0, 0, 0, 1);
    line-height: 1.6;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 15px 0 0;
    margin: 20px 0 0;
    font-size: 0.9rem;
}

.breadcrumb-item {
    margin: 0 10px;
}

.breadcrumb-item a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #fff;
}

.breadcrumb-item.active {
    color: #fff;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding-right: 10px;
    color: #fff;
}

/* Blog Post Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 40px auto;
    max-width: 900px;
    width: 90%;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 30px;
    color: #666;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: #000;
    background: #fff;
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
}

.blog-post-modal-content {
    display: flex;
    flex-direction: column;
}

.blog-post-modal-media {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.blog-post-modal-media img,
.blog-post-modal-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.blog-post-modal-details {
    padding: 30px;
}

.blog-post-modal-category {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.blog-post-modal-date {
    color: #888;
    font-size: 0.9em;
    margin-bottom: 15px;
    display: block;
}

.blog-post-modal-title {
    font-size: 2em;
    margin: 0 0 20px 0;
    color: var(--primary);
    line-height: 1.3;
}

.blog-post-modal-body {
    line-height: 1.8;
    color: #444;
    margin-bottom: 25px;
}

.blog-post-modal-body p {
    margin-bottom: 1.5em;
}

@media (max-width: 989.98px) {
    .blog-post-modal-media {
        height: 250px;
    }
    
    .blog-post-modal-details {
        padding: 20px;
    }
    
    .blog-post-modal-title {
        font-size: 1.6em;
    }
}

/* Loading Spinner */
.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: var(--accent);
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

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

/* Blog Posts Section */
.blog-posts {
    padding: 80px 0;
    background-color: #f8f9fa;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-family: 'Bree Serif', serif;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 3px;
    background-color: var(--accent);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.section-header p {
    color: #6c757d;
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto;
}

.blog-grid {
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 2rem;
    width: 100% !important;
    padding: 2rem 0;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 2rem;
}

.blog-grid .blog-card {
    flex: 0 0 auto;
    width: 300px;
    scroll-snap-align: start;
}

.blog-image,
.blog-video {
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.blog-video video {
    width: 100%;
    display: block;
    background: #000;
}

.blog-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.blog-image {
    position: relative;
    height: 250px;
    overflow: hidden;
}

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

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

.date {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: var(--accent);
    color: #fff;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.blog-content {
    padding: 30px;
}

.blog-content h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    line-height: 1.4;
    font-family: 'Bree Serif', serif;
}

.blog-content h2 a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-content h2 a:hover {
    color: var(--accent);
}

/* Category Tag */
.category {
    display: inline-block;
    background: #e9f5ff;
    color: #2c7be5;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-content p {
    color: #6c757d;
    line-height: 1.7;
    margin-bottom: 20px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.read-more i {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.read-more:hover {
    color: #b8942b;
}

.read-more:hover i {
    transform: translateX(5px);
}

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

.pagination-list {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination-item {
    margin: 0 5px;
}

.pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    color: #2c3e50;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid #eee;
}

.pagination-link:hover,
.pagination .page-item.active .page-link {
    background-color: var(--accent);
    border-color: var(--accent);
}

.pagination-link.prev,
.pagination-link.next {
    width: auto;
    padding: 0 20px;
    border-radius: 30px;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .blog-hero h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 989.98px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-hero h1 {
        font-size: 2.2rem;
    }
    
    .blog-hero p {
        font-size: 1.1rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
    }
}

.blog-content h2 a:hover {
    color: var(--primary-color);
}

.blog-content p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

.read-more {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.read-more i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.read-more:hover {
    color: #0056b3;
}

.read-more:hover i {
    transform: translateX(5px);
}

/* Category text in posts */
.post-category {
    color: #d4af37; /* Gold color to match headings */
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    margin-right: 1rem;
}

/* Blog Post Page */
.blog-post {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 20px;
}

.blog-post-header {
    text-align: center;
    margin-bottom: 50px;
}

.blog-post-header .date {
    position: static;
    display: inline-block;
    margin-bottom: 15px;
}

.blog-post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    line-height: 1.3;
}

.blog-post-meta {
    color: #666;
    margin-bottom: 30px;
}

.blog-post-image {
    width: 100%;
    height: 450px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 30px;
}

.blog-post-content {
    line-height: 1.8;
    color: #444;
}

.blog-post-content h2 {
    font-size: 1.8rem;
    margin: 40px 0 20px;
    color: #333;
}

.blog-post-content p {
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 992px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 989.98px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-hero h1 {
        font-size: 2.5rem;
    }
    
    .blog-post-header h1 {
        font-size: 2rem;
    }
    
    .blog-post-image {
        height: 300px;
    }
}
