/*
Theme Name: Media Khodro
Theme URI: https://mediakhodro.ir
Author: Ali ilkhani
Author URI: https://mediakhodro.ir
Description: قالب مجله خودرویی مدیا خودرو - یک قالب حرفه‌ای و مدرن برای مجلات خودرو
Version: 1.1.0
Requires at least: 5.9
Tested up to: 6.4
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: media-khodro
Tags: rtl-language-support, right-to-left, blog, magazine, custom-colors, custom-menu

این قالب برای مجله خودرویی مدیا خودرو طراحی شده است.
*/

/* === CSS Variables === */
:root {
    /* Primary Colors */
    --mk-primary: #E63946;
    --mk-primary-dark: #C1121F;
    --mk-primary-light: #FF6B6B;
    
    /* Secondary Colors */
    --mk-secondary: #1D3557;
    --mk-secondary-dark: #0D1B2A;
    --mk-secondary-light: #457B9D;
    
    /* Accent Colors */
    --mk-accent: #F4A261;
    --mk-accent-gold: #E9C46A;
    
    /* Neutral Colors */
    --mk-white: #FFFFFF;
    --mk-light: #F8F9FA;
    --mk-gray-100: #F1F3F5;
    --mk-gray-200: #E9ECEF;
    --mk-gray-300: #DEE2E6;
    --mk-gray-400: #CED4DA;
    --mk-gray-500: #ADB5BD;
    --mk-gray-600: #6C757D;
    --mk-gray-700: #495057;
    --mk-gray-800: #343A40;
    --mk-dark: #212529;
    
    /* Typography */
    --mk-font-primary: 'IRANYekan', 'Vazirmatn', 'Segoe UI', Tahoma, Arial, sans-serif;
    --mk-font-display: 'IRANYekan', 'Vazirmatn', 'Segoe UI', Tahoma, Arial, sans-serif;
    
    /* Spacing */
    --mk-spacing-xs: 0.25rem;
    --mk-spacing-sm: 0.5rem;
    --mk-spacing-md: 1rem;
    --mk-spacing-lg: 1.5rem;
    --mk-spacing-xl: 2rem;
    --mk-spacing-2xl: 3rem;
    --mk-spacing-3xl: 4rem;
    
    /* Border Radius */
    --mk-radius-sm: 4px;
    --mk-radius-md: 8px;
    --mk-radius-lg: 12px;
    --mk-radius-xl: 16px;
    --mk-radius-full: 50%;
    
    /* Shadows */
    --mk-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --mk-shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --mk-shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --mk-shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    
    /* Transitions */
    --mk-transition-fast: 0.15s ease;
    --mk-transition-normal: 0.3s ease;
    --mk-transition-slow: 0.5s ease;
    
    /* Container */
    --mk-container-max: 1320px;
    --mk-container-padding: 1.5rem;
}

/* === Base Reset === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--mk-font-primary);
    font-size: 1rem;
    color: var(--mk-dark);
    line-height: 1.7;
    color: var(--mk-dark);
    background-color: var(--mk-white);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.menu-open {
    overflow: hidden;
}

/* RTL Support for all sections */
.mk-magazine-section,
.mk-comparison-section,
.mk-brands-section,
.mk-footer {
    direction: rtl;
    text-align: right;
}

/* RTL Support for all sections */
.mk-magazine-section,
.mk-comparison-section,
.mk-brands-section,
.mk-footer {
    direction: rtl;
    text-align: right;
}



