/**
 * Articles CSS
 * Styling for article list and detail pages across all categories
 * Created: 2026-02-01
 */

/* ===================================================================
   ARTICLE LIST PAGE STYLES
   =================================================================== */

/* Articles container */
.articles-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Article header with filters */
.articles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.articles-count {
    font-size: 0.95rem;
    color: #64748b;
}

.articles-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-dropdown {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 0.9rem;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-dropdown:hover {
    border-color: #3b82f6;
}

.articles-search {
    position: relative;
}

.search-input {
    padding: 10px 16px 10px 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    width: 250px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 1.1rem;
}

/* Article card (horizontal layout) */
.article-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 25px;
    overflow: hidden;
    display: flex;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.article-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.article-card-image {
    width: 400px;
    height: 250px;
    object-fit: cover;
    flex-shrink: 0;
}

.article-card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.article-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.article-card-excerpt {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-meta {
    display: flex;
    gap: 20px;
    font-size: 0.875rem;
    color: #94a3b8;
    align-items: center;
    flex-wrap: wrap;
}

.article-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-meta-item svg,
.article-meta-item span:first-child {
    flex-shrink: 0;
}

.read-more-link {
    color: #3b82f6;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    transition: all 0.2s;
}

.read-more-link:hover {
    gap: 8px;
    color: #2563eb;
}

/* Featured article (larger, highlighted) */
.article-card.featured {
    background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
    border: 2px solid #3b82f6;
}

.article-card.featured .article-card-title {
    color: #1e40af;
    font-size: 1.75rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
}

.pagination-btn {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #334155;
    transition: all 0.2s;
    text-decoration: none;
}

.pagination-btn:hover:not(.disabled) {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* No results state */
.no-articles {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
}

.no-articles h3 {
    font-size: 1.5rem;
    color: #64748b;
    margin: 0 0 10px 0;
}

.no-articles p {
    color: #94a3b8;
    font-size: 1rem;
}

/* ===================================================================
   ARTICLE DETAIL PAGE STYLES
   =================================================================== */

/* Back navigation */
.article-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 20px;
    transition: all 0.2s;
}

.article-back-link:hover {
    gap: 6px;
    color: #2563eb;
}

/* Article detail container */
.article-detail {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* Article header */
.article-detail-header {
    padding: 40px 40px 25px;
    border-bottom: 1px solid #e2e8f0;
}

.article-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    margin: 0 0 20px 0;
}

.article-detail-meta {
    display: flex;
    gap: 25px;
    font-size: 0.95rem;
    color: #64748b;
    flex-wrap: wrap;
}

.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.article-tag {
    background: #e0f2fe;
    color: #0c4a6e;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

.article-tag:hover {
    background: #0ea5e9;
    color: white;
}

/* Featured image */
.article-featured-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

/* Article body */
.article-body {
    padding: 40px;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #334155;
}

.article-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    margin: 30px 0 15px 0;
}

.article-body h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #334155;
    margin: 25px 0 12px 0;
}

.article-body p {
    margin: 0 0 18px 0;
}

.article-body ul,
.article-body ol {
    margin: 0 0 18px 0;
    padding-left: 30px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 25px 0;
}

.article-body figure {
    margin: 25px 0;
}

.article-body figcaption {
    font-size: 0.9rem;
    color: #64748b;
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

.article-body blockquote {
    border-left: 4px solid #3b82f6;
    padding: 15px 20px;
    background: #f8fafc;
    margin: 25px 0;
    font-style: italic;
    color: #475569;
}

/* Social sharing */
.article-share {
    padding: 25px 40px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.share-title {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin: 0 0 15px 0;
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.linkedin { background: #0a66c2; }
.share-btn.whatsapp { background: #25d366; }

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Related articles */
.related-articles {
    padding: 40px;
    background: #f8fafc;
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 25px 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.related-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

.related-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.related-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.related-card-content {
    padding: 15px;
}

.related-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.related-card-excerpt {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===================================================================
   RESPONSIVE DESIGN
   =================================================================== */

@media (max-width: 968px) {
    /* Article card switches to vertical on tablets */
    .article-card {
        flex-direction: column;
    }

    .article-card-image {
        width: 100%;
        height: 250px;
    }
}

@media (max-width: 768px) {
    /* Filters stack vertically */
    .articles-header {
        flex-direction: column;
        align-items: stretch;
    }

    .articles-filters {
        flex-direction: column;
    }

    .filter-dropdown,
    .search-input {
        width: 100%;
    }

    /* Article detail adjustments */
    .article-detail-header {
        padding: 25px 20px 15px;
    }

    .article-detail-title {
        font-size: 1.75rem;
    }

    .article-body {
        padding: 25px 20px;
        font-size: 1rem;
    }

    .article-body h2 {
        font-size: 1.4rem;
    }

    .article-share,
    .related-articles {
        padding: 25px 20px;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .article-card-content {
        padding: 20px;
    }

    .article-card-title {
        font-size: 1.25rem;
    }

    .article-detail-title {
        font-size: 1.5rem;
    }

    .pagination {
        gap: 5px;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* ===================================================================
   UTILITY CLASSES
   =================================================================== */

.text-muted {
    color: #94a3b8;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}
