/*
 * استایل اختصاصی میکروسایت‌های آریاشیمی (شرق / پلاست / بذر)
 * — تک‌فایل مستقل، RTL، بدون وابستگی به CSS سایت اصلی.
 * رنگ سازمانی هر سایت با متغیر --site-accent از layout تزریق می‌شود.
 */

@font-face {
    font-family: IRANYekan;
    src: url('../../fonts/iranyekan/IRANYekanRegular.ttf') format('truetype');
    font-display: swap;
}

:root {
    --site-accent: #b31426;
    --ink: #1f2430;
    --ink-soft: #4c5566;
    --muted: #737d8f;
    --paper: #ffffff;
    --paper-soft: #f7f8fa;
    --line: #e6e9ef;
    --card: #ffffff;
    --shadow: 0 14px 40px rgba(24, 30, 44, .08);
    --radius: 16px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--paper-soft);
    color: var(--ink);
    font-family: IRANYekan, Tahoma, Arial, sans-serif;
    font-size: 15px;
    line-height: 2;
    direction: rtl;
}

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

a { color: inherit; text-decoration: none; transition: color .2s, border-color .2s, background .2s, transform .2s, box-shadow .2s; }

h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.6; color: var(--ink); }

h1 { font-size: 1.65rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }

p { margin: 0 0 .75rem; }

.container { width: min(1140px, calc(100% - 40px)); margin-inline: auto; }
.container-narrow { max-width: 860px; }

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

/* ---------- چیدمان کلی: فوتر همیشه چسبان به پایین ---------- */
.page-shell { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1 0 auto; padding-bottom: 56px; }
.site-footer { flex-shrink: 0; margin-top: auto; }

/* ---------- هدر ---------- */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { height: 40px; width: auto; }
.brand-name { font-weight: 700; font-size: 1.02rem; white-space: nowrap; color: var(--ink); }

.site-nav ul {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    display: inline-block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink-soft);
    font-size: .95rem;
}

.nav-link:hover { color: var(--site-accent); background: var(--paper-soft); }

.nav-link.is-active {
    color: var(--site-accent);
    font-weight: 700;
    background: color-mix(in srgb, var(--site-accent) 8%, var(--paper));
}

/* دکمهٔ قرمز ورود در انتهای منو (طبق طراحی تاییدشده) */
.nav-auth { display: flex; align-items: center; gap: 8px; margin-inline-start: 8px; }

.btn-login {
    display: inline-block;
    padding: 8px 22px;
    border-radius: var(--radius-sm);
    background: var(--site-accent);
    color: #fff;
    font-weight: 700;
    font-size: .95rem;
    border: 1px solid var(--site-accent);
    cursor: pointer;
}

.btn-login:hover { filter: brightness(1.08); box-shadow: 0 6px 18px color-mix(in srgb, var(--site-accent) 35%, transparent); }

.btn-login.is-logged-in { background: var(--paper); color: var(--site-accent); }
.btn-login.is-logged-in:hover { background: var(--paper-soft); }

.member-name { font-size: .9rem; color: var(--muted); white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }

.inline-form { display: inline; }

/* منوی موبایل (بدون JS) */
.nav-toggle { display: none; }

.nav-toggle-label {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.nav-toggle-label span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .2s; }

@media (max-width: 900px) {
    .nav-toggle-label { display: flex; }

    .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        inset-inline: 0;
        background: var(--paper);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
    }

    .nav-toggle:checked ~ .site-nav { display: block; }

    .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 20px 16px; }

    .nav-link { display: block; padding: 12px; }

    .nav-auth { margin: 10px 0 0; }
}

