/* =========================================
   Zisteh Theme - Main Stylesheet
   Brand DNA: Persian calligraphy wave, teal blue
   ========================================= */

/* ---------- Fonts ---------- */
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---------- CSS Variables (Brand Tokens) ---------- */
:root {
    --color-teal: #106B86;
    --color-teal-dark: #0A4A5E;
    --color-teal-light: #E8F3F6;
    --color-amber: #BA7517;
    --color-green: #0F6E56;
    --color-blue: #185FA5;

    --bg-primary: #FAF8F3;
    --bg-secondary: #F5F2EC;
    --bg-card: #FFFFFF;
    --bg-dark: #1A1A1A;

    --text-primary: #1A1A1A;
    --text-secondary: #444441;
    --text-muted: #5F5E5A;
    --text-light: #888780;
    --text-on-dark: #FFFFFF;

    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-strong: rgba(0, 0, 0, 0.15);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);

    --container-width: 1240px;

    --font-base: 'Vazirmatn', 'Tahoma', 'Iranian Sans', sans-serif;
    --font-serif: Georgia, 'Times New Roman', serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-base);
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    background: var(--bg-primary);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-teal); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--color-teal-dark); }
button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.5;
    margin: 0 0 0.6em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; line-height: 1.9; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 32px;
}

.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden; padding: 0;
    position: absolute; width: 1px; word-wrap: normal !important;
}

.skip-link {
    position: absolute; top: -100px; right: 0;
    background: var(--color-teal); color: white;
    padding: 12px 20px; z-index: 9999;
}
.skip-link:focus { top: 0; }

/* ---------- Top accent bar ---------- */
.top-accent { height: 3px; background: var(--color-teal); }

/* ---------- Header ---------- */
.site-header {
    background: var(--bg-primary);
    border-bottom: 0.5px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    gap: 24px;
}

.site-branding { display: flex; align-items: center; gap: 12px; }
.site-branding .custom-logo,
.site-branding .site-logo {
    height: 50px;
    width: auto;
    max-width: 140px;
}
.site-title {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
    color: var(--text-primary);
}
.site-description {
    font-size: 11px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

/* Primary Menu */
.main-navigation { flex: 1; display: flex; justify-content: center; }
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 32px;
}
.main-navigation a {
    color: var(--text-secondary);
    font-size: 14px;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s ease;
}
.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: var(--text-primary);
    font-weight: 500;
}
.main-navigation .current-menu-item > a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    height: 2px;
    background: var(--color-teal);
}

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
    border: 0.5px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}
.icon-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-primary {
    background: var(--color-teal);
    color: white;
}
.btn-primary:hover {
    background: var(--color-teal-dark);
    color: white;
}
.btn-dark {
    background: var(--text-primary);
    color: white;
}
.btn-dark:hover {
    background: #000;
    color: white;
}
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 0.5px solid var(--border-color-strong);
}
.btn-outline:hover {
    background: var(--bg-secondary);
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 8px;
    color: var(--text-primary);
}

/* ---------- Hero Section (Homepage) ---------- */
.hero-featured {
    padding: 48px 0 56px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}
.hero-featured::before {
    content: '';
    position: absolute;
    left: -100px;
    top: -50px;
    width: 700px;
    height: 400px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400' preserveAspectRatio='none'><path d='M 0 250 Q 200 100 400 200 T 800 150' stroke='%23106B86' stroke-width='60' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    opacity: 0.04;
    pointer-events: none;
}

.hero-label {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    position: relative;
    z-index: 2;
}
.hero-label-line {
    width: 40px;
    height: 1px;
    background: var(--color-teal);
}
.hero-label-text {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    color: var(--color-teal);
}
.hero-label-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: auto;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 48px;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content .category-tag {
    background: white;
    color: var(--color-teal);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
    border: 0.5px solid rgba(16, 107, 134, 0.3);
    display: inline-block;
}
.hero-title {
    font-size: 2.8rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 20px 0 16px;
    color: var(--text-primary);
}
.hero-excerpt {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 2;
    margin: 0 0 24px;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 20px;
    border-top: 0.5px solid var(--border-color-strong);
}
.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-teal);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}
.author-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}
.author-meta {
    font-size: 11px;
    color: var(--text-light);
}

