@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

/* ============================================
   ROOT VARIABLES — Light mode
   ============================================ */
:root {
    --bg: #f8fafb;
    --surface: #ffffff;
    --surface2: #f3f7fb;
    --surface3: #e8f0f8;
    --text: #0f1419;
    --secondary: #4b5563;
    --muted: #7a8591;
    --line: #d4dce3;
    --accent: #0891b2;
    --accent2: #4ade80;
    --accent-dark: #0e7490;
    --shadow-sm: 0 4px 12px rgba(15, 20, 25, 0.06);
    --shadow: 0 18px 55px rgba(15, 20, 25, 0.1);
    --shadow-lg: 0 25px 60px rgba(15, 20, 25, 0.2);
}

/* ============================================
   DARK MODE
   ============================================ */
.site-shell.is-dark {
    --bg: #0a0e14;
    --surface: #10161e;
    --surface2: #18212b;
    --surface3: #23303c;
    --text: #e8f0f7;
    --secondary: #b4c0ca;
    --muted: #82909b;
    --line: #273441;
    --accent: #22b8d2;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow: 0 18px 55px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.6);
}

/* ============================================
   BASE
   ============================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Vazirmatn, Tahoma, Arial, sans-serif;
    line-height: 1.8;
    transition: background 0.25s ease, color 0.25s ease;
}

a, a:visited {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
}

.container {
    max-width: 1160px;
    margin: auto;
    padding-inline: 24px;
}

/* ============================================
   TOPBAR / NAVIGATION
   ============================================ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.nav {
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--text);
    font-size: 21px;
    font-weight: 800;
}

.logo b,
.dialog-mark {
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    border-radius: 12px;
    width: 35px;
    height: 35px;
}

.logo span span {
    color: var(--accent);
}

.desktop-nav {
    display: flex;
    gap: 30px;
}

.desktop-nav a {
    color: var(--muted);
    font-size: 14px;
    transition: color 0.2s;
}

.desktop-nav a:hover {
    color: var(--accent);
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon,
.menu-btn {
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 22px;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.icon:hover,
.menu-btn:hover {
    background: var(--surface2);
}

.login,
.outline,
.outline-btn {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    border-radius: 10px;
    padding: 9px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.outline:hover,
.outline-btn:hover,
.login:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.primary {
    display: inline-block;
    border: 0;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 8px 18px rgba(8, 145, 178, 0.35);
    transition: all 0.2s;
}

.primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(8, 145, 178, 0.4);
}

.full {
    width: 100%;
    margin-top: 12px;
}

/* ============================================
   HERO — Home page
   ============================================ */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    padding: 76px 24px 90px;
}

.eyebrow,
.section-head small,
.publish small {
    color: var(--accent);
    font-weight: 700;
    font-size: 13px;
}

.hero h1 {
    font-size: 56px;
    line-height: 1.35;
    margin: 18px 0;
}

.hero h1 i {
    font-style: normal;
    color: var(--accent);
}

.hero p {
    max-width: 500px;
    color: var(--secondary);
    font-size: 17px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 25px;
    flex-wrap: wrap;
}

.text-link {
    color: var(--accent);
    font-weight: 600;
}

.trust {
    font-size: 12px !important;
    color: var(--muted) !important;
    margin-top: 32px;
}

.trust b {
    color: var(--accent);
}

/* --- Hero Image --- */
.hero-art {
    position: relative;
}

.hero-art img {
    width: 100%;
    aspect-ratio: 4 / 5;
    max-height: 480px;
    object-fit: cover;
    object-position: center;
    border-radius: 28px;
    box-shadow: var(--shadow-lg);
    display: block;
}

/* --- Audio Note Badge --- */
.audio-note {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    padding: 12px 18px;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(15, 20, 25, 0.18);
    max-width: calc(100% - 40px);
    backdrop-filter: blur(8px);
}

.audio-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.audio-text {
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    min-width: 0;
}

