/* ================================================================
   AfterKin — Shared Stylesheet
   Extracted from what-to-do-when-someone-dies.html + new components
   ================================================================ */

/* ── GOOGLE FONTS IMPORT ── */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&family=Inter:wght@300;400;500;600&display=swap');

/* ── CSS VARIABLES ── */
:root {
  --cream: #F8F4EF;
  --warm-white: #FDFAF7;
  --charcoal: #3D3D3A;
  --mid: #6B6560;
  --light: #9B968E;
  --sage: #6E8072;
  --sage-light: #EDF0ED;
  --amber: #C4874A;
  --amber-light: #FBF3E9;
  --border: #E4DED6;
  --section-1: #F0EDE8;
  --serif: 'Lora', Georgia, serif;
  --sans: 'Inter', sans-serif;
  --nav-height: 60px;
  --content-max: 780px;
  --wide-max: 1080px;
}

/* ── RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--sans);
  background: var(--warm-white);
  color: var(--charcoal);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

/* ── PROGRESS BAR ── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--sage);
  z-index: 200;
  transition: width 0.1s;
  width: 0%;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 250, 247, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-logo {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--charcoal);
  text-decoration: none;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.nav-logo span { color: var(--sage); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--charcoal); }

.nav-cta {
  background: var(--sage) !important;
  color: white !important;
  padding: 7px 16px !important;
  border-radius: 6px !important;
  letter-spacing: 0.05em !important;
  text-transform: none !important;
  font-size: 0.8rem !important;
  transition: background 0.2s !important;
}

.nav-cta:hover { background: #5e6e62 !important; }

/* ── HAMBURGER MENU ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px 4px;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--charcoal);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

body.nav-open .hamburger span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
body.nav-open .hamburger span:nth-child(2) {
  opacity: 0;
}
body.nav-open .hamburger span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-menu {
  display: none;
  position: fixed;
  inset: var(--nav-height) 0 0 0;
  background: var(--warm-white);
  z-index: 99;
  padding: 32px 24px;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  overflow-y: auto;
}

body.nav-open .mobile-menu {
  display: flex;
}

.mobile-menu a {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--charcoal);
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}

.mobile-menu a:hover { color: var(--sage); }

.mobile-menu a:last-child { border-bottom: none; }

.mobile-menu .btn-primary {
  margin-top: 16px;
  display: block;
  text-align: center;
}

/* ── HERO LABEL (pill badge) ── */
.hero-label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  border: 1px solid var(--sage);
  padding: 5px 14px;
  border-radius: 100px;
  margin-bottom: 28px;
}

/* ── HERO SUB TEXT ── */
.hero-sub {
  font-size: 1.05rem;
  font-weight: 300;
  color: var(--mid);
  max-width: 580px;
  margin: 0 auto 36px;
  line-height: 1.8;
}

/* ── HERO META (read time, etc.) ── */
.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 0.78rem;
  color: var(--light);
  flex-wrap: wrap;
}

.hero-meta span::before { content: '·'; margin-right: 20px; }
.hero-meta span:first-child::before { content: none; margin: 0; }

.hero-divider {
  width: 60px;
  height: 1px;
  background: var(--border);
  margin: 48px auto 0;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--amber);
  color: white;
  text-decoration: none;
  padding: 13px 28px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: #b07540;
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--sage);
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 8px;
  border: 1.5px solid var(--sage);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  letter-spacing: 0.01em;
}

.btn-secondary:hover {
  background: var(--sage);
  color: white;
  transform: translateY(-1px);
}

/* ── TRUST BAR ── */
.trust-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--mid);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.trust-bar span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trust-bar span::before {
  content: '✓';
  color: var(--sage);
  font-weight: 700;
}

/* ── FEATURE CARDS ── */
.feature-card {
  display: block;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  text-decoration: none;
  transition: all 0.2s;
}

.feature-card:hover {
  border-color: var(--sage);
  box-shadow: 0 6px 24px rgba(122, 140, 126, 0.14);
  transform: translateY(-3px);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
  display: block;
}

.feature-card h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 8px;
  line-height: 1.3;
}

.feature-card p {
  font-size: 0.84rem;
  color: var(--mid);
  line-height: 1.65;
  margin-bottom: 16px;
}

.card-link {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sage);
  text-decoration: none;
  letter-spacing: 0.03em;
}

/* ── BLOG CARDS ── */
.blog-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: all 0.2s;
}

