/**
 * VIO Elementor Addons — FAQ + Rating + Author
 * @since 1.4.1
 */

/* =============================================================
   FAQ  —  CSS grid accordion (no JS height calc needed)
   ============================================================= */

.vio-faq-wrap {
    background: #FAFAE5;
    border-radius: 16px;
    padding: 24px;
    direction: rtl;
    box-sizing: border-box;
}

/* ── Header ── */
.vio-faq-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.vio-faq-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    flex: 1;
    text-align: right;
}

.vio-faq-toggle-all {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #c8c820;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #555;
    flex-shrink: 0;
    transition: background .2s;
    padding: 0;
}
.vio-faq-toggle-all:hover { background: #f5f5d5; }
.vio-faq-toggle-all svg   { transition: transform .3s ease; }
.vio-faq-wrap.all-open .vio-faq-toggle-all svg { transform: rotate(180deg); }

/* ── List & Items ── */
.vio-faq-list { display: flex; flex-direction: column; }

.vio-faq-item {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.vio-faq-item + .vio-faq-item { margin-top: 10px; }
.vio-faq-item.vio-open        { box-shadow: 0 3px 10px rgba(0,0,0,.1); }

/* ── Question button ── */
.vio-faq-q {
    width: 100%;
    background: none;
    border: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 18px 20px;
    cursor: pointer;
    text-align: right;
    direction: rtl;
}
.vio-faq-q:hover { background: rgba(0,0,0,.025); }

.vio-faq-q-text {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    flex: 1;
    line-height: 1.5;
    text-align: right;
}

.vio-faq-chevron {
    flex-shrink: 0;
    color: #9CA3AF;
    transition: transform .32s ease;
}
.vio-faq-item.vio-open .vio-faq-chevron { transform: rotate(180deg); }

/* ── Answer: CSS grid accordion (no JS height calc) ── */
.vio-faq-body {
    display: grid;
    grid-template-rows: 0fr;           /* collapsed */
    transition: grid-template-rows .32s ease;
    direction: rtl;
}
.vio-faq-item.vio-open .vio-faq-body {
    grid-template-rows: 1fr;           /* expanded */
}

/* inner must have overflow:hidden for the grid trick to work */
.vio-faq-answer-inner {
    overflow: hidden;
    min-height: 0;
    padding: 0 20px 0;
    font-size: 14px;
    line-height: 1.9;
    color: #4B5563;
    transition: padding .32s ease;
}
.vio-faq-item.vio-open .vio-faq-answer-inner {
    padding-bottom: 20px;
}

/* =============================================================
   Article Rating
   ============================================================= */

.vio-rating-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px 20px;
    direction: rtl;
    box-sizing: border-box;
}

.vio-rating-text-side { flex: 1; text-align: right; }

.vio-rating-label {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
}
.vio-rating-label.vio-rated { color: #16a34a; }

.vio-rating-divider {
    width: 1.5px;
    height: 44px;
    background: #e5e7eb;
    flex-shrink: 0;
}

.vio-rating-stars-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

/* ستاره‌ها — RTL: ستاره ۱ سمت راست */
.vio-stars-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-direction: row-reverse;
}

/* ── Star button ── */
.vio-star-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform .15s ease;
    line-height: 1;
}
.vio-star-btn:hover { transform: scale(1.2); }
.vio-star-btn svg   { width: 100%; height: 100%; display: block; }

/* ستاره خالی */
.vio-star-btn:not(.is-filled):not(.is-hover) svg path {
    fill:   none;
    stroke: #D1D5DB;
    stroke-width: 1.5;
    stroke-linejoin: round;
}

/* ستاره فعال (رأی‌داده‌شده) */
.vio-star-btn.is-filled svg path {
    fill:   #C0274C;
    stroke: #C0274C;
    stroke-width: 1.5;
    stroke-linejoin: round;
}

/* ستاره hover */
.vio-star-btn.is-hover svg path {
    fill:   #C0274C;
    stroke: #C0274C;
    stroke-width: 1.5;
    stroke-linejoin: round;
    opacity: .8;
}

/* ── Tooltip عددی ── */
.vio-star-tip {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 50%;
    transform: translateX(-50%);
    background: #C0274C;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    padding: 3px 7px 4px;
    border-radius: 5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s ease;
    white-space: nowrap;
    z-index: 100;
}
.vio-star-tip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #C0274C;
}
/* نمایش tooltip هنگام hover — CSS فقط */
.vio-star-btn:hover .vio-star-tip { opacity: 1; }

/* ── امتیاز و تعداد ── */
.vio-rating-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}
.vio-rating-score { font-weight: 700; color: #374151; }
.vio-rating-count { color: #9CA3AF; font-size: 12px; }

/* =============================================================
   Author Info
   ============================================================= */

.vio-author-info {
    background: #F3EEFF;
    border-radius: 16px;
    padding: 24px;
    direction: rtl;
    box-sizing: border-box;
}
.vio-author-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}
.vio-author-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.vio-author-title-label { font-size: 13px; color: #6B7280; font-weight: 500; }
.vio-author-name        { font-size: 18px; font-weight: 700; color: #D97706; line-height: 1.3; }
.vio-author-icon-wrap   { font-size: 28px; color: #5A8A3C; display: flex; align-items: center; }
.vio-author-bio {
    font-size: 14px; line-height: 1.9; color: #4B5563;
    text-align: right; margin-bottom: 20px;
}
.vio-author-btn-wrap { text-align: left; }
.vio-author-btn {
    display: inline-flex; align-items: center; padding: 11px 28px;
    background: linear-gradient(135deg, #F97316, #FBBF24);
    color: #fff; font-weight: 700; font-size: 15px;
    border-radius: 50px; text-decoration: none;
    transition: opacity .2s, transform .15s;
}
.vio-author-btn:hover { opacity: .9; transform: translateY(-1px); color: #fff; text-decoration: none; }

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 600px) {
    .vio-rating-wrap   { flex-direction: column; align-items: flex-end; gap: 12px; }
    .vio-rating-divider { width: 100%; height: 1.5px; }
}
