/* Updated LatestAnnouncementsHP.css */
/* Opsters eSports Announcements */
.recentNews {
    text-align: center; /* Center align the entire section */
}

.news-title {
    padding-top: 30px;
    padding-bottom: 30px;
    font-family: 'nimbus-sans-condensed', sans-serif;
    font-size: 55px;
    font-weight: bold;
    color: #fff;
}

.recentNews .row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center align announcement cards */
    margin-bottom: 30px;
}

.recentNews .ct-blog {
    margin-bottom: 30px;
}

.ct-blog .inner {
    background-color: #FFF;
    padding: 10px;
    transition: all 0.2s ease-in-out 0s;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column; /* Arrange content vertically */
    justify-content: flex-start; /* Align content to the top */
    align-items: flex-start; /* Align items to the start */
    border: 1px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.ct-blog .inner:hover {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.ct-blog .fauxcrop img {
    width: 100%;
    height: auto;
}

.ct-blog-content {
    padding: 20px;
    background-color: #fff;
    width: 100%; /* Ensure content width is 100% */
}

.ct-blog-header {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.4em;
    font-weight: bold;
    text-align: center; /* Center align the header text */
    width: 100%; /* Ensure header width is 100% */
}

.ct-blog-content p {
    margin-top: 0;
    width: 100%; /* Ensure paragraph width is 100% */
}

/* =============================================== */
/*                  MODAL STYLES                   */
/*         (Corrected for image stretching)        */
/* =============================================== */

/* The Modal (background) */
.modal { /* This targets #imageModal or #myModal if they also have this class */
    display: none;
    position: fixed;
    z-index: 1050; /* Increased z-index from original to be safely on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    padding-top: 60px;
    box-sizing: border-box;
}

/* Modal Content (The Image) - CORRECTED */
.modal-content, /* Class for the image element, e.g., <img class="modal-content" id="modalImage"> */
#img01,        /* Possible ID used by JS for the image */
#modalImage    /* Possible ID used by JS/HTML for the image */
{
    margin: auto;
    display: block;
    /* --- Key Fixes for Preventing Stretching --- */
    width: auto;          /* Let width adjust to content or max-width */
    height: auto;         /* Let height adjust to content or max-height, maintaining aspect ratio */
    max-width: 90%;       /* Limit width to 90% of parent (modal background) */
    max-height: 85vh;     /* Limit height to 85% of viewport height */
    object-fit: contain;  /* Ensures entire image fits, letterboxing if needed */
    /* --- End Key Fixes --- */
    border: 2px solid #444; /* Optional: slightly darker border */
    border-radius: 4px;    /* Optional: slightly rounded corners */
}

/* Caption of Modal Image - Adjusted for dynamic height */
.caption,
#caption {
    margin: 15px auto; /* Add top margin */
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    /* height: 150px; FIXED HEIGHT REMOVED - let it be dynamic */
    font-size: 1.1em;
    line-height: 1.4;
}

/* Add Animation - Using a more specific keyframe name */
.modal-content, #img01, #modalImage,
.caption, #caption {
    animation-name: modalElementZoomIn; /* Changed keyframe name */
    animation-duration: 0.6s;
}

@keyframes modalElementZoomIn { /* Changed keyframe name */
    from {transform:scale(0)}
    to {transform:scale(1)}
}

/* The Close Button - More specific selector */
.modal .close { /* Targeting .close specifically within .modal */
    position: absolute;
    top: 20px; /* Slightly adjusted */
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s ease; /* Added 'ease' */
    z-index: 1051; /* Ensure it's above the modal content */
}

.modal .close:hover,
.modal .close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
    transform: scale(1.1); /* Optional: slight zoom on hover */
}

/* Responsive adjustments for modal on smaller screens */
@media only screen and (max-width: 700px){
    .modal-content, #img01, #modalImage {
        max-width: 95%;
        max-height: 80vh;
    }
    .modal .close {
        top: 15px;
        right: 25px;
        font-size: 30px;
    }
    .caption, #caption {
        font-size: 1em;
    }
}
/* =============================================== */
/*            END OF MODAL STYLES                  */
/* =============================================== */


/* Additional CSS for responsiveness of .ct-blog items */
.ct-blog {
    flex: 0 0 calc(100% - 30px);
    max-width: calc(100% - 30px);
    margin: 0 15px 30px;
}

@media (min-width: 576px) {
    .ct-blog {
        flex: 0 0 calc(50% - 30px);
        max-width: calc(50% - 30px);
    }
}

@media (min-width: 992px) {
    .ct-blog {
        flex: 0 0 calc(33.333% - 30px);
        max-width: calc(33.333% - 30px);
    }
}

@media (min-width: 1200px) {
    .ct-blog {
        flex-basis: calc(33.333% - 30px);
        max-width: calc(33.333% - 30px);
    }
}