.blog-card:hover {
  border-color: var(--sage);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.blog-category {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-light);
  padding: 3px 10px;
  border-radius: 100px;
}

.blog-read-time {
  font-size: 0.75rem;
  color: var(--light);
}

.blog-card h2,
.blog-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--charcoal);
  line-height: 1.3;
  margin-bottom: 10px;
}

.blog-card h2 { font-size: 1.15rem; }
.blog-card h3 { font-size: 1.1rem; }

.blog-card h2 a,
.blog-card h3 a {
  text-decoration: none;
  color: var(--charcoal);
  transition: color 0.2s;
}

.blog-card h2 a:hover,
.blog-card h3 a:hover { color: var(--sage); }

.blog-card p {
  font-size: 0.86rem;
  color: var(--mid);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* ── PROVIDER CARDS ── */
.providers-heading {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light);
  margin: 32px 0 14px;
}

.providers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.provider-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  background: white;
  transition: all 0.2s;
  position: relative;
}

.provider-card:hover {
  border-color: var(--sage);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

.provider-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-light);
  padding: 2px 7px;
  border-radius: 100px;
}

.provider-icon {
  font-size: 1.4rem;
  margin-bottom: 8px;
  display: block;
}

.provider-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--charcoal);
  margin-bottom: 3px;
}

.provider-desc {
  font-size: 0.74rem;
  color: var(--light);
  line-height: 1.5;
}

/* ── CHECKLIST ── */
.checklist {
  list-style: none;
  margin: 20px 0 28px;
}

.checklist li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.92rem;
  color: var(--charcoal);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.checklist li:last-child { border-bottom: none; }

.check-box {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.check-box:hover { border-color: var(--sage); }
.check-box.checked { background: var(--sage); border-color: var(--sage); }
.check-box.checked::after { content: '✓'; color: white; font-size: 11px; }

.checklist li.done .check-text { text-decoration: line-through; color: var(--light); }

/* ── CALLOUT ── */
.callout {
  background: var(--amber-light);
  border-left: 4px solid var(--amber);
  border-radius: 0 8px 8px 0;
  padding: 18px 22px;
  margin: 24px 0;
}

.callout-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}

.callout p {
  font-size: 0.88rem;
  color: var(--charcoal);
  margin: 0;
  line-height: 1.7;
}

.callout-sage {
  background: var(--sage-light);
  border-color: var(--sage);
}

.callout-sage .callout-label { color: var(--sage); }

/* ── FAQ ACCORDION ── */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.faq-q {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--charcoal);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.faq-q::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--sage);
  font-weight: 300;
  flex-shrink: 0;
  margin-left: 16px;
}

.faq-q.open::after { content: '−'; }

.faq-a {
  font-size: 0.9rem;
  color: var(--mid);
  line-height: 1.8;
  padding-top: 12px;
  display: none;
}

.faq-a.open { display: block; }

/* ── CTA BANNER ── */
.cta-banner {
  background: linear-gradient(135deg, #2C3830 0%, #3D5245 100%);
  padding: 60px 32px;
  text-align: center;
}

.cta-banner h2 {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 300;
  color: white;
  margin-bottom: 14px;
}

.cta-banner p {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.65);
  max-width: 460px;
  margin: 0 auto 28px;
}

.cta-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 440px;
  margin: 0 auto;
}

.cta-form input {
  flex: 1;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: white;
  font-family: var(--sans);
  font-size: 0.88rem;
  outline: none;
}

.cta-form input::placeholder { color: rgba(255,255,255,0.4); }

.cta-form button {
  padding: 12px 24px;
  background: var(--amber);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.cta-form button:hover { background: #b07540; }
.cta-form button:disabled { background: var(--light); cursor: default; }

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 48px 32px 40px;
  text-align: center;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.footer-logo {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--charcoal);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  list-style: none;
}

.footer-links a {
  font-size: 0.78rem;
  color: var(--light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--mid); }

.footer-disclaimer {
  font-size: 0.72rem;
  color: var(--light);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
}

/* ── BREADCRUMB ── */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--light);
  margin-bottom: 20px;
}

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

.breadcrumb a:hover { color: var(--sage); }

.breadcrumb span { margin: 0 6px; }

/* ── ARTICLE HERO ── */
.article-hero {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 56px 32px 40px;
}

.article-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 300;
  color: var(--charcoal);
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}

.article-hero h1 em {
  font-style: italic;
  color: var(--sage);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--light);
  flex-wrap: wrap;
}