.hero-image-wrap {
    position: relative;
}
.hero-image {
    width: 100%;
    height: 420px;
    object-fit: cover;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.issue-badge {
    position: absolute;
    top: -16px;
    right: -16px;
    background: var(--color-teal);
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.issue-badge-label {
    font-size: 9px;
    letter-spacing: 2px;
}
.issue-badge-number {
    font-size: 22px;
    font-weight: 500;
    font-family: var(--font-serif);
}

/* ---------- Wave Divider ---------- */
.wave-divider {
    display: block;
    width: 100%;
    height: 50px;
}

/* ---------- Section Header ---------- */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 32px;
}
.section-head-title {
    margin: 0;
}
.section-head-label {
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--color-teal);
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}
.section-head h2 {
    font-size: 1.75rem;
    font-weight: 500;
    margin: 0;
    color: var(--text-primary);
}
.view-all {
    font-size: 13px;
    color: var(--color-teal);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Articles Section ---------- */
.section-articles {
    padding: 24px 0 56px;
    background: var(--bg-secondary);
}

.articles-asymmetric {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.articles-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Post Card */
.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: block;
    color: inherit;
}
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    color: inherit;
}

.post-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: var(--bg-secondary);
}

.post-card-body { padding: 20px; }

.post-card-category {
    background: var(--color-teal-light);
    color: var(--color-teal);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 500;
    display: inline-block;
}
.post-card-category.cat-it { background: #E6F1FB; color: #0C447C; }
.post-card-category.cat-management { background: var(--color-teal-light); color: var(--color-teal); }
.post-card-category.cat-life { background: #E1F5EE; color: #085041; }

.post-card-title {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.7;
    margin: 10px 0 8px;
    color: var(--text-primary);
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--color-teal); }
.post-card-excerpt {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.9;
    margin: 0;
}
.post-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 0.5px solid var(--border-color);
    font-size: 11px;
    color: var(--text-light);
}

/* Big card variant */
.post-card-big {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 280px;
}
.post-card-big .post-card-image {
    height: 100%;
    min-height: 280px;
}
.post-card-big .post-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.post-card-big .post-card-title {
    font-size: 1.2rem;
}

/* ---------- Quote Section ---------- */
.section-quote {
    padding: 64px 0;
    background: var(--bg-dark);
    color: white;
    position: relative;
    overflow: hidden;
}
.section-quote::before {
    content: '';
    position: absolute;
    left: -50px;
    bottom: -50px;
    width: 500px;
    height: 200px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 200' preserveAspectRatio='none'><path d='M 0 100 Q 200 0 400 80 T 800 60' stroke='%23106B86' stroke-width='40' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    opacity: 0.08;
}
.quote-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 32px;
    align-items: center;
    max-width: 900px;
    position: relative;
    z-index: 2;
}
.quote-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-teal);
}
.quote-mark {
    font-family: var(--font-serif);
    font-size: 4rem;
    line-height: 0.6;
    color: var(--color-teal);
    margin-bottom: 12px;
}
.quote-text {
    font-size: 1.4rem;
    line-height: 1.8;
    margin: 0;
    color: white;
}
.quote-author {
    font-size: 13px;
    color: #B4B2A9;
    margin: 16px 0 0;
}

/* ---------- Categories Section ---------- */
.section-categories {
    padding: 64px 0;
    background: var(--bg-secondary);
}
.section-categories .section-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.category-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    color: inherit;
}
.category-card-image {
    height: 160px;
    background-size: cover;
    background-position: center;
    position: relative;
}
.category-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(16, 107, 134, 0.7), rgba(16, 107, 134, 0.3));
}
.category-card-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 28px;
    z-index: 2;
}
.category-card-body { padding: 20px; }
.category-card-title {
    font-size: 1.05rem;
    font-weight: 500;
    margin: 0 0 6px;
    color: var(--text-primary);
}
.category-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 10px;
}
.category-card-count {
    font-size: 11px;
    color: var(--color-teal);
}

/* Category color variants */
.category-card.cat-management .category-card-image::after {
    background: linear-gradient(135deg, rgba(186, 117, 23, 0.7), rgba(186, 117, 23, 0.3));
}
.category-card.cat-management .category-card-count { color: var(--color-amber); }

.category-card.cat-life .category-card-image::after {
    background: linear-gradient(135deg, rgba(15, 110, 86, 0.7), rgba(15, 110, 86, 0.3));
}
.category-card.cat-life .category-card-count { color: var(--color-green); }

