/* static/css/home.css */

/* General Styles */
body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.main-content {
    padding: 20px 0;
}

/* Custom Carousel Styles */
.carousel-container {
    position: relative;
    overflow: hidden;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    height: 80vh; /* Increased height to better accommodate 1920x1080 images */
    margin-bottom: 40px;
}

.carousel-slides {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.45, 0, 0.55, 1);
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #ffffff;
    padding: 40px 20px 20px;
    font-size: 1.2em;
    font-weight: 500;
    text-align: center;
}

/* Navigation Buttons */
.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
}

.carousel-button:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-button.prev {
    left: 30px;
}

.carousel-button.next {
    right: 30px;
}

/* Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 25px;
    left: 0;
    right: 0;
    display: flex;
    gap: 12px;
    z-index: 10;
    justify-content: center;
    width: 100%;
    padding: 0;
    margin: 0 auto;
}

.carousel-indicators .indicator {
    width: 40px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.carousel-indicators .indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.carousel-indicators .indicator.active {
    background-color: #ffffff;
    transform: scaleX(1.2);
}

/* Content Wrapper */
.content-wrapper {
    display: flex;
    gap: 20px;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

/* Blog Posts Container */
.posts-container {
    flex: 3;
    width: 100%;
}

.posts-container h1 {
    margin-bottom: 20px;
    color: #007bff;
    text-align: center;
    position: relative;
}

.posts-container h1::after {
    content: '';
    width: 60px;
    height: 3px;
    background-color: #007bff;
    display: block;
    margin: 10px auto 0;
    border-radius: 2px;
}

/* Individual Post */
.post {
    background-color: #ffffff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.post:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.post h2 {
    margin-bottom: 10px;
    color: #007bff;
    transition: color 0.3s;
}

.post h2 a {
    text-decoration: none;
    color: inherit;
}

.post h2 a:hover {
    color: #0056b3;
}

.post p {
    line-height: 1.6;
    color: #555555;
}

/* Read More Button */
.read-more {
    display: inline-block;           
    margin-top: 10px;               
    padding: 10px 15px;             
    background-color: #007bff;      
    color: #ffffff;                  
    text-decoration: none;           
    border-radius: 5px;             
    transition: background-color 0.3s;
}

.read-more:hover {
    background-color: #0056b3; /* Darker blue on hover */    
}

/* Sidebar */
.sidebar {
    flex: 1;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 80px; /* Adjust based on navbar height */
    transition: box-shadow 0.3s;
}

.sidebar h2 {
    margin-bottom: 15px;
    color: #007bff;
    text-align: center;
    position: relative;
}

.sidebar h2::after {
    content: '';
    width: 40px;
    height: 3px;
    background-color: #007bff;
    display: block;
    margin: 10px auto 0;
    border-radius: 2px;
}

.categories-list {
    list-style: none;
    padding: 0;
}

.categories-list li {
    margin-bottom: 10px;
    text-align: center;
}

.categories-list li a {
    color: #333333;
    font-size: 1em;
    transition: color 0.3s, background-color 0.3s;
    padding: 8px 12px;
    border-radius: 5px;
    display: inline-block;
    width: 100%;
    text-decoration: none;
}

.categories-list li a:hover {
    background-color: #007bff;
    color: #ffffff;
}

/* Pagination */
.pagination {
    text-align: center;
    margin-top: 20px;
}

.page-links a,
.page-links span {
    color: #007bff;
    padding: 8px 16px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    border-radius: 5px;
    margin: 0 2px;
    border: 1px solid #007bff;
}

.page-links a:hover {
    background-color: #007bff;
    color: #ffffff;
}

.page-links .current {
    background-color: #007bff;
    color: #ffffff;
    cursor: default;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .content-wrapper {
        flex-direction: column;
    }

    .carousel-container {
        height: 60vh;
    }
}

@media (max-width: 768px) {
    .carousel-container {
        height: 50vh;
        min-height: 300px; /* Ensure minimum height on mobile */
    }

    .carousel-caption {
        font-size: 1em;
        padding: 30px 15px 15px;
    }

    .carousel-button {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }

    .carousel-button.prev {
        left: 15px;
    }

    .carousel-button.next {
        right: 15px;
    }

    .carousel-indicators {
        bottom: 15px;
    }

    .carousel-indicators .indicator {
        width: 30px;
        height: 3px;
    }

    .carousel-container {
        padding-top: 56.25%; /* Maintain 16:9 aspect ratio */
    }

    .carousel-slide img {
        height: 100%; /* Ensure image height adjusts based on container */
    }

    .carousel-caption {
        font-size: 0.9em;
        padding: 8px 12px;
        bottom: 15px;
        left: 15px;
    }

    .post {
        padding: 15px;
        margin-bottom: 15px;
    }

    .sidebar {
        margin-top: 20px;
    }

    .content-wrapper {
        gap: 15px;
    }

    .categories-list li a {
        font-size: 0.9em;
        padding: 6px 10px;
    }

    /* Adjust navigation buttons size on smaller screens */
    .carousel-button {
        padding: 8px;
    }

    /* Hide indicators on small screens (optional) */
    .carousel-indicators {
        display: none;
    }
}

@media (max-width: 644px) {
    .carousel-container {
        padding-top: 56.25%; /* Maintain 16:9 aspect ratio */
    }

    .carousel-slide img {
        height: 100%; /* Ensure image height adjusts based on container */
    }
}

@media (max-width: 480px) {
    .carousel-container {
        height: 40vh;
    }

    .carousel-button {
        width: 35px;
        height: 35px;
        font-size: 1em;
    }
}