.audio-text b {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.audio-text small {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    padding: 35px 24px 80px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 25px;
    gap: 20px;
}

.section-head h2,
.split-page h2,
.about-page h2,
.publish h2 {
    font-size: 28px;
    margin: 5px 0;
}

.section-lead {
    color: var(--secondary);
    margin: 6px 0;
}

/* ============================================
   STORY CARDS — Grid
   ============================================ */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.card-link {
    display: block;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-link > img,
.card-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
    background: linear-gradient(135deg, #0891b2, #155e75);
    transition: transform 0.5s ease;
    border-radius: 0;
}

.card:hover .card-link > img,
.card:hover .card-img {
    transform: scale(1.04);
}

.card > img {
    width: 100%;
    aspect-ratio: 16 / 10;
    height: auto;
    object-fit: cover;
    display: block;
}

.card-content {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tag {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.card h3 {
    font-size: 17px;
    line-height: 1.5;
    margin: 8px 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 51px;
}

.card p {
    font-size: 13px;
    color: var(--secondary);
    margin: 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 42px;
}

.meta,
.card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 11px;
    margin-top: auto;
}

.card-foot {
    border-top: 1px solid var(--line);
    padding-top: 13px;
    margin-top: 12px;
}

.card-actions {
    display: flex;
    gap: 5px;
    align-items: center;
}

.like,
.save,
.play {
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 4px 6px;
    cursor: pointer;
    font-family: inherit;
    border-radius: 6px;
    transition: all 0.2s;
}

.like:hover,
.save:hover {
    background: var(--surface2);
    color: var(--accent);
}

.like.liked {
    color: #ef4444;
}

.play {
    color: var(--accent);
}

/* ============================================
   SPLIT PAGE — Community
   ============================================ */
.split-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    min-height: 460px;
}

.community-list {
    display: grid;
    gap: 13px;
}

.community-item {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 15px;
    transition: border-color 0.2s;
}

.community-item:hover {
    border-color: var(--accent);
}

.community-item b,
.community-item span,
.community-item strong {
    display: block;
}

.community-item span {
    color: var(--muted);
    font-size: 13px;
}

.community-item strong {
    color: var(--accent);
    font-size: 12px;
    margin-top: 8px;
}

/* ============================================
   STATS / VALUES
   ============================================ */
.stats,
.values {
    display: flex;
    gap: 18px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.stats div,
.values article {
    flex: 1;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 20px;
}

.stats b {
    display: block;
    font-size: 26px;
    color: var(--accent);
}

.stats span {
    font-size: 12px;
    color: var(--muted);
}

.values article b {
    color: var(--accent);
}

.values article p {
    font-size: 13px;
    margin: 6px 0 0;
}

/* ============================================
   PUBLISH BANNER
   ============================================ */
.publish {
    display: flex;
    align-items: center;
    gap: 22px;
    background: var(--surface2);
    border-radius: 22px;
    padding: 28px;
    margin: 0 auto 70px;
    max-width: 1160px;
    flex-wrap: wrap;
}

.publish > div:nth-child(2) {
    flex: 1;
    min-width: 200px;
}

.publish p,
.split-page p,
.about-page > p {
    color: var(--secondary);
    margin: 0;
}

.pen {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: var(--accent);
    color: #fff;
    font-size: 27px;
    flex-shrink: 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    border-top: 1px solid var(--line);
    padding: 45px 24px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 2fr;
    gap: 30px;
    max-width: 1160px;
    margin: auto;
}

.footer > div:not(:first-child) {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer > div b {
    margin-bottom: 8px;
}

.footer a {
    color: var(--muted);
    font-size: 14px;
    display: block;
    margin-top: 8px;
    width: fit-content;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--accent);
}

.footer p {
    color: var(--muted);
    font-size: 13px;
}

.footer-note {
    align-self: end;
}

/* ============================================
   AUTH PAGES — Login / Signup
   ============================================ */
.auth-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 5rem;
    align-items: center;
    min-height: calc(100vh - 90px);
    padding: 4rem 24px;
}

.auth-intro h1 {
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: 1.18;
    max-width: 650px;
    margin: 1rem 0;
}

.auth-intro p {
    font-size: 1.15rem;
    max-width: 520px;
    color: var(--muted);
    line-height: 2;
}

.auth-perks {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2.5rem;
}

.auth-perks span {
    padding: 0.7rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
}

.account-card {
    position: relative;
    z-index: 1;
    width: min(100%, 470px);
    padding: 42px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 20px 70px rgba(25, 44, 53, 0.12);
    text-align: center;
}

.auth-card {
    box-shadow: 0 20px 70px rgba(25, 44, 53, 0.12);
}

.account-card .dialog-mark {
    width: 54px;
    height: 54px;
    margin: 0 auto 18px;
    border-radius: 17px;
    font-size: 24px;
}

.account-card h2 {
    font-size: 27px;
    margin: 0 0 8px;
}

.account-card > p {
    color: var(--muted);
    font-size: 14px;
    max-width: 330px;
    margin: 0 auto 26px;
}

.account-card label {
    display: block;
    text-align: right;
    color: var(--secondary);
    font-size: 13px;
    font-weight: 600;
    margin-top: 16px;
}

.account-card input {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface2);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.account-card input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.auth-tabs {
    display: flex;
    gap: 6px;
    padding: 5px;
    background: var(--surface2);
    border-radius: 13px;
    margin-bottom: 20px;
}

.auth-tabs button,
.auth-tabs a {
    flex: 1;
    border: 0;
    background: transparent;
    color: var(--muted);
    font: inherit;
    padding: 9px;
    border-radius: 9px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.auth-tabs button.active {
    background: var(--surface);
    color: var(--accent);
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(15, 20, 25, 0.07);
}

.forgot {
    border: 0;
    background: transparent;
    color: var(--accent);
    font-size: 12px;
    margin-top: 17px;
    cursor: pointer;
}

.auth-note {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.8;
    margin-top: 20px;
}

/* ============================================
   DASHBOARD
   ============================================ */
.dashboard {
    padding: 3rem 24px 6rem;
}

.dashboard-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 2rem;
    padding: 3rem;
    border-radius: 28px;
    background: linear-gradient(135deg, #0f1419, #315768);
    color: #fff;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.dashboard-hero h1 {
    font-size: 3rem;
    margin: 0.5rem 0;
}

.dashboard-hero p {
    color: #d7e7e9;
}

.button-link {
    display: inline-flex;
    white-space: nowrap;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.dashboard-sidebar,
.panel,
.stats-row article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
}

.dashboard-sidebar {
    padding: 1.2rem;
    height: max-content;
}

.profile-mini {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    padding: 0.7rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1rem;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--accent2);
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    font-weight: 800;
    color: #0f1419;
    flex-shrink: 0;
}

.profile-mini small {
    display: block;
    color: var(--muted);
    margin-top: 0.2rem;
}

.dashboard-menu {
    display: grid;
    gap: 0.35rem;
}

.dashboard-menu a {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: var(--muted);
    transition: all 0.2s;
}

.dashboard-menu a.active,
.dashboard-menu a:hover {
    background: var(--surface2);
    color: var(--accent);
    font-weight: 700;
}

.dashboard-content {
    display: grid;
    gap: 1.5rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stats-row article {
    padding: 1.4rem;
}

.stats-row span,
.stats-row small {
    display: block;
    color: var(--muted);
}

.stats-row strong {
    display: block;
    font-size: 2.4rem;
    color: var(--accent);
    margin: 0.5rem 0;
}

.panel {
    padding: 1.5rem;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 1rem;
}

.panel-heading h2 {
    margin: 0.35rem 0 0;
}

.panel-heading a {
    color: var(--accent);
}

.story-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid var(--line);
}

.story-thumb {
    width: 76px;
    height: 62px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0891b2, #155e75);
    background-size: cover;
    background-position: center;
    flex: none;
}

.story-row h3 {
    margin: 0.3rem 0;
    font-size: 1rem;
}

.story-row p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.status {
    margin-right: auto;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    font-size: 0.76rem;
    white-space: nowrap;
}

.status.published {
    background: #d9f4e8;
    color: #17684b;
}

.status.draft {
    background: #fff0d5;
    color: #8b5b12;
}

/* ============================================
   STORIES LIST PAGE
   ============================================ */
.stories-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
}

.story-search {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 6px 14px;
    margin: 34px 0 18px;
    box-shadow: var(--shadow-sm);
}

.story-search span {
    font-size: 25px;
    color: var(--accent);
}

.story-search input {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    flex: 1;
    padding: 12px;
}

.story-search .hidden-submit {
    display: none;
}

.story-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter {
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 6px 15px;
    color: var(--muted);
    background: var(--surface);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    align-items: center;
}

.pagination span {
    padding: 0.5rem 1rem;
    color: var(--muted);
}

/* ============================================
   STORY DETAIL PAGE
   ============================================ */
.detail-page {
    padding: 38px 24px 80px;
}

.back-link {
    color: var(--muted);
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--accent);
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 300px;
    gap: 28px;
    margin-top: 22px;
}

