/**
 * Joruva FAQ Accordion Styles
 * For pages using .jrv-faq-* classes (Air Compressor FAQ, etc.)
 * 
 * @since 2026-01-17
 * @updated 2026-01-18 - Fixed selector for WordPress wpautop compatibility
 * @updated 2026-01-18 - Added hub page card styles
 */

/* Container */
.jrv-faq-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 28px 18px 64px;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.55;
}

.jrv-faq-wrap * {
    box-sizing: border-box;
}

/* Hide empty p tags WordPress injects */
.jrv-faq-item > p:empty {
    display: none;
}

/* Header */
.jrv-faq-header {
    margin: 8px 0 24px;
}

.jrv-faq-header h1 {
    margin: 0 0 10px;
    font-size: clamp(28px, 3.2vw, 42px);
    letter-spacing: -0.02em;
    color: #0033A0;
}

.jrv-faq-header .meta {
    color: #5a6472;
    font-size: 13px;
    margin: 0 0 8px;
}

/* CTA Buttons */
.jrv-faq-cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 10px 0 20px;
}

.jrv-faq-cta a {
    text-decoration: none;
    background: #014EFC;
    color: #fff !important;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 6px 18px rgba(1, 78, 252, 0.16);
}

.jrv-faq-cta a.secondary {
    background: #fff;
    color: #0033A0 !important;
    border: 1px solid #e4e7ee;
    box-shadow: none;
}

/* Jump Link Pills */
.jrv-faq-pillbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 14px 0 22px;
}

.jrv-faq-pillbar a {
    text-decoration: none;
    padding: 10px 14px;
    border: 1px solid #e4e7ee;
    border-radius: 999px;
    background: #fff !important;
    color: #0a0a0a !important;
    font-size: 14px;
}

.jrv-faq-pillbar a:hover {
    border-color: #014EFC;
    color: #014EFC !important;
}

/* Expand/Collapse Tools */
.jrv-faq-tools {
    display: flex;
    gap: 12px;
    margin: 8px 0 16px;
}

.jrv-faq-tools a {
    text-decoration: underline;
    color: #014EFC;
    font-size: 14px;
}

/* Section Groups */
.jrv-faq-group {
    margin: 28px 0 18px;
    padding: 8px 2px;
    border-left: 5px solid #014EFC;
}

.jrv-faq-group h2 {
    margin: 0 0 6px 10px;
    color: #0033A0;
    letter-spacing: -0.02em;
    font-size: clamp(20px, 2.4vw, 26px);
}

/* Accordion Container */
.jrv-faq-accordion {
    display: grid;
    gap: 12px;
}

/* Individual FAQ Item */
.jrv-faq-item {
    background: #fff !important;
    border: 1px solid #e4e7ee;
    border-radius: 14px;
    overflow: hidden;
}

/* Question Button */
.jrv-faq-q {
    width: 100%;
    appearance: none;
    border: 0 !important;
    background: #fff !important;
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 16px 18px !important;
    text-align: left;
    margin: 0 !important;
}

.jrv-faq-q:hover {
    background: linear-gradient(0deg, rgba(1, 78, 252, 0.03), rgba(1, 78, 252, 0.03)), #fff !important;
}

/* Green Badge */
.jrv-faq-q .badge {
    flex: 0 0 auto;
    margin-top: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #7EC55F;
    box-shadow: 0 0 0 3px rgba(126, 197, 95, 0.18);
}

/* Question Text */
.jrv-faq-q .qtxt {
    display: block;
    font-weight: 700;
    color: #0a0a0a !important;
    letter-spacing: -0.01em;
    flex: 1;
}

/* Chevron */
.jrv-faq-q .chev {
    margin-left: auto;
    transition: transform 0.18s ease;
    width: 12px;
    height: 12px;
    border: 2px solid #0033A0;
    border-left: 0;
    border-top: 0;
    transform: rotate(45deg);
}

.jrv-faq-q[aria-expanded="true"] .chev {
    transform: rotate(-135deg);
}

/* Answer Panel - Collapsed (default) */
.jrv-faq-a {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.22s ease;
    padding: 0 18px;
}

.jrv-faq-a > div {
    overflow: hidden;
}

