/* ==========================================================================
   Funeraire 360 — Modern CSS Reset
   Normalizes browser defaults for consistent cross-browser rendering.
   ========================================================================== */

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

/* Remove default margins and padding */
* {
  margin: 0;
  padding: 0;
}

/* Prevent font size inflation on mobile */
html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Set core body defaults */
body {
  min-height: 100vh;
  min-height: 100dvh;
  line-height: var(--line-height-base, 1.5);
  font-family: var(--font-family, sans-serif);
  font-size: var(--font-size-base, 16px);
  color: var(--color-text, #2D3748);
  background-color: var(--color-bg, #F5F6FA);
  text-rendering: optimizeLegibility;
}

/* Remove default list styles */
ul,
ol {
  list-style: none;
}

/* Headings and interactive elements inherit font */
h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* Remove button styling */
button {
  cursor: pointer;
  background: none;
  border: none;
}

/* Avoid text overflows */
h1, h2, h3, h4, h5, h6,
p, li, figcaption {
  overflow-wrap: break-word;
}

/* Images are block-level and responsive by default */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Consistent textarea behavior */
textarea {
  resize: vertical;
}

/* Anchor defaults */
a {
  color: inherit;
  text-decoration: none;
}

/* Table defaults */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* Remove fieldset defaults */
fieldset {
  border: none;
}

/* Make sure hidden elements are truly hidden */
[hidden] {
  display: none !important;
}

/* Remove animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Focus visible for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--color-primary, #4A6FA5);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* Remove default dialog styling */
dialog {
  padding: 0;
  border: none;
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* Remove search input clear button */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-results-button,
input[type="search"]::-webkit-search-results-decoration {
  -webkit-appearance: none;
}

/* Consistent horizontal rules */
hr {
  border: none;
  border-top: 1px solid var(--color-border, #D2D6E1);
  height: 0;
}

/* Abbreviation styling */
abbr[title] {
  text-decoration: underline dotted;
  cursor: help;
}

/* Code and pre defaults */
code, kbd, samp, pre {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.875em;
}

/* Summary cursor */
summary {
  cursor: pointer;
}

/* Progress bar reset */
progress {
  vertical-align: baseline;
}
