/* ============================================================
   Gabay sa FX — design system
   Palette: deep teal (#0d5c63) + warm gold (#e8a33d) on white.
   Philippines financial-media style: clean, credible, light.
   ============================================================ */

:root {
  --teal: #0d5c63;
  --teal-dark: #09464c;
  --teal-soft: #e8f1f1;
  --gold: #8a5f15;           /* darkened for AA contrast on white (kickers, logo FX) */
  --gold-soft: #fdf3e3;
  --gold-bright: #d99a2b;    /* for teal backgrounds where contrast is inverted */
  --ink: #1b2a33;
  --ink-soft: #4c5c66;
  --bg: #ffffff;
  --bg-soft: #f5f8f7;
  --border: #e0e8e6;
  --danger: #b3261e;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(13, 92, 99, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}

img { max-width: 100%; height: auto; }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 14px; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--teal); color: #fff; padding: 10px 16px; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.site-logo { display: flex; align-items: center; gap: 10px; }
.site-logo:hover { text-decoration: none; }
.site-logo-text {
  font-size: 21px; font-weight: 800; letter-spacing: -0.3px; color: var(--ink);
}
.logo-sa { font-weight: 600; color: var(--ink-soft); }
.logo-fx { color: var(--gold); font-weight: 900; }

.main-nav { display: flex; gap: 4px; }
.nav-link {
  display: inline-block; padding: 8px 14px; border-radius: 8px;
  font-weight: 500; font-size: 15px; color: var(--ink);
}
.nav-link:hover { background: var(--bg-soft); text-decoration: none; }
.nav-link.nav-active { color: var(--teal); background: var(--teal-soft); font-weight: 600; }

.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; }
.main-nav-mobile { display: none; }

/* ---------- footer ---------- */