/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--mk-font-display);
    font-weight: 700;
    line-height: 1.3;
    color: var(--mk-secondary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

/* === Links === */
a,
a:link,
a:visited {
    text-decoration: none;
    transition: color var(--mk-transition-fast);
}

a:hover,
a:focus,
a:active {
    color: var(--mk-primary-dark) !important;
    text-decoration: none;
}

/* Keep button links readable on hover */
a.mk-btn:hover,
a.mk-btn:focus,
a.mk-btn:active,
a.mk-btn-primary:hover,
a.mk-btn-primary:focus,
a.mk-btn-secondary:hover,
a.mk-btn-secondary:focus,
a.mk-btn-outline:hover,
a.mk-btn-outline:focus,
a.mk-btn-hero-primary:hover,
a.mk-btn-hero-primary:focus,
a.mk-btn-hero-secondary:hover,
a.mk-btn-hero-secondary:focus {
    text-decoration: none;
}

/* Override WordPress default link styles */


body a:hover,
body a:focus,
.mk-theme a:hover,
.mk-theme a:focus,
.mk-container a:hover,
.mk-container a:focus,
.mk-content a:hover,
.mk-content a:focus,
.entry-content a:hover,
.entry-content a:focus,
.post-content a:hover,
.post-content a:focus,
.page-content a:hover,
.page-content a:focus,
.wp-block-post-content a:hover,
.wp-block-post-content a:focus,
.wp-block-post-excerpt a:hover,
.wp-block-post-excerpt a:focus,
article a:hover,
article a:focus,
main a:hover,
main a:focus,
section a:hover,
section a:focus,
div a:hover,
div a:focus,
p a:hover,
p a:focus,
li a:hover,
li a:focus,
td a:hover,
td a:focus,
th a:hover,
th a:focus {
    color: var(--mk-primary-dark) !important;
}

a.mk-btn,
a.mk-btn:link,
a.mk-btn:visited {
    color: inherit;
}

a.mk-btn-primary,
a.mk-btn-primary:link,
a.mk-btn-primary:visited {
    color: var(--mk-white) !important;
}

a.mk-btn-secondary,
a.mk-btn-secondary:link,
a.mk-btn-secondary:visited {
    color: var(--mk-white) !important;
}

a.mk-btn-outline,
a.mk-btn-outline:link,
a.mk-btn-outline:visited {
    color: var(--mk-primary) !important;
}

body a.mk-btn:hover,
body a.mk-btn:focus,
.mk-container a.mk-btn:hover,
.mk-container a.mk-btn:focus,
section a.mk-btn:hover,
section a.mk-btn:focus {
    color: inherit !important;
}

body a.mk-btn-primary:hover,
body a.mk-btn-primary:focus,
.mk-container a.mk-btn-primary:hover,
.mk-container a.mk-btn-primary:focus {
    color: var(--mk-white) !important;
}

body a.mk-btn-secondary:hover,
body a.mk-btn-secondary:focus,
.mk-container a.mk-btn-secondary:hover,
.mk-container a.mk-btn-secondary:focus {
    color: var(--mk-white) !important;
}

body a.mk-btn-outline:hover,
body a.mk-btn-outline:focus,
.mk-container a.mk-btn-outline:hover,
.mk-container a.mk-btn-outline:focus {
    color: var(--mk-white) !important;
}

/* Ensure WordPress editor content links use theme colors */
.wp-block-post-content a,
.wp-block-post-excerpt a,
.has-global-color-primary a {
    color: var(--mk-primary) !important;
}

.wp-block-post-content a:hover,
.wp-block-post-content a:focus,
.wp-block-post-excerpt a:hover,
.wp-block-post-excerpt a:focus,
.has-global-color-primary a:hover,
.has-global-color-primary a:focus {
    color: var(--mk-primary-dark) !important;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Container === */
.mk-container {
    width: 100%;
    max-width: var(--mk-container-max);
    margin: 0 auto;
    padding: 0 var(--mk-container-padding);
}

/* === Buttons === */
.mk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--mk-font-primary);
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--mk-radius-md);
    cursor: pointer;
    transition: all var(--mk-transition-normal);
    text-decoration: none;
}

.mk-btn-primary {
    background: var(--mk-primary);
    color: var(--mk-white);
}

.mk-btn-primary:hover {
    background: var(--mk-primary-dark);
    color: var(--mk-white) !important;
    transform: translateY(-2px);
    box-shadow: var(--mk-shadow-lg);
}

.mk-btn-secondary {
    background: var(--mk-secondary);
    color: var(--mk-white);
}

.mk-btn-secondary:hover {
    background: var(--mk-secondary-dark);
    color: var(--mk-white) !important;
    transform: translateY(-2px);
    box-shadow: var(--mk-shadow-lg);
}

