/* Homepage V4 - bsthammy.vn */

/* === Layout === */
body.home .sidebar,
body.home aside,
body.home .widget-area { display: none !important }
body.home .content-area,
body.home .site-main,
body.home .site-content { display: block !important; width: 100% !important }

.vertical-section { width: 100%; margin: 40px 0; padding: 30px 0; display: block; clear: both }
.vertical-section:nth-child(even) { background: #f8f9fa }
.section-wrapper { max-width: 1200px; margin: 0 auto; padding: 0 20px }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 3px solid #1F4A47 }
.section-head h2 { font-size: 24px; font-weight: 700; color: #1F4A47; margin: 0 }
.section-head a { font-size: 13px; color: #FF9800; text-decoration: none; font-weight: 600; transition: color 0.2s }
.section-head a:hover { color: #e68900; text-decoration: underline }

/* === Grid - matches JS getItemsPerPage() === */
.posts-row {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 25px !important;
    min-height: 280px;
}
@media (max-width: 1024px) {
    .posts-row { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 768px) {
    .posts-row { grid-template-columns: repeat(2, 1fr) !important; gap: 15px !important; }
    .section-head h2 { font-size: 20px }
}
@media (max-width: 480px) {
    .posts-row { grid-template-columns: 1fr !important; gap: 15px !important; }
}

/* === Cards === */
.post-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: opacity .5s ease, transform .5s ease, box-shadow .3s ease;
}
.post-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    transform: translateY(-4px) !important;
}
.post-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.post-card:hover .post-card-img { transform: scale(1.03) }

.post-card-content { padding: 15px }
.post-card-title {
    font-size: 15px; font-weight: 600; margin: 0 0 8px; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-title a { color: #333; text-decoration: none; transition: color .2s }
.post-card-title a:hover { color: #1F4A47 }
.post-card-excerpt {
    font-size: 13px; color: #666; margin: 0 0 10px; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #999 }
.post-card-badge { background: #1F4A47; color: #fff; padding: 3px 8px; border-radius: 3px; font-size: 11px; white-space: nowrap }

/* === Pagination === */
.pagination { display: flex; gap: 6px; margin-top: 25px; justify-content: center; flex-wrap: wrap; align-items: center }
.pagination button {
    padding: 8px 14px; border: 2px solid #1F4A47; background: #f0f5f4; color: #1F4A47;
    cursor: pointer; border-radius: 6px; font-size: 14px; font-weight: 600;
    transition: all .25s ease; user-select: none; min-width: 38px;
}
.pagination button.active {
    background: #1F4A47; color: #fff; border-color: #1F4A47;
    transform: scale(1.08); box-shadow: 0 2px 8px rgba(31,74,71,.3);
}
.pagination button:hover:not(:disabled):not(.active) {
    background: #FF9800; color: #fff; border-color: #FF9800; transform: scale(1.05);
}
.pagination button:disabled { opacity: .5; cursor: default; border-color: #aaa; color: #aaa; background: #f5f5f5 }
.pagination button:active:not(:disabled) { transform: scale(.95) }

/* === Loading === */
.loading-section {
    min-height: 300px; display: flex; align-items: center; justify-content: center;
    color: #999; font-size: 16px; transition: opacity .3s ease;
}

/* === Mobile adjustments === */
@media (max-width: 768px) {
    .post-card-img { height: 160px }
    .pagination button { padding: 6px 10px; font-size: 13px; min-width: 32px }
}
@media (max-width: 480px) {
    .post-card-img { height: 200px }
    .vertical-section { margin: 25px 0; padding: 20px 0 }
}
