/* ============================================================
   MODULE.CSS v3.0 - 组件样式
   ============================================================
   匹配 Section 模板:
   - AuthorBoxSection / AuthorProfileSection / AuthorPostsListSection / MainAuthorsSection
   - FaqSection
   - SidebarWidgetsSection
   - PaginationSection
   - SearchBoxSection / SearchResultsSection
   - Error404Section
   - LegalArticleSection
   - PostListSection / RelatedPostsSection
   - SocialShareSection
   ============================================================ */

/* ============================================
   1. Author Profile (AuthorProfileSection)
   ============================================ */
.author-profile {
    background: linear-gradient(135deg, #fdfefe 0%, var(--color-bg-soft) 100%);
}

.author-profile h1 {
    color: var(--color-primary-darker);
}

.author-profile img.rounded-circle {
    border: 4px solid #fdfefe;
    border-radius: 20px;
    box-shadow: 0 6px 14px rgba(58, 76, 92, 0.08), 0 24px 44px -14px rgba(58, 76, 92, 0.18);
}

.author-profile .badge.bg-light {
    background: #eef3f6 !important;
    color: #415466 !important;
    border-color: #d6e0e7 !important;
    border-style: solid;
    border-radius: 999px;
    transition: all 0.34s ease;
}

.author-profile .badge.bg-light:hover {
    background: #6f8fa6 !important;
    color: #fdfefe !important;
}

/* ============================================
   2. Author Box (AuthorBoxSection)
   ============================================ */
.author-box {
    border-inline-start: 4px solid var(--color-accent);
    border-radius: 18px;
    transition: all 0.38s ease;
}

.author-box:hover {
    box-shadow: 0 6px 14px rgba(64, 82, 98, 0.07), 0 22px 42px -14px rgba(64, 82, 98, 0.16);
}

.author-box img {
    border-radius: 18px;
    transition: transform 0.34s ease;
}

.author-box:hover img {
    transform: scale(1.05);
}

/* ============================================
   3. Author Posts List (AuthorPostsListSection)
   ============================================ */
.author-posts-list .card {
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(37, 50, 63, 0.04), 0 18px 34px -16px rgba(37, 50, 63, 0.12);
    transition: all 0.4s ease;
    overflow: hidden;
}

.author-posts-list .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px rgba(37, 50, 63, 0.08), 0 28px 52px -16px rgba(37, 50, 63, 0.2);
}

.author-posts-list .card-img-top {
    filter: saturate(1.02) contrast(1.01);
    transition: transform 0.46s ease;
}

.author-posts-list .card:hover .card-img-top {
    transform: scale(1.05);
}

/* ============================================
   4. Main Authors (MainAuthorsSection)
   ============================================ */
.main-authors-section {
    background: var(--color-bg-soft);
}

.author-card {
    transition: all 0.4s ease;
    border: 1px solid var(--color-border-soft);
    border-style: solid;
    border-radius: 22px;
    box-shadow: 0 4px 10px rgba(48, 63, 77, 0.04), 0 16px 30px -18px rgba(48, 63, 77, 0.14);
}

.author-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 22px rgba(48, 63, 77, 0.08), 0 30px 56px -18px rgba(48, 63, 77, 0.2);
}

.author-card img.rounded-circle {
    border: 3px solid var(--color-bg-muted);
    border-radius: 20px;
    transition: border-color 0.4s ease;
}

.author-card:hover img.rounded-circle {
    border-color: var(--color-primary);
}

/* ============================================
   5. FAQ (FaqSection) - <details>/<summary>
   ============================================ */
.faq-section {
    background: linear-gradient(180deg, var(--color-bg-soft) 0%, #fbfcfd 100%);
}

.faq-section h2 {
    font-size: 1.75rem;
    color: var(--color-primary-darker);
    text-shadow: 0 2px 10px rgba(71, 96, 118, 0.1);
}

/* FAQ item */
.faq-list .faq-item {
    border: 1px solid rgba(109, 129, 146, 0.16);
    border-style: solid;
    border-radius: 18px;
    background: rgba(253, 254, 254, 0.88);
    box-shadow: 0 3px 8px rgba(33, 45, 57, 0.03), 0 14px 28px -18px rgba(33, 45, 57, 0.1);
    transition: all 0.38s ease;
    cursor: pointer;
}

.faq-list .faq-item:hover {
    box-shadow: 0 6px 14px rgba(33, 45, 57, 0.06) !important, 0 22px 40px -14px rgba(33, 45, 57, 0.14) !important;
    transform: translateY(-2px);
}

.faq-list .faq-item[open] {
    border-color: rgba(111, 143, 166, 0.34);
    background: linear-gradient(90deg, #edf4f7 0%, #fbfcfd 100%);
}

.faq-list .faq-item summary {
    list-style: none;
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1.6;
    padding-inline-end: 2rem;
    position: relative;
    user-select: none;
    color: #334454;
}

.faq-list .faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-list .faq-item summary::marker {
    content: '';
}

.faq-list .faq-item summary::after {
    content: '+';
    position: absolute;
    inset-inline-end: 0.25rem;
    inset-block-start: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--color-primary);
    text-shadow: 0 2px 8px rgba(111, 143, 166, 0.18);
    transition: transform 0.38s ease;
    line-height: 1;
}

.faq-list .faq-item[open] summary::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}

