/* ============================================================
   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, #f5f1e8 0%, #e9e4d9 100%);
}

.author-profile h1 {
    color: #1a1a1a;
}

.author-profile img.rounded-circle {
    border: 3px solid #f5f1e8;
    box-shadow: 0 1px 3px rgba(26, 26, 26, 0.12), 0 1px 2px rgba(26, 26, 26, 0.08);
    border-radius: 4px;
}

.author-profile .badge.bg-light {
    background: #e3dfd6 !important;
    color: #1a1a1a !important;
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
}

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

/* ============================================
   2. Author Box (AuthorBoxSection)
   ============================================ */
.author-box {
    border-inline-start: 4px solid #c44536;
    transition: all 200ms ease-in-out;
}

.author-box:hover {
    box-shadow:
       0 1px 3px rgba(196, 69, 54, 0.2),
       0 4px 6px rgba(196, 69, 54, 0.15);
}

.author-box img {
    transition: transform 150ms ease-in-out;
    border-radius: 4px;
}

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

/* ============================================
   3. Author Posts List (AuthorPostsListSection)
   ============================================ */
.author-posts-list .card {
    transition: all 250ms ease;
    overflow: hidden;
    border-radius: 4px;
    border: 1px solid #ddd9cc;
}

.author-posts-list .card:hover {
    transform: translateY(-4px);
    box-shadow:
       0 2px 6px rgba(26, 26, 26, 0.1),
       0 6px 12px rgba(196, 69, 54, 0.15);
    border-color: #c44536;
}

.author-posts-list .card-img-top {
    transition: transform 350ms ease;
}

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

/* ============================================
   4. Main Authors (MainAuthorsSection)
   ============================================ */
.main-authors-section {
    background: #e9e4d9;
}

.author-card {
    transition: all 200ms ease;
    border: 1px solid #d6d2c1;
    border-radius: 4px;
}

.author-card:hover {
    transform: translateY(-6px);
    box-shadow:
       0 3px 8px rgba(26, 26, 26, 0.1),
       0 6px 10px rgba(107, 112, 92, 0.12);
    border-color: #6b705c;
}

.author-card img.rounded-circle {
    border: 2px solid #e3dfd6;
    transition: border-color 200ms ease;
    border-radius: 4px;
}

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

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

.faq-section h2 {
    font-size: 1.75rem;
    color: #1a1a1a;
}

/* FAQ item */
.faq-list .faq-item {
    border: 1px solid rgba(26, 26, 26, 0.05);
    transition: all 200ms ease;
    cursor: pointer;
    border-radius: 4px;
}

.faq-list .faq-item:hover {
    box-shadow:
      0 2px 8px rgba(196, 69, 54, 0.08),
      0 6px 14px rgba(26, 26, 26, 0.05) !important;
    transform: translateY(-2px);
}

.faq-list .faq-item[open] {
    border-color: rgba(107, 112, 92, 0.3);
    background: linear-gradient(90deg, #f1f3eb 0%, #f5f1e8 100%);
}

/* summary */
.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: #1a1a1a;
}

.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.3rem;
    inset-block-start: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 300;
    color: #c44536;
    transition: transform 200ms ease;
    line-height: 1;
    text-shadow: 0 0 1px rgba(196,69,54,0.5);
}

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

/* Answer */
.faq-list .faq-answer {
    font-size: 0.95rem;
    line-height: 1.8;
    animation: faqFadeIn 200ms ease;
}

/* ============================================
   6. Sidebar Widgets (SidebarWidgetsSection)
   ============================================ */
.sidebar-widgets .card {
    transition: all 200ms ease;
    border-radius: 4px;
    border: 1px solid #d6d2c1;
}

.sidebar-widgets .card:hover {
    box-shadow:
      0 2px 6px rgba(26, 26, 26, 0.05),
      0 5px 10px rgba(107, 112, 92, 0.1);
}

.sidebar-widgets h5 {
    color: #1a1a1a;
}

.sidebar-widgets .badge {
    transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border-radius: 4px;
}

.sidebar-widgets .badge:hover {
    background-color: #c44536 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

/* last child fixes */
.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: #c44536 !important;
}

/* ============================================
   7. Pagination (PaginationSection)
   ============================================ */
.pagination .page-link {
    color: #c44536;
    border-color: #d6d2c1;
    border-style: solid;
    transition: all 150ms ease;
    border-radius: 4px;
}

.pagination .page-link:hover {
    background-color: #f1f0ea;
    color: #6b705c;
    border-color: #c44536;
}

.pagination .page-item.active .page-link {
    background-color: #c44536;
    border-color: #c44536;
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #bfbfbf;
}

/* ============================================
   8. Search Box (SearchBoxSection)
   ============================================ */
.search-box-section {
    background: #e9e4d9;
}

.search-box-section .input-group-lg .form-control {
    border-radius: 4px 0 0 4px;
    padding-inline-start: 1.5rem;
    border-color: #d6d2c1;
}

.search-box-section .input-group-lg .btn {
    border-radius: 0 4px 4px 0;
    border-color: #d6d2c1;
}