/* ---------- دکمه‌ها ---------- */
.btn {
    display: inline-block;
    padding: 10px 26px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: .98rem;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary { background: var(--site-accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 22px color-mix(in srgb, var(--site-accent) 35%, transparent); transform: translateY(-1px); }

.btn-ghost { background: var(--paper); color: var(--site-accent); border-color: color-mix(in srgb, var(--site-accent) 45%, var(--paper)); }
.btn-ghost:hover { background: color-mix(in srgb, var(--site-accent) 7%, var(--paper)); }

.btn-light { background: #fff; color: var(--site-accent); }
.btn-light:hover { filter: brightness(.97); }

.btn-small { padding: 6px 16px; font-size: .85rem; }
.btn-block { width: 100%; }

/* ---------- هیروی خانه ---------- */
.hero {
    background:
        radial-gradient(900px 300px at 85% -60px, color-mix(in srgb, var(--site-accent) 12%, transparent), transparent 70%),
        linear-gradient(180deg, #fff, var(--paper-soft));
    padding: 64px 0 56px;
    border-bottom: 1px solid var(--line);
}

.hero-inner { display: flex; align-items: center; gap: 32px; }
.hero-text { flex: 1 1 60%; }
.hero-logo { flex: 0 0 260px; display: flex; justify-content: center; }
.hero-logo img { max-height: 220px; width: auto; opacity: .95; }

.hero-kicker { color: var(--site-accent); font-weight: 700; font-size: .95rem; letter-spacing: .2px; }
.hero-tagline { font-size: 1.15rem; color: var(--ink-soft); }
.hero-description { color: var(--muted); }
.hero-actions { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }

@media (max-width: 720px) {
    .hero { padding: 44px 0 40px; }
    .hero-inner { flex-direction: column; text-align: center; }
    .hero-logo { order: -1; }
    .hero-logo img { max-height: 130px; }
    .hero-actions { justify-content: center; }
}

/* ---------- بخش‌ها ---------- */
.section { padding: 48px 0; }
.section-tint { background: var(--paper); border-block: 1px solid var(--line); }
.section-title { margin-bottom: 22px; position: relative; padding-inline-start: 14px; }
.section-title::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: .45em;
    bottom: .45em;
    width: 4px;
    border-radius: 4px;
    background: var(--site-accent);
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.link-more { color: var(--site-accent); font-weight: 700; font-size: .92rem; }
.link-more:hover { text-decoration: underline; }

/* ---------- کارت‌های دسترسی سریع ---------- */
.quick-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }

.quick-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(24, 30, 44, .04);
}

.quick-card:hover { border-color: color-mix(in srgb, var(--site-accent) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }

.quick-icon { font-size: 1.3rem; color: var(--site-accent); }
.quick-desc { color: var(--muted); font-size: .88rem; }

/* ---------- محصولات ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }

.product-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 14px rgba(24, 30, 44, .04);
}

.product-card:hover { border-color: color-mix(in srgb, var(--site-accent) 45%, var(--line)); box-shadow: var(--shadow); transform: translateY(-2px); }

.product-media {
    aspect-ratio: 1 / 1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.product-media img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }

.product-media-empty { color: #c3c9d4; font-size: .82rem; }

.product-info { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; }
.product-info p { color: var(--muted); font-size: .88rem; margin: 0; }

/* ---------- جزئیات محصول ---------- */
.product-detail { display: grid; grid-template-columns: minmax(260px, 420px) 1fr; gap: 28px; align-items: start; }
.product-detail-media { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.product-detail-media img { object-fit: contain; }
.product-summary { font-size: 1.05rem; color: var(--ink-soft); }
.product-cta { margin-top: 10px; }

@media (max-width: 860px) {
    .product-detail { grid-template-columns: 1fr; }
}

/* ---------- جستجو ---------- */
.search-bar { display: flex; gap: 10px; max-width: 480px; margin-bottom: 24px; }
.search-bar input[type="search"] {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--paper);
}
.search-bar input[type="search"]:focus { outline: 2px solid color-mix(in srgb, var(--site-accent) 55%, transparent); outline-offset: 1px; border-color: var(--site-accent); }

/* ---------- صفحهٔ محتوایی ---------- */
.page-hero { background: linear-gradient(180deg, #fff, var(--paper-soft)); border-bottom: 1px solid var(--line); padding: 34px 0 26px; }

.breadcrumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .86rem; margin-bottom: 6px; }
.breadcrumbs a:hover { color: var(--site-accent); }

.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; }
.prose h2, .prose h3 { margin-top: 1.2rem; }
.prose a { color: var(--site-accent); text-decoration: underline; }
.prose ul, .prose ol { padding-inline-start: 1.4rem; }
.prose img { border-radius: var(--radius-sm); margin: 10px 0; }
.prose table { border-collapse: collapse; width: 100%; }
.prose table td, .prose table th { border: 1px solid var(--line); padding: 8px 10px; }

/* ---------- امور سهامداران ---------- */
.member-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: color-mix(in srgb, var(--site-accent) 7%, var(--paper));
    border: 1px solid color-mix(in srgb, var(--site-accent) 25%, var(--line));
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin: 18px 0 26px;
    flex-wrap: wrap;
}

.post-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 34px; }

.post-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.post-card:hover { border-color: color-mix(in srgb, var(--site-accent) 40%, var(--line)); }

.post-confidential { border-inline-start: 4px solid var(--site-accent); }

.post-card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.post-card-body { color: var(--ink-soft); }
.post-card-foot { display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: .86rem; margin-top: 6px; flex-wrap: wrap; }

.post-badge {
    background: color-mix(in srgb, var(--site-accent) 10%, var(--paper));
    color: var(--site-accent);
    border: 1px solid color-mix(in srgb, var(--site-accent) 30%, var(--line));
    font-size: .78rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 12px;
}

.post-file-link { color: var(--site-accent); font-weight: 700; }
.post-file-link:hover { text-decoration: underline; }

.gate-card {
    background: var(--card);
    border: 1px dashed color-mix(in srgb, var(--site-accent) 45%, var(--line));
    border-radius: var(--radius);
    padding: 34px 22px;
}

.gate-card-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gate-icon { font-size: 1.9rem; }
.gate-hint { color: var(--muted); font-size: .86rem; max-width: 420px; }

/* ---------- تماس ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1.15fr; gap: 26px; align-items: start; }

@media (max-width: 860px) {
    .contact-layout { grid-template-columns: 1fr; }
}

.contact-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.contact-list li { display: flex; gap: 10px; align-items: baseline; }
.contact-label { font-weight: 700; color: var(--site-accent); min-width: 72px; }

.contact-form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-field label { font-weight: 700; font-size: .92rem; }
.form-field input, .form-field textarea {
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font: inherit;
    background: var(--paper-soft);
}
.form-field input:focus, .form-field textarea:focus { outline: 2px solid color-mix(in srgb, var(--site-accent) 55%, transparent); outline-offset: 1px; border-color: var(--site-accent); background: #fff; }

.field-error { color: #c62828; font-size: .84rem; margin: 0; }
.req { color: #c62828; }

.form-check { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; cursor: pointer; }

.alert {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin: 18px 0 0;
    border: 1px solid transparent;
}

.alert-success { background: #edf7f0; border-color: #bfe3cc; color: #1c6b3a; }

/* ---------- لاگین ---------- */
.login-card {
    max-width: 430px;
    margin: 40px auto 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 32px 28px;
}

.login-head { text-align: center; margin-bottom: 20px; }
.login-icon { color: var(--site-accent); font-size: 1.6rem; }
.login-head p { color: var(--muted); font-size: .92rem; }
.login-hint { text-align: center; color: var(--muted); font-size: .84rem; margin: 16px 0 0; }

/* ---------- 404 ---------- */
.notfound-card { text-align: center; padding: 60px 20px; }
.notfound-code { font-size: 3.4rem; font-weight: 700; color: color-mix(in srgb, var(--site-accent) 70%, var(--paper)); margin: 0; }
.notfound-card p { color: var(--muted); }
.notfound-card .btn { margin-top: 8px; }

/* ---------- CTA ---------- */
.section-cta { padding: 0 0 48px; }

.cta-inner {
    background: linear-gradient(120deg, var(--site-accent), color-mix(in srgb, var(--site-accent) 72%, #000));
    color: #fff;
    border-radius: var(--radius);
    padding: 34px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 18px 44px color-mix(in srgb, var(--site-accent) 30%, transparent);
}

.cta-inner h2 { color: #fff; margin: 0; }
.cta-inner p { margin: 0; opacity: .92; }

/* ---------- فوتر ---------- */
.site-footer { background: #14181f; color: #c9cfd8; margin-top: 0; }

.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr 1.1fr;
    gap: 28px;
    padding: 42px 0 26px;
}

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
}

.site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: 12px; }

.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; margin-bottom: 8px; }
.footer-logo { height: 34px; width: auto; }

.footer-tagline { margin: 0 0 6px; }
.footer-note { color: #98a1af; font-size: .9rem; }

.footer-contact, .footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: .92rem; }
.fc-label { color: #98a1af; }
.footer-links a:hover { color: #fff; }
.footer-group { font-size: .92rem; }
.footer-group a { color: #fff; text-decoration: underline; }

.footer-bottom { border-top: 1px solid #2a313c; padding: 16px 0 20px; }
.footer-bottom p { margin: 0; text-align: center; color: #98a1af; font-size: .86rem; }

/* ---------- حالت خالی ---------- */
.empty-state { text-align: center; color: var(--muted); padding: 46px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- صفحه‌بندی (لینک‌های پیش‌فرض) ---------- */
.pagination { margin-top: 26px; display: flex; justify-content: center; }
.pagination :is(ul, nav) { display: inline-flex; gap: 6px; list-style: none; flex-wrap: wrap; }
.pagination a, .pagination span {
    display: inline-block;
    min-width: 38px;
    padding: 7px 12px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink-soft);
    font-size: .9rem;
}
.pagination .current { background: var(--site-accent); color: #fff; border-color: var(--site-accent); font-weight: 700; }
.pagination a:hover { border-color: var(--site-accent); color: var(--site-accent); }
