/* =========================================
   ToothCostGuide — Main Stylesheet
   toothcostguide.com  |  Clinical Clean theme
   ========================================= */

/* ---------- Reset & Variables ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:        #0D5C8A;
  --blue-light:  #1976B8;
  --blue-bg:     #EBF4FB;
  --blue-dark:   #083D5E;
  --orange:      #E8631A;
  --green:       #2E7D32;
  --yellow:      #F5B800;
  --dark:        #111827;
  --gray-700:    #374151;
  --gray-500:    #6B7280;
  --gray-300:    #D1D5DB;
  --gray-100:    #F9FAFB;
  --white:       #FFFFFF;
  --radius:      8px;
  --radius-lg:   16px;
  --shadow:      0 1px 8px rgba(0,0,0,.08);
  --shadow-md:   0 4px 20px rgba(0,0,0,.12);
  --font:        'Inter', 'Segoe UI', system-ui, sans-serif;
  --max-w:       1200px;
}

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

body {
  font-family: var(--font);
  color: var(--dark);
  background: var(--white);
  line-height: 1.7;
}

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

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.section    { padding: 60px 0; }
.section-sm { padding: 40px 0; }

/* ---------- Trust Bar ---------- */
.trust-bar {
  background: var(--blue-dark);
  color: var(--white);
  font-size: .82rem;
  padding: 8px 0;
  text-align: center;
  letter-spacing: .02em;
}
.trust-bar span { margin: 0 16px; opacity: .9; }
.trust-bar strong { opacity: 1; }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-300);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow .2s;
}
.site-header.scrolled {
  box-shadow: var(--shadow-md);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon {
  font-size: 28px;
  line-height: 1;
}
.logo-text {
  font-family: var(--font);
  font-size: 20px;
  font-weight: 600;
  color: var(--dark);
}
.logo-text strong { color: var(--blue); font-weight: 700; }

/* Nav */
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .92rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: background .2s, color .2s;
  white-space: nowrap;
}
.site-nav a:hover { background: var(--blue-bg); color: var(--blue); }
.site-nav a.active {
  background: var(--blue);
  color: var(--white);
}

/* Hamburger */
.btn-menu {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 4px; color: var(--dark);
}

/* Mobile nav open state */
@media (max-width: 768px) {
  .site-nav {
    display: none;
  }
  .site-nav.nav-open {
    display: flex; flex-direction: column;
    position: absolute; top: 68px; left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
    padding: 12px 20px 20px;
    box-shadow: var(--shadow-md);
    z-index: 999;
  }
  .btn-menu { display: block; }
}

/* ---------- Hero ---------- */
.hero-dental {
  background: linear-gradient(135deg, #EBF4FB 0%, #FFFFFF 100%);
  padding: 80px 0;
}
.hero-dental-inner {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.hero-dental-badge {
  display: inline-block;
  border: 1px solid var(--blue);
  color: var(--blue);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 24px;
}
.hero-dental h1 {
  font-family: var(--font);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--dark);
  line-height: 1.25;
  margin-bottom: 18px;
}
.hero-dental h1 em {
  color: var(--blue);
  font-style: normal;
}
.hero-dental > .hero-dental-inner > p {
  font-size: 1.1rem;
  color: var(--gray-500);
  max-width: 560px;
  margin: 0 auto 32px;
}
.hero-dental-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.btn-primary {
  display: inline-block;
  background: var(--blue);
  color: var(--white);
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: background .2s, transform .15s;
}
.btn-primary:hover { background: var(--blue-light); transform: translateY(-1px); }

.btn-outline {
  display: inline-block;
  background: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: .95rem;
  transition: background .2s, transform .15s;
}
.btn-outline:hover { background: var(--blue-bg); transform: translateY(-1px); }

.hero-dental-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-dental-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-dental-stats strong {
  font-size: 24px;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.2;
}
.hero-dental-stats span {
  font-size: 12px;
  color: var(--gray-500);
  margin-top: 2px;
}

/* ---------- Sections ---------- */
.categories-section { padding: 64px 0; }
.popular-section    { padding: 64px 0; background: var(--gray-100); }
.latest-section     { padding: 64px 0; }

.section-title {
  font-family: var(--font);
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 24px;
}
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.section-header-row .section-title { margin-bottom: 0; }
.view-all-link {
  font-size: 14px;
  color: var(--blue);
  font-weight: 500;
  transition: text-decoration .1s;
}
.view-all-link:hover { text-decoration: underline; }

/* ---------- Category Grid ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.cat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: 12px;
  padding: 20px;
  transition: border-color .2s, box-shadow .2s;
  cursor: pointer;
}
.cat-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-md);
}
.cat-card-icon {
  font-size: 32px;
  width: 52px;
  flex-shrink: 0;
  text-align: center;
}
.cat-card-body { flex: 1; min-width: 0; }
.cat-card-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
}
.cat-card-body p {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0;
  line-height: 1.4;
}
.cat-card-arrow {
  color: var(--gray-300);
  flex-shrink: 0;
  margin-left: auto;
  transition: color .2s;
}
.cat-card:hover .cat-card-arrow { color: var(--blue); }

/* ---------- Popular Grid ---------- */
.popular-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.popular-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--white);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}
.popular-card:hover { box-shadow: var(--shadow-md); }
.popular-card-icon {
  font-size: 28px;
  flex-shrink: 0;
  line-height: 1;
}
.popular-card-body h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
  line-height: 1.4;
}
.popular-card-body h3 a { color: var(--dark); }
.popular-card-body h3 a:hover { color: var(--blue); }
.popular-card-body p {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0 0 8px;
}

