/* Posts & Categories Frontend Styles */

/* Term Header Styles (for both categories and tags) */
.term-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    background: var(--bg-primary);
    width: 100%;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    --term-grid-line-rgb: var(--border-color-dark-rgb);
    --term-grid-line-alpha: 1;
    --term-grid-mask-mid: 0.5;
    --term-grid-mask-end: 0.96;
}


.term-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(var(--term-grid-line-rgb), var(--term-grid-line-alpha)) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(var(--term-grid-line-rgb), var(--term-grid-line-alpha)) 1px, transparent 1px);
    background-size: 22px 28px;
    background-position: center top, center 14px;
    -webkit-mask-image: radial-gradient(ellipse 76% 64% at 50% 0%, var(--black-primary) 58%, transparent 100%);
    mask-image: radial-gradient(ellipse 76% 64% at 50% 0%, var(--black-primary) 58%, transparent 100%);
    pointer-events: none;
}

.term-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 82% 72% at 50% 0%, rgba(var(--bg-primary-rgb), 0) 34%, rgba(var(--bg-primary-rgb), var(--term-grid-mask-mid)) 76%, rgba(var(--bg-primary-rgb), var(--term-grid-mask-end)) 100%);
    pointer-events: none;
}

.term-header>* {
    position: relative;
    z-index: 1;
}

.term-title {
    font-size: var(--font-24);
    font-weight: var(--font-weight-bold);
    margin: 0 0 10px 0;
    color: var(--black-primary);
    font-family: var(--fontH);
    line-height: var(--line-height-tight);
}

.term-stats {
    font-size: var(--font-15);
    font-weight: var(--font-weight-normal);
    color: var(--black-secondary);
    margin-bottom: 15px;
    font-family: var(--fontB);
    line-height: var(--line-height-normal);
}

.stat-item {
    display: inline-block;
}

.stat-separator {
    margin: 0 5px;
    color: var(--text-muted);
}

.term-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.follow-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 9999px;
    padding: 8px 14px;
    font-size: var(--font-15);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: var(--fontB);
    line-height: var(--line-height-normal);
    text-decoration: none;
}

.follow-button:hover {
    background-color: var(--primary-hover);
}

.follow-button.following {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.follow-button.following:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.follow-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.follow-button-secondary {
    background-color: transparent;
    color: var(--black-primary);
    border: 1px solid var(--border-color);
}

.follow-button-secondary:hover {
    background-color: var(--bg-secondary);
}

.explore-topics-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.explore-topics-btn .follow-button-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .term-title {
        font-size: var(--font-20);
        margin-bottom: 8px;
    }

    .term-stats {
        font-size: var(--font-13);
        margin-bottom: 20px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .stat-separator {
        margin: 0 2px;
    }

    .follow-button {
        padding: 8px 12px;
        font-size: var(--font-14);
        width: auto;
        min-width: 120px;
    }

    .term-actions {
        gap: 8px;
    }
}

/* Breadcrumb Header */
.postTtl {
    font-size: var(--font-15);
    color: var(--black-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--fontB);
}

.postTtl a {
    color: var(--black-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

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

.postTtl .separator {
    color: var(--text-muted);
}

.postTtl .current {
    color: var(--black-primary);
    font-weight: var(--font-weight-medium);
}

/* Posts Grid Layout (Industrial Style) */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
    width: 100%;
}

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

@media (min-width:1024px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.post-card {
    background: var(--white-primary);
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}


.post-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    position: relative;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


.post-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: var(--white-primary);
    padding-top: 16px;
}

.post-card-category {
    font-family: var(--fontH);
    font-size: var(--font-15);
    font-weight: var(--font-weight-medium);
    color: var(--primary-color);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.post-card-category .in-text {
    display: none;
}

.post-card-title {
    font-family: var(--fontB);
    font-size: var(--font-20);
    font-weight: var(--font-weight-bold);
    color: var(--black-primary);
    line-height: 1.2;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-excerpt {
    font-size: var(--font-16);
    line-height: var(--line-height-relaxed);
    color: var(--black-secondary);
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-title a {
    color: inherit;
    text-decoration: none;
}

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

.post-card-meta {
    margin-top: auto;
    font-size: var(--font-15);
    color: var(--black-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-card-meta .new-badge {
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: var(--font-11);
    font-weight: var(--font-weight-bold);
}

.post-card-meta .read-more-text {
    margin-left: auto;
    color: var(--primary-color);
    font-weight: var(--font-weight-medium);
    display: none;
}

.post-card:hover .read-more-text {
    display: block;
}

/* Custom Pagination */
.custom-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 40px;
    padding: 0 10px;
    margin-bottom: 40px;
}