/* ═══════════════════════════════════════════════════
   BookJune Design System
   Inspired by Lacemade.com — Luxury Aesthetic
   ═══════════════════════════════════════════════════ */

/* ─── CSS Custom Properties ───────────────────────── */
:root {
    /* Colors - Primary */
    --bj-rose: #F2DFDF;
    --bj-rose-light: #FDF7F7;
    --bj-rose-dark: #E4D4D4;
    --bj-charcoal: #1C1B1B;
    --bj-gray: #5C5C5C;
    --bj-gray-light: #939393;
    --bj-gray-lighter: #C4C4C4;
    --bj-border: #E7E7E7;
    --bj-white: #FFFFFF;
    --bj-off-white: #FAFAFA;

    /* Colors - Accent */
    --bj-coral: #F94C43;
    --bj-gold: #C9A96E;
    --bj-success: #4CAF50;
    --bj-warning: #FF9800;
    --bj-error: #F44336;

    /* Typography */
    --bj-font-heading: 'Eczar', 'Georgia', serif;
    --bj-font-body: 'Lato', 'Helvetica Neue', sans-serif;
    --bj-font-accent: 'Playfair Display', 'Georgia', serif;

    /* Font Sizes (fluid) */
    --bj-text-xs: clamp(0.6875rem, 0.65rem + 0.1vw, 0.75rem);      /* 11-12px */
    --bj-text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);     /* 13-14px */
    --bj-text-base: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);   /* 14-15px */
    --bj-text-md: clamp(1rem, 0.95rem + 0.2vw, 1.125rem);           /* 16-18px */
    --bj-text-lg: clamp(1.25rem, 1.15rem + 0.4vw, 1.5rem);          /* 20-24px */
    --bj-text-xl: clamp(1.5rem, 1.3rem + 0.8vw, 2rem);              /* 24-32px */
    --bj-text-2xl: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);           /* 28-36px */
    --bj-text-3xl: clamp(2rem, 1.6rem + 1.5vw, 3rem);               /* 32-48px */
    --bj-text-4xl: clamp(2.5rem, 2rem + 2vw, 3.75rem);              /* 40-60px */

    /* Spacing (8px grid) */
    --bj-space-2xs: 0.25rem;   /* 4px */
    --bj-space-xs: 0.5rem;     /* 8px */
    --bj-space-sm: 0.75rem;    /* 12px */
    --bj-space-md: 1rem;       /* 16px */
    --bj-space-lg: 1.5rem;     /* 24px */
    --bj-space-xl: 2rem;       /* 32px */
    --bj-space-2xl: 3rem;      /* 48px */
    --bj-space-3xl: 4rem;      /* 64px */
    --bj-space-4xl: 5rem;      /* 80px */
    --bj-space-5xl: 6rem;      /* 96px */

    /* Layout */
    --bj-container-max: 1200px;
    --bj-container-wide: 1400px;
    --bj-container-narrow: 800px;
    --bj-gutter: var(--bj-space-lg);
    --bj-header-height: 110px;
    --bj-header-height-mobile: 76px;

    /* Border Radius */
    --bj-radius-none: 0;
    --bj-radius-sm: 2px;
    --bj-radius-md: 4px;
    --bj-radius-lg: 8px;
    --bj-radius-full: 9999px;

    /* Shadows */
    --bj-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --bj-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --bj-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
    --bj-shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --bj-ease: cubic-bezier(0.645, 0.045, 0.355, 1);
    --bj-duration-fast: 0.15s;
    --bj-duration-base: 0.3s;
    --bj-duration-slow: 0.6s;

    /* Z-index Scale */
    --bj-z-below: -1;
    --bj-z-base: 0;
    --bj-z-dropdown: 100;
    --bj-z-sticky: 200;
    --bj-z-overlay: 300;
    --bj-z-modal: 400;
    --bj-z-toast: 500;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--bj-font-body);
    font-size: var(--bj-text-base);
    font-weight: 400;
    line-height: 1.7;
    color: var(--bj-gray);
    background-color: var(--bj-white);
    overflow-x: hidden;
}

