/*
Theme Name: Medra
Theme URI: https://medrafab.com
Author: Medra
Description: پوسته‌ی اختصاصی مدرا — سایت مینیمال سه‌صفحه‌ای برای فروش استند موبایل ساخت ایران.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: medra
*/

@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #F7F5F0;
  --card: #FFFFFF;
  --ink: #1D1D1F;
  --muted: #66666C;
  --line: #E7E3DB;
  --accent: #E8622C;
  --accent-dark: #C94E1D;
  --accent-soft: #FBE7DC;
  --radius: 22px;
  --shadow: 0 1px 2px rgba(29, 29, 31, .04), 0 12px 32px -16px rgba(29, 29, 31, .18);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  direction: rtl;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.45; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.3rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 480px) { .container { padding: 0 16px; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247, 245, 240, .86);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 72px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand-name { font-size: 1.45rem; font-weight: 900; line-height: 1; }
.brand-name small { display: block; font-size: .58rem; font-weight: 600; letter-spacing: .28em; color: var(--muted); margin-top: 5px; direction: ltr; text-align: right; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 500; font-size: .95rem; color: var(--muted); transition: background .2s, color .2s; }
.nav a:hover { color: var(--ink); background: rgba(29, 29, 31, .05); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.nav .btn { margin-inline-start: 8px; }
@media (max-width: 680px) {
  .nav .btn { display: none; }
  .nav a { padding: 6px 10px; font-size: .9rem; }
  .brand-name small { display: none; }
}
@media (max-width: 380px) { .brand img { width: 34px; height: 34px; } .nav { gap: 0; } .nav a { padding: 6px 8px; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; border: 0;
  font: inherit; font-weight: 700; font-size: 1rem; line-height: 1.4;
  text-decoration: none; cursor: pointer;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff !important; box-shadow: 0 8px 20px -10px rgba(232, 98, 44, .8); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: var(--card); color: var(--ink) !important; box-shadow: inset 0 0 0 1px var(--line); }
.btn-dark { background: var(--ink); color: #fff !important; }
.btn-light { background: #fff; color: var(--ink) !important; }
.btn .ltr { white-space: nowrap; }
.btn svg { width: 18px; height: 18px; flex: none; }
.nav .btn { padding: 9px 18px; font-size: .92rem; color: #fff; }

/* ---------- hero ---------- */
.hero { padding: 64px 0 40px; overflow: hidden; }
.hero .container { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 40px; }
.hero h1 span { color: var(--accent); }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }
.hero-art img { width: 100%; max-width: 620px; margin-inline-start: auto; }
@media (max-width: 880px) {
  .hero { padding-top: 36px; }
  .hero .container { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art img { margin: 0 auto; max-width: 460px; }
}

.badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 8px; margin-bottom: 18px;
  background: var(--card); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line);
  font-size: .9rem; font-weight: 600;
}
.flag { display: inline-flex; flex-direction: column; width: 22px; height: 15px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.flag i { flex: 1; }
.flag i:nth-child(1) { background: #239F40; }
.flag i:nth-child(2) { background: #fff; }
.flag i:nth-child(3) { background: #DA0000; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; list-style: none; }
.chips li { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--muted); }
.chips li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.chips li + li { margin-inline-start: 10px; }

/* ---------- sections ---------- */
.section { padding: 72px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.eyebrow { display: inline-block; color: var(--accent); font-weight: 700; font-size: .9rem; margin-bottom: 8px; }

.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.card p { color: var(--muted); margin: 0; font-size: .97rem; }
.icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.icon svg { width: 24px; height: 24px; }

/* ---------- products ---------- */
.product { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.product-img { aspect-ratio: 1 / 1; overflow: hidden; background: var(--accent-soft); }
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.product:hover .product-img img { transform: scale(1.04); }
.product-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.product-body p { color: var(--muted); font-size: .95rem; margin-bottom: 18px; flex: 1; }
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.product-top h3 { margin: 0; }
.tag { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.link-arrow { font-weight: 700; color: var(--accent); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link-arrow:hover { gap: 10px; }
.link-arrow::after { content: "←"; transition: inherit; }

/* ---------- process ---------- */
.process { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }
@media (max-width: 880px) { .process { grid-template-columns: 1fr; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start; background: var(--card); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.steps li::before { content: "۱"; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; font-weight: 800; }
.steps li:nth-child(2)::before { content: "۲"; }
.steps li:nth-child(3)::before { content: "۳"; }
.steps li:nth-child(4)::before { content: "۴"; }
.steps h3 { margin: 0 0 4px; }
.steps p { margin: 0; color: var(--muted); font-size: .95rem; }
.diagram { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; min-height: 380px; }
.diagram h3 { color: #fff; margin: 0; }
.diagram p { color: rgba(255, 255, 255, .65); margin: 0; font-size: .95rem; }
.diagram svg { width: 100%; max-width: 420px; margin: 0 auto; display: block; }

/* ---------- CTA band ---------- */
.cta { background: var(--accent); color: #fff; border-radius: 28px; padding: 48px; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 7px); pointer-events: none; }
.cta > * { position: relative; }
.cta h2 { color: #fff; margin-bottom: 6px; }
.cta p { margin: 0; color: rgba(255, 255, 255, .88); }
.cta .phone-big { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; }
@media (max-width: 560px) { .cta { padding: 32px 24px; } }

/* ---------- inner pages ---------- */
.page-hero { padding: 64px 0 24px; }
.page-hero .lead { max-width: 40em; }
.story { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: stretch; }
@media (max-width: 880px) { .story { grid-template-columns: 1fr; } }
.story .card { padding: 36px; }
.story .card p { font-size: 1.05rem; color: var(--ink); margin-bottom: 1.1em; }
.story .card p:last-child { margin-bottom: 0; }
.portrait { background: var(--accent-soft); border-radius: var(--radius); display: grid; place-items: center; padding: 36px; position: relative; overflow: hidden; min-height: 320px; }
.portrait::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(232, 98, 44, .10) 0 2px, transparent 2px 8px); }
.portrait img { width: 52%; max-width: 200px; position: relative; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .18)); }
.portrait figcaption { position: absolute; bottom: 18px; inset-inline: 18px; background: var(--card); border-radius: 14px; padding: 12px 16px; font-size: .92rem; box-shadow: var(--shadow); }
.portrait figcaption strong { display: block; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.facts div { padding: 24px 28px; }
.facts div + div { border-inline-start: 1px solid var(--line); }
.facts span { display: block; color: var(--muted); font-size: .88rem; }
.facts strong { font-size: 1.05rem; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; } .facts div + div { border-inline-start: 0; border-top: 1px solid var(--line); } }

blockquote.quote { margin: 0; padding: 28px 32px; border-inline-start: 4px solid var(--accent); background: var(--card); border-radius: var(--radius); border-start-start-radius: 0; border-end-start-radius: 0; box-shadow: var(--shadow); font-size: 1.15rem; font-weight: 500; }
blockquote.quote cite { display: block; margin-top: 10px; font-size: .9rem; font-style: normal; color: var(--muted); }

.contact-card { display: flex; flex-direction: column; }
.contact-card .value { font-size: 1.3rem; font-weight: 800; color: var(--ink); margin: 4px 0 18px; line-height: 1.6; }
.contact-card .row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.contact-card .btn { padding: 10px 18px; font-size: .92rem; }

/* ---------- generic WordPress content ---------- */
.entry { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px; margin-bottom: 72px; }
.entry > *:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
.site-footer { margin-top: 24px; padding: 48px 0 32px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }
.site-footer h4 { margin: 0 0 12px; font-size: 1rem; }
.site-footer p, .site-footer li { color: var(--muted); font-size: .95rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.copy { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .85rem; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
