/**
 * FAQ Sidebar Template Styles
 *
 * File: faq-sidebar.css
 * Location: wp-content/themes/seccommerce/assets/css/faq-sidebar.css
 *
 * Uses existing theme CSS variables from :root.
 * Designed for block themes (TwentyTwentyFour child).
 */

/* ─── LAYOUT ─── */
.faq-page-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    /* Break out of the block theme's content-width constraint */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    justify-content: center;
}

/* ─── SIDEBAR ─── */
.faq-sidebar {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    background: var(--white);
    position: sticky;
    top: 65px; /* adjust to match your fixed header height */
    height: calc(100vh - 65px);
    overflow-y: auto;
    z-index: 50;
}

.faq-sidebar-header {
    padding: 24px 20px 12px;
    border-bottom: 1px solid var(--border);
}

.faq-sidebar-header .sub-headline {
    font-size: 11px;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
}

.faq-sidebar-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 135%;
}

/* Search */
.faq-sidebar-search {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.faq-sidebar-search input {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 0 12px 0 36px;
    font-family: inherit;
    font-size: 12px;
    color: var(--secondary);
    outline: none;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24' stroke='%234f607a' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 10px center no-repeat;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.faq-sidebar-search input:focus {
    border-color: var(--primary);
}

.faq-sidebar-search input::placeholder {
    color: var(--grey);
}

/* Post list */
.faq-sidebar-posts {
    padding: 12px;
}

.faq-sidebar-post {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 10px !important;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
    text-decoration: none;
    color: inherit;
    width: 100%;
  box-sizing: border-box;
}

.faq-sidebar-post:hover {
    background: var(--primary-50);
}

.faq-sidebar-post.active {
    background: var(--primary-50);
    border-left-color: var(--primary);
}

.faq-post-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 6px;
    background: var(--primary-50);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.faq-post-icon svg {
    width: 16px;
    height: 16px;
    stroke: var(--primary);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.faq-sidebar-post.active .faq-post-icon {
    background: var(--primary);
}

.faq-sidebar-post.active .faq-post-icon svg {
    stroke: var(--white);
}

.faq-post-info {
    flex: 1;
    min-width: 0;
}

.faq-post-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.faq-sidebar-post.active .faq-post-title {
    color: var(--primary);
}

.faq-post-meta {
    font-size: 11px;
    color: var(--grey);
    margin-top: 2px;
}

.faq-post-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--primary-75);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    display: none;
}

.faq-no-posts {
    padding: 20px;
    color: var(--grey);
    font-size: 13px;
}

/* ─── MOBILE TOGGLE ─── */
.faq-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 24px;
    padding: 10px 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(42, 112, 233, 0.35);
    transition: background 0.2s;
}

.faq-sidebar-toggle:hover {
    background: #1F59D6;
}

.faq-sidebar-toggle svg {
    stroke: currentColor;
    fill: none;
      width: 20px;
}


/* ─── MAIN CONTENT ─── */
.faq-main-content {
    flex: 1;
  min-width: 0;
  padding: 100px 40px 100px 40px;
  max-width: 1000px;
  box-sizing: border-box;
}

/* Breadcrumb */
.faq-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--grey);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.faq-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

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

.faq-breadcrumb .separator {
    color: var(--border);
}

/* Article header */
.faq-article-header {
    margin-bottom: 32px;
}

.faq-article-header .sub-headline {
    font-size: 12px;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
}

.faq-article-header h1 {
    font-size: 34px;
    font-weight: 700;
    line-height: 135%;
    color: var(--text);
    margin-bottom: 12px;
    max-width: 800px;
}

.faq-article-header h1 strong {
    color: var(--primary);
}

.faq-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--grey);
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.faq-meta-tag {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 4px;
}

/* Article body */
.faq-article-body {
    margin-top: 24px;
}

.faq-article-body h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin: 32px 0 12px;
    line-height: 135%;
}

.faq-article-body h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 8px;
}

.faq-article-body p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--secondary);
    margin-bottom: 16px;
}

.faq-article-body ul,
.faq-article-body ol {
    font-size: 14px;
    line-height: 1.7;
    padding-left: 20px;
    margin-bottom: 16px;
}

.faq-article-body li {
    margin-bottom: 6px;
}

.faq-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 16px 0;
}

.faq-article-body blockquote {
    background: var(--primary-50);
    border-left: 4px solid var(--primary);
    border-radius: var(--border-radius);
    padding: 20px 24px;
    margin: 24px 0;
}

.faq-article-body blockquote p {
    font-size: 13px;
    margin-bottom: 0;
}

/* Post navigation */
.faq-post-navigation {
    display: flex;
    gap: 20px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.faq-nav-prev,
.faq-nav-next {
    flex: 1;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.faq-nav-prev:hover,
.faq-nav-next:hover {
    border-color: var(--primary);
    background: var(--primary-50);
}

.faq-nav-next {
    text-align: right;
}

.faq-nav-label {
    display: block;
    font-size: 11px;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}

.faq-nav-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary);
    line-height: 1.4;
}

/* ─── GO TO TOP ─── */
.faq-go-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 60;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.15s, border-color 0.15s;
}

.faq-go-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.faq-go-top:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.faq-go-top svg {
    stroke: currentColor;
}

/* ─── SCROLLBAR ─── */
.faq-sidebar::-webkit-scrollbar { width: 4px; }
.faq-sidebar::-webkit-scrollbar-track { background: transparent; }
.faq-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.faq-sidebar::-webkit-scrollbar-thumb:hover { background: var(--grey); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1280px) {
    .faq-sidebar { width: 280px; min-width: 280px; }
    .faq-main-content { padding: 32px 40px 60px; }
}

@media (max-width: 1024px) {
    .faq-sidebar { width: 260px; min-width: 260px; }
    .faq-main-content { padding: 32px 32px 60px; }
}

@media (max-width: 768px) {
    .faq-page-wrapper {
        flex-direction: column;
        width: 100%;
        margin-left: 0;
    }

    .faq-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        min-width: unset;
        max-width: 320px;
        height: 100vh;
        border-right: 1px solid var(--border);
        transition: left 0.3s ease;
        z-index: 200;
    }

    .faq-sidebar.open {
        left: 0;
    }

    .faq-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 199;
    }

    .faq-sidebar-overlay.visible {
        display: block;
    }

    .faq-sidebar-toggle {
        display: flex;
    }

    .faq-main-content {
        padding: 24px 20px 80px;
    }

    .faq-article-header h1 {
        font-size: 26px;
    }

    .faq-post-navigation {
        flex-direction: column;
    }

    .faq-nav-next {
        text-align: left;
    }
}

@media (max-width: 450px) {
    .faq-article-header h1 {
        font-size: 22px;
    }

    .faq-article-meta {
        gap: 8px;
    }
}
