/**
 * Modlino Design System — Base
 * Reset، typography ریشه، container، utilities پایه
 */

@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('../../fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 800; font-style: normal; font-display: swap;
}

/* ═══ BASE ════════════════════════════════════════════════════ */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--m-font-sans);
    font-size: var(--m-text-base);
    line-height: var(--m-leading-normal);
    color: var(--m-text);
    background: var(--m-bg);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--m-primary-soft);
    color: var(--m-primary-hover);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--m-font-sans);
    color: var(--m-text-strong);
    font-weight: var(--m-weight-extrabold);
    line-height: var(--m-leading-tight);
    letter-spacing: -0.01em;
    margin: 0;
}

h1 { font-size: var(--m-text-4xl); }
h2 { font-size: var(--m-text-3xl); }
h3 { font-size: var(--m-text-2xl); }
h4 { font-size: var(--m-text-xl); font-weight: var(--m-weight-bold); }
h5 { font-size: var(--m-text-lg); font-weight: var(--m-weight-bold); }
h6 { font-size: var(--m-text-md); font-weight: var(--m-weight-bold); }

p { margin: 0 0 var(--m-space-3); line-height: var(--m-leading-relaxed); }
p:last-child { margin-bottom: 0; }

a {
    color: var(--m-text-link);
    text-decoration: none;
    transition: color var(--m-duration-fast) var(--m-ease-standard);
}
a:hover { color: var(--m-primary-hover); }

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

button {
    font-family: inherit;
    cursor: pointer;
}

/* Focus visible */
*:focus-visible {
    outline: 2px solid var(--m-border-focus);
    outline-offset: 2px;
    border-radius: var(--m-radius-sm);
}

/* ═══ CONTAINER ═══════════════════════════════════════════════ */

.m-container,
.ct-container {
    max-width: var(--m-container-max);
    margin-inline: auto;
    padding-inline: var(--m-container-gutter);
    width: 100%;
}

.m-container-fluid {
    max-width: none;
    margin-inline: auto;
    padding-inline: var(--m-container-gutter);
    width: 100%;
}

/* ═══ FONT SCOPE — override Blocksy globally ══════════════════ */

body, body * {
    font-family: var(--m-font-sans);
}
body code, body pre, body kbd, body samp {
    font-family: var(--m-font-mono);
}

/* ═══ UTILITY CLASSES ═════════════════════════════════════════ */

.m-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;
}

.m-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.m-line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.m-flex { display: flex; }
.m-grid { display: grid; }
.m-hidden { display: none; }

/* Spacing helpers (use sparingly) */
.m-stack > * + * { margin-top: var(--m-space-4); }
.m-stack-sm > * + * { margin-top: var(--m-space-2); }
.m-stack-lg > * + * { margin-top: var(--m-space-6); }

/* Section padding */
.m-section { padding-block: var(--m-space-12); }
.m-section-sm { padding-block: var(--m-space-8); }
.m-section-lg { padding-block: var(--m-space-16); }

@media (max-width: 768px) {
    .m-section { padding-block: var(--m-space-8); }
    .m-section-lg { padding-block: var(--m-space-10); }
}

/* Section heading pattern (reused everywhere) */
.m-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--m-space-6);
    gap: var(--m-space-4);
}
.m-section-title {
    font-size: var(--m-text-2xl);
    font-weight: var(--m-weight-extrabold);
    color: var(--m-text-strong);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--m-space-3);
}
.m-section-title::before {
    content: "";
    width: 4px;
    height: 22px;
    background: var(--m-primary);
    border-radius: var(--m-radius-xs);
}
.m-section-link {
    color: var(--m-primary);
    font-size: var(--m-text-sm);
    font-weight: var(--m-weight-semibold);
    display: inline-flex;
    align-items: center;
    gap: var(--m-space-1);
    transition: gap var(--m-duration-fast) var(--m-ease-standard);
}
.m-section-link:hover {
    gap: var(--m-space-3);
    color: var(--m-primary);
}

/* Persian numerals */
.m-num-fa {
    font-variant-numeric: tabular-nums;
}

/* Visually hide WP admin bar interference */
#wpadminbar { background: var(--m-color-neutral-900) !important; }


/* === Page background override (Blocksy default cream → white) === */
html, body {
    background: var(--m-bg) !important;
    background-color: var(--m-bg) !important;
}

/* === Hide hero/title on home page === */
body.home .hero-section,
body.page-id-4006 .hero-section,
body.page-id-4006 .entry-header,
body.home .entry-header,
body.home .page-title,
body.page-id-4006 .page-title {
    display: none !important;
}

/* === Single product wrapper has-wide width === */
body.single-product main#main {
    background: var(--m-bg);
}

/* === Hide entry-meta on archive === */
.ct-archive-template .entry-meta { display: none; }

/* === Coming Soon notice hide (Iran can't reach Stripe etc.) === */
.wc-launch-your-store-notice,
.ls-launch-store-notice-container,
[class*="coming-soon-notice"],
.woocommerce-store-notice { display: none; }

/* === remove Blocksy outline buttons defaults === */
.wp-element-button, .ct-button, button.button,
.woocommerce a.button, .woocommerce button.button,
.woocommerce-page .button {
    background: var(--m-primary);
    color: var(--m-text-on-brand);
    border: none;
    border-radius: var(--m-radius-md);
    padding: 10px 22px;
    font-weight: var(--m-weight-semibold);
    text-transform: none;
    letter-spacing: 0;
    font-size: var(--m-text-base);
    cursor: pointer;
    transition: all var(--m-duration-fast) var(--m-ease-standard);
    box-shadow: var(--m-shadow-brand);
    font-family: var(--m-font-sans);
}
.wp-element-button:hover, .ct-button:hover,
.woocommerce a.button:hover, .woocommerce button.button:hover {
    background: var(--m-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--m-shadow-brand-strong);
}
