/* File Name: main.css
Path: wp-content/themes/navisa-blog/assets/css/main.css
Module: Main Theme Styles (includes single post components & app-like category) */

:root {
    --primary-color: #1E88E5;
    --primary-dark: #1565C0;
    --accent-color: #FF6F00;
    --success-color: #2E7D32;
    --error-color: #C62828;
    --warning-color: #F9A825;
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-on-primary: #FFFFFF;
    --background: #F5F5F5;
    --surface: #FFFFFF;
    --border-color: #E0E0E0;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --font-family: 'IRANSans', 'Vazirmatn', 'Tahoma', sans-serif;
    --header-height: 56px;
    --bottom-nav-height: 64px;
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; direction: rtl; scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-inset-bottom) + 8px);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    user-select: none;
    -webkit-user-select: none;
}
body.admin-bar { --header-height: calc(56px + 46px); }
@media screen and (min-width: 783px) { body.admin-bar { --header-height: calc(56px + 32px); } }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; touch-action: manipulation; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; line-height: inherit; outline: none; }
button { border: none; background: none; cursor: pointer; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.4; color: var(--text-primary); }
p { margin-bottom: 1rem; color: var(--text-secondary); }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

/* Header */
.site-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background-color: var(--primary-color);
    color: var(--text-on-primary);
    height: var(--header-height);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    box-shadow: var(--shadow-medium);
}
.site-header .header-right, .site-header .header-left { display: flex; align-items: center; gap: 12px; min-width: 40px; }
.site-header .header-center { font-size: 1.1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hamburger-btn, .back-btn, .header-action-btn {
    width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(255,255,255,0.15); color: inherit; font-size: 1.3rem;
    transition: background var(--transition-fast);
}
.hamburger-btn:active, .back-btn:active, .header-action-btn:active { background: rgba(255,255,255,0.3); }

/* Drawer Menu */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1100; opacity: 0; visibility: hidden; transition: opacity var(--transition-normal), visibility var(--transition-normal); }
.drawer-overlay.active { opacity: 1; visibility: visible; }
.drawer-menu { position: fixed; top: 0; right: 0; bottom: 0; width: 280px; max-width: 80vw; background: var(--surface); z-index: 1200; transform: translateX(100%); transition: transform var(--transition-normal); display: flex; flex-direction: column; box-shadow: var(--shadow-medium); overflow-y: auto; }
.drawer-menu.active { transform: translateX(0); }
.drawer-header { padding: 20px 16px; background: var(--primary-color); color: var(--text-on-primary); display: flex; align-items: center; justify-content: space-between; }
.drawer-header .site-title { font-size: 1.2rem; font-weight: 700; }
.drawer-close { width: 36px; height: 36px; background: rgba(255,255,255,0.15); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-on-primary); }
.drawer-nav { flex: 1; padding: 16px 0; }
.drawer-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: var(--text-primary); font-weight: 500; transition: background var(--transition-fast); }
.drawer-nav a:active { background: rgba(0,0,0,0.05); }
.drawer-nav a i { width: 24px; text-align: center; font-size: 1.1rem; }

/* Bottom Navigation */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000;
    background: var(--surface); display: flex; align-items: center; justify-content: space-around;
    height: var(--bottom-nav-height); padding-bottom: var(--safe-area-inset-bottom);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.7rem; color: var(--text-secondary); transition: color var(--transition-fast); padding: 4px 8px; border-radius: var(--radius-sm); min-width: 48px; }
.bottom-nav a.active, .bottom-nav a:active { color: var(--primary-color); }
.bottom-nav a i { font-size: 1.4rem; }

/* Carousels (Swiper) */
.carousel-container { position: relative; width: 100%; overflow: hidden; border-radius: var(--radius-lg); background: var(--surface); margin: 16px 0; }
.swiper-wrapper { display: flex; }
.swiper-slide { flex-shrink: 0; width: 100%; height: auto; }
.carousel-container .swiper-slide img { width: 100%; height: 220px; object-fit: cover; display: block; }
.carousel-thumbs { margin: 8px 0; }
.carousel-thumbs .swiper-slide { width: 60px; height: 60px; border-radius: var(--radius-sm); overflow: hidden; opacity: 0.5; transition: opacity var(--transition-fast); }
.carousel-thumbs .swiper-slide-thumb-active { opacity: 1; box-shadow: 0 0 0 2px var(--primary-color); }
.carousel-thumbs .swiper-slide img { width: 100%; height: 100%; object-fit: cover; }

