/* ============================================================
   Topics / Education Page — Negin Gostaran
   Theme: navy #0B3954 + red #C81D25, glass cards, RTL
============================================================ */

@keyframes tFadeUp {
    from {
        opacity: 0;
        transform: translateY(22px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes tCardIn {
    from {
        opacity: 0;
        transform: translateY(28px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tDot {
    0%,100% {
        transform: scale(1);
        opacity: .7;
    }

    50% {
        transform: scale(1.5);
        opacity: 1;
    }
}

@keyframes tShimmer {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }

    100% {
        transform: translateX(300%) skewX(-15deg);
    }
}

.topics-page {
    direction: rtl;
    font-family: 'IRANSansX', 'IRANSans', Tahoma, sans-serif;
    background: linear-gradient(180deg, #F3FAFF 0%, #ffffff 60%);
    padding: 72px 0 96px;
    color: #0B3954;
}

.topics-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Hero ---------- */
.topics-hero {
    text-align: center;
    margin-bottom: 56px;
    animation: tFadeUp .7s ease both;
}

    .topics-hero .eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 8px 18px;
        border-radius: 999px;
        background: rgba(200, 29, 37, .08);
        color: #C81D25;
        font-size: 13px;
        font-weight: 700;
        margin-bottom: 18px;
        border: 1px solid rgba(200, 29, 37, .18);
    }

        .topics-hero .eyebrow::before {
            content: "";
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #C81D25;
            box-shadow: 0 0 0 4px rgba(200, 29, 37, .18);
            animation: tDot 1.8s ease-in-out infinite;
        }

    .topics-hero h1 {
        font-size: clamp(28px, 4vw, 44px);
        font-weight: 900;
        color: #0B3954;
        margin: 0 0 18px;
        line-height: 1.3;
        letter-spacing: -.5px;
    }

        .topics-hero h1::after {
            content: "";
            display: block;
            width: 80px;
            height: 4px;
            margin: 18px auto 0;
            border-radius: 4px;
            background: linear-gradient(90deg, #C81D25, #1A6CA0);
        }

    .topics-hero p {
        max-width: 720px;
        margin: 0 auto;
        color: #5a7a8e;
        font-size: 17px;
        line-height: 1.9;
    }

/* ---------- Grid ---------- */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 28px;
    margin-top: 24px;
}

/* ---------- Card ---------- */
.topic-card {
    position: relative;
    background: #fff;
    border: 1px solid rgba(11, 57, 84, .10);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(11, 57, 84, .08), 0 2px 8px rgba(11, 57, 84, .05), inset 0 1px 0 rgba(255, 255, 255, .9);
    transition: transform .45s cubic-bezier(.34,1.56,.64,1), box-shadow .45s ease, border-color .45s ease;
    display: flex;
    flex-direction: column;
    animation: tCardIn .6s ease both;
}

    .topic-card:hover {
        transform: translateY(-8px);
        border-color: rgba(200, 29, 37, .30);
        box-shadow: 0 24px 48px rgba(11, 57, 84, .14), 0 6px 16px rgba(200, 29, 37, .10);
    }

    /* image */
    .topic-card .thumb {
        position: relative;
        display: block;
        aspect-ratio: 16 / 10;
        overflow: hidden;
        background: #F3FAFF;
    }

        .topic-card .thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform .8s ease;
        }

    .topic-card:hover .thumb img {
        transform: scale(1.08);
    }

    .topic-card .thumb::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, transparent 55%, rgba(11, 57, 84, .55) 100%);
        pointer-events: none;
    }

    .topic-card .badge {
        position: absolute;
        top: 14px;
        right: 14px;
        background: rgba(255, 255, 255, .95);
        color: #C81D25;
        font-size: 12px;
        font-weight: 800;
        padding: 6px 12px;
        border-radius: 999px;
        backdrop-filter: blur(8px);
        box-shadow: 0 4px 12px rgba(11, 57, 84, .15);
        z-index: 2;
    }

    /* body */
    .topic-card .body {
        padding: 22px 22px 20px;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

        .topic-card .body h3 {
            margin: 0 0 10px;
            font-size: 18px;
            font-weight: 800;
            line-height: 1.6;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

            .topic-card .body h3 a {
                color: #0B3954;
                text-decoration: none;
                transition: color .3s ease;
            }

    .topic-card:hover .body h3 a {
        color: #C81D25;
    }

    .topic-card .excerpt {
        color: #5a7a8e;
        font-size: 14px;
        line-height: 1.85;
        margin: 0 0 18px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        flex: 1;
    }

    /* CTA */
    .topic-card .cta {
        align-self: flex-start;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 11px 22px;
        background: linear-gradient(135deg, #C81D25, #a8181f);
        color: #fff;
        text-decoration: none;
        font-weight: 700;
        font-size: 14px;
        border-radius: 14px;
        transition: transform .35s ease, box-shadow .35s ease;
        box-shadow: 0 6px 18px rgba(200, 29, 37, .28);
        position: relative;
        overflow: hidden;
    }

        .topic-card .cta::after {
            content: "←";
            font-size: 16px;
            transition: transform .35s ease;
        }

        .topic-card .cta:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 28px rgba(200, 29, 37, .45);
            color: #fff;
        }

            .topic-card .cta:hover::after {
                transform: translateX(-4px);
            }

        .topic-card .cta::before {
            content: "";
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,.4), transparent);
            transform: translateX(-100%) skewX(-15deg);
        }

    .topic-card:hover .cta::before {
        animation: tShimmer .9s ease;
    }

/* ---------- Tags ---------- */
.topics-tags {
    margin-top: 64px;
    padding: 28px;
    background: #fff;
    border: 1px solid rgba(11, 57, 84, .10);
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(11, 57, 84, .05);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

    .topics-tags .tags-title {
        font-weight: 800;
        color: #0B3954;
        margin-left: 8px;
        font-size: 14px;
    }

.tag-chip {
    display: inline-block;
    padding: 7px 14px;
    background: rgba(11, 57, 84, .05);
    color: #0B3954;
    border: 1px solid rgba(11, 57, 84, .12);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all .3s ease;
}

    .tag-chip:hover {
        background: #C81D25;
        color: #fff;
        border-color: #C81D25;
        transform: translateY(-2px);
        box-shadow: 0 6px 14px rgba(200, 29, 37, .3);
    }

/* ---------- Staggered entrance ---------- */
.topic-card:nth-child(1) {
    animation-delay: .05s;
}

.topic-card:nth-child(2) {
    animation-delay: .12s;
}

.topic-card:nth-child(3) {
    animation-delay: .19s;
}

.topic-card:nth-child(4) {
    animation-delay: .26s;
}

.topic-card:nth-child(5) {
    animation-delay: .33s;
}

.topic-card:nth-child(6) {
    animation-delay: .40s;
}

.topic-card:nth-child(7) {
    animation-delay: .47s;
}

.topic-card:nth-child(8) {
    animation-delay: .54s;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .topics-page {
        padding: 48px 0 64px;
    }

    .topics-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .topics-hero {
        margin-bottom: 36px;
    }
}
