@import url("https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:wght@300;400;500;600&display=swap");

:root {
  --ink: #1a1a1a;
  --ink-muted: #555;
  --ink-faint: #888;
  --surface: #fafaf8;
  --surface-2: #f2f0eb;
  --border: #e0ddd5;
  --qt-blue: #0070ba;
  --qt-blue-light: #e8f4fd;
  --ws-green: #00a854;
  --ws-green-light: #e6f7ef;
  --accent: #c84b1f;
  --accent-light: #fdf0eb;
  --gold: #b8860b;
  --gold-light: #fdf8e1;
  --warning: #7c3d12;
  --warning-light: #fff7ed;
  --card-shadow: 0 18px 48px rgba(21, 18, 14, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ===== Shared elements for article pages ===== */
body.page-article {
  font-family: "DM Sans", sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--surface);
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}

body.page-article h1,
body.page-article h2,
body.page-article h3 {
  font-family: "DM Serif Display", serif;
  font-weight: 400;
  line-height: 1.2;
}

body.page-article .hero {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 32px;
  margin-bottom: 48px;
}

body.page-article .hero-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

body.page-article .hero h1 {
  font-size: 52px;
  line-height: 1.08;
  margin-bottom: 20px;
}

body.page-article .hero-subtitle {
  font-size: 19px;
  color: var(--ink-muted);
  max-width: 620px;
  margin-bottom: 24px;
}

body.page-article .hero-meta {
  font-size: 13px;
  color: var(--ink-faint);
  display: flex;
  gap: 24px;
}

body.page-article .hero-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

body.page-article h2 {
  font-size: 34px;
  margin-top: 56px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

body.page-article h3 {
  font-size: 22px;
  margin-top: 36px;
  margin-bottom: 12px;
}

body.page-article p {
  margin-bottom: 16px;
}

body.page-article .callout {
  border-radius: 10px;
  padding: 20px 24px;
  margin: 28px 0;
  border-left: 4px solid;
}

body.page-article .callout-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

body.page-article .callout-body {
  font-size: 15px;
  line-height: 1.65;
}

body.page-article .callout.tip {
  background: var(--gold-light);
  border-color: var(--gold);
}

body.page-article .callout.tip .callout-title {
  color: var(--gold);
}

body.page-article .callout.warning {
  background: var(--warning-light);
  border-color: #ea6c00;
}

body.page-article .callout.warning .callout-title {
  color: #c45a00;
}

body.page-article .callout.info {
  background: #eef6ff;
  border-color: var(--qt-blue);
}

body.page-article .callout.info .callout-title {
  color: var(--qt-blue);
}

body.page-article .callout.success {
  background: var(--ws-green-light);
  border-color: var(--ws-green);
}

body.page-article .callout.success .callout-title {
  color: #007a3d;
}

body.page-article .table-wrap {
  overflow-x: auto;
  margin: 24px 0;
}

body.page-article .calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin: 16px 0 12px;
  font-size: 12px;
  color: var(--ink-muted);
}

body.page-article .legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body.page-article .legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

body.page-article .legend-swatch.good,
body.page-article .day-good {
  background: #e6f7ef;
  color: #007a3d;
}

body.page-article .legend-swatch.caution,
body.page-article .day-caution {
  background: var(--warning-light);
  color: #c45a00;
}

body.page-article .legend-swatch.bad,
body.page-article .day-bad,
body.page-article .month-chip.bad {
  background: #fee7e7;
  color: #b42318;
}

body.page-article .legend-swatch.closed,
body.page-article .day-closed,
body.page-article .month-chip.note {
  background: #eef2f7;
  color: #475569;
}

body.page-article .week-calendar {
  min-width: 840px;
}

body.page-article .week-calendar thead th {
  text-align: center;
}

body.page-article .week-calendar .row-label {
  width: 210px;
  background: var(--surface-2);
  font-weight: 600;
  color: var(--ink);
}

body.page-article .week-calendar .day-cell {
  text-align: center;
  font-weight: 600;
  border-left: 1px solid rgba(0, 0, 0, 0.04);
}

body.page-article .week-calendar .day-good,
body.page-article .week-calendar .day-caution,
body.page-article .week-calendar .day-closed {
  border-radius: 0;
}

body.page-article .year-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0 18px;
}

body.page-article .month-card {
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--card-shadow);
}

