/* ============================================================
   McArthur MD — Main Stylesheet v1.1
   William McArthur, MD | Evidence-Based Health Insights
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,300;1,8..60,400&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  --navy:       #0f1f3d;
  --navy-light: #1a3260;
  --teal:       #0d7c6e;
  --teal-light: #e6f4f2;
  --gold:       #c8963e;
  --cream:      #faf8f4;
  --text:       #1a1a2e;
  --text-body:  #2d2d3d;
  --muted:      #6b7280;
  --border:     #e5e0d8;
  --white:      #ffffff;
  --shadow:     0 8px 40px rgba(0,0,0,0.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

html, body {
  font-family: 'Source Serif 4', Georgia, serif;
  background: var(--cream) !important;
  color: var(--text);
  line-height: 1.8;
  font-size: 18px;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--navy); }

/* ── READING PROGRESS BAR ── */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ── SITE HEADER ── */
#masthead {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.site-branding { display: flex; flex-direction: column; justify-content: center; }
.site-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.site-title .md-credential { color: var(--gold); font-style: italic; }
.site-description {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-top: 2px;
}

#primary-navigation ul { list-style: none; display: flex; gap: 2rem; }
#primary-navigation ul li a {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s;
}
#primary-navigation ul li a:hover,
#primary-navigation ul li.current-menu-item a { color: var(--gold); }

.menu-toggle {
  display: none;
  background: none;
  border: 1.5px solid rgba(255,255,255,0.3);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
}

/* ── BLOG INDEX ── */
#primary {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2.5rem;
}
.post-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
  transition: transform 0.25s, box-shadow 0.25s;
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.13); }
.post-card-thumb { width: 100%; height: 220px; object-fit: cover; }
.post-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.post-card-category {
  display: inline-block;
  align-self: flex-start;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--teal);
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  margin-bottom: 0.8rem;
}
.post-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 0.75rem;
  flex: 1;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--teal); }
.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 1.2rem;
  font-family: 'DM Sans', sans-serif;
}
.post-card-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: auto;
}

/* ── SINGLE POST ── */
.single #primary { max-width: 100%; padding: 0; }
.article-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}
.post-category-tag {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--teal);
  padding: 0.3rem 0.8rem;
  border-radius: 2px;
  margin-bottom: 1.2rem;
}
.entry-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.2;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.entry-meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  margin-bottom: 2.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  color: var(--muted);
}
.meta-author { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; color: var(--text); }
.author-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--navy));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 0.7rem; font-weight: 700;
  font-family: 'DM Sans', sans-serif; flex-shrink: 0;
}
.meta-dot { color: var(--border); }

/* ── ENTRY CONTENT ── */
.entry-content {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--text-body);
}
.entry-content p { margin-bottom: 1.6rem; }
.entry-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 700;
  color: var(--navy);
  margin: 3rem 0 1.2rem;
  padding-left: 1.2rem;
  border-left: 4px solid var(--teal);
  line-height: 1.3;
}
.entry-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem; font-weight: 700;
  color: var(--navy); margin: 2rem 0 0.8rem;
}
.entry-content strong { font-weight: 600; color: var(--navy); }
.entry-content em { font-style: italic; color: var(--navy); }

/* ── CONTENT IMAGES ── */
.entry-content img {
  width: 100%;
  height: 400px !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 6px;
  margin: 0.5rem 0 2rem;
  box-shadow: var(--shadow);
  display: block;
}

/* ── ORDERED LIST with teal circle numbers ── */
.entry-content ol {
  list-style: none !important;
  counter-reset: mcarthur-counter;
  margin: 0.5rem 0 1.8rem 0 !important;
  padding: 0 !important;
}
.entry-content ol li {
  counter-increment: mcarthur-counter;
  display: flex !important;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem !important;
  line-height: 1.7;
  font-size: 1.05rem;
  padding-left: 0 !important;
}
.entry-content ol li::before {
  content: counter(mcarthur-counter);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  background: var(--teal);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.18rem;
}
.entry-content ol li::marker { content: none !important; }

/* ── UNORDERED LIST ── */
.entry-content ul {
  margin: 0.5rem 0 1.8rem 1.5rem;
  padding: 0;
}
.entry-content ul li { margin-bottom: 0.5rem; line-height: 1.7; }
.entry-content ul li::marker { color: var(--teal); }

