/* File: assets/css/faq-accordion.css */

/* Container */
.je-faq-accordion {
    width: 100%;
}

/* FAQ Item */
.je-faq-item {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.je-faq-item:not(:last-child) {
    margin-bottom: 10px;
}

/* Header */
.je-faq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: #f7f7f7;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.je-faq-header:hover {
    background-color: #ebebeb;
}

.je-faq-header.active {
    background-color: #e0e0e0;
}

.je-faq-header:focus {
    outline: 2px solid rgba(0, 123, 255, 0.25);
    outline-offset: -2px;
}

/* Question */
.je-faq-question {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

/* Icon */
.je-faq-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
}

.je-faq-icon-left {
    margin-right: 15px;
}

.je-faq-icon-right {
    margin-left: 15px;
}

.je-faq-header.active .je-faq-icon {
    transform: rotate(180deg);
}

/* Fix rotation for specific icons */
.je-faq-header.active .je-faq-icon .eicon-minus,
.je-faq-header.active .je-faq-icon .eicon-arrow-up,
.je-faq-header.active .je-faq-icon .eicon-chevron-up {
    transform: none;
}

/* Content */
.je-faq-content {
    overflow: hidden;
    transition: all 0.3s ease;
}

.je-faq-content-inner {
    padding: 20px;
    background-color: #fff;
}

/* Field Label */
.je-faq-field-label {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
}

/* Field Content */
.je-faq-field {
    margin-bottom: 20px;
}

.je-faq-field:last-child {
    margin-bottom: 0;
}

.je-faq-field p:first-child {
    margin-top: 0;
}

.je-faq-field p:last-child {
    margin-bottom: 0;
}

/* Gallery */
.je-faq-gallery {
    display: grid;
    gap: 15px;
    margin-top: 15px;
}

.je-faq-gallery[data-columns="1"] {
    grid-template-columns: 1fr;
}

