@font-face {
    font-family: "Poppins";
    src: url("../fonts/Poppins-Regular.ttf") format("truetype");
    font-weight: 400;
}
@font-face {
    font-family: "Poppins";
    src: url("../fonts/Poppins-Bold.ttf") format("truetype");
    font-weight: 700;
}
@font-face {
    font-family: "Poppins";
    src: url("../fonts/Poppins-Black.ttf") format("truetype");
    font-weight: 900;
}
@font-face {
    font-family: "IRANSans";
    src:
        url("../fonts/IRANSansWeb.woff2") format("woff2"),
        url("../fonts/IRANSansWeb.woff") format("woff"),
        url("../fonts/IRANSansWeb.ttf") format("truetype");
    font-weight: normal;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --accent: #ff5e00;
    --headline-gradient-end: #ff9e00;
    --bg: #0a0a0c;
    --panel: #121216;
    --panel-2: #19191f;
    --text: #ffffff;
    --muted: #a0a0ab;
    --border: rgba(255, 255, 255, 0.08);
    --soft-surface: rgba(255, 255, 255, 0.025);
    --success: #0bca51;
    --danger: #ef394e;
    --font: "Poppins", sans-serif;
}

[data-theme="light"] {
    --headline-gradient-end: #d77c00;
    --bg: #f4f4f7;
    --panel: #ffffff;
    --panel-2: #f0f0f4;
    --text: #0d0d11;
    --muted: #5e5e66;
    --border: rgba(0, 0, 0, 0.08);
    --soft-surface: rgba(0, 0, 0, 0.025);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(255, 94, 0, 0.12), transparent 34rem),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
}

[dir="rtl"] body,
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] p,
[dir="rtl"] a,
[dir="rtl"] span,
[dir="rtl"] button,
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select,
[dir="rtl"] option,
[dir="rtl"] label,
[dir="rtl"] figcaption,
[dir="rtl"] .blog-btn,
[dir="rtl"] .layout-toggle,
[dir="rtl"] .blog-actions a,
[dir="rtl"] .blog-theme-toggle,
[dir="rtl"] .blog-search,
[dir="rtl"] .blog-view-controls,
[dir="rtl"] .sort-control,
[dir="rtl"] .sort-control select,
[dir="rtl"] .keyword-pill,
[dir="rtl"] .keyword-suggestions,
[dir="rtl"] .feed-status,
[dir="rtl"] .blog-card,
[dir="rtl"] .blog-card-meta,
[dir="rtl"] .article-meta,
[dir="rtl"] .like-button,
[dir="rtl"] .empty-panel,
[dir="rtl"] .alert,
[dir="rtl"] .comment-form,
[dir="rtl"] .comments-panel,
[dir="rtl"] .comment-author,
[dir="rtl"] .comment-date,
[dir="rtl"] .replying-note {
    font-family: "IRANSans", Tahoma, sans-serif !important;
    letter-spacing: 0 !important;
}

[dir="rtl"] .blog-logo,
[dir="rtl"] .like-count,
[dir="rtl"] .blog-user-avatar {
    font-family: "Poppins", sans-serif;
}

a { color: inherit; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.blog-shell {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 56px;
}

.blog-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 42px;
}

.blog-logo {
    font-weight: 900;
    font-size: 1.45rem;
    text-decoration: none;
}

.blog-logo span { color: var(--accent); }

.blog-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.blog-user-dropdown {
    position: relative;
    z-index: 40;
}

.blog-user-trigger,
.blog-user-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 14px 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
    font: 700 0.82rem var(--font);
    cursor: pointer;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.blog-user-trigger:hover,
.blog-user-dropdown.open .blog-user-trigger,
.blog-user-login:hover {
    border-color: rgba(255, 94, 0, 0.72);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.15);
}

.blog-user-avatar,
.blog-user-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex: 0 0 28px;
}

