/* ==========================================================================
   Base: fonts, design tokens, reset, typography
   ========================================================================== */

/* ---------- Fonts (self-hosted, latin subset) ---------- */
@font-face {
    font-family: "Cormorant Garamond";
    src: url("../fonts/cormorant-garamond-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Cormorant Garamond";
    src: url("../fonts/cormorant-garamond-500-italic.woff2") format("woff2");
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: "Cormorant Garamond";
    src: url("../fonts/cormorant-garamond-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Jost";
    src: url("../fonts/jost-400.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Jost";
    src: url("../fonts/jost-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* ---------- Tokens ---------- */
:root {
    /* Colours (fallbacks; head.php prints the live values from settings) */
    --color-primary: #1F4D36;
    --color-primary-dark: #163A28;
    --color-secondary: #C4A265;
    --color-secondary-text: #8C6D2F;
    --color-bg: #FBF8EF;
    --color-bg-alt: #EEF2EC;
    --color-bg-sand: #F5EFE3;
    --color-surface: #FFFFFF;
    --color-text: #23332B;
    --color-text-muted: #56655C;
    --color-whatsapp: #25D366;

    /* Typography */
    --font-heading: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
    --font-body: "Jost", "Segoe UI", system-ui, -apple-system, sans-serif;

    --text-sm: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);
    --text-base: clamp(1.0625rem, 1.03rem + 0.15vw, 1.125rem);   /* 17px -> 18px */
    --text-lead: clamp(1.125rem, 1.06rem + 0.35vw, 1.3125rem);
    --text-h4: clamp(1.375rem, 1.3rem + 0.4vw, 1.625rem);
    --text-h3: clamp(1.625rem, 1.45rem + 0.8vw, 2.125rem);
    --text-h2: clamp(2.125rem, 1.8rem + 1.6vw, 3.25rem);
    --text-h1: clamp(2.75rem, 2.1rem + 3.4vw, 5.25rem);

    --leading-body: 1.7;
    --leading-heading: 1.1;
    --tracking-label: 0.15em;
    --measure: 68ch;

    /* Spacing */
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 0.75rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4.5rem;
    --section-space: clamp(4rem, 3rem + 5vw, 8rem);
    --gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
    --container: 1200px;

    /* Shape & depth */
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --radius-pill: 999px;
    --shadow-soft: 0 10px 30px -12px rgb(31 77 54 / 0.18);
    --shadow-lift: 0 18px 40px -16px rgb(31 77 54 / 0.28);

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --duration: 0.5s;

    /* Layout */
    --header-h: 92px;
}

@media (min-width: 1024px) {
    :root {
        --header-h: 130px;
    }
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 12px); /* also read by Lenis */
}

html,
body {
    overflow-x: clip;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: 400;
    line-height: var(--leading-body);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
}

img {
    height: auto;
}

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

button {
    cursor: pointer;
}

ul[role="list"],
ol[role="list"] {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
    margin: 0 0 var(--space-md);
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: var(--leading-heading);
    color: var(--color-primary);
    text-wrap: balance;
}

h1 { font-size: var(--text-h1); letter-spacing: -0.01em; }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); font-weight: 600; }
h4 { font-size: var(--text-h4); font-weight: 600; }

h1 em,
h2 em,
h3 em {
    font-style: italic;
}

p {
    margin: 0 0 var(--space-md);
    max-width: var(--measure);
    text-wrap: pretty;
}

strong {
    font-weight: 500;
}

a {
    color: var(--color-primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color var(--duration) var(--ease-out);
}

a:hover {
    color: var(--color-primary-dark);
}

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

main:focus,
[tabindex="-1"]:focus:not(:focus-visible) {
    outline: none;
}

::selection {
    background: color-mix(in srgb, var(--color-secondary) 35%, transparent);
    color: var(--color-text);
}

/* ---------- Utilities ---------- */
.container {
    width: 100%;
    max-width: calc(var(--container) + var(--gutter) * 2);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

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

.skip-link {
    position: fixed;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: 1000;
    padding: var(--space-sm) var(--space-lg);
    background: var(--color-primary);
    color: var(--color-surface);
    font-weight: 500;
    border-radius: var(--radius-pill);
    text-decoration: none;
    transform: translateY(-200%);
    transition: transform 0.3s var(--ease-out);
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    color: var(--color-surface);
}
