/* News page specific styles moved from app/views/pages/News.php */

/* ===== Định dạng: News Card - Thẻ bài viết cơ bản ===== */
.news-card {
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    transition: box-shadow 0.3s ease, transform 1s ease;
}

/* ===== Hiệu ứng: Wave Glass - Hiệu ứng thủy tinh khi hover ===== */
.wave-glass {
    position: relative;
    overflow: hidden;
}

/* Định dạng chung cho 4 mảnh kính */
.wave-glass .glass-piece {
    position: absolute;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    width: 0;
    height: 0;
    opacity: 1;
    z-index: 20;
    pointer-events: none;
}

/* Đặt 4 mảnh vào 4 góc */
.wave-glass .glass-piece.top-left { 
    top: 0; 
    left: 0;
}
.wave-glass .glass-piece.top-right { 
    top: 0; 
    right: 0;
}
.wave-glass .glass-piece.bottom-left { 
    bottom: 0; 
    left: 0;
}
.wave-glass .glass-piece.bottom-right { 
    bottom: 0; 
    right: 0;
}

/* Animatin hover: Mở rộng mảnh kính, mờ dần */
.wave-glass:hover .glass-piece {
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: all 1.3s;
}

/* ===== Responsive: Tablet và điện thoại ===== */
@media (max-width: 1024px) {
    #discoverBar {
        margin-bottom: 1.5rem;
    }

    #discoverBar .grid {
        gap: 1rem;
    }

    #discoverBar .font-semibold {
        margin-bottom: 0.25rem;
    }

    .news-card,
    .news-card:hover {
        transform: none;
    }

    #sliderDots {
        right: 1rem;
        bottom: 1rem;
    }

    #btnPrev,
    #btnNext {
        opacity: 1;
    }
}

@media (max-width: 768px) {
    #discoverBar section {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    #discoverBar .flex.flex-wrap {
        gap: 0.5rem;
    }

    #discoverBar .px-4.py-1\.5 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .news-card {
        border-radius: 1rem;
    }

    #sliderContainer,
    .news-slider-shell {
        height: 320px;
    }

    #btnPrev,
    #btnNext {
        width: 2.5rem;
        height: 2.5rem;
        left: 0.75rem;
        right: 0.75rem;
    }

    #sliderDots {
        gap: 0.35rem;
    }

    #sliderDots button,
    #sliderDots span {
        transform: scale(0.9);
    }

    .snap-start {
        width: 12.5rem;
    }
}

@media (max-width: 640px) {
    #discoverBar {
        border-bottom: 1px solid #e5e7eb;
    }

    #discoverBar .font-semibold {
        font-size: 0.95rem;
    }

    #sliderContainer,
    .news-slider-shell {
        height: 280px;
    }

    .news-home-slide-title {
        font-size: 1.35rem;
        line-height: 1.2;
    }

    .news-home-slide-summary {
        width: 100%;
        font-size: 0.75rem;
    }

    .news-home-slide-meta {
        font-size: 0.72rem;
        gap: 0.4rem;
    }

    .news-home-trending-card {
        width: 10rem;
    }

    .news-home-trending-image {
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .news-home-trending-title {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .line-clamp-2,
    .line-clamp-3 {
        -webkit-line-clamp: 2;
    }

    .snap-start {
        width: 11.5rem;
    }

    h2 {
        scroll-margin-top: 90px;
    }
}

/* ===== Additional rules extracted from NewsList.php ===== */
/* Add box-shadow and hover effect for .news-card used in list views */
.news-card {
    box-shadow: 0 8px 10px rgba(0, 0, 0, 0.08);
}

.news-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Search result, dropdown, and list-page specific rules */
.search-result-item:hover {
    background: #f8fafc;
}

.search-dropdown-empty {
    color: #64748b;
}

/* Scoped responsive tweaks for news list pages */
.news-list-page {
    /* container padding handled by page markup */
}

@media (max-width: 768px) {
    .news-list-page .news-list-header h1 {
        font-size: 1.875rem;
        line-height: 1.15;
    }

    .news-list-page .news-list-grid {
        gap: 1rem;
    }

    .news-list-page .news-list-card-image.relative.h-52 {
        height: 13rem;
    }

    .news-list-page .news-list-pagination {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .news-list-page nav ol {
        gap: 0.4rem;
        flex-wrap: wrap;
    }

    .news-list-page .news-list-grid {
        grid-template-columns: 1fr;
    }

    .news-list-page .news-card {
        border-radius: 1rem;
    }

    .news-list-page .news-card h2 {
        font-size: 1rem;
        line-height: 1.35;
    }

    .news-list-page .news-card p {
        font-size: 0.78rem;
        line-height: 1.45;
    }

    .news-list-page .news-list-card-image {
        aspect-ratio: 1 / 1;
        height: auto;
    }

    .news-list-page .news-list-pagination a,
    .news-list-page .news-list-pagination span {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }
}

/* ===== Additional rules extracted from NewsDetail.php ===== */
/* TinyMCE content styling - Notion-like background */
.chi-tiet-bai-viet {
    color: #37352f;
}

.chi-tiet-bai-viet h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.chi-tiet-bai-viet h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #1a1a1a;
}

.chi-tiet-bai-viet p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.chi-tiet-bai-viet img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px;
    margin: 2rem auto;
    display: block;
}

