/* =========================================================
   Gold Rate in Pakistan — premium finance theme
   Dark navy/charcoal base, gold accent, white cards.
   Mobile-first, no framework — plain CSS for max performance.
   ========================================================= */

:root {
  --navy-950: #070b14;
  --navy-900: #0b1320;
  --navy-800: #121d30;
  --navy-700: #1b2940;
  --navy-600: #28395664;
  --gold-500: #d4af37;
  --gold-400: #e8c75a;
  --gold-100: #f8edcd;
  --white: #ffffff;
  --ink-900: #10182b;
  --ink-700: #3a4862;
  --ink-500: #647189;
  --line: #e4e8f0;
  --up: #1f9d63;
  --down: #d6443c;
  --neutral: #8a93a6;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 10px 30px -12px rgba(7, 11, 20, 0.35);
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --container-w: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--navy-900);
  color: var(--ink-900);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, canvas, svg { max-width: 100%; display: block; }
a { color: inherit; }
.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;
}
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--gold-500); color: var(--navy-950);
  padding: 10px 16px; z-index: 1000; font-weight: 600; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.2; color: var(--navy-950); margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--ink-700); }

/* ---------- Ticker ---------- */
.ticker {
  background: var(--navy-950);
  color: var(--gold-100);
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 1px solid var(--navy-700);
  position: sticky;
  top: 0;
  z-index: 60;
  font-size: 0.8rem;
}
.ticker__track {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding: 8px 20px;
  animation: ticker-scroll 38s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item { display: inline-flex; align-items: center; gap: 6px; }
.ticker__item strong { color: var(--gold-400); }
.ticker__item--meta { color: var(--ink-500); }
.ticker__chip { font-weight: 600; padding: 1px 7px; border-radius: 999px; font-size: 0.72rem; }
.ticker__chip.is-up { color: var(--up); background: rgba(31,157,99,0.15); }
.ticker__chip.is-down { color: var(--down); background: rgba(214,68,60,0.15); }
.ticker__chip.is-neutral { color: var(--neutral); background: rgba(138,147,166,0.15); }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; overflow-x: auto; }
}

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--navy-900);
  position: sticky;
  top: 33px;
  z-index: 50;
  border-bottom: 1px solid var(--navy-700);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--navy-950); font-weight: 800; font-family: var(--font-serif);
  font-size: 1.05rem;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { color: var(--white); font-weight: 800; font-size: 1.05rem; letter-spacing: 0.01em; }
.brand__tagline { color: var(--gold-400); font-size: 0.72rem; font-weight: 500; }
.brand--footer .brand__name { font-size: 1.1rem; }

.nav-toggle {
  display: inline-flex; flex-direction: column; gap: 4px; justify-content: center;
  background: transparent; border: 1px solid var(--navy-700); border-radius: 8px;
  width: 42px; height: 38px; cursor: pointer; align-items: center;
}
.nav-toggle__bar { width: 20px; height: 2px; background: var(--gold-400); border-radius: 2px; }