/* ---------- Guides 2-col Grid ---------- */
.guides-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.mt-32 { margin-top: 32px; }

/* ---------- Guide Card ---------- */
.guide-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 12px;
  padding: 20px;
  transition: border-color .2s, box-shadow .2s;
}
.guide-card:hover {
  border-color: var(--blue-bg);
  box-shadow: var(--shadow);
}
.guide-card-icon {
  font-size: 32px;
  flex-shrink: 0;
  width: 48px;
  text-align: center;
  line-height: 1;
}
.guide-card-body { flex: 1; min-width: 0; }
.guide-card-tags { margin-bottom: 6px; }
.guide-card-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  line-height: 1.4;
}
.guide-card-body h3 a { color: var(--dark); }
.guide-card-body h3 a:hover { color: var(--blue); }
.guide-card-body p {
  font-size: 14px;
  color: var(--gray-500);
  margin: 0;
  line-height: 1.5;
}
.guide-card-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--gray-500);
  flex-wrap: wrap;
}
.guide-card-arrow {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--gray-300);
  align-self: center;
}
.guide-card:hover .guide-card-arrow { color: var(--blue); }

/* ---------- Tag Pills ---------- */
.tag-pill {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  margin-bottom: 0;
  margin-right: 4px;
}
.tag-procedures      { background: #EBF4FB; color: #0D5C8A; }
.tag-dental-insurance{ background: #FFF3E0; color: #E65100; }
.tag-orthodontics    { background: #F3E5F5; color: #6A1B9A; }
.tag-save-money      { background: #E8F5E9; color: #2E7D32; }
.tag-emergency       { background: #FFEBEE; color: #C62828; }
.tag-diagnostics     { background: #E3F2FD; color: #1565C0; }

/* ---------- Reviewed Badge ---------- */
.reviewed-badge {
  font-size: 11px;
  color: var(--green);
  font-weight: 500;
}
.vet-reviewed-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-bg);
  border: 1px solid #b7d4ea;
  color: var(--blue);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: .78rem;
  font-weight: 700;
  margin-left: auto;
}

/* ---------- Ad Slots ---------- */
.ad-slot-banner {
  text-align: center;
  margin: 32px 0;
  padding: 16px;
  background: var(--gray-100);
  border-radius: var(--radius);
}
.ad-slot-inline {
  text-align: center;
  margin: 32px 0;
  padding: 16px;
  background: var(--gray-100);
  border-radius: var(--radius);
}
/* Legacy ad-banner classes from partial */
.ad-banner {
  background: var(--gray-100);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  font-size: .78rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.ad-banner-leaderboard { height: 90px; }
.ad-banner-rectangle   { height: 250px; }
.ad-banner-inline      { height: 120px; margin: 32px 0; }

/* ---------- List Page ---------- */
.list-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--gray-100);
  margin-bottom: 32px;
}
.list-header h1 {
  font-family: var(--font);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}
.list-desc {
  font-size: .95rem;
  color: var(--gray-500);
}

/* ---------- Article Page ---------- */
.article-header {
  background: var(--white);
  padding: 40px 0 0;
}

.article-layout {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 20px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--gray-500);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--blue); }
.breadcrumb svg { width: 12px; height: 12px; }

.article-category-tag {
  display: inline-block;
  background: var(--blue-bg);
  color: var(--blue);
  border-radius: 4px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 10px;
  margin-bottom: 14px;
}

.article-title {
  font-family: var(--font);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.3;
  max-width: 800px;
  margin-bottom: 18px;
  color: var(--dark);
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--gray-500);
  padding: 16px 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

.author-chip { display: flex; align-items: center; gap: 8px; }
.author-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: var(--blue);
  flex-shrink: 0;
}
.author-chip strong { color: var(--dark); font-weight: 600; font-size: .88rem; }
.meta-divider { color: var(--gray-300); }

