/* Header */
.section-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
}

.section-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Add Post Button */
.btn-add-post {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #667eea;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
}

.btn-add-post:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* Blog Container */
.container-blog {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
    background: #f8fafc;
}

/* Blog Grid */
.grid-blog {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

/* Blog Card */
.card-blog {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.card-blog:hover {
    transform: translateY(-5px);
}

.image-blog {
    width: 100%;
    height: 200px;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    overflow: hidden;
    position: relative;
}

.image-blog img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.content-blog {
    padding: 1.5rem;
}

.date-blog {
    background: #e2e8f0;
    color: #64748b;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 1rem;
}

.title-blog {
    font-size: 1.4rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 0.8rem;
}

.excerpt-blog {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.link-read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.link-read-more:hover {
    color: #5a67d8;
}

/* Image count badge */
.badge-image-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* Empty State */
.state-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.state-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1e293b;
}

/* Modal Styles */
.overlay-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.container-modal {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.btn-close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #64748b;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    z-index: 10;
}

.btn-close-modal:hover {
    color: #e74c3c;
    background: #fee2e2;
}

.section-images-modal {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    position: relative;
    border-radius: 20px 20px 0 0;
}

.section-images-modal img {
    width: 100%;
    height: 400px;
    object-fit: cover;
}

.grid-images-modal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    padding: 1rem;
    background: #f8fafc;
}

.grid-images-modal img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.grid-images-modal img:hover {
    transform: scale(1.05);
}

.body-modal {
    padding: 2rem;
}

.title-modal {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.date-modal {
    background: #e2e8f0;
    color: #64748b;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 2rem;
}

/* Better paragraph formatting in modal */
.text-content-modal {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 3rem;
    text-align: left;
}

.text-content-modal p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.text-content-modal p:last-child {
    margin-bottom: 0;
}

.section-contact {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 2rem;
    border-radius: 15px;
    border-top: 4px solid #667eea;
}

.section-contact h3 {
    color: #1e293b;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.grid-contact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.item-contact {
    background: white;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.item-contact strong {
    display: block;
    color: #667eea;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.item-contact a {
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
}

.item-contact a:hover {
    color: #667eea;
}

/* FIXED: Force long words to break and wrap */
.text-content-modal {
    font-size: 1.1rem !important;
    line-height: 1.8 !important;
    color: #374151 !important;
    margin-bottom: 3rem !important;
    text-align: left !important;
    
    /* THESE ARE THE KEY FIXES FOR WORD WRAPPING */
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    white-space: pre-wrap !important;
}

.text-content-modal p {
    margin-bottom: 1.2rem !important;
    line-height: 1.7 !important;
    text-align: left !important;
    
    /* FORCE LONG WORDS TO BREAK */
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}

/* Also fix the modal content container */
.container-modal {
    background-color: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
    
    /* PREVENT MODAL FROM EXPANDING */
    overflow-x: hidden !important;
    word-wrap: break-word !important;
}

.body-modal {
    padding: 2rem;
    
    /* PREVENT CONTENT FROM EXPANDING MODAL */
    overflow-x: hidden !important;
    word-wrap: break-word !important;
}

/* Fix for very long words in titles too */
.title-modal {
    font-size: 2.5rem;
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 1rem;
    line-height: 1.2;
    
    /* BREAK LONG TITLES TOO */
    word-wrap: break-word !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
}

/* Responsive */
@media (max-width: 768px) {
    .section-header h1 {
        font-size: 2rem;
    }
    
    .grid-blog {
        grid-template-columns: 1fr;
    }
    
    .btn-add-post {
        position: static;
        display: block;
        margin: 2rem auto;
        width: fit-content;
    }

    .container-modal {
        width: 95%;
        margin: 5% auto;
    }

    .title-modal {
        font-size: 2rem;
    }

    .body-modal {
        padding: 1.5rem;
    }

    .section-images-modal img {
        height: 250px;
    }
}