/* ===== Reset & Base ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --text: #1a1a1a;
  --text-light: #555;
  --bg: #fafafa;
  --white: #ffffff;
  --accent: #2c5f8a;
  --accent-hover: #1e4468;
  --border: #e0e0e0;
  --max-width: 820px;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Typography ===== */
h1, h2, h3, h4 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 2.2rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.5rem; margin-bottom: 1rem; color: var(--text); }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

p { margin-bottom: 1rem; }

/* ===== Header & Nav ===== */
header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.site-title:hover {
  color: var(--accent);
  text-decoration: none;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.8rem;
}

nav a {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

nav a:hover,
nav a.active {
  color: var(--accent);
  text-decoration: none;
}

/* Hamburger menu (mobile) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s;
}

/* ===== Main Content ===== */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* ===== Hero (Home Page) ===== */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.hero h1 {
  font-size: 2.8rem;
  letter-spacing: -0.02em;
}

.hero .tagline {
  font-size: 1.1rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: 0.5rem;
}

/* ===== About Section ===== */
.about-section {
  max-width: 640px;
  margin: 0 auto;
}

.about-section p {
  font-size: 1.05rem;
}

/* ===== Page Header ===== */
.page-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.page-header p {
  color: var(--text-light);
  font-size: 1rem;
}

/* ===== Cards (Podcasts, Reading) ===== */
.card-grid {
  display: grid;
  gap: 1.5rem;
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.card h3 a {
  color: var(--text);
}

.card h3 a:hover {
  color: var(--accent);
}

.card p {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 0;
}

.card .meta {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.5rem;
}

/* ===== Blog Posts (Market Notes) ===== */
.post {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
  margin-bottom: 2rem;
}

.post:last-child {
  border-bottom: none;
}

.post-date {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}

.post h2 {
  margin-bottom: 0.8rem;
  font-size: 1.4rem;
}

.post p {
  font-size: 1rem;
}

/* ===== Reading List Categories ===== */
.reading-category {
  margin-bottom: 2.5rem;
}

.reading-category h2 {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  padding-bottom: 0.2rem;
  margin-bottom: 1.2rem;
}

/* ===== Podcast Digest ===== */
.digest-week {
  margin-bottom: 3rem;
}

.digest-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.digest-header h2 {
  margin-bottom: 0;
}

.digest-count {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--text-light);
}

.themes-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.section-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin-bottom: 1.2rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.theme {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.theme:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.theme h4 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  color: var(--text);
}

.theme p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 0;
}

.episode-card {
  display: flex;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s;
}

.episode-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.episode-number {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--border);
  min-width: 2rem;
  text-align: center;
  padding-top: 0.2rem;
}

.episode-content {
  flex: 1;
}

.episode-content h3 {
  margin-bottom: 0.3rem;
}

.episode-detail {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.3rem;
}

.episode-title {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.8rem;
}

.takeaways {
  list-style: disc;
  padding-left: 1.2rem;
  margin-bottom: 0.8rem;
}

.takeaways li {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.also-recent {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.disclaimer {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.2rem 1.5rem;
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--text-light);
}

.disclaimer p {
  margin-bottom: 0.5rem;
}

.disclaimer p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .digest-header {
    flex-direction: column;
    gap: 0.3rem;
  }

  .episode-card {
    flex-direction: column;
    gap: 0;
  }

  .episode-number {
    text-align: left;
  }
}

/* ===== Long-Form Article ===== */
.article-nav {
  margin-bottom: 1.5rem;
}

.article-nav a {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
}

.long-post h1 {
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
}

.article-subtitle {
  font-style: italic;
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.article-attribution {
  background: var(--white);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.2rem;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.article-attribution p {
  margin-bottom: 0;
}

.long-post h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.long-post h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

.long-post h3 {
  font-size: 1.05rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-light);
}

.verdict {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin: 1rem 0 1.5rem;
}

.verdict h4 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.verdict p {
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}

.verdict p:last-child {
  margin-bottom: 0;
}

.flag {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
}

.flag-red {
  background: #fde8e8;
  color: #b91c1c;
}

.flag-amber {
  background: #fef3cd;
  color: #92400e;
}

.flag-green {
  background: #dcfce7;
  color: #166534;
}

.pattern-list h3 {
  color: var(--text);
  margin-top: 1.2rem;
}

.pattern-list p {
  font-size: 0.95rem;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  display: block;
}

thead tr {
  background: #f0f4f8;
  text-align: left;
}

th, td {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  line-height: 1.5;
}

tbody tr:nth-child(even) {
  background: var(--bg);
}

@media (max-width: 640px) {
  table {
    font-size: 0.8rem;
  }
  th, td {
    padding: 0.35rem 0.5rem;
  }
}

.sources {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sources h3 {
  color: var(--text);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sources ul {
  list-style: disc;
  padding-left: 1.2rem;
}

.sources li {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
  line-height: 1.5;
}

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  color: var(--text-light);
  background: var(--white);
}

/* ===== Mobile ===== */
@media (max-width: 640px) {
  html { font-size: 16px; }

  .hero h1 { font-size: 2rem; }

  .menu-toggle { display: block; }

  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    gap: 1rem;
  }

  nav ul.open {
    display: flex;
  }

  .header-inner {
    position: relative;
  }
}
