:root {
    --glass-bg: rgba(18, 20, 28, 0.58);
    --glass-bg-soft: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: rgba(234, 237, 245, 0.72);
    --accent: #60a5fa;
    --accent-strong: #3b82f6;
    --accent-warm: #f59e0b;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }

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

body {
    font-family: Tahoma, "Segoe UI", sans-serif;
    background: #090c12;
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

.site-content {
    zoom: 86%;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

/* پس‌زمینه سایت */
.site-background {
    position: fixed;

    top: 0;
    left: 0;

    width: 100vw;
    height: 100lvh;

    z-index: -2;
    overflow: hidden;
    pointer-events: none;

    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;

    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}


.site-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(96, 165, 250, 0.18), transparent 35%),
        linear-gradient(180deg, rgba(6, 8, 14, 0.52), rgba(6, 8, 14, 0.9));
}

.glass-card,
.nav,
.site-footer {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
}

.reading-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 2500;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-strong), var(--accent-warm));
    box-shadow: 0 0 14px rgba(96, 165, 250, 0.7);
}

.nav-wrap {
    position: fixed;
    top: 24px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    z-index: 2000;
    transition: var(--transition);
}

.nav-wrap.scrolled { top: 12px; }

.nav {
    width: 100%;
    max-width: 1200px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 28px;
    border: 1px solid var(--glass-border);
}

.nav-top,
.nav-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-top {
    padding: 10px 32px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 12px;
    transition: var(--transition);
}

.brand-name {
    letter-spacing: 2px;
    font-weight: 800;
    color: rgb(255, 255, 255);
}

.quick-links {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
    margin-left: 15px;
    font-weight: 600;
}

.auth-link {
    opacity: 0.82;
    transition: var(--transition);
}

.auth-link:hover { opacity: 1; color: #fff; }

.nav-main {
    padding: 25px 35px;
    gap: 20px;
    transition: var(--transition);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 35px;
}

.logo img {
    display: block;
    height: 38px;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
}

.nav-link:hover {
    background: rgba(74, 78, 90, 0.8);
    color: #fff;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 130vh;
    padding: 100px 30px;
    background: rgba(10, 14, 22, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2300;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active { right: 0; }

.mobile-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.mobile-menu ul {
    list-style: none;
}

.mobile-menu a {
    display: block;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.mobile-menu li { margin-bottom: 22px; }

.menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
    z-index: 2200;
}

.menu-overlay.active { opacity: 1; pointer-events: auto; }

.nav-wrap.scrolled .nav-top {
    height: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    border-bottom: none;
}

.nav-wrap.scrolled .nav-main {
    padding: 12px 32px;
}

.content-wrapper {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 240px 0 44px;
}

.hero-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 22px;
}

.hero-copy,
.hero-panel,
.insight-card,
.toolbar,
.archive-hero,
.archive-strip,
.post-card,
.pagination-panel,
.sidebar-card {
    border-radius: 28px;
}

.archive-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.8fr);
    gap: 22px;
    padding: 30px;
    margin-bottom: 22px;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 42%),
        linear-gradient(145deg, rgba(18, 20, 28, 0.7), rgba(18, 20, 28, 0.45));
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
}

.archive-copy h1 {
    margin-top: 14px;
    font-size: clamp(2rem, 3.6vw, 4rem);
    line-height: 1.2;
}

.archive-copy p {
    margin-top: 16px;
    max-width: 64ch;
    color: var(--text-muted);
}

.archive-spotlight {
    display: grid;
    gap: 12px;
}

.spotlight-card {
    padding: 18px 18px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.spotlight-card span,
.spotlight-card p {
    color: var(--text-muted);
}

.spotlight-card strong {
    display: block;
    margin: 8px 0 6px;
    font-size: 1.35rem;
}

.spotlight-card.accent {
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.22), rgba(255, 255, 255, 0.05));
}

