﻿.grid.news {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Adjust to your layout */
    gap: 1rem;
}

    .grid.news .card {
        display: flex;
        flex-direction: column;
        justify-content: space-between;                
        border-radius: 8px; /* Optional */
    }

    .grid.news .card-content {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }

    .grid.news .ArticlesHeader {        
        flex-grow: 0 !important;
    }

    .grid.news .ArticlesDesc {
        flex-grow: 1;
    }

    .grid.news .readmorearticle {
        margin-top: auto;
        align-self: flex-start; /* Optional: or center/end depending on your layout */
    }



.reviewtime {
    padding-top: 5px;
}
.readmorearticle {
    color: deepskyblue;
    font-weight: bold;
}

.ArticlesHeader {
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 500;
}
    .ArticlesHeader:hover {
        text-decoration: underline;
    }


.ArticlesDesc {
    font-size: 0.8rem !important;
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: inherit;
}

.hideforWindow {
    display: none;
}

.content-web, .content-mobile, .section-title, .see-more, .trailerheader {
    color: white;
}

.trailerheader {
    padding: 5px;
    font-size: 0.9rem;
    font-weight: bold;    
}

.grid.trailers .card {
    background-color: black;
}

.newsHeader {
    font-weight: bold;
    font-size: 1.2rem;
}
.background-container {
    position: relative;
    background: url('https://mypikachu.s3.ap-south-1.amazonaws.com/bgnews.webp') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.content-web {
    position: absolute;
    left: 2%;
    bottom: 10%;
    background: rgba(0, 0, 0, 0.6);
    padding: 20px;
    border-radius: 10px;
    max-width: 550px;
    text-align: left;
    display: block;
}

.bg-win {
    min-height: 60vh;
    display: block;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    max-width: 1200px; /* Maximum width for large screens */
    margin: 0 auto; /* Center horizontally */
    padding: 0 15px; /* Optional padding for smaller screens */

}

.bg-mobile {
    display: none; /* Initially hidden on web view */
}

.content-mobile {
    display: none; /* Initially hidden on web view */
    text-align: left;
    padding: 10px;
    padding-bottom: 0px;
    margin-top: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    max-width: 100%;
}

h1 {
    font-size: 2.5rem;
    margin: 0 0 10px;
    line-height: 1.4;
}

p {
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

.poster {
    display: none; /* Initially hidden on web view */
    max-width: 90%; /* Limit poster width */
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px; /* Add space below the poster */
}

.NewsContainer {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    max-width: 1200px; /* Maximum width for large screens */
    margin: 0 auto; /* Center horizontally */
    padding: 0 15px; /* Optional padding for smaller screens */
}

header {
    text-align: center;
    padding: 2rem;
    color: #fff;
}

section {
    margin: 1rem 0; /* Add vertical margin to separate sections */
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    padding-bottom: 0.5rem;
}

    .section-title h2 {
        margin: 0;
    }

.grid {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

    .grid.reviews {
        grid-template-columns: repeat(5, 1fr); /* 5 items per row for reviews on larger screens */
    }

    .grid.news {
        grid-template-columns: repeat(5, 1fr); /* 5 items per row for news on larger screens */
    }

    .grid.trailers {
        grid-template-columns: repeat(6, 1fr); /* 6 items per row for trailers on larger screens */
    }

.card {
    background: #222;
    border-radius: 8px;
    overflow: hidden;    
}

    .card img {
        width: 100%;
        height: auto;
    }

.reviews .card {
    display: flex;
    flex-direction: column;
    height: 100%; /* ensures all cards are same height if needed */
}

.news .card img {
    width: 100%; /* Ensures the image fits the width of its container */
    height: auto; /* Maintains the aspect ratio */
    height: 125px; /* Adjust this value as needed to limit the image height */
    /*object-fit: cover;*/ /* Ensures the image covers the container without distortion */
    border-radius: 5px; /* Optional: for rounded corners */
    display: block; /* Removes unwanted inline spacing */
}

.ArticlesHeader {
    flex-grow: 1; /* take up all available space */
}

.reviewtime {
    margin-top: auto; /* pushes it to the bottom of .card-content */
}

.reviews .card .card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* let it fill available space */
}

.card-content {
    padding: 10px;
    color: white;
    
}

    .card-content h3 {
        font-size: 1.2rem;
        margin: 0 0 0.5rem;
    }

    .card-content p {
        margin: 0;
        font-size: 0.9rem;
        color: #ccc;
    }


.grid.trailers .card-content {
    padding: 0rem;
}

.trailer-poster {
    max-height: 300px;
    object-fit: cover;
    width: 180px !important;
    height: 270px !important;
    border-radius: 5px;
}

.see-more {
    text-decoration: none;
    font-size: 14px;    
}

@media (max-width: 1024px) {
    /* For medium screens, maintain the original 3 columns for reviews and news */
    .grid.reviews {
        grid-template-columns: repeat(3, 1fr); /* 3 columns for reviews */
    }

    .grid.news {
        grid-template-columns: repeat(3, 1fr); /* 3 columns for news */
    }

    .grid.trailers {
        grid-template-columns: repeat(4, 1fr); /* 4 columns for trailers */
    }
}
@media (max-width: 768px) {
    .trailer-poster {                
        width: 100% !important;
        height: 160px !important;        
    }

    .card-content p {
        padding-top: 5px;        
    }

    .card-content{
        line-height: 1.2;
    }

    .ArticlesHeader {
        font-size: 0.8rem;             
    }

    .ArticlesDesc {
        font-size: 0.7rem !important;        
    }

    .hideforWindow {
        display: block;
    }

    .bg-win {
        display: none;
    }

    .bg-mobile {
        display: block; /* Initially hidden on web view */
    }

    .background-container {
        flex-direction: column;
        padding: 20px;
        background: none;
        min-height: auto; /* Let the height adjust based on content */
    }

    .content-web {
        display: none; /* Hide content-web on mobile view */
    }

    .content-mobile {
        display: block; /* Show content-mobile on mobile view */
    }

    .poster {
        display: block; /* Show the poster on mobile view */
        max-width: 100%;
    }

    h1 {
        font-size: 1.8rem;
    }

    p {
        font-size: 0.7rem;
    }

    .grid.reviews .card:nth-child(n+3),
    .grid.news .card:nth-child(n+3),
    .grid.trailers .card:nth-child(n+4) {
        display: none;
    }

    .grid.reviews {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid.news {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid.trailers {
        grid-template-columns: repeat(3, 1fr);
    }
}