﻿/* faq.css — Mobile-first; matches directory/feedback design system */
/* Compatible with VS validation: no `text-wrap` */

:root {
    /* Brand palette */
    --blue-500: #1a73e8;
    --blue-600: #155cc7;
    --blue-800: #0f3a7a;
    /* Surfaces */
    --bg-900: #0b0d10;
    --bg-800: #101418;
    --bg-700: #141a20;
    /* Text */
    --silver-50: #f3f6fa;
    --silver-100: #e7edf5;
    --silver-300: #c9d3e2;
    --silver-500: #98a6bd;
    /* Misc */
    --border: rgba(255,255,255,0.08);
    --focus: #8ab4ff;
    --radius-8: 8px;
    --radius-12: 12px;
    --radius-16: 16px;
    --tap: 44px;
    /* Components */
    --btn-ghost: rgba(255,255,255,0.08);
    /* Shadows */
    --shadow-1: 0 2px 10px rgba(0,0,0,0.35);
    --shadow-2: 0 8px 22px rgba(0,0,0,0.45);
    /* Shared with “Back” button */
    --color-button-bg: var(--blue-600);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg-900);
    color: var(--silver-100);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Improve wrapping without `text-wrap` */
h1, h2, h3, p, a, button {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* ===== App Bar (consistent) ===== */
.appbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 56px;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    padding: 0 12px;
    background: linear-gradient(180deg, rgba(16,20,24,0.95) 0%, rgba(16,20,24,0.9) 100%);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.brand__logo {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(120% 120% at 30% 30%, var(--blue-500), var(--blue-800));
    color: #fff;
    font-size: 16px;
    box-shadow: var(--shadow-1);
}

.brand__text {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .2px;
}

.brand__beta {
    font-size: 11px;
    color: var(--silver-300);
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-12);
}

/* ===== Layout ===== */
.faq-section {
    max-width: 780px;
    margin: 0 auto;
    padding: clamp(14px, 4vw, 22px);
}

    .faq-section > h2 {
        margin: 4px 2px 12px;
        font-size: clamp(20px, 5vw, 24px);
        font-weight: 800;
        color: var(--silver-50);
    }

/* ===== List ===== */
.faq-list {
    display: grid;
    gap: 10px;
}

/* Each item is a card */
.faq-item {
    background: var(--bg-800);
    border: 1px solid var(--border);
    border-radius: var(--radius-16);
    box-shadow: var(--shadow-2);
    overflow: hidden;
}

/* Question button */
.faq-question {
    width: 100%;
    text-align: left;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    min-height: var(--tap);
    background: linear-gradient(180deg, rgba(26,115,232,0.12) 0%, rgba(26,115,232,0.08) 100%), var(--bg-700);
    color: var(--silver-100);
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px; /* >=16px to avoid iOS zoom */
    letter-spacing: .2px;
}

    .faq-question:focus-visible {
        outline: 2px solid var(--focus);
        outline-offset: 2px;
    }

    /* Arrow flips when open */
    .faq-question .arrow {
        transition: transform 160ms ease;
    }

    .faq-question.open .arrow {
        transform: rotate(45deg);
    }
/* ➕ → ✚ */

.faq-answer {
    padding: 0 14px;
    color: var(--silver-300);
    font-size: 0.98rem;
    line-height: 1.55;
    border-top: 1px solid var(--border);
    /* Smooth open/close */
    max-height: 0;
    overflow: hidden;
    transition: max-height 220ms ease, padding 220ms ease;
}

    /* When shown (JS adds .show and removes [hidden]) */
    .faq-answer.show {
        padding: 12px 14px 14px;
        max-height: 600px; /* large enough for most answers */
    }

/* Back to directory */
#back-to-directory-container {
    text-align: center;
    margin-top: 1.5rem;
}

#back-to-directory-button {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    background-color: var(--color-button-bg);
    border: 1px solid rgba(138,180,255,0.30);
    box-shadow: var(--shadow-1);
    font-weight: 700;
}

    #back-to-directory-button:hover {
        filter: brightness(1.05);
        transform: translateY(-1px);
    }

    #back-to-directory-button:active {
        transform: translateY(0);
    }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .faq-question .arrow,
    .faq-answer {
        transition: none !important;
    }

    #back-to-directory-button {
        transition: none !important;
    }
}

/* Optional Light Mode */
@media (prefers-color-scheme: light) {
    :root {
        --bg-900: #ffffff;
        --bg-800: #f7f9fc;
        --bg-700: #ffffff;
        --border: rgba(0,0,0,0.08);
        --silver-50: #0b1220;
        --silver-100: #1b2436;
        --silver-300: #3b4b69;
        --silver-500: #6b7a96;
    }
}