.archive-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.archive-pill {
    padding: 18px;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.archive-pill strong {
    display: block;
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.hero-copy {
    padding: 34px;
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 42%),
        linear-gradient(145deg, rgba(18, 20, 28, 0.7), rgba(18, 20, 28, 0.45));
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: var(--shadow);
}

.hero-badge,
.sidebar-label,
.toolbar-label,
.panel-header span {
    color: var(--accent);
    letter-spacing: 0.4px;
    font-size: 12px;
    text-transform: uppercase;
}

.section-kicker {
    color: var(--accent);
    letter-spacing: 0.4px;
    font-size: 18px;
    text-transform: uppercase;
}

.hero-content h1 {
    margin-top: 14px;
    font-size: clamp(2.1rem, 4vw, 4.2rem);
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(90deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    margin-top: 16px;
    max-width: 62ch;
    color: var(--text-muted);
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 28px;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 16px;
    font-weight: 700;
    transition: var(--transition);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(90deg, var(--accent-strong), #60a5fa);
    box-shadow: 0 10px 24px rgba(59, 130, 246, 0.28);
}

.btn-glass {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.05);
}

.btn:hover {
    transform: translateY(-2px);
}

.hero-panel {
    padding: 28px;
    display: grid;
    gap: 22px;
}

.panel-header,
.mini-stats,
.pagination-info {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.panel-header strong,
.pagination-info strong {
    display: block;
    margin-top: 4px;
    font-size: 1.1rem;
}

.mini-stats {
    gap: 10px;
}

.mini-stats div {
    flex: 1;
    padding: 18px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    text-align: center;
}

.mini-stats b {
    display: block;
    margin-bottom: 6px;
    font-size: 1.4rem;
}

.mini-stats span,
.panel-note,
.insight-card p,
.post-body p,
.trend-item span,
.sidebar-card p,
.pagination-info span {
    color: var(--text-muted);
}

.panel-note {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
}

.insight-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.insight-card {
    padding: 22px;
}

.insight-card strong,
.section-head h2,
.sidebar-card h3 {
    display: block;
    margin-top: 30px;
    font-size: 1.8rem;
}

.toolbar {
    padding: 30px 22px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding: 10px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover,
.chip.active {
    background: rgba(96, 165, 250, 0.18);
    border-color: rgba(96, 165, 250, 0.35);
}

.layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.75fr);
    gap: 22px;
    align-items: start;
}

.posts-column,
.sidebar-column {
    display: grid;
    gap: 22px;
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 50px;
}

.section-head p {
    max-width: 40ch;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.section-head-ad {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: 26px;
    min-height: 220px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.section-head-ad img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease, filter 0.35s ease;
    filter: saturate(1.05) contrast(1.02);
}

.section-head-ad::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 8, 18, 0.08), rgba(4, 8, 18, 0.7));
}

.section-head-ad-overlay {
    position: absolute;
    inset-inline: 18px;
    bottom: 16px;
    z-index: 1;
    display: grid;
    gap: 6px;
    color: #fff;
}

.section-head-ad-overlay strong {
    font-size: 1.15rem;
}

.section-head-ad-overlay span {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.88);
}

.section-head-ad:hover img {
    transform: scale(1.04);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: rgba(18, 20, 28, 0.6);
}

.post-card.featured {
    grid-column: span 2;
    
}
.post-card.featured img {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
    filter: saturate(0.95) contrast(1.02);
}
.post-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    filter: saturate(0.95) contrast(1.02);
}

.post-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-meta,
.post-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.post-meta {
    color: var(--accent);
    font-size: 12px;
    margin-bottom: 10px;
}

.post-body h3 {
    font-size: 1.15rem;
    line-height: 1.45;
    margin-bottom: 10px;
}

.post-body p {
    margin: 0;
    margin-bottom: 10%;
}

.post-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 13px;
}

.post-footer a {
    color: #fff;
    font-weight: 700;
}

.pagination-panel {
    padding: 22px;
    margin-top: 15.5%;
}

