/* ==========================================================================
   Stock publication system — shared primitives for the stock pages that sit
   beside Research (Báo cáo tài chính, Nhận định, Tài liệu nghiên cứu).

   Values are copied from the approved Research page (premium_article.css) and
   the Overview v2 page (stock_overview_v2.css): paper / ink palette, Newsreader
   + Inter, hairlines instead of boxes, the Research stock navigation. Research
   itself is NOT edited or made to depend on this file; if the two ever need to
   be one system, consolidate deliberately in a later pass.

   Namespace: .stp-*   (page-specific rules live in their own stylesheet)
   ========================================================================== */

html, body { overflow-x: hidden; }

.stp-page {
    --paper: #f4f0e7;
    --paper-raised: #f8f4ec;
    --ink: #0c2835;
    --body: #213b45;
    --muted: #53676c;
    --gold: #9b7447;
    --gold-text: #79552f;
    --rule: rgba(12, 40, 53, .2);
    --rule-soft: rgba(12, 40, 53, .11);
    --rule-strong: rgba(12, 40, 53, .58);
    --serif: "Newsreader", Georgia, serif;
    --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    width: min(calc(100% - 32px), 1380px);
    margin: 0 auto;
    padding: 0 0 42px;
    overflow: clip;
    border-right: 1px solid rgba(12, 40, 53, .08);
    border-left: 1px solid rgba(12, 40, 53, .08);
    background: var(--paper);
    color: var(--body);
    font: 450 15px/1.58 var(--sans);
    letter-spacing: .002em;
    text-rendering: optimizeLegibility;
}
.stp-page::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--paper); }
.stp-page *, .stp-page *::before, .stp-page *::after { box-sizing: border-box; }
.stp-page a { color: inherit; }
.stp-page h1, .stp-page h2, .stp-page h3, .stp-page p, .stp-page dl, .stp-page dd { margin: 0; }
.stp-page h1, .stp-page h2, .stp-page h3 { color: var(--ink); font-family: var(--serif); font-weight: 500; }
.stp-page :focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* Service bar — same row as Research: a quiet way back to the stock list */
.stp-servicebar { display: flex; align-items: center; min-height: 46px; padding: 0 32px; border-top: 3px solid var(--gold); border-bottom: 1px solid var(--rule); color: var(--muted); font-size: .76rem; }
.stp-servicebar a { text-decoration: none; }

/* Identity — the stock, set the way the Research cover sets it */
.stp-identity { padding: 38px 42px 30px; }
.stp-symbol { color: var(--ink); font: 500 clamp(3.9rem, 4.6vw, 4.75rem)/.84 var(--serif); letter-spacing: -.055em; }
.stp-page .stp-company { max-width: 62ch; margin-top: 15px; color: var(--body); font-size: .8rem; }

/* Stock navigation — the Research treatment of the shared subnav include:
   text + underline, no pills. The include itself is untouched. */
.stp-page .ss-subnav { display: flex; gap: 0; margin: 0; padding: 0 32px; overflow-x: auto; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule-strong); }
.stp-page .ss-subnav a { flex: 0 0 auto; padding: 10px 16px 9px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.stp-page .ss-subnav a:hover { color: var(--ink); }
.stp-page .ss-subnav a.is-active { border-bottom-color: var(--gold); color: var(--ink); }

/* Document column */
.stp-document { padding: 0 42px; }

/* Section masthead: eyebrow, serif headline, one quiet line */
.stp-head { padding: 54px 0 30px; }
.stp-eyebrow { color: var(--gold-text); font-size: .64rem; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.stp-head h1 { max-width: 24ch; margin-top: 14px; font-size: clamp(2rem, 3vw, 2.9rem); line-height: 1.04; letter-spacing: -.034em; }
.stp-page .stp-head-note { max-width: 62ch; margin-top: 14px; color: var(--muted); font-size: .8rem; line-height: 1.55; }

/* Continuation — "what is the natural next document after this one?"
   Each surface declares its own kicker / headline / destination. */
.stp-continuation { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 56px; align-items: end; margin: 64px 42px 0; padding: 40px 0 46px; border-top: 1px solid var(--rule-strong); }
.stp-continuation .stp-eyebrow { grid-column: 1 / -1; }
.stp-continuation h2 { max-width: 22ch; font-size: clamp(1.9rem, 2.8vw, 2.7rem); line-height: 1.06; letter-spacing: -.034em; text-wrap: balance; }
.stp-continuation-link { align-self: end; padding-bottom: 3px; border-bottom: 1px solid var(--rule-strong); color: var(--ink); font-size: .82rem; font-weight: 650; text-decoration: none; white-space: nowrap; }
.stp-continuation-link:hover { border-bottom-color: var(--gold); }

/* Index — a dated list of documents: date | title, hairline between entries. The whole row is the click
   target (the headline link stretches over it); no card, badge or icon. Titles are never truncated.
   Used by the report archive; Nhận định keeps its own, richer index (a later pass can move it here). */
.stp-page .stp-index { margin: 18px 0 0; padding: 0; list-style: none; border-top: 2px solid var(--ink); }
.stp-entry { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0 34px; padding: 22px 0 24px; border-bottom: 1px solid var(--rule); }
.stp-entry-date { padding-top: 5px; color: var(--muted); font: 600 .72rem/1.3 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.stp-entry-title { max-width: 52ch; font-size: clamp(1.28rem, 1.75vw, 1.6rem); line-height: 1.22; letter-spacing: -.022em; }
.stp-entry-title a { color: var(--ink); text-decoration: none; }
.stp-entry-title a::after { content: ""; position: absolute; inset: 0; }
.stp-entry:hover .stp-entry-title a { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 5px; }
.stp-entry-title a:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }

/* Adapters — legacy partials rendered inside publication pages. Their markup and behaviour are untouched;
   only their light-on-dark inline styling is overridden, under .stp-page so no other page is affected.
   Consumer: _stock_price_strip.html (Phân tích theo mã). */
.stp-page .sps-strip { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0 0 22px; border: 0; font-variant-numeric: tabular-nums; }
.stp-page .sps-price { color: var(--ink); font: 500 1.5rem/1 var(--serif); letter-spacing: -.015em; }
.stp-page .sps-chg { font-size: .8rem; font-weight: 650; }
.stp-page .sps-chg.up { color: #315f51; }
.stp-page .sps-chg.down { color: #8b443e; }
.stp-page .sps-chg.flat { color: var(--muted); }
.stp-page .sps-m { color: var(--muted); font-size: .78rem; }
.stp-page .sps-m i { margin-right: 6px; color: var(--muted); font: 750 .62rem/1 var(--sans); font-style: normal; letter-spacing: .09em; text-transform: uppercase; }

@media (max-width: 749px) {
    .stp-page { width: 100%; padding-bottom: 28px; font-size: 14px; }
    .stp-servicebar { padding: 0 15px; }
    .stp-identity { padding: 28px 18px 22px; }
    .stp-symbol { font-size: 3.9rem; }
    .stp-page .ss-subnav { padding: 0 14px; }
    .stp-page .ss-subnav a { padding-right: 12px; padding-left: 12px; }
    .stp-document { padding: 0 18px; }
    .stp-head { padding: 38px 0 22px; }
    .stp-continuation { grid-template-columns: minmax(0, 1fr); margin: 44px 18px 0; padding: 32px 0 36px; }
    .stp-entry { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 20px 0 22px; }
    .stp-entry-date { padding-top: 0; }
    .stp-entry-title { max-width: none; font-size: 1.32rem; }
    .stp-continuation-link { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
    .stp-page *, .stp-page *::before, .stp-page *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
