/* =============================================================
   Community Q&A – community-qa.css
   Sidebar font: Inter  |  Feed font: Roboto
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto:wght@400;500;700&display=swap');

/* ── CSS Variables ── */
:root {
    --cqa-teal:        #008080;
    --cqa-teal-light:  #e8f5f2;
    --cqa-teal-bg:     #2a9d8a;
    --cqa-white:       #ffffff;
    --cqa-off-white:   #f9fafb;
    --cqa-border:      #e5e7eb;
    --cqa-text:        #1D293D;
    --cqa-text-muted:  #484A54;
    --cqa-text-light:  #9ca3af;

    --badge-wins-bg:   #fef3c7;
    --badge-wins-fg:   #92400e;
    --badge-expert-bg: #dbeafe;
    --badge-expert-fg: #1e40af;
    --badge-infant-bg: #fce7f3;
    --badge-infant-fg: #9d174d;
    --badge-motor-bg:  #ede9fe;
    --badge-motor-fg:  #5b21b6;
    --badge-comm-bg:   #d1fae5;
    --badge-comm-fg:   #065f46;
    --badge-feeding-bg:#fff7ed;
    --badge-feeding-fg:#9a3412;
    --badge-behavior-bg:#f0fdf4;
    --badge-behavior-fg:#166534;

    --cqa-radius:      12px;
    --cqa-shadow:      0 1px 4px rgba(0,0,0,.07);
    --cqa-shadow-card: 0 2px 12px rgba(0,0,0,.08);
}

/* ── Wrapper layout ── */
.cqa-wrapper {
    display: flex;
    gap: 0;
    margin: 0 auto;
    min-height: 80vh;
    gap: 24px;
}

/* ════════════════════════════════════════════
   SIDEBAR
   Font: Inter
════════════════════════════════════════════ */
.cqa-sidebar {
    font-family: 'Inter', sans-serif;
    width: 275px;
    min-width: 180px;
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    flex-shrink: 0;
    max-height: fit-content;
}

.cqa-sidebar__heading {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--cqa-text-light);
    text-transform: uppercase;
    padding: 0 20px 12px;
    margin: 0;
}

.cqa-sidebar__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cqa-sidebar__list li {
    margin: 0;
    margin-bottom: 12px;
}

.cqa-sidebar__link {
    font-family: 'Inter', sans-serif;
    display: block;
    background-color: #F9F9F9;
    border: 1px solid #00000014;
    border-radius: 16px !important;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--cqa-text-muted);
    text-decoration: none;
    border-radius: 0;
    transition: background .15s, color .15s;
}

.cqa-sidebar__link:hover {
    background: var(--cqa-teal-light);
    color: var(--cqa-teal) !important;
    border-radius: 16px;
}

.cqa-sidebar__link--active {
    background: var(--cqa-teal);
    color: var(--cqa-white) !important;
    font-weight: 500;
    border-radius: 16px;
}

/* ════════════════════════════════════════════
   FEED
   Font: Roboto
════════════════════════════════════════════ */
.cqa-feed {
    font-family: 'Roboto', sans-serif;
    flex: 1;
    padding: 20px;
    min-width: 0;
    background-color: white;
    border-radius: 12px;
}

.cqa-feed__title {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--cqa-text);
    margin: 0 0 4px;
}

.cqa-feed__subtitle {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    color: #62748E;
    margin: 0 0 20px;
}

/* ── Card ── */
.cqa-card {
    font-family: 'Roboto', sans-serif;
    background: var(--cqa-white);
    border: 1px solid var(--cqa-border);
    border-radius: var(--cqa-radius);
    padding: 18px 20px 14px;
    margin-bottom: 16px;
    box-shadow: var(--cqa-shadow-card);
    transition: box-shadow .2s;
}

.cqa-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.11);
}

