/* =========================
   CATEGORY ARCHIVE PAGE
   ========================= */

/* --- Header --- */
.search-header-wrapper {
    background: var(--blue-darkest);
    padding: 36px 0;
    margin-bottom: 30px;
    color: #fff;
}

.search-header {
    text-align: left;
}

.search-title {
    font-family: var(--primary-heading);
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
    letter-spacing: -0.3px;
}

.header-description {
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    line-height: 1.5;
    max-width: 600px;
}

.header-description p { margin: 0; color: inherit; }

/* --- Count --- */
.search-count {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 24px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* --- Posts Grid --- */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 36px;
}

/* --- Card --- */
.search-post {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius, 12px);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid #eef1f5;
}

.search-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.1);
}

/* --- Thumbnail --- */
.search-post .post-thumbnail {
    flex: none;
    overflow: hidden;
}

.search-post .post-thumbnail a {
    display: block;
    line-height: 0;
}

.search-post .post-thumbnail img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.search-post:hover .post-thumbnail img {
    transform: scale(1.04);
}

/* --- Content --- */
.search-post .post-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* --- Meta (date + read time) --- */
.search-post .post-meta {
    display: flex;
    gap: 14px;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 10px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.search-post .post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.search-post .post-meta .material-symbols-outlined {
    font-size: 15px;
    color: var(--blue-light, #0066c3);
}

/* --- Title --- */
.search-post .post-title {
    font-family: var(--primary-heading, 'Merriweather', serif);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 10px;
    color: var(--night-black, #111);
}

.search-post .post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.search-post .post-title a:hover {
    color: var(--blue-light, #0066c3);
}

/* --- Excerpt --- */
.search-post .post-excerpt {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* --- Footer (tags + author) --- */
.search-post .post-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* --- Tags --- */
.search-post .post-tags {
    margin-bottom: 10px;
}

.search-post .post-tags h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #999;
    margin: 0 0 6px;
}

.search-post .post-tags a {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--blue-dark, #004a8f);
    background: #eef4fb;
    border-radius: 4px;
    text-decoration: none;
    margin: 0 4px 4px 0;
    transition: background 0.2s ease, color 0.2s ease;
    letter-spacing: 0.3px;
}

.search-post .post-tags a:hover {
    background: var(--blue-dark, #004a8f);
    color: #fff;
}

/* --- Author --- */
.search-post .author-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.search-post .author-meta img {
    border-radius: 50%;
    width: 26px;
    height: 26px;
    object-fit: cover;
}

.search-post .author-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #444;
}

/* --- Pagination --- */
.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 10px 0 36px;
}

.nav-links .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #fff;
    color: var(--night-black, #111);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: all 0.25s ease;
    text-decoration: none;
    border: 1px solid #e8e8e8;
}

.nav-links .page-numbers.current {
    background: var(--blue-dark, #004a8f);
    color: #fff;
    border-color: var(--blue-dark, #004a8f);
}

.nav-links .page-numbers:hover:not(.current) {
    background: var(--blue-light, #0066c3);
    color: #fff;
    border-color: var(--blue-light);
    transform: translateY(-2px);
}

.nav-links .page-numbers .material-symbols-outlined {
    font-size: 18px;
}

/* =========================
   CATEGORY ARCHIVE — RESPONSIVE
   ========================= */
@media (max-width: 1100px) {
    .posts-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}

@media (max-width: 820px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .search-title { font-size: 1.6rem; }
    .search-header-wrapper { padding: 28px 0; }
}

@media (max-width: 576px) {
    .posts-grid { grid-template-columns: 1fr; gap: 16px; max-width: 440px; margin-left: auto; margin-right: auto; }
    .search-title { font-size: 1.4rem; }
    .search-header-wrapper { padding: 22px 0; margin-bottom: 20px; }
    .search-post .post-thumbnail img { height: 200px; }
    .search-post .post-title { font-size: 1.1rem; }
    .search-post .post-content { padding: 14px; }
}


/* =========================
   POPULAR CATEGORIES SECTION (Homepage)
   ========================= */

/* Category Section Styles */
.category-section {
    padding: 60px 0;
    background: #f8f9fa;
}

.category-section .section-header {
    text-align: center;
    margin-bottom: 40px;
}

.category-section .section-title {
    font-family: var(--primary-heading);
    font-size: 2.5rem;
    color: var(--night-black);
    position: relative;
    display: inline-block;
}

.category-section .section-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--blue-light);
    border-radius: 2px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 0 auto;
    max-width: 1400px;
}

.category-card {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: transform 0.3s, box-shadow 0.3s;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.category-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    background-color: var(--night-black);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(0,0,0,0.3) 0%,
        rgba(0,0,0,0.6) 100%);
    transition: background 0.3s;
}

.category-card:hover .category-overlay {
    background: linear-gradient(to bottom, 
        rgba(var(--blue-light-rgb), 0.4) 0%,
        rgba(var(--blue-dark-rgb), 0.7) 100%);
}

.category-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    color: #fff;
    z-index: 1;
}

.category-title {
    font-family: var(--primary-heading);
    font-size: 1.5rem;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.post-count {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(4px);
}

/* Animation */
@keyframes categoryCardIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-card {
    animation: categoryCardIn 0.6s ease-out forwards;
}

.category-card:nth-child(2) { animation-delay: 0.1s; }
.category-card:nth-child(3) { animation-delay: 0.2s; }
.category-card:nth-child(4) { animation-delay: 0.3s; }
.category-card:nth-child(5) { animation-delay: 0.4s; }
.category-card:nth-child(6) { animation-delay: 0.5s; }

/* Responsive Styles */
@media (max-width: 1200px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .category-section {
        padding: 40px 0;
    }

    .category-section .section-title {
        font-size: 2rem;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 576px) {
    .category-section {
        padding: 30px 0;
    }

    .category-section .section-title {
        font-size: 1.8rem;
    }

    .category-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .category-title {
        font-size: 1.3rem;
    }
}
