/*
Theme Name: milad
Author: Milad Khanmohammadi
Author URI: https://shimikhan.ir
Version: 1.0
 */
 
 .blog-container {
    margin: 20px;
}

.blog-container h2 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.category-posts {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
}

.category-posts li {
    margin-bottom: 5px;
}

.category-posts li a {
    text-decoration: none;
    color: #0073aa;
}

.category-posts li a:hover {
    text-decoration: underline;
}

@font-face {
    font-family: 'KalamehFaNum';
    src: url('fonts/Kalameh Bold.woff2') format('woff2'),
         url('fonts/Kalameh Bold.woff') format('woff'),
         url('fonts/Kalameh Bold.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}


@font-face {
    font-family: "KalamehWeb Black";
    src: url('fonts/KalamehWeb Black.woff2') format('woff2'),
         url('fonts/KalamehWeb Black.woff') format('woff'),
         url('fonts/KalamehWeb Black.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
@font-face {
  font-family: 'Kalameh';
  src: url('fonts/kalameh/Kalameh-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Kalameh';
  src: url('fonts/kalameh/Kalameh-Bold.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'Kalameh';
  src: url('fonts/kalameh/Kalameh-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Kalameh';
  src: url('fonts/kalameh/Kalameh-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
}

@font-face {
  font-family: 'Kalameh';
  src: url('fonts/kalameh/Kalameh-Black.ttf') format('truetype');
  font-weight: 900;
  font-style: normal;
}

/* Comment Styles */
.comment-list {
    list-style: none;
    padding: 0;
}

.comment-list li {
    margin-bottom: 1rem;
}

.comment-list .children {
    margin-right: 2rem;
    margin-top: 1rem;
    border-right: 2px solid #e5e7eb;
    padding-right: 1rem;
}

.comment-list .depth-2,
.comment-list .depth-3,
.comment-list .depth-4,
.comment-list .depth-5 {
    margin-right: 2rem;
}

/* Optional: Add visual distinction for nested comments */
.comment-list .children .comment {
    background-color: #f8fafc; /* Slightly different background for nested comments */
}

/* Add transition effects */
.comment {
    transition: all 0.3s ease;
}

/* Hover effect on comments */
.comment:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Style for the reply button */
.reply-button {
    transition: color 0.2s ease;
}

/* Comments wrapper */
.comments-wrapper {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

/* Drawer Menu Styles */
#sidebar {
    transition: transform 0.3s ease-in-out;
}

@media (max-width: 768px) {
    #sidebar {
        transform: translateX(100%);
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px;
        background: white;
        box-shadow: -2px 0 8px rgba(0,0,0,0.1);
        z-index: 50;
        padding: 1rem;
        overflow-y: auto;
    }

    #sidebar.open {
        transform: translateX(0);
    }

    #sidebarOverlay {
        transition: opacity 0.3s ease-in-out;
        opacity: 0;
        pointer-events: none;
    }

    #sidebarOverlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    /* Close button for mobile */
    #sidebarCloseBtn {
        display: block;
        position: absolute;
        top: 1rem;
        left: 1rem;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #666;
        cursor: pointer;
    }

    /* Mobile menu button */
    #mobileSidebarToggle {
        transition: background-color 0.2s ease;
    }

    #mobileSidebarToggle:hover {
        background-color: #3b82f6;
    }

    #mobileSidebarToggle:active {
        background-color: #2563eb;
    }

    /* Prevent body scroll when drawer is open */
    body.drawer-open {
        overflow: hidden;
    }
}

/* Sidebar Item Styles */
#sidebar nav a {
    position: relative;
    overflow: hidden;
    transition: all 0.2s ease-in-out;
}

#sidebar nav a svg {
    transition: transform 0.2s ease;
}

#sidebar nav a:hover svg {
    transform: scale(1.1);
}

/* Active state styles */
#sidebar nav a.bg-primary {
    position: relative;
    background-color: #eff6ff !important; /* Light blue background */
    color: #2563eb !important; /* Blue text color */
}