/* Card header */
.cqa-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.cqa-card__author {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Avatar */
.cqa-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.cqa-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cqa-avatar span {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Roboto', sans-serif;
}

.cqa-avatar--sm {
    width: 32px;
    height: 32px;
}

.cqa-avatar--sm span {
    font-size: 11px;
}
.cqa-replies-toggle:hover, .cqa-action:hover, .cqa-icon-btn:hover {
  background-color: unset !important;
}
.cqa-replies-toggle:focus, .cqa-action:focus, .cqa-icon-btn:focus {
  background-color: unset !important;
  color: var(--cqa-teal);
}

.cqa-card__name {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #1D293D;
    display: block;
}

.cqa-card__sub {
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    color: #90A1B9;
    display: block;
}

.cqa-card__meta-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.cqa-card__time {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #838799;
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Card title */
.cqa-card__title {
    font-family: 'Roboto', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #262D39;
    margin: 0 0 8px;
    line-height: 1.4;
}

.cqa-card__title a {
    color: inherit;
    text-decoration: none;
}

.cqa-card__title a:hover {
    color: var(--cqa-teal);
}

/* Card excerpt */
.cqa-card__excerpt {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: var(--cqa-text-muted);
    line-height: 1.6;
    margin-bottom: 10px;
}

/* Tags */
.cqa-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.cqa-tag {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    background: var(--cqa-off-white);
    border: 1px solid var(--cqa-border);
    color: var(--cqa-text-muted);
    border-radius: 20px;
    padding: 3px 10px;
}

/* Card actions */
.cqa-card__actions {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--cqa-border);
}

.cqa-action {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: var(--cqa-text-muted);
    padding: 0;
    transition: color .15s;
}

.cqa-action:hover {
    color: var(--cqa-teal);
}

.cqa-card__icons {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.cqa-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--cqa-text-light);
    padding: 2px;
    display: flex;
    align-items: center;
    transition: color .15s;
}

.cqa-icon-btn:hover {
    color: var(--cqa-teal) !important;
}

/* ── Badges ── */
.cqa-badge {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    padding: 3px 10px;
    white-space: nowrap;
}

.badge--wins     { background: var(--badge-wins-bg);     color: var(--badge-wins-fg); }
.badge--suggestion { background: #F0F9FF; color: #0084D1; }
.badge--expert   { background: var(--badge-expert-bg);   color: var(--badge-expert-fg); }
.badge--infant   { background: var(--badge-infant-bg);   color: var(--badge-infant-fg); }
.badge--motor    { background: var(--badge-motor-bg);    color: var(--badge-motor-fg); }
.badge--comm     { background: var(--badge-comm-bg);     color: var(--badge-comm-fg); }
.badge--feeding  { background: var(--badge-feeding-bg);  color: var(--badge-feeding-fg); }
.badge--behavior { background: var(--badge-behavior-bg); color: var(--badge-behavior-fg); }

/* ── Replies Toggle ── */
.cqa-replies-toggle-wrap {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--cqa-border);
}

.cqa-reply-card__title {
    font-family: 'Roboto', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--cqa-text);
    margin: 8px 0 4px;
}

.cqa-replies-toggle {
    font-family: 'Roboto', sans-serif;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--cqa-teal);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    width: 100%;
    text-align: left;
    transition: color .15s;
}

.cqa-replies-toggle:hover {
    color: var(--cqa-teal-bg);
}

.cqa-chevron {
    transition: transform .25s;
    flex-shrink: 0;
    margin-left: auto;
}

.cqa-replies-toggle[aria-expanded="true"] .cqa-chevron {
    transform: rotate(180deg);
}

/* ── Replies container ── */
.cqa-replies {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: cqa-fade-in .2s ease;
}

.cqa-replies[hidden] {
    display: none !important;
}

@keyframes cqa-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Reply card ── */
.cqa-reply-card {
    font-family: 'Roboto', sans-serif;
    background: #f3fbf9;
    border: 1px solid #c7e8e0;
    border-radius: 10px;
    padding: 14px 16px 10px;
}

.cqa-reply-card__content {
    font-size: 14px;
    color: var(--cqa-text-muted);
    line-height: 1.6;
    margin: 8px 0 10px;
}

/* No posts */
.cqa-no-posts {
    font-family: 'Roboto', sans-serif;
    color: var(--cqa-text-muted);
    font-size: 15px;
    padding: 24px 0;
}

/* ════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════ */

/* Tablet: sidebar becomes top horizontal strip */
@media (max-width: 768px) {
    .cqa-wrapper {
        flex-direction: column;
    }

    .cqa-sidebar {
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid var(--cqa-border);
        padding: 14px 0 0;
        overflow-x: auto;
    }

    .cqa-sidebar__heading {
        padding: 0 10px 8px;
    }

    .cqa-sidebar__list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        padding: 0 12px 10px;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .cqa-sidebar__list::-webkit-scrollbar { display: none; }

    .cqa-sidebar__list li { flex-shrink: 0; }

    .cqa-sidebar__link {
        padding: 7px 14px;
        border-radius: 20px;
        white-space: nowrap;
        border: 1px solid var(--cqa-border);
    }

    .cqa-sidebar__link--active {
        border-color: var(--cqa-teal);
    }

    .cqa-feed {
        padding: 20px 16px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .cqa-feed__title  { font-size: 18px; }
    .cqa-card         { padding: 14px 14px 10px; }
    .cqa-card__title  { font-size: 14px; }
    .cqa-card__header { flex-wrap: wrap; }
    .cqa-card__meta-right { flex-direction: row; }
    .cqa-avatar       { width: 32px; height: 32px; }
    .cqa-avatar span  { font-size: 11px; }
}