.blog-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: #fff;
    font-weight: 900;
    line-height: 1;
}

.blog-user-avatar-img {
    object-fit: cover;
    display: block;
}

.blog-user-chevron {
    color: var(--muted);
    font-size: 0.78rem;
    transition: transform 0.16s ease;
}

.blog-user-dropdown.open .blog-user-chevron {
    transform: rotate(180deg);
}

.blog-user-menu {
    position: absolute;
    top: calc(100% + 9px);
    right: 0;
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel-2);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

[dir="rtl"] .blog-user-menu {
    right: auto;
    left: 0;
}

.blog-user-dropdown.open .blog-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.blog-user-menu a {
    display: block;
    padding: 10px 14px;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.blog-user-menu a.support-menu-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.support-nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
}

.blog-user-menu a:hover {
    background: rgba(255, 94, 0, 0.12);
    color: var(--text);
}

.blog-user-menu hr {
    border: 0;
    height: 1px;
    margin: 6px 4px;
    background: var(--border);
}

.blog-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    min-width: 92px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text);
    font: 700 0.82rem var(--font);
    box-shadow: none;
    cursor: pointer;
    transition: border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.blog-theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.15);
}

.blog-theme-icon {
    position: relative;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 94, 0, 0.14);
}

[data-theme="light"] .blog-theme-icon {
    background: #121216;
    box-shadow: inset -5px -4px 0 #f4f4f7, 0 0 0 4px rgba(255, 94, 0, 0.12);
}

.blog-actions a,
.blog-actions button,
.blog-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
    font: 700 0.78rem var(--font);
    cursor: pointer;
}

.blog-actions .blog-user-trigger,
.blog-actions .blog-user-login {
    padding: 7px 14px 7px 10px;
    background: var(--panel);
    font: 700 0.82rem var(--font);
}

.blog-actions .blog-user-menu a {
    display: block;
    min-height: auto;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: var(--muted);
    text-align: inherit;
    font-size: 0.82rem;
    font-weight: 700;
}

.blog-actions .blog-user-menu a:hover {
    background: rgba(255, 94, 0, 0.12);
    color: var(--text);
}

.blog-actions .blog-theme-toggle {
    min-width: 92px;
}

.layout-toggle {
    position: relative;
    min-width: 118px;
    min-height: 44px;
    gap: 10px;
    padding: 10px 16px 10px 14px;
    border: 1px solid rgba(255, 94, 0, 0.42);
    border-radius: 999px;
    background:
        linear-gradient(135deg, rgba(255, 94, 0, 0.18), rgba(255, 255, 255, 0.035)),
        rgba(18, 18, 22, 0.94);
    color: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    font-weight: 900;
    letter-spacing: 0.02em;
    white-space: nowrap;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.layout-toggle::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border-radius: 5px;
    background:
        linear-gradient(#fff 0 0) left 2px top 2px / 4px 14px no-repeat,
        linear-gradient(#fff 0 0) right 2px top 2px / 4px 14px no-repeat;
    opacity: 0.92;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.layout-toggle[aria-pressed="true"]::before {
    background:
        linear-gradient(#fff 0 0) left 2px top 2px / 5px 5px no-repeat,
        linear-gradient(#fff 0 0) right 2px top 2px / 5px 5px no-repeat,
        linear-gradient(#fff 0 0) left 2px bottom 2px / 5px 5px no-repeat,
        linear-gradient(#fff 0 0) right 2px bottom 2px / 5px 5px no-repeat;
}

.layout-toggle:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 94, 0, 0.72);
    background:
        linear-gradient(135deg, rgba(255, 94, 0, 0.28), rgba(255, 255, 255, 0.055)),
        rgba(24, 24, 30, 0.98);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34), 0 0 0 4px rgba(255, 94, 0, 0.08);
}

.layout-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 94, 0, 0.22), 0 16px 34px rgba(0, 0, 0, 0.34);
}

.layout-toggle:active {
    transform: translateY(0);
}

[dir="rtl"] .layout-toggle {
    padding: 10px 14px 10px 16px;
}

.blog-actions .lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    min-width: 42px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text);
    font: 700 0.82rem var(--font);
    cursor: pointer;
    transition: border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.blog-actions .lang-switch:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.15);
}