#sidebar nav a.bg-primary::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background-color: #2563eb;
    border-radius: 0 4px 4px 0;
}

/* Hover effect for non-active items */
#sidebar nav a:not(.bg-primary):hover {
    background-color: #eff6ff;
    color: #2563eb;
}

/* Hover effect for active items - slightly darker background */
#sidebar nav a.bg-primary:hover {
    background-color: #dbeafe !important; /* Slightly darker blue on hover */
}

/* Remove or comment out the old copyright-text class */
/* .copyright-text {
    direction: rtl;
    text-align: right;
    padding: 0 1rem;
} */

/* View Toggle Styles */
.view-toggle-btn {
    transition: all 0.2s ease-in-out;
}

.view-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

table {
    border-collapse: collapse;
    width: 100%;
  }

  th, td {
    border: 1px solid #dddddd;
    text-align: left;
    padding: 8px;
  }

  th {
    background-color: #f2f2f2;
  }

  tr:nth-child(even) {
    background-color: #f9f9f9;
  }

  ul.ai-style-change-1 {
    list-style: disc;
    padding-left: 1em;
  }
  
  li.ai-style-change-2,
  li.ai-style-change-3,
  li.ai-style-change-4 {
    font-family: 'Kalameh';
    font-size: 16px;
    line-height: 35px;
    color: rgb(31, 41, 55);
    margin-bottom: 10px;
  }
  
  

