/* ==================================================
   OCTAGRAM CATEGORIES SECTION
   - شکل هشت‌پر با mask
   - چیدمان با flex (همه خطوط وسط‌چین)
   - سایه‌ی بیرونی قوی + سایه‌ی داخلی سه‌بعدی
   ================================================== */

/* ---------- Section Wrapper ---------- */
.custom-education-theme-octa-cat {
    padding: 60px 24px;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* ---------- Grid (flex با wrap برای وسط‌چین شدن همه خطوط) ---------- */
.custom-education-theme-octa-cat-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: 70px 70px;
}

/* ---------- Item ---------- */
.custom-education-theme-octa-cat-item {
    /* اندازه‌ی کارت با flex */
    flex: 0 1 300px;
    max-width: 367px;
    min-width: 260px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    padding: 8px;
    position: relative;
    isolation: isolate;
    box-shadow: 0px 0px 50px var(--accent-glow-70);
    border-radius: 20%;
    background: var(--accent-glow-10);
    margin-top: 20px;
}

    .custom-education-theme-octa-cat-item:hover {
        transform: translateY(-8px);
    }

/* ==================================================
   SHAPE — خود هشت‌پر
   ================================================== */
.custom-education-theme-octa-cat-shape {
    position: relative;
    width: 100%;
    aspect-ratio: 1432 / 1439;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18%;
    /* ─── گرادیان ملایم لایت ─── */
    background:
    /* درخشش داخلی بالا-چپ (برجستگی ۳بعدی) */
    radial-gradient(ellipse at 30% 25%, rgba(255, 255, 255, 0.28) 0%, transparent 45%),
    /* سایه‌ی داخلی پایین-راست (فرورفتگی ۳بعدی) */
    radial-gradient(ellipse at 75% 85%, rgba(var(--accent-dark-rgb), 0.28) 0%, transparent 55%),
    /* گرادیان اصلی */
    linear-gradient(135deg, var(--accent-2-glow-60) 0%, var(--accent-glow-45) 100%);
    /* ماسک هشت‌پر */
    -webkit-mask-image: url('/assets/img/shapes/octagram.svg');
    mask-image: url('/assets/img/shapes/octagram.svg');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    transition: var(--transition);
    z-index: 2;
}

/* ─── دارک: گرادیان داخلی متناسب با تیرگی ─── */
[data-theme="dark"] .custom-education-theme-octa-cat-shape {
    background: radial-gradient(ellipse at 30% 25%, rgba(var(--accent-2-rgb), 0.22) 0%, transparent 45%), radial-gradient(ellipse at 75% 85%, rgba(0, 0, 0, 0.5) 0%, transparent 55%), linear-gradient(135deg, rgba(var(--accent-2-rgb), 0.32) 0%, var(--accent-glow-20) 100%);
}

/* ─── Hover: گرادیان روشن‌تر ─── */
.custom-education-theme-octa-cat-item:hover .custom-education-theme-octa-cat-shape {
    background: radial-gradient(ellipse at 30% 25%, rgba(255, 255, 255, 0.45) 0%, transparent 50%), radial-gradient(ellipse at 75% 85%, rgba(var(--accent-dark-rgb), 0.35) 0%, transparent 55%), linear-gradient(135deg, rgba(var(--accent-2-rgb), 0.85) 0%, var(--accent-glow-70) 100%);
}

[data-theme="dark"] .custom-education-theme-octa-cat-item:hover .custom-education-theme-octa-cat-shape {
    background: radial-gradient(ellipse at 30% 25%, rgba(var(--accent-2-rgb), 0.32) 0%, transparent 50%), radial-gradient(ellipse at 75% 85%, rgba(0, 0, 0, 0.6) 0%, transparent 55%), linear-gradient(135deg, var(--accent-2-glow-55) 0%, var(--accent-glow-35) 100%);
}

/* ==================================================
   لایه‌ی سایه‌ی بیرونی (پشت شکل)
   ================================================== */