/* ---------- Newsletter ---------- */
.section-newsletter {
    padding: 56px 0;
    background: var(--bg-secondary);
}
.newsletter-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: center;
    position: relative;
    overflow: hidden;
    border: 0.5px solid var(--border-color);
}
.newsletter-box::before {
    content: '';
    position: absolute;
    left: -100px;
    top: -50px;
    width: 600px;
    height: 400px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400' preserveAspectRatio='none'><path d='M 0 250 Q 200 100 400 200 T 800 150' stroke='%23106B86' stroke-width='80' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    opacity: 0.08;
    pointer-events: none;
}
.newsletter-content {
    position: relative;
    z-index: 2;
}
.newsletter-label {
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--color-teal);
    font-weight: 500;
}
.newsletter-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 8px 0 12px;
    line-height: 1.5;
    color: var(--text-primary);
}
.newsletter-desc {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.9;
    margin: 0;
}
.newsletter-form {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.newsletter-form input[type="text"],
.newsletter-form input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 0.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
}
.newsletter-form-row {
    display: flex;
    gap: 10px;
}
.newsletter-form-row input { flex: 1; }
.newsletter-form button {
    background: var(--color-teal);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.newsletter-form button:hover { background: var(--color-teal-dark); }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--bg-dark);
    color: white;
    padding: 56px 0 24px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.1fr 1fr;
    gap: 32px;
    padding-bottom: 32px;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}
.footer-brand-logo {
    height: 46px;
    margin-bottom: 14px;
    width: auto;
}
.footer-about {
    font-size: 12px;
    color: #B4B2A9;
    line-height: 2;
    margin: 0 0 14px;
}
.footer-email {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-teal);
    font-size: 12px;
    padding: 4px 0;
}
.footer-email:hover { color: white; }
.footer-col h5 {
    font-size: 13px;
    font-weight: 500;
    color: white;
    margin: 0 0 14px;
}
.footer-col a {
    display: block;
    color: #B4B2A9;
    padding: 4px 0;
    font-size: 12px;
}
.footer-col a:hover { color: white; }
.footer-social { display: flex; gap: 10px; }
.footer-social a {
    width: 36px; height: 36px;
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #B4B2A9;
    padding: 0;
}
.footer-social a:hover {
    background: var(--color-teal);
    border-color: var(--color-teal);
    color: white;
}
.footer-bottom {
    font-size: 11px;
    color: #5F5E5A;
    text-align: center;
    margin: 24px 0 0;
}

/* ---------- Single Post ---------- */
.single-post-wrap {
    background: var(--bg-primary);
    padding: 56px 0;
}
.single-post-header {
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
}
.single-post-category {
    display: inline-block;
    background: var(--color-teal-light);
    color: var(--color-teal);
    padding: 4px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 20px;
}
.single-post-title {
    font-size: 2.5rem;
    line-height: 1.4;
    margin: 0 0 20px;
    color: var(--text-primary);
}
.single-post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}
.single-post-thumbnail {
    max-width: 1100px;
    margin: 0 auto 40px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    /* Fixed-height frame with centered image, no stretching */
    height: 480px;
    background: var(--bg-secondary);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.single-post-thumbnail::before {
    /* Blurred background using the same image - prevents empty space for small images */
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--thumb-bg, none);
    background-size: cover;
    background-position: center;
    filter: blur(40px) brightness(0.6) saturate(1.2);
    transform: scale(1.15); /* hide blur edges */
    z-index: 0;
}
.single-post-thumbnail img {
    position: relative;
    z-index: 1;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
@media (max-width: 768px) {
    .single-post-thumbnail {
        height: 260px;
    }
}
.single-post-content {
    max-width: 720px;
    margin: 0 auto;
    font-size: 17px;
    line-height: 2;
    color: var(--text-secondary);
}
.single-post-content h2 {
    font-size: 1.6rem;
    margin: 2em 0 0.6em;
    color: var(--text-primary);
}
.single-post-content h3 {
    font-size: 1.3rem;
    margin: 1.6em 0 0.6em;
}
.single-post-content p { margin-bottom: 1.4em; }
.single-post-content a {
    color: var(--color-teal);
    border-bottom: 1px solid rgba(16, 107, 134, 0.3);
}
.single-post-content blockquote {
    border-right: 4px solid var(--color-teal);
    padding: 8px 24px;
    margin: 2em 0;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-style: italic;
    color: var(--text-primary);
}
.single-post-content img {
    border-radius: var(--radius-md);
    margin: 1.5em 0;
}
.single-post-content pre,
.single-post-content code {
    direction: ltr;
    text-align: left;
    background: #F1EFE8;
    border-radius: var(--radius-sm);
}
.single-post-content code {
    padding: 2px 6px;
    font-size: 0.9em;
}
.single-post-content pre {
    padding: 16px;
    overflow-x: auto;
    font-size: 0.9em;
    line-height: 1.7;
}
.single-post-content ul,
.single-post-content ol {
    padding-right: 1.5em;
    margin: 1em 0;
}
.single-post-content li { margin-bottom: 0.5em; }

/* Tags + Share */
.single-post-footer {
    max-width: 720px;
    margin: 48px auto 0;
    padding-top: 32px;
    border-top: 0.5px solid var(--border-color);
}
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.post-tags a {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
}
.post-tags a:hover {
    background: var(--color-teal);
    color: white;
}
.post-share {
    display: flex;
    align-items: center;
    gap: 12px;
}
.post-share-label {
    font-size: 13px;
    color: var(--text-muted);
}
.post-share a {
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: 50%;
    color: var(--text-secondary);
}
.post-share a:hover {
    background: var(--color-teal);
    color: white;
}

/* Author Box */
.author-box {
    max-width: 720px;
    margin: 48px auto 0;
    padding: 32px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 24px;
    align-items: center;
}
.author-box img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
}
.author-box h4 {
    margin: 0 0 8px;
    font-size: 1.1rem;
}
.author-box p {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.9;
}