body.page-article .month-card-header {
  padding: 14px 16px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

body.page-article .month-card-title {
  font-family: "DM Serif Display", serif;
  font-size: 20px;
}

body.page-article .month-card-year {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

body.page-article .month-chip-row {
  padding: 14px 16px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.page-article .month-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: help;
}

body.page-article .month-chip.caution {
  background: var(--warning-light);
  color: #c45a00;
  border-color: #ffd39b;
}

body.page-article .month-chip.bad {
  border-color: #f5b7b7;
}

body.page-article .month-chip.note {
  min-width: 84px;
  border-color: #dbe3ee;
}

body.page-article .month-chip:hover,
body.page-article .month-chip:focus-visible {
  filter: brightness(0.98);
}

body.page-article table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

body.page-article thead th {
  background: var(--ink);
  color: #fff;
  font-family: "DM Sans", sans-serif;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 12px 16px;
}

body.page-article thead th:first-child {
  border-radius: 8px 0 0 0;
}

body.page-article thead th:last-child {
  border-radius: 0 8px 0 0;
}

body.page-article tbody tr {
  border-bottom: 1px solid var(--border);
}

body.page-article tbody tr:last-child {
  border-bottom: none;
}

body.page-article tbody tr:nth-child(even) {
  background: var(--surface-2);
}

body.page-article tbody td {
  padding: 11px 16px;
  vertical-align: top;
  line-height: 1.5;
}

body.page-article tbody td:first-child {
  font-weight: 500;
}

body.page-article .badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 20px;
  vertical-align: middle;
}

body.page-article .badge-qt {
  background: var(--qt-blue-light);
  color: var(--qt-blue);
}

body.page-article .badge-ws {
  background: var(--ws-green-light);
  color: #007a3d;
}

body.page-article .badge-margin {
  background: #f3e8ff;
  color: #6d28d9;
}

body.page-article .badge-tfsa {
  background: #fff7ed;
  color: #c45a00;
}

body.page-article .badge-rrsp {
  background: #e6f4f1;
  color: #0e6b5e;
}

body.page-article .broker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 28px 0;
}

body.page-article .broker-card {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

body.page-article .broker-card-header {
  padding: 16px 20px;
  font-family: "DM Serif Display", serif;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

body.page-article .broker-card-header.qt {
  background: var(--qt-blue-light);
  color: var(--qt-blue);
}

body.page-article .broker-card-header.ws {
  background: var(--ws-green-light);
  color: #006e37;
}

body.page-article .broker-card-body {
  padding: 16px 20px;
  font-size: 14px;
}

body.page-article .broker-card-body ul {
  list-style: none;
  padding: 0;
}

body.page-article .broker-card-body li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

body.page-article .broker-card-body li:last-child {
  border-bottom: none;
}

body.page-article .li-label {
  color: var(--ink-muted);
}

body.page-article .li-val {
  font-weight: 500;
  text-align: right;
  max-width: 55%;
}

body.page-article .phase-block {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin: 28px 0;
  overflow: hidden;
}

body.page-article .phase-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

body.page-article .phase-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "DM Serif Display", serif;
  font-size: 20px;
  flex-shrink: 0;
}

body.page-article .phase-number.qt {
  background: var(--qt-blue);
  color: #fff;
}

body.page-article .phase-number.ws {
  background: var(--ws-green);
  color: #fff;
}

body.page-article .phase-number.neutral {
  background: var(--ink);
  color: #fff;
}

body.page-article .phase-title {
  font-family: "DM Serif Display", serif;
  font-size: 20px;
}

body.page-article .phase-timing {
  margin-left: auto;
  font-size: 13px;
  color: var(--ink-faint);
  white-space: nowrap;
}

body.page-article .phase-body {
  padding: 20px 24px;
}

body.page-article .phase-body ul,
body.page-article .phase-body ol {
  padding-left: 22px;
  margin: 10px 0;
}

body.page-article .phase-body li {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.6;
}

body.page-article .phase-body p {
  font-size: 15px;
  margin-bottom: 12px;
}

body.page-article .returns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0;
}

body.page-article .return-card {
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

body.page-article .return-card .rc-label {
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 8px;
}

body.page-article .return-card .rc-amount {
  font-family: "DM Serif Display", serif;
  font-size: 32px;
  line-height: 1;
  margin-bottom: 6px;
}

body.page-article .return-card .rc-note {
  font-size: 12px;
  opacity: 0.55;
}

body.page-article .return-card.highlight {
  background: var(--accent);
}

body.page-article .timeline {
  position: relative;
  margin: 28px 0 28px 20px;
}

body.page-article .timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

body.page-article .tl-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 28px;
}

body.page-article .tl-item:last-child {
  padding-bottom: 0;
}

body.page-article .tl-dot {
  position: absolute;
  left: -7px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
}

body.page-article .tl-dot.qt {
  background: var(--qt-blue);
}

body.page-article .tl-dot.ws {
  background: var(--ws-green);
}

body.page-article .tl-dot.both {
  background: var(--accent);
}

body.page-article .tl-dot.neutral {
  background: var(--ink);
}

body.page-article .tl-month {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

body.page-article .tl-desc {
  font-size: 15px;
}

body.page-article .tl-detail {
  font-size: 14px;
  color: var(--ink-muted);
  margin-top: 4px;
}

body.page-article .glossary-term {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
}

body.page-article .gt-word {
  font-weight: 600;
  font-size: 15px;
}

body.page-article .gt-def {
  font-size: 15px;
  color: var(--ink-muted);
  line-height: 1.55;
}

body.page-article .footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.6;
}

body.page-article .text-qt {
  color: var(--qt-blue);
}

body.page-article .text-ws {
  color: var(--ws-green);
}