/* ── BLOCKQUOTE ── */
.entry-content blockquote {
  margin: 2.5rem -1rem;
  padding: 2rem 2.5rem;
  background: var(--teal-light);
  border-left: 5px solid var(--teal);
  border-radius: 0 8px 8px 0;
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--navy);
  line-height: 1.6;
}

/* ── POST FOOTER TAGS ── */
.entry-footer {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.entry-footer .tags-label { font-weight: 600; color: var(--text); }
.tag-pill {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--muted);
  transition: all 0.2s;
}
.tag-pill:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-light); }

/* ── SITE FOOTER ── */
#colophon {
  background: var(--navy);
  color: rgba(255,255,255,0.45);
  text-align: center;
  padding: 2.5rem 2rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  line-height: 1.9;
}
#colophon strong { color: var(--gold); }
#colophon a { color: rgba(255,255,255,0.6); }
#colophon a:hover { color: var(--gold); }

/* ── PAGINATION ── */
.pagination {
  display: flex; justify-content: center;
  gap: 0.5rem; margin-top: 3rem;
  font-family: 'DM Sans', sans-serif;
}
.pagination .page-numbers {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  color: var(--muted); font-size: 0.85rem;
  transition: all 0.2s;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover { background: var(--teal); border-color: var(--teal); color: white; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  #primary-navigation { display: none; }
  #primary-navigation.is-open { display: block; }
  #primary-navigation.is-open ul {
    flex-direction: column;
    padding: 1rem 2rem 1.5rem;
    gap: 1rem;
    background: var(--navy-light);
  }
  .menu-toggle { display: block; }
  .header-inner { height: 64px; }
  .posts-grid { grid-template-columns: 1fr; }
  .article-container { padding: 2rem 1.25rem 4rem; }
  .entry-content blockquote { margin: 2rem 0; }
  .entry-content img { height: 250px; }
}

/* ── WORDPRESS FIGURE BLOCKS ── */
.entry-content figure.wp-block-image {
  margin: 0.5rem 0 2rem !important;
}
.entry-content figure.wp-block-image img {
  width: 100% !important;
  height: 400px !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 6px;
  box-shadow: var(--shadow);
}

/* ── NUCLEAR LIST FIX — beats wp-block-library ── */
body .entry-content ol,
body .single .entry-content ol {
  list-style: none !important;
  counter-reset: mcarthur-counter !important;
  margin: 0.5rem 0 1.8rem 0 !important;
  padding: 0 !important;
}
body .entry-content ol li,
body .single .entry-content ol li {
  counter-increment: mcarthur-counter !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 1rem !important;
  margin-bottom: 0.85rem !important;
  padding-left: 0 !important;
  list-style: none !important;
}
body .entry-content ol li::before,
body .single .entry-content ol li::before {
  content: counter(mcarthur-counter) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 28px !important;
  width: 28px !important;
  height: 28px !important;
  background: var(--teal) !important;
  color: white !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  margin-top: 0.18rem !important;
}
body .entry-content ol li::marker {
  content: none !important;
  display: none !important;
}

/* ── FORCE FIGURE BLOCKS TO FILL WIDTH ── */
body .entry-content figure,
body .entry-content figure.wp-block-image,
body .entry-content figure.wp-block-image.size-large,
body .entry-content figure.wp-block-image.size-full {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0.5rem 0 2rem !important;
  padding: 0 !important;
}
body .entry-content figure img,
body .entry-content figure.wp-block-image img {
  width: 100% !important;
  height: 420px !important;
  object-fit: cover !important;
  object-position: center top !important;
  border-radius: 6px !important;
  box-shadow: var(--shadow) !important;
  display: block !important;
}

/* ── FORCE CIRCLE BADGES ON LIST ── */
body .entry-content ol li::before {
  content: counter(mcarthur-counter) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 28px !important;
  width: 28px !important;
  height: 28px !important;
  background: #0d7c6e !important;
  color: #ffffff !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 0.75rem !important;
  font-weight: 700 !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
  margin-top: 0.18rem !important;
  box-sizing: border-box !important;
}

/* ── FIX CATEGORY TAG WIDTH ON CARDS ── */
.post-card-body {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
}