/* ---------- Archive / Category ---------- */
.archive-header {
    padding: 56px 0 32px;
    background: var(--bg-primary);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.archive-header::before {
    content: '';
    position: absolute;
    left: -100px;
    top: -50px;
    width: 700px;
    height: 300px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400' preserveAspectRatio='none'><path d='M 0 250 Q 200 100 400 200 T 800 150' stroke='%23106B86' stroke-width='60' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    opacity: 0.04;
}
.archive-label {
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--color-teal);
    font-weight: 500;
    margin-bottom: 8px;
    display: block;
    position: relative;
    z-index: 2;
}
.archive-title {
    font-size: 2.5rem;
    margin: 0 0 12px;
    position: relative;
    z-index: 2;
}
.archive-description {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}
.archive-content {
    padding: 32px 0 64px;
    background: var(--bg-secondary);
}
.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ---------- Pagination ---------- */
.pagination {
    margin: 48px 0 0;
    display: flex;
    justify-content: center;
    gap: 6px;
}
.pagination .page-numbers {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 0.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    text-decoration: none;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--color-teal);
    border-color: var(--color-teal);
    color: white;
}

/* ---------- Comments ---------- */
.comments-area {
    max-width: 720px;
    margin: 48px auto 0;
    padding-top: 32px;
    border-top: 0.5px solid var(--border-color);
}
.comments-title {
    font-size: 1.3rem;
    margin: 0 0 24px;
}
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 32px;
}
.comment-list li {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}
.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.comment-author img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}
.comment-author cite {
    font-style: normal;
    font-weight: 500;
    font-size: 14px;
}
.comment-meta {
    font-size: 11px;
    color: var(--text-light);
}
.comment-respond input,
.comment-respond textarea {
    width: 100%;
    padding: 12px 16px;
    border: 0.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    font-family: inherit;
    font-size: 14px;
    margin-bottom: 12px;
}
.comment-respond .submit {
    background: var(--color-teal);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    cursor: pointer;
}

/* ---------- Search Form ---------- */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 10px 16px;
    border: 0.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    font-family: inherit;
    font-size: 13px;
}
.search-form button {
    background: var(--color-teal);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: inherit;
}

/* ---------- 404 ---------- */
.error-404 {
    text-align: center;
    padding: 96px 0;
}
.error-404 .error-code {
    font-size: 8rem;
    font-weight: 500;
    color: var(--color-teal);
    line-height: 1;
    font-family: var(--font-serif);
}
.error-404 h1 {
    font-size: 1.8rem;
    margin: 24px 0 12px;
}

