/* blog.css */

/* Container */
.blog-section {
    padding: 3rem 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Article Styling */
article {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 2rem;
    margin-bottom: 2rem; /* Replaces <br> tags for spacing */
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

/* Fix for Bootstrap 5 Bootstrap conflicts */
article.post {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Fix inline styles conflicts */
article h1[style*="padding-top"],
article h2[style*="padding-top"],
article p[style*="padding-bottom"] {
    padding-top: 2rem !important;
    padding-bottom: 1rem !important;
}

/* Proper heading spacing */
article h1 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #2c3e50;
}

article h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.875rem;
    font-weight: 600;
    color: #34495e;
}

article h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: #34495e;
}

article header time {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

article img {
    display: block;
    height: 420px;
    width: auto;
    max-width: 100%; /* Prevents image from exceeding container width */
    margin: 0 auto 1rem auto; /* Centers the image and adds bottom margin */
    object-fit: cover;
    border-radius: 0.25rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

article p {
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: #495057;
    text-align: justify;
}

/* Fix for text alignment in blog articles */
article .text-center {
    text-align: left !important;
}

/* Improve figure and image styling */
article figure {
    margin: 2rem 0;
    text-align: center;
}

article .image.featured {
    display: block;
    text-align: center;
    margin: 2rem 0;
}

/* Fix for Bootstrap 5 row and column layout */
.blog-section .row {
    margin: 0;
}

.blog-section .container {
    padding: 0 1rem;
}

/* Footer Styling */
article footer {
    text-align: center;
}

article footer .btn {
    padding: 0.65rem 1.25rem;
    border-radius: 0.25rem;
    text-decoration: none; /* Removes underline from links */
    display: inline-block; /* Ensures proper padding and alignment */
    background-color: #007bff; /* Default button color */
    color: #fff; /* Button text color */
    transition: background-color 0.3s ease;
}

/* Button Hover Effect */
article footer .btn:hover,
article footer .btn:focus {
    background-color: #0056b3;
    color: #fff;
}

/* Blog Card Images */
.card-img-top {
    height: 400px !important;
    width: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    background-color: #f8f9fa !important;
    border-radius: 0.25rem 0.25rem 0 0 !important;
    transition: transform 0.3s ease;
}

.card-img-top:hover {
    transform: scale(1.02);
}

/* Blog Card Container */
.card {
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border: none;
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

/* Blog Navigation Buttons */
.actions.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    list-style: none;
    padding: 2rem 0;
    margin: 2rem 0 0 0;
    border-top: 1px solid #dee2e6;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Fix for mobile layout */
@media (max-width: 768px) {
    .actions.pagination {
        flex-direction: column;
        gap: 1rem;
    }
    
    .actions.pagination li {
        width: 100%;
        text-align: center !important;
    }
}

.actions.pagination li {
    flex: 1;
}

.actions.pagination li:first-child {
    text-align: left;
}

.actions.pagination li:nth-child(2) {
    text-align: center;
}

.actions.pagination li:last-child {
    text-align: right;
}

.actions.pagination a {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

/* Previous Article Button - Left Arrow */
.actions.pagination li:first-child a {
    background-color: #6c757d;
    color: #ffffff;
    padding-left: 2.5rem;
}

.actions.pagination li:first-child a:before {
    content: "←";
    position: absolute;
    left: 0.75rem;
    font-weight: bold;
}

.actions.pagination li:first-child a:hover {
    background-color: #5a6268;
    transform: translateX(-2px);
}

/* Blog Home Button - House Icon */
.actions.pagination li:nth-child(2) a {
    background-color: #007bff;
    color: #ffffff;
    padding-left: 2.5rem;
    padding-right: 1.5rem;
}

.actions.pagination li:nth-child(2) a:before {
    content: "⌂";
    position: absolute;
    left: 0.75rem;
    font-weight: bold;
}

.actions.pagination li:nth-child(2) a:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

/* Next Article Button - Right Arrow */
.actions.pagination li:last-child a {
    background-color: #28a745;
    color: #ffffff;
    padding-right: 2.5rem;
}

.actions.pagination li:last-child a:after {
    content: "→";
    position: absolute;
    right: 0.75rem;
    font-weight: bold;
}

.actions.pagination li:last-child a:hover {
    background-color: #1e7e34;
    transform: translateX(2px);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    article img {
        height: auto; /* Allows images to resize naturally on smaller screens */
    }

    article {
        padding: 1.5rem; /* Reduces padding on smaller screens */
    }

    article footer .btn {
        padding: 0.5rem 1rem;
    }
    
    .card-img-top {
        height: 400px !important;
        object-fit: contain !important;
    }

    .actions.pagination {
        flex-direction: column;
        gap: 0.75rem;
    }

    .actions.pagination li {
        width: 100%;
        text-align: center !important;
    }

    .actions.pagination a {
        width: 100%;
        text-align: center;
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    .actions.pagination li:first-child a:before,
    .actions.pagination li:nth-child(2) a:before {
        position: static;
        margin-right: 0.5rem;
    }

    .actions.pagination li:last-child a:after {
        position: static;
        margin-left: 0.5rem;
    }
}