.mk-btn-outline {
    background: transparent;
    color: var(--mk-primary);
    border: 2px solid var(--mk-primary);
}

.mk-btn-outline:hover {
    background: var(--mk-primary);
    color: var(--mk-white) !important;
}

/* === Section Base === */
.mk-section {
    padding: var(--mk-spacing-3xl) 0;
}

.mk-section-title {
    text-align: center;
    margin-bottom: var(--mk-spacing-2xl);
}

.mk-section-title h2 {
    font-size: 2.25rem;
    margin-bottom: var(--mk-spacing-md);
    position: relative;
    display: inline-block;
}

.mk-section-title h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 50%;
    transform: translateX(50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--mk-primary), var(--mk-accent));
    border-radius: var(--mk-radius-full);
}

.mk-section-title p {
    color: var(--mk-gray-600);
    font-size: 1.1rem;
    max-width: 600px;
    margin: var(--mk-spacing-lg) auto 0;
}

/* === Cards === */
.mk-card {
    background: var(--mk-white);
    border-radius: var(--mk-radius-lg);
    overflow: hidden;
    box-shadow: var(--mk-shadow-md);
    transition: all var(--mk-transition-normal);
}

.mk-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--mk-shadow-xl);
}

/* === Utilities === */
.mk-text-center { text-align: center; }
.mk-text-primary { color: var(--mk-primary); }
.mk-bg-light { background-color: var(--mk-light); }
.mk-bg-dark { background-color: var(--mk-secondary-dark); }

/* === Responsive === */
@media (max-width: 1200px) {
    :root {
        --mk-container-max: 960px;
    }
}

@media (max-width: 992px) {
    :root {
        --mk-container-max: 720px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
}

@media (max-width: 768px) {
    :root {
        --mk-container-max: 540px;
        --mk-container-padding: 1rem;
    }
    
    .mk-section {
        padding: var(--mk-spacing-2xl) 0;
    }

    body.mk-front-page {
        overflow-x: hidden;
        max-width: 100%;
    }

    .mk-front-page-content,
    .mk-main {
        width: 100%;
        min-width: 0;
        overflow-x: hidden;
        max-width: 100%;
    }

    @supports (overflow: clip) {
        body.mk-front-page,
        .mk-front-page-content,
        .mk-main {
            overflow-x: clip;
        }
    }

    .mk-container {
        max-width: 100%;
        min-width: 0;
    }

    .mk-categories-carousel-wrapper,
    .mk-comparison-section,
    .mk-comparison-section .mk-container,
    .mk-services,
    .mk-features-section,
    .mk-popular-cars,
    .mk-appraisal-section,
    .mk-brands-section,
    .mk-magazine-section,
    .mk-hero,
    .mk-footer,
    .mk-car-archive-page,
    .mk-brand-archive-page,
    .mk-brand-page,
    .mk-single-car {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
    }

    @supports (overflow: clip) {
        .mk-categories-carousel-wrapper,
        .mk-comparison-section,
        .mk-comparison-section .mk-container,
        .mk-services,
        .mk-features-section,
        .mk-popular-cars,
        .mk-appraisal-section,
        .mk-brands-section,
        .mk-magazine-section,
        .mk-hero,
        .mk-footer,
        .mk-car-archive-page,
        .mk-brand-archive-page,
        .mk-brand-page,
        .mk-single-car {
            overflow-x: clip;
        }
    }

    .mk-comparison-top-nav,
    .mk-magazine-top-nav {
        max-width: 100%;
        min-width: 0;
    }
}

@media (max-width: 576px) {
    :root {
        --mk-container-max: 100%;
        --mk-container-padding: 0.85rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
}

/* === iOS Safari & iPhone === */
html {
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    max-width: 100%;
}

@supports (overflow: clip) {
    html,
    body {
        overflow-x: clip;
    }
}

.mk-site-top {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

body.menu-open,
body.mk-car-sidebar-open {
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
}

@supports (padding: max(0px)) {
    .mk-header.mk-sticky-header {
        top: env(safe-area-inset-top, 0px);
    }
}

