/* ════════════════════════════════════════════════════════════
   GOLD FORECAST PAGE
   Tokens match tejaratafarin.com widget design system.
════════════════════════════════════════════════════════════ */
.gf-page {
    --surface: #ffffff;
    --bg:      #f8fafc;
    --border:  #e2e8f0;
    --accent:  #0284c7;
    --al:      rgba(2,132,199,0.08);
    --ab:      rgba(2,132,199,0.22);
    --text:    #0f172a;
    --soft:    #334155;
    --muted:   #94a3b8;
    --hbg:     #f1f5f9;
    --gold:    #d97706;
    --gold-bg: rgba(217,119,6,0.08);
    --gold-b:  rgba(217,119,6,0.22);
    --gold-l:  rgba(217,119,6,0.05);
    --up:      #16a34a;
    --up-bg:   rgba(22,163,74,0.08);
    --dn:      #dc2626;
    --radius:  16px;

    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 48px;
    color: var(--text);
}
.gf-page * { box-sizing: border-box; margin: 0; }

/* ── HERO ── */
.gf-hero {
    position: relative;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0c1a2e 100%);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
    padding: 48px 36px 40px;
}
.gf-hero::before {
    content: '';
    position: absolute; inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 20% 50%, rgba(217,119,6,0.18) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 80% 20%, rgba(2,132,199,0.14) 0%, transparent 60%);
    pointer-events: none;
}
.gf-hero::after {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), #fbbf24, var(--gold), transparent);
}
.gf-hero-inner { position: relative; z-index: 1; max-width: 700px; }

.gf-hero-badge {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 10.5px; font-weight: 700; color: var(--gold);
    background: rgba(217,119,6,0.15); border: 1px solid rgba(217,119,6,0.35);
    border-radius: 20px; padding: 4px 14px; margin-bottom: 18px; letter-spacing: .3px;
}
.gf-hero-badge-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--gold);
    animation: gf-pulse 1.8s ease-in-out infinite;
}
@keyframes gf-pulse {
    0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.4;transform:scale(.7)}
}
.gf-hero-title {
    font-size: clamp(22px, 4vw, 34px); font-weight: 800;
    color: #ffffff; line-height: 1.3; margin-bottom: 14px; direction: rtl;
}
.gf-hero-sub {
    font-size: 14px; color: #94a3b8; line-height: 1.8;
    margin-bottom: 28px; direction: rtl;
}
.gf-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.gf-btn-primary {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: #ffffff;
    background: linear-gradient(135deg, var(--gold), #b45309);
    border: none; border-radius: 10px; padding: 10px 22px;
    cursor: pointer; transition: opacity .2s, transform .18s;
    box-shadow: 0 4px 16px rgba(217,119,6,.4);
    text-decoration: none; white-space: nowrap;
}
.gf-btn-primary:hover { opacity: .88; transform: translateY(-2px); }
.gf-btn-secondary {
    display: inline-flex; align-items: center;
    font-size: 13px; font-weight: 600; color: #cbd5e1;
    background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px; padding: 10px 20px;
    text-decoration: none; transition: all .2s; white-space: nowrap;
}
.gf-btn-secondary:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ── SNAPSHOT ── */
.gf-snapshot {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 32px rgba(0,0,0,.09);
    margin-bottom: 20px;
}
.gf-snapshot::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), #fbbf24, var(--gold), transparent);
    opacity: .9;
}
.gf-snapshot-body { padding: 20px; }
.gf-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.gf-snapshot-item {
    display: flex; flex-direction: column; gap: 5px;
    padding: 16px; border-radius: 12px;
    background: var(--bg); border: 1px solid var(--border);
    transition: border-color .2s, background .2s;
}
.gf-snapshot-item:hover { background: var(--gold-l); border-color: var(--gold-b); }
.gf-snapshot-item--price {
    background: var(--gold-bg); border-color: var(--gold-b);
}
.gf-snapshot-label {
    font-size: 10px; font-weight: 700; color: var(--muted); direction: rtl;
    letter-spacing: .3px;
}
.gf-snapshot-value {
    font-size: 14px; font-weight: 800; color: var(--text);
    direction: ltr;
}
.gf-snapshot-value--large { font-size: 20px; color: var(--gold); }
.gf-snapshot-unit {
    font-size: 9px; font-weight: 500; color: var(--muted);
}
.gf-snapshot-note {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--muted); direction: rtl;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 14px;
}

/* ── LAYOUT ── */
.gf-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

