/* ============================================================
   Wise Dental Core — base layer
   Reset, typography, layout primitives, fallback header/footer.
   Everything consumes tokens; nothing here is widget-specific.
   ============================================================ */

/* --- Minimal reset ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--wdc-bg);
  color: var(--wdc-text);
  font-family: var(--wdc-font-body);
  font-size: var(--wdc-fs-body);
  font-weight: var(--wdc-weight-body);
  line-height: var(--wdc-lh-body);
  -webkit-font-smoothing: antialiased;
}
img, video, svg { max-width: 100%; height: auto; display: block; }

/* --- Typography ---------------------------------------------- */
h1, h2, h3 {
  font-family: var(--wdc-font-display);
  font-weight: var(--wdc-weight-display);
  line-height: var(--wdc-lh-heading);
  letter-spacing: var(--wdc-tracking-display);
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: var(--wdc-fs-h1); }
h2 { font-size: var(--wdc-fs-h2); }
h3 { font-size: var(--wdc-fs-h3); }
h4, h5, h6 {
  font-family: var(--wdc-font-body);
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.5em;
}
h4 { font-size: var(--wdc-fs-h4); }
h5 { font-size: var(--wdc-fs-h5); }
h6 { font-size: var(--wdc-fs-h6); }
p { margin: 0 0 1em; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--wdc-primary); }

/* --- Accessibility primitives -------------------------------- */
:focus-visible {
  outline: 2px solid var(--wdc-focus);
  outline-offset: 3px;
  border-radius: 2px;
}
.wdc-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: calc(var(--wdc-z-modal) + 1);
  background: var(--wdc-text);
  color: var(--wdc-text-inverse);
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--wdc-radius-md) 0;
  text-decoration: none;
}
.wdc-skip-link:focus { left: 0; }
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

/* --- Layout primitives ---------------------------------------- */
.wdc-container {
  width: min(var(--wdc-container), 100% - 2 * var(--wdc-gutter));
  margin-inline: auto;
}
.wdc-section { padding-block: var(--wdc-section-space); }
#wdc-content { display: block; }

/* Non-Elementor content (blog posts, legal pages) gets readable width. */
.wdc-entry {
  width: min(var(--wdc-container-narrow), 100% - 2 * var(--wdc-gutter));
  margin-inline: auto;
  padding-block: var(--wdc-section-space-sm);
}

/* --- Fallback header (used until a header template is assigned) */
.wdc-fb-header {
  position: sticky;
  top: 0;
  z-index: var(--wdc-z-header);
  min-height: var(--wdc-header-height);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--wdc-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--wdc-border);
}
.wdc-fb-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  width: 100%;
}
.wdc-fb-header__brand {
  font-family: var(--wdc-font-display);
  font-size: 1.25rem;
  font-weight: 600;
  text-decoration: none;
}
.wdc-fb-header__brand img { max-height: 44px; width: auto; }
.wdc-fb-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.wdc-fb-nav a {
  text-decoration: none;
  font-size: var(--wdc-fs-small);
  font-weight: 500;
  color: var(--wdc-muted);
}
.wdc-fb-nav a:hover, .wdc-fb-nav .current-menu-item > a { color: var(--wdc-text); }
.wdc-fb-header__cta {
  display: inline-block;
  background: var(--wdc-primary);
  color: var(--wdc-text-inverse);
  border-radius: var(--wdc-button-radius);
  padding: 0.65rem 1.4rem;
  font-size: var(--wdc-fs-small);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--wdc-dur-fast) var(--wdc-ease), background var(--wdc-dur-fast) var(--wdc-ease);
}
.wdc-fb-header__cta:hover { background: var(--wdc-secondary); color: var(--wdc-text-inverse); transform: translateY(-1px); }
@media (max-width: 880px) {
  .wdc-fb-nav { display: none; } /* fallback header stays minimal; real headers come from the library */
}

/* --- Fallback footer ------------------------------------------ */
.wdc-fb-footer {
  background: var(--wdc-bg-inverse);
  color: var(--wdc-text-inverse);
  padding-block: var(--wdc-section-space-sm);
  margin-top: var(--wdc-section-space-sm);
}
.wdc-fb-footer a { color: inherit; }
.wdc-fb-footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-size: var(--wdc-fs-small);
  opacity: 0.85;
}

/* --- Archive / post cards (non-Elementor fallback) ------------- */
.wdc-post-list {
  display: grid;
  gap: var(--wdc-grid-gap);
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  width: min(var(--wdc-container), 100% - 2 * var(--wdc-gutter));
  margin-inline: auto;
  padding-block: var(--wdc-section-space-sm);
}
.wdc-post-card {
  background: var(--wdc-surface);
  border: 1px solid var(--wdc-border);
  border-radius: var(--wdc-card-radius);
  overflow: hidden;
  box-shadow: var(--wdc-shadow-soft);
}
.wdc-post-card__body { padding: 1.5rem; }
.wdc-post-card img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.wdc-post-card h2 { font-size: var(--wdc-fs-h4); }
.wdc-post-card a { text-decoration: none; }
