/* ── DAILY MARKET BRIEF — STYLES (original design) ── */
:root {
  --red:          #BB1919;
  --red-dark:     #8B1010;
  --red-light:    #FFF0F0;
  --charcoal:     #222222;
  --dark:         #1A1A1A;
  --mid:          #555555;
  --muted:        #888888;
  --border:       #DDDDDD;
  --bg:           #F5F5F5;
  --surface:      #FFFFFF;
  --surface2:     #F9F9F9;
  --green:        #1a7a3c;
  --green-bg:     #E8F5EE;
  --green-border: #B2DFC2;
  --red-bg:       #FEE8E8;
  --red-border:   #F5B8B8;
  --amber:        #8A5A00;
  --amber-bg:     #FFF3D6;
  --amber-border: #F5D99A;
  --blue:         #1053A0;
  --blue-bg:      #E6EEF9;
  --blue-border:  #B0C8EE;
  --serif:        Georgia, 'Times New Roman', Times, serif;
  --sans:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--charcoal);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
}

/* ── HEADER ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--red);
  border-bottom: none;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.dmb-logo {
  background: #FFFFFF;
  color: var(--red);
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 900;
  padding: 4px 10px;
  letter-spacing: -0.5px;
  line-height: 1.2;
  border-radius: 2px;
}
.site-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  line-height: 1.2;
}
.edition-label {
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 2px;
}
.header-right { text-align: right; color: rgba(255,255,255,0.9); font-size: 12px; line-height: 1.6; }
.date-label { font-size: 12px; color: rgba(255,255,255,0.85); }
.countdown { font-size: 13px; font-weight: 700; color: #FFFFFF; font-variant-numeric: tabular-nums; }
.archive-badge {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 2px 8px;
  border-radius: 2px;
}
.back-link {
  display: block;
  text-align: center;
  padding: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  background: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.2);
}
.back-link:hover { background: rgba(0,0,0,0.25); color: #fff; }

/* ── TICKER BAR ── */
.ticker-wrap {
  background: #2B2B2B;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 7px 0;
  border-bottom: 3px solid var(--red);
  white-space: nowrap;
}
.ticker-label {
  flex-shrink: 0;
  background: var(--red);
  color: #FFF;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 12px;
  line-height: 22px;
  height: 22px;
  margin-right: 0;
}
.ticker-track { flex: 1; overflow: hidden; }
.ticker-inner {
  display: inline-flex;
  animation: ticker-scroll 60s linear infinite;
}
.ticker-wrap:hover .ticker-inner { animation-play-state: paused; }
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.tick-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 22px;
  border-right: 1px solid #555;
  color: #EEEEEE;
  font-size: 12px;
}
.tick-sym { font-weight: 700; color: #FFFFFF; }
.tick-price { color: #CCCCCC; }
.tick-chg.up   { color: #4ADE80; }
.tick-chg.down { color: #F87171; }

/* ── MAIN CONTAINER ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* ── TOP STORY ── */
.top-story { margin-bottom: 40px; }
.hero-image-wrap {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  max-height: 420px;
  border: 1px solid var(--border);
}
.hero-image { width: 100%; height: 420px; object-fit: cover; display: block; }
.hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, transparent 100%);
  padding: 32px 24px 24px;
}
.hero-headline { font-family: var(--serif); font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 700; color: #fff; line-height: 1.3; }
.hero-no-image {
  background: var(--red);
  border-radius: 2px;
  padding: 32px;
  border-top: 3px solid var(--red-dark);
}
.hero-headline-text { font-family: var(--serif); font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 700; color: #fff; }
.top-story-body { padding: 16px 4px 0; }
.top-story-body p { color: var(--mid); font-size: 14px; line-height: 1.7; }
.image-credit { font-size: 12px !important; color: var(--muted) !important; margin-top: 8px !important; font-style: italic; }

/* ── SECTIONS ── */
.section { margin-bottom: 40px; }
.section-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 8px;
}
.section-divider {
  height: 3px;
  background: var(--red);
  width: 100%;
  margin-bottom: 24px;
}

/* ── TABLES ── */
.table-wrap { overflow-x: auto; border-radius: 2px; border: 1px solid var(--border); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left;
  padding: 9px 13px;
  background: #F2F2F2;
  color: var(--mid);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  border-bottom: 2px solid var(--red);
}
.data-table td {
  padding: 11px 13px;
  border-bottom: 1px solid #EBEBEB;
  vertical-align: middle;
  color: var(--mid);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #FFF8F8; }
.country-tag {
  background: #F2F2F2;
  color: var(--mid);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 2px;
  border: 1px solid var(--border);
}
.actual-released { color: var(--green); font-weight: 700; }

/* ── TABS ── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--red);
}
.tab-btn {
  background: #F2F2F2;
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--mid);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 20px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: var(--sans);
}
.tab-btn:first-child { border-radius: 2px 0 0 0; }
.tab-btn:last-child  { border-radius: 0 2px 0 0; }
.tab-btn.active { background: var(--red); color: #FFFFFF; border-color: var(--red); }
.tab-btn:hover:not(.active) { background: #E8E8E8; color: var(--charcoal); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── INSTRUMENT CARDS ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}
.instrument-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s;
}
.instrument-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.card-symbol { font-family: var(--serif); font-size: 15px; font-weight: 700; color: var(--charcoal); }
.card-name { font-size: 11px; color: var(--muted); letter-spacing: 0.5px; margin-top: 1px; }
.card-unit { font-size: 10px; color: var(--muted); }

/* Sentiment badges — pastel */
.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.badge-bullish  { background: var(--green-bg);  color: var(--green); border: 1px solid var(--green-border); }
.badge-bearish  { background: var(--red-bg);    color: var(--red);   border: 1px solid var(--red-border); }
.badge-volatile { background: var(--amber-bg);  color: var(--amber); border: 1px solid var(--amber-border); }
.badge-neutral  { background: var(--blue-bg);   color: var(--blue);  border: 1px solid var(--blue-border); }

.card-body { padding: 16px; }
.card-price {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1;
  margin-bottom: 14px;
}
.card-currency { font-size: 13px; color: var(--muted); font-weight: 400; font-family: var(--sans); }
.card-changes { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.change-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 2px;
}
.change-up   { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.change-down { background: var(--red-bg);   color: var(--red);   border: 1px solid var(--red-border); }
.change-flat { background: var(--blue-bg);  color: var(--blue);  border: 1px solid var(--blue-border); }

.card-narrative {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--mid);
  margin-bottom: 10px;
}
.card-narrative strong, .card-watch strong {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 5px;
}
.card-watch {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.6;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-left: 3px solid var(--red);
  background: var(--red-light);
}
.card-levels {
  font-size: 12px;
  color: var(--muted);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.card-image { margin-top: 12px; }
.card-image img { width: 100%; border-radius: 2px; max-height: 160px; object-fit: cover; }
.card-image figcaption { font-size: 11px; color: var(--muted); margin-top: 6px; font-style: italic; }

/* ── MACRO ANALYSIS ── */
.macro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.macro-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 2px;
  padding: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.macro-block h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.narrative p { color: var(--mid); font-size: 14px; margin-bottom: 12px; line-height: 1.75; }
.narrative p:last-child { margin-bottom: 0; }
.narrative p strong { color: var(--charcoal); }

/* ── ARCHIVE LINK ── */
.archive-cta { text-align: right; margin: 32px 0 8px; }
.archive-link {
  color: var(--red);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}
.archive-link:hover { text-decoration: underline; }

/* ── FOOTER ── */
.site-footer {
  background: var(--dark);
  border-top: 4px solid var(--red);
  padding: 24px;
  margin-top: 40px;
}
.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; }
.footer-brand {
  display: inline-block;
  background: var(--red);
  color: #FFF;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 900;
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
}
.footer-meta { font-size: 12px; color: #888; line-height: 1.7; }
.countdown-sm { font-size: 12px; color: #AAA; margin: 8px 0; }
.disclaimer {
  font-size: 11.5px;
  color: #777;
  max-width: 700px;
  margin: 14px auto 0;
  line-height: 1.7;
}
.footer-team { font-size: 13px; color: #999; margin-top: 10px; }

/* ── RISK TABLE BADGES ── */
.risk-high   { background: var(--red-bg);   color: var(--red);   font-weight: 700; font-size: 10px; padding: 2px 7px; border-radius: 2px; border: 1px solid var(--red-border);   display: inline-block; }
.risk-medium { background: var(--amber-bg); color: var(--amber); font-weight: 700; font-size: 10px; padding: 2px 7px; border-radius: 2px; border: 1px solid var(--amber-border); display: inline-block; }
.risk-low    { background: var(--green-bg); color: var(--green); font-weight: 700; font-size: 10px; padding: 2px 7px; border-radius: 2px; border: 1px solid var(--green-border); display: inline-block; }

/* ── ARCHIVE PAGE ── */
.archive-month { margin-bottom: 40px; }
.month-heading {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--charcoal);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--red);
}
.archive-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #EBEBEB;
}
.archive-date { font-weight: 700; color: var(--charcoal); min-width: 140px; font-size: 14px; }
.archive-edition { color: var(--mid); font-size: 13px; flex: 1; }
.archive-view { color: var(--red); text-decoration: none; font-size: 13px; font-weight: 700; }
.archive-view:hover { text-decoration: underline; }

/* ── ACTION BAR (PDF + Archive) ── */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 32px 0 8px;
  flex-wrap: wrap;
  gap: 12px;
}
.pdf-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-pdf-download {
  display: inline-block;
  background: var(--red);
  color: #FFFFFF;
  border: none;
  border-radius: 2px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.15s, opacity 0.15s;
  text-decoration: none;
}
.btn-pdf-download:hover { background: var(--red-dark); }
.btn-pdf-pc { background: var(--red-dark); }
.btn-pdf-pc:hover { background: #6a0c0c; }
.btn-pdf-download.unavailable {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── PRINT / PDF STYLES ── */
@media print {
  @page {
    size: A4;
    margin: 15mm 12mm 15mm 12mm;
  }

  /* Hide interactive / screen-only elements */
  .site-header,
  .ticker-wrap,
  .tabs,
  .action-bar,
  .archive-cta,
  .btn-pdf,
  #countdown,
  #countdown-footer,
  .countdown,
  .countdown-sm,
  .back-link { display: none !important; }

  /* Show all tab panels */
  .tab-content { display: block !important; }
  .print-show  { display: block !important; }

  body {
    background: #FFFFFF;
    color: #222222;
    font-size: 11pt;
    font-family: Georgia, serif;
  }

  .container { padding: 0; max-width: 100%; }

  /* Print header block */
  .print-header {
    display: flex !important;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 3px solid #BB1919;
    padding-bottom: 10px;
    margin-bottom: 20px;
  }
  .print-header .ph-title {
    font-family: Georgia, serif;
    font-size: 20pt;
    font-weight: 700;
    color: #BB1919;
  }
  .print-header .ph-meta { font-size: 9pt; color: #555; text-align: right; line-height: 1.6; }

  /* Section titles */
  .section-title {
    font-size: 13pt;
    page-break-after: avoid;
    color: #222;
  }
  .section-divider { background: #BB1919; margin-bottom: 12px; }
  .section { page-break-inside: avoid; margin-bottom: 24pt; }

  /* Cards — 2 per row on A4 */
  .cards-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .instrument-card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #DDD;
    border-top: 3px solid #BB1919;
    padding: 0;
  }
  .card-body { padding: 10px 12px; }
  .card-price { font-size: 18pt; }
  .card-narrative, .card-watch { font-size: 9pt; }
  .card-image { display: none; } /* skip images in PDF to keep it clean */

  /* Tables */
  .table-wrap { border: none; overflow: visible; }
  .data-table { font-size: 9pt; }
  .data-table th { font-size: 8pt; padding: 6px 8px; }
  .data-table td { padding: 7px 8px; }

  /* Hero image */
  .hero-image { max-height: 200px; }
  .hero-image-wrap { page-break-after: avoid; }

  /* Macro grid — stack on print */
  .macro-grid { grid-template-columns: 1fr; gap: 16px; }
  .macro-block { page-break-inside: avoid; padding: 14px; }

  /* Footer */
  .site-footer { border-top: 1px solid #DDD; background: #FFF; padding: 12px 0 0; margin-top: 24pt; }
  .footer-brand { font-size: 10pt; }
  .footer-meta { font-size: 9pt; }
  .disclaimer { font-size: 8pt; }
  .footer-team { display: none; }

  /* Ticker — hidden in print */
  .ticker-wrap { display: none !important; }

  /* Top story */
  .top-story { page-break-after: avoid; }
}

/* Screen: print-show does nothing (only active in print media) */
.print-show:not(.active) { display: none; }

/* ── BREAKING NEWS BANNER ── */
.breaking-news-banner {
  background: linear-gradient(135deg, #0d1525 0%, #111c2e 100%);
  border-top: 3px solid #FFD700;
  border-bottom: 1px solid #1e2d45;
  padding: 0;
  overflow: hidden;
}
.breaking-news-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  gap: 0;
}
.breaking-news-img-wrap {
  flex: 0 0 340px;
  max-width: 340px;
  overflow: hidden;
  position: relative;
}
.breaking-news-img {
  width: 100%;
  height: 100%;
  min-height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.breaking-news-img:hover { transform: scale(1.03); }
.breaking-news-text {
  flex: 1;
  padding: 22px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.breaking-news-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #FFD700;
  text-transform: uppercase;
}
.breaking-news-headline {
  font-size: 22px;
  font-weight: 700;
  color: #f0f4ff;
  line-height: 1.3;
}
.breaking-news-summary {
  font-size: 14px;
  color: #8899b4;
  line-height: 1.6;
}
.breaking-news-credit {
  font-size: 11px;
  color: #556070;
  margin-top: 4px;
}
@media (max-width: 768px) {
  .breaking-news-inner { flex-direction: column; }
  .breaking-news-img-wrap { flex: 0 0 auto; max-width: 100%; height: 200px; }
  .breaking-news-text { padding: 16px; }
  .breaking-news-headline { font-size: 17px; }
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .header-inner { padding: 12px 16px; }
  .site-title { font-size: 16px; }
  .macro-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .hero-image { height: 220px; }
  .tabs { overflow-x: auto; }
  .tab-btn { padding: 9px 14px; font-size: 12px; white-space: nowrap; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 9px 10px; }
  .archive-item { flex-wrap: wrap; }
  .card-price { font-size: 22px; }
}