.custom-education-theme-octa-cat-shape::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-glow-55) 0%, var(--accent-2-glow-40) 100%);
    -webkit-mask-image: url('/assets/img/shapes/octagram.svg');
    mask-image: url('/assets/img/shapes/octagram.svg');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    filter: blur(14px);
    transform: translateY(10px) scale(1.08);
    z-index: -1;
    opacity: 0.75;
    transition: var(--transition);
    pointer-events: none;
}

[data-theme="dark"] .custom-education-theme-octa-cat-shape::before {
    background: linear-gradient(135deg, var(--accent-2-glow-50) 0%, var(--accent-glow-35) 100%);
    filter: blur(18px);
    opacity: 0.6;
    transform: translateY(12px) scale(1.1);
}

.custom-education-theme-octa-cat-item:hover .custom-education-theme-octa-cat-shape::before {
    opacity: 1;
    filter: blur(18px);
    transform: translateY(14px) scale(1.12);
}

[data-theme="dark"] .custom-education-theme-octa-cat-item:hover .custom-education-theme-octa-cat-shape::before {
    opacity: 0.85;
    filter: blur(22px);
    transform: translateY(16px) scale(1.14);
}

/* ==================================================
   لایه‌ی هاله‌ی درخشان دور (خارج از شکل)
   ================================================== */
.custom-education-theme-octa-cat-shape::after {
    content: '';
    position: absolute;
    inset: -6%;
    background: radial-gradient(circle at 50% 50%, var(--accent-2-glow-35) 0%, var(--accent-glow-15) 40%, transparent 70%);
    border-radius: 50%;
    filter: blur(24px);
    opacity: 0.7;
    z-index: -2;
    transition: var(--transition);
    pointer-events: none;
}

[data-theme="dark"] .custom-education-theme-octa-cat-shape::after {
    background: radial-gradient(circle at 50% 50%, var(--accent-2-glow-40) 0%, var(--accent-glow-15) 40%, transparent 70%);
    opacity: 0.6;
}

.custom-education-theme-octa-cat-item:hover .custom-education-theme-octa-cat-shape::after {
    opacity: 1;
    filter: blur(30px);
    inset: -10%;
}

/* ---------- Icon ---------- */
.custom-education-theme-octa-cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    line-height: 1;
    margin-bottom: 6px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 0 16px rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    z-index: 3;
    pointer-events: none;
}

.custom-education-theme-octa-cat-item:hover .custom-education-theme-octa-cat-icon {
    transform: scale(1.15);
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.3), 0 0 24px rgba(255, 255, 255, 0.55);
}

/* ---------- Content ---------- */
.custom-education-theme-octa-cat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-align: center;
    z-index: 3;
    pointer-events: none;
    width: 100%;
}

.custom-education-theme-octa-cat-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.25;
    text-align: center;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.25);
    transition: var(--transition);
}

.custom-education-theme-octa-cat-count {
    font-size: clamp(0.62rem, 0.85vw, 0.72rem);
    color: rgba(255, 255, 255, 0.85);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: var(--transition);
    font-weight: 600;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

    .custom-education-theme-octa-cat-count i {
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.85em;
    }

.custom-education-theme-octa-cat-item:hover .custom-education-theme-octa-cat-count {
    color: #fff;
}

/* ============ Responsive ============ */
@media (max-width: 1100px) {
    .custom-education-theme-octa-cat-item {
        flex: 0 1 280px;
        max-width: 340px;
    }
}

@media (max-width: 800px) {
    .custom-education-theme-octa-cat-grid {
        gap: 28px 18px;
    }

    .custom-education-theme-octa-cat-item {
        flex: 0 1 240px;
        max-width: 300px;
        min-width: 200px;
    }

    .custom-education-theme-octa-cat-shape {
        padding: 20%;
    }
}

@media (max-width: 480px) {
    .custom-education-theme-octa-cat {
        padding: 40px 16px;
    }

    .custom-education-theme-octa-cat-grid {
        gap: 28px;
    }

    .custom-education-theme-octa-cat-item {
        flex: 0 1 100%;
        max-width: 280px;
        min-width: 0;
    }

    .custom-education-theme-octa-cat-shape {
        padding: 22%;
    }

    .custom-education-theme-octa-cat-title {
        font-size: 1.2rem;
    }
}
