/*
Theme Name: Learn.pm
Theme URI: https://learn.pm
Author: Sam
Description: Editorial theme for Learn.pm - Best Practices & Principles for PMs. Recreates the original React prototype design: cream background, Playfair Display headings, gold accents.
Version: 1.0.0
Requires PHP: 8.0
Text Domain: learnpm
*/

:root {
  --bg: hsl(40 33% 96%);
  --fg: hsl(220 30% 12%);
  --card: hsl(40 30% 98%);
  --navy: hsl(220 30% 15%);
  --navy-light: hsl(220 20% 30%);
  --gold: hsl(38 65% 50%);
  --gold-dark: hsl(38 65% 42%);
  --cream-dark: hsl(40 20% 90%);
  --muted: hsl(40 15% 92%);
  --muted-fg: hsl(220 10% 45%);
  --border: hsl(40 15% 85%);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow-editorial: 0 1px 3px hsl(220 30% 15% / 0.06), 0 6px 16px hsl(220 30% 15% / 0.04);
  --shadow-card-hover: 0 4px 12px hsl(220 30% 15% / 0.08), 0 16px 32px hsl(220 30% 15% / 0.06);
  --radius: 0.375rem;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--fg);
}
.site-logo svg { color: var(--gold); }
.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav a {
  font-size: 0.875rem;
  color: var(--muted-fg);
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav a:hover, .site-nav a.current { color: var(--fg); }
.btn-signin {
  background: var(--navy);
  color: hsl(40 33% 96%);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  transition: opacity 0.15s;
}
.btn-signin:hover { opacity: 0.9; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--fg); }

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--navy);
  color: hsl(40 33% 96%);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  color: var(--fg);
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: background 0.15s;
}
.btn-outline:hover { background: var(--cream-dark); }
.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gold);
  color: var(--fg);
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: background 0.15s;
}
.btn-gold:hover { background: var(--gold-dark); }

/* ── Hero ───────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; }
.hero .container {
  display: flex;
  align-items: center;
  gap: 4rem;
  padding-top: 6rem;
  padding-bottom: 6rem;
}
.hero-text { max-width: 42rem; flex: 1; }
.hero-kicker {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(3rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}
.hero-title .underlined { position: relative; display: inline-block; }
.hero-title .underlined::after {
  content: "";
  position: absolute;
  left: 0; bottom: -4px;
  width: 100%; height: 4px;
  background: var(--gold);
  border-radius: 999px;
}
.hero-sub {
  font-size: 1.25rem;
  color: var(--muted-fg);
  line-height: 1.6;
  margin-bottom: 2.5rem;
  max-width: 42rem;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 1rem; }
.hero-image { flex-shrink: 0; }
.hero-image img {
  width: 22rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-card-hover);
  object-fit: cover;
}

/* ── Topics strip ───────────────────────────────────────── */
.topics-strip {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: hsl(40 30% 98% / 0.5);
}
.topics-strip .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.topics-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-fg);
  margin-right: 0.5rem;
}
.topics-strip a {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-fg);
  border-radius: var(--radius);
  transition: all 0.15s;
}
.topics-strip a:hover { color: var(--fg); background: var(--cream-dark); }

/* ── Section headings ───────────────────────────────────── */
.section { padding: 4rem 0; }
.section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 2rem; }
.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.link-gold {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.link-gold:hover { color: var(--gold-dark); }

/* ── Article cards ──────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.article-card {
  display: block;
  background: var(--card);
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: var(--shadow-editorial);
  transition: box-shadow 0.2s, transform 0.2s;
}
.article-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}
.card-category {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
}
.card-readtime { color: var(--muted-fg); }
.article-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
.article-card p { color: var(--muted-fg); font-size: 0.95rem; line-height: 1.6; margin-bottom: 1.25rem; }
.card-byline { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--muted-fg); }
.card-byline .author { color: var(--fg); font-weight: 600; }

/* ── Recent list (Substack feed style) ─────────────────── */
.recent-feed { max-width: 48rem; margin: 0 auto; }
.recent-item { display: block; padding: 1.5rem 0; border-bottom: 1px solid var(--border); }
.recent-item:last-child { border-bottom: none; }
.recent-item .card-category { font-size: 0.75rem; }
.recent-item h3 {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0.375rem 0 0.5rem;
  transition: color 0.15s;
}
.recent-item:hover h3 { color: var(--gold); }
.recent-item p {
  font-size: 0.875rem;
  color: var(--muted-fg);
  line-height: 1.6;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-meta { display: flex; gap: 0.75rem; font-size: 0.75rem; color: var(--muted-fg); }

/* ── CTA band ───────────────────────────────────────────── */
.cta-band { background: var(--navy); color: hsl(40 33% 96%); }
.cta-band .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 5rem;
  padding-bottom: 5rem;
}
.cta-band h2 { font-size: 2.25rem; font-weight: 700; margin-bottom: 1rem; }
.cta-band p { color: hsl(40 33% 96% / 0.7); max-width: 32rem; margin-bottom: 2rem; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { background: var(--navy); color: hsl(40 33% 96%); margin-top: 0; }
.site-footer .cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  padding: 4rem 0 3rem;
}
.site-footer .site-logo { color: hsl(40 33% 96%); margin-bottom: 1rem; }
.site-footer .tagline { font-size: 0.875rem; color: hsl(40 33% 96% / 0.6); line-height: 1.6; max-width: 18rem; }
.site-footer h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(40 33% 96% / 0.5);
  margin-bottom: 1rem;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 0.6rem; }
