/* =============================================================
   Limark Wellness — global.css
   Mobile-first base styles, typography, layout utilities
   ============================================================= */

/* ---- Font faces (self-hosted) ---------------------------------- */
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/cormorant-garamond-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    size-adjust: 105%;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/cormorant-garamond-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
    size-adjust: 105%;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/cormorant-garamond-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
    size-adjust: 105%;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/cormorant-garamond-400italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
    size-adjust: 105%;
}

@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-300.woff2') format('woff2');
    font-weight: 300; font-style: normal; font-display: swap;
    size-adjust: 100%;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-400.woff2') format('woff2');
    font-weight: 400; font-style: normal; font-display: swap;
    size-adjust: 100%;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-500.woff2') format('woff2');
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: 'Inter';
    src: url('../fonts/inter-600.woff2') format('woff2');
    font-weight: 600; font-style: normal; font-display: swap;
}

/* ---- Design tokens ------------------------------------------- */
:root {
    /* Fonts */
    --font-heading: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Palette — neutrals */
    --white: #FFFFFF;
    --off-white: #FAF8F5;
    --warm-gray: #F0EDE8;
    --text-primary: #1A1A1A;
    --text-secondary: #6B6B6B;
    --text-tertiary: #9B9B9B;
    --border-light: #E8E4DD;

    /* Palette — Limark */
    --limark-navy: #1B2A5B;
    --limark-berry: #9E2A6D;
    --limark-bg: #F5F0EB;
    --limark-accent: #D4A84B;

    /* Palette — Safease */
    --safease-purple: #4A2366;
    --safease-light: #E8DFF0;
    --safease-bg: #F8F4FB;
    --safease-dark-blue: #1B1F4B;

    /* CTA */
    --cta-primary: #1B2A5B;
    --cta-hover: #0F1D42;
    --success: #2D7D46;

    /* Fluid spacing */
    --space-xs: clamp(0.25rem, 0.5vw, 0.5rem);
    --space-sm: clamp(0.5rem, 1vw, 0.75rem);
    --space-md: clamp(1rem, 2vw, 1.5rem);
    --space-lg: clamp(1.5rem, 3vw, 2.5rem);
    --space-xl: clamp(2rem, 5vw, 4rem);
    --space-2xl: clamp(3rem, 7vw, 6rem);
    --space-section: clamp(3rem, 8vw, 7rem);

    /* Radii */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-pill: 999px;

    /* Transitions */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --t-fast: 0.2s ease;
    --t-default: 0.3s ease;
    --t-slow: 0.6s var(--ease);

    /* Layout */
    --container: 1240px;
    --container-narrow: 920px;
    --container-wide: 1440px;
    --header-h: 72px;

    /* Fluid font sizes */
    --fs-xs: 0.75rem;
    --fs-sm: 0.875rem;
    --fs-base: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: clamp(1.25rem, 2vw, 1.5rem);
    --fs-2xl: clamp(1.5rem, 3vw, 2rem);
    --fs-3xl: clamp(2rem, 4vw, 2.5rem);
    --fs-hero: clamp(2rem, 5.5vw, 3.75rem);
    --fs-display: clamp(2.5rem, 7vw, 5rem);

    /* Line heights */
    --lh-tight: 1.1;
    --lh-snug: 1.3;
    --lh-normal: 1.5;
    --lh-relaxed: 1.65;
    --lh-loose: 1.8;

    /* Letter spacing */
    --ls-tight: -0.02em;
    --ls-normal: 0;
    --ls-wide: 0.05em;
    --ls-widest: 0.18em;

    /* Product palette defaults (overridden per product) */
    --product-primary: var(--limark-navy);
    --product-primary-dark: var(--limark-navy);
    --product-bg-tint: var(--off-white);
    --product-bg-section: var(--warm-gray);
    --product-bg-dark: var(--limark-navy);
    --product-bg-dark-text: var(--white);
    --product-cta: var(--cta-primary);
    --product-cta-hover: var(--cta-hover);
    --product-cta-text: var(--white);
    --product-accent: var(--limark-berry);
    --product-accent-light: var(--warm-gray);
    --product-border: var(--border-light);
    --product-text-on-light: var(--text-primary);
    --product-badge-bg: var(--warm-gray);
    --product-badge-text: var(--limark-navy);
}

/* ---- Modern reset -------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: var(--fs-base);
    line-height: var(--lh-relaxed);
    color: var(--text-primary);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--limark-berry); }
ul, ol { list-style: none; padding: 0; }

:focus-visible { outline: 2px solid var(--limark-navy); outline-offset: 3px; border-radius: 2px; }

/* ---- Typography ---------------------------------------------- */
h1, h2, h3, h4, h5, .h1, .h2, .h3 {
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-tight);
    color: var(--text-primary);
}
h1, .h1 { font-size: var(--fs-hero); font-weight: 500; }
h2, .h2 { font-size: var(--fs-3xl); line-height: var(--lh-snug); letter-spacing: -0.015em; }
h3, .h3 { font-size: var(--fs-2xl); line-height: var(--lh-snug); }
h4, .h4 { font-size: var(--fs-xl); line-height: 1.3; }
h5 { font-family: var(--font-body); font-weight: 600; font-size: var(--fs-lg); line-height: 1.4; letter-spacing: 0; }
.eyebrow, h6 {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: var(--ls-widest);
    color: var(--text-secondary);
}
.serif-italic { font-family: var(--font-heading); font-style: italic; font-weight: 400; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }

p { line-height: var(--lh-relaxed); }
p + p { margin-top: 1em; }

/* ---- Layout utilities ---------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--space-md);
}
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }
.container--full { max-width: 100%; padding-inline: clamp(1rem, 4vw, 3rem); }

.section { padding-block: var(--space-section); }
.section--compact { padding-block: var(--space-xl); }
.section--tight { padding-block: var(--space-lg); }

.stack > * + * { margin-top: var(--space-md); }
.stack-sm > * + * { margin-top: var(--space-sm); }
.stack-lg > * + * { margin-top: var(--space-lg); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.text-center { text-align: center; }
.text-left { text-align: left; }

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    padding: 12px 18px;
    background: var(--limark-navy);
    color: var(--white);
    z-index: 9999;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---- Touch target guarantee --------------------------------- */
button, .btn, a.btn, [role="button"], input[type="checkbox"], input[type="radio"] {
    min-height: 44px;
}
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], textarea, select {
    min-height: 48px;
    font-size: 16px; /* prevent iOS zoom */
}

/* ---- Responsive visibility ---------------------------------- */
.hide-mobile { display: none; }
.show-mobile { display: block; }
@media (min-width: 768px) {
    .hide-mobile { display: initial; }
    .show-mobile { display: none; }
}

/* ---- Body when mobile drawer open -------------------------- */
body.drawer-open { overflow: hidden; }

/* ---- FSE layout overrides ---------------------------------- */
/* Force full-width main + full-width child sections regardless of parent layout */
main.alignfull,
main.wp-block-group.alignfull {
    max-width: none !important;
    width: 100%;
    margin-inline: 0 !important;
    padding: 0 !important;
}
main.alignfull > *,
main.wp-block-group.alignfull > * {
    max-width: none;
    margin-inline: 0;
}
/* Every section we ship is full-width; inner .container handles inset */
main.alignfull > section,
main.wp-block-group.alignfull > section,
main.alignfull > .wp-block-html,
main.wp-block-group.alignfull > .wp-block-html {
    width: 100%;
    max-width: none;
}
main.alignfull .wp-block-html { max-width: none; }
