/* ============================================================
   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, #fffaf5 0%, var(--color-bg-soft) 100%);
}

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

.author-profile img.rounded-circle {
    border: 4px solid #fff7ed;
    box-shadow: 0 8px 18px rgba(120, 87, 52, 0.08), 0 24px 44px -16px rgba(120, 87, 52, 0.18);
    border-radius: 50%;
}

.author-profile .badge.bg-light {
    background: #fff1e6 !important;
    color: #7a4b2f !important;
    transition: all 0.38s ease;
    border-radius: 999px;
    border-color: #ffd7bf !important;
}

.author-profile .badge.bg-light:hover {
    background: #ff8a4c !important;
    color: #fffaf7 !important;
}

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

.author-box:hover {
    box-shadow: 0 6px 14px rgba(78, 61, 45, 0.06), 0 22px 42px -14px rgba(78, 61, 45, 0.14);
}

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

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

/* ============================================
   3. Author Posts List (AuthorPostsListSection)
   ============================================ */
.author-posts-list .card {
    transition: all 0.42s ease;
    overflow: hidden;
    border-radius: 22px;
    box-shadow: 0 3px 8px rgba(28, 36, 44, 0.04), 0 16px 36px -18px rgba(28, 36, 44, 0.12);
    border-color: #e7ddd3;
}

.author-posts-list .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(28, 36, 44, 0.06), 0 26px 50px -16px rgba(28, 36, 44, 0.18);
}

.author-posts-list .card-img-top {
    transition: transform 0.48s 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.42s ease;
    border: 1px solid #eadfd5;
    border-radius: 22px;
    box-shadow: 0 4px 10px rgba(41, 52, 63, 0.04), 0 18px 38px -18px rgba(41, 52, 63, 0.13);
    background: linear-gradient(180deg, #ffffff 0%, #fff9f3 100%);
}

.author-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(41, 52, 63, 0.06), 0 30px 54px -18px rgba(41, 52, 63, 0.18);
}

.author-card img.rounded-circle {
    border: 3px solid #ffe7d1;
    transition: border-color 0.42s ease;
}

.author-card:hover img.rounded-circle {
    border-color: #ff8a4c;
}

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

.faq-section h2 {
    font-size: 1.75rem;
    color: var(--color-primary-darker);
    text-shadow: 0 2px 12px rgba(255, 138, 76, 0.12);
}

/* FAQ item */
.faq-list .faq-item {
    border: 1px solid rgba(135, 96, 67, 0.10);
    transition: all 0.42s ease;
    cursor: pointer;
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.03), 0 20px 40px -14px rgba(62, 45, 32, 0.10);
}

.faq-list .faq-item:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.04) !important, 0 24px 46px -12px rgba(62, 45, 32, 0.14) !important;
    transform: translateY(-2px);
}

.faq-list .faq-item[open] {
    border-color: rgba(255, 138, 76, 0.28);
    background: linear-gradient(90deg, #fff1e8 0%, #ffffff 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;
}

.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: #ff8a4c;
    transition: transform 0.42s ease, color 0.42s ease;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(255, 138, 76, 0.18);
}

.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: #ff8a4c;
}

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

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

/* ============================================
   6. Sidebar Widgets (SidebarWidgetsSection)
   ============================================ */
