/**
 * ECOIA — پایه و Reset
 * Reset + Typography + Global Styles
 * وابسته به: variables.css
 */

/* ─── Reset مدرن ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin:     0;
    padding:    0;
}

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

/* Lenis smooth scroll — disable native smooth to prevent double-easing */
html.lenis,
html.has-lenis {
    scroll-behavior: auto !important;
}

body {
    font-family:       var(--font-fa);
    font-size:         var(--text-base);
    font-weight:       400;
    line-height:       1.8;
    color:             var(--text-primary);
    background-color:  var(--bg-primary);
    direction:         rtl;
    text-align:        right;
    -webkit-font-smoothing:  antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x:        clip; /* clip ≠ hidden: doesn't make body a scroll container */
}

/* جلوگیری از لرزش صفحه هنگام باز شدن modal */
body.modal-open {
    overflow: hidden;
}

/* ─── لینک‌ها ─────────────────────────────────────────────────────────────── */
a {
    color:           var(--gold-main);
    text-decoration: none;
    transition:      color var(--transition-base);
}

a:hover {
    color: var(--gold-light);
}

a:focus-visible {
    outline:        2px solid var(--gold-main);
    outline-offset: 3px;
    border-radius:  var(--radius-sm);
}

/* ─── تصاویر ─────────────────────────────────────────────────────────────── */
img, svg, video {
    display:   block;
    max-width: 100%;
    height:    auto;
}

img {
    object-fit: cover;
}

/* ─── عناوین ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family:  var(--font-fa);
    font-weight:  700;
    line-height:  1.3;
    color:        var(--text-primary);
    margin-bottom: var(--space-4);
}

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

/* عنوان انگلیسی: Playfair Display */
.en-display,
.brand-name,
.hero-title-en {
    font-family: var(--font-en-display);
    direction:   ltr;
    text-align:  center;
}

/* متن انگلیسی: Outfit */
.en-body,
.contact-info,
.address-en,
.label-en,
.counter-number {
    font-family: var(--font-en-body);
    direction:   ltr;
}

/* ─── پاراگراف و متن ────────────────────────────────────────────────────── */
p {
    margin-bottom: var(--space-4);
    color:         var(--text-secondary);
    line-height:   1.9;
}

p:last-child {
    margin-bottom: 0;
}

strong, b {
    font-weight: 700;
    color:       var(--text-primary);
}

em, i {
    font-style: italic;
}

small {
    font-size: var(--text-sm);
    color:     var(--text-muted);
}

/* ─── لیست‌ها ────────────────────────────────────────────────────────────── */
ul, ol {
    padding-right: var(--space-6);
    margin-bottom: var(--space-4);
}

li {
    margin-bottom: var(--space-2);
    color:         var(--text-secondary);
}

/* ─── جداول ────────────────────────────────────────────────────────────── */
table {
    width:           100%;
    border-collapse: collapse;
    margin-bottom:   var(--space-6);
}

th, td {
    padding:     var(--space-3) var(--space-4);
    text-align:  right;
    border-bottom: 1px solid var(--border-subtle);
}

th {
    font-weight:      700;
    color:            var(--gold-main);
    background-color: var(--bg-card);
    font-size:        var(--text-sm);
    letter-spacing:   0.05em;
}

tr:hover td {
    background-color: var(--bg-card);
}

/* ─── فرم‌های پایه ──────────────────────────────────────────────────────── */
input, textarea, select {
    font-family: var(--font-fa);
    font-size:   var(--text-base);
    direction:   rtl;
}

button {
    cursor:      pointer;
    font-family: var(--font-fa);
    font-size:   var(--text-base);
    border:      none;
    background:  none;
}

/* ─── کدنویسی ────────────────────────────────────────────────────────────── */
code, pre, kbd {
    font-family: 'Courier New', Courier, monospace;
    direction:   ltr;
    text-align:  left;
}

code {
    background: var(--bg-card);
    color:      var(--gold-light);
    padding:    2px 6px;
    border-radius: var(--radius-sm);
    font-size:  0.9em;
}

/* ─── خط افقی ────────────────────────────────────────────────────────────── */
hr {
    border:     none;
    border-top: 1px solid var(--border-subtle);
    margin:     var(--space-8) 0;
}

/* خط تزئینی طلایی */
hr.gold {
    border-top-color: var(--border-gold-faint);
}

/* ─── متون انتخابی ──────────────────────────────────────────────────────── */
::selection {
    background-color: var(--gold-muted-strong);
    color:            var(--gold-main);
}

::-moz-selection {
    background-color: var(--gold-muted-strong);
    color:            var(--gold-main);
}

/* ─── Scrollbar سفارشی ──────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background:    var(--border-default);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* ─── دکوراسیون بخش‌ها ──────────────────────────────────────────────────── */

/* عنوان بخش استاندارد */
.section-title {
    font-size:     clamp(1.5rem, 3vw, 2.25rem);
    font-weight:   700;
    color:         var(--text-primary);
    margin-bottom: var(--space-3);
    position:      relative;
    display:       inline-block;
}

/* خط تزئینی زیر عنوان */
.section-divider {
    display:        flex;
    align-items:    center;
    gap:            var(--space-3);
    margin-bottom:  var(--space-12);
    justify-content: center;
}

.section-divider::before,
.section-divider::after {
    content:    '';
    flex:       1;
    max-width:  80px;
    height:     1px;
    background: var(--gold-gradient);
}

.section-divider span {
    display:       block;
    width:         6px;
    height:        6px;
    border-radius: 50%;
    background:    var(--gold-main);
    box-shadow:    0 0 8px var(--gold-glow);
}

/* ─── کلاس‌های کمکی (Utility) ──────────────────────────────────────────── */
.text-gold    { color: var(--gold-main) !important; }
.text-primary { color: var(--text-primary) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-center  { text-align: center !important; }
.text-right   { text-align: right !important; }
.text-left    { text-align: left !important; direction: ltr !important; }

.d-none     { display: none !important; }
.d-block    { display: block !important; }
.d-flex     { display: flex !important; }
.d-grid     { display: grid !important; }

.mt-auto  { margin-top:  auto !important; }
.mb-0     { margin-bottom: 0 !important; }
.w-100    { width: 100% !important; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ─── انیمیشن fade برای AOS ────────────────────────────────────────────── */
[data-aos] {
    pointer-events: none;
}

[data-aos].aos-animate {
    pointer-events: auto;
}