.blog-actions a.primary,
.blog-btn.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.blog-hero {
    display: grid;
    gap: 12px;
    margin-bottom: 28px;
}

.blog-kicker {
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.blog-hero h1 {
    max-width: 760px;
    font-size: clamp(2.2rem, 6vw, 5.2rem);
    line-height: 0.95;
    font-weight: 900;
}

.blog-hero h1,
.article-header h1 {
    background: linear-gradient(45deg, var(--accent), var(--headline-gradient-end));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

[dir="rtl"] .blog-hero h1 {
    line-height: 1.35;
    max-width: 820px;
}

.blog-hero p {
    max-width: 650px;
    color: var(--muted);
    line-height: 1.8;
    font-size: 1rem;
}

.blog-hero-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    max-width: 980px;
}

.blog-hero-row p {
    margin: 0;
}

.blog-hero-row .layout-toggle {
    flex: 0 0 auto;
}

.blog-discovery {
    display: grid;
    gap: 12px;
    margin: 0 0 18px;
}

.blog-discovery-row {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
}

.blog-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    flex: 1 1 620px;
    min-width: min(100%, 320px);
}

.blog-search input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font: 500 0.9rem var(--font);
    padding: 10px 13px;
    outline: none;
}

.blog-search input:focus {
    border-color: rgba(255, 94, 0, 0.72);
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.12);
}

.blog-search button {
    min-height: 44px;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font: 800 0.82rem var(--font);
    padding: 10px 16px;
    cursor: pointer;
}

.blog-view-controls {
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.sort-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted);
    font: 800 0.74rem var(--font);
}

.sort-control select {
    min-width: 138px;
    border: 0;
    background: var(--panel);
    color: var(--text);
    font: 800 0.78rem var(--font);
    outline: none;
    cursor: pointer;
    color-scheme: dark;
}

.sort-control option {
    background: var(--panel);
    color: var(--text);
    font-family: var(--font);
}

[data-theme="light"] .sort-control select {
    color-scheme: light;
}

[dir="rtl"] .sort-control option {
    font-family: "IRANSans", Tahoma, sans-serif;
}

.keyword-suggestions {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.keyword-suggestions > span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    padding-top: 6px;
}

.keyword-suggestions > div {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.active-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.active-filters a {
    color: var(--accent);
    text-decoration: none;
}

.blog-feed {
    display: grid;
    gap: 16px;
}

.blog-feed.layout-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.blog-feed.layout-column {
    grid-template-columns: 1fr;
}

.blog-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    transition: transform 0.18s ease, border-color 0.18s ease;
}

.blog-card-link {
    display: grid;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.blog-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 94, 0, 0.45);
}

.blog-card:hover .video-card-badge {
    animation: videoBadgePulse 1.15s ease-in-out infinite;
}

.blog-card-media {
    aspect-ratio: 1 / 1;
    background:
        linear-gradient(135deg, rgba(255, 94, 0, 0.22), rgba(255, 255, 255, 0.04)),
        var(--panel-2);
}

.blog-card-media img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.blog-card-media--fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(24px, 12%, 44px);
}

.blog-card-media--fallback img {
    object-fit: contain;
    opacity: 0.94;
    filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.22));
}

.video-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background:
        radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.26), transparent 28%),
        linear-gradient(135deg, rgba(255, 94, 0, 0.92), rgba(239, 57, 78, 0.9));
    color: #fff;
    pointer-events: none;
    backdrop-filter: blur(12px);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.3),
        0 0 0 5px rgba(10, 10, 12, 0.32);
}

