/* Tag Archive Page Styles - جایگزین Tailwind CSS */

/* جلوگیری از اسکرول افقی - فقط برای رفع مشکل */
html,
body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* جلوگیری از overflow در تمام عناصر */
* {
    box-sizing: border-box;
}

.tag-page-wrapper,
.tag-page-wrapper * {
    max-width: 100%;
}

/* استفاده از فونت اصلی قالب - Override Tailwind */
.tag-page-wrapper,
.tag-page-wrapper *,
.tag-page-wrapper h1,
.tag-page-wrapper h2,
.tag-page-wrapper h3,
.tag-page-wrapper p,
.tag-page-wrapper span,
.tag-page-wrapper div,
.tag-page-wrapper a {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif !important;
}

/* RTL برای کل صفحه */
.tag-page-wrapper {
    direction: rtl !important;
    text-align: right !important;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* RTL برای تمام عناصر */
.tag-page-wrapper * {
    direction: rtl !important;
}

/* استثنا برای آیکون‌ها */
.tag-page-wrapper .tag-icon,
.tag-page-wrapper i[class*="bi-"] {
    direction: ltr !important;
}

/* استایل برای آیکون‌های Bootstrap */
.tag-icon {
    font-family: "bootstrap-icons" !important;
    font-style: normal !important;
    font-weight: normal !important;
    display: inline-block;
    vertical-align: middle;
    direction: ltr !important;
    /* آیکون‌ها باید LTR باشند */
}

/* Override Tailwind font */
.font-display {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif !important;
}

/* اطمینان از RTL */
[dir="rtl"] {
    direction: rtl !important;
}

/* استایل سکشن Featured با Background خاکستری - تمام عرض صفحه */
.tag-featured-section {
    background-color: #ececec !important;
    width: 100vw !important;
    position: relative;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    padding: 3rem 0 !important;
    margin-bottom: 2rem !important;
    margin-top: 0 !important;
    direction: rtl !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* Container داخلی برای محدود کردن عرض محتوا */
.tag-featured-section>div {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
}

/* اطمینان از RTL در سکشن Featured */
.tag-featured-section * {
    direction: rtl !important;
}

.tag-featured-section .tag-icon,
.tag-featured-section i[class*="bi-"] {
    direction: ltr !important;
}

/* استایل باکس تبلیغات */
.tag-advertisement-box {
    background-color: #f0f0f0 !important;
    border: 2px dashed #d0d0d0 !important;
    transition: all 0.3s ease;
}

.tag-advertisement-box:hover {
    background-color: #e8e8e8 !important;
    border-color: #b0b0b0 !important;
}

/* استایل لیست مطالب */
.tag-page-wrapper ul[role="list"] {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* استایل برای line-clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* جایگزین Tailwind - Grid System */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sm\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sm\:col-span-2 {
        grid-column: span 2 / span 2;
    }
}

@media (min-width: 768px) {
    .md\:grid-cols-5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lg\:col-span-1 {
        grid-column: span 1 / span 1;
    }

    .lg\:col-span-2 {
        grid-column: span 2 / span 2;
    }

    .lg\:order-1 {
        order: 1;
    }

    .lg\:order-2 {
        order: 2;
    }
}

/* جایگزین Tailwind - Flexbox */
.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1 1 0%;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

/* جایگزین Tailwind - Spacing */
.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.gap-8 {
    gap: 2rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-12 {
    padding: 3rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-8 {
    margin-top: 2rem;
}

/* جایگزین Tailwind - Typography */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 500;
}

.font-bold {
    font-weight: 600;
}

/* جایگزین Tailwind - Colors & Background */
.text-white {
    color: #ffffff;
}
.flex.items-start.gap-4.p-3.rounded-lg.hover\:bg-surface-light.dark\:hover\:bg-surface-dark.transition-colors {
	background: #eaeaea;
}
.text-white\/90 {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* اطمینان از اعمال رنگ سفید */
.text-white,
.tag-page-wrapper .text-white {
    color: #ffffff !important;
}

.tag-page-wrapper .text-white * {
    color: #ffffff !important;
}

.text-text-light-primary {
    color: #1a1a1a;
}

.text-text-light-secondary {
    color: #666666;
}

.text-primary {
    color: #007cba;
}

.bg-surface-light {
    background-color: #eaeaea;
}

.dark\:bg-surface-dark {
    background-color: #1a1a1a;
}

.dark\:text-text-dark-primary {
    color: #13263c;
}

.dark\:text-text-dark-secondary {
    color: #515050;
}

.bg-surface-light.dark\:bg-surface-dark {
    background-color: #eaeaea;
}

/* جایگزین Tailwind - Border & Rounded */
.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.shadow-xl {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* جایگزین Tailwind - Sizing */
.w-full {
    width: 100%;
}

.w-20 {
    width: 5rem;
}

.h-auto {
    height: auto;
}

.h-20 {
    height: 5rem;
}

.h-32 {
    height: 8rem;
}

.h-48 {
    height: 12rem;
}

.h-64 {
    height: 16rem;
}

.h-24 {
    height: 6rem;
}

.w-32 {
    width: 8rem;
}

/* جایگزین Tailwind - Position & Layout */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.bottom-0 {
    bottom: 0;
}

.object-cover {
    object-fit: cover;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

/* جایگزین Tailwind - Transitions */
.transition-colors {
    transition-property: color, background-color, border-color;
    transition-duration: 150ms;
}

.transition-shadow {
    transition-property: box-shadow;
    transition-duration: 150ms;
}

.transition-all {
    transition-property: all;
    transition-duration: 150ms;
}

.duration-300 {
    transition-duration: 300ms;
}

/* جایگزین Tailwind - Hover Effects */
.hover\:bg-surface-light:hover {
    background-color: #f5f5f5;
}

.hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.hover\:shadow-md:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.hover\:text-primary:hover {
    color: #007cba;
}

.group:hover .group-hover\:text-primary {
    color: #007cba;
}

.dark\:hover\:bg-surface-dark:hover {
    background-color: #1a1a1a;
}

/* Hover Scale Effect */
.hover\:scale-105:hover {
    transform: scale(1.05);
}

.group-hover\:scale-105 {
    transition: transform 0.3s ease;
}

.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

/* Gradient Background */
.bg-gradient-to-t {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3), transparent) !important;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    pointer-events: none;
}

.from-black\/75 {
    /* Fallback for gradient */
}

.via-black\/40 {
    /* Fallback for gradient */
}

.to-transparent {
    /* Fallback for gradient */
}

/* جایگزین Tailwind - Overflow */
.overflow-hidden {
    overflow: hidden;
}

.overflow-visible {
    overflow: visible;
}

/* استایل‌های اضافی */
.tag-page-wrapper a {
    text-decoration: none;
    color: inherit;
}

.tag-page-wrapper a:hover {
    opacity: 0.8;
}

.tag-page-wrapper ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* استایل‌های اضافی برای نمایش بهتر */
.mb-16 {
    margin-bottom: 4rem;
}

/* استایل برای بخش‌های مختلف */
.tag-page-wrapper img {
    max-width: 100%;
    height: auto;
}

/* استایل‌های خاص برای Grid و List Posts */
.tag-page-wrapper ul.grid {
    display: grid;
    gap: 1.5rem;
}

.tag-page-wrapper ul.space-y-4 > * + * {
    margin-top: 1rem;
}

/* استایل برای تصاویر در لیست */
.tag-page-wrapper figure img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* محدود کردن اندازه تصاویر در list posts */
.tag-page-wrapper .flex-shrink-0 {
    flex-shrink: 0;
}

/* استایل برای تصاویر در list posts با کلاس w-32 h-24 */
.tag-page-wrapper img.w-32 {
    width: 8rem !important;
    max-width: 8rem !important;
    min-width: 8rem;
}

.tag-page-wrapper img.h-24 {
    height: 6rem !important;
    max-height: 6rem !important;
    min-height: 6rem;
}

.tag-page-wrapper figure.flex-shrink-0 {
    flex-shrink: 0 !important;
    width: 8rem;
    height: 6rem;
    overflow: hidden;
    border-radius: 0.5rem;
    position: relative;
}

.tag-page-wrapper figure.flex-shrink-0 img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* استایل برای grid posts */
.tag-page-wrapper .relative.group {
    position: relative;
    overflow: hidden;
}

.tag-page-wrapper .relative.group img {
    width: 100%;
    object-fit: cover;
    display: block;
}

/* استایل برای متن‌های سفید در grid posts */
.tag-page-wrapper .relative.group header.absolute {
    z-index: 10;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
}

.tag-page-wrapper .relative.group header.absolute.text-white,
.tag-page-wrapper .relative.group header.absolute.text-white *,
.tag-page-wrapper .relative.group header.absolute .text-white,
.tag-page-wrapper .relative.group header.absolute .text-white\/90 {
    color: #ffffff !important;
}

.tag-page-wrapper .relative.group header.absolute .text-white\/90 {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* آیکون‌ها در grid posts باید سفید باشند */
.tag-page-wrapper .relative.group header.absolute .tag-icon,
.tag-page-wrapper .relative.group header.absolute i {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* اطمینان از خوانایی متن در grid posts */
.tag-page-wrapper .relative.group header.absolute h3,
.tag-page-wrapper .relative.group header.absolute h3 a,
.tag-page-wrapper .relative.group header.absolute footer,
.tag-page-wrapper .relative.group header.absolute footer span,
.tag-page-wrapper .relative.group header.absolute footer time,
.tag-page-wrapper .relative.group header.absolute footer div {
    color: #ffffff !important;
}

.tag-page-wrapper .relative.group header.absolute footer {
    color: rgba(255, 255, 255, 0.9) !important;
}

.tag-page-wrapper .relative.group header.absolute footer span,
.tag-page-wrapper .relative.group header.absolute footer time {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* تقویت gradient overlay برای خوانایی بهتر */
.tag-page-wrapper .relative.group .bg-gradient-to-t {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3), transparent) !important;
    z-index: 5;
    pointer-events: none;
}

/* اضافه کردن shadow به متن برای خوانایی بهتر */
.tag-page-wrapper .relative.group header.absolute h3 {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9);
}

.tag-page-wrapper .relative.group header.absolute h3 a {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9);
}

.tag-page-wrapper .relative.group header.absolute footer {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 1px 2px rgba(0, 0, 0, 0.9);
}

.tag-page-wrapper .relative.group header.absolute footer span,
.tag-page-wrapper .relative.group header.absolute footer time {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* اطمینان از رنگ سفید برای آیکون‌های Bootstrap در grid posts */
.tag-page-wrapper .relative.group header.absolute .tag-icon[class*="bi-"],
.tag-page-wrapper .relative.group header.absolute i[class*="bi-"] {
    color: rgba(255, 255, 255, 0.95) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* استایل hover برای لینک‌ها در grid posts */
.tag-page-wrapper .relative.group header.absolute a:hover {
    opacity: 0.9;
}

.tag-page-wrapper .relative.group header.absolute .hover\:text-primary:hover {
    color: #60a5fa !important;
}

/* اطمینان از نمایش درست تصاویر در تمام بخش‌ها */
.tag-page-wrapper article img,
.tag-page-wrapper li img {
    max-width: 100%;
    height: auto;
}

.tag-page-wrapper .object-cover {
    object-fit: cover !important;
}

/* استایل برای header absolute در grid posts */
.tag-page-wrapper header.absolute {
    z-index: 10;
}

/* استایل برای pagination */
.tag-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.tag-pagination .page-numbers,
.tag-pagination .page-numbers:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 1rem;
    background: #ffffff;
    color: #1e293b;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tag-pagination .page-numbers:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.tag-pagination .page-numbers.current {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

.tag-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-pagination li {
    margin: 0;
}

        /* Tag Pagination Styles */
        .tag-pagination {
            display: flex;
            justify-content: center;
            gap: 0.5rem;
        }

        .tag-pagination .page-numbers,
        .tag-pagination .page-numbers:visited {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 44px;
            min-height: 44px;
            padding: 0.5rem 1rem;
            background: #ffffff;
            color: #1e293b;
            border: 2px solid #e2e8f0;
            border-radius: 0.75rem;
            font-size: 0.875rem;
            font-weight: 600;
            text-decoration: none;
            transition: all 0.25s ease;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
        }

        .tag-pagination .page-numbers:hover {
            background: #dc2626;
            color: #ffffff;
            border-color: #dc2626;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
        }

        .tag-pagination .page-numbers.current {
            background: #dc2626;
            color: #ffffff;
            border-color: #dc2626;
            box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
        }

        .tag-pagination ul {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .tag-pagination li {
            margin: 0;
        }

        .dark .tag-pagination .page-numbers {
            background: #334155;
            color: #f8fafc;
            border-color: #475569;
        }

        .dark .tag-pagination .page-numbers:hover {
            background: #dc2626;
            color: #ffffff;
            border-color: #dc2626;
        }

/* ============================================
   Mobile Responsive Styles - بهینه‌سازی موبایل
   ============================================ */

@media (max-width: 768px) {
    /* افزایش padding کلی برای موبایل */
    .tag-page-wrapper {
        padding: 1rem 0.75rem !important;
    }

    /* تغییر layout برای موبایل - Sidebar در پایین */
    .tag-page-wrapper .grid.lg\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    .tag-page-wrapper aside.lg\:col-span-1 {
        order: 2 !important;
        margin-top: 2rem !important;
    }

    .tag-page-wrapper div.lg\:col-span-2 {
        order: 1 !important;
    }

    /* افزایش اندازه فونت‌های اصلی */
    .tag-page-wrapper h1 {
        font-size: 1.75rem !important;
        line-height: 1.4 !important;
        margin-bottom: 1rem !important;
    }

    .tag-page-wrapper h2 {
        font-size: 1.5rem !important;
        line-height: 1.4 !important;
        margin-bottom: 1rem !important;
    }

    .tag-page-wrapper h3 {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
        margin-bottom: 0.75rem !important;
    }

    /* افزایش اندازه فونت متن‌ها */
    .tag-page-wrapper p {
        font-size: 1rem !important;
        line-height: 1.7 !important;
        margin-bottom: 1rem !important;
    }

    /* افزایش spacing در Featured Section */
    .tag-featured-section {
        padding: 2rem 0 !important;
        margin-bottom: 1.5rem !important;
    }

    .tag-featured-section > div {
        padding: 0 0.75rem !important;
    }

    .tag-featured-section .p-6 {
        padding: 1.5rem !important;
    }

    /* بهینه‌سازی Grid برای Featured Posts در موبایل */
    .tag-page-wrapper .grid.grid-cols-2.sm\:grid-cols-3.md\:grid-cols-5 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    /* افزایش اندازه تصاویر Featured Posts */
    .tag-page-wrapper .grid img {
        min-height: 120px !important;
        height: 120px !important;
    }

    /* بهینه‌سازی Sidebar در موبایل - افزایش visibility */
    .tag-page-wrapper aside.lg\:col-span-1 {
        margin-bottom: 2rem !important;
        background: #f9f9f9;
        padding: 1.5rem !important;
        border-radius: 0.75rem;
    }

    .tag-page-wrapper aside h3 {
        font-size: 1.125rem !important;
        margin-bottom: 0.75rem !important;
        font-weight: 600 !important;
    }

    .tag-page-wrapper aside .space-y-4 > * + * {
        margin-top: 1.25rem !important;
    }

    /* افزایش اندازه فونت و padding در Sidebar */
    .tag-page-wrapper aside article {
        padding: 1rem !important;
    }

    .tag-page-wrapper aside h3 {
        font-size: 1rem !important;
        margin-bottom: 0.5rem !important;
    }

    .tag-page-wrapper aside p {
        font-size: 0.9rem !important;
        line-height: 1.6 !important;
    }

    /* افزایش اندازه تصاویر Sidebar */
    .tag-page-wrapper aside img.w-20 {
        width: 6rem !important;
        min-width: 6rem !important;
    }

    .tag-page-wrapper aside img.h-20 {
        height: 6rem !important;
        min-height: 6rem !important;
    }

    /* بهینه‌سازی Grid Posts برای موبایل */
    .tag-page-wrapper ul.grid.grid-cols-1.sm\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* افزایش اندازه متن در Grid Posts */
    .tag-page-wrapper .relative.group header.absolute h3 {
        font-size: 1.25rem !important;
        line-height: 1.4 !important;
    }

    .tag-page-wrapper .relative.group header.absolute footer {
        font-size: 0.875rem !important;
    }

    /* افزایش padding در Grid Posts */
    .tag-page-wrapper .relative.group header.absolute.p-4 {
        padding: 1rem !important;
    }

    .tag-page-wrapper .relative.group header.absolute.p-3 {
        padding: 0.875rem !important;
    }

    /* بهینه‌سازی List Posts برای موبایل */
    .tag-page-wrapper ul.space-y-4 {
        gap: 1.25rem !important;
    }

    .tag-page-wrapper ul.space-y-4 > * + * {
        margin-top: 1.25rem !important;
    }

    /* افزایش padding و اندازه در List Posts */
    .tag-page-wrapper li.bg-surface-light {
        padding: 1.25rem !important;
        margin-bottom: 1rem !important;
    }

    .tag-page-wrapper li article h3 {
        font-size: 1.125rem !important;
        line-height: 1.5 !important;
        margin-bottom: 0.75rem !important;
    }

    .tag-page-wrapper li article p {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        margin-bottom: 0.75rem !important;
    }

    /* افزایش اندازه تصاویر List Posts */
    .tag-page-wrapper figure.flex-shrink-0 {
        width: 7rem !important;
        min-width: 7rem !important;
        height: 5.5rem !important;
        min-height: 5.5rem !important;
    }

    .tag-page-wrapper figure.flex-shrink-0 img {
        width: 100% !important;
        height: 100% !important;
    }

    /* افزایش اندازه فونت footer در List Posts */
    .tag-page-wrapper footer.flex {
        font-size: 0.875rem !important;
        gap: 1rem !important;
    }

    /* بهینه‌سازی Gap ها */
    .tag-page-wrapper .gap-4 {
        gap: 1rem !important;
    }

    .tag-page-wrapper .gap-6 {
        gap: 1.25rem !important;
    }

    .tag-page-wrapper .gap-8 {
        gap: 1.5rem !important;
    }

    /* بهینه‌سازی Margin Bottom */
    .tag-page-wrapper .mb-4 {
        margin-bottom: 1rem !important;
    }

    .tag-page-wrapper .mb-6 {
        margin-bottom: 1.5rem !important;
    }

    .tag-page-wrapper .mb-8 {
        margin-bottom: 2rem !important;
    }

    /* بهینه‌سازی Pagination برای موبایل */
    .tag-pagination {
        gap: 0.5rem !important;
        padding: 0 0.5rem !important;
    }

    .tag-pagination .page-numbers {
        min-width: 40px !important;
        min-height: 40px !important;
        font-size: 0.9rem !important;
        padding: 0.5rem 0.75rem !important;
    }

    /* افزایش اندازه آیکون‌ها */
    .tag-page-wrapper .tag-icon {
        font-size: 1.1rem !important;
    }

    /* افزایش اندازه فونت‌های کوچک */
    .tag-page-wrapper .text-xs {
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
    }

    .tag-page-wrapper .text-sm {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
    }

    /* بهبود spacing در Featured Posts Grid */
    .tag-featured-section ul.grid {
        gap: 1rem !important;
    }

    .tag-featured-section ul.grid li {
        margin-bottom: 0 !important;
    }

    /* بهینه‌سازی Related Posts Grid در موبایل */
    .tag-featured-section ul.grid.grid-cols-2.sm\:grid-cols-3.md\:grid-cols-5 {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 0.75rem !important;
    }

    .tag-featured-section ul.grid li h3 {
        font-size: 0.875rem !important;
        line-height: 1.5 !important;
        margin-top: 0.5rem !important;
    }

    .tag-featured-section ul.grid li footer {
        font-size: 0.75rem !important;
        margin-top: 0.5rem !important;
    }

    /* افزایش padding در Featured Post */
    .tag-featured-section article a {
        padding: 0.5rem !important;
        min-height: auto !important;
    }

    /* بهبود خوانایی متن در List Posts */
    .tag-page-wrapper li article {
        gap: 1rem !important;
    }

    /* افزایش line-height برای خوانایی بهتر */
    .tag-page-wrapper * {
        line-height: 1.6 !important;
    }

    .tag-page-wrapper h1,
    .tag-page-wrapper h2,
    .tag-page-wrapper h3 {
        line-height: 1.4 !important;
    }

    /* بهینه‌سازی Section Header */
    .tag-page-wrapper section header {
        margin-bottom: 1.5rem !important;
    }

    /* بهبود خوانایی متن در موبایل */
    .tag-page-wrapper a {
        font-size: inherit !important;
    }

    /* افزایش touch target برای لینک‌ها */
    .tag-page-wrapper a,
    .tag-page-wrapper button {
        min-height: 44px !important;
        min-width: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* بهینه‌سازی Featured Section در موبایل */
    .tag-featured-section article.grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .tag-featured-section article header {
        order: 2 !important;
    }

    .tag-featured-section article figure {
        order: 1 !important;
    }

    /* افزایش اندازه فونت در Featured Post */
    .tag-featured-section h1 {
        font-size: 1.5rem !important;
        line-height: 1.5 !important;
    }

    .tag-featured-section p {
        font-size: 1rem !important;
        line-height: 1.7 !important;
    }

    /* بهینه‌سازی Header Section */
    .tag-page-wrapper section header.flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem !important;
    }

    .tag-page-wrapper section header h2 {
        width: 100% !important;
        margin-bottom: 0 !important;
    }
}

/* موبایل کوچک (تا 480px) */
@media (max-width: 480px) {
    /* کاهش بیشتر padding در موبایل کوچک */
    .tag-page-wrapper {
        padding: 0.75rem 0.5rem !important;
    }

    /* کاهش اندازه فونت‌ها در موبایل کوچک اما قابل خوانا */
    .tag-page-wrapper h1 {
        font-size: 1.5rem !important;
    }

    .tag-page-wrapper h2 {
        font-size: 1.25rem !important;
    }

    .tag-page-wrapper h3 {
        font-size: 1.125rem !important;
    }

    /* کاهش spacing */
    .tag-featured-section {
        padding: 1.5rem 0 !important;
    }

    .tag-featured-section > div {
        padding: 0 0.5rem !important;
    }

    .tag-featured-section .p-6 {
        padding: 1rem !important;
    }

    /* Grid Posts در یک ستون */
    .tag-page-wrapper ul.grid {
        grid-template-columns: 1fr !important;
    }

    /* Related Posts Grid در موبایل کوچک - 2 ستون */
    .tag-featured-section ul.grid.grid-cols-2.sm\:grid-cols-3.md\:grid-cols-5 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }

    /* کاهش اندازه تصاویر در موبایل کوچک */
    .tag-page-wrapper figure.flex-shrink-0 {
        width: 6rem !important;
        min-width: 6rem !important;
        height: 4.5rem !important;
        min-height: 4.5rem !important;
    }

    /* افزایش اندازه فونت‌ها در موبایل کوچک */
    .tag-page-wrapper .text-xs {
        font-size: 0.8rem !important;
    }

    .tag-page-wrapper .text-sm {
        font-size: 0.9rem !important;
    }

    /* بهبود spacing */
    .tag-page-wrapper .gap-4 {
        gap: 0.75rem !important;
    }

    .tag-page-wrapper .gap-6 {
        gap: 1rem !important;
    }
}
