/* =========================================
   BLOG PAGE STYLES - FINAL
   ========================================= */

:root {
    --deep-blue: #2A4068;
    --primary-blue: #3E5C9A;
    --white: #ffffff;
    --text-grey: #666;
    --font-serif: 'Georgia', serif;
    --font-sans: 'Inter', sans-serif;
}

/* Remove underlines from all links on blog page */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* --- Hero Section --- */
.hero-centered {
    background-color: var(--deep-blue);
    color: var(--white);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 30vh;
    padding-top: 40px;
    padding-bottom: 0px;
    text-align: center;
    overflow: hidden;
}

.hero-centered h1 {
    color: var(--white);
    font-family: var(--font-serif);
    margin-bottom: 10px;
}

.hero-bg-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(62, 92, 154, 0.15) 0%, rgba(42, 64, 104, 0) 70%);
    z-index: 1;
    pointer-events: none;
}

.hero-content-wrapper-center { z-index: 2; position: relative; }

/* Mesh Gradient Blobs */
.mesh-blob {
    position: absolute;
    filter: blur(80px);
    z-index: 1;
    opacity: 0.6;
    animation: float 10s infinite alternate;
}
.blob-1 {
    top: -10%; left: -10%;
    width: 50vw; height: 50vw;
    background: #3E5C9A;
}
.blob-2 {
    bottom: -10%; right: -10%;
    width: 40vw; height: 40vw;
    background: #6b4c9a;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(20px, 40px) scale(1.1); }
}

/* --- Blog Grid --- */
.blog-container {
    max-width: 1200px;
    margin: 20px auto 80px;
    position: relative;
    z-index: 10;
    padding: 0 20px;
}

.blog-grid {
    display: grid;
    /* Force exactly 3 columns on desktop */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: start;
}

/* --- Blog Card --- */
.blog-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.02);
    height: 100%;
    max-height: 460px; /* caps vertical size so cards stay uniform */
}

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

/* --- Blog Card Link Wrapper --- */
.blog-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Image container fixed at 200px */
.blog-img-wrapper {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

/* Ensure all images inside cards are fixed and cropped uniformly */
.blog-card img,
.blog-img {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.4s ease;
}

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

.blog-card-content {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.blog-meta {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #999;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 600;
}

.blog-meta span { color: var(--primary-blue); }

.blog-title, h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    color: var(--deep-blue);
    margin-bottom: 10px;
    line-height: 1.25;
}

.blog-summary {
    font-size: 0.9rem;
    color: var(--text-grey);
    line-height: 1.5;
    margin-bottom: 12px;
    flex-grow: 1;
    overflow: hidden;
}

/* --- Interactions (Like & Share) --- */
.blog-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-more {
    color: var(--deep-blue);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    text-decoration: none;
}

/* --- Call-to-Action Card (Submit Story) --- */
.blog-card-cta {
    background: linear-gradient(135deg, #3E5C9A 0%, #2A4068 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 20px;
    min-height: 460px;
}

.blog-card-cta:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(62, 92, 154, 0.3);
}

.blog-card-cta h3 {
    color: white;
    margin-bottom: 15px;
}

.blog-card-cta .blog-summary {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
}

.blog-card-cta .blog-meta {
    color: rgba(255, 255, 255, 0.7);
}

.blog-card-cta .blog-meta span {
    color: rgba(255, 255, 255, 0.8);
}

.blog-card-cta .blog-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    margin-top: auto;
}

