/* =========================
   Design tokens
   ========================= */

:root {
  /* ───────────────────────────
     Core surfaces
     ─────────────────────────── */

  --bg-app: #F4F5F3;          /* paper / stone */
  --bg-card: #FFFFFF;         /* deliberate surfaces only */
  --bg-nav: #184054;          /* authority rail / header only */

  /* ───────────────────────────
     Text / ink
     ─────────────────────────── */

  --text-primary: #1A1A1A;    /* near-black ink */
  --text-secondary: #5F6B73;  /* muted slate */
  --text-muted: #8A949B;      /* de-emphasised meta */

  /* ───────────────────────────
     Accents (use sparingly)
     ─────────────────────────── */

  --accent-primary: #184054;  /* naval teal — single dominant accent */
  --accent-secondary: #a08c9b;/* Pale aubergine */
  --accent-hover: #541840;    /* Dark aubergine */

  /* ───────────────────────────
     Functional states
     ─────────────────────────── */

  --state-positive: #595B24;  /* muted olive */
  --state-caution:  #8A5A2B;  /* muted rust */
  --state-negative: #7A2E2E;  /* oxide red */

  /* ───────────────────────────
     Structure
     ─────────────────────────── */

  --border-light: #E2E4E6;
  --radius: 10px;

  /* Shadows: keep barely perceptible */
  --shadow-soft: 0 8px 18px rgba(0, 0, 0, 0.05);

  /* ───────────────────────────
     Charts
     ─────────────────────────── */

  --chart-primary: #24595B;
  --chart-secondary: #6F7F80;
  --chart-historical: #B5BDC2;
  --chart-grid: #E6E8EA;

    /* ───────────────────────────
     Typography — families
     ─────────────────────────── */

  --font-sans: "IBM Plex Sans", Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;

  /* ───────────────────────────
     Typography — weights
     ─────────────────────────── */

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  /* No bolds beyond this. No lights. */

  /* ───────────────────────────
     Typography — sizing scale (tight, sober)
     ─────────────────────────── */

  --text-xs: 0.8rem;   /* timestamps, qualifiers */
  --text-sm: 0.9rem;   /* meta, labels */
  --text-md: 1rem;     /* body */
  --text-lg: 1.1rem;   /* card titles (sans) */
  --text-xl: 1.25rem;  /* section headers (serif) */

  /* ───────────────────────────
     Typography — rhythm
     ─────────────────────────── */

  --line-tight: 1.4;
  --line-normal: 1.5;
  --line-loose: 1.55;

}


/* =========================
   Global chrome
   ========================= */

body {
    background: var(--bg-app);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
}

/* =========================
   Header / Navigation
   ========================= */

.site-header {
    background: var(--bg-nav);
    color: #ffffff;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-size: 1.5rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 1.6rem;
}

.nav-links a {
    color: #E6ECEF;
    text-decoration: none;
    font-size: var(--text-sm);
}

.nav-links a:hover {
    color: #ffffff;
}

/* =========================
   Page shell
   ========================= */

.page {
    max-width: 1200px;
    min-height: 600px;
    margin: 1.75rem auto 3rem;
    padding: 0 1.5rem;
}

.page-title {
    margin-bottom: 25px;
    line-height: 1.5rem;
}

.page-title h1 {
  font-family: var(--font-serif);
  font-weight: var(--weight-semibold);
}


.page-title .subtitle {
    font-family: var(--font-sans);
    font-weight: var(--weight-regular);
    max-width: 500px
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
}


/* =========================
   Footer
   ========================= */

.site-footer {
    margin-top: 3rem;
    padding: 1.25rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    background: #fafafa;
}

/* =========================
   Card base (neutral)
   ========================= */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
    text-align: left;
    display: flex;
    flex-direction: column;
}

.card p:last-of-type {
    margin-bottom: 2.5rem;
}

/* =========================
   Buttons – baseline
   ========================= */

.card .button,
.btn,
.button {
    display: inline-block;
    background: var(--accent-secondary);
    color: #ffffff;
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--accent-hover);
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    margin-top: auto;
}

.button:hover,
.btn:hover {
    background: var(--accent-hover);
}

/* =========================
   Buttons inside cards
   ========================= */


/* Make cards a vertical layout so we can push the button to the bottom */
.page .card,
.page .wide-card {
    display: flex;
    flex-direction: column;
}

/* =========================
   Company overview layout
   ========================= */