/* ── SHARED CARD ── */
.gf-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.07);
    margin-bottom: 20px;
}
.gf-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--gold), var(--accent), transparent);
    opacity: .8;
}
.gf-card-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 20px 11px;
    border-bottom: 1px solid var(--border);
    background: var(--hbg);
}
.gf-card-header-right { display: flex; align-items: center; gap: 10px; }
.gf-card-icon {
    width: 32px; height: 32px;
    background: var(--gold-bg); border: 1px solid var(--gold-b);
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; flex-shrink: 0;
}
.gf-card-label { font-size: 9.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; }
.gf-card-title { font-size: 14px; font-weight: 700; color: var(--text); direction: rtl; }
.gf-card-body { padding: 18px 20px; }

/* Live badge */
.gf-live-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 10px; font-weight: 700; color: var(--up);
    background: var(--up-bg); border: 1px solid rgba(22,163,74,.25);
    border-radius: 20px; padding: 3px 11px; flex-shrink: 0;
}
.gf-live-dot {
    width: 6px; height: 6px; border-radius: 50%; background: var(--up);
    animation: gf-pulse 1.8s ease-in-out infinite;
}

/* Intro */
.gf-intro-body p {
    font-size: 13.5px; line-height: 2; color: var(--soft);
    direction: rtl; margin-bottom: 12px;
}
.gf-intro-body p:last-child { margin-bottom: 0; }
.gf-intro-body strong { color: var(--text); font-weight: 700; }
.gf-intro-body a { color: var(--accent); }

/* Factors */
.gf-factors-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.gf-factor-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 10px; text-align: center;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    transition: border-color .2s, background .2s;
}
.gf-factor-item:hover { background: var(--gold-l); border-color: var(--gold-b); }
.gf-factor-icon { font-size: 20px; }
.gf-factor-label { font-size: 10.5px; font-weight: 600; color: var(--soft); direction: rtl; }

/* TOC */
.gf-toc-list {
    list-style: none; display: flex; flex-direction: column; gap: 2px;
    counter-reset: toc-counter;
}
.gf-toc-list li { counter-increment: toc-counter; }
.gf-toc-list a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 8px;
    font-size: 12.5px; font-weight: 600; color: var(--soft);
    text-decoration: none; direction: rtl;
    transition: background .15s, color .15s;
}
.gf-toc-list a::before {
    content: counter(toc-counter, persian);
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 6px;
    font-size: 10px; font-weight: 800; flex-shrink: 0;
    background: var(--al); color: var(--accent); border: 1px solid var(--ab);
}
.gf-toc-list a:hover { background: var(--gold-l); color: var(--gold); }
.gf-toc-list a:hover::before { background: var(--gold-bg); color: var(--gold); border-color: var(--gold-b); }

/* Opinion */
.gf-opinion-desc {
    font-size: 12.5px; color: var(--soft); direction: rtl;
    line-height: 1.8; margin-bottom: 16px;
}

/* ── FORECAST SECTION ── */
.gf-section-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 20px 13px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0; border-bottom: none;
    position: relative;
}
.gf-section-header::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), #fbbf24, var(--gold), transparent);
    border-radius: var(--radius) var(--radius) 0 0;
}
.gf-section-header-right { display: flex; align-items: center; gap: 10px; }
.gf-section-title { font-size: 15px; font-weight: 800; color: var(--text); direction: rtl; }

/* Forecast article card */
.gf-forecast-card {
    background: var(--surface); border: 1px solid var(--border); border-top: none;
    padding: 28px 24px; position: relative; transition: background .15s;
}
/* Forecast thumbnail (F8 fix — was missing entirely) */
.gf-forecast-thumb {
    display: block; margin-bottom: 14px;
    border-radius: 10px; overflow: hidden; line-height: 0;
}
.gf-forecast-thumb img {
    display: block; width: 100%; max-width: 100%; height: auto;
}
.gf-forecast-card:last-of-type { border-radius: 0 0 var(--radius) var(--radius); }
.gf-forecast-card:hover { background: var(--bg); }
.gf-forecast-card::after {
    content: '';
    position: absolute; bottom: 0; left: 24px; right: 24px; height: 1px;
    background: var(--border);
}
.gf-forecast-card:last-of-type::after { display: none; }