/* ─── Typography ──────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--bj-font-heading);
    font-weight: 500;
    color: var(--bj-charcoal);
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 { font-size: var(--bj-text-3xl); }
h2 { font-size: var(--bj-text-2xl); line-height: 1.3; }
h3 { font-size: var(--bj-text-xl); line-height: 1.3; }
h4 { font-size: var(--bj-text-lg); line-height: 1.4; }
h5 { font-size: var(--bj-text-md); line-height: 1.4; }
h6 { font-size: var(--bj-text-base); line-height: 1.5; }

p {
    margin-bottom: 1em;
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--bj-charcoal);
    text-decoration: none;
    transition: color var(--bj-duration-fast) var(--bj-ease);
}

a:hover {
    color: var(--bj-gray);
}

strong, b {
    font-weight: 700;
}

.text-accent {
    font-family: var(--bj-font-accent);
    font-style: italic;
}

.text-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: var(--bj-text-xs);
}

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

/* ─── Layout ──────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--bj-container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--bj-gutter);
    padding-right: var(--bj-gutter);
}

.container--wide {
    max-width: var(--bj-container-wide);
}

.container--narrow {
    max-width: var(--bj-container-narrow);
}

.section {
    padding-top: var(--bj-space-4xl);
    padding-bottom: var(--bj-space-4xl);
}

.section--sm {
    padding-top: var(--bj-space-2xl);
    padding-bottom: var(--bj-space-2xl);
}

.section--lg {
    padding-top: var(--bj-space-5xl);
    padding-bottom: var(--bj-space-5xl);
}

.section--rose {
    background-color: var(--bj-rose-light);
}

.section--dark {
    background-color: var(--bj-charcoal);
    color: var(--bj-rose);
}

.section--dark h1,
.section--dark h2,
.section--dark h3,
.section--dark h4 {
    color: var(--bj-rose);
}

/* ─── Grid System ─────────────────────────────────── */
.grid {
    display: grid;
    gap: var(--bj-gutter);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

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

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

    .section {
        padding-top: var(--bj-space-2xl);
        padding-bottom: var(--bj-space-2xl);
    }
}

/* ─── Flex Utilities ──────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--bj-space-xs); }
.gap-sm { gap: var(--bj-space-sm); }
.gap-md { gap: var(--bj-space-md); }
.gap-lg { gap: var(--bj-space-lg); }
.gap-xl { gap: var(--bj-space-xl); }

/* ─── Buttons ─────────────────────────────────────── */
.btn,
button[class*="btn-"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--bj-font-body);
    font-size: var(--bj-text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 14px 32px;
    border: none;
    cursor: pointer;
    transition: all var(--bj-duration-base) var(--bj-ease);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--bj-charcoal);
    color: var(--bj-rose);
}

.btn-primary:hover {
    background-color: var(--bj-gray);
    color: var(--bj-rose);
}

.btn-secondary {
    background-color: transparent;
    color: var(--bj-charcoal);
    border: 1px solid var(--bj-charcoal);
}

.btn-secondary:hover {
    background-color: var(--bj-charcoal);
    color: var(--bj-rose);
}

.btn-ghost {
    background: none;
    border: none;
    color: var(--bj-charcoal);
    text-decoration: underline;
    text-underline-offset: 4px;
    padding: 8px 0;
}

.btn-ghost:hover {
    color: var(--bj-gray);
    text-decoration-thickness: 2px;
}

.btn-white {
    background-color: var(--bj-white);
    color: var(--bj-charcoal);
}

.btn-white:hover {
    background-color: var(--bj-rose);
    color: var(--bj-charcoal);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 10px 20px;
    font-size: var(--bj-text-xs);
}

.btn-lg {
    padding: 18px 40px;
    font-size: var(--bj-text-base);
}

/* ─── Forms ───────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--bj-font-body);
    font-size: var(--bj-text-base);
    color: var(--bj-charcoal);
    background: var(--bj-white);
    border: 1px solid var(--bj-border);
    transition: border-color var(--bj-duration-fast) var(--bj-ease);
    appearance: none;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--bj-charcoal);
}

label {
    display: block;
    font-size: var(--bj-text-sm);
    font-weight: 700;
    color: var(--bj-charcoal);
    margin-bottom: var(--bj-space-2xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group {
    margin-bottom: var(--bj-space-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bj-space-md);
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ─── Images ──────────────────────────────────────── */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

.img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aspect-4-5 {
    aspect-ratio: 4 / 5;
}

.aspect-1-1 {
    aspect-ratio: 1 / 1;
}

.aspect-16-9 {
    aspect-ratio: 16 / 9;
}

/* ─── Utility Classes ─────────────────────────────── */
.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;
}

.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--bj-space-sm); }
.mt-md { margin-top: var(--bj-space-md); }
.mt-lg { margin-top: var(--bj-space-lg); }
.mt-xl { margin-top: var(--bj-space-xl); }
.mt-2xl { margin-top: var(--bj-space-2xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--bj-space-sm); }
.mb-md { margin-bottom: var(--bj-space-md); }
.mb-lg { margin-bottom: var(--bj-space-lg); }
.mb-xl { margin-bottom: var(--bj-space-xl); }
.mb-2xl { margin-bottom: var(--bj-space-2xl); }

.mx-auto { margin-left: auto; margin-right: auto; }

.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }

.w-full { width: 100%; }

.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