.video-card-badge::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: inherit;
}

[dir="rtl"] .video-card-badge {
    right: 12px;
    left: auto;
}

.video-card-badge span {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid currentColor;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.24));
    transform: translate(-40%, -50%);
}

[dir="rtl"] .video-card-badge span {
    right: auto;
    left: 50%;
}

@keyframes videoBadgePulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 14px 30px rgba(0, 0, 0, 0.3),
            0 0 0 5px rgba(10, 10, 12, 0.32);
    }

    50% {
        transform: scale(1.08);
        box-shadow:
            0 18px 36px rgba(0, 0, 0, 0.36),
            0 0 0 9px rgba(255, 94, 0, 0.18);
    }
}

.blog-card-body {
    display: grid;
    align-content: start;
    gap: 11px;
    padding: 16px;
}

.layout-grid .blog-card-body {
    position: absolute;
    inset: auto 0 0;
    padding: 58px 14px 14px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0));
}

.layout-grid .blog-card-meta {
    color: rgba(255, 255, 255, 0.76);
}

.layout-grid .blog-card h2 {
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.layout-grid .blog-card p {
    display: none;
}

.layout-column {
    width: min(860px, 100%);
}

.layout-column .blog-card-link {
    grid-template-columns: minmax(210px, 34%) 1fr;
    min-height: 230px;
}

.layout-column .blog-card-media {
    aspect-ratio: auto;
    min-height: 230px;
}

.layout-column .blog-card-body {
    padding: 22px 64px 22px 22px;
}

[dir="rtl"] .layout-column .blog-card-body {
    padding: 22px 22px 22px 64px;
}

[dir="rtl"] .blog-actions {
    direction: rtl;
}

.blog-card-meta,
.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

[dir="rtl"] .blog-card-meta,
[dir="rtl"] .article-meta {
    justify-content: flex-start;
}

.blog-card h2 {
    font-size: 1.15rem;
    line-height: 1.35;
    font-weight: 900;
}

.blog-card p {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.75;
}

.blog-card-keywords,
.article-keywords {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.blog-card-keywords {
    position: relative;
    z-index: 6;
    padding: 0 14px 14px;
}

.layout-grid .blog-card-keywords {
    display: none;
}

.keyword-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid rgba(255, 94, 0, 0.28);
    border-radius: 999px;
    background: rgba(255, 94, 0, 0.08);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}

.keyword-pill:hover {
    border-color: rgba(255, 94, 0, 0.62);
    background: rgba(255, 94, 0, 0.14);
}

.like-button {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 58px;
    min-height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(10, 10, 12, 0.68);
    color: #fff;
    font: 900 0.78rem var(--font);
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

[dir="rtl"] .like-button {
    right: auto;
    left: 12px;
}

.like-button:hover {
    transform: scale(1.04);
    border-color: rgba(239, 57, 78, 0.5);
}

.like-button .heart {
    color: rgba(255, 255, 255, 0.75);
    font-size: 1.06rem;
    line-height: 1;
}

.like-button.liked {
    background: rgba(239, 57, 78, 0.92);
    border-color: rgba(239, 57, 78, 0.95);
}

.like-button.liked .heart {
    color: #fff;
}

.like-button.is-pending {
    opacity: 0.76;
    pointer-events: none;
}

.empty-panel,
.comment-form,
.comments-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    padding: 22px;
}

.empty-panel {
    color: var(--muted);
    text-align: center;
    line-height: 1.8;
}

.empty-panel.is-hidden {
    display: none;
}

.feed-status {
    min-height: 34px;
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-align: center;
}

.feed-status.is-visible {
    display: block;
}

.article {
    width: min(860px, 100%);
    margin: 0 auto;
}

.article-header {
    display: grid;
    gap: 14px;
    padding-top: 14px;
    margin-bottom: 26px;
}

.article-header h1 {
    font-size: clamp(1.9rem, 4.4vw, 3.8rem);
    line-height: 1.18;
    font-weight: 900;
    padding: 0.08em 0 0.12em;
    overflow: visible;
}

[dir="rtl"] .article-header h1 {
    line-height: 1.35;
}

.article-header p {
    color: var(--muted);
    line-height: 1.8;
    font-size: 1.02rem;
}

.article-keywords {
    margin-top: 4px;
}

.article-cover {
    overflow: hidden;
    margin: 26px 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
}

.article-cover img {
    width: 100%;
    display: block;
}

.article-body {
    display: grid;
    gap: 24px;
    margin: 32px 0 42px;
}

.related-posts {
    display: grid;
    gap: 16px;
    margin: 36px 0 34px;
}

.related-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}

