/* ═══════════════════════════════════════════════════════════════════
   MTQ IR Portal — Frontend Styles
   Uses CSS custom properties so colours match admin settings
   ═══════════════════════════════════════════════════════════════════ */

.mtq-ir-portal,
.mtq-section-home {
  /* Corporate tokens (Main light) — overridden by inline CSS from plugin settings */
  --mtq-bg:           #ffffff;
  --mtq-bg-2:         #f5fbff;
  --mtq-border:       #dfeaf3;
  --mtq-heading:      #949494;
  --mtq-text:         #82878e;
  --mtq-text-meta:    #a7acb2;
  --mtq-accent:       #01247f;
  --mtq-hover:        #018762;
  --mtq-navy:         var(--mtq-accent);
  --mtq-navy-mid:     #1e3050;
  --mtq-gold:         var(--mtq-hover);
  --mtq-cream:        var(--mtq-bg);
  --mtq-muted:        var(--mtq-text-meta);
  --mtq-up:           #018762;
  --mtq-down:         #c0392b;
  --mtq-font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mtq-font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-family: var(--mtq-font-body);
  color: var(--mtq-text);
  background: var(--mtq-bg);
  border: 1px solid var(--mtq-border);
  border-radius: 8px;
  overflow: hidden;
}

/* ── Price Strip ─────────────────────────────────────────────────── */
.mtq-price-strip {
  background: var(--mtq-navy);
  color: #fff;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
}
.mtq-company-name { font-weight: 600; color: #fff; }
.mtq-ticker        { background: var(--mtq-hover); color: #ffffff; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.mtq-price-val     { font-family: monospace; font-size: 15px; font-weight: 700; color: #fff; }
.mtq-price-change.mtq-up   { color: #5edb9a; font-weight: 600; }
.mtq-price-change.mtq-down { color: #f08080; font-weight: 600; }
.mtq-price-meta    { color: #7a9ab5; font-size: 12px; margin-left: auto; }
.mtq-ext-link      { color: rgba(255,255,255,0.9); font-size: 12px; text-decoration: none; }
.mtq-ext-link:hover { color: #ffffff; text-decoration: underline; }

/* ── Navigation ──────────────────────────────────────────────────── */
.mtq-ir-nav {
  background: var(--mtq-accent);
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 2px solid var(--mtq-gold);
}
.mtq-ir-nav::-webkit-scrollbar { display: none; }

.mtq-nav-btn {
  flex-shrink: 0;
  padding: 10px 14px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.78);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.mtq-nav-btn:hover { color: #ffffff; }
.mtq-nav-btn.active { color: #ffffff; border-bottom-color: var(--mtq-hover); }

/* ── Content area ────────────────────────────────────────────────── */
.mtq-ir-content { background: var(--mtq-bg); }
.mtq-tab { display: none; padding: 24px 28px; }
.mtq-tab.active { display: block; }

.mtq-section-title {
  font-size: 18px; font-weight: 600;
  color: var(--mtq-heading);
  font-family: var(--mtq-font-heading);
  border-bottom: 2px solid var(--mtq-hover);
  padding-bottom: 8px; margin: 0 0 16px;
}
.mtq-section-desc { color: var(--mtq-text-meta); font-size: 14px; margin-bottom: 16px; }

/* ── Loading / Error ─────────────────────────────────────────────── */
.mtq-loading {
  color: var(--mtq-muted); font-size: 13px;
  padding: 20px; text-align: center;
  animation: mtq-pulse 1.4s ease-in-out infinite;
}
@keyframes mtq-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
.mtq-error, .mtq-notice {
  background: var(--mtq-bg-2); border-left: 3px solid var(--mtq-hover);
  padding: 12px 16px; font-size: 13px; border-radius: 0 6px 6px 0;
  margin-bottom: 12px;
  color: var(--mtq-text);
}
.mtq-error { background: #fff0f0; border-color: var(--mtq-down); }

/* ── Metrics grid ────────────────────────────────────────────────── */
.mtq-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.mtq-metric {
  background: var(--mtq-bg-2); border: 1px solid var(--mtq-border);
  border-top: 3px solid var(--mtq-hover);
  padding: 14px 12px; border-radius: 8px; text-align: center;
}
.mtq-metric-label { font-size: 11px; color: var(--mtq-text-meta); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px; }
.mtq-metric-val   { font-family: monospace; font-size: 16px; font-weight: 600; color: var(--mtq-accent); }

/* ── Data tables ─────────────────────────────────────────────────── */
.mtq-table-wrap { overflow-x: auto; margin-bottom: 16px; }
.mtq-data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mtq-data-table thead th { background: var(--mtq-accent); color: #ffffff; padding: 10px 12px; text-align: left; font-weight: 600; font-size: 12px; letter-spacing: 0.04em; white-space: nowrap; }
.mtq-data-table tbody td { padding: 9px 10px; border-bottom: 1px solid var(--mtq-border); color: var(--mtq-text); }
.mtq-data-table tbody tr:hover td { background: var(--mtq-bg-2); }
.mtq-data-table tr.mtq-upcoming td { background: #f0fff4; font-weight: 500; }

/* ── KV table ────────────────────────────────────────────────────── */
.mtq-kv-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 12px; }
.mtq-kv-label { color: var(--mtq-text-meta); padding: 5px 10px 5px 0; width: 45%; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.mtq-kv-val   { font-family: monospace; padding: 5px 0; font-weight: 600; color: var(--mtq-accent); }

/* ── Announcements list ──────────────────────────────────────────── */
.mtq-ann-list { list-style: none; margin: 0; padding: 0; }
.mtq-ann-list li { padding: 9px 0; border-bottom: 1px solid var(--mtq-border); display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.mtq-ann-list li:last-child { border-bottom: none; }
.mtq-ann-date { font-family: monospace; font-size: 12px; background: var(--mtq-accent); color: #ffffff; padding: 2px 8px; border-radius: 4px; white-space: nowrap; flex-shrink: 0; }
.mtq-ann-cat  { font-size: 11px; background: var(--mtq-bg-2); color: var(--mtq-text-meta); padding: 2px 7px; border-radius: 10px; white-space: nowrap; border: 1px solid var(--mtq-border); }
.mtq-ann-list a { color: var(--mtq-accent); font-size: 13px; text-decoration: none; }
.mtq-ann-list a:hover { color: var(--mtq-hover); text-decoration: underline; }

/* ── News list (home) ────────────────────────────────────────────── */
.mtq-news-list { list-style: none; margin: 10px 0 0; padding: 0; }
.mtq-news-list li { padding: 6px 0; border-bottom: 1px solid var(--mtq-border); display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.mtq-news-list a { color: var(--mtq-accent); text-decoration: none; }
.mtq-news-list a:hover { color: var(--mtq-hover); text-decoration: underline; }

/* ── Year tabs ───────────────────────────────────────────────────── */
.mtq-ann-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.mtq-year-tab {
  padding: 3px 9px; font-size: 12px; font-family: monospace;
  border: 1px solid var(--mtq-border); border-radius: 3px;
  cursor: pointer; background: #fff; color: var(--mtq-muted);
  transition: all 0.12s;
}
.mtq-year-tab:hover, .mtq-year-tab.active { background: var(--mtq-accent); color: #ffffff; border-color: var(--mtq-accent); }

.mtq-ar-year-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.mtq-ar-year-tab {
  padding: 3px 9px; font-size: 12px; font-family: monospace;
  border: 1px solid var(--mtq-border); border-radius: 3px;
  cursor: pointer; background: #fff; color: var(--mtq-muted);
  transition: all 0.12s;
}
.mtq-ar-year-tab:hover, .mtq-ar-year-tab.active { background: var(--mtq-accent); color: #ffffff; border-color: var(--mtq-accent); }

/* ── Calendar type badges ────────────────────────────────────────── */
.mtq-cal-type { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.mtq-cal-full-year-results  { background: #e8f4e8; color: #1a6b2f; }
.mtq-cal-half-year-results  { background: #e8f4e8; color: #1a6b2f; }
.mtq-cal-agm                { background: #eef2ff; color: #3730a3; }
.mtq-cal-egm                { background: #eef2ff; color: #3730a3; }
.mtq-cal-ex-dividend        { background: #fef3c7; color: #92400e; }
.mtq-cal-dividend-payment   { background: #fef3c7; color: #92400e; }
.mtq-cal-other              { background: #f3f4f6; color: #6b7280; }

/* ── Annual reports grid ─────────────────────────────────────────── */
.mtq-ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 20px; }
.mtq-ar-card { background: #fff; border: 1px solid var(--mtq-border); border-radius: 4px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.mtq-ar-year  { font-size: 24px; font-weight: 700; color: var(--mtq-heading); font-family: var(--mtq-font-heading); }
.mtq-ar-title { font-size: 13px; color: var(--mtq-muted); }
.mtq-ar-size  { font-size: 11px; color: #aaa; }

/* ── Home cards grid ─────────────────────────────────────────────── */
.mtq-home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.mtq-home-card { background: #fff; border: 1px solid var(--mtq-border); border-radius: 4px; padding: 16px; }
.mtq-home-card h3 { font-size: 14px; color: var(--mtq-heading); margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--mtq-border); }

/* ── Quick links ─────────────────────────────────────────────────── */
.mtq-quicklinks { list-style: none; margin: 0; padding: 0; }
.mtq-quicklinks li { padding: 5px 0; border-bottom: 1px dashed var(--mtq-border); }
.mtq-quicklinks li:last-child { border: none; }
.mtq-quicklinks a { color: var(--mtq-accent); font-size: 13px; text-decoration: none; }
.mtq-quicklinks a:hover { color: var(--mtq-hover); }

/* ── Buttons ─────────────────────────────────────────────────────── */
.mtq-btn {
  display: inline-block; padding: 10px 18px;
  background: var(--mtq-accent); color: #ffffff;
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em; border-radius: 6px;
  text-decoration: none; border: none; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mtq-btn:hover { background: var(--mtq-hover); color: #ffffff; text-decoration: none; }

/* ── Source bar ──────────────────────────────────────────────────── */
.mtq-source { font-size: 11px; color: #aaa; margin-top: 12px; }
.mtq-source a { color: #aaa; }
.mtq-source a:hover { color: var(--mtq-hover); }

/* ── Source links row ────────────────────────────────────────────── */
.mtq-source-links { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--mtq-border); font-size: 12px; color: var(--mtq-muted); }
.mtq-source-links a { color: var(--mtq-accent); text-decoration: none; font-weight: 500; }
.mtq-source-links a:hover { color: var(--mtq-hover); text-decoration: underline; }

/* ── Footer ──────────────────────────────────────────────────────── */
.mtq-ir-footer { background: var(--mtq-accent); color: var(--mtq-text-meta); font-size: 11px; padding: 12px 16px; text-align: center; border-top: 2px solid var(--mtq-hover); }
.mtq-ir-footer a { color: #ffffff; text-decoration: none; opacity: 0.92; }
.mtq-ir-footer a:hover { opacity: 1; text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .mtq-tab { padding: 14px; }
  .mtq-metrics-grid { grid-template-columns: 1fr 1fr; }
  .mtq-home-grid, .mtq-ar-grid { grid-template-columns: 1fr; }
  .mtq-price-meta { display: none; }
}

/* ── Standalone section (individual shortcodes on a page/post) ───── */
.mtq-standalone-section {
  padding: 24px 28px;
  background: var(--mtq-bg);
  border: 1px solid var(--mtq-border);
  border-radius: 8px;
  margin-bottom: 24px;
}
.mtq-standalone-section .mtq-section-title {
  margin-top: 0;
}
/* Ensure data areas have min height while loading */
.mtq-data-area {
  min-height: 60px;
}

/* ── Announcement PDF links ───────────────────────────────────────── */
.mtq-ann-link { color: var(--mtq-accent); font-size: 13px; text-decoration: none; line-height: 1.4; }
.mtq-ann-link:hover { color: var(--mtq-hover); text-decoration: underline; }

.mtq-ann-pdf { display: inline-flex; align-items: center; gap: 5px; }

.mtq-pdf-icon {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: #c0392b;
  color: #fff;
  padding: 1px 5px;
  border-radius: 2px;
  flex-shrink: 0;
  font-family: var(--font-sans, sans-serif);
}

/* ── Images section ───────────────────────────────────────────────── */
.mtq-images-block + .mtq-images-block { border-top: 1px solid var(--mtq-border); padding-top: 24px; }
.mtq-highlights-figure { margin: 0; }
.mtq-highlights-figure img { box-shadow: 0 1px 6px rgba(0,0,0,0.08); }

/* ── Announcement detail link (ℹ icon beside PDF) ────────────────── */
.mtq-ann-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--mtq-muted);
  font-size: 11px;
  text-decoration: none;
  margin-left: 4px;
  vertical-align: middle;
  flex-shrink: 0;
  transition: background .15s;
}
.mtq-ann-detail-link:hover { background: var(--mtq-accent); color: #ffffff; }

/* ── Investment calculator ───────────────────────────────────────── */
.mtq-investment-calculator .mtq-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 20px;
  margin: 16px 0;
}
.mtq-investment-calculator .mtq-calc-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--mtq-muted);
  margin-bottom: 4px;
}
.mtq-investment-calculator .mtq-calc-field input {
  width: 100%;
  max-width: 280px;
  padding: 8px 10px;
  border: 1px solid var(--mtq-border);
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}
.mtq-investment-calculator .mtq-calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.mtq-investment-calculator .mtq-calc-results {
  margin-top: 20px;
  padding: 16px;
  background: var(--mtq-bg-2);
  border: 1px solid var(--mtq-border);
  border-radius: 8px;
  border-left: 3px solid var(--mtq-hover);
}
.mtq-investment-calculator .mtq-calc-results table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.mtq-investment-calculator .mtq-calc-results th,
.mtq-investment-calculator .mtq-calc-results td {
  padding: 6px 10px 6px 0;
  text-align: left;
  border-bottom: 1px solid var(--mtq-border);
}
.mtq-investment-calculator .mtq-calc-results tbody tr:last-child th,
.mtq-investment-calculator .mtq-calc-results tbody tr:last-child td {
  border-bottom: none;
  font-weight: 700;
}
.mtq-investment-calculator .mtq-calc-results .mtq-calc-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mtq-investment-calculator .mtq-calc-footnote {
  margin-top: 12px;
  font-size: 12px;
  color: var(--mtq-muted);
}
.mtq-investment-calculator .mtq-calc-subhead {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--mtq-accent);
  padding-top: 8px;
}
.mtq-investment-calculator .mtq-calc-field-span {
  grid-column: 1 / -1;
}
/* ── Insider trades (lookup table + filters) ───────────────────── */
.mtq-insider-details summary {
  cursor: pointer;
  color: var(--mtq-accent);
  font-size: 13px;
  font-weight: 600;
}
.mtq-insider-remarks {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--mtq-bg-2);
  border: 1px solid var(--mtq-border);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
  max-width: 36rem;
  text-align: left;
  white-space: pre-wrap;
}

.mtq-investment-calculator .mtq-calc-dividend-hint {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--mtq-muted);
  font-weight: 400;
  max-width: 52rem;
}
.mtq-investment-calculator .mtq-calc-quote-hint {
  font-size: 13px;
  margin-bottom: 8px;
}

/* ── Email alerts (legacy-style demographics + honeypot) ───────── */
.mtq-email-alerts-form .mtq-select-wide {
  max-width: 100%;
  width: min(420px, 100%);
  padding: 6px 8px;
  border: 1px solid var(--mtq-border);
  border-radius: 4px;
  background: #fff;
}
.mtq-email-alerts-prefs {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--mtq-border);
}
.mtq-email-alerts-prefs-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mtq-heading);
  font-family: var(--mtq-font-heading);
}
.mtq-sub-hp-wrap {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Layout wrap + chrome presets (shortcode / Elementor) ───────── */
.mtq-section-intro {
  font-size: 14px;
  line-height: 1.6;
  color: var(--mtq-text);
  margin-bottom: 12px;
}
.mtq-section-intro p:last-child {
  margin-bottom: 0;
}
.mtq-ann--hide-sources .mtq-source-links {
  display: none;
}
.mtq-ir-portal--chrome-compact .mtq-ir-nav .mtq-nav-btn {
  padding: 8px 10px;
  font-size: 11px;
}
.mtq-ir-portal--chrome-compact .mtq-price-strip {
  padding: 6px 12px;
  font-size: 12px;
}
.mtq-ir-portal--chrome-compact .mtq-ir-footer {
  padding: 8px 12px;
  font-size: 11px;
}
.mtq-ir-portal--chrome-compact .mtq-section-title {
  font-size: 16px;
  padding-bottom: 6px;
  margin-bottom: 12px;
}

/* ── Financials: detailed statements + review block ─────────────── */
.mtq-fin-detail-wrap {
  margin-top: 22px;
}
.mtq-fin-detail-title,
.mtq-fin-review-title {
  margin: 0 0 10px;
  font-size: 17px;
  color: var(--mtq-heading);
  font-family: var(--mtq-font-heading);
}
.mtq-fin-detail-section {
  margin-bottom: 16px;
}
.mtq-fin-detail-section-title {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--mtq-heading);
}
.mtq-fin-detail-table td:first-child,
.mtq-fin-detail-table th:first-child {
  min-width: 220px;
}
.mtq-fin-review-wrap {
  margin-top: 22px;
  padding: 14px 16px;
  background: var(--mtq-bg-2);
  border: 1px solid var(--mtq-border);
  border-radius: 8px;
}
.mtq-fin-review-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--mtq-text);
}
.mtq-fin-review-content p:first-child {
  margin-top: 0;
}
.mtq-fin-review-content p:last-child {
  margin-bottom: 0;
}