/* --- Detail Cover --- */
.detail-cover {
    position: relative;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    background: linear-gradient(135deg, #0891b2, #155e75);
}

.detail-cover img {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.6s ease;
}

.detail-cover:hover img {
    transform: scale(1.02);
}

/* گرادیان تیره برای خوانایی برچسب */
.detail-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.15) 0%,
        rgba(0, 0, 0, 0) 30%,
        rgba(0, 0, 0, 0) 70%,
        rgba(0, 0, 0, 0.25) 100%
    );
    pointer-events: none;
}

.cover-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 6px 20px rgba(8, 145, 178, 0.5);
    backdrop-filter: blur(6px);
}

.detail-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0 0 24px 24px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.detail-card h1 {
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.35;
    margin: 14px 0;
}

.author-row {
    display: flex;
    align-items: center;
    gap: 12px;
    border-block: 1px solid var(--line);
    padding: 16px 0;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.author-row .avatar {
    border-radius: 50%;
    background: var(--surface3);
    color: var(--accent);
}

.author-row small {
    display: block;
    color: var(--muted);
}

.meta-pill {
    margin-right: auto;
    color: var(--muted);
    font-size: 13px;
}

.story-body {
    font-size: 17px;
    line-height: 2.35;
}

.story-body p {
    margin: 0 0 22px;
}

.detail-aside > div {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 18px;
}

.detail-aside small,
.detail-aside p {
    color: var(--muted);
}

.share-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.audio-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    margin-top: 26px;
    flex-wrap: wrap;
}

