/* CSS-Only Components - Zero JavaScript */

/* ========================================
   MOBILE MENU - CSS-Only Toggle
   ======================================== */

/* Hide the checkbox */
.mobile-menu-toggle {
    display: none;
}

/* Mobile nav starts hidden off-screen */
#mobile-nav {
    position: fixed;
    top: 0;
    right: -240px;
    width: 240px;
    height: 100%;
    background: #fff;
    transition: right 0.3s ease;
    z-index: 9999;
    display: none;
}

/* Show mobile nav when checkbox is checked */
.mobile-menu-toggle:checked ~ header + #mobile-nav {
    right: 0;
    display: block;
}

/* Alternative selector if nav is sibling to header container */
.mobile-menu-toggle:checked ~ #mobile-nav {
    right: 0;
    display: block;
}

/* Overlay behind menu */
.mobile-menu-toggle:checked::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

/* Menu button and close button styling */
#mob-nav-btn,
#close-mob-nav {
    cursor: pointer;
    display: inline-block;
}

#close-mob-nav {
    padding: 15px;
    display: block;
}

/* ========================================
   LANGUAGE SWITCHER - CSS-Only Hover
   ======================================== */

/* Hide language dropdown by default */
.languages .list-container {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    min-width: 120px;
    z-index: 1000;
}

/* Show dropdown on hover and focus */
.languages:hover .list-container,
.languages:focus-within .list-container {
    display: block;
}

/* Ensure parent is positioned */
.languages {
    position: relative;
}

/* Style the current language selector */
.languages .current {
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.languages .current:hover {
    background-color: #f5f5f5;
}

/* ========================================
   FAQ ACCORDIONS - CSS-Only Details/Summary
   ======================================== */

/* Style the details element */
details {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
}

/* Style the summary (question) */
details summary {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    background-color: #f8f9fa;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
    user-select: none;
}

/* Remove default marker */
details summary::-webkit-details-marker {
    display: none;
}

/* Add custom arrow indicator */
details summary::after {
    content: '\25BC';
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

/* Rotate arrow when open */
details[open] summary::after {
    transform: rotate(-180deg);
}

/* Hover effect on summary */
details summary:hover {
    background-color: #e9ecef;
}

/* Style the answer content */
details > div {
    padding: 16px 20px;
    background-color: #fff;
}

/* Open state styling */
details[open] summary {
    background-color: #e30a17;
    color: #fff;
    border-bottom: 1px solid #e0e0e0;
}

details[open] summary::after {
    color: #fff;
}

/* FAQ wrapper styling */
.schema-faq-code {
    margin-top: 20px;
}

.schema-faq-code details {
    margin-bottom: 8px;
}

/* Nested Schema.org divs */
.schema-faq-code details > div[itemscope] {
    padding: 0;
}

.schema-faq-code details > div[itemscope] > div[itemprop="text"] {
    padding: 16px 20px;
}

/* Typography for FAQ content */
.schema-faq-code details p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.schema-faq-code details p:last-child {
    margin-bottom: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    details summary {
        padding: 14px 16px;
        font-size: 15px;
    }

    details > div,
    .schema-faq-code details > div[itemscope] > div[itemprop="text"] {
        padding: 14px 16px;
    }
}

/* ========================================
   PERFORMANCE OPTIMIZATIONS
   ======================================== */

/* Use CSS containment for better performance */
details {
    contain: layout style;
}

/* Optimize animations */
@media (prefers-reduced-motion: reduce) {
    details summary::after,
    .languages .list-container,
    #mobile-nav {
        transition: none;
    }
}

/* Force hardware acceleration */
#mobile-nav,
.languages .list-container {
    transform: translateZ(0);
    will-change: auto;
}