/* Article featured image / icon placeholder */
.article-featured-img {
  width: 100%;
  aspect-ratio: 21/9;
  background: linear-gradient(135deg, var(--blue-bg) 0%, #ddeef8 100%);
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem;
  margin-top: 24px;
}

/* Infographic */
.article-infographic {
  margin-top: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.infographic-img {
  width: 100%; height: auto; display: block;
}

/* ---------- Article Body ---------- */
.article-body {
  max-width: 780px;
}
.article-body h2 {
  font-family: var(--font);
  font-size: 1.55rem;
  font-weight: 700;
  margin: 36px 0 14px;
  color: var(--dark);
}
.article-body h3 {
  font-family: var(--font);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 28px 0 10px;
  color: var(--dark);
}
.article-body p  { margin-bottom: 18px; font-size: 1.05rem; color: var(--gray-700); }
.article-body ul,
.article-body ol {
  margin: 0 0 18px 0;
  padding-left: 22px;
  color: var(--gray-700);
  font-size: 1.05rem;
}
.article-body li { margin-bottom: 8px; list-style: disc; }
.article-body ol li { list-style: decimal; }

/* ---------- YMYL Disclaimer ---------- */
.ymyl-disclaimer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #FFF8E1;
  border: 1px solid var(--blue-light);
  border-left: 4px solid var(--blue-light);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
  font-size: 0.875rem;
  color: #1a3a50;
  line-height: 1.6;
}
.ymyl-disclaimer svg { flex-shrink: 0; margin-top: 2px; color: var(--blue-light); }
.ymyl-disclaimer strong { color: var(--blue-dark); }

/* ---------- Key Box ---------- */
.key-box {
  background: var(--blue-bg);
  border-left: 4px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px;
  margin: 24px 0;
}
.key-box strong {
  display: block;
  color: var(--blue);
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.key-box p { margin: 0; font-size: .98rem; }

/* ---------- Warn Box ---------- */
.warn-box {
  background: #FFF8E7;
  border-left: 4px solid var(--yellow);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px;
  margin: 24px 0;
}
.warn-box strong {
  display: block;
  color: #92600A;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.warn-box p { margin: 0; font-size: .98rem; color: #6B4A0D; }

/* ---------- Cost Table ---------- */
.cost-table-wrap { overflow-x: auto; margin: 24px 0; }
.cost-table-wrap table,
.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.cost-table-wrap table th,
.cost-table th {
  background: var(--blue-bg);
  color: var(--blue-dark);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
}
.cost-table-wrap table td,
.cost-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
}
.cost-table-wrap table tr:hover td,
.cost-table tr:hover td {
  background: var(--gray-100);
}
.cost-table td:last-child { font-weight: 600; color: var(--blue); }

/* ---------- TOC ---------- */
.toc {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
}
.toc h4 { font-size: .9rem; font-weight: 700; margin-bottom: 12px; color: var(--dark); }
.toc ol { padding-left: 18px; margin: 0; }
.toc li { margin-bottom: 6px; }
.toc a { color: var(--blue); font-size: .9rem; }
.toc a:hover { text-decoration: underline; }

/* ---------- Author Bio ---------- */
.author-bio {
  display: flex;
  gap: 20px;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 48px;
}
.author-bio-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--blue-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; flex-shrink: 0;
}
.author-bio h4 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.author-bio .role { font-size: .8rem; color: var(--blue); font-weight: 600; margin-bottom: 8px; }
.author-bio p { font-size: .88rem; color: var(--gray-500); margin: 0; }

/* ---------- Related Articles ---------- */
.related-section {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 2px solid var(--gray-100);
}
.related-section h3 {
  font-family: var(--font);
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 20px;
}
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.related-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.related-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.related-card .card-img {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--blue-bg), #ddeef8);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.related-card .card-body { padding: 14px; }
.related-card h4 { font-size: .9rem; font-weight: 700; line-height: 1.4; }
.related-card h4 a { color: var(--dark); }
.related-card h4 a:hover { color: var(--blue); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--blue-dark);
  color: #D1D5DB;
  padding: 60px 0 0;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand .logo-text { color: var(--white); font-size: 1.2rem; }
.footer-brand .logo-text strong { color: #7EC8F0; }
.footer-brand p { font-size: .88rem; opacity: .65; margin-top: 12px; line-height: 1.6; }
.footer-trust { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.footer-trust-badge {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: .72rem;
  color: #9CA3AF;
}
.footer-col h4 {
  color: var(--white);
  font-size: .88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { font-size: .88rem; opacity: .7; transition: opacity .2s; }
.footer-col a:hover { opacity: 1; color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  opacity: .5;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Reading Progress Bar ---------- */
#reading-progress {
  position: fixed; top: 0; left: 0; height: 3px;
  background: var(--blue); width: 0%;
  z-index: 9999; transition: width .1s linear;
}

/* ---------- Utility ---------- */
.text-center  { text-align: center; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8  { margin-bottom: 8px; }
.mb-24 { margin-bottom: 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .category-grid    { grid-template-columns: 1fr; }
  .guides-grid-2col { grid-template-columns: 1fr; }
  .popular-grid     { grid-template-columns: 1fr; }
  .hero-dental-stats { flex-wrap: wrap; gap: 16px; }
  .hero-dental { padding: 48px 0; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .article-title { font-size: 1.7rem; }
  .author-bio { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section-header-row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 480px) {
  .related-grid { grid-template-columns: 1fr; }
  .footer-grid  { grid-template-columns: 1fr; }
  .hero-dental-stats { gap: 12px; }
  .article-title { font-size: 1.45rem; }
}
