.mag-page {
    --mag-ink: #1c1917;
    --mag-muted: #57534e;
    --mag-paper: #f6f1ea;
    --mag-card: #fffdfb;
    --mag-line: #e7ddd0;
    --mag-accent: #9a3412;
    --mag-accent-dark: #7c2d12;
    color: var(--mag-ink);
    font-family: IRANSans-web, Tahoma, sans-serif;
    font-size: 17px;
    line-height: 1.9;
    background:
        radial-gradient(circle at 100% 0, rgba(196, 165, 116, 0.18), transparent 28rem),
        var(--mag-paper);
    padding: 36px 0 64px;
}

.mag-page a { color: inherit; }

.mag-wrap {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.mag-hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 2rem;
}

.mag-kicker {
    color: var(--mag-accent);
    font-size: 16px;
    margin-bottom: 10px;
}

.mag-hero h1,
.mag-article h1 {
    font-size: 34px;
    line-height: 1.45;
    margin: 0 0 14px;
    color: var(--mag-ink);
}

.mag-lead {
    color: var(--mag-muted);
    font-size: 18px;
    line-height: 1.9;
    margin: 0;
    max-width: 40rem;
}

.mag-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.2rem;
}

.mag-cats a,
.mag-tag {
    border: 1px solid var(--mag-line);
    background: var(--mag-card);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 15px;
    line-height: 1.6;
    text-decoration: none;
}

.mag-cats a.is-active,
.mag-cats a:hover {
    background: var(--mag-ink);
    color: #fff;
    border-color: var(--mag-ink);
}

.mag-feature {
    display: block;
    background: var(--mag-card);
    border-radius: 1.4rem;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 16px 40px rgba(60, 40, 20, 0.08);
    min-height: 100%;
}

.mag-feature img,
.mag-card img,
.mag-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mag-media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #efe6da;
    overflow: hidden;
}
.mag-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.mag-feature .mag-copy { padding: 18px 20px 22px; }
.mag-feature strong { display: block; font-size: 22px; line-height: 1.7; }

.mag-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.mag-card {
    display: flex;
    flex-direction: column;
    background: var(--mag-card);
    border: 1px solid var(--mag-line);
    border-radius: 1.2rem;
    overflow: hidden;
    text-decoration: none;
    min-height: 100%;
}

.mag-card .mag-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.mag-card h2 { font-size: 20px; line-height: 1.7; margin: 0; color: var(--mag-ink); }
.mag-card p {
    color: var(--mag-muted);
    margin: 0;
    line-height: 1.85;
    font-size: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.mag-meta { color: var(--mag-muted); font-size: 14px; line-height: 1.6; margin-top: auto; }

.mag-empty {
    background: var(--mag-card);
    border: 1px dashed var(--mag-line);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
}

.mag-pager {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

.mag-pager a {
    text-decoration: none;
    background: var(--mag-ink);
    color: #fff;
    border-radius: 999px;
    padding: 0.55rem 1rem;
}

.mag-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--mag-muted);
    font-size: 15px;
    margin-bottom: 16px;
}

.mag-crumbs a { text-decoration: none; }

.mag-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.5rem;
    align-items: start;
}

.mag-article {
    background: var(--mag-card);
    border: 1px solid var(--mag-line);
    border-radius: 1.4rem;
    overflow: hidden;
}

.mag-cover { aspect-ratio: 16 / 9; max-height: 460px; background: #efe6da; overflow: hidden; }
.mag-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mag-article-body { padding: 28px 32px 36px; }
.mag-article h1 { font-size: 32px; }
.mag-excerpt { font-size: 19px; line-height: 1.9; color: #44403c; }
.mag-content { font-size: 18px; line-height: 2.05; }
.mag-content h2 { font-size: 26px; line-height: 1.6; margin: 28px 0 10px; }
.mag-content h3, .mag-content h4, .mag-content h5, .mag-content h6 { font-size: 21px; line-height: 1.6; margin: 20px 0 8px; }
.mag-content p { margin: 0 0 1rem; }
.mag-content ul, .mag-content ol { padding-right: 1.2rem; }
.mag-content a { color: var(--mag-accent-dark); }

.mag-side, .mag-product, .mag-related a, .mag-comment {
    background: var(--mag-card);
    border: 1px solid var(--mag-line);
    border-radius: 1rem;
}

.mag-side, .mag-product { padding: 1rem; }
.mag-side h2, .mag-related h2, .mag-comments h2 { font-size: 20px; margin: 0 0 12px; }
.mag-side a { display: block; text-decoration: none; padding: 10px 0; border-bottom: 1px solid var(--mag-line); font-size: 16px; line-height: 1.7; }
.mag-product { margin-top: 1rem; }
.mag-product a.mag-buy {
    display: inline-block;
    margin-top: 0.8rem;
    background: var(--mag-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    padding: 0.55rem 1rem;
}

.mag-related { margin-top: 1.4rem; }
.mag-related-grid { display: grid; gap: 0.7rem; }
.mag-related a { display: block; padding: 14px 16px; text-decoration: none; font-size: 17px; line-height: 1.7; }

.mag-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.mag-comments { margin-top: 1.5rem; }
.mag-comment { padding: 0.9rem 1rem; margin-bottom: 0.6rem; }
.mag-form { display: grid; gap: 0.6rem; margin-top: 0.8rem; }
.mag-form input, .mag-form textarea {
    width: 100%;
    border: 1px solid var(--mag-line);
    border-radius: 0.8rem;
    padding: 0.7rem 0.8rem;
    font: inherit;
    background: #fff;
}
.mag-form button, .mag-preview-bar a {
    border: 0;
    background: var(--mag-ink);
    color: #fff;
    border-radius: 999px;
    padding: 0.65rem 1.1rem;
    text-decoration: none;
}

.mag-preview-bar {
    background: #7c2d12;
    color: #fff;
    padding: 0.7rem 1rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.mag-json { display: none; }

@media (max-width: 900px) {
    .mag-hero, .mag-layout, .mag-grid { grid-template-columns: 1fr; }
    .mag-hero h1, .mag-article h1 { font-size: 28px; }
    .mag-article-body { padding: 20px 18px 28px; }
    .mag-content { font-size: 17px; }
}