.primary-nav {
  display: none;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.primary-nav.is-open { display: flex; flex-direction: column; align-items: stretch; width: 100%; }
.primary-nav a, .primary-nav__dropdown-trigger {
  color: var(--ink-100, #cfd6e4);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-block;
  color: #cfd6e4;
}
.primary-nav a:hover, .primary-nav__dropdown-trigger:hover { color: var(--gold-400); background: rgba(212,175,55,0.08); }
.primary-nav__dropdown { position: relative; }
.primary-nav__dropdown-panel {
  display: none;
  flex-direction: column;
  background: var(--navy-800);
  border: 1px solid var(--navy-700);
  border-radius: 10px;
  padding: 6px;
  min-width: 200px;
}
.primary-nav__dropdown-panel a { color: #cfd6e4; }
.primary-nav__dropdown-all { font-weight: 700; color: var(--gold-400) !important; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 4px; padding-top: 10px !important; }
.primary-nav__dropdown.is-open .primary-nav__dropdown-panel { display: flex; }

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .primary-nav { display: flex; }
  .primary-nav__dropdown-panel {
    position: absolute; top: 100%; left: 0; margin-top: 6px;
    box-shadow: var(--shadow-card);
    z-index: 70;
  }
  .primary-nav__dropdown:hover .primary-nav__dropdown-panel,
  .primary-nav__dropdown:focus-within .primary-nav__dropdown-panel { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 85% 0%, rgba(212,175,55,0.18), transparent 45%),
    linear-gradient(180deg, var(--navy-900), var(--navy-950));
  color: var(--white);
  padding: 48px 0 56px;
}
.hero h1 { color: var(--white); }
.hero__eyebrow {
  display: inline-block; color: var(--gold-400); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.78rem; margin-bottom: 10px;
}
.hero__lede { color: #b9c2d6; max-width: 62ch; font-size: 1.05rem; }
.hero__breadcrumbs .breadcrumbs a, .hero__breadcrumbs .breadcrumbs span { color: #aab4cb; }

.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 14px; font-size: 0.82rem; }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 6px; color: var(--ink-500); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { color: var(--gold-500); }

/* ---------- Status bar ---------- */
.status-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  margin-top: 22px; padding: 14px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  color: #cfd6e4;
}
.status-badge { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.status-badge__dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.status-badge.is-open { color: var(--up); background: rgba(31,157,99,0.15); }
.status-badge.is-open .status-badge__dot { background: var(--up); box-shadow: 0 0 0 4px rgba(31,157,99,0.18); }
.status-badge.is-closed { color: var(--down); background: rgba(214,68,60,0.15); }
.status-badge.is-closed .status-badge__dot { background: var(--down); box-shadow: 0 0 0 4px rgba(214,68,60,0.18); }
.status-bar__updated strong { color: var(--white); }

.indicator { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; }
.indicator.is-up { color: var(--up); background: rgba(31,157,99,0.15); }
.indicator.is-down { color: var(--down); background: rgba(214,68,60,0.15); }
.indicator.is-neutral { color: var(--neutral); background: rgba(138,147,166,0.15); }

.refresh-btn {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: var(--navy-950); font-weight: 700; border: none;
  padding: 10px 18px; border-radius: 999px; cursor: pointer; font-size: 0.86rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.refresh-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px rgba(212,175,55,0.6); }
.refresh-btn__icon { display: inline-block; transition: transform .5s ease; }
.refresh-btn.is-spinning .refresh-btn__icon { transform: rotate(360deg); }

/* ---------- Sections / layout ---------- */
.section { padding: 44px 0; }
.section--alt { background: #f6f7fb; }
.section__head { max-width: 70ch; margin-bottom: 24px; }
.section__head p { color: var(--ink-700); }
.section:not(.section--alt) .section__head h2,
.section:not(.section--alt) .prose h2,
.section:not(.section--alt) .prose h3 { color: var(--white); }
.section:not(.section--alt) .prose p,
.section:not(.section--alt) .prose ul,
.section:not(.section--alt) .prose ol { color: var(--ink-100, #cfd6e4); }
.layout-with-sidebar { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 980px) {
  .layout-with-sidebar { grid-template-columns: 2fr 1fr; align-items: start; }
  .layout-with-sidebar__sidebar { position: sticky; top: 130px; display: flex; flex-direction: column; gap: 20px; }
}

/* ---------- Price cards ---------- */
.price-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 26px;
}
@media (min-width: 640px) { .price-cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .price-cards { grid-template-columns: repeat(4, 1fr); } }
.price-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.price-card__label { font-size: 0.8rem; color: var(--ink-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.price-card__value { font-family: var(--font-serif); font-size: 1.5rem; font-weight: 700; color: var(--navy-950); margin: 0 0 8px; }
.price-card__meta { margin: 0; }

/* ---------- Cards / panels (white-on-navy generic) ---------- */
.panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.panel + .panel { margin-top: 20px; }

/* ---------- Price table ---------- */
.price-table-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.price-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 520px; }
.price-table caption { text-align: left; padding: 18px 20px 6px; font-weight: 600; color: var(--ink-700); font-size: 0.85rem; }
.price-table th, .price-table td { padding: 13px 20px; text-align: left; border-top: 1px solid var(--line); }
.price-table thead th { color: var(--ink-500); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; border-top: none; }
.price-table tbody th { font-weight: 700; color: var(--navy-950); }
.price-table tbody td { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy-950); }
.price-table__ounce td { color: var(--ink-700); font-weight: 500; }

/* ---------- Calculator ---------- */
.calculator {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border-top: 4px solid var(--gold-500);
}
.calculator__hint { font-size: 0.9rem; }
.calculator__row { display: grid; grid-template-columns: 100px 1fr; gap: 12px; align-items: center; margin-bottom: 12px; }
.calculator__row label { font-weight: 600; font-size: 0.88rem; color: var(--ink-700); }
.calculator select, .calculator input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 0.95rem; font-family: inherit; background: #fbfbfd; color: var(--navy-950);
}
.calculator select:focus, .calculator input:focus { outline: 2px solid var(--gold-500); outline-offset: 1px; }
.calculator__result {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  background: var(--navy-900); color: var(--white); border-radius: var(--radius-md);
  padding: 16px 18px; margin: 16px 0 12px;
}
.calculator__result-label { font-size: 0.82rem; color: #b9c2d6; }
.calculator__result-value { font-family: var(--font-serif); font-size: 1.6rem; color: var(--gold-400); }
.calculator__note { font-size: 0.78rem; color: var(--ink-500); margin: 0; }

/* ---------- City grid ---------- */
.city-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 22px; }
@media (min-width: 640px) { .city-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .city-grid { grid-template-columns: repeat(4, 1fr); } }
.city-grid__more { margin-top: 18px; font-weight: 600; }
.city-grid__more a { color: var(--gold-500); text-decoration: none; }
.city-grid__more a:hover { text-decoration: underline; }
.city-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--white); border-radius: var(--radius-md); padding: 16px 18px;
  text-decoration: none; box-shadow: var(--shadow-card);
  border: 1px solid transparent; transition: border-color .15s ease, transform .15s ease;
}
.city-card:hover { border-color: var(--gold-500); transform: translateY(-2px); }
.city-card__name { font-weight: 700; color: var(--navy-950); font-family: var(--font-serif); font-size: 1.05rem; }
.city-card__region { font-size: 0.78rem; color: var(--ink-500); }
.city-card__cta { font-size: 0.8rem; color: var(--gold-500); font-weight: 600; margin-top: 6px; }

/* ---------- History chart ---------- */
.history-chart { background: var(--white); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-card); }
.history-chart__tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.history-chart__tab {
  border: 1px solid var(--line); background: #fbfbfd; color: var(--ink-700);
  padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 0.85rem; cursor: pointer;
}
.history-chart__tab.is-active { background: var(--navy-900); border-color: var(--navy-900); color: var(--gold-400); }
.history-chart__canvas-wrap { margin-bottom: 18px; }
.history-chart__canvas { width: 100%; height: auto; background: linear-gradient(180deg, #fbfbfd, #ffffff); border-radius: var(--radius-md); border: 1px solid var(--line); }
.history-chart__table-wrap { overflow-x: auto; }
.history-chart__table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.history-chart__table caption { text-align: left; font-weight: 600; color: var(--ink-700); padding-bottom: 8px; font-size: 0.82rem; }
.history-chart__table th, .history-chart__table td { padding: 9px 14px; border-top: 1px solid var(--line); text-align: left; }
.history-chart__note { font-size: 0.78rem; color: var(--ink-500); margin: 14px 0 0; }

/* ---------- FAQ ---------- */
.faq { margin-top: 8px; }
.faq__list { display: flex; flex-direction: column; gap: 10px; }
.faq__item {
  background: var(--white); border-radius: var(--radius-md); padding: 4px 18px;
  box-shadow: var(--shadow-card); border: 1px solid var(--line);
}
.faq__item summary {
  cursor: pointer; padding: 14px 0; font-weight: 700; color: var(--navy-950);
  list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: '+'; color: var(--gold-500); font-size: 1.2rem; font-weight: 700; }
.faq__item[open] summary::after { content: '−'; }
.faq__item p { padding-bottom: 14px; margin: 0; }

/* ---------- Disclaimer ---------- */
.disclaimer-box {
  display: block; margin-top: 26px; padding: 16px 18px; font-size: 0.85rem;
  background: #fff8e6; border: 1px solid #f1e0ad; border-radius: var(--radius-md); color: var(--ink-700);
}
.disclaimer-box strong { color: var(--navy-950); }

/* ---------- Ad slots ---------- */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 100px; border: 1px dashed var(--line); border-radius: var(--radius-md);
  background: #f6f7fb; color: var(--ink-500); font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.08em; margin: 28px 0;
}
.ad-slot--sidebar { min-height: 250px; }

/* ---------- TradingView live spot widget ---------- */
.tv-widget { margin: 28px 0 36px; }
.tv-widget .section__head h2 { color: var(--white); }
.tv-widget .section__head p { color: var(--ink-100, #cfd6e4); }
.tv-widget .section__head p a { color: var(--gold-400); }
.tv-widget__frame {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--navy-950); padding: 12px; overflow: hidden;
}
.tradingview-widget-container { width: 100%; }
.tradingview-widget-copyright {
  font-size: 0.72rem; text-align: right; padding: 6px 4px 0; color: var(--ink-500);
}
.tradingview-widget-copyright a { color: var(--gold-500); text-decoration: none; }

/* ---------- Content / prose pages ---------- */
.prose { max-width: 76ch; }
.prose h2 { margin-top: 1.4em; }
.prose ul, .prose ol { color: var(--ink-700); padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }

.intro-card { background: var(--white); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-card); }

.related-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.related-links a {
  text-decoration: none; font-size: 0.85rem; font-weight: 600; color: var(--navy-950);
  background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
}
.related-links a:hover { border-color: var(--gold-500); color: var(--gold-500); }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-950); color: #aab4cb; padding: 48px 0 0; }
.site-footer h2 { color: var(--white); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-sans); }
.site-footer__grid { display: grid; gap: 28px; grid-template-columns: 1fr; padding-bottom: 32px; }
@media (min-width: 760px) { .site-footer__grid { grid-template-columns: 1.4fr repeat(2, 1fr); } }
@media (min-width: 1080px) { .site-footer__grid { grid-template-columns: 1.4fr repeat(4, 1fr); } }
.site-footer__about p { color: #97a2ba; font-size: 0.88rem; }
.site-footer__disclaimer { font-size: 0.78rem; color: #7c8aa6; }
.site-footer__col { display: flex; flex-direction: column; gap: 8px; }
.site-footer__col a { color: #aab4cb; text-decoration: none; font-size: 0.86rem; }
.site-footer__col a:hover { color: var(--gold-400); }
.site-footer__bottom {
  border-top: 1px solid var(--navy-700); padding: 18px 20px; display: flex; flex-wrap: wrap;
  justify-content: space-between; gap: 8px; font-size: 0.76rem; color: #7c8aa6;
}
.site-footer__bottom p { margin: 0; color: inherit; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.kicker { color: var(--gold-500); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.76rem; }
