/* Titan Home — content templates (pages, posts, archives, search, 404).
   Reuses --th-* tokens from main.css. Works with Gutenberg and Elementor:
   templates output the_content() inside the loop, no builder required. */

/* Page / post hero */
.titanhome-page-hero {
    padding-block: calc(var(--th-header-height) + 48px) 40px;
    background: var(--th-surface);
    border-bottom: 1px solid var(--th-outline-light);
}

.titanhome-page-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(28px, 3.4vw, 44px);
    font-weight: 800;
    line-height: 1.4;
}

.titanhome-page-hero p {
    margin: 0;
    max-width: 640px;
    color: var(--th-text-muted);
    font-size: 15px;
    line-height: 2;
}

.titanhome-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 16px;
    color: var(--th-text-muted);
    font-size: 13px;
}

/* Prose body */
.titanhome-prose-wrap {
    padding-block: 64px;
}

.titanhome-prose {
    max-width: 780px;
    font-size: 15px;
    line-height: 2.1;
    overflow-wrap: break-word;
}

.titanhome-prose > :first-child {
    margin-top: 0;
}

.titanhome-prose h2,
.titanhome-prose h3 {
    line-height: 1.6;
}

.titanhome-prose img {
    border-radius: var(--th-radius-md);
}

.titanhome-prose a {
    color: var(--th-blue);
}

/* Elementor full-width rows should not be squeezed by the prose column. */
.titanhome-prose .elementor {
    max-width: none;
}

/* Cards (blog index / archive / search) */
.titanhome-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    padding-block: 64px;
}

.titanhome-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--th-surface);
    border: 1px solid var(--th-outline-light);
    border-radius: var(--th-radius-lg);
}

.titanhome-card-media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--th-surface-low);
}

.titanhome-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.titanhome-card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    flex: 1;
}

.titanhome-card-body h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.8;
}

.titanhome-card-body h2 a:hover {
    color: var(--th-blue);
}

.titanhome-card-excerpt {
    margin: 0;
    color: var(--th-text-muted);
    font-size: 13.5px;
    line-height: 2;
}

.titanhome-card-meta {
    margin-top: auto;
    padding-top: 8px;
    color: var(--th-text-muted);
    font-size: 12px;
}

/* Pagination */
.titanhome-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-bottom: 64px;
}

.titanhome-pagination .page-numbers {
    min-width: 40px;
    min-height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--th-surface);
    border: 1px solid var(--th-outline-light);
    border-radius: var(--th-radius-sm);
    font-size: 14px;
    font-weight: 600;
}

.titanhome-pagination .page-numbers.current {
    background: var(--th-text);
    border-color: var(--th-text);
    color: var(--th-text-invert);
}

/* Post footer nav */
.titanhome-post-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-block: 0 64px;
    font-size: 14px;
    font-weight: 600;
}

.titanhome-post-nav a {
    color: var(--th-blue);
}

/* Search form */
.titanhome-search-form {
    display: flex;
    gap: 8px;
    max-width: 480px;
    margin-top: 20px;
}

.titanhome-search-form input[type="search"] {
    flex: 1;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid var(--th-outline-light);
    border-radius: var(--th-radius-sm);
    background: var(--th-surface);
    font: inherit;
}

/* Empty states / 404 */
.titanhome-empty {
    padding-block: 64px;
    text-align: center;
}

.titanhome-empty p {
    color: var(--th-text-muted);
    line-height: 2;
}

.titanhome-empty-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

@media (max-width: 921.98px) {
    .titanhome-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .titanhome-cards {
        grid-template-columns: 1fr;
    }

    .titanhome-prose-wrap {
        padding-block: 40px;
    }

    .titanhome-post-nav {
        flex-direction: column;
    }
}
