/**
 * JSC FAQ - Default Styles
 * Framework-agnostic base styles. Themes override via their own CSS.
 *
 * @package JaysSeoChecklist
 * @since 1.4.0
 */

/* ============================================================
   Layout
   ============================================================ */

.jsc-faq-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.jsc-faq-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.jsc-faq-sidebar {
    flex: 0 0 220px;
    min-width: 0;
}

.jsc-faq-content {
    flex: 1;
    min-width: 0;
}

/* ============================================================
   Archive Header
   ============================================================ */

.jsc-faq-archive-header {
    margin-bottom: 2rem;
}

.jsc-faq-archive-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.jsc-faq-archive-description {
    color: #555;
}

/* ============================================================
   Sidebar / Category List
   ============================================================ */

.jsc-faq-sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    color: #333;
}

.jsc-faq-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jsc-faq-category-item {
    border-bottom: 1px solid #eee;
}

.jsc-faq-category-item a {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.25rem;
    color: #444;
    text-decoration: none;
}

.jsc-faq-category-item a:hover,
.jsc-faq-category-item.jsc-active a {
    color: #0073aa;
    font-weight: 600;
}

.jsc-faq-cat-count {
    color: #888;
    font-size: 0.85em;
}

/* ============================================================
   Search
   ============================================================ */

.jsc-faq-search-bar,
.jsc-faq-search {
    margin-bottom: 1.5rem;
}

.jsc-faq-search-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.jsc-faq-search-input:focus {
    outline: 2px solid #0073aa;
    outline-offset: 1px;
    border-color: #0073aa;
}

/* ============================================================
   Accordion
   ============================================================ */

.jsc-faq-accordion,
.jsc-faq-widget-accordion {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid #ddd;
}

.jsc-faq-item {
    border-bottom: 1px solid #ddd;
}

.jsc-faq-item.jsc-faq-featured {
    background: #fffbf0;
}

.jsc-faq-question {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    color: #222;
    gap: 0.5rem;
}

.jsc-faq-question:hover {
    color: #0073aa;
}

.jsc-faq-question:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.jsc-faq-question[aria-expanded="true"] {
    color: #0073aa;
}

/* Chevron indicator */
.jsc-faq-chevron {
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    display: inline-block;
    transition: transform 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23444'%3E%3Cpath d='M5 7l5 5 5-5'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.jsc-faq-question[aria-expanded="true"] .jsc-faq-chevron {
    transform: rotate(180deg);
}

.jsc-faq-answer {
    padding: 0 0.5rem 1.25rem;
    color: #444;
    line-height: 1.7;
}

.jsc-faq-answer[hidden] {
    display: none;
}

.jsc-faq-permalink {
    margin-top: 1rem;
    font-size: 0.85em;
}

/* ============================================================
   Category Badge
   ============================================================ */

.jsc-faq-category-badge {
    font-size: 0.75em;
    font-weight: 400;
    padding: 0.2em 0.5em;
    background: #e8f4f8;
    color: #0073aa;
    border-radius: 3px;
    white-space: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

/* ============================================================
   List Style
   ============================================================ */

.jsc-faq-list,
.jsc-faq-shortcode-list,
.jsc-faq-widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jsc-faq-list-item,
.jsc-faq-widget-list-item {
    border-bottom: 1px solid #eee;
}

.jsc-faq-list-link,
.jsc-faq-widget-link {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 0.25rem;
    color: #0073aa;
    text-decoration: none;
}

.jsc-faq-list-link:hover,
.jsc-faq-widget-link:hover {
    text-decoration: underline;
}

.jsc-faq-list-icon {
    flex-shrink: 0;
    font-weight: 700;
    color: #0073aa;
    font-size: 0.85em;
    line-height: 1.5;
}

.jsc-faq-list-text {
    display: flex;
    flex-direction: column;
}

.jsc-faq-list-category,
.jsc-faq-cat-label {
    color: #888;
    font-size: 0.8em;
    margin-top: 0.15em;
}

/* ============================================================
   Grid Style
   ============================================================ */

.jsc-faq-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.jsc-faq-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 1.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.jsc-faq-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.jsc-faq-card-excerpt {
    flex: 1;
    color: #555;
    font-size: 0.9em;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.jsc-faq-read-more,
.jsc-faq-read-more-link {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    background: #0073aa;
    color: #fff;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
}

.jsc-faq-read-more:hover,
.jsc-faq-read-more-link:hover {
    background: #005177;
    color: #fff;
}

/* ============================================================
   View All Link
   ============================================================ */

.jsc-faq-view-all,
.jsc-faq-widget-footer {
    margin-top: 1.25rem;
    text-align: center;
}

.jsc-faq-view-all-link {
    display: inline-block;
    padding: 0.4rem 1rem;
    border: 2px solid #0073aa;
    color: #0073aa;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
}

.jsc-faq-view-all-link:hover {
    background: #0073aa;
    color: #fff;
}

/* ============================================================
   Single FAQ
   ============================================================ */

.jsc-faq-single {
    max-width: 820px;
}

.jsc-faq-single-header {
    margin-bottom: 1.5rem;
}

.jsc-faq-single-title {
    font-size: 1.75rem;
    margin: 0.5rem 0 0;
}

.jsc-faq-single-answer {
    line-height: 1.8;
    color: #333;
}

.jsc-faq-single-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.jsc-faq-back {
    margin: 0;
}

.jsc-faq-back a {
    color: #0073aa;
    text-decoration: none;
}

.jsc-faq-back a:hover {
    text-decoration: underline;
}

/* ============================================================
   Breadcrumb
   ============================================================ */

.jsc-faq-breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.85em;
    color: #888;
}

.jsc-faq-breadcrumb ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.jsc-faq-breadcrumb li + li::before {
    content: '›';
    margin-right: 0.25rem;
    color: #aaa;
}

.jsc-faq-breadcrumb a {
    color: #0073aa;
    text-decoration: none;
}

.jsc-faq-breadcrumb a:hover {
    text-decoration: underline;
}

/* ============================================================
   Related FAQs
   ============================================================ */

.jsc-faq-related {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid #eee;
}

.jsc-faq-related-title {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
}

.jsc-faq-related-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.jsc-faq-related-item {
    border-bottom: 1px solid #eee;
}

.jsc-faq-related-item a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.25rem;
    color: #0073aa;
    text-decoration: none;
}

.jsc-faq-related-item a:hover {
    text-decoration: underline;
}

/* ============================================================
   Shortcode Wrapper
   ============================================================ */

.jsc-faq-shortcode-wrapper {
    margin: 1.5rem 0;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 767px) {
    .jsc-faq-layout {
        flex-direction: column;
    }

    .jsc-faq-sidebar {
        flex: none;
        width: 100%;
        order: 2;
        margin-top: 2rem;
    }

    .jsc-faq-content {
        order: 1;
    }

    .jsc-faq-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Accessibility
   ============================================================ */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .jsc-faq-chevron {
        transition: none;
    }
}

/* ============================================================
   Print
   ============================================================ */

@media print {
    .jsc-faq-sidebar,
    .jsc-faq-search-bar,
    .jsc-faq-search,
    .jsc-faq-view-all,
    .jsc-faq-widget-footer {
        display: none;
    }

    .jsc-faq-answer[hidden] {
        display: block !important;
    }
}