.related-head h2 {
    margin-top: 6px;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1.4;
}

.related-feed.layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.related-feed .blog-card {
    min-height: 270px;
}

.article-paragraph {
    color: var(--text);
    font-size: 1.02rem;
    line-height: 2;
    text-align: justify;
    text-align-last: auto;
}

.article-citations {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    color: var(--text-muted);
    direction: ltr;
    text-align: left;
}

.article-citations h2 {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 1rem;
    font-weight: 900;
    text-align: center;
}

.article-citation-viewport {
    position: relative;
    max-height: 8.8rem;
    overflow: hidden;
}

.article-citations.is-expanded .article-citation-viewport {
    max-height: none;
}

.article-citations.is-collapsible:not(.is-expanded) .article-citation-viewport::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 3.2rem;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255,255,255,0), var(--card-bg, #fff));
}

html[data-theme="dark"] .article-citations.is-collapsible:not(.is-expanded) .article-citation-viewport::after {
    background: linear-gradient(to bottom, rgba(0,0,0,0), var(--card-bg, #111827));
}

.article-citation-list {
    margin: 0;
    padding-inline-start: 1.55rem;
    font-size: 0.88rem;
    line-height: 1.85;
    overflow-wrap: anywhere;
    direction: ltr;
    text-align: justify;
    text-align-last: auto;
    unicode-bidi: plaintext;
}

.article-citation-list li {
    padding-inline-start: 0.35rem;
    margin-bottom: 0.65rem;
}

.article-citation-list li::marker {
    color: var(--text);
    font-weight: 900;
}

.article-citations .article-link {
    text-decoration: none;
    text-underline-offset: 0;
}

.article-citations .article-link:hover {
    text-decoration: none;
}

.article-citation-toggle {
    display: block;
    width: fit-content;
    margin: 12px auto 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--input-bg);
    color: var(--accent);
    font: 800 0.78rem var(--font-en);
    padding: 8px 12px;
    cursor: pointer;
}

.article-citation-toggle:hover {
    border-color: var(--accent);
    color: var(--text);
}

.article-link {
    color: var(--accent);
    font-weight: 800;
    text-decoration: underline;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.22em;
}

.article-link:hover {
    color: var(--text);
}

.article-image {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
}

.article-image img {
    width: 100%;
    display: block;
}

.article-image figcaption {
    padding: 10px 14px;
    color: var(--muted);
    font-size: 0.78rem;
}

.article-video {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #050506;
}

.kaveh-video-player {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 94, 0, 0.12), transparent 42%),
        #050506;
}

.kaveh-video-player video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #050506;
    cursor: pointer;
}

.video-big-play {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 74px;
    height: 74px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    background: rgba(10, 10, 12, 0.72);
    color: #fff;
    cursor: pointer;
    transform: translate(-50%, -50%);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
    transition: transform 0.16s ease, opacity 0.16s ease, background 0.16s ease;
}

.video-big-play::before {
    content: "";
    position: absolute;
    left: 30px;
    top: 24px;
    width: 0;
    height: 0;
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
    border-left: 19px solid var(--accent);
}

