/* ==========================================================================
   ویدیوهای آموزشی پیود (نسخه ۱.۸.۰)
   ========================================================================== */

.trn-page {
    --trn-primary: #4f46e5;
    --trn-soft: #eef2ff;
    --trn-text: #111827;
    --trn-muted: #6b7280;
    --trn-border: #e5e7eb;

    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 16px 60px;
    direction: rtl;
    color: var(--trn-text);
}

.trn-hero {
    text-align: center;
    padding: 34px 20px;
    border-radius: 22px;
    background: linear-gradient(135deg, #eef2ff, #ffffff 55%, #e0f2fe);
    border: 1px solid var(--trn-border);
    margin-bottom: 28px;
}

.trn-hero-icon {
    font-size: 56px;
    color: var(--trn-primary);
}

.trn-hero h1 {
    margin: 6px 0 10px;
    font-size: clamp(1.35rem, 4vw, 2rem);
}

.trn-hero p {
    max-width: 760px;
    margin: 0 auto;
    color: var(--trn-muted);
    font-size: 0.95rem;
    line-height: 2;
}

.trn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.trn-card {
    border-radius: 18px;
    background: #fff;
    border: 1px solid var(--trn-border);
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.trn-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}

.trn-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    padding: 0;
    background: #0f172a;
    cursor: pointer;
    overflow: hidden;
}

.trn-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.trn-thumb-fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #312e81, #4f46e5);
    color: #fff;
}

.trn-thumb-fallback .material-icons {
    font-size: 46px;
}

.trn-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    display: grid;
    place-items: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    transition: transform 0.2s ease;
}

.trn-play .material-icons {
    color: var(--trn-primary);
    font-size: 34px;
}

.trn-card:hover .trn-play {
    transform: scale(1.08);
}

.trn-duration {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(15, 23, 42, 0.78);
    color: #fff;
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.trn-card-body {
    padding: 16px;
}

.trn-card-body h3 {
    font-size: 1rem;
    margin: 0 0 8px;
    line-height: 1.8;
}

.trn-card-body p {
    font-size: 0.83rem;
    color: var(--trn-muted);
    line-height: 1.9;
    margin: 0 0 12px;
}

.trn-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 4px;
    font-size: 0.78rem;
    color: var(--trn-muted);
}

.trn-meta li {
    display: flex;
    align-items: center;
    gap: 5px;
}

.trn-meta .material-icons {
    font-size: 16px;
    color: #9ca3af;
}

.trn-meta b {
    color: var(--trn-text);
}

.trn-empty {
    text-align: center;
    padding: 34px 20px;
    border-radius: 18px;
    border: 1px dashed var(--trn-border);
    color: var(--trn-muted);
}

.trn-empty .material-icons {
    font-size: 40px;
    color: var(--trn-primary);
}

/* پخش‌کننده مودال */
.trn-modal {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 20px;
}

/* متن‌های طولانی بدون فاصله نباید از کارت بیرون بزنند */
.trn-card,
.trn-card h3,
.trn-card p,
.trn-modal-title {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.trn-modal[hidden] {
    display: none !important;
}

.trn-page [hidden] {
    display: none !important;
}

.trn-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.86);
}

.trn-modal-dialog {
    position: relative;
    width: min(960px, 100%);
    background: #0b1120;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.trn-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: #111827;
    color: #fff;
    font-size: 0.9rem;
}

.trn-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.trn-modal-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

.trn-modal-player video,
.trn-modal-player iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #000;
}

@media (max-width: 600px) {
    .trn-grid {
        grid-template-columns: 1fr;
    }

    .trn-modal {
        padding: 0;
    }

    .trn-modal-dialog {
        border-radius: 0;
        width: 100%;
    }
}
