/* ================================================================
   city.css — Gold Rate City Pages
   Mobile-first, fully responsive
================================================================ */

/* ── CSS VARIABLES ────────────────────────────────────────── */
:root {
  --gold:       #B8972A;
  --gold-light: #D4A93A;
  --black:      #0A0A0A;
  --white:      #FFFFFF;
  --text:       #111111;
  --muted:      #555555;
  --dim:        #888888;
  --border:     #E5E5E5;
  --bg:         #F7F7F7;
  --success:    #2E7D52;
  --danger:     #C0392B;
  --radius:     12px;
}

/* Prevent horizontal scroll on all city pages */
html, body { overflow-x: hidden; max-width: 100%; }

/* ── CITY HERO ────────────────────────────────────────────── */
.city-hero {
  background: var(--black);
  padding: 28px 16px 0;
  position: relative;
  overflow: hidden;
}
.city-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(184,151,42,0.04) 0px, rgba(184,151,42,0.04) 1px,
    transparent 1px, transparent 40px
  );
  pointer-events: none;
}
.city-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  position: relative; z-index: 1;
}
.city-hero-breadcrumb {
  font-family: Calibri, sans-serif;
  font-size: 12px; color: var(--dim);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.city-hero-breadcrumb a {
  color: var(--gold); text-decoration: none;
}
.city-hero-breadcrumb a:hover { color: var(--gold-light); }
.bc-sep { color: #444; }

.city-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-wrap: wrap;
}
.city-hero-left { flex: 1; min-width: 0; }

.city-hero-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(184,151,42,0.12);
  border: 1px solid rgba(184,151,42,0.25);
  border-radius: 20px; padding: 4px 12px;
  font-family: Calibri, sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.10em;
  color: var(--gold); margin-bottom: 10px;
}
.city-hero-tag svg { width: 11px; height: 11px; }

.city-hero h1 {
  font-family: Calibri, sans-serif;
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 700; color: var(--white);
  line-height: 1.2; margin: 0 0 8px;
}
.city-hero h1 span { color: var(--gold); }

.city-hero-sub {
  font-family: Calibri, sans-serif;
  font-size: 13px; color: var(--dim);
  line-height: 1.6; margin: 0;
}

