/* ============================================================
   TESTIMONIAL WALL
   ============================================================ */

:root {
    --tw-primary: #6a1e55;
    --tw-primary-light: #8a2e75;
    --tw-gold: #deb887;
    --tw-danger: #e74c3c;
    --tw-text: #222;
    --tw-text-soft: #666;
    --tw-text-mute: #999;
    --tw-border: #ececec;
    --tw-bg-soft: #f8f8f8;
    --tw-radius: 14px;
    --tw-radius-lg: 18px;
    --tw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.04);
    --tw-shadow-md: 0 4px 12px rgba(106, 30, 85, 0.08), 0 12px 32px rgba(106, 30, 85, 0.12);
}

/* ═══════════════════════════════════════════════
   Section
   ═══════════════════════════════════════════════ */
.tw {
    padding: 40px 0;
}

.tw__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tw__head-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tw__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--tw-text);
    margin: 0;
}

.tw__title svg {
    color: var(--tw-primary);
}

.tw__sub {
    font-size: 0.85rem;
    color: var(--tw-text-mute);
    margin: 0;
}

/* ═══════════════════════════════════════════════
   Grid
   ═══════════════════════════════════════════════ */
.tw__grid {
    display: grid;
    gap: 14px;
}

.tw__grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.tw__grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.tw__grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

.tw__grid--5 {
    grid-template-columns: repeat(5, 1fr);
}

.tw__grid--6 {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 991.98px) {

    .tw__grid--4,
    .tw__grid--5,
    .tw__grid--6 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767.98px) {

    .tw__grid--3,
    .tw__grid--4,
    .tw__grid--5,
    .tw__grid--6 {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 400px) {

    .tw__grid--2,
    .tw__grid--3,
    .tw__grid--4,
    .tw__grid--5,
    .tw__grid--6 {
        gap: 8px;
    }
}

/* ═══════════════════════════════════════════════
   Card
   ═══════════════════════════════════════════════ */
.tw-card {
    background: #fff;
    border: 1px solid var(--tw-border);
    border-radius: var(--tw-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: var(--tw-shadow-sm);
    display: flex;
    flex-direction: column;
}

.tw-card:hover {
    border-color: rgba(106, 30, 85, 0.15);
    transform: translateY(-4px);
    box-shadow: var(--tw-shadow-md);
}

.tw-card:focus-visible {
    outline: 2px solid var(--tw-primary);
    outline-offset: 2px;
}

/* ─── Media ─── */
.tw-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, var(--tw-primary) 0%, var(--tw-primary-light) 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tw-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.tw-card:hover .tw-card__img {
    transform: scale(1.06);
}

.tw-card__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.95);
    width: 100%;
    height: 100%;
    position: relative;
}

/* پس‌زمینه گرادیانت با نور */
.tw-card__placeholder::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    background: var(--tw-gold);
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.tw-card__placeholder svg {
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

.tw-card:hover .tw-card__placeholder svg {
    transform: scale(1.15);
}

.tw-card__placeholder--video svg {
    opacity: 0.95;
}

.tw-card__placeholder--audio {
    background: linear-gradient(135deg, #4a1540 0%, #6a1e55 100%);
}

.tw-card__placeholder-text {
    position: relative;
    z-index: 1;
    font-size: 0.72rem;
    font-weight: 600;
    opacity: 0.9;
}

/* ─── Badge نوع ─── */
.tw-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 100px;
    z-index: 2;
}

/* ─── Body ─── */
.tw-card__body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.tw-card__name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--tw-text);
    line-height: 1.4;
}

.tw-card__tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: var(--tw-primary);
    font-weight: 600;
    background: rgba(106, 30, 85, 0.06);
    padding: 2px 8px;
    border-radius: 100px;
    align-self: flex-start;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   Modal
   ═══════════════════════════════════════════════ */
.tw-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tw-modal.is-open {
    display: flex;
    animation: twFade 0.25s ease;
}

@keyframes twFade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.tw-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

.tw-modal__content {
    position: relative;
    z-index: 1;
    max-width: 900px;
    width: 100%;
    background: #1a1a1a;
    border-radius: var(--tw-radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: twScale 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes twScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.tw-modal__close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    z-index: 3;
    transition: all 0.2s;
}

.tw-modal__close:hover {
    background: var(--tw-danger);
    transform: rotate(90deg);
}

.tw-modal__media {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.tw-modal__media video,
.tw-modal__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.tw-modal__media audio {
    width: 80%;
}

.tw-modal__media iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.tw-modal__footer {
    padding: 14px 20px;
    background: #222;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tw-modal__name {
    font-size: 0.95rem;
    font-weight: 700;
}

.tw-modal__type {
    font-size: 0.75rem;
    color: var(--tw-gold);
    background: rgba(222, 184, 135, 0.15);
    padding: 4px 10px;
    border-radius: 100px;
    font-weight: 600;
}

@media (max-width: 575.98px) {
    .tw-modal {
        padding: 10px;
    }

    .tw-modal__close {
        top: 8px;
        left: 8px;
        width: 34px;
        height: 34px;
    }

    .tw-modal__footer {
        padding: 10px 14px;
    }

    .tw-modal__name {
        font-size: 0.85rem;
    }
}