body.page-article .text-accent {
  color: var(--accent);
}

body.page-article strong {
  font-weight: 600;
}

body.page-article em {
  font-style: italic;
}

body.page-article code {
  font-size: 13px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
}

/* ===== Landing page ===== */
body.page-home {
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(
      1100px 420px at 100% -15%,
      #fff0df 0%,
      rgba(255, 240, 223, 0) 72%
    ),
    radial-gradient(
      900px 360px at 0% 0%,
      #e7f2ff 0%,
      rgba(231, 242, 255, 0) 70%
    ),
    linear-gradient(180deg, #fbfaf7 0%, #f4f1eb 100%);
  min-height: 100vh;
}

.site-shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px 24px 64px;
}

.site-intro {
  margin-bottom: 14px;
}

.site-title {
  font-family: "DM Serif Display", serif;
  font-size: clamp(38px, 7vw, 64px);
  line-height: 1;
  margin-bottom: 8px;
}

.site-subtitle {
  color: var(--ink-muted);
  max-width: 860px;
  font-size: 16px;
  line-height: 1.45;
}

.category-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.chip-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-faint);
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.category-chip {
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.category-chip:hover {
  border-color: rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
}

.category-chip.is-active,
.category-chip[aria-pressed="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.category-chip:focus-visible {
  outline: 2px solid var(--qt-blue);
  outline-offset: 2px;
}

.feed-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 14px 0 18px;
}

.feed-title {
  font-family: "DM Serif Display", serif;
  font-size: 30px;
  line-height: 1.1;
}

.feed-count {
  color: var(--ink-muted);
  font-size: 14px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.post-card {
  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(22, 16, 13, 0.07);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(22, 16, 13, 0.13);
}

.post-link {
  color: inherit;
  text-decoration: none;
  display: block;
  padding: 20px 22px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--ink-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--qt-blue-light);
  color: var(--qt-blue);
}

.post-card h3 {
  font-family: "DM Serif Display", serif;
  font-size: 29px;
  line-height: 1.18;
  margin-bottom: 10px;
}

.post-card p {
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.6;
}

.post-arrow {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  color: var(--accent);
  font-weight: 600;
}

.empty-state {
  border: 1px dashed rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  padding: 32px;
  color: var(--ink-muted);
  background: rgba(255, 255, 255, 0.66);
}

.filter-empty {
  margin-top: 16px;
}

.site-footer {
  margin-top: 56px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  padding-top: 22px;
  color: var(--ink-faint);
  font-size: 13px;
}

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

@media (max-width: 600px) {
  body.page-article {
    padding: 32px 20px 64px;
  }

  body.page-article .hero h1 {
    font-size: 36px;
  }

  body.page-article .broker-grid {
    grid-template-columns: 1fr;
  }

  body.page-article .returns-grid {
    grid-template-columns: 1fr;
  }

  body.page-article .glossary-term {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .site-shell {
    padding: 26px 16px 42px;
  }
}

/* ===== 2026 mini trading calendars ===== */
body.page-article .mini-calendars-2026 {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 16px 0 12px;
}

body.page-article .mini-cal-row {
  display: flex;
  flex-direction: row;
  gap: 14px;
}

body.page-article .mini-cal {
  flex: 1 1 0;
  min-width: 0;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px 10px;
  box-shadow: var(--card-shadow);
}

body.page-article .mini-cal-title {
  font-family: "DM Serif Display", serif;
  font-size: 15px;
  color: var(--ink);
  text-align: center;
  margin-bottom: 6px;
}

body.page-article .month-calendar {
  border-collapse: separate;
  border-spacing: 2px;
  width: 100%;
  min-width: 0;
  text-align: center;
}

body.page-article .month-calendar thead th {
  background: transparent;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 0;
  letter-spacing: 0;
  text-align: center;
}

body.page-article .month-calendar tbody td {
  width: 26px;
  height: 22px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
  padding: 1px 0;
  border: none;
}

/* Calendar day color classes */
body.page-article .month-calendar .cal-good {
  background: #d1fae5;
  color: #065f46;
}

body.page-article .month-calendar .cal-caution {
  background: #fee2e2;
  color: #991b1b;
}

body.page-article .month-calendar .cal-holiday {
  background: #374151;
  color: #f9fafb;
}

body.page-article .month-calendar .cal-closed {
  background: #f3f4f6;
  color: #9ca3af;
}

/* Legend swatches for the 2026 trading calendar */
body.page-article .legend-swatch.cal-good {
  background: #d1fae5;
  border: 1px solid #6ee7b7;
}

body.page-article .legend-swatch.cal-caution {
  background: #fee2e2;
  border: 1px solid #fca5a5;
}

body.page-article .legend-swatch.cal-holiday {
  background: #374151;
  border: 1px solid #374151;
}

body.page-article .legend-swatch.cal-closed {
  background: #f3f4f6;
  border: 1px solid #d1d5db;
}

@media (max-width: 700px) {
  body.page-article .mini-cal-row {
    flex-direction: column;
  }
}