.search-box-section .badge {
    transition: all 150ms ease;
    border-radius: 4px;
}

.search-box-section .badge:hover {
    background-color: #c44536 !important;
    color: #fff !important;
    border-color: #c44536 !important;
}

/* ============================================
   9. Search Results (SearchResultsSection)
   ============================================ */
.search-results-section {
    background: #f5f1e8;
}

.search-result {
    transition: all 200ms ease;
    border-radius: 4px;
}

.search-result:hover {
    transform: translateX(3px);
    box-shadow:
       0 1px 3px rgba(26, 26, 26, 0.1),
       0 4px 8px rgba(196, 69, 54, 0.1);
}

.search-result h2 a:hover {
    color: #c44536 !important;
    text-shadow: 0 0 2px #c44536aa;
}

.search-result mark {
    background-color: #f7f3a6;
    padding-inline: 2px;
    border-radius: 3px;
    font-weight: 600;
    color: #6b705c;
}

/* ============================================
   10. Error Page (Error404Section)
   ============================================ */
.error-page h1 {
    background: linear-gradient(135deg, #c44536, #6b705c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    line-height: 1;
    text-shadow: 0 3px 14px rgba(196, 69, 54, 0.25);
}

.recommended-links .badge {
    transition: all 150ms ease;
    border: 1px solid #d6d2c1;
    border-radius: 4px;
    color: #1a1a1a;
}

.recommended-links .badge:hover {
    background-color: #c44536 !important;
    color: #fff !important;
    border-color: #c44536 !important;
    transform: translateY(-2px);
    box-shadow:
      0 1px 3px rgba(196, 69, 54, 0.3);
}

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

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

article :is(h2.h4) {
    color: #6b705c;
    border-bottom: 2px solid #d6d2c1;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
    border-radius: 2px;
}

article .alert-info {
    background-color: #f0f3eb;
    border-color: #b8c3aa;
    color: #6b705c;
    border-radius: 4px;
}

article .list-group-item {
    background: transparent;
    transition: all 150ms ease;
    border-radius: 4px;
}

article .list-group-item:hover {
    background: #e3dfd6;
    padding-inline-start: 0.5rem;
}

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

.posts-grid .card {
    transition: all 200ms ease;
    border: 1px solid #d6d2c1;
    overflow: hidden;
    border-radius: 4px;
}

.posts-grid .card:hover {
    transform: translateY(-4px);
    box-shadow:
       0 2px 7px rgba(26, 26, 26, 0.08),
       0 5px 10px rgba(196, 69, 54, 0.12);
    border-color: #c44536;
}

.posts-grid .card-img-top {
    transition: transform 350ms ease;
}

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

.posts-grid .card-title a {
    transition: color 150ms ease;
}

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

/* ============================================
   13. Related Posts (RelatedPostsSection)
   ============================================ */
.related-posts h3 {
    border-bottom: 3px solid #6b705c;
    padding-bottom: 0.25rem;
    display: inline-block;
    border-radius: 2px;
}

.related-card {
    transition: all 200ms ease;
    border-radius: 4px;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow:
      0 1px 3px rgba(26, 26, 26, 0.1),
      0 5px 12px rgba(107, 112, 92, 0.15);
}

.related-card img {
    transition: transform 350ms ease;
    border-radius: 4px;
}

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

/* ============================================
   14. Social Share (SocialShareSection)
   ============================================ */
.social-share .btn {
    min-width: 40px;
    transition: all 150ms ease;
    border-radius: 4px;
    background-color: #f5f1e8;
    color: #1a1a1a;
    border: 1px solid #c44536;
}

.social-share .btn:hover {
    transform: translateY(-2px);
    box-shadow:
      0 1px 4px rgba(196, 69, 54, 0.3);
    background-color: #c44536;
    color: #fff;
    border-color: #6b705c;
}

.social-share [data-copy-url].copied {
    background-color: #6b705c;
    color: #fff;
    border-color: #6b705c;
}

/* ============================================
   15. Bootstrap Accordion override
   ============================================ */
.accordion-button:not(.collapsed) {
    background-color: #f0f3eb;
    color: #6b705c;
    box-shadow: none;
    border-radius: 4px;
}

.accordion-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(107, 112, 92, 0.25);
}

/* ============================================
   16. Modal (用于 SocialShare 微信二维码)
   ============================================ */
.modal-content {
    border: none;
    border-radius: 8px;
    box-shadow:
       0 8px 20px rgba(26, 26, 26, 0.08),
       0 6px 10px rgba(107, 112, 92, 0.12);
}

/* ============================================
   17. Tooltip (Bootstrap)
   ============================================ */
.tooltip-inner {
    background-color: #1a1a1a;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #f5f1e8;
    text-shadow: 0 0 2px rgba(0,0,0,0.6);
}

/* ============================================
   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;
        border-radius: 4px !important;
    }

    .error-page h1 {
        font-size: 5rem !important;
        text-shadow: 0 3px 14px rgba(196, 69, 54, 0.3);
    }

    .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: 0.4rem;
    }

    .pagination .page-link {
        padding: 0.35rem 0.65rem;
        font-size: 0.9rem;
    }
}