.blog-img-cta {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.blog-card-cta:hover .blog-img-cta {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* --- Modal Reader --- */
.blog-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.blog-modal.active { display: flex; }

.blog-modal-content {
    background: #fff;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 15px;
    position: relative;
    overflow-y: auto;
    margin: auto;
}

.modal-img {
    display: none;
}

.modal-body { 
    padding: 0;
}

.modal-body .blog-author-box {
    margin-top: 40px !important;
    padding: 20px !important;
    background: #f9f9f9 !important;
    border-left: 4px solid #2A4068 !important;
    border-radius: 8px !important;
}

.modal-body .blog-author-box span {
    font-size: 0.8rem !important;
    text-transform: uppercase !important;
    color: #888 !important;
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
}

.modal-body .blog-author-box p {
    margin: 0 !important;
    font-style: italic !important;
    color: #555 !important;
}

.modal-title {
    display: none;
}

.modal-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.modal-author-info {
    display: none;
}

.modal-author-info span {
    color: var(--primary-blue);
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions .action-btn {
    border: 2px solid #ddd;
    padding: 10px 14px;
    font-size: 0.9rem;
}

.modal-text {
    /* Styles handled by blog-full-page wrapper */
}

.blog-full-page {
    display: flex;
    flex-direction: column;
}

.blog-header {
    background: linear-gradient(135deg, #2A4068, #3E5C9A) !important;
    color: white !important;
    padding: 40px 30px !important;
    text-align: center !important;
    border-radius: 0 !important;
}

.blog-header h1 {
    margin: 15px 0 !important;
    font-family: 'Playfair Display', serif !important;
    font-size: 2rem !important;
    color: white !important;
}

.blog-header span {
    font-size: 0.8rem !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    color: #8fb3ff !important;
    display: block !important;
    margin-bottom: 10px !important;
    font-weight: 600 !important;
}

.blog-body {
    padding: 40px 30px !important;
    background: white !important;
    color: #333 !important;
}

.blog-body p {
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

.blog-footer-section {
    background: #f9f9f9 !important;
    padding: 30px 30px !important;
    text-align: center !important;
    border-top: 1px solid #eee !important;
    font-size: 0.95rem !important;
    color: #888 !important;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: #333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 28px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.modal-body { padding: 30px 40px; }

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

/* --- Action Buttons (Like & Share) --- */
.action-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: #f5f5f5;
    border-color: #999;
}

.action-btn.like-btn.liked {
    background: #ffe0e6;
    border-color: #ff4757;
    color: #ff4757;
}

.action-btn.like-btn.liked i {
    animation: likePopin 0.5s ease;
}

/* Universal like button styling for all action buttons */
.action-btn.liked {
    background: #ffe0e6;
    border-color: #ff4757;
    color: #ff4757;
}

.read-btn, .read-more {
    background: linear-gradient(135deg, var(--primary-blue), var(--deep-blue));
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.read-btn:hover, .read-more:hover {
    transform: translateX(4px);
    box-shadow: 0 6px 16px rgba(62, 92, 154, 0.4);
}

/* --- Loading Skeleton --- */
.skeleton-loader {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.skeleton-img {
    width: 100%;
    height: 250px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

.skeleton-title {
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    width: 70%;
}

.skeleton-text {
    height: 14px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    width: 100%;
    margin-bottom: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes likePopin {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Interaction Group */
.interaction-group {
    display: flex;
    gap: 10px;
}

/* Modal action buttons styling */
.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions .action-btn {
    border: 2px solid #ddd;
    padding: 10px 14px;
    font-size: 0.9rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
    .hero-centered { min-height: 200px; padding-top: 100px; }
    .modal-body { padding: 20px; }
    /* On small screens reduce image height a bit to save space */
    .blog-card img,
    .blog-img { height: 160px !important; }
    
    .read-btn, .read-more {
        padding: 8px 14px;
        font-size: 0.75rem;
    }
    
    .blog-header {
        padding: 30px 20px !important;
    }
    
    .blog-body {
        padding: 25px 20px !important;
    }
    
    .blog-header h1 {
        font-size: 1.5rem !important;
    }
}

/* --- Toast Notification --- */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    padding: 18px 28px;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    font-size: 1rem;
    z-index: 9999;
    animation: slideInToast 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 350px;
    border-left: 5px solid #fff;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.toast-notification i {
    font-size: 1.4rem;
    animation: iconBounce 0.6s ease;
}

.toast-notification.fadeOut {
    animation: slideOutToast 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes slideInToast {
    from {
        transform: translateX(450px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutToast {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(450px);
        opacity: 0;
    }
}

@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

@media (max-width: 768px) {
    .toast-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
        padding: 16px 24px;
        font-size: 0.95rem;
        z-index: 9999;
    }
}