/* Single Post Specific */
.single-featured-image { width: 100%; max-height: 350px; object-fit: cover; display: block; margin-bottom: 16px; border-radius: var(--radius-lg); }
.single-gallery-thumbs { margin: 12px 0; }
.single-gallery-thumbs .swiper-slide { width: 70px; height: 70px; border-radius: var(--radius-sm); overflow: hidden; opacity: 0.6; border: 2px solid transparent; }
.single-gallery-thumbs .swiper-slide-thumb-active { opacity: 1; border-color: var(--primary-color); }
.single-gallery-thumbs .swiper-slide img { width: 100%; height: 100%; object-fit: cover; }
.single-post-title { font-size: 1.4rem; font-weight: 700; margin: 16px 0; line-height: 1.6; }

/* Action Buttons */
.action-buttons { display: flex; gap: 12px; margin: 16px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: var(--radius-md); font-weight: 600; font-size: 0.9rem; transition: all var(--transition-fast); background: var(--surface); color: var(--primary-color); border: 1px solid var(--border-color); flex: 1; }
.btn-primary { background: var(--primary-color); color: var(--text-on-primary); border: none; }
.btn-primary:active { background: var(--primary-dark); }
.btn-outline:active { background: rgba(30,136,229,0.08); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1500; display: flex; align-items: flex-end; justify-content: center; opacity: 0; visibility: hidden; transition: opacity var(--transition-normal), visibility var(--transition-normal); }
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { width: 100%; max-width: 600px; max-height: 80vh; background: var(--surface); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 24px 16px; overflow-y: auto; transform: translateY(100%); transition: transform var(--transition-slow); box-shadow: 0 -10px 30px rgba(0,0,0,0.2); }
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,0.08); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }

/* Related Posts */
.related-carousel .swiper-slide { width: 160px; }
.related-card { background: var(--surface); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-light); }
.related-card img { width: 100%; height: 100px; object-fit: cover; }
.related-card .related-title { padding: 8px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Comments */
.comments-list { margin-top: 16px; }
.comment-item { background: var(--surface); border-radius: var(--radius-md); padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow-light); }
.comment-item .comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-item .comment-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-color); color: var(--text-on-primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; }
.comment-item .comment-author { font-weight: 700; }
.comment-item .comment-date { font-size: 0.75rem; color: var(--text-secondary); }
.comment-item .comment-text { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.8; }

/* Empty state, Toast, Skeleton */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 16px; color: var(--text-secondary); }
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.6; }
.empty-state p { font-size: 1rem; margin-bottom: 16px; }
.toast-container { position: fixed; bottom: 80px; left: 16px; right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--text-primary); color: var(--text-on-primary); padding: 12px 16px; border-radius: var(--radius-md); font-size: 0.9rem; box-shadow: var(--shadow-medium); transform: translateY(100%); opacity: 0; transition: transform var(--transition-normal), opacity var(--transition-normal); pointer-events: auto; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success-color); }
.toast.error { background: var(--error-color); }
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-post { display: flex; gap: 12px; padding: 12px; background: var(--surface); border-radius: var(--radius-md); margin-bottom: 12px; }
.skeleton-post .skeleton-thumb { width: 80px; height: 80px; border-radius: var(--radius-sm); }
.skeleton-post .skeleton-text { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 14px; border-radius: 4px; width: 100%; }
.skeleton-line.short { width: 60%; }

/* Responsive overrides */
@media screen and (min-width: 600px) {
    :root { --header-height: 64px; --bottom-nav-height: 72px; }
    .carousel-container .swiper-slide img { height: 300px; }
}
@media screen and (min-width: 1024px) {
    body { padding-bottom: 0; }
    .bottom-nav { display: none; }
    .container { padding: 0 24px; }
    .carousel-container .swiper-slide img { height: 400px; }
    .modal-content { border-radius: var(--radius-xl); max-width: 500px; }
}

/* =============================================
   ???? ????????? ? ?????? ????????? (????)
   ============================================= */
main .category-list-ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

main .category-list-item-li {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: categoryFadeIn 0.4s ease backwards;
}

main .category-list-item-li:nth-child(1) { animation-delay: 0.05s; }
main .category-list-item-li:nth-child(2) { animation-delay: 0.1s; }
main .category-list-item-li:nth-child(3) { animation-delay: 0.15s; }
main .category-list-item-li:nth-child(4) { animation-delay: 0.2s; }
main .category-list-item-li:nth-child(5) { animation-delay: 0.25s; }

@keyframes categoryFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

main .category-list-item-li:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

main .category-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    background: transparent;
    border: none;
}

main .category-link i {
    font-size: 1.7rem;
    color: var(--primary-color);
    background: rgba(30, 136, 229, 0.1);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    transition: background 0.3s, transform 0.3s, color 0.3s;
}

main .category-link:active i {
    background: var(--primary-color);
    color: #fff;
    transform: scale(0.9);
}

/* ???? ?????? */
main .back-to-parent {
    margin-bottom: 20px;
}

main .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 18px;
    border-radius: 16px;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.5);
    transition: background 0.3s, transform 0.2s;
}

main .back-link:active {
    background: rgba(30,136,229,0.15);
    transform: translateX(-4px);
}