/*! blog.css v3.0.1 | Safis Spa Blog Page | MIT License */

/* Blog Page Styles - Content Only */
.page-header {
    background: linear-gradient(135deg, var(--gold) 0%, var(--jade) 100%);
    color: var(--heavenwhite);
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
    /* margin-bottom: 30px; */
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
}

.page-header h1 {
    font-family: 'Mistrully', cursive;
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 20px;
    position: relative;
}

.page-header p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
    position: relative;
}

/* Featured Post */
.featured-post {
    background: linear-gradient(135deg, var(--lavender) 0%, var(--cream) 100%);
}

.featured-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.featured-badge {
    background: var(--gold);
    color: var(--heavenwhite);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 30px;
}

.featured-content h2 {
    font-family: 'mistrully', cursive;
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 20px;
    color: var(--dark);
    line-height: 1.2;
}

.featured-content .post-meta {
    color: var(--lightdark);
    margin-bottom: 25px;
    font-size: 1rem;
}

.featured-content .post-excerpt {
    color: var(--dark);
    margin-bottom: 35px;
    line-height: 1.7;
    font-size: 1.1rem;
}

/* Blog Grid */
.blog-grid-section {
    background: var(--ivory);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
}

.blog-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.blog-image {
    height: 250px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.category-tag {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--jade);
    color: var(--heavenwhite);
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.blog-content {
    padding: 30px;
}

.blog-content h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--gold);
    line-height: 1.3;
    font-weight: 700;
}

.blog-content .post-excerpt {
    color: var(--incense);
    margin-bottom: 20px;
    line-height: 1.6;
}

.blog-content .post-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--gold);
}

.blog-content .post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* No Posts Message */
.no-posts-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    font-size: 1.2rem;
    color: var(--incense);
    background-color: var(--heavenwhite);
    border-radius: 15px;
    box-shadow: var(--shadow);
}

/* Load More Button */
.load-more-container {
    text-align: center;
    margin-top: 50px;
}

#load-more-btn {
    padding: 15px 40px;
    background: var(--gold);
    color: var(--heavenwhite);
    border: none;
    border-radius: 5px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

#load-more-btn:hover {
    background: var(--jade);
    transform: translateY(-3px);
}

/* Blog Post Content Styles (for modal content) */
.blog-post-header {
    margin-bottom: 30px;
    text-align: center;
}

.blog-post-header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--dark);
    line-height: 1.3;
    padding: 50px 15px;
}

.blog-post-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    color: var(--gold);
    flex-wrap: wrap;
    justify-content: center;
    font-size: 0.9rem;
}

.blog-post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.blog-post-image {
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 15px;
    margin-bottom: 30px;
}

.blog-post-content {
    line-height: 1.8;
    color: var(--dark);
    font-size: 1.1rem;
}

.blog-post-content h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    margin: 30px 0 15px;
    color: var(--dark);
    border-bottom: 2px solid var(--gold);
    padding-bottom: 5px;
}

.blog-post-content p {
    margin-bottom: 20px;
}

.blog-post-content blockquote {
    border-left: 4px solid var(--gold);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--incense);
    background: var(--lavender);
    padding: 20px;
    border-radius: 0 10px 10px 0;
}

.blog-post-content ul, .blog-post-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.blog-post-content li {
    margin-bottom: 10px;
}

.blog-post-content strong {
    color: var(--gold);
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, var(--gold) 0%, var(--jade) 100%);
    color: var(--heavenwhite);
    text-align: center;
}

.newsletter-content h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--heavenwhite);
}

.newsletter-content p {
    margin-bottom: 30px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
    gap: 10px;
}

.newsletter-form input {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
}

.newsletter-form .cta-button {
    background: var(--gold);
    color: var(--heavenwhite);
    border: none;
    padding: 15px 25px;
    border-radius: 5px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.newsletter-form .cta-button:hover {
    background: var(--ivory);
    color: var(--dark);
}

/* Fixed Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active,
.modal[aria-hidden="false"] {
    display: flex !important;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--ivory);
    padding: 40px;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal.active .modal-content,
.modal[aria-hidden="false"] .modal-content {
    transform: scale(1);
}

/* Blog Card Interactions */
.blog-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 2px solid transparent;
}

.blog-card:focus {
    outline: none;
    border-color: var(--gold);
    transform: translateY(-5px);
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

/* Loading State */
#loading-screen {
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* No Posts Styling */
.no-posts-message {
    text-align: center;
    padding: 80px 40px;
    background: var(--heavenwhite);
    border-radius: 20px;
    box-shadow: var(--shadow);
    color: var(--incense);
    grid-column: 1 / -1;
}

.no-posts-message h3 {
    color: var(--dark);
    margin-bottom: 15px;
    font-family: 'Cormorant Garamond', serif;
}

.no-posts-message i {
    display: block;
    margin-bottom: 20px;
}

/* Ensure modal close button is always accessible */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gold);
    color: var(--heavenwhite);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover,
.modal-close:focus {
    background: var(--jade);
    transform: rotate(90deg);
    outline: none;
}

/* Better focus styles */
.read-more-btn {
    color: var(--dark) !important;
    border: 1px solid var(--dark) !important;
}
.read-more-btn:focus,
.blog-card:focus {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    color: var(--heavenwhite) !important;
}

/* Responsive modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
        padding: 25px;
        max-height: 90vh;
    }
    
    .blog-post-header h1 {
        font-size: 1.8rem;
    }
    
    .blog-post-image {
        height: 200px;
    }
    
    .blog-post-meta {
        gap: 10px;
        flex-direction: column;
        align-items: center;
    }
    
    .blog-post-content {
        font-size: 1rem;
    }
    
    .blog-post-content h2 {
        font-size: 1.5rem;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 100px 0 60px;
    }
    
    .blog-content {
        padding: 20px;
    }
    
    .blog-post-header h1 {
        font-size: 1.8rem;
    }
    
    .blog-post-image {
        height: 200px;
    }
    
    .newsletter-content h2 {
        font-size: 2rem;
    }
}

/* Force modal display - important fix */
#blog-modal {
    position: fixed !important;
    z-index: 10000 !important;
}

#blog-modal.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}