/* ---------- Mobile Menu ---------- */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 200;
    padding: 24px;
    overflow-y: auto;
}
.mobile-menu-overlay.open { display: block; }
.mobile-menu-overlay .close-btn {
    position: absolute;
    top: 24px;
    left: 24px;
    width: 40px; height: 40px;
    border: none;
    background: var(--bg-secondary);
    border-radius: 50%;
}
.mobile-menu-overlay ul {
    list-style: none;
    padding: 80px 0 0;
    margin: 0;
}
.mobile-menu-overlay li {
    border-bottom: 0.5px solid var(--border-color);
}
.mobile-menu-overlay a {
    display: block;
    padding: 20px 0;
    font-size: 18px;
    color: var(--text-primary);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .container { padding: 0 24px; }
    .articles-asymmetric { grid-template-columns: 1fr; }
    .post-card-big { grid-template-columns: 1fr; }
    .post-card-big .post-card-image { min-height: 220px; }
    .hero-title { font-size: 2.2rem; }
    .single-post-title { font-size: 2rem; }
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    body { font-size: 15px; }

    .main-navigation,
    .header-actions .btn { display: none; }
    .menu-toggle { display: flex; }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .hero-title { font-size: 1.6rem; }
    .hero-image { height: 240px; }
    .issue-badge { width: 60px; height: 60px; }
    .issue-badge-number { font-size: 16px; }

    .articles-row,
    .archive-grid,
    .categories-grid,
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .newsletter-box {
        grid-template-columns: 1fr;
        padding: 32px 24px;
        gap: 20px;
    }
    .newsletter-form-row { flex-direction: column; }

    .quote-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 20px;
    }
    .quote-avatar { margin: 0 auto; width: 80px; height: 80px; }
    .quote-text { font-size: 1.1rem; }

    .single-post-title { font-size: 1.5rem; }
    .single-post-content { font-size: 15px; }
    .archive-title { font-size: 1.8rem; }
    .error-404 .error-code { font-size: 5rem; }

    .author-box {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .author-box img { margin: 0 auto; }
}

/* ---------- Books / Bookshelf ---------- */
.bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 32px 24px;
}
.book-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
}
.book-card:hover {
    transform: translateY(-4px);
    color: inherit;
}
.book-card-cover {
    position: relative;
    aspect-ratio: 2 / 3;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}
.book-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.book-cover-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 48px;
}
.book-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--color-teal);
    color: white;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}
.book-card-info {
    padding: 0 4px;
}
.book-card-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    margin: 0 0 4px;
    color: var(--text-primary);
}
.book-card-author {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 6px;
}
.book-card-rating {
    color: var(--color-amber);
    font-size: 14px;
    display: flex;
    gap: 1px;
}
.book-card-rating .ti-star { color: var(--text-light); }

/* Single Book Page */
.book-detail-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 48px;
    align-items: start;
    max-width: 900px;
    margin: 0 auto;
}
.book-cover-wrap {
    position: sticky;
    top: 100px;
}
.book-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.book-cover.book-cover-placeholder {
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 80px;
}
.book-title {
    font-size: 2.2rem;
    line-height: 1.4;
    margin: 16px 0 8px;
    color: var(--text-primary);
}
.book-author {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0 0 16px;
}
.book-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-amber);
    font-size: 22px;
    margin-bottom: 24px;
}
.book-rating .ti-star { color: var(--text-light); }
.book-rating-num {
    margin-right: 8px;
    font-size: 14px;
    color: var(--text-muted);
}
.book-meta-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
}
.book-meta-list li {
    padding: 8px 0;
    border-bottom: 0.5px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}
.book-meta-label {
    color: var(--text-muted);
    margin-left: 8px;
    display: inline-block;
    min-width: 90px;
}

@media (max-width: 768px) {
    .book-detail-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .book-cover-wrap {
        max-width: 200px;
        margin: 0 auto;
        position: static;
    }
    .book-title { font-size: 1.6rem; }
    .bookshelf-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 24px 16px;
    }
}


/* ---------- Reflections (تأملات) - Twitter-style minimal ---------- */
.section-reflections {
    padding: 72px 0;
    background: #F0E5D0; /* Warm cream/sand */
    position: relative;
    overflow: hidden;
}
.section-reflections::before {
    content: '';
    position: absolute;
    left: -80px;
    bottom: -50px;
    width: 600px;
    height: 250px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 200' preserveAspectRatio='none'><path d='M 0 100 Q 200 0 400 80 T 800 60' stroke='%237A5B1A' stroke-width='40' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    opacity: 0.10;
    pointer-events: none;
}
.section-reflections > .container {
    position: relative;
    z-index: 2;
}

