:root {
  --gh-font-heading: Inter, ui-sans-serif, system-ui, sans-serif;
  --gh-font-body: Inter, ui-sans-serif, system-ui, sans-serif;
  --ink: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --paper: #fff;
  --soft: #f5f7fb;
  --brand: #2563eb;
  --brand-dark: #1748b5;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px/1.65 Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
}


/* ---------------------------------------------------------
   GHOST WIDTHS
   --------------------------------------------------------- */

.kg-width-wide {
  width: min(1100px, calc(100vw - 40px));
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.kg-width-full {
  width: calc(100vw - 40px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}


/* ---------------------------------------------------------
   SITE
   --------------------------------------------------------- */

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  width: min(1180px, calc(100% - 40px));
  margin: auto;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.15rem;
  font-weight: 850;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand img {
  display: block;
  max-height: 38px;
  max-width: 180px;
}

.nav {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 650;
  white-space: nowrap;
}

.account-actions,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.text-button,
.button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.text-button {
  background: none;
  color: var(--ink);
  font-weight: 700;
}

.button {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  padding: 12px 18px;
  border-radius: 9px;
  text-decoration: none;
  font-weight: 800;
}

.button:hover {
  background: var(--brand-dark);
}

.button.small {
  padding: 9px 14px;
}

.button.secondary {
  background: #e9efff;
  color: #1d4ed8;
}

.site-main {
  flex: 1;
}


/* ---------------------------------------------------------
   HOME / SHORTLIST PAGE
   --------------------------------------------------------- */

.shortlist-page {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 60px 0;
}


/* ---------------------------------------------------------
   HERO
   --------------------------------------------------------- */

.hero {
  padding: 110px 20px;
  text-align: center;
  background: #ffffff;
}

.hero.compact {
  padding: 90px 20px;
}

.hero h1 {
  max-width: 850px;
  margin: 8px auto 18px;
  font-size: clamp(2.7rem, 7vw, 5.7rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 670px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 1.18rem;
}

.hero-actions {
  justify-content: center;
}

.homepage-content {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 60px 0;
  text-align: center;
}


/* ---------------------------------------------------------
   SECTIONS
   --------------------------------------------------------- */

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 850;
}

.section {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 76px 0;
}

.section.narrow-top {
  padding-top: 54px;
}

.section h1,
.section h2 {
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.section h1 {
  font-size: 3rem;
}

.section-heading h2 {
  font-size: 2.2rem;
  margin: 4px 0 24px;
}


/* ---------------------------------------------------------
   POSTS
   --------------------------------------------------------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.post-card,
.list-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.post-image {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.post-card-body {
  padding: 20px;
}

.post-card h3 {
  font-size: 1.3rem;
  line-height: 1.25;
  margin: 8px 0;
}

.post-card h3 a,
.list-card h2 a {
  text-decoration: none;
}

.post-card p,
.list-card p,
.post-meta {
  color: var(--muted);
}

.post-meta {
  font-size: 0.84rem;
}

.read-link {
  color: var(--brand);
  font-weight: 750;
  text-decoration: none;
}

.post-list {
  display: grid;
  gap: 16px;
}

.list-card {
  padding: 24px;
}

.list-card h2 {
  margin: 5px 0;
}

.empty-state {
  padding: 28px;
  border: 1px dashed #c9d2e3;
  border-radius: var(--radius);
  color: var(--muted);
}

.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 28px;
}


/* ---------------------------------------------------------
   NORMAL PAGE / POST CONTENT
   --------------------------------------------------------- */

.content-wrap {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 70px 0;
}

.content-header {
  text-align: center;
  margin-bottom: 34px;
}

.content-header h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1.03;
  letter-spacing: -0.05em;
  margin: 10px 0;
}

.content-deck {
  font-size: 1.18rem;
  color: var(--muted);
}

.feature {
  width: min(1050px, calc(100vw - 40px));
  margin: 0 50% 36px;
  transform: translateX(-50%);
}

.feature img {
  width: 100%;
  border-radius: var(--radius);
}

.gh-content {
  font-family: Georgia, serif;
  font-size: 1.12rem;
}

.gh-content :is(h2, h3) {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  line-height: 1.2;
  margin-top: 2em;
}

.gh-content img {
  max-width: 100%;
  height: auto;
}

.gh-content a {
  color: var(--brand);
}

.gh-content pre {
  overflow: auto;
  padding: 18px;
  background: #111827;
  color: #f9fafb;
  border-radius: 10px;
}


/* ---------------------------------------------------------
   SHORTLIST TABLE
   --------------------------------------------------------- */

.shortlist-table-wrapper {
  width: 100%;
  max-width: 1100px;
  margin: 24px auto;

  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.shortlist-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: auto;

  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  color: var(--ink);
}

.shortlist-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 14px 16px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.shortlist-table th:first-child {
  text-align: left;
}

.shortlist-table td {
  padding: 14px 16px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.shortlist-table td:first-child {
  text-align: left;
}

.shortlist-table tbody:last-child tr:last-child td {
  border-bottom: none;
}

.shortlist-table tbody tr:hover {
  background: var(--soft);
}

.shortlist-table .symbol {
  font-weight: 700;
  color: var(--brand);
}


/* ---------------------------------------------------------
   LAST UPDATED

   Ghost converts the simple timestamp <div> from source HTML
   into a normal paragraph. Both the paid page and homepage
   use the same centered content layout.

   20px top margin gives the timestamp breathing room below
   the shortlist table.
   --------------------------------------------------------- */

/* Paid page */
body.page-paid .homepage-content > p:last-child,
body.page-paid .homepage-content > .gh-content > p:last-child {
  margin: 20px auto 24px;
  color: #98a2b3;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  text-align: center;
}

/* Homepage */
.shortlist-home > p:last-child,
.shortlist-home > .gh-content > p:last-child {
  margin: 20px auto 24px;
  color: #98a2b3;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  text-align: center;
}


/* ---------------------------------------------------------
   FOOTER
   --------------------------------------------------------- */

.site-footer {
  width: min(1100px, calc(100% - 40px));
  margin: auto;
  border-top: 1px solid var(--line);
  padding: 28px 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}


/* ---------------------------------------------------------
   RESPONSIVE SITE LAYOUT
   --------------------------------------------------------- */

@media (max-width: 800px) {
  .site-header {
    flex-wrap: wrap;
    padding: 16px 0;
  }

  .nav {
    order: 3;
    flex-basis: 100%;
    overflow-x: auto;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 80px 20px;
  }

  .site-footer {
    flex-direction: column;
  }

  .account-actions {
    margin-left: auto;
  }
}


/* ---------------------------------------------------------
   RESPONSIVE SHORTLIST TABLE
   --------------------------------------------------------- */

@media (max-width: 700px) {
  .shortlist-page {
    width: calc(100% - 20px);
  }

  .shortlist-table-wrapper {
    width: 100%;
    max-width: 100%;
  }

  .shortlist-table {
    min-width: 700px;
    font-size: 13px;
  }

  .shortlist-table th,
  .shortlist-table td {
    padding: 12px;
  }
}


/* ---------------------------------------------------------
   STANDARD CONTENT PAGES
   Terms, How It Works, etc.
   --------------------------------------------------------- */

.page-content {
  width: min(900px, calc(100% - 40px));
  margin: 0 auto;
  padding: 60px 0 100px;
  text-align: left;
}

.page-content h1 {
  margin: 0 0 28px;
  text-align: left;
}

.page-content h2 {
  margin: 42px 0 18px;
  text-align: left;
}

.page-content h3 {
  margin: 32px 0 16px;
  text-align: left;
}

.page-content p {
  margin: 0 0 20px;
  line-height: 1.75;
  text-align: left;
}

.page-content ul,
.page-content ol {
  margin: 0 0 24px;
  padding-left: 28px;
  text-align: left;
}

.page-content li {
  margin-bottom: 8px;
}

/* ---------------------------------------------------------
   SHORTLIST PAGE FINAL LAYOUT FIX
   Keep the shortlist timestamp styled consistently and keep
   the footer directly below shortlist content.
   --------------------------------------------------------- */

/* Ghost may render the generated timestamp as p, div, or another block. */
.shortlist-updated {
  margin: 20px auto 24px;
  color: #98a2b3;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  text-align: center;
}

/* Expandable shortlist rows and historical price charts */
.shortlist-table .shortlist-toggle { border: 0; background: transparent; color: #2563eb; font-size: 22px; font-weight: 600; cursor: pointer; min-width: 32px; min-height: 32px; }
.shortlist-table .shortlist-detail[hidden] { display: none !important; }
.shortlist-table .shortlist-detail > td { padding: 24px; background: #f2f5f9; text-align: left; white-space: normal; }
.shortlist-table .shortlist-stock:hover > .shortlist-main { background: #f2f5f9; }
.shortlist-table .shortlist-detail h3 { font-size: 16px; margin: 0 0 12px; }
.shortlist-chart { display: block; width: 100%; max-width: 850px; height: auto; margin: auto; }
.shortlist-chart text { font-size: 11px; fill: #64748b; }

.shortlist-table .shortlist-main > td { border-bottom: 1px solid var(--line); }
.shortlist-table .shortlist-stock:last-child > .shortlist-main:has(+ .shortlist-detail[hidden]) > td { border-bottom: 0; }
.shortlist-table .shortlist-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.shortlist-table .shortlist-detail p { margin: 12px 0; white-space: normal; }
.shortlist-table .shortlist-detail h3 { font-family: var(--gh-font-heading); }
.shortlist-table .shortlist-toggle { font-family: inherit; }
