/**
 * Post/News Pages Styles
 * Applies to: /tin-tuc (list), /tin-tuc/:slug (detail)
 * Uses CSS variables from components.css
 */

/* ==========================================================================
   POST LIST PAGE - HERO HEADER
   ========================================================================== */

.post-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #667eea 100%);
    padding: 48px 0;
    position: relative;
    overflow: hidden;
}

.post-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.post-hero .breadcrumb {
    margin-bottom: 24px;
}

.post-hero .breadcrumb__link {
    color: rgba(255, 255, 255, 0.8);
}

.post-hero .breadcrumb__link:hover {
    color: white;
}

.post-hero .breadcrumb__sep {
    color: rgba(255, 255, 255, 0.5);
}

.post-hero .breadcrumb__current {
    color: white;
}

.post-hero__content {
    position: relative;
    text-align: center;
    color: white;
    max-width: 700px;
    margin: 0 auto;
}

.post-hero__eyebrow {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    backdrop-filter: blur(4px);
}

.post-hero__title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 12px;
}

.post-hero__desc {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
}

/* ==========================================================================
   FILTER LAYOUT
   ========================================================================== */

.filter-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
}

.filter-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==========================================================================
   SIDEBAR CARD
   ========================================================================== */

.sidebar-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.sidebar-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--color-border-light);
    font-weight: 600;
    font-size: 15px;
    color: var(--color-text);
}

.sidebar-card__header svg {
    color: var(--color-primary);
}

.sidebar-card__body {
    padding: 16px 20px;
}

.sidebar-card__body--flush {
    padding: 0;
}

/* Sidebar Empty State */
.sidebar-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--color-text-muted);
}

.sidebar-empty svg {
    opacity: 0.3;
    margin-bottom: 12px;
}

.sidebar-empty p {
    margin: 0;
    font-size: 14px;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 8px;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: #0958d9;
}

/* Category Navigation */
.category-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-nav__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.category-nav__link:hover {
    background: var(--color-bg-subtle);
    color: var(--color-primary);
}

.category-nav__link--active {
    background: linear-gradient(135deg, #e6f4ff 0%, #bae0ff 100%);
    color: var(--color-primary);
    font-weight: 600;
}

.category-nav__link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.category-nav__link--active svg {
    opacity: 1;
}

/* ==========================================================================
   RESULTS HEADER
   ========================================================================== */

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.results-header__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: var(--color-text);
}

.results-header__count {
    font-size: 14px;
    color: var(--color-text-muted);
}

/* ==========================================================================
   POST GRID
   ========================================================================== */

.post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.card-grid--3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* ==========================================================================
   EMPTY CARD
   ========================================================================== */

.empty-card {
    grid-column: 1 / -1;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 64px 24px;
    text-align: center;
}

.empty-card__icon {
    color: var(--color-text-muted);
    opacity: 0.4;
    margin-bottom: 16px;
}

.empty-card__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 8px;
}

.empty-card__desc {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 0;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
}

.pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.2s ease;
}

.pagination__item:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.pagination__item--active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    font-weight: 600;
}

.pagination__item--active:hover {
    background: var(--color-primary);
    color: white;
}

.pagination__item--nav {
    padding: 0 12px;
}

/* ==========================================================================
   NEWS CARD
   ========================================================================== */

.news-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary-light);
}

.news-card__image {
    position: relative;
    height: 180px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e6f4ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.news-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

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

.news-card__category {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 12px;
    background: var(--color-primary);
    color: white;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.news-card__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card__meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.news-card__date,
.news-card__views {
    font-size: 13px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.news-card__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 10px;
    flex: 1;
}

.news-card__title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

.news-card__excerpt {
    font-size: 14px;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}

.news-card__link {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s ease;
}

.news-card__link:hover {
    gap: 8px;
}

/* ==========================================================================
   POST DETAIL PAGE - HERO
   ========================================================================== */

.post-detail-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #667eea 100%);
    padding: 48px 0;
    position: relative;
    overflow: hidden;
}

.post-detail-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.post-detail-hero .breadcrumb {
    margin-bottom: 24px;
}

.post-detail-hero .breadcrumb__link {
    color: rgba(255, 255, 255, 0.8);
}

.post-detail-hero .breadcrumb__link:hover {
    color: white;
}

.post-detail-hero .breadcrumb__sep {
    color: rgba(255, 255, 255, 0.5);
}

.post-detail-hero .breadcrumb__current {
    color: white;
}

.post-detail-hero__meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
}

.post-detail-hero__category,
.post-detail-hero__date,
.post-detail-hero__views {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.post-detail-hero__category {
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.post-detail-hero__title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.3;
    margin: 0;
    color: white;
    position: relative;
    max-width: 900px;
}

/* ==========================================================================
   POST DETAIL PAGE - LAYOUT
   ========================================================================== */

.two-column-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    margin-top: 24px;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Article Card */
.article-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.article-card__body {
    padding: 32px;
}

/* Article Meta */
.article-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 20px;
}

.article-meta__category {
    padding: 5px 14px;
    background: linear-gradient(135deg, #e6f4ff 0%, #bae0ff 100%);
    color: var(--color-primary);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.article-meta__item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.article-meta__item svg {
    width: 14px;
    height: 14px;
}

/* Article Title */
.article-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 800;
    line-height: 1.35;
    margin: 0 0 28px;
    color: var(--color-text);
}

/* Post Content */
.post-content {
    line-height: 1.9;
    font-size: 16px;
    color: rgba(0, 0, 0, 0.8);
}

.post-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 32px 0 16px;
    color: var(--color-text);
}

.post-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 28px 0 14px;
    color: var(--color-text);
}

.post-content p {
    margin-bottom: 18px;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 24px 0;
}

