/* Fonts loaded via <link> tags for faster non-blocking load */

:root {
  --gold: #C4973B;
  --gold-dark: #A07830;
  --gold-light: #E8D9B8;
  --gold-subtle: #F2EBD8;
  --bg: #FDF8F0;
  --surface: #FFFDF7;
  --text: #2C1810;
  --text-muted: #6B5B4F;
  --text-light: #9A8B7F;
  --success: #3D7A52;
  --success-bg: #EBF2EC;
  --warning: #B87333;
  --warning-bg: #F5EDE2;
  --border: #D4C5B0;
  --border-light: #E8DDD0;
  --shadow: rgba(44, 24, 16, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif !important;
  background: var(--bg) !important;
  color: var(--text) !important;
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

.js-plotly-plot, .plotly { max-width: 100%; overflow: hidden; }

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif !important; font-weight: 400 !important; letter-spacing: -0.01em; }

/* ---- NAVBAR ---- */
.zidi-nav { background: var(--text); padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 56px; position: sticky; top: 0; z-index: 100; }
.zidi-nav-brand { font-family: 'Playfair Display', Georgia, serif; font-size: 1.5rem; font-weight: 500; color: var(--gold); text-decoration: none; display: flex; align-items: center; gap: 0.4rem; letter-spacing: 0.02em; }
.zidi-nav-brand .dot { width: 8px; height: 8px; background: var(--gold); border-radius: 50%; display: inline-block; }
.zidi-nav-links { display: flex; gap: 0.15rem; flex-wrap: wrap; }
.zidi-nav-links a { text-decoration: none; color: rgba(255,255,255,0.6); padding: 0.4rem 0.7rem; border-radius: 6px; font-size: 0.8rem; font-weight: 400; letter-spacing: 0.04em; text-transform: uppercase; transition: all 0.15s; font-family: 'Inter', sans-serif; }
.zidi-nav-links a:hover { color: white; background: rgba(255,255,255,0.08); }
.zidi-nav-links a.active { color: var(--gold); background: rgba(196,151,59,0.12); font-weight: 500; }

/* ---- MARQUEE ---- */
.marquee-strip { background: var(--gold-light); border-bottom: 2px solid var(--text); padding: 0.4rem 0; overflow: hidden; white-space: nowrap; }
.marquee-inner { display: inline-block; animation: marquee 30s linear infinite; font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text); }
.marquee-inner span { margin: 0 2rem; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ---- CONTAINER ---- */
.zidi-container { max-width: 1200px; margin: 0 auto; padding: 2rem; }

/* ---- CARDS ---- */
.zidi-card { background: var(--surface); border: 2px solid var(--text); border-radius: 16px; padding: 1.25rem 1.5rem; transition: all 0.2s; box-shadow: 4px 4px 0 var(--border); margin-bottom: 1.25rem; }
.zidi-card:hover { box-shadow: 6px 6px 0 var(--border); transform: translate(-1px, -1px); }
.zidi-card-accent { border-left: 5px solid var(--gold); }
.zidi-card .card-label { font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.08em; }
.zidi-card .big-number { font-family: 'Playfair Display', Georgia, serif; font-size: 2rem; font-weight: 400; color: var(--text); letter-spacing: -0.02em; }
.zidi-card .sub-text { font-size: 0.8rem; color: var(--text-light); margin-top: 0.25rem; }

/* ---- HERO ---- */
.zidi-hero { background: var(--gold-subtle); border: 2px solid var(--text); border-radius: 16px; padding: 2.5rem; margin-bottom: 2rem; box-shadow: 6px 6px 0 var(--text); position: relative; overflow: hidden; }
.zidi-hero::after { content: '\2604'; position: absolute; top: -20px; right: 30px; font-size: 8rem; opacity: 0.12; color: var(--text); }
.zidi-hero h2 { font-size: 2.4rem; margin-bottom: 0.5rem; position: relative; }
.zidi-hero p { color: var(--text); opacity: 0.75; margin-bottom: 1.25rem; font-size: 1rem; position: relative; }

/* ---- BUTTONS ---- */
.zidi-btn { font-family: 'Inter', sans-serif; padding: 0.65rem 1.4rem; border-radius: 50px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; border: 2px solid var(--text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 0.4rem; transition: all 0.15s; }
.zidi-btn-primary { background: var(--text); color: var(--surface); }
.zidi-btn-primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--surface); transform: translateY(-1px); box-shadow: 0 4px 12px var(--shadow); }
.zidi-btn-outline { background: var(--surface); color: var(--text); }
.zidi-btn-outline:hover { background: var(--gold-subtle); color: var(--text); transform: translateY(-1px); }
.zidi-btn-gold { background: var(--gold); color: var(--text); border-color: var(--text); }
.zidi-btn-gold:hover { background: var(--gold-dark); color: white; transform: translateY(-1px); }

