/* ========================================
   Blog Styles
   ======================================== */

/* Blog Grid Layout - Override default opacity behavior */
.grid-layout.post-3-columns > * {
    opacity: 1 !important;
}

.grid-layout.post-3-columns {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
    overflow: visible !important;
}

/* Post Item */
.grid-layout.post-3-columns .post-item {
    display: flex !important;
    flex-direction: column;
    background: #fff;
    height: 100%;
    opacity: 1 !important;
    width: auto !important;
    float: none !important;
}

.post-item.border {
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.post-item-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Post Image */
.grid-layout.post-3-columns .post-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 0;
    padding-bottom: 66.67%; /* 3:2 aspect ratio */
}

.grid-layout.post-3-columns .post-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Post Description */
.post-item-description {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-item-description.p-20 {
    padding: 20px;
}

/* Post Meta */
.post-meta-date {
    color: #999;
    font-size: 13px;
    display: inline-block;
    margin-bottom: 10px;
}

.post-meta-date i {
    margin-right: 5px;
}

/* Post Title */
.post-item-description h2 {
    font-size: 18px;
    line-height: 1.4;
    margin: 10px 0 15px;
    font-weight: 600;
}

.post-item-description h2.m-t-10 {
    margin-top: 10px;
}

.post-item-description h2 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-item-description h2 a:hover {
    color: #007bff;
}

/* Post Excerpt */
.post-item-description p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex-grow: 1;
}

/* Read More Button */
.post-item-description .btn {
    margin-top: auto;
    align-self: flex-start;
}

.btn.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn.btn-outline {
    border: 1px solid #007bff;
    color: #007bff;
    background: transparent;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.btn.btn-outline:hover {
    background: #007bff;
    color: #fff;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 40px 0;
    gap: 5px;
}

.pagination .page-item {
    display: inline-block;
}

.pagination .page-link {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
}

.pagination .page-link:hover {
    background: #f5f5f5;
    border-color: #007bff;
}

/* Responsive Design */
@media (max-width: 992px) {
    .grid-layout.post-3-columns {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .grid-layout.post-3-columns {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .post-item-description h2 {
        font-size: 16px;
    }
}

/* Utility Classes */
.m-b-60 {
    margin-bottom: 60px;
}

.m-t-10 {
    margin-top: 10px;
}

.m-t-40 {
    margin-top: 40px;
}

.text-center {
    text-align: center;
}

.p-20 {
    padding: 20px;
}

/* ========================================
   Post Navigation (Prev/Next) - Redesigned
   ======================================== */

.post-navigation {
    margin: 40px 0;
    padding: 30px 0;
    border-top: 2px solid #e8e8e8;
    border-bottom: 2px solid #e8e8e8;
}

/* Category Link - Always on top */
.post-all {
    display: block;
    text-align: center;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.post-all:hover {
    background: #0056b3;
    color: #fff;
}

.post-all i {
    margin-right: 8px;
}

/* Prev/Next Container */
.post-navigation {
    display: block;
}

.post-prev,
.post-next {
    display: block;
    padding: 15px 20px;
    margin-bottom: 15px;
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.post-prev:hover,
.post-next:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.post-prev-title,
.post-next-title {
    display: block;
}

.post-prev-title span,
.post-next-title span {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 5px;
    font-weight: 600;
}

.post-prev-title span::before {
    content: "← ";
}

.post-next-title span::after {
    content: " →";
}

/* Desktop: Side by side layout */
@media (min-width: 768px) {
    .post-navigation {
        position: relative;
    }

    .post-all {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }

    .post-prev,
    .post-next {
        width: calc(50% - 10px);
        display: inline-block;
        vertical-align: top;
        margin-bottom: 0;
    }

    .post-prev {
        margin-right: 10px;
    }

    .post-next {
        margin-left: 10px;
    }
}