.context-strip {
    background: var(--bg-app);
    border: none;
    border-radius: var(--radius);
    box-shadow: none;
    padding: 1rem 1.25rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.company-name h1{
    font-family: var(--font-serif);
    font-weight: bold;
    display: inline;
}

.company-name .ticker {
    color: var(--text-muted);
    font-weight: 600;
}

.company-meta,
.status {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Main two-column layout: content + action rail */
.layout {
    display: grid;
    grid-template-columns: minmax(0, 3fr) 230px;
    gap: 1.5rem;
    align-items: start;
}

/* Cards grid inside content column */
.cards {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
        "desc market"
        "people details";
    gap: 1rem;
    min-width: 0;
    margin: 0;
}

.desc { grid-area: desc; }
.market { grid-area: market; }
.people { grid-area: people; }
.details { grid-area: details; }


/* Description card sizing */
.card.desc, .card.people {
    max-height: 360px;
    display: flex;
    flex-direction: column;
}

.card.desc p,
.card.people ul {
    overflow-y: auto;
    margin-bottom: 0;
}

/* Card typography */
.card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.05rem;
    font-weight: 650;
}

.card p,
.card li {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Market key-value layout */
.kv {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.4rem 1rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--border-light);
    padding-top: 0.75rem;
}

.kv .k {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.kv .v {
    font-variant-numeric: tabular-nums;
    font-size: 0.92rem;
}

/* =========================
   Company overview layout – column widths
   ========================= */



/* Cards must fully occupy their grid columns */
.page .cards > .card {
    width: 100% !important;
    max-width: none !important;
}



/* =========================
   Action rail
   ========================= */

.action-rail {
    position: sticky;
    top: 1.75rem;
}

.rail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1rem;
    overflow: hidden;
    margin-top:10px;
}

.rail-title {
    font-size: 0.95rem;
    font-weight: 650;
    margin-bottom: 0.75rem;
}

/* Action buttons – subtle default, strong hover */
.page .action-rail .rail-btn,
.page .action-rail .rail-btn.primary,
.page .action-rail .rail-btn.secondary {

    background: var(--accent-secondary);
    color: #ffffff;
    text-decoration: none;
    padding: 0.45rem 0.9rem;
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.45rem 1.4rem;
    margin-bottom: 0.6rem;
    border: 1px solid var(--accent-hover);


    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    border-radius: 8px;

    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.page .action-rail .rail-btn:hover,
.page .action-rail .rail-btn.primary:hover,
.page .action-rail .rail-btn.secondary:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
    border-color: var(--accent-hover);
}

/* =========================
   Buttons must never look like links
   ========================= */

.page .button,
.page .rail-btn {
    text-decoration: none !important;
}

.page .button:hover,
.page .rail-btn:hover {
    text-decoration: none !important;
}




/* =========================
   Card group layouts (home + hubs)
   ========================= */

/* Home page cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
}

/* Company Research hub (choice page) */
.card-row {
    display: flex;
    gap: 1.75rem;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
}

.card-row .card {
    flex: 1 1 320px;
    max-width: 420px;
}

/* =========================
   Release card width caps in card grids / hubs
   ========================= */

/* Home page + hub cards must size by layout, not legacy caps */
.card-grid .card,
.card-row .card {
    width: auto !important;
    max-width: none !important;
}

/* Let grid / flex decide sizing */
.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    width: 100%;
}

.card-row .card {
    flex: 1 1 420px;
    max-width: 520px;
}


/* =========================
   Responsive
   ========================= */

@media (max-width: 780px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .cards {
        grid-template-columns: 1fr;
        grid-template-areas:
            "desc"
            "details"
            "people"
            "market";
    }

    .action-rail {
        position: relative;
        top: auto;
    }

    .context-strip {
        flex-direction: column;
    }
}


@media (max-width: 780px) {

  .nav-toggle {
    display: block;
    color: #ffffff;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    margin-top: 0.75rem;
  }

  .nav-links a {
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-light);
  }

  .nav-links.is-open {
    display: flex;
  }
}

/* ------------------------------
Stock chart formatting
------------------------------*/
.page-stockchart  {
    max-width: 900px;
    min-height: 600px;
    margin: 1.75rem auto 3rem;
    padding: 0 1.5rem;
}
.chart-main img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

.top-row {
    display: grid;
    grid-template-columns: 3fr 1fr; /* ~75% / 25% */
    gap: 1rem;
    align-items: start;
    margin-bottom: 1rem;
}

.rail-select {
    margin-bottom: 1rem;
}

/* -------------------------------------
Financial charts page
--------------------------------------*/

.page .card.chart-card {
  width: 100%;
  max-width: none;
}

.page .card.financial-toggle {
    width: 100%;
    max-width: none;
}