.pagination-info {
    margin-bottom: 18px;
    align-items: center;
}

.pagination-note {
    margin-bottom: 16px;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-action {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);

    /* center content */
    display: inline-flex;      /* یا flex اگر تمام عرض است */
    align-items: center;       /* وسط عمودی */
    justify-content: center;   /* وسط افقی */
    text-align: center;
    gap: 8px; 
}

.page-action:hover,
.page-action:focus-visible {
    background: rgba(96, 165, 250, 0.18);
}

.page-numbers {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.page-number {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.page-number:hover,
.page-number.active {
    background: linear-gradient(90deg, var(--accent-strong), #60a5fa);
    border-color: transparent;
}

.sidebar-card {
    padding: 22px;
}

.ad-card {
    overflow: hidden;
}

.ad-card-link {
    position: relative;
    display: block;
    margin-top: 16px;
    border-radius: 22px;
    overflow: hidden;
    min-height: 260px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
}

.ad-card-link img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease, filter 0.35s ease;
    filter: saturate(1.05) contrast(1.02);
}

.ad-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4, 8, 18, 0.08), rgba(4, 8, 18, 0.72));
}

.ad-card-overlay {
    position: absolute;
    inset-inline: 16px;
    bottom: 16px;
    z-index: 1;
    display: grid;
    gap: 6px;
    color: #fff;
}

.ad-card-overlay strong {
    font-size: 1.05rem;
}

.ad-card-overlay span {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.85);
}

.ad-card-link:hover img {
    transform: scale(1.04);
}

.sidebar-highlight {
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 34%),
        rgba(18, 20, 28, 0.6);
}

.sidebar-highlight-ad {
    margin-top: 16px;
    min-height: 260px;
}

.sidebar-highlight-ad img {
    min-height: 260px;
}

.check-list {
    margin-top: 16px;
    display: grid;
    gap: 10px;
    padding-right: 18px;
    color: var(--text-muted);
}

