/* ==========================================================================
   MASTER LEGAL & FAQ STYLESHEET (css-legal-pages.css)
   Organized: FAQ Accordions, Legal Grids, Typography, & Mobile/RTL
   ========================================================================== */

/* ==========================================================================
   MODULE 1: FAQ PAGE LAYOUT & CONTAINERS
   ========================================================================== */

.kh-faq-vault {
    max-width: 1200px !important; /* Widened to fit 2 columns perfectly */
    margin: 40px auto !important;
    padding: 0 20px !important;
}

/* Section Headers */
.kh-faq-header {
    font-size: 18px !important;
    font-weight: 900 !important;
    color: #8db73b !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin: 50px 0 20px 0 !important;
    border-bottom: 2px solid #eeeeee !important;
    padding-bottom: 10px !important;
}

.kh-faq-vault .kh-faq-section:first-child .kh-faq-header {
    margin-top: 0 !important;
}

/* The FAQ Items (2-Column Grid Layout) */
.kh-faq-items-wrapper {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important; /* Forces exactly 2 columns */
    gap: 20px !important;
    align-items: start !important; /* Prevents neighboring items from stretching when one opens */
}


/* ==========================================================================
   MODULE 2: FAQ ACCORDION ITEMS
   ========================================================================== */

.kh-faq-item {
    background: #ffffff !important;
    border: 1px solid #eeeeee !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02) !important;
    transition: all 0.3s ease !important;
}

.kh-faq-item:hover {
    border-color: #dddddd !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05) !important;
}

.kh-faq-item.active {
    border-color: #8db73b !important;
}

/* The Question Button */
.kh-faq-question {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 20px 25px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    text-align: start !important; /* Changed to start for RTL support */
    color: #222222 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    transition: all 0.3s ease !important;
}

.kh-faq-item.active .kh-faq-question {
    color: #8db73b !important;
}

/* The Icon Chevron */
.kh-faq-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #999999 !important;
    transition: transform 0.4s ease !important;
    flex-shrink: 0 !important;
    margin-inline-start: 15px !important; /* Changed to inline-start for RTL support */
}

.kh-faq-item.active .kh-faq-icon {
    transform: rotate(180deg) !important;
    color: #8db73b !important;
}

/* The Answer Body */
.kh-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.1, 1, 0.2, 1) !important;
    background: #fdfdfd !important;
}

.kh-faq-answer-inner {
    padding: 0 25px 25px 25px !important;
    font-size: 14px !important;
    color: #555555 !important;
    line-height: 1.6 !important;
}


/* ==========================================================================
   MODULE 3: FAQ MOBILE & RTL LOGIC
   ========================================================================== */

/* Mobile: Stack back to 1 column on smaller screens */
@media (max-width: 992px) {
    .kh-faq-items-wrapper {
        grid-template-columns: 1fr !important;
    }
}

/* RTL: Section headers — letter-spacing disconnects Arabic joined glyphs */
html[dir="rtl"] .kh-faq-header,
body.rtl .kh-faq-header {
    letter-spacing: 0 !important;
}

/* RTL: Question button.
   direction: ltr creates a neutral, predictable flex baseline — without it,
   direction: rtl is already inherited and flex-direction: row-reverse would
   double-reverse back to LTR, putting the chevron on the wrong side again.
   flex-direction: row-reverse then explicitly moves the icon (2nd DOM element)
   to the left and the text (1st DOM element) to the right. */
html[dir="rtl"] .kh-faq-question,
body.rtl .kh-faq-question {
    direction: ltr !important;
    flex-direction: row-reverse !important;
    text-align: right !important;
}

/* RTL: Icon — zero the inherited left margin and add the gap on the right
   (between the icon now on the left and the text now on the right) */
html[dir="rtl"] .kh-faq-icon,
body.rtl .kh-faq-icon {
    margin-inline-start: 0 !important;
    margin-left: 0 !important;
    margin-right: 15px !important;
}

/* RTL: Answer content — right-align answer text */
html[dir="rtl"] .kh-faq-answer-inner,
body.rtl .kh-faq-answer-inner {
    text-align: right !important;
}


/* ==========================================================================
   MODULE 4: LEGAL PAGES GRID (PRIVACY, TERMS, REFUND)
   ========================================================================== */

.kh-legal-vault {
    max-width: 1200px !important;
    margin: 40px auto !important;
    padding: 0 20px !important;
}

.kh-legal-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 25px !important;
    align-items: stretch !important;
}

/* Card Styling */
.kh-legal-card {
    background: #ffffff !important;
    border: 1px solid #eeeeee !important;
    border-radius: 12px !important;
    padding: 35px !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02) !important;
    transition: all 0.3s ease !important;
}

.kh-legal-card:hover {
    border-color: #dddddd !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.05) !important;
}

/* Control Column Spanning */
.kh-legal-card-full {
    grid-column: 1 / -1 !important; /* Forces it to stretch across both columns */
    background: #fdfdfd !important;
}

.kh-legal-card-half {
    grid-column: span 1 !important;
}


/* ==========================================================================
   MODULE 5: LEGAL TYPOGRAPHY, LINKS & LISTS
   ========================================================================== */

/* Typography inside the Cards */
.kh-legal-card-title {
    font-size: 16px !important;
    font-weight: 900 !important;
    color: #8db73b !important;
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-bottom: 2px solid #f5f5f5 !important;
    padding-bottom: 15px !important;
}

.kh-legal-card-content {
    font-size: 14px !important;
    color: #555555 !important;
    line-height: 1.7 !important;
}

.kh-legal-card-content strong {
    color: #222222 !important;
    font-weight: 800 !important;
}

/* Legal Links */
.kh-legal-link {
    color: #8db73b !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.kh-legal-link:hover {
    color: #222222 !important;
}

/* Legal Lists (Bullets) */
ul.kh-legal-list {
    margin: 15px 0 0 0 !important;
    padding-left: 20px !important;
}

ul.kh-legal-list li {
    margin-bottom: 10px !important;
    position: relative !important;
}

ul.kh-legal-list li:last-child {
    margin-bottom: 0 !important;
}


/* ==========================================================================
   MODULE 6: LEGAL MOBILE & RTL LOGIC
   ========================================================================== */

html[dir="rtl"] ul.kh-legal-list {
    padding-left: 0 !important;
    padding-right: 20px !important;
}

/* Mobile Responsiveness (Stack into 1 column) */
@media (max-width: 992px) {
    .kh-legal-grid {
        grid-template-columns: 1fr !important;
    }
    .kh-legal-card-full, 
    .kh-legal-card-half {
        grid-column: 1 / -1 !important;
    }
    .kh-legal-card {
        padding: 25px !important;
    }
}