/* jseinvestor.co.za — Market Brief discovery page
   Wall Street Journal meets FinTech. No hype, just signal. */

:root {
  --bg-canvas: #F8F7F4;
  --text-heading: #111111;
  --text-body: #555550;
  --text-meta: #888880;
  --border: #DDD9D0;
  --green: #007A4D;
  --gold: #FFB612;
  --red: #DE3831;
  --blue: #002395;
  --white: #FFFFFF;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-canvas);
  color: var(--text-body);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

/* --- SA flag stripe (6 equal bands) --- */
.flag-stripe {
  height: 6px;
  width: 100%;
  flex-shrink: 0;
  background: linear-gradient(
    to right,
    #007A4D 0%,
    #007A4D 16.666667%,
    #FFB612 16.666667%,
    #FFB612 33.333333%,
    #DE3831 33.333333%,
    #DE3831 50%,
    #002395 50%,
    #002395 66.666667%,
    #111111 66.666667%,
    #111111 83.333333%,
    #FFFFFF 83.333333%,
    #FFFFFF 100%
  );
}

.flag-stripe--footer {
  margin-top: 0;
}

.page-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Type scale: mobile-first --- */
.site-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 22px;
  line-height: 1.15;
  color: var(--text-heading);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.site-tagline {
  margin: 12px auto 0;
  max-width: 22rem;
  padding: 0 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-meta);
  text-wrap: balance;
}

.summary-pill {
  margin: 16px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-meta);
}

.site-header {
  text-align: center;
  padding: 32px 16px 20px;
}

.page-context {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 44px;
  padding: 0 16px 0;
  border-bottom: 1px solid var(--border);
}

.page-context__label {
  display: inline-block;
  margin-bottom: -1px;
  padding: 10px 4px 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-heading);
  border-bottom: 2px solid var(--green);
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  flex: 1;
}

.width-wrap {
  width: 100%;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

.rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

/* --- Daily lead --- */
.daily-lead {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 20px;
}

.eyebrow {
  margin: 0 0 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-meta);
}

.daily-lead__headline {
  margin: 0 0 12px;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.25;
  color: var(--text-heading);
}

.daily-lead__figure {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  color: var(--green);
}

.daily-lead__body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
}

/* --- Section labels (H4 spec) --- */
.section-label {
  margin: 0 0 16px;
  padding-left: 10px;
  border-left: 2px solid var(--blue);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-meta);
}

.section-label--blue {
  border-left-color: var(--blue);
}

.section-label--green {
  border-left-color: var(--green);
}

.section-label--gold {
  border-left-color: var(--gold);
}

.market-block {
  margin-bottom: 40px;
}

.market-block:last-of-type {
  margin-bottom: 32px;
}

/* --- Tiles --- */
.tile-grid {
  display: grid;
  gap: 12px;
}

.tile-grid--3 {
  grid-template-columns: 1fr;
}

.market-tile {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 16px;
}

.market-tile__label {
  display: block;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  color: var(--text-body);
  margin-bottom: 8px;
}

.market-tile__value {
  display: block;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  color: var(--text-heading);
}

.market-tile__change {
  display: block;
  margin-top: 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 700;
}

.market-tile__change.positive {
  color: var(--green);
}

.market-tile__change.negative {
  color: var(--red);
}

.market-tile__change.neutral {
  color: var(--blue);
}

.market-tile__change--flat {
  color: var(--text-meta);
  font-weight: 400;
}

/* --- Macro strip --- */
.macro-strip-wrap {
  margin: 0 0 40px;
}

.macro-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 12px;
  padding: 20px 16px;
  background: #111111;
  color: var(--bg-canvas);
  border-top: 3px solid var(--gold);
}

.macro-item {
  flex: 1 1 calc(50% - 8px);
  min-width: 120px;
  text-align: center;
}

@media (min-width: 768px) {
  .macro-item {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.macro-item__label {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-meta);
  margin-bottom: 6px;
}

.macro-item__value {
  font-family: "Courier New", Courier, monospace;
  font-weight: 700;
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 0.02em;
}

/* --- SENS feed --- */
.sens-block {
  margin-bottom: 8px;
}

.sens-feed {
  border-top: 1px solid var(--border);
}

.sens-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  transition: opacity 0.35s ease, max-height 0.45s ease, padding 0.35s ease, margin 0.35s ease;
}

.sens-item--collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  border-bottom: none;
  pointer-events: none;
}

.sens-feed--expanded .sens-item--collapsed {
  max-height: 2400px;
  opacity: 1;
  padding-top: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  pointer-events: auto;
}

.sens-item:last-child {
  border-bottom: none;
}

