/*
Theme Name: Namnak Style
Theme URI: https://parsipu.com/-style
Author: Mostafa 09122404736
Author URI: https://parsipu.com/
Description: قالب وردپرس حرفه‌ای و سئو فرندلی به سبک نمناک - مجله اینترنتی فارسی با پشتیبانی کامل RTL، تنظیمات پیشرفته صفحه اصلی، ابزارک‌های سفارشی و سازگار با Yoast SEO
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: namnak-style
Tags: rtl-language-support, news, magazine, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, blog, entertainment
*/

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', 'Tahoma', 'IranSans', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.7;
    direction: rtl;
    text-align: right;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #004d99;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: #222;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p {
    margin-bottom: 1rem;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
    padding: 20px 0;
}

/* Grid helpers */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    padding: 0 10px;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: #0d7377;
    color: #fff;
    font-size: 0.85rem;
    padding: 6px 0;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-main {
    padding: 12px 0;
}

.header-main .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-branding {
    flex-shrink: 0;
}

.site-logo img {
    max-height: 55px;
    width: auto;
}

.site-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0d7377;
    margin: 0;
}

.site-title a {
    color: inherit;
}

.main-navigation {
    flex: 1;
}

.main-navigation ul {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 18px;
    justify-content: center;
}

.main-navigation a {
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 0;
    position: relative;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
    color: #0d7377;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: #0d7377;
    transition: width 0.25s ease;
}

.main-navigation a:hover::after {
    width: 100%;
}

.header-search {
    flex-shrink: 0;
}

.header-search form {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 25px;
    overflow: hidden;
    background: #f9f9f9;
}

.header-search input[type="search"] {
    border: none;
    background: transparent;
    padding: 8px 15px;
    width: 180px;
    font-size: 0.9rem;
    outline: none;
}

.header-search button {
    background: #0d7377;
    border: none;
    color: #fff;
    padding: 8px 14px;
    cursor: pointer;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #333;
}

/* ==========================================================================
   Top Banner / Ads
   ========================================================================== */
.top-banner {
    background: linear-gradient(90deg, #0d7377, #14919b);
    color: #fff;
    text-align: center;
    padding: 8px;
    font-size: 0.9rem;
}

.top-banner a {
    color: #fff;
    font-weight: 600;
}

/* ==========================================================================
   Homepage Sections
   ========================================================================== */
.section {
    background: #fff;
    border-radius: 10px;
    margin-bottom: 25px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0d7377;
}

.section-title {
    font-size: 1.2rem;
    color: #0d7377;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: #0d7377;
    border-radius: 2px;
}

.section-more {
    font-size: 0.85rem;
    color: #0d7377;
    font-weight: 500;
}

.section-more:hover {
    text-decoration: underline;
}

/* Featured / Hero grid */
.hero-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.hero-main {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    min-height: 320px;
}

.hero-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-main .overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: #fff;
    padding: 25px 20px 18px;
}

.hero-main .overlay h2 {
    color: #fff;
    font-size: 1.35rem;
    margin-bottom: 6px;
}

.hero-main .overlay .meta {
    font-size: 0.8rem;
    opacity: 0.9;
}

.hero-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-side-item {
    display: flex;
    gap: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.hero-side-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.hero-side-item img {
    width: 120px;
    height: 90px;
    object-fit: cover;
    flex-shrink: 0;
}

.hero-side-item .content {
    padding: 10px 10px 10px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-side-item h3 {
    font-size: 0.95rem;
    margin: 0 0 4px;
    line-height: 1.4;
}

.hero-side-item .meta {
    font-size: 0.75rem;
    color: #888;
}

/* Post cards grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.posts-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.posts-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.post-card .thumb {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.post-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.post-card:hover .thumb img {
    transform: scale(1.05);
}

.post-card .badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #0d7377;
    color: #fff;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.post-card .body {
    padding: 12px 14px 16px;
}

.post-card .body h3 {
    font-size: 0.95rem;
    margin: 0 0 8px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card .body .meta {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.post-card .body .excerpt {
    font-size: 0.85rem;
    color: #555;
    margin-top: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Artists / Circle cards */
.artists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    text-align: center;
}

.artist-card img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 8px;
    border: 3px solid #e0e0e0;
    transition: border-color 0.2s;
}

.artist-card:hover img {
    border-color: #0d7377;
}

.artist-card .name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

/* ==========================================================================
   Archive & Single
   ========================================================================== */
.content-area {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 25px;
}

.main-column {
    min-width: 0;
}

