/* ==========================================================================
   NUV FAQ — Frontend + Admin Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Accordion — container
   -------------------------------------------------------------------------- */
.nuv-faq-accordion {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin: 1.5em 0;
}

/* --------------------------------------------------------------------------
   Accordion — item
   -------------------------------------------------------------------------- */
.nuv-faq-item {
    border: none;
}

/* --------------------------------------------------------------------------
   Accordion — question button
   -------------------------------------------------------------------------- */
.nuv-faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 1em 1.25em;
    background: #f9f9f9;
    border: none;
    border-top: 1px solid #e0e0e0;
    cursor: pointer;
    text-align: left;
    font-size: 1em;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    transition: background 0.2s ease;
}

.nuv-faq-item:first-child > .nuv-faq-question {
    border-top: none;
}

.nuv-faq-question:hover {
    background: #f0f0f0;
}

.nuv-faq-item--open > .nuv-faq-question {
    background: #efefef;
}

.nuv-faq-question-text {
    flex: 1;
    padding-right: 1em;
}

/* --------------------------------------------------------------------------
   Accordion — chevron icon
   -------------------------------------------------------------------------- */
.nuv-faq-icon {
    display: inline-block;
    flex-shrink: 0;
    width:  9px;
    height: 9px;
    border-right:  2px solid #666;
    border-bottom: 2px solid #666;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.25s ease;
}

.nuv-faq-item--open .nuv-faq-icon {
    transform: rotate(-135deg) translateY(-2px);
}

/* --------------------------------------------------------------------------
   Accordion — answer panel
   -------------------------------------------------------------------------- */
.nuv-faq-answer {
    overflow: hidden;
}

.nuv-faq-answer-inner {
    padding: 1em 1.25em 1.25em;
    color: #555;
    line-height: 1.7;
}