.site-footer li a { font-size: 0.875rem; color: hsl(40 33% 96% / 0.8); }
.site-footer li a:hover { color: hsl(40 33% 96%); }
.footer-bottom {
  border-top: 1px solid hsl(40 33% 96% / 0.1);
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: hsl(40 33% 96% / 0.5);
}

/* ── Single article (editorial prose) ───────────────────── */
.article-header { max-width: 48rem; margin: 0 auto; padding: 4rem 0 2rem; }
.article-header .card-category { font-size: 0.8rem; }
.article-header h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0.75rem 0 1.25rem;
}
.article-header .meta { display: flex; gap: 0.75rem; font-size: 0.875rem; color: var(--muted-fg); }
.article-header .meta .author { color: var(--fg); font-weight: 600; }

.editorial-prose { max-width: 48rem; margin: 0 auto; font-size: 1.125rem; line-height: 1.8; padding-bottom: 4rem; }
.editorial-prose h2 { font-size: 1.75rem; font-weight: 700; margin: 2.5rem 0 1rem; }
.editorial-prose h3 { font-size: 1.375rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.editorial-prose p { margin-bottom: 1.4rem; }
.editorial-prose ul, .editorial-prose ol { margin: 0 0 1.4rem 1.5rem; }
.editorial-prose li { margin-bottom: 0.5rem; }
.editorial-prose blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.5rem 0 0.5rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--navy-light);
}
.editorial-prose img { border-radius: 0.75rem; margin: 2rem auto; box-shadow: var(--shadow-editorial); }
.editorial-prose figcaption { text-align: center; font-size: 0.85rem; color: var(--muted-fg); margin-top: -1.25rem; margin-bottom: 2rem; }
.editorial-prose a { color: var(--gold-dark); text-decoration: underline; text-underline-offset: 3px; }

/* ── Archive / articles list ────────────────────────────── */
.page-title-block { padding: 4rem 0 1rem; }
.page-kicker {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 1rem;
}
.page-title { font-size: clamp(2.25rem, 5vw, 3.25rem); font-weight: 700; margin-bottom: 1rem; }
.page-sub { font-size: 1.1rem; color: var(--muted-fg); max-width: 38rem; line-height: 1.6; }

/* ── Skills map ─────────────────────────────────────────── */
.skill-author-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 1rem 0.4rem 0.4rem;
  margin: 1.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted-fg);
}
.skill-author-chip img { width: 2rem; height: 2rem; border-radius: 50%; object-fit: cover; }
.skill-author-chip .name { color: var(--fg); font-weight: 600; }

.skill-cats { display: flex; flex-direction: column; gap: 1rem; padding: 2.5rem 0 1rem; }
.skill-cat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-editorial);
  transition: box-shadow 0.2s;
}
.skill-cat-card:hover { box-shadow: var(--shadow-card-hover); }
.skill-cat-card .icon { font-size: 1.5rem; flex-shrink: 0; }
.skill-cat-card .body { flex: 1; min-width: 0; }
.skill-cat-card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.2rem; }
.skill-cat-card p { font-size: 0.875rem; color: var(--muted-fg); }
.skill-count {
  flex-shrink: 0;
  background: var(--muted);
  color: var(--muted-fg);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}
