/* Page styles for templates/articles.html (moved out of the template, issue #96) */
.header {
    padding: 2rem;
    background: linear-gradient(180deg, var(--ocean-dark) 0%, var(--ocean-abyss) 100%);
    border-bottom: 1px solid var(--card-border);
}

.main {
    width: 100%;
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 1.5rem 2rem;
    box-sizing: border-box;
}

.page-intro {
    text-align: center;
    margin-bottom: 1.5rem;
}

.page-intro h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.page-intro p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* Filter bar */
/* Active tag filter indicator */
.active-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.active-filter-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: rgba(79, 209, 197, 0.15);
    border: 1px solid var(--ocean-glow);
    color: var(--ocean-glow);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
}

.active-filter-tag .clear-x {
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.7;
}

.active-filter-tag:hover .clear-x {
    opacity: 1;
}

/* Article grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 1.5rem;
}

.article-card {
    position: relative;  /* the title link's ::after covers the card (#152) */
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s, translate 0.2s;
    translate: 0px;  /* keeps the stacking context the same on hover (#168) */
}

.article-card:hover,
.article-card:focus-within {
    border-color: var(--ocean-glow);
}

/* The card is an <article>; its title is the link, stretched over the whole
   card. The category tag is a separate link raised above it (#152). */
.article-card-link {
    color: inherit;
    text-decoration: none;
}
.article-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}
@media (prefers-reduced-motion: no-preference) { .article-card:hover { translate: 0 -2px; } }

.article-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--ocean-dark);
}

.article-card-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--ocean-dark), var(--ocean-abyss));
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-card-placeholder svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    opacity: 0.4;
}

.article-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.article-category-tag {
    background: var(--ocean-glow);
    color: var(--on-accent);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: opacity 0.2s;
    position: relative;
    z-index: 2;
    text-decoration: none;
}

.article-category-tag:hover {
    opacity: 0.85;
}

.article-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.article-card-excerpt {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.article-featured-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--status-open);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    text-decoration: none;
    min-width: 2.25rem;
    text-align: center;
}

.pagination a {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
}

.pagination a:hover {
    border-color: var(--ocean-glow);
    color: var(--ocean-glow);
}

.pagination .active {
    background: var(--ocean-glow);
    color: var(--on-accent);
    border: 1px solid var(--ocean-glow);
}

.pagination .ellipsis {
    color: var(--text-muted);
    border: none;
}

/* Load More */
.load-more-section {
    text-align: center;
    margin-top: 2rem;
}

.load-more-count {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .main {
        padding: 1rem;
    }
    .articles-grid {
        grid-template-columns: 1fr;
    }
    .page-intro h2 {
        font-size: 1.4rem;
    }
}