/* Q number */
.faq-list .faq-q-num {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-primary);
}

/* Answer */
.faq-list .faq-answer {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #556776;
    animation: faqFadeIn 0.38s ease;
}

@keyframes faqFadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   6. Sidebar Widgets (SidebarWidgetsSection)
   ============================================ */
.sidebar-widgets .card {
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(42, 55, 67, 0.04), 0 18px 36px -18px rgba(42, 55, 67, 0.12);
    transition: all 0.4s ease;
}

.sidebar-widgets .card:hover {
    box-shadow: 0 8px 18px rgba(42, 55, 67, 0.07), 0 26px 46px -16px rgba(42, 55, 67, 0.16);
}

.sidebar-widgets h5 {
    color: var(--color-primary-darker);
}

.sidebar-widgets .badge {
    border-radius: 999px;
    transition: all 0.34s ease;
    cursor: pointer;
}

.sidebar-widgets .badge:hover {
    background-color: var(--color-primary) !important;
    color: #fdfefe !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(111, 143, 166, 0.12), 0 14px 24px -14px rgba(111, 143, 166, 0.24);
}

.sidebar-widgets ul li:last-child {
    border-bottom: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.sidebar-widgets ul li a:hover .small {
    color: var(--color-primary) !important;
}

/* ============================================
   7. Pagination (PaginationSection)
   ============================================ */
.pagination .page-link {
    color: var(--color-primary);
    border-color: var(--color-border);
    border-style: solid;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(40, 54, 68, 0.03);
    transition: all 0.32s ease;
}

.pagination .page-link:hover {
    background-color: var(--color-bg-muted);
    color: var(--color-primary-dark);
    border-color: var(--color-primary);
    box-shadow: 0 4px 10px rgba(40, 54, 68, 0.06), 0 14px 24px -16px rgba(40, 54, 68, 0.14);
}

.pagination .page-item.active .page-link {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #fdfefe;
    box-shadow: 0 6px 14px rgba(111, 143, 166, 0.16), 0 18px 32px -16px rgba(111, 143, 166, 0.28);
}

.pagination .page-item.disabled .page-link {
    color: var(--color-text-light);
    opacity: 0.72;
}

/* ============================================
   8. Search Box (SearchBoxSection)
   ============================================ */
.search-box-section {
    background: var(--color-bg-soft);
}

.search-box-section .input-group-lg .form-control {
    border-radius: var(--radius-pill) 0 0 var(--radius-pill);
    padding-inline-start: 1.5rem;
    border-color: #d5e0e6;
    border-style: solid;
    caret-color: var(--color-primary);
    box-shadow: 0 3px 8px rgba(46, 61, 74, 0.03);
}

.search-box-section .input-group-lg .btn {
    border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
    box-shadow: 0 3px 8px rgba(46, 61, 74, 0.04);
}

.search-box-section .badge {
    border-radius: 999px;
    transition: all 0.34s ease;
}

.search-box-section .badge:hover {
    background-color: var(--color-primary) !important;
    color: #fdfefe !important;
    border-color: var(--color-primary) !important;
}

/* ============================================
   9. Search Results (SearchResultsSection)
   ============================================ */
.search-results-section {
    background: var(--color-bg);
}

.search-result {
    border-radius: 18px;
    transition: all 0.38s ease;
}

.search-result:hover {
    transform: translateX(3px);
    box-shadow: 0 6px 14px rgba(41, 53, 65, 0.06), 0 22px 40px -16px rgba(41, 53, 65, 0.14);
}

.search-result h2 a:hover {
    color: var(--color-primary) !important;
}

.search-result mark {
    background-color: #f2e7b9;
    color: #5d5130;
    padding-inline: 2px;
    border-radius: 6px;
    font-weight: 600;
}

/* ============================================
   10. Error Page (Error404Section)
   ============================================ */
.error-page h1 {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    line-height: 1;
    text-shadow: 0 6px 24px rgba(111, 143, 166, 0.18);
}

.recommended-links .badge {
    transition: all 0.34s ease;
    border: 1px solid var(--color-border);
    border-style: solid;
    border-radius: 999px;
}

.recommended-links .badge:hover {
    background-color: var(--color-primary) !important;
    color: #fdfefe !important;
    border-color: var(--color-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(111, 143, 166, 0.12), 0 14px 24px -14px rgba(111, 143, 166, 0.24);
}

.recommended-links .badge:hover .text-warning {
    color: var(--color-accent) !important;
}

/* ============================================
   11. Legal Article (LegalArticleSection)
   ============================================ */
.legal-article-section,
main:has(> .container > article.bg-white) {
    background: var(--color-bg-soft);
}

article :is(h2.h4) {
    color: var(--color-primary-dark);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-sm);
}

article .alert-info {
    background-color: #eaf2f5;
    border-color: #c8d9e2;
    color: var(--color-primary-dark);
    border-radius: 18px;
    box-shadow: 0 4px 10px rgba(52, 70, 84, 0.04), 0 16px 30px -20px rgba(52, 70, 84, 0.12);
}

article .list-group-item {
    background: transparent;
    border-radius: 14px;
    transition: all 0.32s ease;
}

article .list-group-item:hover {
    background: var(--color-bg-soft);
    padding-inline-start: var(--space-sm);
    box-shadow: 0 3px 8px rgba(43, 57, 70, 0.03);
}

/* ============================================
   12. Post List (PostListSection - Category page)
   ============================================ */
.posts-grid {
    /* Container nếu cần */
}

.posts-grid .card {
    transition: all 0.4s ease;
    border: 1px solid var(--color-border-soft);
    border-style: solid;
    border-radius: 22px;
    box-shadow: 0 4px 10px rgba(39, 52, 64, 0.04), 0 18px 34px -18px rgba(39, 52, 64, 0.12);
    overflow: hidden;
}

.posts-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px rgba(39, 52, 64, 0.08), 0 28px 48px -16px rgba(39, 52, 64, 0.18);
    border-color: var(--color-primary);
}

