/* ==========================================================================
   Digital Maheshwari — Base / Reset / Typography
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--dm-paper);
  color: var(--dm-text);
  font-family: var(--dm-font-body);
  font-size: var(--dm-body);
  line-height: var(--dm-lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; display: block; }
img { height: auto; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--dm-font-display);
  font-weight: 600;
  line-height: var(--dm-lh-tight);
  letter-spacing: var(--dm-tracking-tight);
  color: var(--dm-ink);
  margin: 0 0 var(--dm-space-4);
}
h1 { font-size: var(--dm-h1); }
h2 { font-size: var(--dm-h2); }
h3 { font-size: var(--dm-h3); }
h4 { font-size: var(--dm-h4); font-family: var(--dm-font-body); font-weight: 700; }

p { margin: 0 0 var(--dm-space-4); color: var(--dm-text); }
p.lead, .lead { font-size: var(--dm-body-lg); color: var(--dm-text-muted); }
.lead p:last-child { margin-bottom: 0; }

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

ul, ol { margin: 0; padding: 0; list-style: none; }

/* ---- Rich text content blocks ----
   Admin-authored long-form HTML (blog post content, page "About Content"
   section, service "body" content) is rendered raw, wherever it appears —
   the list/heading resets above are meant for the site's own hand-built
   components (cards, nav, etc.), not for prose an admin typed in the rich
   text editor. Anything using that editor's toolbar (H2–H4, bold/italic,
   links, bulleted/numbered lists, blockquote) needs its own readable
   defaults, scoped to this class so it never fights the rest of the site. */
.richtext { color: var(--dm-text); }
.richtext > *:first-child { margin-top: 0; }
.richtext > *:last-child { margin-bottom: 0; }
.richtext h2 {
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);
  margin-top: var(--dm-space-8);
  margin-bottom: var(--dm-space-4);
}
.richtext h3 {
  font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.5rem);
  margin-top: var(--dm-space-6);
  margin-bottom: var(--dm-space-3);
}
.richtext h4 { margin-top: var(--dm-space-5); margin-bottom: var(--dm-space-2); }
.richtext p { margin-bottom: var(--dm-space-4); }
.richtext ul, .richtext ol {
  margin: 0 0 var(--dm-space-5);
  padding-left: 1.35em;
}
.richtext ul { list-style: disc; }
.richtext ol { list-style: decimal; }
.richtext li { margin-bottom: var(--dm-space-2); color: var(--dm-text); }
.richtext li::marker { color: var(--dm-gold-dark); }
.richtext a { color: var(--dm-gold-dark); text-decoration: underline; text-underline-offset: 0.15em; }
.richtext strong { font-weight: 700; }
.richtext blockquote {
  margin: var(--dm-space-6) 0;
  padding: var(--dm-space-4) var(--dm-space-5);
  border-left: 3px solid var(--dm-gold);
  background: var(--dm-surface-alt);
  color: var(--dm-text-muted);
  font-size: var(--dm-body-lg);
}
.richtext blockquote p:last-child { margin-bottom: 0; }
.richtext img { border-radius: var(--dm-radius, 10px); margin-block: var(--dm-space-5); }
.richtext table { margin: var(--dm-space-5) 0 var(--dm-space-6); font-size: var(--dm-body-sm); display: block; overflow-x: auto; }
.richtext th, .richtext td { border: 1px solid var(--dm-border); padding: 0.6em 0.8em; text-align: left; vertical-align: top; }
.richtext th { background: var(--dm-surface-alt); font-weight: 700; }
.richtext hr { border: 0; border-top: 1px solid var(--dm-border); margin: var(--dm-space-7) 0; }
/* FAQ blocks from the blog editor: <details><summary>Question</summary><p>Answer</p></details> */
.richtext details { border: 1px solid var(--dm-border); border-radius: var(--dm-radius-sm, 8px); margin: 0 0 var(--dm-space-3); background: var(--dm-surface); }
.richtext summary { cursor: pointer; padding: var(--dm-space-4) var(--dm-space-5); font-weight: 700; color: var(--dm-ink); list-style-position: inside; }
.richtext details[open] summary { border-bottom: 1px solid var(--dm-border); }
.richtext details > :not(summary) { margin: var(--dm-space-4) var(--dm-space-5); }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

table { border-collapse: collapse; width: 100%; }

/* ---- Accessibility ---- */
:focus-visible {
  outline: 2px solid var(--dm-gold-dark);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--dm-ink);
  color: var(--dm-text-inverse);
  padding: var(--dm-space-3) var(--dm-space-5);
  z-index: var(--dm-z-toast);
  border-radius: 0 0 var(--dm-radius) 0;
}
.skip-link:focus {
  left: 0;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Selection ---- */
::selection { background: var(--dm-gold); color: var(--dm-ink); }
