/* MARKET TALKS shared styles (all pages) */

/* ---------- Tokens ---------- */
:root, [data-theme="dark"]{
  --page:#0A0F1A; --surface:rgba(17,24,39,.78); --surface-solid:#111827; --surface-2:#162033;
  --line:rgba(255,255,255,.09); --line-strong:rgba(255,255,255,.18);
  --ink:#EEF1F6; --muted:#A3AEC2; --link:#8FB4F0;
  --chip-bg:rgba(143,180,240,.14); --chip-ink:#B4CBF3;
  --band:rgba(14,21,36,.74); --gold:#D4AF5F; --footer:#060A12;
  --shadow:0 1px 2px rgba(0,0,0,.35);
  --up:#3FB27F; --down:#E25C5C;
  --serif:'Libre Caslon Text', Georgia, 'Times New Roman', serif;
  --sans:'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
[data-theme="light"]{
  --page:#EEF0F7; --surface:rgba(255,255,255,.9); --surface-solid:#FFFFFF; --surface-2:#F7F8FB;
  --line:#E1E4EC; --line-strong:#CDD2DD;
  --ink:#0F2147; --muted:#56617A; --link:#1D4F9C;
  --chip-bg:#DFE6F2; --chip-ink:#2A4A7C;
  --band:rgba(226,228,240,.82); --gold:#A97E2E; --footer:#0B1220;
  --shadow:0 1px 3px rgba(15,33,71,.07);
}

*{ margin:0; padding:0; box-sizing:border-box; }
html{ background:var(--page); -webkit-text-size-adjust:100%; }
body{ background:transparent; color:var(--ink); font-family:var(--sans); font-size:15px; line-height:1.55; min-height:100vh; overflow-x:clip; display:flex; flex-direction:column; }
body[dir="rtl"]{ --serif:'Vazirmatn', Tahoma, sans-serif; --sans:'Vazirmatn', Tahoma, sans-serif; }
main{ flex:1; }
a{ color:inherit; text-decoration:none; }
button{ font:inherit; color:inherit; background:none; border:0; cursor:pointer; }
img{ max-width:100%; display:block; }
:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; border-radius:6px; }
.wrap{ width:100%; max-width:1400px; margin:0 auto; padding:0 40px; }
.wrap-wide{ width:100%; max-width:1680px; margin:0 auto; padding:0 40px; }
.flip-rtl{ display:inline-block; }
[dir="rtl"] .flip-rtl{ transform:scaleX(-1); }
iframe, tv-market-overview, tv-ticker-tape, tv-forex-table, .tradingview-widget-container{ max-width:100% !important; }

#galaxy-bg{ position:fixed; inset:0; width:100%; height:100%; z-index:-2; pointer-events:none; }

/* ---------- Header ---------- */
.site-header{ position:relative; z-index:30; }
.site-header .wrap{ display:flex; align-items:center; gap:24px; height:80px; }
.brand{ display:flex; align-items:center; gap:12px; flex-shrink:0; }
.brand img{ width:40px; height:40px; object-fit:contain; }
.brand span{ font-family:'Libre Caslon Text', Georgia, serif; font-size:24px; font-weight:700; letter-spacing:-.01em; white-space:nowrap; color:var(--ink); }
.nav-panel{ flex:1; display:flex; align-items:center; justify-content:flex-end; min-width:0; }
.nav-tools{ display:flex; align-items:center; gap:22px; }

.lang-switch{ position:relative; }
.lang-toggle{ display:flex; align-items:center; gap:5px; font-size:14px; font-weight:600; padding:6px 2px; color:var(--ink); }
.lang-toggle svg{ width:9px; height:6px; stroke:currentColor; }
.lang-options{ position:absolute; top:calc(100% + 8px); inset-inline-end:-10px; min-width:150px; background:var(--surface-solid); border:1px solid var(--line-strong); border-radius:10px; padding:6px; display:none; box-shadow:0 10px 30px rgba(0,0,0,.3); z-index:40; }
.lang-switch.open .lang-options{ display:block; }
.lang-options button{ display:block; width:100%; text-align:start; padding:8px 12px; border-radius:6px; font-size:14px; color:var(--ink); }
.lang-options button:hover{ background:var(--chip-bg); }
.lang-options button.active{ color:var(--gold); font-weight:600; }

