/* ============================================
   SilverPrice.com.hk — Stylesheet
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f4f6f9;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --accent: #7c8db5;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --header-bg: #0f172a;
  --header-text: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Header --- */
.header {
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--header-text);
}
.logo:hover { text-decoration: none; }

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #94a3b8, #e2e8f0);
  color: var(--header-bg);
  font-weight: 700;
  font-size: 14px;
  border-radius: 8px;
  letter-spacing: -0.5px;
}

.logo-text { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }
.logo-tld { color: var(--text-muted); font-weight: 400; }

.nav { display: flex; gap: 4px; }

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover {
  color: var(--header-text);
  background: rgba(255,255,255,0.06);
  text-decoration: none;
}
.nav-link.active { color: var(--header-text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--header-text);
  border-radius: 2px;
  transition: var(--transition);
}

/* --- Breadcrumbs --- */
.breadcrumbs {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-secondary); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb-sep { margin: 0 6px; color: var(--text-muted); }

/* --- Contextual Intro --- */
.intro-section {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0 0 8px;
}
.intro-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}
.intro-content h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.intro-content p {
  font-size: 15px;
  line-height: 1.8;
  color: #cbd5e1;
}

/* --- Hero / Price --- */
.hero {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 24px 0 44px;
  text-align: center;
}
.hero-label {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.hero-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-price-main { display: flex; align-items: baseline; gap: 8px; }
.currency-label { font-size: 16px; font-weight: 500; color: var(--text-muted); }
.price-value {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.price-unit { font-size: 16px; color: var(--text-muted); font-weight: 400; }
.price-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.price-change.up { background: rgba(22,163,74,0.15); color: #4ade80; }
.price-change.down { background: rgba(220,38,38,0.15); color: #f87171; }
.hero-hkd {
  margin-top: 16px;
  font-size: 20px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.price-value-hkd { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.separator { color: var(--text-muted); opacity: 0.4; margin: 0 4px; }
.hero-updated { margin-top: 16px; font-size: 12px; color: var(--text-muted); }

/* --- Stats --- */
.stats-section { margin-top: -24px; padding-bottom: 32px; position: relative; z-index: 10; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }

/* --- Section Headers --- */
.section-header { margin-bottom: 24px; }
.section-header h2 { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.section-desc { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* --- Chart --- */
.chart-section { padding: 40px 0; }
.chart-controls { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.timeframe-buttons, .currency-toggle { display: flex; background: var(--bg); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.tf-btn, .cur-btn {
  padding: 7px 14px; border: none; border-radius: 6px; background: transparent;
  color: var(--text-secondary); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--transition); font-family: inherit;
}
.tf-btn:hover, .cur-btn:hover { color: var(--text); background: rgba(0,0,0,0.04); }
.tf-btn.active, .cur-btn.active { background: var(--bg-card); color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }
.chart-wrapper { background: var(--bg-card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-md); position: relative; min-height: 380px; }
.chart-footer { margin-top: 12px; font-size: 12px; color: var(--text-muted); text-align: right; }

/* --- History Table --- */
.history-section { padding: 40px 0; }
.table-wrapper { background: var(--bg-card); border-radius: var(--radius); box-shadow: var(--shadow-md); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.price-table thead { background: #f8fafc; border-bottom: 2px solid var(--border); }
.price-table th { padding: 14px 16px; text-align: right; font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.price-table th:first-child { text-align: left; }
.price-table td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--border); white-space: nowrap; }
.price-table td:first-child { text-align: left; font-weight: 500; color: var(--text-secondary); }
.price-table tbody tr:hover { background: #f8fafc; }
.price-table tbody tr:last-child td { border-bottom: none; }
.change-up { color: var(--green); font-weight: 600; }
.change-down { color: var(--red); font-weight: 600; }
.loading-cell { text-align: center !important; color: var(--text-muted); padding: 40px 16px !important; }

/* --- Converter --- */
.converter-section { padding: 40px 0; }
.converter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.converter-card { background: var(--bg-card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-md); }
.converter-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.3px; }
.converter-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.converter-currency { font-size: 12px; font-weight: 600; color: var(--text-muted); min-width: 32px; }
.converter-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }

/* --- About --- */
.about-section { padding: 40px 0; }
.about-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.about-card { background: var(--bg-card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-md); }
.about-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.about-card p { font-size: 14px; line-height: 1.75; color: var(--text-secondary); }
.about-card .table-wrapper { margin: 12px 0; overflow-x: auto; }
.about-card .price-table { font-size: 13px; }
.about-card .price-table th, .about-card .price-table td { padding: 8px 12px; }
.article-content .table-wrapper { margin: 20px 0; overflow-x: auto; }
.article-content .price-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.article-content .price-table th { background: var(--primary); color: #fff; padding: 10px 14px; text-align: left; font-weight: 600; }
.article-content .price-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.article-content .price-table tr:hover td { background: var(--bg); }

/* --- FAQ Section --- */
.faq-section { padding: 48px 0; }
.faq-list { max-width: 800px; }
.faq-item { background: var(--bg-card); border-radius: var(--radius); padding: 24px 28px; box-shadow: var(--shadow-md); margin-bottom: 12px; }
.faq-item h3 { font-size: 17px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.faq-item p { font-size: 14px; line-height: 1.8; color: var(--text-secondary); }

/* --- Latest Articles --- */
.latest-articles { padding: 48px 0; border-top: 1px solid var(--border); }
.articles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.article-card {
  background: var(--bg-card); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-md); transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none; color: inherit; display: block;
}
.article-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.article-card-tag {
  display: inline-block; font-size: 11px; font-weight: 600; color: var(--primary);
  background: rgba(37,99,235,0.08); padding: 3px 10px; border-radius: 20px;
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.3px;
}
.article-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--text); line-height: 1.4; }
.article-card p { font-size: 13px; line-height: 1.6; color: var(--text-secondary); }
.article-card-date { font-size: 12px; color: var(--text-muted); margin-top: 12px; }

/* --- SEO Section --- */
.seo-section { padding: 48px 0; border-top: 1px solid var(--border); }
.seo-content { max-width: 800px; }
.seo-content h2 { font-size: 22px; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.seo-content p { font-size: 15px; line-height: 1.8; color: var(--text-secondary); margin-bottom: 14px; }
.seo-content p:last-child { margin-bottom: 0; }

/* --- Footer --- */
.footer { background: var(--header-bg); color: var(--text-muted); padding: 36px 0; }
.footer-inner { text-align: center; }
.footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 16px; font-size: 16px; font-weight: 600; color: var(--header-text); }
.footer-logo { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: linear-gradient(135deg, #94a3b8, #e2e8f0); color: var(--header-bg); font-weight: 700; font-size: 11px; border-radius: 6px; }
.footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 13px; transition: color var(--transition); }
.footer-links a:hover { color: var(--header-text); text-decoration: underline; }
.footer-disclaimer { font-size: 12px; line-height: 1.7; max-width: 640px; margin: 0 auto 12px; }
.footer-copy { font-size: 12px; opacity: 0.6; }

/* --- Blog Post Page --- */
.blog-post-page { padding: 40px 0; }
.blog-post-layout { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.article-content { background: var(--bg-card); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow-md); }
.article-content h1 { font-size: 28px; font-weight: 700; line-height: 1.35; margin-bottom: 12px; letter-spacing: -0.5px; }
.article-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.article-content h2 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; color: var(--text); }
.article-content p { font-size: 15px; line-height: 1.85; color: var(--text-secondary); margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 12px 0 16px 24px; color: var(--text-secondary); font-size: 15px; line-height: 1.85; }
.article-content li { margin-bottom: 6px; }
.article-cta { margin-top: 32px; padding: 20px 24px; background: rgba(37,99,235,0.04); border-left: 4px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.article-cta p { margin-bottom: 0; color: var(--text); font-weight: 500; }

.blog-sidebar { position: sticky; top: 80px; }
.sidebar-widget { background: var(--bg-card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-md); margin-bottom: 16px; }
.sidebar-widget h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.sidebar-widget p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }
.sidebar-cta { display: inline-block; font-size: 14px; font-weight: 600; color: var(--primary); }
.sidebar-links { list-style: none; padding: 0; }
.sidebar-links li { margin-bottom: 8px; }
.sidebar-links a { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.sidebar-links a:hover { color: var(--primary); }

/* --- Blog Index --- */
.blog-index-page { padding: 40px 0 60px; }
.blog-index-page h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.blog-index-desc { font-size: 15px; color: var(--text-secondary); margin-bottom: 32px; }
.blog-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.blog-list-card { background: var(--bg-card); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-md); transition: box-shadow var(--transition), transform var(--transition); text-decoration: none; color: inherit; display: block; }
.blog-list-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; }
.blog-list-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text); line-height: 1.4; }
.blog-list-card p { font-size: 14px; line-height: 1.65; color: var(--text-secondary); margin-bottom: 12px; }
.blog-list-card .card-date { font-size: 12px; color: var(--text-muted); }

/* --- Static Pages --- */
.static-page { padding: 48px 0 60px; }
.static-page-content { max-width: 760px; background: var(--bg-card); border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow-md); }
.static-page-content h1 { font-size: 28px; font-weight: 700; margin-bottom: 24px; }
.static-page-content h2 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; color: var(--text); }
.static-page-content p { font-size: 15px; line-height: 1.85; color: var(--text-secondary); margin-bottom: 14px; }
.static-page-content ul { margin: 8px 0 16px 24px; color: var(--text-secondary); font-size: 15px; line-height: 1.85; }
.static-page-content li { margin-bottom: 4px; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .converter-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .price-value { font-size: 42px; }
  .blog-post-layout { grid-template-columns: 1fr; }
  .blog-sidebar { position: static; }
  .articles-grid { grid-template-columns: 1fr; }
  .blog-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--header-bg); flex-direction: column; padding: 12px 20px 20px; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .nav.open { display: flex; }
  .nav-toggle { display: flex; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 14px 16px; }
  .stat-value { font-size: 17px; }
  .price-value { font-size: 36px; }
  .hero { padding: 20px 0 36px; }
  .hero-hkd { font-size: 16px; }
  .price-value-hkd { font-size: 20px; }
  .converter-grid { grid-template-columns: 1fr 1fr; }
  .chart-wrapper { padding: 16px 12px; min-height: 280px; }
  .chart-controls { flex-direction: column; align-items: flex-start; }
  .tf-btn { padding: 7px 10px; font-size: 12px; }
  .section-header h2 { font-size: 20px; }
  .price-table { font-size: 13px; }
  .price-table th, .price-table td { padding: 10px 10px; }
  .article-content { padding: 24px 20px; }
  .article-content h1 { font-size: 22px; }
  .static-page-content { padding: 24px 20px; }
  .intro-content h1 { font-size: 22px; }
}

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

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.stat-card, .about-card, .converter-card, .article-card, .blog-list-card { animation: fadeIn 0.4s ease both; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }
.stat-card:nth-child(5) { animation-delay: 0.2s; }
.stat-card:nth-child(6) { animation-delay: 0.25s; }
.stat-card:nth-child(7) { animation-delay: 0.3s; }
.stat-card:nth-child(8) { animation-delay: 0.35s; }