.posts-grid .card-img-top {
    filter: saturate(1.03);
    transition: transform 0.46s ease;
}

.posts-grid .card:hover .card-img-top {
    transform: scale(1.05);
}

.posts-grid .card-title a {
    transition: color 0.32s ease;
}

.posts-grid .card-title a:hover {
    color: var(--color-primary) !important;
}

/* ============================================
   13. Related Posts (RelatedPostsSection)
   ============================================ */
.related-posts h3 {
    border-bottom: 3px solid var(--color-accent);
    padding-bottom: var(--space-xs);
    display: inline-block;
    color: #3b4e5f;
}

.related-card {
    border-radius: 20px;
    transition: all 0.38s ease;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 14px rgba(42, 55, 68, 0.06), 0 22px 40px -16px rgba(42, 55, 68, 0.14);
}

.related-card img {
    border-radius: 18px;
    transition: transform 0.46s ease;
}

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

/* ============================================
   14. Social Share (SocialShareSection)
   ============================================ */
.social-share .btn {
    min-width: 40px;
    border-radius: 14px;
    transition: all 0.32s ease;
    accent-color: var(--color-primary);
}

.social-share .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(45, 58, 72, 0.06), 0 14px 24px -14px rgba(45, 58, 72, 0.16);
}

.social-share [data-copy-url].copied {
    background-color: var(--color-success);
    color: #fdfefe;
    border-color: var(--color-success);
}

/* ============================================
   15. Bootstrap Accordion override
   ============================================ */
.accordion-button:not(.collapsed) {
    background-color: #eaf2f5;
    color: var(--color-primary-dark);
    box-shadow: inset 0 -1px 0 rgba(122, 142, 160, 0.12);
}

.accordion-button:focus {
    outline-color: rgba(111, 143, 166, 0.32);
    box-shadow: 0 0 0 0.2rem rgba(111, 143, 166, 0.16);
}

/* ============================================
   16. Modal (用于 SocialShare 微信二维码)
   ============================================ */
.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #fdfefe 0%, #f4f7f9 100%);
    box-shadow: 0 10px 24px rgba(39, 52, 64, 0.08), 0 34px 64px -20px rgba(39, 52, 64, 0.22);
    backdrop-filter: blur(10px);
}

/* ============================================
   17. Tooltip (Bootstrap)
   ============================================ */
.tooltip-inner {
    background-color: var(--color-primary-darker);
    color: #fdfefe;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(32, 43, 54, 0.08), 0 18px 30px -18px rgba(32, 43, 54, 0.2);
}

/* ============================================
   18. Responsive
   ============================================ */
@media (max-width: 767.98px) {
    .faq-section h2 {
        font-size: 1.4rem;
    }

    .faq-list .faq-item summary {
        font-size: 0.95rem;
        padding-inline-end: 1.5rem;
    }

    .faq-list .faq-answer {
        font-size: 0.88rem;
    }

    .author-profile h1 {
        font-size: 1.5rem;
    }

    .author-profile .col-md-3 img {
        width: 120px !important;
        height: 120px !important;
    }

    .error-page h1 {
        font-size: 5rem !important;
    }

    .search-box-section .input-group-lg .form-control,
    .search-box-section .input-group-lg .btn {
        font-size: 1rem;
    }
}

@media (max-width: 575.98px) {
    .related-posts .row > [class*="col-"] {
        margin-bottom: var(--space-sm);
    }

    .pagination .page-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.9rem;
    }
}