/**
 * Community Q&A forum (public) — markup from local_cms_render_community_qa_forum_page().
 *
 * @package local_cms
 */
.path-local-cms-commqa:not(.editing) .activity-header {
    display: none;
}

/*
 * Hero + forum shell: .local-cms-community-qa = root wrapper from qa_lib (always in DOM).
 * Matches Tri thức số list banner (theme iomadboost cms.scss); avoids relying only on body.path-*.
 */
.local-cms-community-qa > .cms-hero-slider {
    text-align: left;
}

body.path-local-cms-category .local-cms-community-qa > .cms-hero-slider,
body.path-local-cms-community_topic .local-cms-community-qa > .cms-hero-slider {
    width: calc(100% + 160px);
    max-width: none;
    margin-inline: -80px;
    margin-bottom: 0;
    box-sizing: border-box;
}

@media (max-width: 991.98px) {
    body.path-local-cms-category .local-cms-community-qa > .cms-hero-slider,
    body.path-local-cms-community_topic .local-cms-community-qa > .cms-hero-slider {
        width: 100%;
        margin-inline: 0;
    }
}

.local-cms-community-qa .cms-hero {
    width: 100%;
    height: min(48vh, 480px);
    min-height: 300px;
    max-height: none;
    border-radius: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

@supports (height: 100dvh) {
    .local-cms-community-qa .cms-hero {
        height: min(48dvh, 480px);
    }
}

.local-cms-community-qa .cms-hero.cms-hero--has-image {
    padding: 0;
    height: min(48vh, 480px);
    min-height: 300px;
}

@supports (height: 100dvh) {
    .local-cms-community-qa .cms-hero.cms-hero--has-image {
        height: min(48dvh, 480px);
    }
}

@media (max-width: 768px) {
    .local-cms-community-qa .cms-hero,
    .local-cms-community-qa .cms-hero.cms-hero--has-image {
        height: min(42vh, 380px);
        min-height: 240px;
    }

    @supports (height: 100dvh) {
        .local-cms-community-qa .cms-hero,
        .local-cms-community-qa .cms-hero.cms-hero--has-image {
            height: min(42dvh, 380px);
        }
    }
}

.local-cms-community-qa .cms-hero.cms-hero--has-image .cms-hero__bg {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.local-cms-community-qa .cms-hero .cms-hero__content {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 153px;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    flex: 0 0 auto;
    margin-top: auto;
    box-sizing: border-box;
    text-align: left;
    overflow: hidden;
    padding: 40px 80px 40px;
}

@media (max-width: 768px) {
    .local-cms-community-qa .cms-hero .cms-hero__content {
        padding: 24px 20px 24px;
    }
}

.local-cms-community-qa .cms-hero.cms-hero--has-image .cms-hero__content {
    top: auto;
    bottom: 0;
    left: 0;
    max-width: none;
    padding: 40px 80px 40px;
    background: transparent;
    text-align: left;
    align-items: flex-start;
}

.local-cms-community-qa .cms-hero.cms-hero--has-image .cms-hero__title,
.local-cms-community-qa .cms-hero.cms-hero--has-image .cms-hero__desc {
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85), 0 1px 3px rgba(0, 0, 0, 0.95);
}

@media (max-width: 768px) {
    .local-cms-community-qa .cms-hero.cms-hero--has-image .cms-hero__content {
        padding: 24px 20px 24px;
    }
}

.local-cms-community-qa .cms-hero__title {
    color: #fff;
    font-size: 64px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
    margin: 0 0 0.5rem;
}

@media (max-width: 768px) {
    .local-cms-community-qa .cms-hero__title {
        font-size: 2rem;
    }
}

.local-cms-community-qa .cms-hero__desc {
    color: rgba(255, 255, 255, 0.92);
    font-size: 20px;
    line-height: 1.5;
    text-align: left;
    margin: 0;
}

.local-cms-community-qa .cms-hero__desc p {
    margin: 0;
}

@media (max-width: 768px) {
    .local-cms-community-qa .cms-hero__desc {
        font-size: 1rem;
    }
}

.local-cms-community-qa .cms-hero:not(.cms-hero--has-image) {
    background: rgb(251, 23, 28);
    justify-content: flex-end;
    padding: 0;
}

.local-cms-community-qa .cms-hero:not(.cms-hero--has-image) .cms-hero__content {
    background: transparent;
}

/* Full-width soft panel behind filters + cards (mockup) */
.local-cms-community-qa .community-content {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 1.5rem 0 2.5rem;
    border: 1px solid #e8e8e8; 
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
    box-sizing: border-box;
}

.local-cms-community-qa .community-content-inner {
    margin: 0 auto;
    padding: 48px 64px 64px;
    box-sizing: border-box;
}

/* Scoped: tránh Bootstrap/theme ép button/tab full-width hoặc flex-column */
.local-cms-community-qa .forum-filter.forum-filter-centered {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.625rem 1rem;
    margin-bottom: 1.75rem;
    width: 100%;
    box-sizing: border-box;
}

.local-cms-community-qa .forum-filter-tab {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid #c8cdd4;
    background: #fff;
    color: #111;
    padding: 0.55rem 1.15rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-radius: 999px;
    line-height: 1.3;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
    text-align: center;
}

/* Topic pill colors: --forum-topic-color set inline per slug in qa_lib.php */

.local-cms-community-qa .forum-filter-tab:not(.active) {
    border-color: var(--forum-topic-color, #c8cdd4);
    color: var(--forum-topic-color, #111);
}

.local-cms-community-qa .forum-filter-tab:hover,
.local-cms-community-qa .forum-filter-tab:focus {
    outline: 2px solid color-mix(in srgb, var(--forum-topic-color, #fb171c) 28%, white);
    outline-offset: 2px;
}

.local-cms-community-qa .forum-filter-tab.active {
    background: var(--forum-topic-color, #fb171c);
    color: #fff;
    border-color: var(--forum-topic-color, #fb171c);
}

.local-cms-community-qa a.forum-filter-tab {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.local-cms-community-qa a.forum-filter-tab:hover,
.local-cms-community-qa a.forum-filter-tab:focus {
    text-decoration: none;
}

.local-cms-community-qa a.forum-filter-tab:not(.active):hover,
.local-cms-community-qa a.forum-filter-tab:not(.active):focus {
    color: var(--forum-topic-color, #111);
}

.local-cms-community-qa .forum-faq-pagination {
    margin: 1.5rem 0 0;
    display: flex;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
}

.local-cms-community-qa .forum-faq-pagination .pagination {
    margin-bottom: 0;
    flex-wrap: wrap;
    justify-content: center;
}

/* List dọc một cột như cũ; chỉ thẻ đang hover / focus (trỏ chuột hoặc Tab) nổi lên */
.local-cms-community-qa .forum-faq-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 100%;
}

.local-cms-community-qa .forum-faq-item {
    position: relative;
    z-index: 0;
    min-width: 0;
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.local-cms-community-qa .forum-faq-item .forum-faq-details {
    border: 1px solid #e2e5ea;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    transition: box-shadow 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.local-cms-community-qa .forum-faq-item:hover,
.local-cms-community-qa .forum-faq-item:focus-within {
    z-index: 2;
    transform: translateY(-8px);
}

.local-cms-community-qa .forum-faq-item:hover .forum-faq-details,
.local-cms-community-qa .forum-faq-item:focus-within .forum-faq-details {
    box-shadow: 0 22px 44px rgba(15, 23, 42, 0.12);
}

.local-cms-community-qa .forum-faq-summary {
    list-style: none;
    padding: 1.25rem 1.5rem;
}

.local-cms-community-qa .forum-faq-summary-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.local-cms-community-qa .forum-faq-topic {
    flex: 1;
    min-width: 0;
}

.local-cms-community-qa .forum-faq-topic-divider {
    margin: 0.65rem 0 0.95rem;
    border: 0;
    border-top: 1px solid #e2e5ea;
}

.local-cms-community-qa .forum-faq-question-section {
    min-width: 0;
}

.local-cms-community-qa .forum-faq-question-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.45rem;
}

.local-cms-community-qa .forum-faq-topic-label {
    font-size: 0.9375rem;
    color: #333;
    line-height: 1.45;
}

.forum-faq-item .forum-faq-topic-label strong {
    color: var(--forum-topic-color, #444);
}

.local-cms-community-qa .forum-faq-q-label {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111;
}

.local-cms-community-qa .forum-faq-q-time {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #6b7280;
}

.local-cms-community-qa .forum-faq-q-text {
    margin: 0;
    font-size: 1.025rem;
    line-height: 1.55;
    color: #1a1a1a;
}

.local-cms-community-qa .forum-faq-caret {
    display: none;
}

.local-cms-community-qa .forum-faq-answer {
    padding: 1.25rem;
    margin: 0 1.5rem 1.5rem 2.5rem;
    border-top: none;
    border-radius: 10px;
    border: 0;
    border-left: 4px solid #0d7a4f;
    background: linear-gradient(135deg, #f0f9f4 0%, #e8f5ee 100%);
    box-sizing: border-box;
}

.local-cms-community-qa .forum-faq-answer::before {
    content: none;
}

@media (max-width: 700px) {
    .local-cms-community-qa .forum-faq-answer {
        margin: 0 1rem 1rem 1.5rem;
        padding: 1rem 1.1rem 1.15rem;
    }
}

.local-cms-community-qa .forum-faq-answer-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
    margin-bottom: 0.75rem;
}

.local-cms-community-qa .forum-faq-a-label {
    display: inline;
    font-size: 1rem;
    font-weight: 600;
    color: #0f4a32;
    line-height: 1.45;
    margin: 0;
}

.local-cms-community-qa .forum-faq-a-time {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #6b7280;
}

.local-cms-community-qa .forum-faq-check {
    display: inline-block;
    width: 0.45rem;
    height: 0.72rem;
    border: solid #0f4a32;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-right: 0.45rem;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.local-cms-community-qa .forum-faq-a-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #333;
    white-space: pre-wrap;
}

.local-cms-community-qa .forum-faq-a-text p:last-child,
.local-cms-community-qa .forum-faq-a-text ul:last-child,
.local-cms-community-qa .forum-faq-a-text ol:last-child {
    margin-bottom: 0;
}

.local-cms-community-qa .forum-faq-a-text ul,
.local-cms-community-qa .forum-faq-a-text ol {
    margin: 0;
    padding-left: 1.25rem;
}

.local-cms-community-qa .forum-faq-a-text li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* EN empty state: prominent CTA when no Q&A rows yet (replaces bottom .forum-cta for that case). */
.local-cms-community-qa .forum-qa-empty-banner {
    margin: 0 0 1.5rem;
    text-align: center;
    padding: 2.5rem 1.5rem;
    background: linear-gradient(135deg, #e10600 0%, #1f1114 100%);
    border: 1px solid #d42b28;
    border-radius: 1.35rem;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
}

.local-cms-community-qa .forum-qa-empty-banner__title {
    margin: 0 0 0.65rem;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
}

.local-cms-community-qa .forum-qa-empty-banner__text {
    margin: 0 0 1.35rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #fff;
    opacity: 0.95;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}

/* Bottom CTA + EN empty-banner: cùng style gọn như bản đầu */
.local-cms-community-qa .forum-qa-empty-banner__btn,
.local-cms-community-qa .forum-cta-btn {
    display: inline-block;
    width: auto;
    padding: 0.55rem 1.35rem;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.25;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: #fb171c;
    cursor: pointer;
    box-sizing: border-box;
    text-decoration: none;
    vertical-align: middle;
}

.local-cms-community-qa .forum-qa-empty-banner__btn:hover,
.local-cms-community-qa .forum-qa-empty-banner__btn:focus {
    opacity: 0.94;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.local-cms-community-qa .forum-cta {
    margin-top: 2rem;
    text-align: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, #e10600 0%, #1f1114 100%);
    border: 1px solid #d42b28;
    border-radius: 1.35rem;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.forum-cta-title {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    color: #fff;
}

.forum-cta-text {
    margin: 0 0 1rem;
    opacity: 0.85;
    color: #fff;

}

.local-cms-community-qa .forum-cta-btn:hover,
.local-cms-community-qa .forum-cta-btn:focus {
    text-decoration: none;
    opacity: 0.92;
}

body.path-local-cms-commqa.theme-dark .local-cms-community-qa a.forum-filter-tab,
body.path-local-cms-commqa.theme-dark .local-cms-community-qa .forum-filter-tab,
body[class*="iomadboost"] .local-cms-community-qa a.forum-filter-tab:not(.active),
body[class*="iomadboost"] .local-cms-community-qa .forum-filter-tab:not(.active) {
    border-color: rgba(0, 0, 0, 0.12);
}

/* --- Public “ask question” modal (guest / logged-in) --- */
.local-cms-qa-req {
    color: #fb171c;
    font-weight: 700;
}

body.local-cms-qa-modal-open {
    overflow: hidden;
}

.local-cms-qa-modal[hidden] {
    display: none !important;
}

.local-cms-qa-modal:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 10550;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    box-sizing: border-box;
}

.local-cms-qa-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.local-cms-qa-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 32rem;
    margin-top: min(8vh, 4rem);
    padding: 1.5rem 1.35rem 1.35rem;
    background: #fff;
    color: #111;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
}

.local-cms-qa-modal__title {
    margin: 0 0 1.1rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #000;
}

.local-cms-qa-modal__form {
    margin: 0;
}

.local-cms-qa-modal__hp {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.local-cms-qa-modal__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 1rem;
}

@media (max-width: 640px) {
    .local-cms-qa-modal__row {
        grid-template-columns: 1fr;
    }
}

.local-cms-qa-modal__field {
    margin-bottom: 0.85rem;
}

.local-cms-qa-modal__field--full {
    grid-column: 1 / -1;
}

.local-cms-qa-modal__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #111;
}

.local-cms-qa-modal__input,
.local-cms-qa-modal__textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.65rem;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: #111;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.local-cms-qa-modal__input::placeholder,
.local-cms-qa-modal__textarea::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.local-cms-qa-modal__input:focus,
.local-cms-qa-modal__textarea:focus {
    outline: 2px solid rgba(251, 23, 28, 0.45);
    outline-offset: 1px;
    border-color: rgba(251, 23, 28, 0.35);
}

.local-cms-qa-modal__textarea {
    min-height: 7rem;
    resize: vertical;
}

.local-cms-qa-modal__msg {
    min-height: 1.25rem;
    margin: 0.35rem 0 0.5rem;
    font-size: 0.875rem;
    color: rgba(0, 0, 0, 0.65);
}

.local-cms-qa-modal__msg--error {
    color: #b00020;
}

.local-cms-qa-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-top: 1rem;
}

.local-cms-qa-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.15rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}

.local-cms-qa-modal__btn--secondary {
    border: 1px solid rgba(0, 0, 0, 0.22);
    background: #fff;
    color: #111;
}

.local-cms-qa-modal__btn--secondary:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.06);
}

.local-cms-qa-modal__btn--primary {
    border: 1px solid #fb171c;
    background: #fb171c;
    color: #fff;
}

.local-cms-qa-modal__btn--primary:hover:not(:disabled) {
    background: #d91418;
    border-color: #d91418;
    color: #fff;
}

.local-cms-qa-modal__btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.local-cms-community-qa .forum-qa-board .local-cms-qa-toast {
    margin: 0 0 1rem;
}

@media (prefers-reduced-motion: reduce) {
    .local-cms-community-qa .forum-faq-item {
        transition: none;
    }

    .local-cms-community-qa .forum-faq-item .forum-faq-details {
        transition: none;
    }

    .local-cms-community-qa .forum-faq-item:hover,
    .local-cms-community-qa .forum-faq-item:focus-within {
        transform: none;
    }
}