.site-footer { background: var(--ink); color: #c8d2d6; margin-top: 0; }
.footer-grid {
  display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 36px; padding: 44px 20px 36px;
}
.footer-brand .site-logo-text { color: #fff; }
.footer-brand .logo-sa { color: #9fb3ba; }
.footer-brand .logo-fx { color: var(--gold-bright); }
.footer-about { font-size: 14px; margin-top: 12px; color: #9fb3ba; }
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.4px; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #b9c6cb; font-size: 14.5px; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom { border-top: 1px solid #243a42; }
.footer-bottom-inner { padding: 16px 20px; }
.footer-bottom p { font-size: 13px; color: #7f949b; margin: 0; }

.risk-bar {
  background: #fdf0ee; border-top: 1px solid #f3d2cd; color: #6b3a35;
  font-size: 12.5px; padding: 10px 0;
}
.risk-bar .container { display: flex; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 11px 20px; border-radius: 8px;
  font-weight: 600; font-size: 14.5px; line-height: 1.2;
  border: 1.5px solid transparent; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-lg { padding: 14px 26px; font-size: 16px; }

.btn-primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }

.btn-ghost { background: #fff; color: var(--teal); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--teal); background: var(--teal-soft); }

.bc-actions {
  display: flex; gap: 10px; margin-top: auto; padding-top: 14px;
}
.bc-actions .btn { flex: 1; min-width: 0; white-space: normal; text-align: center; padding-left: 10px; padding-right: 10px; }

/* ---------- hero ---------- */

.hero { background: linear-gradient(180deg, #f2f8f7 0%, #ffffff 100%); border-bottom: 1px solid var(--border); }
.hero-inner { padding: 56px 20px 48px; }
.hero h1 { font-size: 34px; line-height: 1.25; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 16px; }
.accent { color: var(--gold); }
.hero-sub { font-size: 17.5px; color: var(--ink-soft); max-width: 640px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.hero-stats { display: flex; gap: 32px; margin-bottom: 18px; }
.hero-stat b { display: block; font-size: 26px; font-weight: 800; color: var(--teal); }
.hero-stat span { font-size: 13px; color: var(--ink-soft); }
.hero-notes { font-size: 12.5px; color: #7a8b92; max-width: 600px; }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: start; }

.hero-panel {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.hero-panel h2 { font-size: 17px; font-weight: 700; margin-bottom: 14px; }
.hero-check { list-style: none; margin-bottom: 16px; }
.hero-check li { padding-left: 26px; position: relative; margin-bottom: 12px; font-size: 14.5px; color: var(--ink); }
.hero-check li::before {
  content: ""; position: absolute; left: 0; top: 3px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--teal-soft); border: 2px solid var(--teal);
}
.hero-check li::after {
  content: ""; position: absolute; left: 5px; top: 8px;
  width: 7px; height: 4px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal);
  transform: rotate(-45deg);
}
.hero-panel-note { font-size: 13px; color: var(--ink-soft); }
.hero-panel-note a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- sections ---------- */

.section { padding: 48px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-kicker { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--gold); margin-bottom: 4px; }
.section-title { font-size: 26px; font-weight: 800; letter-spacing: -0.3px; }
.section-link { font-weight: 600; font-size: 14.5px; white-space: nowrap; }

/* ---------- grids ---------- */

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }

/* ---------- broker cards ---------- */

.broker-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.bc-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.broker-logo {
  width: 64px; height: 64px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
}
.broker-logo img { max-width: 82%; max-height: 82%; object-fit: contain; }
.bc-name { font-size: 17px; font-weight: 700; line-height: 1.3; }
.bc-tagline { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.bc-facts { list-style: none; margin-bottom: 6px; flex: 1; }
.bc-facts li { font-size: 13.5px; color: var(--ink-soft); padding: 5px 0; border-bottom: 1px dashed var(--border); }
.bc-facts li:last-child { border-bottom: 0; }
.bc-facts b { color: var(--ink); font-weight: 600; margin-right: 5px; }

/* ---------- article cards ---------- */

.article-card {
  display: flex; flex-direction: column; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); transition: border-color 0.15s;
}
.article-card:hover { border-color: var(--teal); text-decoration: none; }
.article-card h3 { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.article-card p { font-size: 13.5px; color: var(--ink-soft); margin: 0; }
.ac-kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--gold); }

/* ---------- page head ---------- */

.page-head { background: linear-gradient(180deg, #f2f8f7 0%, #ffffff 100%); border-bottom: 1px solid var(--border); }
.page-head .container { padding: 40px 20px 32px; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.25; margin-bottom: 12px; }
.page-sub { font-size: 16px; color: var(--ink-soft); max-width: 780px; }
.page-sub a { text-decoration: underline; text-underline-offset: 2px; }
/* text links inside prose paragraphs must not rely on color alone (a11y) */
.section p a { text-decoration: underline; text-underline-offset: 2px; }
.section-soft p a { text-decoration: underline; text-underline-offset: 2px; }
.article-date { font-size: 13px; color: var(--ink-soft); }

/* ---------- ranking ---------- */

.rank-list { display: flex; flex-direction: column; gap: 14px; }
.rank-row {
  display: flex; align-items: flex-start; gap: 18px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.rank-no {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  background: var(--teal); color: #fff; font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center; margin-top: 12px;
}
.rank-logo {
  width: 64px; height: 64px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
}
.rank-logo img { max-width: 82%; max-height: 82%; object-fit: contain; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-size: 19px; font-weight: 700; }
.rank-name a { color: var(--ink); }
.rank-name a:hover { color: var(--teal); }
.rank-tagline { font-size: 13.5px; color: var(--ink-soft); margin: 3px 0 8px; }
.rank-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 6px; }
.rank-facts span { font-size: 13px; color: var(--ink-soft); }
.rank-facts b { color: var(--ink); font-weight: 600; }
.rank-why { font-size: 13.5px; color: var(--ink-soft); font-style: italic; }
.rank-actions {
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0; width: 200px; align-self: flex-start;
}
.rank-actions .btn { width: 100%; }

/* ---------- breadcrumbs ---------- */

.breadcrumbs {
  font-size: 13px; color: var(--ink-soft);
  padding: 12px 20px 0; max-width: 1160px; margin: 0 auto;
}
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--teal); }
.breadcrumbs span { color: var(--ink); font-weight: 500; }

/* ---------- detail page ---------- */

.detail-hero { background: linear-gradient(180deg, #f2f8f7 0%, #ffffff 100%); border-bottom: 1px solid var(--border); }
.detail-hero-inner { display: flex; align-items: center; gap: 22px; padding: 34px 20px 30px; }
.bh-logo {
  width: 104px; height: 104px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
}
.bh-logo img { max-width: 84%; max-height: 84%; object-fit: contain; }
.bh-title { font-size: 26px; font-weight: 800; letter-spacing: -0.3px; line-height: 1.25; }
.bh-sub { font-size: 14.5px; color: var(--ink-soft); margin-top: 4px; }
.bh-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip {
  display: inline-block; background: var(--teal-soft); color: var(--teal);
  border-radius: 999px; padding: 4px 12px; font-size: 13px;
}
.chip b { font-weight: 700; }
.bh-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.detail-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 36px; padding-top: 34px; padding-bottom: 48px;
}
.detail-main { min-width: 0; }
.detail-main section { margin-bottom: 30px; }
.detail-main h2 {
  font-size: 21px; font-weight: 800; letter-spacing: -0.2px;
  margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--teal-soft);
}
.detail-main h3 { font-size: 16.5px; font-weight: 700; margin: 16px 0 8px; }
.detail-main ul, .detail-main ol { margin: 0 0 14px 22px; }
.detail-main li { margin-bottom: 6px; }

.facts-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.facts-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.facts-table td:first-child { font-weight: 600; color: var(--ink-soft); width: 34%; white-space: nowrap; }
.pay-table td:first-child { white-space: normal; }
.pay-legend { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 8px; }
.pay-status { display: inline-block; width: 20px; font-weight: 700; }
.pay-confirmed_official, .pay-confirmed_portal { color: #1a7f37; }
.pay-reported { color: #b45d1c; }
.pay-unknown { color: #8a6416; }
.pay-not_supported { color: #b3261e; }

/* ---------- sidebar ---------- */

.sidebar { min-width: 0; }
.side-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.side-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.side-cta .btn { width: 100%; margin-bottom: 10px; }
.side-mini {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px dashed var(--border);
}
.side-mini:last-child { border-bottom: 0; }
.side-mini img { width: 34px; height: 34px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; background: #fff; padding: 2px; }
.side-mini a { font-size: 14px; font-weight: 500; }

/* ---------- notices ---------- */

.notice { border-radius: var(--radius); padding: 16px 18px; margin: 14px 0; font-size: 14.5px; }
.notice h3 { font-size: 15px; margin-bottom: 6px; }
.notice-risk { background: #fdf0ee; border: 1px solid #f3d2cd; color: #6b3a35; }
.notice-warning { background: #fdf6e7; border: 1px solid #f0d9a8; color: #6b4d12; }
.notice-warning h3 { color: #8a6416; }
.notice-info { background: var(--teal-soft); border: 1px solid #cfe4e4; color: var(--teal-dark); }

.aff-disclosure { font-size: 13px; color: var(--ink-soft); margin: 12px 0; }

/* ---------- how grid ---------- */

.how-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.how-item { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.how-item h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 8px; }
.how-item p { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* ---------- article ---------- */

.article { max-width: 760px; margin: 0 auto; }
.article p { font-size: 16px; margin-bottom: 16px; }
.article h2 { font-size: 22px; font-weight: 800; margin: 28px 0 12px; }
.article h3 { font-size: 17px; font-weight: 700; margin: 22px 0 10px; }
.article ul, .article ol { margin: 0 0 16px 24px; }
.article li { margin-bottom: 7px; font-size: 15.5px; }
.article a { text-decoration: underline; }
.article-wrap { padding-top: 8px; }

.toc {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 26px;
}
.toc h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-soft); margin-bottom: 8px; }
.toc ol { margin: 0 0 0 20px; }
.toc li { margin-bottom: 5px; font-size: 14.5px; }

.sources { border-top: 1px solid var(--border); padding-top: 20px; }
.sources ul { margin-left: 20px; }
.sources li { margin-bottom: 6px; font-size: 14px; }

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

@media (max-width: 767px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .main-nav-mobile {
    display: none; flex-direction: column; gap: 2px;
    border-top: 1px solid var(--border); background: #fff; padding: 10px 20px 14px;
  }
  .main-nav-mobile.open { display: flex; }
  .main-nav-mobile .nav-link { padding: 11px 8px; }

  .hero h1 { font-size: 26px; }
  .hero-sub { font-size: 16px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .hero-inner { padding: 36px 20px 32px; }
  .hero-stats { gap: 22px; }

  .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 36px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .section-title { font-size: 22px; }

  .rank-row { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .rank-no { margin-top: 0; }
  .rank-actions { width: 100%; flex-direction: column; }
  .rank-actions .btn { width: 100%; white-space: normal; }
  .rank-facts { flex-direction: column; gap: 4px; }

  .bc-actions { flex-direction: column; }
  .bc-actions .btn { width: 100%; }

  .detail-hero-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .bh-title { font-size: 22px; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 36px 20px 28px; }
  .how-grid { grid-template-columns: minmax(0, 1fr); }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .page-head .container { padding: 30px 20px 26px; }
  .page-head h1 { font-size: 24px; }
  .hero-actions .btn { width: 100%; }
  .facts-table td:first-child { width: auto; white-space: normal; }
  .facts-table td { display: block; }
  .facts-table tr { border-bottom: 1px solid var(--border); padding: 4px 0; }
  .facts-table tr:last-child { border-bottom: 0; }
}

@media (max-width: 360px) {
  .hero h1 { font-size: 23px; }
  .hero-actions .btn { padding: 12px 14px; font-size: 14px; }
  .rank-actions { flex-direction: column; }
  .site-logo-text { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