.article-meta span { display: flex; align-items: center; }

/* ── ARTICLE LAYOUT (2-col: body + sidebar) ── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 56px;
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 0 32px 80px;
  align-items: start;
}

.article-body {
  min-width: 0;
}

.article-body h2 {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 400;
  color: var(--charcoal);
  line-height: 1.3;
  margin: 40px 0 14px;
}

.article-body h2:first-of-type { margin-top: 0; }

.article-body p {
  font-size: 0.95rem;
  color: var(--mid);
  line-height: 1.85;
  margin-bottom: 16px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 16px 20px;
}

.article-body li {
  font-size: 0.95rem;
  color: var(--mid);
  line-height: 1.8;
  margin-bottom: 6px;
}

.article-body strong { color: var(--charcoal); }

/* ── ARTICLE SIDEBAR ── */
.article-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 20px);
}

.sidebar-block {
  background: var(--section-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 20px;
}

.sidebar-block .toc-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 14px;
}

.sidebar-toc ol {
  list-style: none;
  counter-reset: toc-counter;
}

.sidebar-toc ol li {
  counter-increment: toc-counter;
  margin-bottom: 8px;
}

.sidebar-toc ol li a {
  font-size: 0.83rem;
  color: var(--mid);
  text-decoration: none;
  display: flex;
  gap: 8px;
  align-items: baseline;
  transition: color 0.2s;
  line-height: 1.4;
}

.sidebar-toc ol li a::before {
  content: counter(toc-counter);
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--border);
  flex-shrink: 0;
}

.sidebar-toc ol li a:hover,
.sidebar-toc ol li a.active { color: var(--sage); }

.sidebar-toc ol li a.active::before { color: var(--sage); }

.sidebar-related ul {
  list-style: none;
}

.sidebar-related ul li {
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
}

.sidebar-related ul li:last-child { border-bottom: none; }

.sidebar-related ul li a {
  font-size: 0.83rem;
  color: var(--mid);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.2s;
}

.sidebar-related ul li a:hover { color: var(--sage); }

.sidebar-cta { text-align: center; }

.sidebar-cta p {
  font-size: 0.84rem;
  color: var(--mid);
  margin-bottom: 14px;
  line-height: 1.6;
}

.sidebar-cta .btn-primary {
  width: 100%;
  text-align: center;
  font-size: 0.84rem;
  padding: 11px 16px;
}

/* ── INLINE TOC (mobile) ── */
.article-toc-inline {
  background: var(--section-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 36px;
  display: none;
}

.article-toc-inline .toc-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 14px;
}

.article-toc-inline ol {
  list-style: none;
  counter-reset: toc-inline;
}

.article-toc-inline ol li {
  counter-increment: toc-inline;
  margin-bottom: 8px;
}

.article-toc-inline ol li a {
  font-size: 0.85rem;
  color: var(--mid);
  text-decoration: none;
  display: flex;
  gap: 8px;
  align-items: baseline;
  transition: color 0.2s;
  line-height: 1.4;
}

.article-toc-inline ol li a::before {
  content: counter(toc-inline);
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--border);
  flex-shrink: 0;
}

.article-toc-inline ol li a:hover { color: var(--sage); }

/* ── RELATED ARTICLES ── */
.related-articles {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 48px 32px;
  border-top: 1px solid var(--border);
}

.related-articles h2 {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--charcoal);
  margin-bottom: 28px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

/* ── SECTION HEADER (blog preview, related, etc.) ── */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.section-header h2 {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 400;
  color: var(--charcoal);
}

.see-all-link {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sage);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.see-all-link:hover { color: var(--charcoal); }

/* ── FADE-IN ANIMATION ── */
.fade-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .article-sidebar { display: none; }
  .article-toc-inline { display: block; }
}

@media (max-width: 640px) {
  nav { padding: 0 20px; }
  .nav-links { display: none; }
  .hamburger { display: flex; }

  .hero-sub { font-size: 0.95rem; }

  .cta-banner { padding: 48px 20px; }
  .cta-form { flex-direction: column; }
  .cta-form button { width: 100%; }

  .providers-grid { grid-template-columns: 1fr 1fr; }

  footer { padding: 36px 20px; }

  .article-hero { padding: 40px 20px 28px; }
  .article-layout { padding: 0 20px 60px; }
  .related-articles { padding: 36px 20px; }

  .blog-grid { grid-template-columns: 1fr; }
}
