/*
Theme Name: Peter Lynch Hub
Theme URI: https://example.com/peter-lynch-hub
Author: Peter Lynch Hub
Description: A lightweight WordPress knowledge-base theme for Peter Lynch investment notes, quotes, case studies, books, interviews, and timelines.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.5
Requires PHP: 8.1
Text Domain: peter-lynch-hub
*/

:root {
  --plh-ink: #10211c;
  --plh-muted: #66756f;
  --plh-line: #e5ebe7;
  --plh-soft: #f5f8f6;
  --plh-card: #ffffff;
  --plh-green: #17833f;
  --plh-green-dark: #08372d;
  --plh-gold: #b68a34;
  --plh-red: #b34b3f;
  --plh-shadow: 0 18px 50px rgba(18, 34, 29, 0.1);
  --plh-radius: 8px;
  --plh-max: 1160px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--plh-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.6;
  background: #fff;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--plh-line);
  backdrop-filter: blur(14px);
}

.site-header__inner,
.section__inner,
.site-footer__inner {
  width: min(var(--plh-max), calc(100% - 40px));
  margin: 0 auto;
}

.site-header__inner {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 250px;
}

.brand__mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--plh-line);
  border-radius: 50%;
  background: var(--plh-soft);
  color: var(--plh-green);
  font-weight: 800;
}

.brand__title {
  display: block;
  color: var(--plh-ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.brand__tagline {
  display: block;
  color: var(--plh-muted);
  font-size: 12px;
}

.primary-nav {
  flex: 1;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: #22332e;
  font-size: 14px;
  font-weight: 700;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a {
  color: var(--plh-green);
}

.header-search {
  width: 180px;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-field {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--plh-line);
  border-radius: var(--plh-radius);
  background: #fff;
  color: var(--plh-ink);
}

.search-submit,
.button,
.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--plh-radius);
  background: var(--plh-green);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.search-submit {
  width: 40px;
  padding: 0;
}

.button--ghost {
  border-color: rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
}

.hero {
  overflow: hidden;
  background: #06362d;
  color: #fff;
}

.hero__inner {
  display: grid;
  min-height: 430px;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  align-items: center;
  gap: 34px;
  width: min(var(--plh-max), calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0;
}

.hero__title {
  margin: 0 0 12px;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.12;
}

.hero__subtitle {
  margin: 0 0 22px;
  font-size: 24px;
  font-weight: 700;
}

.hero__copy {
  max-width: 560px;
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.86);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero__media {
  position: relative;
  min-height: 330px;
}

.hero__media img {
  width: 100%;
  height: 390px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--plh-radius);
  box-shadow: var(--plh-shadow);
}

.hero__quote {
  position: absolute;
  right: 0;
  top: 42px;
  max-width: 310px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--plh-radius);
  background: rgba(4, 37, 31, 0.72);
  color: #fff;
}

.hero__quote-mark {
  color: #47b96b;
  font-size: 42px;
  line-height: 0.7;
}

.hero__quote p {
  margin: 10px 0;
  font-size: 18px;
  font-weight: 700;
}

.stats {
  margin-top: -42px;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--plh-line);
  border-radius: var(--plh-radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--plh-shadow);
}

.stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 26px;
}

.stat__icon,
.card__icon,
.tool-list__icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #edf5ef;
  color: var(--plh-green);
  font-weight: 900;
}