/* Live rate card */
.city-rate-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  padding: 20px 24px;
  text-align: center;
  flex-shrink: 0;
  min-width: 220px;
}
.city-rate-card-label {
  font-family: Calibri, sans-serif;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--dim); margin-bottom: 6px;
}
.city-rate-card-price {
  font-family: Calibri, sans-serif;
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 700; color: var(--gold);
  line-height: 1; margin-bottom: 6px;
}
.city-rate-card-unit {
  font-family: Calibri, sans-serif;
  font-size: 12px; color: var(--dim); margin-bottom: 10px;
}
.city-rate-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: Calibri, sans-serif;
  font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
}
.city-rate-badge.up   { background: rgba(46,125,82,0.15);  color: var(--success); border: 1px solid rgba(46,125,82,0.3); }
.city-rate-badge.down { background: rgba(192,57,43,0.12); color: var(--danger);  border: 1px solid rgba(192,57,43,0.25); }
.city-rate-time { font-family: Calibri, sans-serif; font-size: 11px; color: #555; margin-top: 8px; }

/* ── KARAT TAB BAR ────────────────────────────────────────── */
.city-karat-bar {
  background: #111111;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.city-karat-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 16px;
  display: flex; gap: 0;
  min-width: max-content;
}
.city-karat-tab {
  flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  font-family: Calibri, sans-serif;
  font-size: 12px; font-weight: 600; color: #666;
  padding: 13px 20px;
  letter-spacing: 0.04em; text-transform: uppercase;
  border-bottom: 3px solid transparent;
  transition: color 0.18s, border-color 0.18s;
  white-space: nowrap;
}
.city-karat-tab:hover  { color: var(--white); }
.city-karat-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── MAIN PAGE LAYOUT ─────────────────────────────────────── */
.city-page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 16px 60px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

/* Main column — never exceed screen */
.city-main {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

/* ── SECTION HEADING ──────────────────────────────────────── */
.city-section-heading {
  font-family: Calibri, sans-serif;
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 700; color: var(--black);
  background: #F2F2F2;
  border-left: 4px solid var(--black);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 0 0 16px;
  line-height: 1.3;
}
.city-section-heading span { color: var(--gold); font-style: italic; }

/* ── TODAY'S RATE TABLE ───────────────────────────────────── */
.city-table-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 28px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
/* Scroll wrapper — critical for mobile */
.city-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 100%;
  display: block;
}
.city-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  table-layout: auto;
}
.city-table thead tr {
  background: #F5F5F5;
  border-bottom: 1px solid var(--border);
}
.city-table thead th {
  font-family: Calibri, sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: #777; padding: 12px 14px; text-align: left;
  white-space: nowrap;
}
.city-table thead th:not(:first-child) { text-align: right; }
.city-table tbody tr {
  border-bottom: 1px solid #F5F5F5;
  transition: background 0.15s;
}
.city-table tbody tr:last-child { border-bottom: none; }
.city-table tbody tr:hover { background: #FAFAFA; }
.city-table td {
  font-family: Calibri, sans-serif;
  font-size: 14px; color: var(--muted);
  padding: 13px 14px; text-align: right;
  white-space: nowrap;
}
.city-table td:first-child {
  text-align: left; font-weight: 700; color: var(--text);
}
.td-up   { color: var(--success) !important; }
.td-down { color: var(--danger) !important; }
.change-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.change-cell .chg-main { font-weight: 700; font-size: 13px; }
.change-cell .chg-pct  { font-size: 11px; opacity: 0.8; }

/* ── CHART CARD ───────────────────────────────────────────── */
.city-chart-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 28px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.city-chart-header {
  padding: 16px 16px 0;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 10px;
}
.city-chart-title {
  font-family: Calibri, sans-serif;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.city-chart-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.city-chart-tab {
  background: #F5F5F5; border: none; cursor: pointer;
  font-family: Calibri, sans-serif;
  font-size: 11px; font-weight: 700; color: #888;
  padding: 5px 10px; border-radius: 6px;
  transition: all 0.18s;
}
.city-chart-tab:hover  { background: #E5E5E5; color: #333; }
.city-chart-tab.active { background: var(--black); color: var(--gold); }
.city-chart-wrap {
  padding: 10px 16px 8px;
  height: 180px;
  position: relative;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.city-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  cursor: crosshair;
  max-width: 100%;
}
.city-chart-xlabels {
  display: flex; justify-content: space-between;
  padding: 0 16px 14px;
  font-family: Calibri, sans-serif;
  font-size: 10px; color: #AAA;
  overflow: hidden;
}

/* ── HISTORY TABLE ────────────────────────────────────────── */
.city-history-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 28px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.city-history-tabs {
  display: flex;
  border-bottom: 1px solid #EEEEEE;
  padding: 0 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.city-history-tab {
  background: none; border: none; cursor: pointer;
  font-family: Calibri, sans-serif;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: #AAA; padding: 12px 14px;
  border-bottom: 2px solid transparent;
  transition: all 0.18s; white-space: nowrap;
  flex-shrink: 0;
}
.city-history-tab:hover  { color: var(--muted); }
.city-history-tab.active { color: var(--black); border-bottom-color: var(--black); }

/* ── EDITORIAL CONTENT ────────────────────────────────────── */
.city-article {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}
.city-article h2 {
  font-family: Calibri, sans-serif;
  font-size: clamp(15px, 2.5vw, 18px);
  font-weight: 700; color: var(--black);
  background: #F2F2F2;
  border-left: 4px solid var(--black);
  padding: 10px 14px;
  border-radius: 0 8px 8px 0;
  margin: 28px 0 12px; line-height: 1.3;
  max-width: 100%;
  box-sizing: border-box;
}
.city-article h2:first-child { margin-top: 0; }
.city-article p {
  font-family: Calibri, sans-serif;
  font-size: 15px; color: #333;
  line-height: 1.85; margin-bottom: 14px;
  text-align: justify; text-justify: inter-word;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
  box-sizing: border-box;
}
.city-article strong { color: var(--black); font-weight: 700; }
.city-article a { color: var(--gold); text-decoration: none; }
.city-article a:hover { text-decoration: underline; }
.city-highlight {
  background: #FFFBF0;
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  padding: 13px 16px; margin: 16px 0;
  font-family: Calibri, sans-serif;
  font-size: 14px; color: #555;
  font-style: italic; line-height: 1.7;
}

/* ── FAQ ──────────────────────────────────────────────────── */
.city-faq { margin-top: 28px; }
.city-faq-item {
  border: 1px solid #E2E2E2;
  border-radius: 10px; overflow: hidden;
  margin-bottom: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.city-faq-item.open {
  border-color: var(--black);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.city-faq-btn {
  width: 100%; display: flex;
  align-items: center; justify-content: space-between;
  gap: 12px; padding: 0;
  background: #F5F5F5; border: none;
  cursor: pointer; text-align: left;
  transition: background 0.18s;
}
.city-faq-item.open .city-faq-btn { background: var(--black); }
.city-faq-btn:hover { background: #EBEBEB; }
.city-faq-item.open .city-faq-btn:hover { background: #1A1A1A; }
.city-faq-btn h3 {
  font-family: Calibri, sans-serif;
  font-size: 14px; font-weight: 700; color: #111;
  margin: 0; padding: 14px 16px; flex: 1; line-height: 1.4;
}
.city-faq-item.open .city-faq-btn h3 { color: var(--white); }
.city-faq-icon {
  flex-shrink: 0; width: 24px; height: 24px;
  border-radius: 50%; border: 2px solid #BBB;
  margin-right: 14px;
  display: flex; align-items: center; justify-content: center;
  position: relative; transition: all 0.22s;
}
.city-faq-icon::before, .city-faq-icon::after {
  content: ''; position: absolute;
  background: #555; border-radius: 2px; transition: all 0.22s;
}
.city-faq-icon::before { width: 10px; height: 2px; }
.city-faq-icon::after  { width: 2px; height: 10px; }
.city-faq-item.open .city-faq-icon {
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.1);
  transform: rotate(45deg);
}
.city-faq-item.open .city-faq-icon::before,
.city-faq-item.open .city-faq-icon::after { background: var(--white); }
.city-faq-answer {
  display: none; padding: 14px 16px 16px;
  background: #FAFAFA;
  border-top: 1px solid #EEEEEE;
  animation: fadeIn 0.2s ease;
}
.city-faq-item.open .city-faq-answer { display: block; }
.city-faq-answer p {
  font-family: Calibri, sans-serif;
  font-size: 14px; color: #444;
  line-height: 1.8; margin: 0;
  text-align: justify;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── RIGHT SIDEBAR ────────────────────────────────────────── */
.city-sidebar {
  position: sticky; top: 70px;
  width: 100%;
}
.city-sidebar-widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 20px;
}
.city-sidebar-head {
  background: var(--black); color: var(--white);
  font-family: Calibri, sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.10em;
  padding: 10px 14px;
}
.city-sidebar-head span { color: var(--gold); }

/* Mini calculator */
.city-mini-calc { padding: 14px; }
.city-mini-calc label {
  font-family: Calibri, sans-serif;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: #888; display: block; margin-bottom: 6px;
}
.city-mini-calc input,
.city-mini-calc select {
  width: 100%;
  font-family: Calibri, sans-serif; font-size: 14px;
  color: #111; background: #F7F7F7;
  border: 1.5px solid #E0E0E0; border-radius: 8px;
  padding: 9px 12px; outline: none; margin-bottom: 10px;
  transition: border-color 0.18s;
}
.city-mini-calc input:focus,
.city-mini-calc select:focus {
  border-color: var(--black); background: var(--white);
}
.city-mini-result {
  background: var(--black); border-radius: 8px;
  padding: 12px; text-align: center; margin-top: 4px;
}
.city-mini-result-label {
  font-family: Calibri, sans-serif;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.10em;
  color: #666; margin-bottom: 4px;
}
.city-mini-result-value {
  font-family: Calibri, sans-serif;
  font-size: 22px; font-weight: 700;
  color: var(--gold); line-height: 1;
}
.city-mini-calc-btn {
  width: 100%; margin-top: 10px;
  background: var(--gold); color: var(--white);
  font-family: Calibri, sans-serif;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  border: none; border-radius: 8px;
  padding: 10px; cursor: pointer;
  transition: background 0.18s; text-decoration: none;
  display: block; text-align: center;
}
.city-mini-calc-btn:hover { background: #9E7E1E; }

/* Other cities list */
.city-list { list-style: none; padding: 0; margin: 0; }
.city-list li { border-bottom: 1px solid #F5F5F5; }
.city-list li:last-child { border-bottom: none; }
.city-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  font-family: Calibri, sans-serif;
  font-size: 13px; font-weight: 600; color: #222;
  text-decoration: none; transition: background 0.15s;
}
.city-list a:hover { background: #F7F7F7; color: var(--gold); }
.city-list-rate { font-weight: 700; color: var(--black); font-size: 13px; }

/* Sidebar news */
.city-sidebar-news-list { list-style: none; padding: 0; margin: 0; }
.city-sidebar-news-item { border-bottom: 1px solid #F5F5F5; }
.city-sidebar-news-item:last-child { border-bottom: none; }
.city-sidebar-news-link {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 14px; text-decoration: none;
  transition: background 0.15s;
}
.city-sidebar-news-link:hover { background: #F7F7F7; }
.city-sidebar-news-num {
  font-family: Calibri, sans-serif;
  font-size: 17px; font-weight: 700;
  color: #E8E8E8; min-width: 22px; flex-shrink: 0; line-height: 1;
}
.city-sidebar-news-title {
  font-family: Calibri, sans-serif;
  font-size: 13px; font-weight: 600;
  color: #222; line-height: 1.4;
}
.city-sidebar-news-link:hover .city-sidebar-news-title { color: var(--gold); }

/* ── RESPONSIVE ───────────────────────────────────────────── */

/* CRITICAL: min-width: 0 on grid children prevents CSS grid overflow */
.city-main, .city-sidebar {
  min-width: 0;
}

@media (max-width: 960px) {
  /* Single column layout */
  .city-page-wrap {
    grid-template-columns: 1fr;
    padding: 20px 14px 50px;
    gap: 20px;
  }
  .city-sidebar {
    position: static;
    width: 100%;
    min-width: 0;
  }
  /* Show sidebar in a 2-col mini grid on tablet */
  .city-sidebar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .city-sidebar-widget { margin-bottom: 0; }

  .city-hero     { padding: 24px 14px 0; }
  .city-hero-top { flex-direction: column; gap: 16px; }
  .city-rate-card {
    width: 100%; min-width: unset; box-sizing: border-box;
  }
}

@media (max-width: 600px) {
  /* Sidebar back to single col on small mobile */
  .city-sidebar-inner { grid-template-columns: 1fr; }
  .city-sidebar-widget { margin-bottom: 16px; }

  .city-hero     { padding: 18px 12px 0; }
  .city-hero h1  { font-size: 19px; }
  .city-hero-sub { font-size: 12px; }
  .city-hero-tag { font-size: 10px; padding: 3px 10px; }

  .city-rate-card        { padding: 16px; }
  .city-rate-card-price  { font-size: 30px; }

  .city-page-wrap   { padding: 16px 10px 44px; gap: 16px; }

  .city-section-heading { font-size: 15px; padding: 9px 12px; }

  /* Tables always scroll horizontally */
  .city-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
    max-width: 100%;
  }
  .city-table         { min-width: 440px; }
  .city-history-card .city-table { min-width: 320px; }
  .city-table thead th { font-size: 10px; padding: 9px 8px; white-space: nowrap; }
  .city-table td        { font-size: 12px; padding: 10px 8px; white-space: nowrap; }

  /* Chart smaller and constrained */
  .city-chart-wrap   { height: 150px !important; padding: 8px 12px 6px; overflow: hidden; }
  .city-chart-header { padding: 12px 12px 0; flex-direction: column; align-items: flex-start; gap: 8px; }
  .city-chart-tab    { font-size: 10px; padding: 4px 8px; }
  .city-chart-xlabels { padding: 0 12px 12px; font-size: 9px; }

  .city-article h2  { font-size: 14px; padding: 9px 12px; margin: 22px 0 10px; }
  .city-article p   { font-size: 14px; }

  .city-faq-btn h3  { font-size: 13px; padding: 12px 14px; }
  .city-faq-answer p { font-size: 13px; }

  .city-sidebar-head { font-size: 10px; padding: 9px 12px; }
  .city-mini-calc    { padding: 12px; }
  .city-mini-result-value { font-size: 20px; }

  .change-cell .chg-main { font-size: 12px; }
  .change-cell .chg-pct  { font-size: 10px; }
}

@media (max-width: 380px) {
  .city-hero h1          { font-size: 17px; }
  .city-rate-card-price  { font-size: 26px; }
  .city-page-wrap        { padding: 12px 8px 40px; }
  .city-section-heading  { font-size: 13px; }
  .city-table thead th   { font-size: 9px; padding: 8px 6px; }
  .city-table td          { font-size: 11px; padding: 9px 6px; }
}