.video-big-play:hover {
    transform: translate(-50%, -50%) scale(1.04);
    background: rgba(18, 18, 22, 0.86);
}

.kaveh-video-player.is-playing .video-big-play {
    opacity: 0;
    pointer-events: none;
}

.video-control-bar {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: grid;
    grid-template-columns: auto auto minmax(90px, 1fr) auto auto;
    grid-template-areas: "play time progress mute full";
    align-items: center;
    gap: 9px;
    padding: 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(8, 8, 10, 0.78);
    color: #fff;
    backdrop-filter: blur(16px);
}

[dir="rtl"] .video-control-bar {
    grid-template-areas: "full mute progress time play";
}

[dir="rtl"] .video-control-bar button,
[dir="rtl"] .video-time {
    direction: rtl;
}

[dir="rtl"] .video-time {
    flex-direction: row-reverse;
}

.video-play-toggle {
    grid-area: play;
}

.video-time {
    grid-area: time;
}

.video-progress {
    grid-area: progress;
}

.video-mute-toggle {
    grid-area: mute;
}

.video-fullscreen {
    grid-area: full;
}

.video-control-bar button {
    min-height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: 800 0.72rem var(--font);
    padding: 6px 9px;
    cursor: pointer;
}

.video-control-bar button:hover {
    border-color: rgba(255, 94, 0, 0.62);
    color: var(--accent);
}

.video-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.78);
    font: 800 0.72rem var(--font);
    white-space: nowrap;
}

.video-progress {
    --progress: 0%;
    width: 100%;
    accent-color: var(--accent);
    direction: ltr;
}

.video-progress::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(to right, var(--accent) var(--progress), rgba(255, 255, 255, 0.22) var(--progress));
}

.video-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    margin-top: -5px;
}

.video-progress::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.22);
}

.video-progress::-moz-range-progress {
    height: 6px;
    border-radius: 999px;
    background: var(--accent);
}

.article-video figcaption {
    padding: 10px 14px;
    background: var(--panel);
    color: var(--muted);
    font-size: 0.78rem;
}

.alert {
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
}

.alert-success {
    border: 1px solid rgba(11, 202, 81, 0.22);
    background: rgba(11, 202, 81, 0.1);
    color: var(--success);
}

.alert-error {
    border: 1px solid rgba(239, 57, 78, 0.22);
    background: rgba(239, 57, 78, 0.1);
    color: var(--danger);
}

.comments-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.comments-title h2 {
    font-size: 1.2rem;
    font-weight: 900;
}

.comment-list {
    display: grid;
    gap: 12px;
}

.comment {
    border-left: 2px solid rgba(255, 94, 0, 0.42);
    padding-left: 14px;
}

.comment + .comment { margin-top: 10px; }

.comment-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft-surface);
    padding: 14px;
}

.comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 900;
    font-size: 0.86rem;
}

.comment-date {
    color: var(--muted);
    font-size: 0.72rem;
}

.comment p {
    color: var(--text);
    line-height: 1.7;
    font-size: 0.88rem;
}

.comment-reply {
    margin-top: 10px;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: 700 0.76rem var(--font);
    cursor: pointer;
}

.comment-children {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    margin-left: 18px;
}

.comment-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.comment-form h3 {
    font-size: 1rem;
    font-weight: 900;
}

.replying-note {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid rgba(255, 94, 0, 0.25);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 94, 0, 0.08);
    font-size: 0.8rem;
}

.replying-note.on { display: flex; }

.replying-note button {
    border: 0;
    background: transparent;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.form-field {
    display: grid;
    gap: 5px;
}

.form-field.full { grid-column: 1 / -1; }

.form-field label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.form-field input,
.form-field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-2);
    color: var(--text);
    font: 400 0.88rem var(--font);
    padding: 10px 12px;
    outline: none;
}

.form-field textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.7;
}

.form-field input:focus,
.form-field textarea:focus {
    border-color: var(--accent);
}