.stat__number {
  display: block;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.stat__label {
  display: block;
  color: var(--plh-muted);
  font-size: 13px;
}

.section {
  padding: 36px 0;
}

.section--soft {
  background: var(--plh-soft);
}

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section__title {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.section__more,
.terms a,
.entry-meta a {
  color: var(--plh-green);
  font-weight: 800;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 30px;
  align-items: start;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid--six {
  grid-template-columns: repeat(3, 1fr);
}

.grid--four {
  grid-template-columns: repeat(4, 1fr);
}

.grid--three {
  grid-template-columns: repeat(3, 1fr);
}

.card,
.sidebar-panel,
.entry-shell,
.archive-card {
  border: 1px solid var(--plh-line);
  border-radius: var(--plh-radius);
  background: var(--plh-card);
  box-shadow: 0 10px 26px rgba(18, 34, 29, 0.06);
}

.card {
  overflow: hidden;
}

.card__body {
  padding: 18px;
}

.card__title {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.card__text {
  margin: 0;
  color: var(--plh-muted);
  font-size: 14px;
}

.card__media {
  width: 100%;
  aspect-ratio: 4 / 2.65;
  background: var(--plh-soft);
  object-fit: cover;
}

.card-link {
  min-height: auto;
  margin-top: 14px;
  padding: 0;
  background: transparent;
  color: var(--plh-green);
}

.sidebar {
  display: grid;
  gap: 18px;
}

.sidebar-panel {
  padding: 22px;
}

.sidebar-panel h2,
.sidebar-panel h3 {
  margin: 0 0 14px;
  font-size: 19px;
}

.quick-list,
.quote-list,
.tool-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.quick-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  border-bottom: 1px solid var(--plh-line);
  color: #24362f;
  font-weight: 700;
}

.quote-list li {
  position: relative;
  padding-left: 24px;
  color: #273830;
}

.quote-list li::before {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--plh-green);
  content: "“";
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.tool-list li {
  display: flex;
  gap: 12px;
}

.tool-list strong {
  display: block;
}

.tool-list span {
  color: var(--plh-muted);
  font-size: 13px;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  border-top: 2px solid #bed2c7;
  padding-top: 22px;
}

.timeline__item {
  position: relative;
}

.timeline__item::before {
  position: absolute;
  top: -29px;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--plh-green);
  content: "";
}

.timeline__date {
  display: block;
  color: var(--plh-green);
  font-weight: 900;
}

.timeline__title {
  display: block;
  font-weight: 800;
}

.newsletter {
  background: var(--plh-green-dark);
  color: #fff;
}

.newsletter__inner {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(260px, 0.7fr) minmax(180px, 0.4fr);
  gap: 28px;
  align-items: center;
  width: min(var(--plh-max), calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0;
}

.newsletter p,
.site-footer p {
  color: rgba(255, 255, 255, 0.72);
}

.newsletter-form {
  display: flex;
  gap: 10px;
}

.newsletter-form input {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: var(--plh-radius);
  padding: 0 14px;
}

.site-footer {
  background: #082920;
  color: #fff;
}

.site-footer__inner {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-hero {
  background: var(--plh-soft);
  border-bottom: 1px solid var(--plh-line);
}

.page-hero__inner {
  width: min(var(--plh-max), calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0;
}

.page-hero h1 {
  margin: 0 0 10px;
  font-size: 40px;
  line-height: 1.16;
}

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

.archive-card {
  padding: 20px;
}

.entry-shell {
  width: min(860px, calc(100% - 40px));
  margin: 34px auto;
  padding: 34px;
}

.entry-content {
  font-size: 17px;
}

.entry-content h2,
.entry-content h3 {
  margin-top: 32px;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--plh-muted);
  font-size: 14px;
}

.detail-box {
  margin: 24px 0;
  padding: 18px;
  border-left: 4px solid var(--plh-green);
  background: var(--plh-soft);
}

.terms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.terms a {
  padding: 5px 10px;
  border-radius: 999px;
  background: #edf5ef;
  font-size: 13px;
}

.pagination {
  margin-top: 28px;
}

.pagination .page-numbers {
  display: inline-flex;
  min-width: 36px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  margin-right: 6px;
  border: 1px solid var(--plh-line);
  border-radius: var(--plh-radius);
}

.pagination .current {
  background: var(--plh-green);
  color: #fff;
}

@media (max-width: 980px) {
  .site-header__inner,
  .newsletter__inner,
  .home-layout,
  .hero__inner {
    grid-template-columns: 1fr;
  }

  .site-header__inner {
    display: grid;
    padding: 12px 0;
  }

  .brand {
    min-width: 0;
  }

  .primary-nav ul {
    justify-content: start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .header-search {
    width: 100%;
  }

  .stats {
    margin-top: 0;
  }

  .stats__grid,
  .grid--six,
  .grid--four,
  .grid--three,
  .archive-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .site-header__inner,
  .section__inner,
  .site-footer__inner,
  .hero__inner,
  .newsletter__inner,
  .page-hero__inner,
  .entry-shell {
    width: min(100% - 28px, var(--plh-max));
  }

  .hero__inner {
    min-height: auto;
    padding: 34px 0;
  }

  .hero__subtitle {
    font-size: 20px;
  }

  .hero__media {
    min-height: 0;
  }

  .hero__media img {
    height: 260px;
  }

  .hero__quote {
    position: static;
    max-width: none;
    margin-top: 12px;
  }

  .stats__grid,
  .grid--six,
  .grid--four,
  .grid--three,
  .archive-grid {
    grid-template-columns: 1fr;
  }

  .stat {
    padding: 16px;
  }

  .section__head,
  .site-footer__inner,
  .newsletter-form {
    align-items: stretch;
    flex-direction: column;
  }

  .entry-shell {
    padding: 22px;
  }
}