/* Answer Panel - Expanded 
   Uses :has() on parent to handle WordPress wpautop inserting <p></p> tags */
.jrv-faq-item:has(.jrv-faq-q[aria-expanded="true"]) .jrv-faq-a {
    grid-template-rows: 1fr;
    padding-bottom: 16px;
}

/* Answer Content */
.jrv-faq-a p {
    margin: 10px 0 8px;
    color: #1a1a1a;
}

.jrv-faq-a ul,
.jrv-faq-a ol {
    margin: 6px 0 10px 18px;
    color: #1a1a1a;
}

.jrv-faq-a li {
    margin: 4px 0;
}

/* Note Box */
.jrv-faq-note {
    padding: 10px 12px;
    background: #f1f5ff;
    border: 1px dashed #cfe0ff;
    border-radius: 10px;
    color: #0a2b66;
    font-size: 14px;
    margin: 10px 0;
}

/* Tables */
.jrv-faq-a table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 10px 0 4px;
    border: 1px solid #e4e7ee;
    border-radius: 10px;
    overflow: hidden;
    font-size: 14px;
}

.jrv-faq-a th,
.jrv-faq-a td {
    padding: 10px 12px;
    border-bottom: 1px solid #e4e7ee;
    text-align: left;
}

.jrv-faq-a th {
    background: #f9fbff;
    font-weight: 700;
}

.jrv-faq-a tr:last-child td {
    border-bottom: 0;
}

/* Footer */
.jrv-faq-footer {
    margin-top: 32px;
    color: #5a6472;
    font-size: 12.5px;
}

.jrv-faq-footer a {
    color: #014EFC;
}

/* ==========================================================================
   FAQ Hub Page Styles
   ========================================================================== */

.jrv-faq-hub .jrv-faq-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.jrv-faq-hub .jrv-faq-header h1 {
    margin-bottom: 0.5rem;
}

.jrv-faq-hub .jrv-faq-header .meta {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Category Cards Grid */
.jrv-faq-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 2rem 0 3rem;
}

/* Hide empty p tags WordPress injects in categories */
.jrv-faq-categories > p:empty,
.jrv-faq-categories > br {
    display: none;
}

/* Individual Card */
.jrv-faq-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e4e7ee;
    border-radius: 16px;
    padding: 1.75rem;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.jrv-faq-card:hover {
    border-color: #014EFC;
    box-shadow: 0 8px 24px rgba(1, 78, 252, 0.12);
    transform: translateY(-2px);
}

/* Card Icon (emoji) */
.jrv-faq-card-icon {
    display: block;
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

/* Card Title (strong element) */
.jrv-faq-card strong {
    display: block;
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    color: #0033A0;
    font-weight: 700;
}

/* Card Description */
.jrv-faq-card-desc {
    display: block;
    font-size: 0.95rem;
    color: #5a6472;
    margin: 0 0 1rem;
    line-height: 1.5;
    flex: 1;
}

/* Card Link */
.jrv-faq-card-link {
    display: block;
    font-weight: 600;
    color: #014EFC;
    font-size: 0.9rem;
    margin-top: auto;
}

.jrv-faq-card:hover .jrv-faq-card-link {
    text-decoration: underline;
}

/* Coming Soon Cards */
.jrv-faq-card-soon {
    opacity: 0.6;
    cursor: default;
    background: #f9fafb;
}

.jrv-faq-card-soon:hover {
    border-color: #e4e7ee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transform: none;
}

.jrv-faq-card-soon .jrv-faq-card-link {
    color: #5a6472;
}

/* CTA Section */
.jrv-faq-cta-section {
    text-align: center;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8f4f8 100%);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    margin: 2rem 0;
}

.jrv-faq-cta-section h2 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem;
    color: #0033A0;
}

.jrv-faq-cta-section p {
    color: #5a6472;
    margin: 0 0 1.5rem;
}

.jrv-faq-cta-section .jrv-faq-cta {
    justify-content: center;
}

/* Mobile Responsive */
@media (max-width: 700px) {
    .jrv-faq-categories {
        grid-template-columns: 1fr;
    }
    
    .jrv-faq-card {
        padding: 1.25rem;
    }
}