.reflections-head {
    text-align: center;
    margin-bottom: 40px;
}
.reflections-head > div:first-child {
    margin-bottom: 12px;
}
.reflections-line {
    width: 32px;
    height: 1px;
    background: #7A5B1A;
}
.reflections-label {
    font-size: 11px;
    letter-spacing: 3px;
    color: #7A5B1A;
    font-weight: 500;
}
.reflections-title {
    font-size: 1.75rem;
    font-weight: 500;
    margin: 8px 0 8px;
    color: #3D2F0F;
}
.reflections-desc {
    font-size: 14px;
    color: #7A5B1A;
    opacity: 0.85;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.9;
}

/* GRID — three columns, twitter-style cards */
.reflections-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    max-width: 1100px;
    margin: 0 auto;
}

.reflection-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 24px 26px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    border-right: 3px solid #7A5B1A;
    text-align: right;
    direction: rtl;
    min-height: 240px;
}
.reflection-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(122, 91, 26, 0.12);
    color: inherit;
}
.reflection-card-mark {
    font-family: var(--font-serif);
    font-size: 38px;
    line-height: 0.4;
    color: #7A5B1A;
    margin-bottom: 12px;
    opacity: 0.7;
    display: block;
}
.reflection-card-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 10px;
    color: #1A1A1A;
    line-height: 1.6;
}

/* Text wrapper with fade-out gradient for long content */
.reflection-card-text-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    margin-bottom: 14px;
}
.reflection-card.has-more .reflection-card-text-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, #FFFFFF);
    pointer-events: none;
}
.reflection-card-text {
    font-size: 14px;
    line-height: 1.95;
    color: #3D2F0F;
    margin: 0;
    text-align: right;
    /* Soft cap when very long */
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer with date + "continue" indicator */
.reflection-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 0.5px solid rgba(122, 91, 26, 0.15);
}
.reflection-card-date {
    font-size: 11px;
    color: #7A5B1A;
    opacity: 0.7;
}
.reflection-card-more {
    font-size: 11px;
    color: #7A5B1A;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(122, 91, 26, 0.08);
    border-radius: 999px;
    transition: all 0.2s ease;
}
.reflection-card:hover .reflection-card-more {
    background: #7A5B1A;
    color: #F0E5D0;
}

/* If only 1 or 2 reflections exist, keep them centered with a max width */
.reflections-grid:has(> :nth-child(1):last-child) {
    grid-template-columns: minmax(0, 500px);
    justify-content: center;
}
.reflections-grid:has(> :nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 400px));
    justify-content: center;
}

/* CTA */
.reflections-cta {
    text-align: center;
    margin-top: 40px;
}
.reflections-view-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #7A5B1A;
    font-size: 13px;
    font-weight: 500;
    padding: 10px 24px;
    border: 0.5px solid rgba(122, 91, 26, 0.3);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.2s ease;
}
.reflections-view-all:hover {
    background: #7A5B1A;
    color: #F0E5D0;
    border-color: #7A5B1A;
}

/* Single Reflection Page */
.single-reflection-wrap {
    padding: 80px 0;
    background: #F0E5D0;
    min-height: 80vh;
    position: relative;
    overflow: hidden;
}
.single-reflection-wrap::before {
    content: '';
    position: absolute;
    left: -100px;
    bottom: -80px;
    width: 700px;
    height: 300px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 200' preserveAspectRatio='none'><path d='M 0 100 Q 200 0 400 80 T 800 60' stroke='%237A5B1A' stroke-width='50' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    opacity: 0.08;
    pointer-events: none;
}
.reflection-single-card {
    max-width: 720px;
    margin: 0 auto;
    background: #FFFFFF;
    border-radius: var(--radius-lg);
    padding: 56px 48px;
    position: relative;
    z-index: 2;
    box-shadow: 0 20px 50px rgba(122, 91, 26, 0.10);
    border-right: 4px solid #7A5B1A;
    text-align: right;
}
.reflection-single-label {
    text-align: center;
    margin-bottom: 20px;
}
.reflection-single-label span {
    font-size: 11px;
    letter-spacing: 3px;
    color: #7A5B1A;
    font-weight: 500;
}
.reflection-single-mark {
    font-family: var(--font-serif);
    font-size: 4rem;
    line-height: 0.4;
    color: #7A5B1A;
    margin-bottom: 20px;
    text-align: center;
    opacity: 0.4;
}
.reflection-single-title {
    font-size: 1.8rem;
    font-weight: 500;
    text-align: right;
    color: #1A1A1A;
    margin: 0 0 24px;
    line-height: 1.5;
}
.reflection-single-content {
    font-size: 17px;
    line-height: 2.2;
    color: #3D2F0F;
    text-align: right;
}
.reflection-single-content p {
    margin: 0 0 1.2em;
}
.reflection-single-content p:last-child { margin-bottom: 0; }
.reflection-single-meta {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 0.5px solid rgba(122, 91, 26, 0.15);
    font-size: 12px;
    color: #7A5B1A;
    opacity: 0.85;
}