@media (max-width: 980px) {
    .blog-topbar {
        align-items: flex-start;
        flex-direction: column;
    }
    .blog-actions {
        width: 100%;
    }
    .blog-discovery-row {
        align-items: stretch;
        flex-direction: column;
    }
    .blog-search {
        flex-basis: auto;
    }
    .blog-view-controls {
        justify-content: space-between;
    }
    .blog-feed.layout-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    }
}

@media (max-width: 720px) {
    .blog-topbar,
    .blog-hero-row,
    .comments-title {
        align-items: flex-start;
        flex-direction: column;
    }
    .blog-shell {
        width: min(100% - 20px, 1120px);
        padding-top: 16px;
    }
    .blog-actions a,
    .blog-actions button,
    .blog-btn {
        min-height: 36px;
        padding: 8px 11px;
        font-size: 0.72rem;
    }
    .blog-search {
        grid-template-columns: 1fr;
    }
    .blog-search button {
        width: 100%;
    }
    .blog-view-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }
    .sort-control {
        justify-content: space-between;
    }
    .sort-control select {
        min-width: 0;
        width: 100%;
    }
    .keyword-suggestions {
        gap: 8px;
    }
    .keyword-suggestions > span {
        width: 100%;
    }
    .blog-hero h1,
    .article-header h1 {
        font-size: clamp(2rem, 12vw, 3.4rem);
    }
    .blog-feed.layout-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .layout-grid .blog-card-body {
        padding: 46px 10px 10px;
    }
    .layout-grid .blog-card-meta {
        font-size: 0.62rem;
        gap: 6px;
    }
    .layout-grid .blog-card h2 {
        font-size: 0.86rem;
    }
    .layout-column .blog-card-link {
        grid-template-columns: 1fr;
    }
    .layout-column .blog-card-media {
        aspect-ratio: 1 / 1;
        min-height: 0;
    }
    .layout-column .blog-card-body,
    [dir="rtl"] .layout-column .blog-card-body {
        padding: 16px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .video-control-bar {
        grid-template-columns: auto minmax(80px, 1fr) auto;
        grid-template-areas: "play progress mute";
    }
    [dir="rtl"] .video-control-bar {
        grid-template-areas: "mute progress play";
    }
    .video-time,
    .video-fullscreen {
        display: none;
    }
    .comment-children {
        margin-left: 8px;
    }
}

@media (max-width: 460px) {
    .blog-logo {
        font-size: 1.2rem;
    }
    .blog-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }
    .blog-actions > a,
    .blog-actions > button,
    .blog-actions > .blog-user-dropdown,
    .blog-actions > .blog-user-login {
        width: 100%;
    }
    .blog-user-trigger,
    .blog-user-login,
    .blog-theme-toggle {
        width: 100%;
    }
    .blog-user-name {
        max-width: 74px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .layout-toggle {
        width: 100%;
    }
    .blog-view-controls {
        grid-template-columns: 1fr;
    }
    .blog-feed.layout-grid {
        grid-template-columns: 1fr;
    }
    .layout-grid .blog-card-body {
        padding: 70px 14px 14px;
    }
    .layout-grid .blog-card h2 {
        font-size: 1.05rem;
    }
    .article-body {
        gap: 18px;
    }
    .article-paragraph {
        font-size: 0.96rem;
        line-height: 1.9;
    }
    .video-big-play {
        width: 60px;
        height: 60px;
    }
    .video-big-play::before {
        left: 24px;
        top: 19px;
    }
    .video-control-bar {
        left: 8px;
        right: 8px;
        bottom: 8px;
        gap: 6px;
        padding: 7px;
    }
    .video-control-bar button {
        min-height: 30px;
        padding: 5px 7px;
        font-size: 0.66rem;
    }
    .comment-form,
    .comments-panel,
    .empty-panel {
        padding: 16px;
    }
}