.nuv-faq-answer-inner > *:first-child { margin-top: 0; }
.nuv-faq-answer-inner > *:last-child  { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   All-FAQs layout
   -------------------------------------------------------------------------- */
.nuv-faq-all {
    margin: 1.5em 0;
}

.nuv-faq-category-section {
    margin-bottom: 2.5em;
}

.nuv-faq-category-title {
    font-size: 1.15em;
    font-weight: 700;
    margin: 0 0 0.5em;
    padding-bottom: 0.35em;
    border-bottom: 2px solid #ddd;
    color: #222;
}

/* --------------------------------------------------------------------------
   View FAQ link (shown at the bottom of each accordion answer)
   -------------------------------------------------------------------------- */
.nuv-faq-view-link {
    display: inline-block;
    margin-top: 0.85em;
    font-size: 0.875em;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.nuv-faq-view-link:hover {
    color: #005177;
    border-bottom-color: currentColor;
}

/* --------------------------------------------------------------------------
   Single FAQ page
   -------------------------------------------------------------------------- */
/* ── Detail page nav bar (← Back | FAQ All) above the title ── */
.nuv-faq-detail-nav {
    display: flex;
    align-items: center;
    gap: 0.6em;
    margin-bottom: 1em;
    font-size: 0.875em;
    font-weight: 600;
}

.nuv-faq-nav-link {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.15s ease;
}

.nuv-faq-nav-link:hover {
    color: #005177;
    text-decoration: underline;
}

.nuv-faq-nav-sep {
    color: #bbb;
    font-weight: 400;
    user-select: none;
}

.nuv-faq-single-answer {
    line-height: 1.75;
    color: #333;
    margin-bottom: 2.5em;
}

.nuv-faq-single-answer > *:first-child { margin-top: 0; }
.nuv-faq-single-answer > *:last-child  { margin-bottom: 0; }

.nuv-faq-single-related {
    margin-top: 2.5em;
    padding-top: 1.5em;
    border-top: 2px solid #e8e8e8;
}

.nuv-faq-related-title {
    font-size: 1.05em;
    font-weight: 700;
    margin: 0 0 0.5em;
    color: #222;
}

.nuv-faq-related-list {
    list-style: disc;
    margin: 0;
    padding-left: 1.25em;
}

.nuv-faq-related-list li {
    margin: 0.2em 0;
    padding: 0;
}

.nuv-faq-related-list a {
    color: #0073aa;
    text-decoration: none;
    font-size: 0.95em;
    line-height: 1.4;
}

.nuv-faq-related-list a:hover {
    color: #005177;
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Single FAQ — always hidden: entry footer & post meta (author, date, cats)
   These make no sense on FAQ detail pages regardless of nav settings.
   PHP filters suppress the text values; CSS is the belt-and-braces fallback.
   -------------------------------------------------------------------------- */

/* Entry footer: "This entry was posted in … Bookmark the permalink."
   Covers both the standard WordPress class and the older .entry-meta
   variant used by Twenty Eleven / Twelve era themes. */
.single-nuv_faq .entry-footer,
.single-nuv_faq .entry-meta,
.single-nuv_faq .post-footer,
.single-nuv_faq .post-edit-link {
    display: none !important;
}

/* Author — generic WordPress patterns */
.single-nuv_faq .byline,
.single-nuv_faq .author.vcard,
.single-nuv_faq .entry-author,
.single-nuv_faq .post-author,
.single-nuv_faq span.author {
    display: none !important;
}

/* Divi: hide the entire meta bar ("by | Apr 21, 2026").
   et_divi_post_meta() outputs <p class="post-meta"> — that is the correct
   selector. Divi hard-codes "by" and "|" as literal text so suppressing
   just the author name via PHP leaves the label orphaned. */
.single-nuv_faq .post-meta,
.single-nuv_faq .et_pb_post_meta,
.single-nuv_faq .et-pb-meta-info {
    display: none !important;
}

/* Flatsome: "page-title" is a separate hero section above the content loop
   that also renders the post title, causing it to appear twice.
   Flatsome adds .flatsome to <body> so this selector is theme-scoped. */
.flatsome.single-nuv_faq .page-title {
    display: none !important;
}

/* Avada */
.single-nuv_faq .fusion-post-meta .fusion-author,
.single-nuv_faq .fusion-post-meta .fusion-date {
    display: none !important;
}

/* Astra */
.single-nuv_faq .ast-author-meta,
.single-nuv_faq .ast-posted-on {
    display: none !important;
}

/* GeneratePress */
.single-nuv_faq .entry-meta .byline,
.single-nuv_faq .entry-meta .posted-on {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Single FAQ — suppress post navigation (next / prev links)
   Applied when "Hide post navigation" is enabled in the plugin settings.
   WordPress adds .nuv-faq-hide-nav to <body> when the option is on.
   PHP filters handle previous_post_link / next_post_link; CSS covers
   themes that build navigation without those functions.
   -------------------------------------------------------------------------- */

/* Attribute selector catches any nav whose class contains "navigation" —
   covers .post-navigation, .posts-navigation, .navigation.post-navigation
   and theme variants regardless of class order. Also hides the surrounding
   divider borders by hiding the wrapper itself. */
.single-nuv_faq.nuv-faq-hide-nav nav[class*="navigation"],
.single-nuv_faq.nuv-faq-hide-nav .post-navigation,
.single-nuv_faq.nuv-faq-hide-nav .posts-navigation,
.single-nuv_faq.nuv-faq-hide-nav .nav-links,
/* Flatsome */
.single-nuv_faq.nuv-faq-hide-nav .post-share-buttons,
/* Divi */
.single-nuv_faq.nuv-faq-hide-nav .et-post-navigation,
.single-nuv_faq.nuv-faq-hide-nav .et_pb_post_nav,
/* Avada */
.single-nuv_faq.nuv-faq-hide-nav .fusion-post-nav,
/* Astra */
.single-nuv_faq.nuv-faq-hide-nav .ast-single-post-navigation {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Error / empty states
   -------------------------------------------------------------------------- */
.nuv-faq-error,
.nuv-faq-empty {
    color: #888;
    font-style: italic;
}

/* ==========================================================================
   Admin — Shortcodes page
   ========================================================================== */
.nuv-faq-admin .nuv-faq-admin-card {
    background: #fff;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 1.5em 2em;
    margin-top: 1.5em;
    max-width: 1100px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.nuv-faq-admin .nuv-faq-admin-card h2 {
    margin-top: 0;
    padding-bottom: 0.6em;
    border-bottom: 1px solid #eee;
    font-size: 1.1em;
}

/* All-FAQs shortcode row */
.nuv-faq-shortcode-row {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-top: 0.75em;
}

/* Per-category shortcode cell inside the table */
.nuv-faq-sc-cell {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.nuv-faq-shortcode-input {
    font-family: Consolas, Monaco, monospace;
    font-size: 0.85em;
    padding: 5px 8px;
    background: #f6f7f7;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #333;
    flex: 1;
    min-width: 180px;
}

.nuv-faq-table td {
    vertical-align: middle;
}

.nuv-faq-copy-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.nuv-faq-no-categories {
    font-style: italic;
    color: #666;
}

.nuv-faq-usage-card code {
    background: #f0f0f1;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.9em;
}