.chi-tiet-bai-viet iframe {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    margin: 2rem 0;
}

.chi-tiet-bai-viet figcaption {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    font-style: italic;
    margin-top: -1rem;
    margin-bottom: 2rem;
}

.toc-link.active {
    color: #2563eb;
    border-left-color: #2563eb;
    background-color: #f3f4f6;
}

html {
    scroll-behavior: smooth;
}

section[id], h2[id], h1[id] {
    scroll-margin-top: 120px;
}

@media (max-width: 1024px) {
    .news-detail-layout {
        gap: 2rem;
    }

    .news-detail-article {
        width: 100%;
    }

    .news-detail-toc {
        width: 100%;
        order: -1;
    }

    .news-detail-toc-panel {
        position: relative;
        top: auto;
    }
}

@media (max-width: 768px) {
    .news-detail-page {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .news-detail-page .breadcrumb ol {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }

    .news-detail-page .breadcrumb li {
        max-width: 100%;
    }

    .news-detail-article {
        padding: 1.25rem;
        border-radius: 1.5rem;
    }

    .news-detail-article h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .news-detail-meta {
        gap: 0.75rem;
        align-items: flex-start;
    }

    .news-detail-toc-panel {
        padding: 1rem;
        border-radius: 1.25rem;
    }
}

@media (max-width: 640px) {
    .news-detail-page .breadcrumb {
        display: none;
    }

    .news-detail-article .mb-8 p {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    .news-detail-article .chi-tiet-bai-viet {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .news-detail-article .chi-tiet-bai-viet p {
        font-size: 0.9rem;
    }

    .news-detail-meta {
        gap: 0.75rem;
    }

    .news-detail-meta .w-12.h-12 {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 0.85rem;
    }

    .news-detail-meta > div .font-bold {
        font-size: 0.875rem;
    }

    .news-detail-meta > div .text-gray-400 {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .comments-list-item {
        padding: 0.75rem;
    }

    .comments-list-item .font-bold {
        font-size: 0.875rem;
    }

    .comments-list-item .text-gray-600,
    .comments-list-item .text-xs,
    .comments-list-item p {
        font-size: 0.8rem;
    }

    .comments-list-item .text-gray-400 {
        font-size: 0.7rem;
    }

    .news-detail-article h1 {
        font-size: 1.75rem;
    }

    .news-detail-article .chi-tiet-bai-viet h2 {
        font-size: 1.5rem;
    }

    .news-detail-article .chi-tiet-bai-viet h3 {
        font-size: 1.25rem;
    }

    .news-detail-toc-panel {
        padding: 0.2rem;
    }

    .news-detail-toc-panel #toc-list {
        gap: 0.125rem;
    }
}