.reflection-nav {
    max-width: 720px;
    margin: 32px auto 0;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    z-index: 2;
}
.reflection-nav a {
    flex: 1;
    background: rgba(255, 255, 255, 0.6);
    border: 0.5px solid rgba(122, 91, 26, 0.2);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    color: #3D2F0F;
    font-size: 13px;
    text-align: right;
    transition: all 0.2s ease;
}
.reflection-nav a:hover {
    background: rgba(255, 255, 255, 0.95);
    color: #3D2F0F;
}
.reflection-nav-label {
    font-size: 10px;
    color: #7A5B1A;
    letter-spacing: 2px;
    margin-bottom: 4px;
    display: block;
}

/* Reflections archive */
.reflections-archive-header {
    background: #F0E5D0;
    padding: 64px 0 32px;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.reflections-archive-header::before {
    content: '';
    position: absolute;
    left: -100px;
    bottom: -50px;
    width: 700px;
    height: 250px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 200' preserveAspectRatio='none'><path d='M 0 100 Q 200 0 400 80 T 800 60' stroke='%237A5B1A' stroke-width='50' fill='none' stroke-linecap='round'/></svg>");
    background-repeat: no-repeat;
    opacity: 0.10;
}
.reflections-archive-header .archive-label {
    color: #7A5B1A;
    position: relative;
    z-index: 2;
}
.reflections-archive-header .archive-title {
    color: #3D2F0F;
    position: relative;
    z-index: 2;
}
.reflections-archive-content {
    background: #F0E5D0;
    padding: 24px 0 80px;
}

@media (max-width: 1024px) {
    .reflections-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .section-reflections { padding: 48px 0; }
    .reflections-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .reflection-single-card { padding: 36px 24px; }
    .reflection-single-title { font-size: 1.35rem; }
    .reflection-single-content { font-size: 15px; line-height: 2; }
    .reflection-nav { flex-direction: column; }
}

/* ---------- Bookshelf Section (Homepage) ---------- */
.section-bookshelf {
    padding: 72px 0;
    background: var(--bg-primary);
    position: relative;
}

.bookshelf-slider-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bookshelf-slider {
    overflow: hidden;
    flex: 1;
    /* Subtle fade on edges */
    -webkit-mask-image: linear-gradient(to left, transparent 0, #000 30px, #000 calc(100% - 30px), transparent 100%);
            mask-image: linear-gradient(to left, transparent 0, #000 30px, #000 calc(100% - 30px), transparent 100%);
}

.bookshelf-slider-track {
    display: flex;
    gap: 20px;
    padding: 8px 4px 32px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.bookshelf-slider-track::-webkit-scrollbar { display: none; }

.bookshelf-card {
    flex: 0 0 auto;
    width: 240px;
    scroll-snap-align: start;
}
@media (min-width: 768px) {
    .bookshelf-card { width: 260px; }
}

.bookshelf-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.bookshelf-card:hover .bookshelf-card-cover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}
.bookshelf-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.bookshelf-card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 64px;
}

/* Overlay with title + author (always visible at bottom) */
.bookshelf-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.85) 22%,
        rgba(0, 0, 0, 0.5) 40%,
        rgba(0, 0, 0, 0) 70%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px 18px;
    color: white;
    text-align: right;
    direction: rtl;
}
.bookshelf-card-title {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 4px;
    color: white;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.bookshelf-card-author {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.bookshelf-card-publisher {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin: 4px 0 0;
}
.bookshelf-card-rating {
    margin-top: 8px;
    color: #F5C518;
    font-size: 13px;
    display: flex;
    gap: 1px;
}
.bookshelf-card-rating .ti-star { color: rgba(255, 255, 255, 0.3); }

/* CTA button (appears on hover) */
.bookshelf-card-cta {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--color-teal);
    color: white;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
    pointer-events: none;
    z-index: 2;
}
.bookshelf-card-cta:hover {
    background: var(--color-teal-dark);
    color: white;
}
.bookshelf-card:hover .bookshelf-card-cta {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Arrow controls */
.bookshelf-arrow {
    width: 44px;
    height: 44px;
    background: white;
    border: 0.5px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.bookshelf-arrow:hover {
    background: var(--color-teal);
    color: white;
    border-color: var(--color-teal);
}
.bookshelf-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .section-bookshelf { padding: 48px 0; }
    .bookshelf-card { width: 200px; }
    .bookshelf-arrow { display: none; }
}

/* ---------- Archive Page Template ---------- */
.zisteh-archive-page-header {
    background: var(--bg-primary);
}
.zisteh-archive-page {
    padding: 32px 0 80px;
    background: var(--bg-secondary);
}

/* Toolbar */
.zisteh-archive-toolbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
    padding: 12px;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}
.zisteh-archive-search {
    position: relative;
    display: flex;
    align-items: center;
}
.zisteh-archive-search > i.ti-search {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 18px;
    pointer-events: none;
}
.zisteh-archive-search input[type="search"] {
    width: 100%;
    padding: 12px 44px 12px 40px;
    border: 0.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}
.zisteh-archive-search input[type="search"]:focus {
    outline: none;
    border-color: var(--color-teal);
}
.zisteh-archive-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.zisteh-archive-search-clear {
    position: absolute;
    left: 10px;
    background: var(--bg-secondary);
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: background 0.2s ease;
}
.zisteh-archive-search-clear:hover { background: var(--border-color-strong); }

.zisteh-archive-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}
.zisteh-archive-sort label {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
}
.zisteh-archive-sort select {
    padding: 10px 14px;
    border: 0.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    font-family: inherit;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
}
.zisteh-archive-sort select:focus {
    outline: none;
    border-color: var(--color-teal);
}

