/* ==========================================================================
   BLOG.CSS — Durs Theme Blog & Post Styles
   Archive grids, post cards, single post, related posts, 404, search.
   ========================================================================== */

/* ── Posts Grid ──────────────────────────────────────────────────────────── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
}

@media (max-width: 991px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Post Card ──────────────────────────────────────────────────────────── */
.post-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-card__image {
    display: block;
    overflow: hidden;
    line-height: 0;
}

.post-card__image img,
.post-card__thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-slow);
}

.post-card:hover .post-card__image img,
.post-card:hover .post-card__thumbnail {
    transform: scale(1.03);
}

.post-card__placeholder {
    width: 100%;
    height: 200px;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-card__placeholder::after {
    content: '';
    width: 48px;
    height: 48px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    opacity: 0.4;
}

.post-card__content {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-card__meta {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.post-card__meta a {
    color: var(--color-text-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.post-card__meta a:hover {
    color: var(--color-primary);
}

.post-card__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 var(--space-sm) 0;
}

.post-card__title a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.post-card__title a:hover {
    color: var(--color-primary);
}

.post-card__excerpt {
    font-size: 0.875rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin: 0 0 var(--space-md) 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.post-card__link {
    color: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
    margin-top: auto;
}

.post-card__link:hover {
    color: var(--color-primary-dark);
}

/* ── Archive Header ─────────────────────────────────────────────────────── */
.archive-header {
    margin-bottom: var(--space-3xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}

.archive-header__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin: 0 0 var(--space-sm) 0;
}

.archive-header__description {
    font-size: 1rem;
    color: var(--color-text-light);
    max-width: 600px;
}

.archive-header__description p {
    margin: 0;
}

/* ── Archive Pagination ─────────────────────────────────────────────────── */
.archive-page .navigation.pagination,
.search-page .navigation.pagination {
    margin-top: var(--space-3xl);
    text-align: center;
}

.archive-page .nav-links,
.search-page .nav-links {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.archive-page .page-numbers,
.search-page .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-sm);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.archive-page .page-numbers:hover,
.search-page .page-numbers:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.archive-page .page-numbers.current,
.search-page .page-numbers.current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-text-on-dark);
}

/* ── Single Post ────────────────────────────────────────────────────────── */
.single-post__featured {
    width: 100%;
    max-height: 480px;
    overflow: hidden;
    margin-bottom: var(--space-3xl);
}

.single-post__hero-image {
    width: 100%;
    height: 480px;
    object-fit: cover;
    display: block;
}

.single-post__header {
    margin-bottom: var(--space-3xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--color-border);
}

.single-post__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin: 0 0 var(--space-md) 0;
    line-height: 1.3;
}

.single-post__meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    color: var(--color-text-light);
    flex-wrap: wrap;
}

.single-post__meta time {
    color: var(--color-text-light);
}

.single-post__categories a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.single-post__categories a:hover {
    color: var(--color-primary-dark);
}

.single-post__content {
    max-width: 780px;
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.8;
}

.single-post__content h2,
.single-post__content h3,
.single-post__content h4 {
    font-family: 'Montserrat', sans-serif;
    color: var(--color-secondary);
    margin-top: var(--space-3xl);
}

.single-post__content img {
    border-radius: var(--radius-md);
    max-width: 100%;
    height: auto;
}

.single-post__content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: var(--space-md) var(--space-xl);
    margin: var(--space-xl) 0;
    background: var(--color-primary-light);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--color-secondary);
}

/* ── Related Posts ──────────────────────────────────────────────────────── */
.related-posts {
    background: var(--color-bg);
    padding: var(--space-4xl) 0;
    margin-top: var(--space-4xl);
}

.related-posts__heading {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin: 0 0 var(--space-xl) 0;
}

/* ── Single Post CTA ───────────────────────────────────────────────────── */
.single-post__cta {
    background: var(--color-secondary);
    padding: var(--space-4xl) 0;
}

.single-post__cta-inner {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.single-post__cta h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-on-dark);
    margin: 0 0 var(--space-md) 0;
}

.single-post__cta p {
    color: var(--color-text-on-dark-muted);
    font-size: 1.0625rem;
    margin: 0 0 var(--space-xl) 0;
}

.single-post__cta .btn--primary {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-text-on-dark);
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: background var(--transition-fast);
}

.single-post__cta .btn--primary:hover {
    background: var(--color-primary-dark);
}

/* ── 404 Page ───────────────────────────────────────────────────────────── */
.error-404 {
    padding: var(--space-4xl) 0;
}

.error-404__content {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
    padding: var(--space-4xl) 0;
}

.error-404__code {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 6rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: var(--space-md);
}

.error-404__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin: 0 0 var(--space-md) 0;
}

.error-404__message {
    font-size: 1.0625rem;
    color: var(--color-text-light);
    margin: 0 0 var(--space-xl) 0;
}

.error-404 .search-form {
    display: flex;
    gap: var(--space-sm);
    max-width: 400px;
    margin: 0 auto var(--space-xl) auto;
}

.error-404 .search-form .search-field {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.error-404 .search-form .search-field:focus {
    border-color: var(--color-primary);
}

.error-404 .search-form .search-submit {
    background: var(--color-primary);
    color: var(--color-text-on-dark);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.error-404 .search-form .search-submit:hover {
    background: var(--color-primary-dark);
}

.error-404__btn {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-text-on-dark);
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: background var(--transition-fast);
}

.error-404__btn:hover {
    background: var(--color-primary-dark);
}

/* ── Search Page ────────────────────────────────────────────────────────── */
.search-page .archive-header__title span {
    color: var(--color-primary);
}

/* ── No Results ─────────────────────────────────────────────────────────── */
.no-results {
    text-align: center;
    padding: var(--space-4xl) 0;
}

.no-results__title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin: 0 0 var(--space-md) 0;
}

.no-results__message {
    font-size: 1rem;
    color: var(--color-text-light);
    margin: 0 0 var(--space-xl) 0;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.no-results .search-form {
    display: flex;
    gap: var(--space-sm);
    max-width: 400px;
    margin: 0 auto;
}

.no-results .search-form .search-field {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.no-results .search-form .search-field:focus {
    border-color: var(--color-primary);
}

.no-results .search-form .search-submit {
    background: var(--color-primary);
    color: var(--color-text-on-dark);
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.no-results .search-form .search-submit:hover {
    background: var(--color-primary-dark);
}

/* ── Responsive Adjustments ─────────────────────────────────────────────── */
@media (max-width: 767px) {
    .single-post__title {
        font-size: 1.75rem;
    }

    .single-post__featured {
        max-height: 300px;
    }

    .single-post__hero-image {
        height: 300px;
    }

    .archive-header__title {
        font-size: 1.5rem;
    }

    .error-404__code {
        font-size: 4rem;
    }

    .error-404__title {
        font-size: 1.5rem;
    }

    .single-post__cta h2 {
        font-size: 1.375rem;
    }

    .error-404 .search-form,
    .no-results .search-form {
        flex-direction: column;
    }
}
