/* ============================================================
   Two Pieces — base.css
   Brand tokens, reset, typography. Loaded first on every page.
   All custom properties below port unchanged into the WP child theme.
   ============================================================ */

@font-face {
  font-family: 'Classyvogue';
  src: url('../fonts/Classyvogueregular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Palette — sourced from Two Pieces brand printing files */
  --c-eggplant:        #1F1830;   /* deep midnight purple — primary chrome bg */
  --c-eggplant-deep:   #14101F;   /* slightly darker, for layered surfaces */
  --c-plum:            #6B2E5A;
  --c-pink:            #E8C8C8;
  --c-pink-soft:       #F2DDDD;
  --c-cream:           #F5EFE6;
  --c-cream-dim:       rgba(245, 239, 230, 0.65);
  --c-cream-faint:     rgba(245, 239, 230, 0.18);
  --c-line:            rgba(245, 239, 230, 0.14);

  /* Type */
  --font-display:      'Classyvogue', 'Cormorant Garamond', 'Times New Roman', serif;
  --font-body:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Scale */
  --fs-xs:    0.75rem;
  --fs-sm:    0.875rem;
  --fs-base:  1rem;
  --fs-md:    1.125rem;
  --fs-lg:    1.5rem;
  --fs-xl:    2.25rem;
  --fs-2xl:   clamp(2.5rem, 5vw + 1rem, 5.5rem);
  --fs-display: clamp(3rem, 7vw + 1rem, 8rem);

  /* Spacing */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.5rem;
  --sp-6:  2rem;
  --sp-8:  3rem;
  --sp-10: 4rem;
  --sp-12: 6rem;

  /* Layout */
  --header-h: 84px;
  --gutter:   clamp(1.25rem, 3vw, 2.5rem);
  --max-w:    1680px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in:  cubic-bezier(0.55, 0, 1, 0.45);
  --t-fast:   200ms;
  --t-base:   400ms;
  --t-slow:   700ms;

  /* Z layers */
  --z-header:  100;
  --z-overlay: 200;
  --z-drawer:  210;
}

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

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

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: 300;
  line-height: 1.5;
  color: var(--c-eggplant);
  background: var(--c-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul, ol {
  list-style: none;
}

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

/* Body scroll lock — applied by JS while overlay/drawer is open.
   Pattern works on iOS Safari (where overflow:hidden on body fails). */
body.tp-scroll-locked {
  position: fixed;
  inset: 0 0 auto 0;
  width: 100%;
  overflow: hidden;
}

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

.tp-skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-eggplant);
  color: var(--c-cream);
  z-index: 9999;
  transition: top var(--t-fast) var(--ease-out);
}
.tp-skip-link:focus {
  top: 0;
}

/* ============================================================
   Brand defaults — defensive safety net for surfaces outside our
   .tp-* templates (Blocksy parent bits, plugin output, comment forms,
   the bare-WP fallbacks). Uses :where() so specificity stays at 0
   and our explicit .tp-* rules always win.
   ============================================================ */

html { background: var(--c-cream); }

:where(html, body) {
  color: var(--c-eggplant);
}

/* Any unstyled link → plum, hover → eggplant. WP-block buttons,
   WC buttons, and our .tp-* links have their own rules and win. */
:where(a) {
  color: var(--c-plum);
  text-decoration-color: rgba(107, 46, 90, 0.4);
  text-underline-offset: 3px;
  transition: color 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
:where(a:hover) {
  color: var(--c-eggplant);
}

/* Any unstyled heading → Classyvogue italic eggplant.
   Blocksy's per-heading typography (set via Customize → Typography)
   uses higher specificity and still wins where the user sets it. */
:where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--c-eggplant);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

/* Text selection — matches brand even if Blocksy default leaks. */
::selection {
  background: var(--c-pink);
  color: var(--c-eggplant);
}
::-moz-selection {
  background: var(--c-pink);
  color: var(--c-eggplant);
}

/* Default focus ring — pink outline, matches the brand. */
:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--c-pink);
  outline-offset: 3px;
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
