/**
 * News Pages Styles
 * Phase 6: News & Case Studies
 *
 * D-01: Card grid layout matching product catalog style
 * D-03: Tab-based category filter below header
 * D-06: News detail article styling
 */

/* ============================================
   News Grid Layout (D-01)
   ============================================ */

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 40px;
}

/* Tablet: 2 columns */
@media (max-width: 1199px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Mobile: 1 column */
@media (max-width: 767px) {
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ============================================
   Category Tabs (D-03)
   Matches Phase 4 product category tabs
   ============================================ */

.category-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 15px 0;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: inline-block;
    padding: 10px 24px;
    background: #fff;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.category-tab:hover {
    background: #f0f7ff;
    border-color: #0066cc;
    color: #0066cc;
}

.category-tab.active {
    background: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .category-tab {
        padding: 8px 18px;
        font-size: 13px;
    }
}

/* ============================================
   News Card Styles
   Reuses existing news-card component
   Additional styles for consistency
   ============================================ */

.news-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.news-card-image {
    position: relative;
    width: 100%;
    padding-top: 60%; /* Aspect ratio 5:3 */
    overflow: hidden;
}

.news-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-body {
    padding: 20px;
}

.news-card-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.news-card-title a {
    color: #333;
    text-decoration: none;
}

.news-card-title a:hover {
    color: #0066cc;
}

.news-card-date {
    display: inline-block;
    font-size: 13px;
    color: #888;
}

/* ============================================
   News Detail Article (D-06)
   ============================================ */

.news-article {
    max-width: 900px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (max-width: 767px) {
    .news-article {
        padding: 20px;
        border-radius: 0;
    }
}

/* Article Header */
.news-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.news-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    color: #333;
    margin: 0 0 15px;
}

@media (max-width: 767px) {
    .news-title {
        font-size: 24px;
    }
}

/* Meta Info */
.news-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.news-date {
    font-size: 14px;
    color: #666;
}

.news-category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e8f4ff;
    color: #0066cc;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Featured Image */
.news-featured-image {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
}

.news-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Rich Text Content (D-05)
   Styles for TipTap rendered content
   ============================================ */

.news-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.news-content h1,
.news-content h2,
.news-content h3,
.news-content h4,
.news-content h5,
.news-content h6 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: #222;
}

.news-content h1 { font-size: 28px; }
.news-content h2 { font-size: 24px; }
.news-content h3 { font-size: 20px; }
.news-content h4 { font-size: 18px; }
.news-content h5 { font-size: 16px; }
.news-content h6 { font-size: 14px; }

.news-content p {
    margin-bottom: 15px;
}

.news-content ul,
.news-content ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

.news-content li {
    margin-bottom: 8px;
}

.news-content ul li {
    list-style-type: disc;
}

.news-content ol li {
    list-style-type: decimal;
}

.news-content a {
    color: #0066cc;
    text-decoration: underline;
}

.news-content a:hover {
    color: #0052a3;
}

.news-content strong {
    font-weight: 600;
}

.news-content em {
    font-style: italic;
}

.news-content u {
    text-decoration: underline;
}

.news-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* First paragraph - no top margin */
.news-content > h1:first-child,
.news-content > h2:first-child,
.news-content > h3:first-child,
.news-content > p:first-child {
    margin-top: 0;
}

/* ============================================
   Breadcrumb Navigation
   ============================================ */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 0;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #0066cc;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-separator {
    color: #999;
}

.breadcrumb-current {
    color: #333;
    font-weight: 500;
}

/* ============================================
   Back Link
   ============================================ */

.news-back-link {
    margin-top: 40px;
    text-align: center;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    margin-bottom: 20px;
    color: #ccc;
}

.empty-state-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
}

/* ============================================
   Pagination Wrapper
   ============================================ */

.pagination-wrapper {
    margin-top: 40px;
}