.archive-header {
    background: #fff;
    padding: 18px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.archive-header h1 {
    margin: 0;
    font-size: 1.4rem;
    color: #0d7377;
}

.breadcrumb {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
}

.breadcrumb a {
    color: #666;
}

.breadcrumb span {
    margin: 0 6px;
    color: #ccc;
}

/* Archive list */
.archive-list .post-item {
    display: flex;
    gap: 18px;
    background: #fff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}

.archive-list .post-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.archive-list .post-item .thumb {
    width: 220px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.archive-list .post-item .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.archive-list .post-item .content h2 {
    font-size: 1.15rem;
    margin: 0 0 8px;
}

.archive-list .post-item .meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

.archive-list .post-item .excerpt {
    font-size: 0.9rem;
    color: #555;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Single post */
.single-post {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.single-post .entry-header {
    margin-bottom: 20px;
}

.single-post .entry-title {
    font-size: 1.7rem;
    line-height: 1.4;
    margin-bottom: 12px;
}

.single-post .entry-meta {
    font-size: 0.85rem;
    color: #888;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.single-post .entry-thumbnail {
    margin-bottom: 25px;
    border-radius: 10px;
    overflow: hidden;
}

.single-post .entry-thumbnail img {
    width: 100%;
}

.single-post .entry-content {
    font-size: 1.05rem;
    line-height: 1.9;
}

.single-post .entry-content p {
    margin-bottom: 1.2rem;
}

.single-post .entry-content h2,
.single-post .entry-content h3 {
    margin-top: 1.8rem;
    color: #0d7377;
}

.single-post .entry-content img {
    border-radius: 8px;
    margin: 1.5rem 0;
}

.single-post .entry-content ul,
.single-post .entry-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
    list-style: disc;
}

.single-post .entry-content ol {
    list-style: decimal;
}

.single-post .entry-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.tags-list a {
    display: inline-block;
    background: #f0f0f0;
    color: #555;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin: 0 0 6px 6px;
}

.tags-list a:hover {
    background: #0d7377;
    color: #fff;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
    min-width: 0;
}

.widget {
    background: #fff;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.widget-title {
    font-size: 1.05rem;
    color: #0d7377;
    margin: 0 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0d7377;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget a {
    color: #333;
    font-size: 0.9rem;
}

.widget a:hover {
    color: #0d7377;
}

/* Popular / Recent widget items */
.widget-post-item {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.widget-post-item:last-child {
    margin-bottom: 0;
}

.widget-post-item img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.widget-post-item .info h4 {
    font-size: 0.85rem;
    margin: 0 0 4px;
    line-height: 1.4;
}

.widget-post-item .info .date {
    font-size: 0.75rem;
    color: #999;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widgets .widget-title {
    color: #fff;
    border-bottom-color: #0d7377;
}

.footer-widgets a {
    color: #bbb;
}

.footer-widgets a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
}

.footer-bottom a {
    color: #0d7377;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 30px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 0.9rem;
    border: 1px solid #ddd;
}

.pagination .current {
    background: #0d7377;
    color: #fff;
    border-color: #0d7377;
}

.pagination a:hover {
    background: #f0f0f0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 992px) {
    .content-area {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 2;
    }

    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-main .container {
        flex-wrap: wrap;
    }

    .main-navigation {
        display: none;
        width: 100%;
        order: 3;
    }

    .main-navigation.active {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
        padding: 10px 0;
    }

    .main-navigation li {
        border-bottom: 1px solid #eee;
    }

    .main-navigation a {
        display: block;
        padding: 10px 0;
    }

    .menu-toggle {
        display: block;
    }

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

    .archive-list .post-item {
        flex-direction: column;
    }

    .archive-list .post-item .thumb {
        width: 100%;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
    }

    .header-search input[type="search"] {
        width: 140px;
    }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.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;
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

/* ========== Latest News Special Layout (1 big + 4 side + 4 bottom) ========== */
.latest-special-top {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
    margin-bottom: 20px;
}

.latest-big {
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
}

.latest-big:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.latest-big .thumb {
    position: relative;
    aspect-ratio: 16/11;
    overflow: hidden;
}

.latest-big .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.latest-big:hover .thumb img {
    transform: scale(1.04);
}

.latest-big .badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #0d7377;
    color: #fff;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
}

.latest-big .body {
    padding: 14px 16px 18px;
}

.latest-big .body h3 {
    font-size: 1.15rem;
    margin: 0 0 6px;
    line-height: 1.45;
    color: #222;
}

.latest-big .body .meta {
    font-size: 0.8rem;
    color: #888;
}

.latest-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
}

.latest-side-item {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
}

.latest-side-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.latest-side-item .thumb {
    aspect-ratio: 16/10;
    overflow: hidden;
}

.latest-side-item .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.latest-side-item:hover .thumb img {
    transform: scale(1.05);
}

.latest-side-item .content {
    padding: 10px 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.latest-side-item h4 {
    font-size: 0.88rem;
    margin: 0 0 4px;
    line-height: 1.4;
    color: #222;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.latest-side-item .meta {
    font-size: 0.75rem;
    color: #999;
}

.latest-bottom {
    margin-top: 5px;
}

@media (max-width: 768px) {
    .latest-special-top {
        grid-template-columns: 1fr;
    }
    .latest-side {
        grid-template-columns: 1fr 1fr;
    }
}
