/* =========================================================
   DentalWise — style.css
   Mobile-first, responsive, no external dependencies.
   ========================================================= */

:root {
  --primary: #0e7490;
  --primary-dark: #155e75;
  --primary-600: #0891b2;
  --primary-50: #ecfeff;
  --accent: #0d9488;
  --accent-50: #f0fdfa;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --white: #ffffff;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --maxw: 1120px;
}

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

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

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.brand-logo {
  height: 34px;
  width: auto;
  display: block;
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary-600), var(--accent));
  color: #fff;
  flex: none;
}

.brand .mark svg {
  width: 20px;
  height: 20px;
}

.brand em {
  font-style: normal;
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--primary-50);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg);
  border-radius: 9px;
  cursor: pointer;
  place-items: center;
}

.nav-toggle svg {
  width: 22px;
  height: 22px;
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(160deg, #f0f9ff 0%, #ecfeff 45%, #f0fdfa 100%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding-top: 48px;
  padding-bottom: 40px;
}

.hero-inner > * {
  min-width: 0;
}

.hero-img {
  width: 100%;
  height: auto;
}

.hero h1 {
  font-size: clamp(1.7rem, 4.4vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 800;
  max-width: 20ch;
}

.hero h1 span {
  color: var(--primary);
}

.hero p.lead {
  margin-top: 14px;
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 56ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 28px;
}

.hero-stats .stat {
  display: flex;
  flex-direction: column;
}

.hero-stats .stat strong {
  font-size: 1.4rem;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.hero-stats .stat span {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--primary-600);
  color: var(--primary);
}

/* ---------- Section scaffolding ---------- */
.section {
  padding-top: 40px;
  padding-bottom: 40px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  letter-spacing: -0.02em;
  font-weight: 750;
}

.section-head .more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.section-head .more:hover {
  text-decoration: underline;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s, box-shadow 0.16s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card .thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e2e8f0;
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s;
}

.card:hover .thumb img {
  transform: scale(1.04);
}

.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px;
}

.card .cat {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-50);
  padding: 4px 9px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.card h3 {
  font-size: 1.08rem;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.card h3 a:hover {
  color: var(--primary);
}

.card p {
  color: var(--muted);
  font-size: 0.93rem;
  flex: 1;
}

.card .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--muted);
}

.card .meta .dot {
  color: var(--line);
}

/* Horizontal (featured) card variant */
.card-horizontal {
  flex-direction: row;
}

.card-horizontal .thumb {
  flex: 0 0 40%;
  aspect-ratio: auto;
  min-height: 100%;
}

.card-horizontal .card-body {
  justify-content: center;
}

/* ---------- Category tiles ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.cat-tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 130px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
}

.cat-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  transition: transform 0.4s;
}

.cat-tile:hover img {
  transform: scale(1.05);
}

.cat-tile .overlay {
  position: relative;
  z-index: 1;
  display: block;
  padding: 16px;
  width: 100%;
  color: #fff;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.75), transparent);
}

.cat-tile .overlay strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
}

.cat-tile .overlay span {
  font-size: 0.78rem;
  opacity: 0.9;
}

/* ---------- Newsletter / CTA ---------- */
.newsletter {
  background: var(--primary-dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 34px 26px;
  display: grid;
  gap: 16px;
}

.newsletter h2 {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.newsletter p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
}

.newsletter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.newsletter-form input {
  flex: 1;
  min-width: 200px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-family: inherit;
}

.newsletter-form input:focus {
  outline: 2px solid var(--accent);
}

.newsletter-form .btn {
  background: #fff;
  color: var(--primary-dark);
}

/* ---------- Article detail ---------- */
.article-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 24px 0 12px;
}

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

.article-hero {
  margin-bottom: 8px;
}

.article-hero .cat {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-50);
  padding: 5px 10px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.article-hero h1 {
  font-size: clamp(1.6rem, 4.6vw, 2.4rem);
  line-height: 1.18;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 16px 0 22px;
  font-size: 0.88rem;
  color: var(--muted);
}

.article-cover {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.prose {
  font-size: 1.06rem;
  line-height: 1.75;
  color: #1e293b;
}

.prose p {
  margin-bottom: 1.2em;
}

.prose h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  font-weight: 750;
  margin: 1.6em 0 0.6em;
  color: var(--ink);
}

.prose ul {
  margin: 0 0 1.3em 1.3em;
}

.prose li {
  margin-bottom: 0.5em;
  padding-left: 4px;
}

.prose strong {
  color: var(--ink);
}

.prose a {
  color: var(--primary);
  text-decoration: underline;
}

.note {
  background: var(--accent-50);
  border-left: 4px solid var(--accent);
  padding: 16px 18px;
  border-radius: 0 10px 10px 0;
  margin: 1.4em 0;
  font-size: 0.98rem;
  color: #134e4a;
}

.article-footer {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.article-footer .btn {
  font-size: 0.9rem;
}

/* ---------- Related ---------- */
.related {
  padding-top: 32px;
  padding-bottom: 56px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0b1220;
  color: #cbd5e1;
  padding: 44px 0 28px;
  margin-top: 20px;
}

.footer-grid {
  display: grid;
  gap: 28px;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  font-size: 0.9rem;
  padding: 4px 0;
  color: #94a3b8;
}

.footer-col a:hover {
  color: #fff;
}

.footer-brand .brand {
  color: #fff;
  margin-bottom: 10px;
}

.footer-brand p {
  font-size: 0.88rem;
  color: #94a3b8;
  max-width: 34ch;
}

.footer-bottom {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #1e293b;
  font-size: 0.82rem;
  color: #64748b;
}

.disclaimer {
  background: #fff7ed;
  color: #9a3412;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.84rem;
  line-height: 1.55;
  margin: 20px 0;
}

/* ---------- Search ---------- */
.search {
  display: flex;
  gap: 10px;
  max-width: 480px;
}

.search input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
}

.search input:focus {
  outline: 2px solid var(--primary-600);
  border-color: transparent;
}

/* ---------- Responsive: tablet & desktop ---------- */
@media (min-width: 640px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cat-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .newsletter {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 40px 44px;
  }

  .newsletter-form {
    flex: none;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: center;
    padding-top: 64px;
    padding-bottom: 56px;
  }

  .card-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- Mobile & tablet navigation ---------- */
@media (max-width: 1099px) {
  .nav-toggle {
    display: grid;
  }

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 16px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 12px;
    border-radius: 8px;
  }

  .card-horizontal {
    flex-direction: column;
  }

  .card-horizontal .thumb {
    aspect-ratio: 16 / 9;
    flex: none;
  }
}