.je-faq-gallery[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.je-faq-gallery[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.je-faq-gallery[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.je-faq-gallery[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.je-faq-gallery[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

.je-faq-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    background-color: #f5f5f5;
    display: block;
}

.je-faq-gallery-item a {
    display: block;
    line-height: 0;
    width: 100%;
    height: 100%;
    position: relative;
}

.je-faq-gallery-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease, filter 0.3s ease;
    object-fit: cover;
}

/* Aspect Ratios - IMPORTANT: These need absolute positioning for proper image sizing */
.je-faq-gallery-ratio-1-1 .je-faq-gallery-item {
    aspect-ratio: 1 / 1;
}

.je-faq-gallery-ratio-3-2 .je-faq-gallery-item {
    aspect-ratio: 3 / 2;
}

.je-faq-gallery-ratio-4-3 .je-faq-gallery-item {
    aspect-ratio: 4 / 3;
}

.je-faq-gallery-ratio-16-9 .je-faq-gallery-item {
    aspect-ratio: 16 / 9;
}

.je-faq-gallery-ratio-21-9 .je-faq-gallery-item {
    aspect-ratio: 21 / 9;
}

.je-faq-gallery-ratio-9-16 .je-faq-gallery-item {
    aspect-ratio: 9 / 16;
}

.je-faq-gallery-ratio-2-3 .je-faq-gallery-item {
    aspect-ratio: 2 / 3;
}

/* When aspect ratio is set, position images absolutely to fill container */
[class*="je-faq-gallery-ratio-"] .je-faq-gallery-item a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

[class*="je-faq-gallery-ratio-"] .je-faq-gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hover Effects */
.je-faq-gallery-hover-zoom .je-faq-gallery-item:hover .je-faq-gallery-image {
    transform: scale(1.1);
}

.je-faq-gallery-hover-zoom-out .je-faq-gallery-item:hover .je-faq-gallery-image {
    transform: scale(0.9);
}

.je-faq-gallery-hover-opacity .je-faq-gallery-item:hover .je-faq-gallery-image {
    opacity: 0.7;
}

.je-faq-gallery-hover-grayscale .je-faq-gallery-item:hover .je-faq-gallery-image {
    filter: grayscale(100%);
}

.je-faq-gallery-hover-blur .je-faq-gallery-item:hover .je-faq-gallery-image {
    filter: blur(3px);
}

/* Overlay */
.je-faq-gallery-has-overlay .je-faq-gallery-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    transition: background-color 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.je-faq-gallery-has-overlay .je-faq-gallery-item:hover::after {
    background-color: rgba(0, 0, 0, 0.3);
}

/* Fix for WordPress default image styles */
.je-faq-gallery img[width],
.je-faq-gallery img[height] {
    width: 100% !important;
    height: 100% !important;
}

/* Gallery - Single Image Mode */
.je-faq-gallery-single {
    display: block;
    max-width: 100%;
}

.je-faq-gallery-single .je-faq-gallery-item {
    width: 100%;
    max-width: 100%;
}

.je-faq-gallery-single .je-faq-gallery-image {
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    position: relative !important;
    object-fit: initial !important;
}

/* Don't apply aspect ratio to single images */
.je-faq-gallery-single.je-faq-gallery-ratio-1-1 .je-faq-gallery-item,
.je-faq-gallery-single.je-faq-gallery-ratio-3-2 .je-faq-gallery-item,
.je-faq-gallery-single.je-faq-gallery-ratio-4-3 .je-faq-gallery-item,
.je-faq-gallery-single.je-faq-gallery-ratio-16-9 .je-faq-gallery-item,
.je-faq-gallery-single.je-faq-gallery-ratio-21-9 .je-faq-gallery-item,
.je-faq-gallery-single.je-faq-gallery-ratio-9-16 .je-faq-gallery-item,
.je-faq-gallery-single.je-faq-gallery-ratio-2-3 .je-faq-gallery-item {
    aspect-ratio: unset;
    height: auto;
}

.je-faq-gallery-single .je-faq-gallery-item a {
    position: relative !important;
    width: auto !important;
    height: auto !important;
    display: inline-block;
}

/* Single Image */
.je-faq-single-image {
    margin-top: 15px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    display: inline-block;
    max-width: 100%;
}

.je-faq-single-image a {
    display: block;
    line-height: 0;
}

.je-faq-single-image-img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

/* Single Image */
.je-faq-single-image {
    margin-top: 15px;
}

.je-faq-single-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Video */
.je-faq-video {
    margin-top: 15px;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.je-faq-video iframe,
.je-faq-video embed,
.je-faq-video object {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* If video is just a link */
.je-faq-video a {
    position: static;
    display: inline-block;
    color: #0073aa;
    text-decoration: underline;
}

/* File Download */
.je-faq-file-download {
    margin-top: 15px;
}

.je-faq-download-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.je-faq-download-link:hover {
    background-color: #005a87;
    color: #fff;
}

.je-faq-download-link i {
    margin-right: 8px;
    font-size: 16px;
}

/* Editor Notice */
.je-faq-notice {
    padding: 20px;
    background-color: #f0f0f1;
    border: 2px dashed #c3c4c7;
    border-radius: 4px;
    text-align: center;
    color: #646970;
}

/* Responsive */
@media (max-width: 768px) {
    .je-faq-header {
        padding: 12px 15px;
    }
    
    .je-faq-content-inner {
        padding: 15px;
    }
    
    .je-faq-question {
        font-size: 14px;
    }
    
    .je-faq-icon {
        font-size: 14px;
    }
    
    .je-faq-icon-left {
        margin-right: 10px;
    }
    
    .je-faq-icon-right {
        margin-left: 10px;
    }
    
    /* Adjust gallery columns on tablet */
    .je-faq-gallery[data-columns="5"],
    .je-faq-gallery[data-columns="6"] {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .je-faq-gallery[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    /* Adjust gallery columns on mobile */
    .je-faq-gallery[data-columns="3"],
    .je-faq-gallery[data-columns="4"],
    .je-faq-gallery[data-columns="5"],
    .je-faq-gallery[data-columns="6"] {
        grid-template-columns: 1fr;
    }
    
    .je-faq-gallery[data-columns="2"] {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .je-faq-header {
        background-color: transparent !important;
        border-bottom: 1px solid #ddd;
    }
    
    .je-faq-content {
        display: block !important;
    }
    
    .je-faq-icon {
        display: none;
    }
}
