/* ============================================================
   MemorialPro — base.css
   Reset, design tokens, base typography, accessibility
   ============================================================ */

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

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  hanging-punctuation: first last;
  scroll-padding-top: 5rem;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

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

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

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

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.15;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
}

p, li, figcaption {
  text-wrap: pretty;
}

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

::selection {
  background: color-mix(in oklab, var(--color-primary) 30%, transparent);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@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;
  }
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

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

a, button, [role='button'], input, textarea, select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    transform var(--transition-interactive),
    box-shadow var(--transition-interactive);
}

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

/* ============================================================
   Design Tokens — MemorialPro Brand
   Palette: Deep navy/charcoal, warm ivory, soft stone, refined gold
   ============================================================ */

:root,
[data-theme='light'] {
  /* Surfaces — warm ivory / soft stone */
  --color-bg: #F7F3EC;            /* warm ivory */
  --color-surface: #FBF8F2;       /* card surface */
  --color-surface-2: #FFFFFF;     /* elevated surface */
  --color-surface-offset: #EFEAE0;/* subtle alt surface */
  --color-border: #DCD3C2;        /* warm stone border */
  --color-divider: #E5DDCC;

  /* Text — deep navy / ink */
  --color-text: #16202E;          /* deep navy ink */
  --color-text-muted: #4A5466;
  --color-text-faint: #8A8576;
  --color-text-inverse: #F7F3EC;

  /* Primary — Deep Navy */
  --color-primary: #16202E;
  --color-primary-hover: #0E1722;
  --color-primary-active: #060B14;

  /* Accent — Refined Gold */
  --color-accent: #B08A3E;        /* refined gold (not yellow) */
  --color-accent-hover: #95722F;
  --color-accent-soft: #E8DCBE;   /* gold tinted background */
  --color-accent-faint: #F3EBD6;

  /* Optional secondary surface — slate */
  --color-slate: #2A3445;

  /* Shadows — warm tone */
  --shadow-sm: 0 1px 2px rgba(22, 32, 46, 0.06);
  --shadow-md: 0 8px 24px rgba(22, 32, 46, 0.08);
  --shadow-lg: 0 24px 60px rgba(22, 32, 46, 0.14);

  /* Border radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 220ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Type scale */
  --text-xs:    clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:    clamp(0.875rem, 0.82rem + 0.3vw,  1rem);
  --text-base:  clamp(1rem,     0.96rem + 0.2vw,  1.125rem);
  --text-lg:    clamp(1.125rem, 1rem    + 0.6vw,  1.375rem);
  --text-xl:    clamp(1.5rem,   1.2rem  + 1.2vw,  2.25rem);
  --text-2xl:   clamp(2rem,     1.4rem  + 2.4vw,  3.25rem);
  --text-hero:  clamp(2.5rem,   1.4rem  + 4.5vw,  5rem);

  /* Spacing — 4px scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Content widths */
  --content-narrow: 720px;
  --content-default: 1080px;
  --content-wide: 1280px;

  /* Fonts */
  --font-display: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', 'Helvetica Neue', system-ui, -apple-system, sans-serif;
}

/* ----- Dark Mode ----- */
[data-theme='dark'] {
  --color-bg: #0E141C;            /* nearly-black navy */
  --color-surface: #141C28;
  --color-surface-2: #1B2433;
  --color-surface-offset: #1F2A3B;
  --color-border: #2A3548;
  --color-divider: #1E2838;

  --color-text: #ECE4D2;          /* warm ivory text */
  --color-text-muted: #A39E91;
  --color-text-faint: #6E6A60;
  --color-text-inverse: #0E141C;

  --color-primary: #ECE4D2;       /* in dark, primary buttons go ivory */
  --color-primary-hover: #FFFFFF;
  --color-primary-active: #C8C0AE;

  --color-accent: #D7B26A;        /* warmer gold for dark mode */
  --color-accent-hover: #E5C586;
  --color-accent-soft: #2A2418;
  --color-accent-faint: #1F1B12;

  --color-slate: #C2BBAA;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}