/* ---- BADGES ---- */
.zidi-badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 50px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; border: 1.5px solid; font-family: 'Inter', sans-serif; }
.zidi-badge-bill { background: var(--success-bg); color: var(--success); border-color: var(--success); }
.zidi-badge-bond { background: var(--warning-bg); color: var(--warning); border-color: var(--warning); }
.zidi-badge-tag { background: transparent; color: var(--text-muted); border-color: var(--border); font-weight: 500; }

/* ---- TABLES ---- */
.zidi-table-wrap { background: var(--surface); border: 2px solid var(--text); border-radius: 16px; overflow: hidden; box-shadow: 4px 4px 0 var(--border); margin-bottom: 1.25rem; }
.zidi-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.zidi-table thead { background: var(--text); color: var(--surface); }
.zidi-table th { font-family: 'Inter', sans-serif; text-align: left; padding: 0.75rem 1rem; font-weight: 500; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; }
.zidi-table th.text-right { text-align: right; }
.zidi-table td { padding: 0.75rem 1rem; border-top: 1px solid var(--border-light); }
.zidi-table td.text-right { text-align: right; }
.zidi-table tbody tr:hover { background: var(--gold-subtle); }

/* ---- SECTION LABELS ---- */
.zidi-section-label { font-family: 'Inter', sans-serif; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--gold-dark); font-weight: 600; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.zidi-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }

/* ---- FORMS ---- */
.zidi-form-label { font-family: 'Inter', sans-serif; display: block; font-size: 0.7rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.08em; }
.zidi-input, .zidi-select, .zidi-textarea { width: 100%; padding: 0.6rem 0.75rem; border: 2px solid var(--text); border-radius: 10px; font-size: 0.9rem; background: white; color: var(--text); font-family: 'Inter', sans-serif; }
.zidi-input:focus, .zidi-select:focus, .zidi-textarea:focus { outline: none; border-color: var(--gold-dark); box-shadow: 0 0 0 3px var(--gold-light); }
.zidi-textarea { min-height: 80px; resize: vertical; }

/* ---- SUBSCRIBE CARD ---- */
.zidi-subscribe { background: var(--gold-subtle); border: 2px solid var(--text); border-radius: 16px; padding: 1.75rem; margin-bottom: 1.75rem; box-shadow: 4px 4px 0 var(--text); }
.zidi-subscribe h3 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.zidi-subscribe p { color: var(--text); opacity: 0.7; font-size: 0.9rem; margin-bottom: 1rem; }
.zidi-subscribe .zidi-form-label { opacity: 0.7; }
.form-row { display: flex; gap: 0.75rem; align-items: flex-end; flex-wrap: wrap; }
.form-group { flex: 1; min-width: 150px; }

/* ---- BLOG CARDS ---- */
.zidi-blog-card { background: var(--surface); border: 2px solid var(--text); border-radius: 16px; padding: 1.5rem; transition: all 0.2s; cursor: pointer; box-shadow: 4px 4px 0 var(--border); margin-bottom: 1.25rem; }
.zidi-blog-card:hover { box-shadow: 6px 6px 0 var(--gold); transform: translate(-2px, -2px); }
.zidi-blog-card h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.zidi-blog-card:hover h3 { color: var(--gold-dark); }
.zidi-blog-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }
.blog-meta { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.75rem; }
.blog-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* ---- BLOG POST CONTENT ---- */
.zidi-post-content { background: var(--surface); border: 2px solid var(--text); border-radius: 16px; padding: 2.5rem; box-shadow: 4px 4px 0 var(--border); margin-bottom: 1.25rem; }
.zidi-post-content h1 { font-size: 1.8rem; margin-bottom: 1rem; }
.zidi-post-content h2 { font-size: 1.3rem; margin-top: 1.5rem; margin-bottom: 0.5rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--gold); }
.zidi-post-content p { margin-bottom: 0.75rem; }
.zidi-post-content table { border: 2px solid var(--text); border-radius: 10px; margin: 1rem 0; overflow: hidden; width: 100%; border-collapse: collapse; }
.zidi-post-content thead { background: var(--text); color: var(--surface); }
.zidi-post-content th { padding: 0.75rem 1rem; text-align: left; font-size: 0.8rem; }
.zidi-post-content td { padding: 0.75rem 1rem; border-top: 1px solid var(--border-light); }
.zidi-post-content ul, .zidi-post-content ol { margin-left: 1.5rem; margin-bottom: 0.75rem; }
.zidi-post-content li { margin-bottom: 0.25rem; }
.zidi-post-content strong { color: var(--text); }

