/* The daily market data pages under /markets/ (tools/render_daily_pages.py),
   2026-10-29. Their own sheet, linked only from those pages, so the shared
   styles.css stays as it is. Colours and type come from its tokens. */

.market-crumb {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 650;
}

.market-crumb a {
  color: var(--blue);
  text-decoration: none;
}

.market-figures {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 56px;
  margin: 10px 0 26px;
}

.market-figure {
  display: grid;
  gap: 6px;
  margin: 0;
}

/* Serif like the headings; lining figures so the digits sit on the line. */
.market-figure-num {
  font-family: "CIM Rupee", Georgia, "Times New Roman", serif;
  font-size: clamp(56px, 7vw, 96px);
  letter-spacing: -0.03em;
  line-height: 0.95;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

/* White like the rest of the blue hero (styles.css .page-hero p); a grey
   label was unreadable on the blue. */
.market-figure-label {
  max-width: 26ch;
  font-size: 17px;
}

.market-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  margin: 0 0 22px;
}

.market-stat {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.market-stat dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.market-stat dd {
  margin: 6px 0 0;
  font-size: 30px;
  font-weight: 650;
  font-variant-numeric: lining-nums tabular-nums;
}

.market-note {
  max-width: 760px;
  color: var(--ink-soft);
}

.market-spark {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  overflow: visible;
}

.market-spark polyline,
.market-spark line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The PE line, and breadth's 50-day share. Each line's end dot and value
   tag take its colour. */
.market-spark-line-pe,
.market-spark-line-50 {
  stroke: var(--blue);
  stroke-width: 2.5;
}

.market-spark-dot-pe,
.market-spark-dot-50,
.market-spark .market-spark-tag-pe,
.market-spark .market-spark-tag-50 {
  fill: var(--blue);
}

.market-spark-line-200 {
  stroke: var(--ink-soft);
  stroke-width: 2;
}

.market-spark-dot-200,
.market-spark .market-spark-tag-200 {
  fill: var(--ink-soft);
}

/* Breadth's 20-day share: teal, at least 3:1 against white like the others. */
.market-spark-line-20 {
  stroke: #0b7d6e;
  stroke-width: 1.75;
}

.market-spark-dot-20,
.market-spark .market-spark-tag-20 {
  fill: #0b7d6e;
}

/* Value labels on the right, dates underneath (Bloomberg, Apple Stocks). */
.market-spark-grid {
  stroke: var(--line-soft);
  stroke-width: 1;
}

.market-spark text,
.market-spark-axis {
  fill: var(--muted);
  font-size: 12px;
  font-variant-numeric: lining-nums tabular-nums;
}

.market-spark [class^="market-spark-tag-"] {
  font-weight: 700;
}

/* Wide drawing on desktop, phone drawing below 761px (see CHART_SIZES). */
.market-spark-narrow {
  display: none;
}

.market-spark-guide {
  stroke: var(--line);
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
}

.market-spark-caption {
  max-width: 760px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.market-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 14px 0 0;
  font-size: 14px;
}

.market-legend-key::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 0;
  margin-right: 8px;
  vertical-align: middle;
  border-top: 3px solid;
}

.market-legend-50::before {
  border-top-color: var(--blue);
}

.market-legend-200::before {
  border-top-color: var(--ink-soft);
}

.market-legend-20::before {
  border-top-color: #0b7d6e;
}

.market-legend-guide::before {
  border-top: 2px dashed var(--line);
}

/* Scrolls inside itself on a phone, never the page. */
.market-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin-bottom: 18px;
}

.market-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-variant-numeric: lining-nums tabular-nums;
}

.market-table th,
.market-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 10px;
  text-align: right;
  white-space: nowrap;
}

.market-table th:first-child,
.market-table td:first-child {
  padding-left: 0;
  text-align: left;
}

.market-table thead th {
  border-bottom-color: var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.market-table tbody th {
  font-weight: 650;
}

.market-table a {
  color: var(--blue);
  text-decoration: none;
}

/* India and US label rows in the hub tables, set like the header row. */
.market-table-group th,
.market-table-group td {
  padding-top: 22px;
  padding-bottom: 8px;
  border-bottom-color: var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
}

/* "More market data": every other index page under India and US, and the
   hub. These are additions; the shared .related-strip rules stay as they are. */
.market-related h2 {
  margin-bottom: 4px;
}

.market-related-all {
  margin-bottom: 10px;
}

.market-related-group {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

@media (min-width: 761px) {
  .market-related .three-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .market-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* The index column stays in view while the figures scroll beside it
     (Bloomberg and Fidelity on phones). Collapsed borders do not travel
     with a sticky cell, so its right edge is an inset shadow. */
  .market-table th:first-child,
  .market-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    padding-right: 14px;
    box-shadow: inset -1px 0 0 var(--line);
  }

  /* Each index name is a 44px tap target; the cell gives up its padding to it. */
  .market-table tbody tr:not(.market-table-group) th {
    padding-top: 0;
    padding-bottom: 0;
  }

  .market-table tbody th a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
}

/* One connected data page (owner 2026-10-29: "too much spacing between the
   different headers"). styles.css spaces marketing sections 88px apart (68px
   on a phone), so the gap between one table's last line and the next heading
   was about 190px (150px on a phone). This sheet loads only on /markets/
   pages, so these overrides leave the rest of the site as it is. */
.page-hero {
  padding-bottom: 44px;
}

.section {
  padding: 36px 0;
}

/* Section headings take the strip size (styles.css .related-strip h2), so
   the figures, not the headings, carry the page (Mobbin review 2026-10-29). */
.section h2 {
  margin-bottom: 14px;
  font-size: clamp(24px, 2.1vw, 30px);
}

.section .container > :last-child,
.market-note:last-child {
  margin-bottom: 0;
}

.related-strip h2 {
  margin-bottom: 18px;
}

@media (max-width: 760px) {
  .page-hero {
    padding-bottom: 32px;
  }

  .section {
    padding: 28px 0;
  }
}

/* Under each big figure: low, the period and high over a track with today's
   mark (Bloomberg, TradingView). White like the rest of the hero. */
.market-range {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2px 10px;
  max-width: 300px;
  margin-top: 10px;
  font-size: 14px;
  font-variant-numeric: lining-nums tabular-nums;
}

.market-range-name {
  text-align: center;
}

.market-range-high {
  text-align: right;
}

.market-range-bar {
  grid-column: 1 / -1;
  width: 100%;
  height: 8px;
  overflow: visible;
}

.market-range-track {
  stroke: currentColor;
  stroke-opacity: 0.45;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.market-range-mark {
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* The breadth figures' one date, on its own line under the row. */
.market-asof {
  flex-basis: 100%;
  margin: 0;
  font-size: 17px;
}

@media (max-width: 760px) {
  .market-spark-wide {
    display: none;
  }

  .market-spark-narrow {
    display: block;
    max-width: 480px;
  }
}
