:root {
    --bg: #f7f7fb;
    --card-bg: #ffffff;
    --muted: #6b7280;
    --radius: 12px;
    --gap: 1.25rem;
    --max-width: 1200px;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    direction: rtl;
}

.container {
    max-width: var(--max-width);
    margin: 2rem auto;
    padding: 0 1rem;
}

.page-title {
    margin: 0 0 1rem;
    font-size: 1.6rem;
    text-align: right;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap);
    align-items: stretch;
}

@media(max-width:991px) {
    .posts-grid {
        grid-template-columns: repeat(1, 1fr);

    }
}


.post-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(16, 24, 40, 0.06);
    transition: transform .18s ease, box-shadow .18s ease;
    border: 1px solid rgba(15, 23, 42, 0.04);
    min-height: 320px;
}

.post-card__media {
    width: 100%;
    padding-top: 56.25%;
    background-position: center;
    background-size: cover;
}

.post-card__body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.post-card__title {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.25;
    text-align: right;
}

.post-card__excerpt {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.4;
    text-align: right;
    margin-top: 0.25rem;
    flex: 1;
}

.post-card__time {
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.5rem;
    text-align: right;
}

.post-card:hover,
.post-card:focus {
    transform: translateY(-6px);
    box-shadow: 0 14px 40px rgba(16, 24, 40, 0.12);
    outline: none;
}

.post-card:focus {
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Responsive tweaks */
@media (max-width:520px) {
    .container {
        margin: 1rem auto
    }

    .page-title {
        font-size: 1.25rem
    }

    .post-card {
        min-height: 280px
    }
}



/* detail blog */

.blog-layout {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 15px;
    align-items: start;
}

@media(max-width:991px) {
    .blog-layout {
        grid-template-columns: 1fr;

    }
}

.main-article {
    padding: 30px;
    box-shadow: 0 20px 40px rgba(16, 24, 40, 0.12);
    border-radius: 20px;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    -ms-border-radius: 20px;
    -o-border-radius: 20px;
    margin-bottom: 20px;
}

.main-article .main-img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    border-radius: 10px;
    /* margin-bottom: 20px; */
}

.article-title {
    font-size: 24px;
    margin-bottom: 15px;
}

.article-content {
    line-height: 1.8;
    color: #555;
    font-size: 15px;
    text-align: justify;
}

.sidebar_main {
    background-color: #fff;
    box-shadow: 0 20px 40px rgba(16, 24, 40, 0.12);
    padding: 10px;
    border-radius: 20px;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    -ms-border-radius: 20px;
    -o-border-radius: 20px;
}

.sidebar_main h3 {
    margin-bottom: 20px;
    font-size: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}

.related-article {
    display: flex;
    /* align-items: center; */
    gap: 10px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: 0.3s;
}

.related-article:hover {
    transform: translateX(-5px);
    -webkit-transform: translateX(-5px);
    -moz-transform: translateX(-5px);
    -ms-transform: translateX(-5px);
    -o-transform: translateX(-5px);
}

.related-article img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.related-article h4 {
    font-size: 14px;
    color: #333;
    padding: 0;
    margin: 0;
}

/* course */

.course-detail {
    margin: 0 auto;
    background: #fff;
    /* border-radius: 24px; */
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.course-header {
    position: relative;
    overflow: hidden;
}

.course-header img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.course-header:hover img {
    transform: scale(1.05);
}

.course-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to top, #4B6566, transparent);
}

.course-content {
    padding: 50px 60px;
}

.course-badge {
    display: inline-block;
    background: #4B6566;
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.course-title {
    font-size: 36px;
    margin-bottom: 25px;
    color: #1a202c;
    font-weight: 800;
    line-height: 1.3;
    background: #4B6566;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.course-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 15px;
}

.meta-icon {
    font-size: 18px;
    color: #4B6566;
}

.course-description {
    font-size: 18px;
    line-height: 2;
    color: #4B6566;
    margin-bottom: 30px;
}

.course-description ul {
    margin: 25px 0;
    padding-right: 25px;
}

.course-description li {
    margin-bottom: 15px;
    color: #4B6566;
    font-size: 17px;
    position: relative;
    padding-right: 15px;
}

.course-description li::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: -10px;
    color: #4B6566;
    font-size: 16px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.back-btn,
.enroll-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    text-decoration: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.back-btn {
    background-color: #f1f5f9;
    color: #475569;
}

.back-btn:hover {
    background-color: #e2e8f0;
    transform: translateX(5px);
}

.enroll-btn {
    background: #4B6566;
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.enroll-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.course-highlights {
    background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);
    padding: 30px;
    border-radius: 16px;
    margin-top: 30px;
}

.highlights-title {
    font-size: 22px;
    font-weight: 700;
    color: #4B6566;
    margin-bottom: 20px;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.highlight-item {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.highlight-icon {
    font-size: 32px;
    margin-bottom: 10px;
    color: #4B6566;
}

.highlight-text {
    font-size: 15px;
    color: #4B6566;
    font-weight: 600;
}

@media (max-width: 768px) {
    .course-content {
        padding: 30px 25px;
    }

    .course-title {
        font-size: 28px;
    }

    .course-description {
        font-size: 16px;
    }

    .course-header img {
        height: 300px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .back-btn,
    .enroll-btn {
        width: 100%;
        justify-content: center;
    }
}

.course-header {
    position: relative;
}