.audio-player small {
    display: block;
    color: var(--muted);
}

.audio-player audio {
    max-width: 65%;
}

.detail-footer {
    margin-top: 22px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ============================================
   WRITE / FORM PAGE
   ============================================ */
.write-page {
    padding: 60px 24px;
    min-height: calc(100vh - 78px);
    display: grid;
    place-items: center;
}

.form-card {
    width: min(100%, 720px);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.form-card h1 {
    margin: 10px 0;
}

.form-card p {
    color: var(--muted);
    margin: 0 0 24px;
}

.form-card label {
    display: block;
    color: var(--secondary);
    font-weight: 600;
    font-size: 13px;
    margin-top: 16px;
}

.form-card input[type="text"],
.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="file"],
.form-card select,
.form-card textarea {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface2);
    color: var(--text);
    font: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.upload span {
    display: block;
    border: 1px dashed var(--accent);
    border-radius: 9px;
    padding: 10px;
    color: var(--accent);
    margin-top: 5px;
    text-align: center;
}

.upload input {
    display: block;
    margin-top: 5px;
    font: inherit;
    width: 100%;
}

/* ============================================
   FLASH MESSAGES
   ============================================ */
.messages-wrap {
    margin-top: 1rem;
}

.flash-message {
    background: var(--surface);
    border: 1px solid var(--line);
    border-right: 4px solid var(--accent);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 0.5rem;
}

.flash-error {
    border-right-color: #ef4444;
}

.flash-success {
    border-right-color: #10b981;
}

.field-error {
    color: #ef4444;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

/* ============================================
   TOAST
   ============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text);
    color: var(--bg);
    border-radius: 10px;
    padding: 12px 18px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 1000;
    box-shadow: var(--shadow);
    max-width: calc(100vw - 48px);
}

.toast.show {
    opacity: 1;
    transform: none;
}

/* ============================================
   MOBILE MENU
   ============================================ */
.menu-btn {
    display: none;
}

.mobile-menu {
    position: fixed;
    top: 78px;
    right: 0;
    left: 0;
    background: var(--surface);
    padding: 20px;
    z-index: 15;
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 10px;
    display: none;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    color: var(--muted);
    padding: 6px 0;
}

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 50px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
    .desktop-nav {
        display: none;
    }

    .menu-btn {
        display: block;
    }

    .hero,
    .split-page {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 42px 24px;
    }

    .hero h1 {
        font-size: 43px;
    }

    .hero-art img {
        aspect-ratio: 16 / 10;
        max-height: 320px;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .card-link > img,
    .card-img {
        aspect-ratio: 16 / 9;
    }

    .card h3 {
        min-height: auto;
    }

    .card p {
        min-height: auto;
    }

    .section-head {
        display: block;
    }

    .filters {
        margin-top: 15px;
    }

    .publish {
        margin-inline: 24px;
        flex-wrap: wrap;
    }

    .footer {
        grid-template-columns: 1fr 1fr;
    }

    .footer-note {
        grid-column: 1 / -1;
    }

    .auth-layout,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .auth-intro {
        order: 2;
    }

    .dashboard-hero {
        display: block;
        padding: 2rem;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .story-row {
        align-items: flex-start;
    }

    .detail-layout {
        display: block;
    }

    .detail-cover img {
        aspect-ratio: 16 / 10;
        border-radius: 20px 20px 0 0;
    }

    .detail-aside {
        margin-top: 20px;
    }

    .stories-heading {
        display: block;
    }

    .stories-heading .primary {
        display: inline-block;
        margin-top: 20px;
    }

    .story-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .account-card {
        padding: 30px 22px;
    }

    .form-card {
        padding: 24px;
    }

    .audio-player {
        flex-direction: column;
        align-items: stretch;
    }

    .audio-player audio {
        max-width: 100%;
    }
}

@media (max-width: 560px) {
    .hero h1 {
        font-size: 34px;
    }

    .container {
        padding-inline: 16px;
    }

    .audio-note {
        bottom: 14px;
        right: 14px;
        padding: 10px 14px;
        gap: 10px;
    }

    .audio-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .audio-text b {
        font-size: 12px;
    }

    .audio-text small {
        font-size: 10px;
    }
}

/* آیکون کنار زمان مطالعه */
.meta span,
.meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* آیکون ذخیره (بوکمارک) */
.save {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.save .save-icon {
    fill: none;
    stroke: currentColor;
    transition: fill 0.2s ease, transform 0.2s ease;
}
.save.saved .save-icon {
    fill: currentColor;
}
.save.saved {
    color: var(--accent);
}
.save:hover .save-icon {
    transform: scale(1.1);
}

/* ============================================
   Like & Save Buttons
   ============================================ */
.like,
.save {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 0;
    background: transparent;
    color: var(--muted);
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
    font-family: inherit;
    font-size: 12px;
}

.like:hover,
.save:hover {
    background: var(--surface2);
    color: var(--accent);
}

.like .like-icon,
.save .save-icon {
    fill: none;
    stroke: currentColor;
    transition: fill 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.like:hover .like-icon,
.save:hover .save-icon {
    transform: scale(1.15);
}

/* حالت فعال لایک (قلب پر و قرمز) */
.like.liked {
    color: #ef4444;
}
.like.liked .like-icon {
    fill: currentColor;
}

/* حالت فعال ذخیره (بوکمارک پر و آبی) */
.save.saved {
    color: var(--accent);
}
.save.saved .save-icon {
    fill: currentColor;
}

.like-count,
.save-label {
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.detail-footer .like,
.detail-footer .save {
    font-size: 14px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    background: var(--surface);
    border-radius: 10px;
}

.detail-footer .like:hover,
.detail-footer .save:hover {
    border-color: var(--accent);
}

.detail-footer .like.liked {
    border-color: #ef4444;
    background: #fef2f2;
}

.detail-footer .save.saved {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}