.sens-item__type {
  margin: 12px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  color: var(--text-meta);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sens-item__headline {
  margin: 12px 0 0;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  color: var(--text-heading);
}

.sens-item__body {
  margin: 12px 0 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-body);
}

.ticker-tag {
  display: inline-block;
  padding: 6px 10px;
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--white);
  background: #111111;
  border-radius: 2px;
  line-height: 1;
}

.sens-toggle {
  margin-top: 8px;
  padding: 12px 0;
  min-height: 44px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sens-toggle:hover {
  color: var(--blue);
}

.sens-toggle:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.sens-toggle[hidden] {
  display: none !important;
}

/* --- Newsletter --- */
.newsletter {
  background: var(--green);
  color: var(--white);
  padding: 40px 0;
}

.newsletter__inner {
  max-width: 1080px;
}

.newsletter__eyebrow {
  margin: 0 0 12px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
}

.newsletter__headline {
  margin: 0 0 12px;
  max-width: 36rem;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  color: var(--white);
  text-wrap: balance;
}

.newsletter__sub {
  margin: 0 0 24px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
}

.newsletter__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 520px;
}

.newsletter__input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  color: var(--text-heading);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 2px;
}

.newsletter__input::placeholder {
  color: var(--text-meta);
}

.newsletter__input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}

.newsletter__submit {
  width: 100%;
  min-height: 44px;
  padding: 0 20px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--green);
  background: var(--white);
  border: none;
  border-radius: 2px;
  cursor: pointer;
}

.newsletter__submit:hover {
  background: var(--gold);
  color: var(--text-heading);
}

.newsletter__submit:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Footer --- */
.site-footer {
  background: #111111;
  color: var(--text-meta);
  margin-top: auto;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding-top: 28px;
  padding-bottom: 28px;
}

.site-footer__copy {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  color: var(--text-meta);
}

.site-footer__disclaimer {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-style: italic;
  color: var(--text-meta);
  max-width: 720px;
  line-height: 1.5;
}

/* --- Tablet ≥768 --- */
@media (min-width: 768px) {
  body {
    font-size: 15px;
  }

  .site-title {
    font-size: 28px;
  }

  .daily-lead__headline {
    font-size: 20px;
  }

  .daily-lead__figure {
    font-size: 28px;
  }

  .daily-lead__body {
    font-size: 15px;
  }

  .daily-lead {
    padding: 24px;
  }

  .sens-item__headline {
    font-size: 17px;
  }

  .market-tile__value {
    font-size: 20px;
  }

  .macro-item__value {
    font-size: 20px;
  }

  .tile-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .container {
    padding: 40px 24px 56px;
  }

  .site-header {
    padding: 40px 24px 24px;
  }

  .site-tagline {
    max-width: 32rem;
    padding: 0 12px;
  }

  .page-context {
    padding-left: 24px;
    padding-right: 24px;
  }

  .newsletter__headline {
    font-size: 20px;
    line-height: 1.27;
  }

  .width-wrap {
    padding-left: 24px;
    padding-right: 24px;
  }

  .newsletter__form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    max-width: none;
  }

  .newsletter__input {
    flex: 1 1 220px;
    min-width: 0;
  }

  .newsletter__submit {
    width: auto;
    flex: 0 0 auto;
    min-width: 160px;
  }

  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
  }
}

/* --- Desktop ≥1024 --- */
@media (min-width: 1024px) {
  body {
    font-size: 16px;
  }

  .site-title {
    font-size: 36px;
  }

  .daily-lead__headline {
    font-size: 24px;
  }

  .daily-lead__figure {
    font-size: 36px;
  }

  .daily-lead__body {
    font-size: 16px;
  }

  .daily-lead {
    padding: 32px;
  }

  .sens-item__headline {
    font-size: 20px;
  }

  .market-tile__value {
    font-size: 24px;
  }

  .tile-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .container {
    padding: 48px 40px 64px;
  }

  .site-header {
    padding: 48px 40px 28px;
  }

  .site-tagline {
    max-width: 38rem;
    padding: 0 16px;
    font-size: 13px;
  }

  .page-context {
    padding-left: 40px;
    padding-right: 40px;
  }

  .newsletter__headline {
    font-size: 24px;
    max-width: 42rem;
    line-height: 1.22;
  }

  .width-wrap {
    padding-left: 40px;
    padding-right: 40px;
  }

  .site-footer__inner {
    padding-top: 32px;
    padding-bottom: 32px;
  }
}

/* Body minimum 14px (mobile base 15px — ok) */
@media (max-width: 767px) {
  body {
    font-size: 15px;
  }
}

/* Dashboard / legacy helpers (script.js) */
.hidden {
  display: none !important;
}
