/*
 * تکمیل استایل صفحات آکادمی (قالب جدید).
 * CSS اصلی از بیلد Vite در dist می‌آید و فقط کلاس‌های همان طراحی را دارد؛
 * اینجا فقط چیزهایی است که طراحی استاتیک نداشت. همه‌ی کلاس‌ها پیشوند ac- دارند.
 */

[x-cloak] { display: none !important; }

/* بردکرامب: یک خط با اسکرول افقی در موبایل */
.ac-breadcrumb { flex-wrap: wrap; }
.ac-breadcrumb a { transition: color .15s ease; }
@media (max-width: 767.98px) {
    .ac-breadcrumb { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
    .ac-breadcrumb::-webkit-scrollbar { display: none; }
}

/* دکمه‌های آیکونی (علاقه‌مندی، اشتراک) */
.ac-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 9999px; cursor: pointer;
    transition: background-color .15s ease;
}
.ac-icon-btn:hover { background: var(--color-gray-100, #f5f5f5); }
.ac-icon-btn:disabled { opacity: .6; cursor: default; }
.ac-icon-btn:focus-visible { outline: 2px solid var(--color-primary-500, #1e76c1); outline-offset: 2px; }

/* آواتار حرفی (وقتی تصویر نداریم) */
.ac-avatar {
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    border-radius: 9999px; font-size: 13px; font-weight: 700;
    background: var(--color-primary-50, #eaf3fb); color: var(--color-primary-500, #1e76c1);
}

/* نوار مشخصات و آمار مدرس با تعداد ستون متغیر */
@media (min-width: 768px) {
    .ac-specs { grid-template-columns: repeat(var(--ac-cols, 4), minmax(0, 1fr)); }
}
@media (min-width: 768px) and (max-width: 1023.98px) {
    .ac-specs { grid-template-columns: repeat(min(var(--ac-cols, 4), 2), minmax(0, 1fr)); }
}
.ac-stats { grid-template-columns: repeat(var(--ac-cols, 3), minmax(0, 1fr)); }

/* توضیحات جمع‌شونده */
.ac-collapsible { position: relative; overflow: hidden; }
.ac-collapsible.is-collapsed { max-height: 360px; }
.ac-collapsible.is-collapsed::after {
    content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 96px; pointer-events: none;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
}
.ac-collapsible img { max-width: 100%; height: auto; border-radius: 12px; }

/* کارت‌های «دیگر دوره‌های مدرس»: دو کارت در عرض دسکتاپ */
@media (min-width: 1024px) {
    .ac-mini-card { flex: 0 0 calc(50% - 6px); }
}

/* کارت ویدئوی تجربه‌ی هنرجو */
.ac-video-card { width: 168px; }
.ac-video-card__btn {
    position: relative; display: block; width: 100%; aspect-ratio: 9 / 16; cursor: pointer;
    overflow: hidden; border-radius: 16px; background: #0c0c0c;
}
.ac-video-card__btn video { width: 100%; height: 100%; object-fit: cover; opacity: .85; pointer-events: none; }
.ac-video-card__play {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    display: flex; align-items: center; justify-content: center; width: 48px; height: 48px;
    border-radius: 9999px; background: rgba(255, 255, 255, .3); backdrop-filter: blur(4px);
}
.ac-video-card__name {
    position: absolute; inset-inline: 0; bottom: 0; padding: 24px 12px 12px; font-size: 12px; font-weight: 700;
    color: #fff; text-align: start; background: linear-gradient(to top, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0));
}
.ac-video-card__btn:focus-visible { outline: 2px solid var(--color-primary-500, #1e76c1); outline-offset: 3px; }

/* مودال ویدئو */
@media (min-width: 768px) {
    .ac-video-panel { max-width: 880px !important; width: calc(100% - 48px); height: auto !important; }
}
.ac-video-panel__player { display: block; width: 100%; max-height: 70vh; aspect-ratio: 16 / 9; border-radius: 12px; background: #000; }

/* ---------- ستون خرید صفحه‌ی دوره: در هر ارتفاع صفحه کامل دیده شود ---------- */
@media (min-width: 768px) {
    .ac-buy-sticky {
        max-height: calc(100vh - 176px);
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
    }
    .ac-buy-sticky::-webkit-scrollbar { display: none; }
    body.header-bottom-visible .ac-buy-sticky { max-height: calc(100vh - 240px); }
}
@media (min-width: 768px) and (max-height: 900px) {
    .ac-perks li { min-height: 42px !important; font-size: 13px; }
}
@media (min-width: 768px) and (max-height: 760px) {
    .ac-perks { display: none; }
}

/* ---------- لیست دوره‌ها (PLP) ---------- */
.ac-grid { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ac-grid .academy-course { width: auto !important; display: flex; flex-direction: column; }
@media (max-width: 1279.98px) { .ac-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639.98px) { .ac-grid { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1024px) and (max-width: 1279.98px) { .ac-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ac-card-stats { grid-template-columns: repeat(var(--ac-cols, 3), minmax(0, 1fr)); }
/* کاورهای دوره ۱۶:۹ هستند؛ با همین نسبت کامل و بدون برش دیده می‌شوند */
.academy-course .academy-course__image { aspect-ratio: 16 / 9 !important; background: #f5f5f5; }
.academy-course .academy-course__image img { width: 100%; height: 100%; object-fit: cover; }
.ac-stats-list { grid-template-columns: repeat(var(--ac-cols, 4), minmax(0, 1fr)); }
@media (max-width: 767.98px) { .ac-stats-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) and (max-width: 1023.98px) {
    .ac-topics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
    .ac-topics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.ac-line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ac-line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ac-more-card { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 280px; color: var(--color-primary-500, #1e76c1); }
.ac-more-card__icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 9999px; background: var(--color-primary-50, #eaf3fb); }
.ac-card-stats .academy-course__stat { display: flex; text-align: center; }

.ac-cat-chips { scrollbar-width: none; }
.ac-cat-chips::-webkit-scrollbar { display: none; }
.ac-cat-chips .academy-courses__tab { border-width: 1px; text-decoration: none; }

.ac-filters-aside { top: 160px; width: 272px; }
.ac-list-hero p { max-width: 760px; }
.ac-link-danger:hover { color: var(--color-error-500, #ef4056); }
.ac-sort { flex-wrap: wrap; row-gap: 8px; }
.ac-sort__link { padding: 6px 10px; border-radius: 9999px; color: #81858b; transition: color .15s ease, background-color .15s ease; }
.ac-sort__link:hover { color: var(--color-primary-text, #23254e); }
.ac-sort__link[aria-current="true"] { background: var(--color-primary-50, #eaf3fb); color: var(--color-primary-500, #1e76c1); font-weight: 700; }
@media (max-width: 1023.98px) {
    .ac-filters-aside, .ac-sort { display: none !important; }
}
@media (min-width: 1024px) {
    .ac-mobile-tools { display: none !important; }
}

.ac-filter-group { display: flex; flex-direction: column; gap: 10px; padding-block: 16px; border-bottom: 1px solid var(--color-gray-50, #f0f0f1); min-width: 0; }
.ac-filter-group:last-of-type { border-bottom: 0; }
.ac-filter-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.ac-check { position: relative; display: flex; align-items: center; gap: 10px; min-height: 32px; cursor: pointer; font-size: 13px; }
.ac-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ac-check__box { width: 18px; height: 18px; flex-shrink: 0; border: 1.5px solid #c9cbd1; border-radius: 5px; transition: all .15s ease; }
.ac-check input:checked + .ac-check__box { background: var(--color-primary-500, #1e76c1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: var(--color-primary-500, #1e76c1); }
.ac-check input:focus-visible + .ac-check__box { outline: 2px solid var(--color-primary-500, #1e76c1); outline-offset: 2px; }
.ac-check__count { font-size: 11px; color: #a1a3a8; }
.ac-switch { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; font-size: 13px; min-height: 32px; }
.ac-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ac-switch__track { position: relative; width: 36px; height: 20px; flex-shrink: 0; border-radius: 9999px; background: #e0e0e2; transition: background-color .15s ease; }
.ac-switch__track::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 9999px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: inset-inline-start .15s ease; }
.ac-switch input:checked + .ac-switch__track { background: var(--color-primary-500, #1e76c1); }
.ac-switch input:checked + .ac-switch__track::after { inset-inline-start: 18px; }
.ac-switch input:focus-visible + .ac-switch__track { outline: 2px solid var(--color-primary-500, #1e76c1); outline-offset: 2px; }
.ac-noscript-only { display: none; }
.ac-collapsible--short.is-collapsed { max-height: 300px; }

/* ریزه‌کاری‌هایی که utility معادل در بیلد ندارند */
.ac-blur { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ac-btn-success { background: #00a049; color: #fff; transition: opacity .15s ease; }
.ac-btn-success:hover { opacity: .9; }
.ac-warranty { min-height: 66px; }
.ac-mobile-spacer { height: 96px; }
.ac-rating-value { font-size: 32px; line-height: 1; }
@media (max-width: 767.98px) { .ac-rating-value { font-size: 24px; } }
.ac-star-off { color: #e0e0e2; }
.ac-reply { margin-inline-start: 24px; }
@media (max-width: 767.98px) { .ac-reply { margin-inline-start: 12px; } }
.ac-bullet { margin-top: 10px; width: 6px; height: 6px; flex-shrink: 0; border-radius: 9999px; background: #e0e0e2; }

/* اسپینر دکمه‌ها */
.ac-spinner {
    display: inline-block; width: 18px; height: 18px; border-radius: 9999px;
    border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
    animation: ac-spin .7s linear infinite;
}
@keyframes ac-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ac-spinner { animation-duration: 1.6s; } }