.trend-list {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.trend-item {
    display: grid;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.trend-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.highlight-card {
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 34%),
        rgba(18, 20, 28, 0.6);
}

.newsletter-form {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.newsletter-form input,
.newsletter-form button,
.footer-newsletter input,
.footer-newsletter button {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.newsletter-form input,
.footer-newsletter input {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    padding: 0 14px;
    outline: none;
}

.newsletter-form button,
.footer-newsletter button {
    background: linear-gradient(90deg, var(--accent-strong), var(--accent));
    color: #fff;
    cursor: pointer;
    padding: 0 18px;
    font-weight: 700;
}

.site-footer {
    width: min(1240px, calc(100% - 32px));
    margin: 56px auto 36px;
    padding: 30px;
    border-radius: 30px;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.footer-brand h2 {
    margin-bottom: 12px;
    background: linear-gradient(90deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-links h4,
.footer-newsletter h4 {
    margin-bottom: 14px;
}

.footer-links ul {
    list-style: none;
    display: grid;
    gap: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

.footer-links a:hover {
    color: #fff;
    padding-right: 6px;
}

.footer-newsletter form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.footer-bottom {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* Exact sub-landing nav/footer overrides */
.nav-wrap {
    top: 24px;
}

.nav-wrap.scrolled {
    top: 12px;
}

.nav-wrap.scrolled .nav-top {
    height: 0;
    padding: 0;
    opacity: 0;
    overflow: hidden;
    border-bottom: none;
}

.nav-wrap.scrolled .nav-main {
    padding: 12px 32px;
}

.nav {
    max-width: 1200px;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-radius: 28px;
    border: 1px solid var(--glass-border);
}

.nav-top {
    padding: 13px 32px;
    font-size: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.nav-main {
    padding: 25px 35px;
}

.nav-wrap.scrolled .nav-main {
    padding: 12px 32px;
}

.nav-right {
    gap: 35px;
}

.logo img {
    height: 38px;
}

.nav-menu {
    gap: 10px;
}

.nav-link {
    font-size: 15px;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 14px;
}

.nav-link:hover {
    background: rgba(74, 78, 90, 0.8);
    color: #fff;
}

.menu-toggle {
    gap: 5px;
}

.bar {
    width: 25px;
    height: 2px;
    border-radius: 2px;
}

.mobile-menu {
    width: 300px;
    padding: 100px 30px;
    background: rgba(18, 20, 28, 0.98);
    backdrop-filter: blur(20px);
}

.mobile-close {
    top: 20px;
    right: 20px;
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 24px;
}

.mobile-menu ul {
    list-style: none;
}

.mobile-menu li {
    margin-bottom: 22px;
}

.mobile-menu a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.menu-overlay {
    background: rgba(0, 0, 0, 0.6);
    transition: 0.3s;
}

.menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.site-footer {
    max-width: 1200px;
    margin: 72px auto 40px;
    padding: 34px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    text-align: right;
}

.footer-brand h2 {
    font-size: 1.6rem;
    margin-bottom: 14px;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #ffffff, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-brand p,
.footer-newsletter p,
.footer-bottom p {
    color: var(--text-muted);
}

.footer-brand p,
.footer-newsletter p,
.footer-links a {
    font-size: 0.95rem;
    line-height: 1.9;
}

.footer-links h4,
.footer-newsletter h4 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: #fff;
}

.footer-links ul,
.wrapper {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: #93c5fd;
    padding-right: 6px;
}

.footer-newsletter form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 16px;
    align-items: center;
}

.footer-newsletter input {
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    outline: none;
    min-width: 0;
    width: 100%;
}

.footer-newsletter button {
    padding: 12px 22px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.95), rgba(96, 165, 250, 0.8));
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    width: auto;
    min-width: 120px;
}

.footer-newsletter button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.22);
}

.footer-bottom {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 0.86rem;
}

@media (max-width: 992px) {
    .site-footer {
        margin: 60px 20px 30px;
        padding: 28px;
    }

    .footer-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .site-footer {
        margin: 50px 16px 24px;
        padding: 24px;
        border-radius: 22px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .site-footer {
        padding: 20px;
        border-radius: 18px;
    }

    .footer-brand h2 {
        font-size: 1.25rem;
    }

    .footer-brand p,
    .footer-newsletter p,
    .footer-links a {
        font-size: 0.85rem;
        line-height: 1.8;
    }
}

#scrollTopBtn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
    z-index: 999;
    font-size: 1.5rem;
}

#scrollTopBtn.show {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1100px) {
    .hero-shell {
        grid-template-columns: minmax(0, 1.4fr) minmax(250px, 0.8fr);
    }

    .archive-hero {
        grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.72fr);
    }

    .layout-grid {
        grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.78fr);
    }

    .footer-container {
        grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
    }

    .archive-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .insight-row {
        grid-template-columns: 1fr;
    }

    .section-head {
        align-items: start;
        flex-direction: column;
    }
}

@media (max-width: 920px) {
    .nav-menu {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .nav-top {
        padding: 11px 18px;
        font-size: 13px;
    }

    .nav-main {
        padding: 16px 18px;
    }

    .content-wrapper {
        width: min(100% - 24px, 1240px);
        padding-top: 150px;
    }

    .site-footer {
        width: min(100% - 24px, 1240px);
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .hero-shell,
    .archive-hero,
    .layout-grid,
    .footer-container {
        grid-template-columns: 1fr;
    }

    .archive-strip,
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-card.featured {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .archive-hero,
    .hero-copy,
    .hero-panel,
    .insight-card,
    .toolbar,
    .archive-strip,
    .post-body,
    .pagination-panel,
    .sidebar-card {
        border-radius: 22px;
    }

    .ad-card-link,
    .ad-card-link img {
        min-height: 220px;
    }

    .archive-hero {
        padding: 20px;
    }

    .archive-strip {
        grid-template-columns: 1fr;
    }

    .hero-copy,
    .hero-panel,
    .sidebar-card,
    .pagination-panel {
        padding: 20px;
    }

    .toolbar {
        padding: 16px;
    }

    .pagination-controls {
        width: 100%;
    }

    .page-numbers {
        width: 100%;
    }

    .page-action{
        
        width: 50%;
    }

    .page-number {
        width: calc(25% - 6px);
    }

    .panel-header,
    .pagination-info {
        flex-direction: column;
    }
}

/* ===== Categories Mega Menu ===== */
.nav-dropdown {
    position: relative;
}

.nav-dropdown .mega-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 220px;
    padding: 12px 8px;
    background: #121620;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.08));
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-dropdown:hover .mega-menu,
.nav-dropdown:focus-within .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-item {
    display: block;
    padding: 10px 18px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.mega-menu-item:hover {
    background: rgba(74, 78, 90, 0.8);
    color: #fff;
}

.nav-dropdown .dropdown-toggle::after {

    margin-left: 5px;
    font-size: 10px;
    opacity: 0.7;
}

/* Mobile submenu for categories */
.mobile-menu .mobile-dropdown {
    margin-bottom: 22px;
}

.mobile-menu .mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: pointer;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 15px;
}

.mobile-menu .mobile-dropdown-toggle::after {

    font-size: 10px;
    opacity: 0.7;
}

.mobile-menu .mobile-submenu {
    list-style: none;
    margin-right: 10px;
    margin-top: 10px;
}

.mobile-menu .mobile-submenu li {
    margin-bottom: 16px;
}

.mobile-menu details[open] .mobile-dropdown-toggle {
    color: var(--accent, #3b82f6);
}



/* Newsletter Form Captcha */
.footer-newsletter .captcha-field-footer {
    display: grid;
    grid-template-columns: auto 1fr; /* Image and Input */
    gap: 10px;
    align-items: center;
    margin-top: 15px;
}

.footer-newsletter .captcha-field-footer > label {
    grid-column: 1 / -1; /* Label spans both columns */
    text-align: right;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.footer-newsletter .captcha-field-footer .captcha { /* Image */
    height: 42px;
    border-radius: 8px;
}

.footer-newsletter .captcha-field-footer input[type="text"] { /* Input */
    height: 42px;
    width: 100%;
    border-radius: 10px;
    padding: 0 15px;
    font-size: 14px;
}


/* ===== Footer Newsletter Responsive Fix ===== */
/* ===== Footer Newsletter Responsive Fix ===== */

@media (max-width: 768px) {

    .footer-newsletter form {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }


    /* فیلد ایمیل */
    .footer-newsletter form input[type="email"] {
        width: 100%;
        height: 42px;
        box-sizing: border-box;
    }


    /* کپچا - همچنان در یک خط */
    .footer-newsletter .captcha-field-footer {

        display: grid !important;

        grid-template-columns: 40% 60% !important;

        gap: 10px;

        align-items: center;

        width: 90% !important;

        margin-top: 0;

    }


    /* عنوان کپچا */
    .footer-newsletter .captcha-field-footer > label {

        grid-column: 1 / -1;

        width: 100%;

        text-align: right;

        margin-bottom: 0;

    }


    /* wrapper داخلی Django captcha */
    .footer-newsletter .captcha-field-footer > div {

        display: contents !important;

    }


    /* تصویر کپچا */
    .footer-newsletter .captcha-field-footer img,
    .footer-newsletter .captcha-field-footer .captcha {

        width: 100% !important;

        height: 42px;

        object-fit: fill;

        border-radius: 8px;

    }


    /* ورودی کد */
    .footer-newsletter .captcha-field-footer input[type="text"] {

        width: 100% !important;

        height: 42px;

        box-sizing: border-box;

        border-radius: 10px;

    }


    /* دکمه */
    .footer-newsletter button {

        width: 100%;

        height: 42px;

    }

}