/* Category chips */
.zisteh-archive-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.zisteh-chip {
    background: white;
    border: 0.5px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.zisteh-chip:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}
.zisteh-chip.active {
    background: var(--color-teal);
    color: white;
    border-color: var(--color-teal);
}
.zisteh-chip-count {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    color: inherit;
}
.zisteh-chip.active .zisteh-chip-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Counter */
.zisteh-archive-counter {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding: 0 4px;
}
.zisteh-archive-counter strong {
    color: var(--color-teal);
    font-weight: 500;
}

/* Grid (reuses .archive-grid styles where possible) */
.zisteh-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    min-height: 200px;
    position: relative;
}
.zisteh-archive-grid.is-loading {
    opacity: 0.5;
    pointer-events: none;
}
.zisteh-archive-grid.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%23106B86' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 12a9 9 0 1 1-6.219-8.56'/></svg>") no-repeat center 60px;
    background-size: 32px;
    animation: zisteh-spin 1s linear infinite;
    pointer-events: none;
}
@keyframes zisteh-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.zisteh-spin {
    display: inline-block;
    animation: zisteh-spin 1s linear infinite;
}

/* Load more button */
.zisteh-archive-loadmore-wrap {
    text-align: center;
    margin-top: 40px;
}
.zisteh-archive-loadmore {
    min-width: 200px;
    padding: 14px 32px;
    font-size: 14px;
}

/* Empty state */
.zisteh-archive-empty-state {
    text-align: center;
    padding: 80px 24px;
    background: white;
    border-radius: var(--radius-md);
}
.zisteh-archive-empty-state h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
}
.zisteh-archive-empty-state p {
    color: var(--text-muted);
    margin: 0;
}

@media (max-width: 1024px) {
    .zisteh-archive-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .zisteh-archive-toolbar {
        grid-template-columns: 1fr;
    }
    .zisteh-archive-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .zisteh-archive-sort {
        justify-content: space-between;
    }
    .zisteh-archive-sort select {
        flex: 1;
    }
}

/* Persian numerals helper */
.persian-num { font-feature-settings: "ss01"; }

/* Print */
@media print {
    .site-header, .site-footer, .section-newsletter, .post-share,
    .comments-area, .author-box { display: none; }
}