.theme-toggle{ display:flex; align-items:center; gap:2px; padding:3px; border-radius:999px; border:1px solid var(--line-strong); }
.theme-toggle span{ width:26px; height:26px; display:grid; place-items:center; border-radius:50%; color:var(--muted); transition:background .2s, color .2s; }
.theme-toggle svg{ width:14px; height:14px; fill:none; stroke:currentColor; stroke-width:2; }
[data-theme="dark"] .theme-toggle .t-moon, [data-theme="light"] .theme-toggle .t-sun{ background:var(--chip-bg); color:var(--ink); }

.info-btn{ font-size:13px; color:var(--muted); white-space:nowrap; padding:6px 0; }
.info-btn:hover{ color:var(--ink); }

.menu-btn{ display:none; width:42px; height:42px; border-radius:10px; border:1px solid var(--line-strong); place-items:center; margin-inline-start:auto; color:var(--ink); }
.menu-btn svg{ width:20px; height:20px; stroke:currentColor; stroke-width:2; fill:none; }

/* ---------- Ticker (homepage) ---------- */
.top-ticker{ height:72px; background:rgba(5,8,18,.72); border-bottom:1px solid var(--line); overflow:hidden; position:relative; z-index:31; }
[data-theme="light"] .top-ticker{ background:rgba(255,255,255,.85); }
.top-ticker tv-ticker-tape{ display:block; width:100%; height:100%; }

/* ---------- Inner page head ---------- */
.page-head{ padding-top:26px; padding-bottom:30px; }
.crumbs{ display:flex; flex-direction:column; align-items:flex-start; gap:4px; margin-bottom:22px; }
.crumbs a{ font-size:14px; color:var(--muted); cursor:pointer; }
.crumbs a:hover{ color:var(--gold); }
.page-title{ font-family:var(--serif); font-weight:400; font-size:clamp(34px, 4vw, 52px); line-height:1.1; letter-spacing:-.01em; color:var(--ink); }
.page-rule{ width:56px; height:2px; background:var(--gold); margin-top:18px; }
.page-body{ padding-bottom:64px; }

.card{ background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); min-width:0; -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }

/* Section tiles (Markets Analysis, Technical Analysis, Education Center) */
.tile-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap:18px; }
.tile-grid > *{ min-width:0; max-width:100%; }
.page-body, .page-head{ min-width:0; }
.tile{ position:relative; overflow:hidden; overflow-wrap:anywhere; display:flex; flex-direction:column; justify-content:space-between; gap:22px; min-height:150px; padding:24px; background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:var(--shadow); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); transition:border-color .2s, transform .2s; }
.tile:hover{ border-color:var(--gold); transform:translateY(-2px); }
.tile h2{ font-family:var(--serif); font-weight:400; font-size:23px; line-height:1.25; color:var(--ink); }
.tile-foot{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.tile-meta{ display:flex; flex-direction:column; align-items:flex-start; gap:6px; min-width:0; }
.go{ width:36px; height:36px; border-radius:50%; border:1px solid var(--line-strong); display:grid; place-items:center; color:var(--ink); font-size:15px; flex-shrink:0; transition:border-color .2s; }
.tile:hover .go{ border-color:var(--gold); }
.pill{ display:inline-block; font-size:12px; font-weight:500; line-height:1; padding:6px 10px; border-radius:999px; background:var(--chip-bg); color:var(--chip-ink); white-space:nowrap; }
.pill.gold{ background:rgba(212,175,95,.16); color:var(--gold); }
.tile.soon h2{ color:var(--muted); }
.group{ margin-bottom:38px; }
.group-label{ font-size:13px; font-weight:600; color:var(--muted); margin-bottom:14px; padding-bottom:10px; border-bottom:1px solid var(--line); }
.section-title{ font-size:24px; font-weight:700; color:var(--ink); margin:46px 0 16px; }

/* ---------- Footer ---------- */
.site-footer{ background:var(--footer); color:#C9D2E0; }
.site-footer .wrap{ display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr 1.1fr; gap:32px; padding-top:44px; padding-bottom:44px; }
.site-footer .brand span{ color:#fff; font-size:22px; }
.foot-tag{ font-size:14px; color:#9FB0C8; margin-top:14px; }
.foot-copy{ font-size:12px; color:#7D8BA2; margin-top:26px; }
.site-footer h5{ font-size:14px; font-weight:600; color:#fff; margin-bottom:12px; }
.site-footer ul{ list-style:none; display:grid; gap:9px; }
.site-footer li a, .site-footer li button, .site-footer li span{ font-size:14px; color:#B7C3D6; text-align:start; }
.site-footer li a:hover, .site-footer li button:hover{ color:#fff; }

/* ---------- Modals ---------- */
.modal-overlay{ position:fixed; inset:0; background:rgba(4,7,14,.66); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); display:none; align-items:center; justify-content:center; padding:20px; z-index:100; }
.modal-overlay.open{ display:flex; }
.modal-box{ position:relative; background:var(--surface-2); color:var(--ink); border:1px solid var(--line-strong); border-radius:16px; padding:34px 32px 30px; max-width:580px; width:100%; max-height:88vh; overflow:auto; }
.modal-box h3{ font-family:var(--serif); font-size:26px; margin-bottom:14px; }
.modal-box p{ color:var(--muted); font-size:15px; line-height:1.75; }
.modal-close{ position:absolute; top:12px; inset-inline-end:14px; font-size:26px; line-height:1; color:var(--muted); padding:4px 8px; }
.contact-options{ display:grid; gap:12px; margin-top:20px; }
.contact-row{ display:flex; gap:10px; align-items:stretch; }
.contact-option{ flex:1; display:flex; gap:14px; align-items:center; padding:14px 16px; border:1px solid var(--line-strong); border-radius:12px; min-width:0; }
.contact-option:hover{ border-color:var(--gold); }
.contact-option svg{ width:22px; height:22px; fill:none; stroke:var(--gold); stroke-width:1.8; flex-shrink:0; }
.contact-option-text{ display:flex; flex-direction:column; min-width:0; }
.contact-option-label{ font-size:13px; color:var(--muted); }
.contact-option-value{ font-weight:600; overflow-wrap:anywhere; }
.copy-btn{ width:50px; border:1px solid var(--line-strong); border-radius:12px; display:grid; place-items:center; color:var(--muted); }
.copy-btn svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; }
.copy-btn.copied{ border-color:var(--up); color:var(--up); }

/* ---------- Responsive (shared) ---------- */
@media (max-width:900px){
  .menu-btn{ display:grid; }
  .site-header .wrap{ gap:16px; }
  .nav-panel{ display:none; position:absolute; top:74px; inset-inline:16px; flex-direction:column; align-items:stretch; background:var(--surface-solid); border:1px solid var(--line-strong); border-radius:14px; padding:6px 18px 12px; box-shadow:0 20px 40px rgba(0,0,0,.4); }
  .nav-panel.open{ display:flex; }
  .nav-tools{ flex-direction:column; align-items:stretch; gap:0; }
  .nav-tools > *{ padding:12px 0; border-bottom:1px solid var(--line); }
  .nav-tools > *:last-child{ border-bottom:0; }
  .lang-toggle{ display:none; }
  .lang-options{ display:grid !important; grid-template-columns:repeat(2,1fr); position:static; background:none; border:0; box-shadow:none; padding:0; min-width:0; }
  .theme-toggle{ align-self:flex-start; margin:10px 0; border-bottom:1px solid var(--line-strong) !important; }
  .info-btn{ text-align:start; font-size:15px; color:var(--ink); }
  .site-footer .wrap{ grid-template-columns:1fr 1fr; }
  .site-footer .foot-brand{ grid-column:1 / -1; }
}
@media (max-width:640px){
  .wrap, .wrap-wide{ padding-left:16px; padding-right:16px; }
  .site-header .wrap{ height:68px; }
  .nav-panel{ top:64px; inset-inline:10px; }
  .brand img{ width:34px; height:34px; } .brand span{ font-size:20px; }
  .tile-grid{ grid-template-columns:minmax(0, 1fr); }
  .tile{ min-height:120px; }
  .site-footer .wrap{ grid-template-columns:1fr; }
}
@media (prefers-reduced-motion:reduce){ *, *::after{ transition:none !important; animation:none !important; } }
