/* =====================================================================
   OzSites — single hand-written stylesheet
   ---------------------------------------------------------------------
   Section index:
     1. Reset + base
     2. Theme tokens (defaults; per-site values come from <head> :root)
     3. Typography
     4. Layout / containers / utility helpers
     5. Header + nav (Stage 2 expands this)
     6. Footer (Stage 2)
     7. Forms + buttons
     8. Block library — section heading + utilities
     9. Blocks — Rich text
    10. Print styles
    11. Reduced-motion / a11y overrides
   ===================================================================== */


/* ---- 1. Reset + base -------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    line-height: 1.15;
}

body {
    margin: 0;
    background: hsl(var(--background, 0 0% 100%));
    color: hsl(var(--foreground, 0 0% 12%));
    font-family: var(--font-sans, system-ui, sans-serif);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.55;
}

img, video, picture { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: hsl(var(--primary, 174 78% 22%)); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: none; }

/* Visible keyboard focus across the app — match Lovable behaviour exactly. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(var(--background)),
                0 0 0 4px hsl(var(--accent, 45 92% 60%));
}


/* ---- 2. Theme tokens (defaults — per-site overrides via inline <style>) - */
:root {
    /* Colours */
    --background: 0 0% 100%;
    --foreground: 0 0% 12%;
    --primary: 174 78% 22%;
    --primary-foreground: 0 0% 100%;
    --primary-dark: 174 80% 15%;
    --secondary: 0 0% 96%;
    --secondary-foreground: 174 78% 22%;
    --accent: 45 92% 60%;
    --accent-foreground: 174 80% 15%;
    --muted: 0 0% 95%;
    --muted-foreground: 0 0% 40%;
    --destructive: 0 70% 45%;
    --destructive-foreground: 0 0% 100%;
    --border: 0 0% 90%;
    --input: 0 0% 90%;
    --ring: 174 78% 22%;
    --topbar-bg: 0 0% 96%;
    --topbar-fg: 174 78% 22%;
    --footer-bg: 174 80% 12%;

    /* Fonts */
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;

    /* Geometry */
    --radius: 0.25rem;
    --container-max: 1200px;
    --container-px: 1rem;

    /* Shadows */
    --shadow-card: 0 4px 16px -4px hsl(0 0% 0% / 0.12);
    --shadow-soft: 0 2px 8px -2px hsl(0 0% 0% / 0.08);

    /* Motion */
    --transition-base: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ---- 3. Typography ---------------------------------------------- */
h1, h2, h3, h4 {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 0.5em;
    color: hsl(var(--foreground));
}
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.5rem); line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 2.5vw + 0.75rem, 2.5rem); line-height: 1.2; }
h3 { font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.875rem); line-height: 1.25; }
h4 { font-size: 1.25rem; line-height: 1.3; }
p  { margin: 0 0 1.25rem; }

.eyebrow {
    color: hsl(var(--primary));
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin: 0 0 0.75rem;
}

.muted { color: hsl(var(--muted-foreground)); }


/* ---- 4. Layout / containers / utilities ------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-px);
}
@media (min-width: 640px)  { :root { --container-px: 1.5rem; } }
@media (min-width: 1024px) { :root { --container-px: 2.5rem; } }

.block { padding-block: clamp(2rem, 4vw, 4rem); }
.block .container > :last-child { margin-bottom: 0; }

.width-narrow   { max-width: 60ch; margin-left: auto; margin-right: auto; }
.width-standard { max-width: 80ch; margin-left: auto; margin-right: auto; }
.width-wide     { max-width: 100ch; margin-left: auto; margin-right: auto; }

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

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


/* ---- 5. Header + nav (placeholder — replaced in Stage 2) -------- */
.site-header {
    background: hsl(var(--topbar-bg));
    color: hsl(var(--topbar-fg));
    border-bottom: 1px solid hsl(var(--border));
}
.site-header .container { padding-block: 1.25rem; display: flex; align-items: center; gap: 1.5rem; }
.site-brand { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; text-decoration: none; color: inherit; }


/* ---- 6. Footer (placeholder — replaced in Stage 2) -------------- */
.site-footer {
    margin-top: 4rem;
    background: hsl(var(--footer-bg));
    color: hsl(var(--primary-foreground));
    padding-block: 2rem;
}
.site-footer .muted { color: hsl(var(--primary-foreground) / 0.75); }


/* ---- 7. Forms + buttons ----------------------------------------- */
.btn-primary,
.btn-accent,
.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition-base);
}
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-accent  { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.btn-accent:hover  { filter: brightness(1.05); }
.btn-outline { background: transparent; color: hsl(var(--primary)); border-color: hsl(var(--primary)); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }
.btn-outline:hover { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }

input, textarea, select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    background: hsl(var(--background));
    border: 1px solid hsl(var(--input));
    border-radius: var(--radius);
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: hsl(var(--ring));
}
label { display: block; font-weight: 500; margin-bottom: 0.375rem; font-size: 0.875rem; }


/* ---- 8. Block library — section utilities ----------------------- */
.section-heading { margin-bottom: 1.5rem; }


/* ---- 9. Blocks — Rich text -------------------------------------- */
.block-rich-text .heading { margin-top: 0; }
.block-rich-text .prose {
    color: hsl(var(--foreground));
    line-height: 1.65;
}
.block-rich-text .prose p { margin: 0 0 1rem; }
.block-rich-text .prose h2 { font-size: 1.875rem; color: hsl(var(--primary)); margin-top: 2.5rem; margin-bottom: 1rem; }
.block-rich-text .prose h3 { font-size: 1.5rem;   color: hsl(var(--primary)); margin-top: 2rem; margin-bottom: 0.75rem; }
.block-rich-text .prose h4 { font-size: 1.25rem;  margin-top: 1.5rem; margin-bottom: 0.5rem; }
.block-rich-text .prose ul, .block-rich-text .prose ol { padding-left: 1.5rem; margin: 0 0 1rem; }
.block-rich-text .prose li { margin-bottom: 0.5rem; }
.block-rich-text .prose a  { color: hsl(var(--accent)); text-decoration-thickness: 2px; }
.block-rich-text .prose blockquote {
    border-left: 4px solid hsl(var(--accent));
    padding-left: 1rem;
    font-style: italic;
    color: hsl(var(--muted-foreground));
    margin: 1.5rem 0;
}
.block-rich-text .prose code {
    background: hsl(var(--muted));
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}


/* ---- Phase 1 placeholder utilities ------------------------------ */
.phase1-placeholder dl { display: grid; grid-template-columns: 8rem 1fr; gap: 0.5rem 1rem; }
.phase1-placeholder dt { font-weight: 600; color: hsl(var(--muted-foreground)); }


/* ---- 10. Print styles (match Lovable) --------------------------- */
@media print {
    .site-header,
    .site-footer,
    .print\:hidden,
    [role="dialog"] { display: none !important; }
    body { background: #fff; color: #000; }
    a { color: inherit; text-decoration: none; }
    main { padding: 0 !important; }
    .container { padding: 0 !important; max-width: 100% !important; }
}


/* ---- 11. Reduced motion ----------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