.skill-cat-card .chev { color: var(--muted-fg); flex-shrink: 0; }

/* Skill list inside category */
.skill-list { background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem; overflow: hidden; margin: 2rem 0; }
.skill-group-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1rem 1.25rem 0.5rem;
}
.skill-row { border-bottom: 1px solid var(--border); }
.skill-row:last-child { border-bottom: none; }
.skill-row-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg);
  text-align: left;
  transition: background 0.15s;
}
.skill-row-head:hover { background: var(--muted); }
.ai-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.ai-LOW { background: hsl(220 15% 90%); color: hsl(220 15% 35%); }
.ai-MEDIUM { background: hsl(38 60% 88%); color: hsl(38 70% 32%); }
.ai-HIGH { background: hsl(38 65% 75%); color: hsl(38 80% 25%); }
.ai-VERYHIGH { background: var(--gold); color: var(--fg); }

.skill-workflow { padding: 0 1.25rem 1.25rem 2.5rem; }
.skill-workflow ol { list-style: none; }
.skill-workflow li { display: flex; gap: 0.6rem; font-size: 0.9rem; color: var(--muted-fg); margin-bottom: 0.5rem; }
.skill-workflow li .n { font-weight: 700; color: var(--fg); flex-shrink: 0; }

/* Locked overlay */
.locked-steps { position: relative; margin-top: 0.75rem; }
.locked-steps .blurred { filter: blur(6px); user-select: none; pointer-events: none; }
.locked-steps .unlock-cta {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.unlock-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--navy);
  color: hsl(40 33% 96%);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-card-hover);
}

/* Unlock band on skills page */
.unlock-band {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  text-align: center;
  padding: 3rem 2rem;
  margin: 3rem 0 4rem;
}
.unlock-band .lock-icon { color: var(--gold); margin-bottom: 1rem; font-size: 1.5rem; }
.unlock-band h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.75rem; }
.unlock-band p { color: var(--muted-fg); max-width: 30rem; margin: 0 auto 1.5rem; }

/* ── Single skill page ──────────────────────────────────── */
.skill-header { max-width: 48rem; margin: 0 auto; padding: 4rem 0 1rem; }
.skill-header .cat-crumb { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); }
.skill-header h1 { font-size: clamp(2rem, 4.5vw, 2.75rem); font-weight: 700; margin: 0.75rem 0 1rem; }
.skill-header .ai-line { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9rem; color: var(--muted-fg); }
.skill-body { max-width: 48rem; margin: 0 auto; padding-bottom: 4rem; }
.workflow-block { background: var(--card); border: 1px solid var(--border); border-radius: 0.75rem; padding: 1.5rem; margin: 2rem 0; }
.workflow-block h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }

/* ── Forms (login/register) ─────────────────────────────── */
.auth-card {
  max-width: 26rem;
  margin: 4rem auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-editorial);
}
.auth-card h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted-fg); font-size: 0.9rem; margin-bottom: 1.75rem; }
.auth-card label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.35rem; }
.auth-card input[type=text], .auth-card input[type=email], .auth-card input[type=password] {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
}
.auth-card input:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
.auth-card .btn-primary { width: 100%; justify-content: center; }
.auth-card .alt { text-align: center; font-size: 0.85rem; color: var(--muted-fg); margin-top: 1.25rem; }
.auth-card .alt a { color: var(--gold-dark); font-weight: 600; }
.auth-error {
  background: hsl(0 84% 60% / 0.08);
  border: 1px solid hsl(0 84% 60% / 0.3);
  color: hsl(0 60% 40%);
  font-size: 0.85rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius);
  margin-bottom: 1.1rem;
}

/* ── Pagination ─────────────────────────────────────────── */
.pagination { display: flex; gap: 0.5rem; justify-content: center; padding: 2rem 0 4rem; font-size: 0.9rem; }
.pagination a, .pagination span {
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted-fg);
}
.pagination span.current { background: var(--navy); color: hsl(40 33% 96%); border-color: var(--navy); }
.pagination a:hover { background: var(--cream-dark); color: var(--fg); }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-image { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .site-footer .cols { grid-template-columns: 1fr; gap: 2rem; }
}
@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 3.5rem;
    left: 0; right: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem 1.5rem;
    gap: 1rem;
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .hero .container { padding-top: 4rem; padding-bottom: 4rem; }
}