.sidebar-widgets .card {
    transition: all 0.42s ease;
    border-radius: 20px;
    box-shadow: 0 4px 8px rgba(31, 40, 49, 0.04), 0 20px 36px -18px rgba(31, 40, 49, 0.12);
    border-color: #e8ddd2;
    background: linear-gradient(180deg, #ffffff 0%, #fffaf4 100%);
}

.sidebar-widgets .card:hover {
    box-shadow: 0 8px 16px rgba(31, 40, 49, 0.05), 0 24px 42px -16px rgba(31, 40, 49, 0.16);
}

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

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

.sidebar-widgets .badge:hover {
    background-color: #7a7cff !important;
    color: #fffafc !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(122, 124, 255, 0.16), 0 16px 28px -12px rgba(122, 124, 255, 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: #7a7cff !important;
}

/* ============================================
   7. Pagination (PaginationSection)
   ============================================ */
.pagination .page-link {
    color: #7a7cff;
    border-color: #ded8f8;
    transition: all 0.34s ease;
    border-radius: 14px;
    box-shadow: 0 2px 6px rgba(72, 62, 140, 0.04);
}

.pagination .page-link:hover {
    background-color: #f3f0ff;
    color: #5d5fe0;
    border-color: #7a7cff;
    box-shadow: 0 6px 12px rgba(122, 124, 255, 0.10), 0 18px 30px -16px rgba(122, 124, 255, 0.18);
}

.pagination .page-item.active .page-link {
    background-color: #7a7cff;
    border-color: #7a7cff;
    color: #fff;
    box-shadow: 0 8px 16px rgba(122, 124, 255, 0.16), 0 22px 34px -16px rgba(122, 124, 255, 0.24);
}

.pagination .page-item.disabled .page-link {
    color: #b3abc7;
    opacity: 0.8;
}

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

.search-box-section .input-group-lg .form-control {
    border-radius: 999px 0 0 999px;
    padding-inline-start: 1.5rem;
    border-color: #e4d8cb;
    box-shadow: inset 0 1px 2px rgba(90, 70, 54, 0.04);
    caret-color: #ff8a4c;
}

.search-box-section .input-group-lg .btn {
    border-radius: 0 999px 999px 0;
    background: linear-gradient(135deg, #ff8a4c 0%, #ffb36d 100%);
    border-color: #ff9c60;
    box-shadow: 0 8px 16px rgba(255, 138, 76, 0.14), 0 20px 34px -16px rgba(255, 138, 76, 0.22);
}

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

.search-box-section .badge:hover {
    background-color: #00b894 !important;
    color: #fff !important;
    border-color: #00b894 !important;
    box-shadow: 0 6px 14px rgba(0, 184, 148, 0.14), 0 18px 28px -16px rgba(0, 184, 148, 0.26);
}

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

.search-result {
    transition: all 0.42s ease;
    border-radius: 20px;
}

.search-result:hover {
    transform: translateX(3px);
    box-shadow: 0 8px 16px rgba(40, 50, 60, 0.04), 0 24px 42px -16px rgba(40, 50, 60, 0.14);
    background: linear-gradient(90deg, rgba(255, 250, 244, 0.9) 0%, rgba(255, 255, 255, 0.98) 100%);
}

.search-result h2 a:hover {
    color: #ff8a4c !important;
}

.search-result mark {
    background-color: #ffe08a;
    padding-inline: 2px;
    border-radius: 8px;
    font-weight: 600;
    color: #6d4a1f;
    box-shadow: inset 0 -1px 0 rgba(255, 184, 0, 0.18);
}

/* ============================================
   10. Error Page (Error404Section)
   ============================================ */
.error-page h1 {
    background: linear-gradient(135deg, #7a7cff, #ff8a4c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    line-height: 1;
    text-shadow: 0 8px 28px rgba(122, 124, 255, 0.18);
}

.recommended-links .badge {
    transition: all 0.34s ease;
    border: 1px solid #e2d9cf;
    border-radius: 999px;
    box-shadow: 0 2px 6px rgba(41, 34, 29, 0.04);
}

.recommended-links .badge:hover {
    background-color: #ff8a4c !important;
    color: #fff !important;
    border-color: #ff8a4c !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 14px rgba(255, 138, 76, 0.12), 0 22px 32px -18px rgba(255, 138, 76, 0.22);
}

.recommended-links .badge:hover .text-warning {
    color: #ffe08a !important;
}

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

article :is(h2.h4) {
    color: #5d5fe0;
    border-bottom: 2px solid #e7ddd2;
    padding-bottom: var(--space-xs);
    margin-bottom: var(--space-sm);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

article .alert-info {
    background-color: #fff4ea;
    border-color: #ffd1ae;
    color: #9a5a2d;
    border-radius: 18px;
    box-shadow: 0 4px 10px rgba(154, 90, 45, 0.05), 0 18px 32px -20px rgba(154, 90, 45, 0.16);
}

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

article .list-group-item:hover {
    background: #fffaf4;
    padding-inline-start: var(--space-sm);
    box-shadow: inset 0 0 0 1px rgba(255, 138, 76, 0.08);
}

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

.posts-grid .card {
    transition: all 0.42s ease;
    border: 1px solid #e8ddd3;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 4px 8px rgba(33, 40, 49, 0.04), 0 20px 38px -18px rgba(33, 40, 49, 0.12);
    background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
}

.posts-grid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(33, 40, 49, 0.05), 0 28px 52px -18px rgba(33, 40, 49, 0.18);
    border-color: #ff8a4c;
}

.posts-grid .card-img-top {
    transition: transform 0.48s ease;
}

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

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

.posts-grid .card-title a:hover {
    color: #ff8a4c !important;
}

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

.related-card {
    transition: all 0.42s ease;
    border-radius: 22px;
    box-shadow: 0 4px 8px rgba(27, 37, 45, 0.04), 0 18px 34px -18px rgba(27, 37, 45, 0.12);
    background: linear-gradient(180deg, #ffffff 0%, #f9fffd 100%);
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(27, 37, 45, 0.05), 0 24px 42px -16px rgba(27, 37, 45, 0.16);
}

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

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

/* ============================================
   14. Social Share (SocialShareSection)
   ============================================ */
.social-share .btn {
    min-width: 40px;
    transition: all 0.34s ease;
    border-radius: 16px;
    box-shadow: 0 3px 8px rgba(39, 48, 58, 0.05);
}

.social-share .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 14px rgba(39, 48, 58, 0.07), 0 20px 32px -18px rgba(39, 48, 58, 0.16);
    filter: saturate(1.05);
}

.social-share [data-copy-url].copied {
    background-color: #00b894;
    color: #fff;
    border-color: #00b894;
    box-shadow: 0 8px 16px rgba(0, 184, 148, 0.14), 0 22px 34px -18px rgba(0, 184, 148, 0.24);
}

/* ============================================
   15. Bootstrap Accordion override
   ============================================ */
.accordion-button:not(.collapsed) {
    background-color: #fff2e8;
    color: #9a5a2d;
    box-shadow: none;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 138, 76, 0.16);
    outline: 1px solid rgba(255, 138, 76, 0.18);
    outline-color: rgba(255, 138, 76, 0.18);
}

.accordion-button {
    border-radius: 16px;
}

/* ============================================
   16. Modal (用于 SocialShare 微信二维码)
   ============================================ */
.modal-content {
    border: none;
    border-radius: 24px;
    box-shadow: 0 12px 24px rgba(24, 31, 38, 0.08), 0 32px 64px -20px rgba(24, 31, 38, 0.24);
    background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
    backdrop-filter: blur(10px);
}

/* ============================================
   17. Tooltip (Bootstrap)
   ============================================ */
.tooltip-inner {
    background-color: #3c3155;
    border-radius: 12px;
    font-size: 0.85rem;
    box-shadow: 0 8px 16px rgba(60, 49, 85, 0.16), 0 22px 34px -18px rgba(60, 49, 85, 0.26);
}

/* ============================================
   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;
    }
}