.post-content ul,
.post-content ol {
    padding-left: 24px;
    margin-bottom: 18px;
}

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

.post-content blockquote {
    margin: 24px 0;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e6f4ff 100%);
    border-left: 4px solid var(--color-primary);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--color-text-secondary);
}

.post-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-content a:hover {
    text-decoration: none;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.post-content th,
.post-content td {
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    text-align: left;
}

.post-content th {
    background: var(--color-bg-subtle);
    font-weight: 600;
}

/* Share Section */
.share-section {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--color-border-light);
}

.share-section__title {
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--color-text);
}

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

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-btn:hover {
    background: var(--color-bg-subtle);
    border-color: var(--color-primary-light);
}

.share-btn--facebook:hover {
    background: #e7f3ff;
    border-color: #1877f2;
    color: #1877f2;
}

.share-btn--twitter:hover {
    background: #e8f5fd;
    border-color: #1da1f2;
    color: #1da1f2;
}

/* ==========================================================================
   SIDEBAR WIDGETS
   ========================================================================== */

/* Related Posts */
.related-posts {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.related-posts__header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--color-border);
    font-weight: 600;
    color: var(--color-text);
}

.list-stack {
    display: flex;
    flex-direction: column;
}

.list-stack a {
    display: block;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border-light);
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease;
}

.list-stack a:last-child {
    border-bottom: none;
}

.list-stack a:hover {
    background: var(--color-bg-subtle);
}

.related-post__meta {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.related-post__category {
    padding: 3px 10px;
    background: linear-gradient(135deg, #e6f4ff 0%, #bae0ff 100%);
    color: var(--color-primary);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.related-post__date {
    font-size: 12px;
    color: var(--color-text-muted);
}

.related-post__title {
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
    font-size: 14px;
    color: var(--color-text);
}

/* Related Posts List */
.related-posts-list {
    display: flex;
    flex-direction: column;
}

.related-post-item {
    display: block;
    padding: 16px 20px;
    border-bottom: 1px solid var(--color-border-light);
    color: inherit;
    text-decoration: none;
    transition: background 0.2s ease;
}

.related-post-item:last-child {
    border-bottom: none;
}

.related-post-item:hover {
    background: var(--color-bg-subtle);
}

.related-post-item__meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.related-post-item__category {
    padding: 3px 10px;
    background: linear-gradient(135deg, #e6f4ff 0%, #bae0ff 100%);
    color: var(--color-primary);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.related-post-item__date {
    font-size: 12px;
    color: var(--color-text-muted);
}

.related-post-item__title {
    margin: 0;
    font-weight: 500;
    line-height: 1.4;
    font-size: 14px;
    color: var(--color-text);
}

.related-post-item:hover .related-post-item__title {
    color: var(--color-primary);
}

/* CTA Card */
.cta-card {
    background: linear-gradient(135deg, var(--color-primary) 0%, #667eea 100%);
    border-radius: 16px;
    padding: 28px;
    text-align: center;
    color: white;
}

.cta-card__icon {
    margin-bottom: 12px;
}

.cta-card__icon svg {
    stroke: white;
}

.cta-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 10px;
}

.cta-card__desc {
    font-size: 14px;
    opacity: 0.9;
    margin: 0 0 20px;
}

.cta-card__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: white;
    color: var(--color-primary);
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cta-card__btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

/* Hotline Info (inside sidebar-card) */
.hotline-info {
    text-align: center;
}

.hotline-info__number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0 0 4px;
}

.hotline-info__time {
    font-size: 13px;
    color: var(--color-text-muted);
    margin: 0;
}

/* Post Sidebar */
.post-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.ant-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
}

.ant-pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.2s ease;
}

.ant-pagination-item:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.ant-pagination-item-active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
    font-weight: 600;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.empty-state {
    text-align: center;
    padding: 48px 24px;
}

.empty-state__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 8px;
    color: var(--color-text);
}

.empty-state__desc {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 0;
}

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

@media (max-width: 1024px) {
    .filter-layout {
        grid-template-columns: 240px 1fr;
        gap: 24px;
    }

    .post-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .two-column-layout {
        grid-template-columns: 1fr 320px;
        gap: 24px;
    }
}

@media (max-width: 900px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }

    .two-column-layout aside {
        order: -1;
    }

    .article-card__body {
        padding: 24px;
    }

    .post-detail-hero {
        padding: 32px 0;
    }

    .post-detail-hero__meta {
        gap: 12px;
    }
}

@media (max-width: 768px) {
    .filter-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        flex-direction: row;
        overflow-x: auto;
        gap: 12px;
        padding-bottom: 8px;
    }

    .filter-sidebar .sidebar-card {
        flex-shrink: 0;
        min-width: 240px;
    }

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

    .card-grid--3 {
        grid-template-columns: 1fr;
    }

    .post-hero {
        padding: 32px 0;
    }

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

    .post-content {
        font-size: 15px;
    }

    .results-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}

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

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        justify-content: center;
    }

    .news-card__image {
        height: 160px;
    }
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card {
    animation: fadeInUp 0.4s ease forwards;
}

.news-card:nth-child(1) { animation-delay: 0.05s; }
.news-card:nth-child(2) { animation-delay: 0.1s; }
.news-card:nth-child(3) { animation-delay: 0.15s; }
.news-card:nth-child(4) { animation-delay: 0.2s; }
.news-card:nth-child(5) { animation-delay: 0.25s; }
.news-card:nth-child(6) { animation-delay: 0.3s; }
.news-card:nth-child(7) { animation-delay: 0.35s; }
.news-card:nth-child(8) { animation-delay: 0.4s; }
.news-card:nth-child(9) { animation-delay: 0.45s; }