.view-toggle-btn.active {
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* View Transition Styles */
.grid-view, .table-view {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.grid-view.hidden, .table-view.hidden {
    display: none;
    opacity: 0;
}

/* Table View Styles */
.table-view {
    animation: fadeIn 0.3s ease-in-out;
}

.grid-view {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* View Toggle Button Container */
.view-toggle-container {
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.view-toggle-container button {
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

.view-toggle-container button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Ensure smooth transitions for both views */
.grid {
    transition: opacity 0.3s ease-in-out;
}

table.min-w-full {
    transition: opacity 0.3s ease-in-out;
}

/* View switching styles */
.view-content {
    transition: opacity 0.3s ease-in-out;
}

.view-content.hidden {
    display: none;
}

.view-content.block {
    display: block;
}

/* Special case for grid view */
.card-view.block .grid {
    display: grid;
}



/* ==========================
   Article Headings (H1/H2)
   ========================== */
/* Main article title */
.content-section h1,
.entry-content h1,
article h1 {
    direction: rtl;
    text-align: right;
    font-family: 'Kalameh', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 800;
    font-size: 2rem;
    line-height: 1.35;
    color: #0f172a;
    margin: 0 0 1.25rem;
    border-right: 4px solid #2563eb; /* RTL accent */
    padding-right: 0.75rem;
}

/* All section H2s share the FAQ style */
.content-section > h2,
.entry-content h2,
article h2,
h2#conclusion {
    direction: rtl;
    text-align: right;
    font-family: 'Kalameh', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #111827;
    margin: 2rem 0 1rem;
}

/* Article H3 base style (applies everywhere, including nested) */
.content-section h3,
.entry-content h3,
article h3 {
    direction: rtl;
    text-align: right;
    font-family: 'Kalameh', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 600;
    font-size: 1.0625rem;
    color: #1f2937;
    margin: 1.25rem 0 0.5rem;
    line-height: 1.6;
}

/* Top-level H3 accent; does not affect .faq-q which is nested */
.content-section > h3,
.entry-content > h3,
article > h3 {
    border-right: 3px solid #e5e7eb; /* RTL accent */
    padding-right: 0.5rem;
}

/* ==========================
   Lists inside content sections
   ========================== */
.content-section ul,
.entry-content ul,
article ul {
    direction: rtl;
    text-align: right;
    list-style: disc;
    margin: 0.75rem 0 0.75rem;
    padding-right: 1.25rem; /* RTL indent */
}

.content-section ol,
.entry-content ol,
article ol {
    direction: rtl;
    text-align: right;
    list-style: decimal;
    margin: 0.75rem 0 0.75rem;
    padding-right: 1.25rem; /* RTL indent */
}

.content-section li,
.entry-content li,
article li {
    margin: 0.35rem 0;
    line-height: 1.9;
}

/* Nested lists */
.content-section ul ul,
.content-section ol ol,
.entry-content ul ul,
.entry-content ol ol,
article ul ul,
article ol ol {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
    padding-right: 1rem;
}

/* Improve marker visibility */
.content-section li::marker,
.entry-content li::marker,
article li::marker {
    color: #3b82f6;
}

/* ==========================
   Content Table Styles
   ========================== */
/* Scope tables to article/content sections to avoid affecting app UIs */
.content-section table,
.entry-content table,
article table {
    width: 100%;
    border-collapse: collapse;
    direction: rtl;
    text-align: right;
    margin: 1rem 0;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    overflow: hidden; /* rounds corners visually */
}

.content-section thead th,
.entry-content thead th,
article thead th {
    background-color: #eef2ff;
    color: #0f172a;
    font-weight: 700;
    padding: 0.75rem 0.875rem;
    border-bottom: 2px solid #c7d2fe;
    white-space: nowrap;
}

.content-section tbody td,
.entry-content tbody td,
article tbody td {
    padding: 0.625rem 0.875rem;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
}

/* Vertical separators for sharper grid */
.content-section thead th + th,
.entry-content thead th + th,
article thead th + th,
.content-section tbody td + td,
.entry-content tbody td + td,
article tbody td + td {
    border-right: 1px solid #e5e7eb;
}

/* Zebra striping */
.content-section tbody tr:nth-child(odd),
.entry-content tbody tr:nth-child(odd),
article tbody tr:nth-child(odd) {
    background-color: #fafafa;
}

/* Hover effect */
.content-section tbody tr:hover,
.entry-content tbody tr:hover,
article tbody tr:hover {
    background-color: #f0f7ff;
    box-shadow: inset -4px 0 0 #60a5fa; /* RTL right-side accent */
}

/* Row header cells (if used) */
.content-section tbody th[scope="row"],
.entry-content tbody th[scope="row"],
article tbody th[scope="row"] {
    background-color: #f9fafb;
    font-weight: 600;
}

/* Caption styling */
.content-section table caption,
.entry-content table caption,
article table caption {
    caption-side: top;
    padding: 0.5rem 0;
    color: #6b7280;
    text-align: right;
}

/* Optional responsive wrapper. If you wrap table with .table-responsive it will scroll */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

/* Optional: sticky header helper */
.table-sticky-header thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/* Optional: compact density */
.table-compact thead th,
.table-compact tbody td {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Optional: numeric cell alignment (LTR numbers/units) */
.cell-num {
    text-align: left;
    direction: ltr;
}

@media (max-width: 768px) {
    .content-section thead th,
    .entry-content thead th,
    article thead th,
    .content-section tbody td,
    .entry-content tbody td,
    article tbody td {
        padding: 0.5rem 0.625rem;
    }
}

/* ==========================
   FAQ (سوالات متداول) Styles
   ========================== */
#faq {
    direction: rtl;
    text-align: right;
    font-family: 'Kalameh', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: #111827;
    margin: 2rem 0 1rem;
}

.faq-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.faq-item {
    background-color: #bfccf5;
    border: 1px solid #3c5994;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
    direction: rtl;
}

.faq-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.faq-q {
    position: relative;
    margin: 0;
    padding-right: 1.75rem; /* space for chevron on the right (RTL) */
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
    line-height: 1.8;
    cursor: pointer; /* allows future toggle behavior */
}

.faq-q::before {
    content: '\25BC'; /* small chevron */
    position: absolute;
    right: 0.5rem;
    top: 0.4rem;
    font-size: 0.8rem;
    color: #6b7280;
    transition: transform 0.2s ease, color 0.2s ease;
}

.faq-item:hover .faq-q::before {
    color: #2563eb;
}

.faq-a {
    margin: 0.5rem 0 0;
    color: #374151;
    line-height: 2;
}

/* Optional collapsed/open states (for when JS toggling is added) */
.faq-item.is-collapsed .faq-a { display: none; }
.faq-item.is-open .faq-q::before { transform: rotate(180deg); }

/* Nested/long answers */
.faq-a p { margin: 0.5rem 0; }
.faq-a ul, .faq-a ol {
    margin: 0.5rem 0 0;
    padding-right: 1.25rem; /* RTL indent */
}

@media (max-width: 768px) {
    #faq { font-size: 1.125rem; }
    .faq-item { padding: 0.75rem 0.875rem; }
    .faq-q { font-size: 0.985rem; }
}

/* ==========================
   Brand CTA Styles
   ========================== */
.brand-cta {
    direction: rtl;
    text-align: right;
    background-color: #f8fafc;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-right: 4px solid #2563eb; /* RTL accent */
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    margin: 1.25rem 0;
    line-height: 1.9;
}

.brand-cta strong {
    color: #1d4ed8;
    font-weight: 600;
}

.brand-cta a {
    color: #1d4ed8;
    text-decoration: none;
    border-bottom: 1px dashed rgba(29, 78, 216, 0.35);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.brand-cta a:hover {
    color: #2563eb;
    border-bottom-color: rgba(37, 99, 235, 0.6);
}

.brand-cta em,
.brand-cta .highlight {
    background-color: #eff6ff;
    padding: 0 0.25rem;
    border-radius: 0.25rem;
}

@media (max-width: 768px) {
    .brand-cta {
        padding: 0.75rem 0.875rem;
        margin: 1rem 0;
    }
}

/* ==========================
   Table of Contents Styles
   ========================== */
.table-of-contents {
    direction: rtl;
    text-align: right;
    background-color: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem 1rem 0.75rem;
    margin: 1.5rem 0;
}

.table-of-contents .toc-title {
    font-family: 'Kalameh', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: #111827;
    margin: 0 0 0.75rem;
}

.table-of-contents .toc-list,
.table-of-contents ul,
.table-of-contents ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.table-of-contents .toc-item {
    margin: 0.125rem 0;
}

.table-of-contents .toc-link {
    display: block;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    color: #374151;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.table-of-contents .toc-link:hover {
    background-color: #eff6ff;
    color: #2563eb;
}

/* Active state (supports either class on link or parent) */
.table-of-contents .toc-link.is-active,
.table-of-contents .toc-item.is-active > .toc-link {
    background-color: #eff6ff;
    color: #1d4ed8;
    position: relative;
}

/* Active indicator on the right side (RTL) */
.table-of-contents .toc-link.is-active::before,
.table-of-contents .toc-item.is-active > .toc-link::before {
    content: '';
    position: absolute;
    right: 0.25rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background-color: #2563eb;
    border-radius: 2px;
}

/* Nested lists */
.table-of-contents .toc-list .toc-list,
.table-of-contents ul ul,
.table-of-contents ol ol {
    margin-right: 0.75rem;
    padding-right: 0.75rem;
    border-right: 2px solid #e5e7eb;
}

/* Optional numbering span if present */
.table-of-contents .toc-number {
    display: inline-block;
    min-width: 2ch;
    margin-left: 0.25rem;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

/* Spacing tweaks for deeply nested items */
.table-of-contents .toc-list .toc-list .toc-item { margin-right: 0.25rem; }
.table-of-contents .toc-list .toc-list .toc-list .toc-item { margin-right: 0.5rem; }

/* Make TOC sticky if container has .sticky */
.table-of-contents.sticky {
    position: sticky;
    top: 1rem;
}

/* Responsive: relax borders on small screens */
@media (max-width: 768px) {
    .table-of-contents {
        padding: 0.75rem;
        margin: 1rem 0;
    }
    .table-of-contents .toc-list .toc-list,
    .table-of-contents ul ul,
    .table-of-contents ol ol {
        border-right: 1px solid #e5e7eb;
        margin-right: 0.5rem;
        padding-right: 0.5rem;
    }
}
