/* ===================================
   Modern Blog Page Styles
=================================== */

/* Page Header */
.page-header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 6rem 0 4rem;
    margin-top: 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.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 20"><defs><radialGradient id="a" cx="50" cy="50" r="50"><stop offset="0" stop-color="%23ffffff" stop-opacity=".1"/><stop offset="100" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle fill="url(%23a)" cx="10" cy="10" r="10"/><circle fill="url(%23a)" cx="30" cy="5" r="8"/><circle fill="url(%23a)" cx="50" cy="15" r="6"/><circle fill="url(%23a)" cx="70" cy="8" r="9"/><circle fill="url(%23a)" cx="90" cy="12" r="7"/></svg>');
    background-size: 200px 100px;
    opacity: 0.3;
}

.page-header-content {
    position: relative;
    z-index: 2;
}

.page-header-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--white);
    font-weight: 700;
}

.page-header-content p {
    font-size: 1.3rem;
    margin-bottom: 0;
    opacity: 0.9;
    color: var(--white);
    max-width: 600px;
    margin: 0 auto;
}

/* Blog Section */
.blog-section {
    padding: 5rem 0;
    background: var(--light-gray);
}

/* Blog Posts Grid */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

/* Blog Card */
.blog-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(11, 130, 163, 0.1);
    transition: all 0.4s ease;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(11, 130, 163, 0.2);
}

/* Blog Card Image */
.blog-card-image {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.1);
}

.blog-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(11, 130, 163, 0.8) 0%, rgba(23, 178, 201, 0.6) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 1.5rem;
}

.blog-card:hover .blog-card-overlay {
    opacity: 1;
}

.blog-card-date {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    transform: translateY(-20px);
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-date {
    transform: translateY(0);
}

/* Blog Card Content */
.blog-card-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--dark-blue);
    margin-bottom: 1rem;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.blog-card:hover .blog-card-title {
    color: var(--primary-color);
}

.blog-card-excerpt {
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    font-size: 1rem;
}

/* Blog Card Footer */
.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--light-gray);
    margin-top: auto;
}

.blog-card-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray);
    font-size: 0.9rem;
}

.blog-card-author i {
    color: var(--primary-color);
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
}

.blog-card-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.blog-card-link:hover::after {
    width: 100%;
}

.blog-card-link:hover {
    color: var(--secondary-color);
    transform: translateX(3px);
}

.blog-card-link i {
    transition: transform 0.3s ease;
}

.blog-card-link:hover i {
    transform: translateX(3px);
}

/* Blog Modal */
.blog-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.blog-modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-content {
    background: var(--white);
    border-radius: 20px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    margin: 2rem;
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.blog-modal.show .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: var(--primary-color);
}

.modal-body {
    padding: 3rem;
}

.modal-body h1 {
    font-size: 2.5rem;
    color: var(--dark-blue);
    margin-bottom: 1rem;
}

.modal-body p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--gray);
    font-size: 1.05rem;
}

.modal-body h2 {
    color: var(--dark-blue);
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.modal-body h3 {
    color: var(--primary-color);
    margin: 1.5rem 0 1rem;
    font-size: 1.2rem;
}

/* Animations */
.blog-card {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add stagger animation */
.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.4s; }
.blog-card:nth-child(5) { animation-delay: 0.5s; }
.blog-card:nth-child(6) { animation-delay: 0.6s; }

/* Responsive Design */
@media (max-width: 1200px) {
    .blog-posts-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .page-header {
        padding: 4rem 0 3rem;
    }
    
    .page-header-content h1 {
        font-size: 2.5rem;
    }
    
    .page-header-content p {
        font-size: 1.1rem;
    }
    
    .blog-section {
        padding: 3rem 0;
    }
    
    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-card-content {
        padding: 1.5rem;
    }
    
    .blog-card-title {
        font-size: 1.2rem;
    }
    
    .blog-card-excerpt {
        font-size: 0.9rem;
    }
    
    .blog-card-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .blog-card-link {
        text-align: center;
        padding: 0.5rem 1rem;
        background: var(--light-blue);
        border-radius: 8px;
        justify-content: center;
    }
    
    .modal-content {
        margin: 1rem;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 2rem;
    }
    
    .modal-body h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .page-header-content h1 {
        font-size: 2rem;
    }
    
    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 0 -0.5rem;
    }
    
    .blog-card {
        margin: 0 0.5rem;
    }
    
    .blog-card-image {
        height: 220px;
    }
    
    .blog-card-content {
        padding: 1rem;
    }
    
    .blog-card-title {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
}

/* Loading Animation */
.blog-posts-grid.loading .blog-card {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Focus States for Accessibility */
.blog-card:focus-within {
    outline: 3px solid var(--accent-color);
    outline-offset: 3px;
}

.blog-card-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .blog-card {
        border: 2px solid var(--dark-gray);
    }
    
    .blog-card-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .blog-card,
    .blog-card-image img,
    .blog-card-overlay,
    .blog-card-date,
    .blog-card-link {
        transition: none;
        animation: none;
    }
    
    .blog-card:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .blog-modal,
    .modal-overlay,
    .modal-close {
        display: none;
    }
    
    .blog-posts-grid {
        display: block;
    }
    
    .blog-card {
        break-inside: avoid;
        margin-bottom: 2rem;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .blog-card-image {
        height: 200px;
    }
    
    .blog-card-link {
        display: none;
    }
}
