/* =========================================================
   Teaching Grandma — shared styles
   A warm, fun, cozy little blog about AI, money & tech.
   No frameworks, no build step. Just CSS being friendly.
   ========================================================= */

:root {
  --cream:        #FFF8EE;
  --cream-deep:   #FBEAD3;
  --ink:          #3A2E28;   /* warm dark brown, softer than black */
  --ink-soft:     #6B5B50;
  --coral:        #E8714A;   /* the "hello dear" accent */
  --coral-deep:   #C9542F;
  --teal:         #2E8B8B;
  --teal-deep:    #1F6E6E;
  --sun:          #F4C95D;   /* sunny yellow */
  --berry:        #C2548A;   /* a little pop of jam */
  --paper-shadow: rgba(58, 46, 40, 0.12);
  --radius:       22px;
  --maxw:         1080px;
  --font-head:    "Georgia", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body:    "Verdana", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--cream);
  /* a soft polka-dot wallpaper, like grandma's kitchen curtains */
  background-image:
    radial-gradient(var(--cream-deep) 1.4px, transparent 1.5px),
    radial-gradient(var(--cream-deep) 1.4px, transparent 1.5px);
  background-size: 38px 38px;
  background-position: 0 0, 19px 19px;
  line-height: 1.65;
  font-size: 18px;
}

/* ---------- Layout helpers ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 720px; }

a { color: var(--teal-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--coral-deep); }

/* ---------- Top navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--cream);
  border-bottom: 3px dashed var(--cream-deep);
  backdrop-filter: blur(4px);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-head);
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--coral-deep); }
.brand svg { flex: 0 0 auto; }
.brand .brand-sub {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: normal;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-links a:hover { background: var(--sun); color: var(--ink); }
.nav-links a.active { background: var(--coral); color: #fff; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--coral);
  color: #fff;
  text-decoration: none;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: bold;
  box-shadow: 0 4px 0 var(--coral-deep);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:hover { color: #fff; transform: translateY(2px); box-shadow: 0 2px 0 var(--coral-deep); }
.btn.btn-teal { background: var(--teal); box-shadow: 0 4px 0 var(--teal-deep); }
.btn.btn-teal:hover { box-shadow: 0 2px 0 var(--teal-deep); }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 30px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
}
.hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08;
  margin: 0 0 14px;
  color: var(--ink);
}
.hero h1 .squiggle { color: var(--coral); position: relative; white-space: nowrap; }
.hero p.lede { font-size: 1.18rem; color: var(--ink-soft); margin: 0 0 26px; }
.hero-art {
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 10px 12px 0 var(--sun);
  transform: rotate(-1.5deg);
}
.hero-art svg { width: 100%; height: auto; display: block; }

.tagchips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.tagchip {
  font-size: 0.85rem;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: 2px 3px 0 var(--cream-deep);
}

/* ---------- Section titles ---------- */
.section { padding: 40px 0; }
.section-title {
  font-family: var(--font-head);
  font-size: 1.9rem;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-sub { color: var(--ink-soft); margin: 0 0 26px; font-size: 1.02rem; }

/* ---------- Category cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 6px 7px 0 var(--paper-shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:hover { transform: translateY(-4px) rotate(-0.6deg); box-shadow: 8px 12px 0 var(--paper-shadow); color: var(--ink); }
.card .card-icon {
  width: 92px; height: 92px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin-bottom: 4px;
}
.card.ai    .card-icon { background: #E7F3F3; }
.card.money .card-icon { background: #FBEFD3; }
.card.tech  .card-icon { background: #F6E2EC; }
.card h3 { font-family: var(--font-head); font-size: 1.4rem; margin: 0; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.98rem; }
.card .card-more { margin-top: auto; font-weight: bold; color: var(--coral-deep); }

/* ---------- Post list (featured) ---------- */
.postlist { display: grid; gap: 18px; }
.post-row {
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 18px;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 4px 5px 0 var(--paper-shadow);
  transition: transform 0.1s ease;
}
.post-row:hover { transform: translateX(4px); color: var(--ink); }
.post-row .emoji-badge {
  width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center; font-size: 2rem;
  border: 2px solid var(--ink);
}
.post-row h4 { margin: 0 0 3px; font-family: var(--font-head); font-size: 1.22rem; }
.post-row .post-meta { color: var(--ink-soft); font-size: 0.86rem; }
.post-row .arrow { font-size: 1.6rem; color: var(--coral); }

.pill {
  display: inline-block; font-size: 0.72rem; font-weight: bold;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 10px; border-radius: 999px; color: #fff;
}
.pill.ai { background: var(--teal); }
.pill.money { background: var(--coral); }
.pill.tech { background: var(--berry); }

/* ---------- Newsletter / fun callout ---------- */
.callout {
  background: var(--teal);
  color: #fff;
  border-radius: var(--radius);
  padding: 34px;
  text-align: center;
  border: 4px solid var(--ink);
  box-shadow: 8px 9px 0 var(--paper-shadow);
}
.callout h3 { font-family: var(--font-head); font-size: 1.7rem; margin: 0 0 8px; }
.callout p { margin: 0 auto 18px; max-width: 520px; opacity: 0.95; }

/* ---------- Article / blog post ---------- */
.article-header { padding: 44px 0 18px; text-align: center; }
.article-header .pill { margin-bottom: 14px; }
.article-header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.12;
  margin: 6px auto 14px;
  max-width: 760px;
}
.article-header .byline { color: var(--ink-soft); font-size: 0.95rem; }
.article-hero-art {
  max-width: 460px; margin: 26px auto 0;
  background: #fff; border: 4px solid var(--ink); border-radius: var(--radius);
  padding: 16px; box-shadow: 8px 10px 0 var(--sun); transform: rotate(1deg);
}
.article-hero-art svg { width: 100%; height: auto; display: block; }

