/* Markets-page specifics that don't belong in the shared layer.
   Values transcribed from the prototype (Markets.dc.html, spec §2 S3–S7). */

/* Every tab group is rendered in full server-side; only the selected panel is shown. */
.mk-panel[hidden] { display: none }

/* ==========================================================================
   S3 — Index board
   ========================================================================== */
.mk-index {
    padding: 18px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
}
.mk-index--feat {
    grid-column: span 2;
    background: var(--pc-navy-deep);
    border-color: transparent;
}
.mk-index__live {
    position: absolute;
    top: 14px;
    right: 16px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-label);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--pc-green-bright);
    background: rgba(78, 201, 120, .16);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
}
.mk-index__live span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pc-green-bright);
    animation: pc-blink 1.4s infinite;
}

/* The stored flag SVGs are 30x21; the board and the table draw them at 22x16. */
.mk-flag { width: 22px; height: 16px }
.mk-flag > svg { width: 100%; height: 100%; display: block }

/* ==========================================================================
   Panel cards — movers, news, sector heat, calendar
   ========================================================================== */
.mk-cardhead {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.mk-cardhead h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.mk-cardhead h3 > i { font-size: 18px; color: var(--pc-green) }
.mk-cardnote { font-size: 12px; color: var(--text-muted) }

.mk-livedot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #c02626;
    display: inline-block;
    animation: pc-blink 1.4s infinite;
}

/* Text-only action in a card header ("All news"). */
.mk-cardlink {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--pc-blue-primary);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* ==========================================================================
   Tab controls
   ========================================================================== */
/* Square tabs inside the movers card header. */
.mk-tab {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
}
.mk-tab[aria-selected="true"] {
    font-weight: 600;
    color: var(--text-primary);
    background: var(--pc-mist);
    border-color: var(--border);
}

/* Pill tabs for the macro country strip and the remuneration sector strip. The selected
   pill is a solid fill here, which is why it cannot reuse .pc-chip.is-on. */
.mk-pill {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid var(--border);
    background: var(--pc-white);
    color: var(--text-body);
}
.mk-pill[aria-selected="true"] {
    font-weight: 600;
    border-color: var(--pc-blue-primary);
    background: var(--pc-blue-primary);
    color: var(--pc-white);
}
.mk-pill--purple[aria-selected="true"] {
    border-color: var(--pc-purple);
    background: var(--pc-purple);
    color: #ffffff;
}

.mk-tabstrip { display: flex; gap: 8px; flex-wrap: wrap }
.mk-tabstrip--sq { gap: 4px; flex-wrap: nowrap }

/* ==========================================================================
   S4.1 — Mover rows
   ========================================================================== */
.mk-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border: none;
    border-bottom: 1px solid var(--pc-cloud);
    background: var(--pc-white);
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
}

/* ==========================================================================
   S4.2 — News rows
   ========================================================================== */
.mk-newsrow {
    display: block;
    padding: 14px 20px;
    border: none;
    border-bottom: 1px solid var(--pc-cloud);
    background: var(--pc-white);
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
}
.mk-newsrow__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.mk-newsrow__src {
    font-family: var(--font-label);
    font-weight: 600;
    color: var(--pc-blue-primary);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.mk-newsrow h5 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 4px;
}
.mk-newsrow p { font-size: 13px; color: var(--text-body); line-height: 1.5 }

/* ==========================================================================
   S5.1 — Sector heat tiles
   ========================================================================== */
.mk-heatgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 20px }
.mk-heat {
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: #fff;
    /* Neutral base so the tiles stay legible before markets.js applies Hub.heatColor. */
    background: var(--pc-gray);
}
.mk-heat__n { font-size: 12px; font-weight: 600; opacity: .95; margin-bottom: 4px }
.mk-heat__v {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: var(--ls-display);
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   S5.2 — Trading calendar rows
   ========================================================================== */
.mk-calrow {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 11px 0;
    border-bottom: 1px solid var(--pc-cloud);
}
.mk-calrow__dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0 }
.mk-calrow__d {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.mk-calrow__e { font-size: 13px; color: var(--text-body); line-height: 1.4 }

/* ==========================================================================
   S6 — Remuneration
   ========================================================================== */
.mk-statgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

/* The table is a fixed-width flex grid; give it its own scroller on small screens
   (spec §6.3 "known small-screen weakness"). */
.mk-tablescroll { overflow-x: auto }
.mk-thead, .mk-trow { min-width: 640px }

.mk-thead {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    background: var(--pc-mist);
    border-bottom: 1px solid var(--border);
    font-family: var(--font-label);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.mk-trow {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
    border: none;
    border-bottom: 1px solid var(--pc-cloud);
    background: var(--pc-white);
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
    font-size: 13px;
}
.mk-col--name  { flex: 2; min-width: 0 }
.mk-col--num   { text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums }
.mk-col--96    { width: 96px }
.mk-col--88    { width: 88px }
.mk-col--80    { width: 80px }
.mk-col--64    { width: 64px }

/* ==========================================================================
   S7 — Macro indicator grid
   ========================================================================== */
.mk-macrogrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

@media (prefers-reduced-motion: reduce) {
    .mk-index__live span,
    .mk-livedot { animation: none }
}