.gf-forecast-title {
    font-size: 17px; font-weight: 800; color: var(--text);
    direction: rtl; line-height: 1.5; margin-bottom: 10px;
}
.gf-forecast-title-link { color: inherit; text-decoration: none; }
.gf-forecast-title-link:hover { color: var(--gold); }
.gf-forecast-meta {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 0;
}
.gf-forecast-date, .gf-forecast-author {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; font-weight: 600; color: var(--muted);
}
.gf-forecast-badge {
    font-size: 9.5px; font-weight: 700; color: var(--gold);
    background: var(--gold-bg); border: 1px solid var(--gold-b);
    border-radius: 20px; padding: 2px 10px;
}
.gf-forecast-card-header { margin-bottom: 16px; }
.gf-forecast-body {
    font-size: 13.5px; line-height: 2.1; color: var(--soft); direction: rtl;
}
.gf-forecast-body h2, .gf-forecast-body h3 {
    font-size: 15px; font-weight: 700; color: var(--text);
    margin: 20px 0 10px; direction: rtl;
}
.gf-forecast-body p { margin-bottom: 14px; }
.gf-forecast-body strong { color: var(--text); font-weight: 700; }
.gf-forecast-body a { color: var(--accent); text-decoration: none; }
.gf-forecast-body a:hover { text-decoration: underline; }
.gf-forecast-body ul, .gf-forecast-body ol { padding-right: 20px; margin-bottom: 14px; }
.gf-forecast-body li { margin-bottom: 6px; }

.gf-forecast-readmore {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 700; color: var(--accent);
    text-decoration: none;
}
.gf-forecast-readmore:hover { color: var(--gold); }
.gf-forecast-readmore .gf-related-arrow { opacity: 1; transform: none; font-size: 12px; }

/* Empty state */
.gf-empty {
    display: flex; flex-direction: column; align-items: center; gap: 10px;
    padding: 40px 20px;
    background: var(--surface); border: 1px solid var(--border); border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    color: var(--muted); font-size: 13px; direction: rtl;
}

/* ── SIDEBAR ── */
.gf-sidebar { display: flex; flex-direction: column; gap: 16px; }
.gf-related-body { padding: 6px 0; }
.gf-related-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px; border-bottom: 1px solid #f8fafc;
    text-decoration: none; color: var(--soft);
    font-size: 12px; font-weight: 600; direction: rtl;
    transition: background .14s, color .14s;
}
.gf-related-link:last-child { border-bottom: none; }
.gf-related-link:hover { background: var(--gold-l); color: var(--gold); }
.gf-related-icon { font-size: 14px; flex-shrink: 0; }
.gf-related-link span:nth-child(2) { flex: 1; }
.gf-related-arrow {
    font-size: 12px; color: var(--muted);
    opacity: 0; transform: translateX(4px);
    transition: opacity .18s, transform .18s;
}
.gf-related-link:hover .gf-related-arrow { opacity: 1; transform: translateX(0); color: var(--gold); }
.gf-sidebar-widget { }

/* ── MODAL ── */
.gf-modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.7); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.gf-modal-overlay[hidden] { display: none; }
.gf-modal-content {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
    width: 100%; max-width: 900px;
    box-shadow: 0 24px 80px rgba(0,0,0,.4);
    animation: gf-modal-in .22s ease;
}
@keyframes gf-modal-in {
    from{opacity:0;transform:scale(.96) translateY(10px)}
    to  {opacity:1;transform:scale(1)   translateY(0)}
}
.gf-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 20px 12px; border-bottom: 1px solid var(--border); background: var(--hbg);
}
.gf-modal-close {
    background: none; border: 1px solid var(--border); border-radius: 8px;
    width: 32px; height: 32px; font-size: 14px; cursor: pointer; color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, color .2s;
}
.gf-modal-close:hover { background: var(--dn); color: #fff; border-color: var(--dn); }
.gf-modal-body { padding: 16px; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
    .gf-layout { grid-template-columns: 1fr; }
    .gf-sidebar { order: -1; }
    .gf-snapshot-grid { grid-template-columns: repeat(2, 1fr); }
    .gf-hero { padding: 36px 24px 32px; }
    .gf-factors-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .gf-page { padding: 0 12px 32px; }
    .gf-hero { padding: 28px 18px 24px; }
    .gf-hero-title { font-size: 20px; }
    .gf-hero-sub { font-size: 12.5px; }
    .gf-snapshot-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .gf-snapshot-value--large { font-size: 16px; }
    .gf-card-body { padding: 14px 16px; }
    .gf-forecast-card { padding: 20px 16px; }
    .gf-forecast-title { font-size: 15px; }
    .gf-factors-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