.article { font-size: 1.12rem; }
.article p { margin: 0 0 1.25em; }
.article h2 {
  font-family: var(--font-head);
  font-size: 1.7rem; margin: 1.8em 0 0.5em;
  display: flex; align-items: center; gap: 10px;
}
.article h3 { font-family: var(--font-head); font-size: 1.3rem; margin: 1.4em 0 0.4em; }
.article ul, .article ol { margin: 0 0 1.25em; padding-left: 1.3em; }
.article li { margin-bottom: 0.5em; }
.article strong { color: var(--coral-deep); }

.article blockquote {
  margin: 1.6em 0;
  background: #fff;
  border-left: 8px solid var(--sun);
  border-radius: 14px;
  padding: 18px 22px;
  font-style: italic;
  color: var(--ink-soft);
  box-shadow: 4px 5px 0 var(--paper-shadow);
}

/* Grandma's little sticky-note asides */
.grandma-note {
  background: var(--sun);
  border: 3px solid var(--ink);
  border-radius: 16px;
  padding: 18px 20px 18px 64px;
  margin: 1.8em 0;
  position: relative;
  box-shadow: 5px 6px 0 var(--paper-shadow);
  transform: rotate(-0.7deg);
}
.grandma-note::before {
  content: "👵";
  position: absolute;
  left: 16px; top: 16px;
  font-size: 1.8rem;
}
.grandma-note strong { color: var(--ink); }

/* Analogy / "in plain English" box */
.plain-box {
  background: #E7F3F3;
  border: 3px dashed var(--teal);
  border-radius: 16px;
  padding: 18px 22px;
  margin: 1.8em 0;
}
.plain-box .plain-label {
  display: inline-block; font-weight: bold; color: var(--teal-deep);
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem;
  margin-bottom: 6px;
}

figure.inline-art {
  margin: 2em auto;
  text-align: center;
  max-width: 380px;
}
figure.inline-art svg { width: 100%; height: auto; }
figure.inline-art figcaption { color: var(--ink-soft); font-size: 0.9rem; font-style: italic; margin-top: 8px; }

.tldr {
  background: #fff; border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 22px 24px; margin: 2em 0; box-shadow: 5px 6px 0 var(--paper-shadow);
}
.tldr h3 { margin-top: 0; }

/* Prev/next + back navigation in posts */
.post-nav {
  display: flex; justify-content: space-between; gap: 16px;
  margin: 40px 0; flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 50px;
  background: var(--ink);
  color: var(--cream);
  padding: 40px 0;
}
.site-footer .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: center; }
.site-footer a { color: var(--sun); }
.site-footer .foot-brand { font-family: var(--font-head); font-size: 1.2rem; }
.site-footer small { color: #C9BBB0; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 420px; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .post-row { grid-template-columns: 52px 1fr; }
  .post-row .arrow { display: none; }
  .nav-links a { padding: 7px 10px; font-size: 0.88rem; }
}