/* ---- COMMENT CARDS ---- */
.zidi-comment { background: var(--surface); border: 2px solid var(--border); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 0.75rem; }
.zidi-comment .author { font-family: 'Playfair Display', serif; font-weight: 500; color: var(--text); font-size: 0.95rem; }
.zidi-comment .date { color: var(--text-light); font-size: 0.8rem; }
.zidi-comment .body { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.4rem; }
.zidi-admin-reply { background: var(--gold-light); border-left: 3px solid var(--gold); border-radius: 6px; padding: 0.6rem 0.8rem; margin-top: 0.5rem; }
.zidi-admin-btn-delete { background: none; border: 1px solid #c44; color: #c44; border-radius: 6px; padding: 0.25rem 0.6rem; font-size: 0.75rem; cursor: pointer; font-family: 'Inter', sans-serif; }
.zidi-admin-btn-delete:hover { background: #c44; color: #fff; }
.zidi-admin-btn-reply { background: var(--gold); color: #fff; border: none; border-radius: 6px; padding: 0.3rem 0.8rem; font-size: 0.8rem; cursor: pointer; font-family: 'Inter', sans-serif; margin-top: 0.4rem; }
.zidi-admin-btn-reply:hover { background: var(--gold-dark); }

/* ---- TOGGLE BUTTONS ---- */
.zidi-toggle-group { display: flex; gap: 0; margin-bottom: 1.25rem; }
.zidi-toggle-btn { padding: 0.5rem 1.1rem; border: 2px solid var(--text); background: var(--surface); font-size: 0.8rem; font-weight: 500; color: var(--text-muted); cursor: pointer; font-family: 'Inter', sans-serif; text-transform: uppercase; letter-spacing: 0.04em; text-decoration: none; display: inline-block; }
.zidi-toggle-btn:first-child { border-radius: 50px 0 0 50px; }
.zidi-toggle-btn:last-child { border-radius: 0 50px 50px 0; border-left: none; }
.zidi-toggle-btn.active { background: var(--text); border-color: var(--text); color: var(--gold); font-weight: 600; }

/* ---- YIELD PILLS ---- */
.zidi-yield-pill { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.75rem; background: var(--surface); border: 2px solid var(--border); border-radius: 50px; margin: 0.25rem; }
.zidi-yield-pill .tenor { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 0.8rem; }
.zidi-yield-pill .rate { font-family: 'Playfair Display', serif; font-weight: 500; font-size: 1rem; color: var(--gold-dark); }

/* ---- GRID ---- */
.zidi-grid { display: grid; gap: 1.25rem; }
.zidi-grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.zidi-grid-2 { grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); }
.zidi-grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---- PAGE HEADER ---- */
.zidi-page-header h2 { font-size: 2.2rem; margin-bottom: 0.25rem; }
.zidi-page-header p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; }

/* ---- UTILITIES ---- */
.text-success { color: var(--success) !important; }
.text-danger { color: #c0392b !important; }
.text-muted { color: var(--text-muted) !important; }
.text-light { color: var(--text-light) !important; }
.text-right { text-align: right; }
.text-bold { font-weight: 600; }
.spacer { height: 1.5rem; }
.spacer-sm { height: 1rem; }
.space-y > * + * { margin-top: 1.25rem; }

/* ---- CHART WRAP ---- */
.zidi-chart-wrap { background: var(--surface); border: 2px solid var(--text); border-radius: 16px; padding: 1.25rem; box-shadow: 4px 4px 0 var(--border); margin-bottom: 1.25rem; overflow: hidden; }

/* ---- CHART PLACEHOLDER (lazy-load) ---- */
.chart-placeholder { display: flex; align-items: center; justify-content: center; min-height: 400px; color: var(--text-light); font-size: 0.85rem; font-family: 'Inter', sans-serif; }
.chart-placeholder .spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 0.75rem; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- ALERT ---- */
.zidi-alert-success { background: var(--success-bg); border: 2px solid var(--success); border-radius: 10px; padding: 0.75rem 1rem; margin-bottom: 0.75rem; }
.zidi-alert-danger { background: #fde8e8; border: 2px solid #c0392b; border-radius: 10px; padding: 0.75rem 1rem; margin-bottom: 0.75rem; }

/* ---- BACK LINK ---- */
.zidi-back-link { color: var(--gold-dark); font-size: 0.9rem; text-decoration: none; font-weight: 500; }
.zidi-back-link:hover { color: var(--gold); }

/* ---- Hide UIKit defaults we don't need ---- */
.uk-navbar-container { display: none !important; }

/* ---- MOBILE: Hamburger Menu ---- */
.zidi-nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.zidi-nav-toggle span { display: block; width: 22px; height: 2px; background: var(--gold); margin: 5px 0; border-radius: 2px; transition: all 0.3s; }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  /* Nav -> hamburger */
  .zidi-nav { padding: 0 1rem; flex-wrap: wrap; height: auto; min-height: 52px; }
  .zidi-nav-toggle { display: block; }
  .zidi-nav-links { display: none; width: 100%; padding: 0.5rem 0; }
  .zidi-nav-links.open { display: flex; flex-direction: column; gap: 0; }
  .zidi-nav-links a { padding: 0.6rem 0.5rem; border-radius: 0; font-size: 0.85rem; border-bottom: 1px solid rgba(255,255,255,0.06); }

  /* Container */
  .zidi-container { padding: 1rem; }

  /* Hero */
  .zidi-hero { padding: 1.5rem 1rem; margin-bottom: 1.25rem; box-shadow: 3px 3px 0 var(--text); }
  .zidi-hero h2 { font-size: 1.6rem; }
  .zidi-hero p { font-size: 0.9rem; }
  .zidi-hero::after { font-size: 5rem; top: -10px; right: 10px; }

  /* Cards */
  .zidi-card { padding: 1rem; border-radius: 12px; box-shadow: 3px 3px 0 var(--border); }
  .zidi-card .big-number { font-size: 1.5rem; }

  /* Grid -> stack */
  .zidi-grid-3, .zidi-grid-4 { grid-template-columns: 1fr; }
  .zidi-grid-2 { grid-template-columns: 1fr; }

  /* Tables -> horizontal scroll */
  .zidi-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 12px; box-shadow: 3px 3px 0 var(--border); }
  .zidi-table { min-width: 600px; font-size: 0.8rem; }
  .zidi-table th, .zidi-table td { padding: 0.6rem 0.75rem; }

  /* Charts */
  .zidi-chart-wrap { padding: 0.75rem; border-radius: 12px; box-shadow: 3px 3px 0 var(--border); }

  /* Yield pills */
  .zidi-yield-pill { padding: 0.35rem 0.6rem; }
  .zidi-yield-pill .tenor { font-size: 0.7rem; }
  .zidi-yield-pill .rate { font-size: 0.85rem; }

  /* Buttons */
  .zidi-btn { padding: 0.55rem 1rem; font-size: 0.75rem; }

  /* Forms */
  .form-row { flex-direction: column; }
  .form-group { min-width: 100%; }

  /* Subscribe */
  .zidi-subscribe { padding: 1.25rem 1rem; box-shadow: 3px 3px 0 var(--text); }

  /* Blog */
  .zidi-blog-card { box-shadow: 3px 3px 0 var(--border); }
  .zidi-post-content { padding: 1.25rem 1rem; }

  /* Page header */
  .zidi-page-header h2 { font-size: 1.6rem; }

  /* Marquee */
  .marquee-inner { font-size: 0.7rem; }

  /* Section labels */
  .zidi-section-label { font-size: 0.65rem; }
}

@media (max-width: 480px) {
  .zidi-hero h2 { font-size: 1.35rem; }
  .zidi-card .big-number { font-size: 1.3rem; }
  .zidi-page-header h2 { font-size: 1.35rem; }
  .zidi-table { min-width: 500px; font-size: 0.75rem; }
}
