/* =========================================================
   صفحه‌ی نرخ زنده — بازطراحی ۲۰۲۶-۰۹ (فقط روی همین برگه بارگذاری می‌شه)
   زبانِ بصری: طلایی فقط برای تأکید، بدون گرادیانِ براق و سایه‌ی طلایی،
   ترنزیشن زیرِ ۲۵۰ms؛ حرکت فقط «زنده» و «تغییرِ عدد»
   ========================================================= */
html body.sg-rates-page .sg-lr {
    --lr-gold: var(--sg-gold, #C9A227);
    --lr-gold-d: #A88418;
    --lr-ink: #1A1A1A;
    --lr-muted: #767676;
    --lr-line: #ECE5D6;
    --lr-soft: #F8F7F4;
    --lr-up: #2F8F5B;
    --lr-down: #C84B31;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 12px 8px;
    color: var(--lr-ink);
}
html body.sg-rates-page .sg-lr * { box-sizing: border-box; }

/* ---------- کارتِ اصلی ---------- */
.sg-lr .sg-lr-hero {
    position: relative;
    overflow: hidden;
    margin: 4px 0 20px;
    padding: 20px 20px 0;
    border-radius: 20px;
    background: #1C1916;
    color: #F4EFE6;
}
.sg-lr .sg-lr-hero__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.8rem;
    color: #B9B0A2;
}
.sg-lr .sg-lr-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 11px;
    border: 1px solid rgba(201, 162, 39, 0.45);
    border-radius: 999px;
    color: var(--lr-gold);
    font-weight: 600;
    font-size: 0.78rem;
}
.sg-lr .sg-lr-live i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3FBF7F;
    animation: sgLrPulse 1.6s ease-in-out infinite;
}
@keyframes sgLrPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.8); }
}
.sg-lr .sg-lr-hero__h1 {
    margin: 16px 0 4px !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    color: #FFFFFF !important;
}
.sg-lr .sg-lr-hero__time {
    margin: 0 0 18px !important;
    font-size: 0.78rem;
    color: #9C9385;
}
.sg-lr .sg-lr-feature {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 14px;
    padding: 16px 0 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sg-lr .sg-lr-feature__name {
    flex-basis: 100%;
    font-size: 0.88rem;
    color: #CFC6B8;
}
.sg-lr .sg-lr-feature__price .sg-lr-num {
    font-size: 2.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #FFFFFF;
}
.sg-lr .sg-lr-feature__price .sg-lr-unit { font-size: 0.85rem; color: #9C9385; }
.sg-lr .sg-lr-feature .sg-lr-chg { font-size: 0.82rem; }
.sg-lr .sg-lr-feature .sg-lr-chg--up { background: rgba(63, 191, 127, 0.14); color: #6FD9A3; }
.sg-lr .sg-lr-feature .sg-lr-chg--down { background: rgba(232, 108, 84, 0.16); color: #F29A86; }
.sg-lr .sg-lr-feature .sg-lr-chg--flat,
.sg-lr .sg-lr-feature .sg-lr-chg--none { background: rgba(255, 255, 255, 0.07); color: #B9B0A2; }

.sg-lr .sg-lr-spark { margin: 8px -20px 0; }
.sg-lr .sg-lr-spark__svg { display: block; width: 100%; height: 86px; }
.sg-lr .sg-lr-spark__area { fill: rgba(201, 162, 39, 0.12); }
.sg-lr .sg-lr-spark__line { fill: none; stroke: var(--lr-gold); stroke-width: 2; }
.sg-lr .sg-lr-spark__legend {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 20px 12px;
    font-size: 0.74rem;
    color: #9C9385;
}
.sg-lr .sg-lr-spark__legend b { color: #E4DCCD; font-weight: 600; }
.sg-lr .sg-lr-progress {
    height: 3px;
    margin: 0 -20px;
    background: rgba(255, 255, 255, 0.06);
}
.sg-lr .sg-lr-progress i {
    display: block;
    height: 100%;
    background: var(--lr-gold);
    transform: scaleX(0);
    transform-origin: right center;
}
.sg-lr .sg-lr-empty { margin: 0; padding: 0 0 20px; color: #CFC6B8; }

/* ---------- برچسبِ تغییر ---------- */
.sg-lr .sg-lr-chg {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}
.sg-lr .sg-lr-chg small { font-size: 0.92em; font-weight: 500; opacity: 0.9; }
.sg-lr .sg-lr-chg--up { background: #EAF5EF; color: var(--lr-up); }
.sg-lr .sg-lr-chg--down { background: #FBEDEA; color: var(--lr-down); }
.sg-lr .sg-lr-chg--flat,
.sg-lr .sg-lr-chg--none { background: #F2EFE9; color: var(--lr-muted); font-weight: 500; }

/* ---------- گروه‌ها ---------- */
.sg-lr .sg-lr-group { margin: 0 0 22px; }
.sg-lr .sg-lr-group__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--lr-ink) !important;
}
.sg-lr .sg-lr-group__title::before {
    content: "";
    width: 4px;
    height: 16px;
    border-radius: 4px;
    background: var(--lr-gold);
}
.sg-lr .sg-lr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
@media (min-width: 720px) {
    .sg-lr .sg-lr-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
@media (min-width: 1000px) {
    .sg-lr .sg-lr-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.sg-lr .sg-lr-tile {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--lr-line);
    border-radius: 16px;
    background: #FFFFFF;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.sg-lr .sg-lr-tile__name { font-size: 0.82rem; color: var(--lr-muted); line-height: 1.5; }
.sg-lr .sg-lr-tile__price { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.sg-lr .sg-lr-tile__price .sg-lr-num { font-size: 1.12rem; font-weight: 700; color: var(--lr-ink); }
.sg-lr .sg-lr-tile__price .sg-lr-unit { font-size: 0.72rem; color: var(--lr-muted); }

/* عددِ تازه: یک لحظه پس‌زمینه‌ی طلاییِ کم‌رنگ (فقط وقتی واقعاً عوض شد) */
.sg-lr .sg-lr-flash { animation: sgLrFlash 1.2s ease-out; }
.sg-lr .sg-lr-hero .sg-lr-flash,
.sg-lr .sg-lr-feature.sg-lr-flash { animation: sgLrFlashDark 1.2s ease-out; }
@keyframes sgLrFlash { 0% { background-color: #FAF1D6; border-color: var(--lr-gold); } 100% { background-color: #FFFFFF; } }
@keyframes sgLrFlashDark { 0% { background-color: rgba(201, 162, 39, 0.18); } 100% { background-color: transparent; } }

/* ---------- محاسبه‌گر ---------- */
.sg-lr .sg-lr-calc,
.sg-lr .sg-lr-info {
    margin: 0 0 22px;
    padding: 18px;
    border: 1px solid var(--lr-line);
    border-radius: 18px;
    background: #FFFFFF;
}
.sg-lr .sg-lr-calc__row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.sg-lr .sg-lr-calc__field { display: flex; flex-direction: column; gap: 6px; margin: 0; font-size: 0.8rem; color: var(--lr-muted); }
.sg-lr .sg-lr-calc__field input,
.sg-lr .sg-lr-calc__field select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--lr-line) !important;
    border-radius: 12px !important;
    background: var(--lr-soft) !important;
    font: inherit;
    font-size: 1rem;
    color: var(--lr-ink);
    box-shadow: none !important;
}
.sg-lr .sg-lr-calc__field input:focus,
.sg-lr .sg-lr-calc__field select:focus { border-color: var(--lr-gold) !important; outline: none; background: #FFFFFF !important; }
.sg-lr .sg-lr-calc__out {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    margin: 14px 0 4px !important;
    padding: 14px;
    border-radius: 12px;
    background: var(--lr-soft);
    font-size: 0.85rem;
    color: var(--lr-muted);
}
.sg-lr .sg-lr-calc__val { font-size: 1.2rem; font-weight: 700; color: var(--lr-ink); }
.sg-lr .sg-lr-calc__note { margin: 0 0 14px !important; font-size: 0.74rem; color: var(--lr-muted); }
.sg-lr .sg-lr-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    border-radius: 12px;
    background: #2B2420;
    color: var(--lr-gold) !important;
    font-weight: 700;
    text-decoration: none !important;
    transition: background-color 0.2s ease;
}
.sg-lr .sg-lr-cta:hover { background: #1A1A1A; }


/* ---------- معرفی و پرسش‌ها ---------- */
.sg-lr .sg-lr-info__intro { margin: 0 0 18px !important; font-size: 0.9rem; line-height: 2; color: #3A3A3A; }
.sg-lr .sg-lr-faq__item { border-top: 1px solid var(--lr-line); }
.sg-lr .sg-lr-faq__item:first-child { border-top: 0; }
.sg-lr .sg-lr-faq__item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    list-style: none;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
}
.sg-lr .sg-lr-faq__item summary::-webkit-details-marker { display: none; }
.sg-lr .sg-lr-faq__item summary::after { content: "+"; flex: 0 0 auto; font-weight: 400; color: var(--lr-gold-d, #A88418); font-size: 1.2rem; }
.sg-lr .sg-lr-faq__item[open] summary::after { content: "−"; }
.sg-lr .sg-lr-faq__item p { margin: 0 0 14px !important; font-size: 0.86rem; line-height: 2; color: #4A4A4A; }

.sg-lr .sg-lr-disclaimer { margin: 0 0 8px !important; font-size: 0.74rem; line-height: 1.9; color: var(--lr-muted); text-align: center; }

/* ---------- دسکتاپ: کارتِ اصلی و محاسبه‌گر کنار هم ---------- */
@media (min-width: 1000px) {
    html body.sg-rates-page .sg-lr { padding-top: 8px; }
    .sg-lr .sg-lr-hero { padding: 26px 28px 0; }
    .sg-lr .sg-lr-spark,
    .sg-lr .sg-lr-progress { margin-left: -28px; margin-right: -28px; }
    .sg-lr .sg-lr-spark__legend { padding-left: 28px; padding-right: 28px; }
    .sg-lr .sg-lr-hero__h1 { font-size: 1.6rem !important; }
    .sg-lr .sg-lr-feature__price .sg-lr-num { font-size: 2.6rem; }
    /* calculator: fields beside result + button (share moved into the hero card) */
    .sg-lr .sg-lr-calc { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; align-items: center; }
    .sg-lr .sg-lr-calc > * { grid-column: 1 / -1; }
    .sg-lr .sg-lr-calc .sg-lr-calc__row { grid-column: 1; }
    .sg-lr .sg-lr-calc .sg-lr-calc__out { grid-column: 2; margin: 0 !important; }
    .sg-lr .sg-lr-hero__share { max-width: 460px; }
}

@media (prefers-reduced-motion: reduce) {
    .sg-lr .sg-lr-live i,
    .sg-lr .sg-lr-flash { animation: none !important; }
    .sg-lr .sg-lr-progress i { transition: none !important; }
}

.sg-lr .sg-lr-chg[hidden] { display: none !important; }
/* گوشی: کاشیِ تنهای ردیفِ آخر (گروه‌های ۳ و ۵ تایی) تمام‌عرض */
@media (max-width: 719px) {
    .sg-lr .sg-lr-grid > .sg-lr-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* ستونِ صفحه: قانونِ قدیمی ۸۲۰px بود (برای تابلوی تک‌ستونه)؛ حالا شبکه‌ی ۴ ستونه جا می‌خواد */
@media (min-width: 1000px) {
    html body.sg-rates-page .site-main,
    html body.sg-rates-page .entry-content { max-width: 1100px !important; width: 100% !important; margin-left: auto !important; margin-right: auto !important; }
}

/* ---------- اشتراک داخل کارت اصلی ---------- */
.sg-lr .sg-lr-hero__share {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 10px;
    margin: 16px 0 6px;
}
.sg-lr .sg-lr-hbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid rgba(244, 239, 230, 0.28);
    border-radius: 12px;
    background: transparent;
    color: #F4EFE6;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.sg-lr .sg-lr-hbtn:hover,
.sg-lr .sg-lr-hbtn:focus-visible { border-color: #C9A227; outline: none; }
.sg-lr .sg-lr-hbtn--primary { background: #C9A227; border-color: #C9A227; color: #1C1916; }
.sg-lr .sg-lr-hbtn--primary:hover,
.sg-lr .sg-lr-hbtn--primary:focus-visible { background: #D6B23C; border-color: #D6B23C; }
.sg-lr .sg-lr-hbtn[disabled] { opacity: 0.6; cursor: wait; }
.sg-lr .sg-lr-hbtn .sg-share-btn__t { white-space: nowrap; }
@media (max-width: 360px) {
    .sg-lr .sg-lr-hero__share { grid-template-columns: 1fr; }
}

/* ---------- آخرین تحلیل بازار (از «دانستنی‌ها») ---------- */
.sg-lr .sg-lr-market {
    display: grid;
    gap: 4px;
    margin: 0 0 22px;
    padding: 14px 18px;
    border: 1px solid var(--lr-line);
    border-inline-start: 3px solid #C9A227;
    border-radius: 14px;
    background: #FFFFFF;
    color: #2B2420;
    text-decoration: none !important;
    transition: border-color 0.2s ease;
}
.sg-lr .sg-lr-market:hover,
.sg-lr .sg-lr-market:focus-visible { border-color: #C9A227; outline: none; }
.sg-lr .sg-lr-market__label { font-size: 0.78rem; color: #A88418; }
.sg-lr .sg-lr-market__title { font-size: 0.98rem; font-weight: 700; line-height: 1.8; color: #2B2420; }
.sg-lr .sg-lr-market__more { font-size: 0.82rem; color: var(--lr-muted); }

/* --- Price trend chart: range buttons --- */
.sg-lr-trend { margin: 28px 0; }
.sg-lr-ranges {
	display: flex;
	gap: 6px;
	margin: 0 0 12px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.sg-lr-ranges::-webkit-scrollbar { display: none; }
.sg-lr-range {
	flex: none;
	height: 34px;
	padding: 0 14px;
	border: 1px solid #E4DED3;
	border-radius: 999px;
	background: #FFF;
	color: #2B2722;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	transition: border-color .15s, background-color .15s, color .15s;
}
.sg-lr-range:hover { border-color: #C9A227; }
.sg-lr-range[aria-pressed="true"] {
	border-color: #2B2722;
	background: #2B2722;
	color: #FFF;
	font-weight: 600;
}
.sg-lr-range:focus-visible { outline: 2px solid #C9A227; outline-offset: 2px; }
.sg-lr-trend__chart { transition: opacity .2s; }
.sg-lr-trend.is-loading .sg-lr-trend__chart { opacity: .55; }
.sg-lr-trend .sg-livechart { margin: 0; }
@media (prefers-reduced-motion: reduce) {
	.sg-lr-range, .sg-lr-trend__chart { transition: none; }
}
