/* ============================================================
   Siblings.co — Theme & Design Tokens
   Single source of truth untuk warna, spacing, radius, shadow,
   typography, dan reset global.
   ============================================================ */

:root {
    /* ---- Brand & Surface Colors ---- */
    --color-brand-900: #2d1f18;
    --color-brand-800: #3c2317;
    --color-brand-700: #4a3328;   /* primary brown */
    --color-brand-600: #6b4a3b;
    --color-brand-500: #8b6650;
    --color-brand-400: #a3856e;
    --color-brand-300: #c9b7a6;
    --color-brand-200: #e6d5b8;
    --color-brand-100: #f1e6db;
    --color-brand-50:  #faf8f5;

    --color-surface:        #ffffff;
    --color-bg:             #f8f3e9;
    --color-bg-soft:        #fdfaf7;

    /* ---- Text ---- */
    --color-text:        #2c1a12;
    --color-text-soft:   #4a3328;
    --color-text-muted:  #6b6157;
    --color-text-on-brand: #ffffff;

    /* ---- Accent / Status ---- */
    --color-accent:        #79b473;
    --color-accent-dark:   #5d8e58;
    --color-info:          #0284c7;
    --color-info-strong:   #075985;
    --color-info-bg:       #e0f2fe;
    --color-info-border:   #bae6fd;
    --color-success:       #16a34a;
    --color-success-strong:#1b5e20;
    --color-success-bg:    #e8f5e9;
    --color-success-border:#a5d6a7;
    --color-warning:       #d97706;
    --color-warning-strong:#6d4c41;
    --color-warning-bg:    #fff8e1;
    --color-warning-border:#ffe082;
    --color-danger:        #dc2626;
    --color-danger-strong: #b91c1c;
    --color-danger-deep:   #8a1c1c;
    --color-danger-bg:     #fee2e2;
    --color-danger-bg-strong: #fecaca;
    --color-danger-border: #f5c2c7;
    --color-pending:       #b45309;
    --color-pending-bg:    #fff4d6;

    /* ---- Border ---- */
    --color-border:        #e6d5b8;
    --color-border-soft:   #f1e6db;
    --color-border-strong: #4a3328;

    /* ---- Semantic colors ---- */
    --color-whatsapp: #25d366;
    --color-overlay: rgba(0, 0, 0, 0.4);

    /* ---- Focus ring (consumed by components & pages) ---- */
    --color-focus-ring: rgba(74, 51, 40, 0.18);

    /* ---- Radius ---- */
    --radius-xs:   6px;
    --radius-sm:   8px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-xl:   20px;
    --radius-2xl:  28px;
    --radius-3xl:  32px;
    --radius-pill: 999px;

    /* ---- Spacing scale (4-step + extras filled in) ---- */
    --space-0-5: 2px;
    --space-1: 4px;
    --space-1-5: 6px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-9: 36px;
    --space-10: 40px;
    --space-11: 44px;
    --space-12: 48px;
    --space-14: 56px;
    --space-16: 64px;

    /* ---- Shadow ---- */
    --shadow-sm: 0 1px 2px rgba(15, 6, 1, 0.05);
    --shadow-md: 0 4px 12px rgba(74, 51, 40, 0.08);
    --shadow-lg: 0 10px 25px rgba(74, 51, 40, 0.12);
    --shadow-xl: 0 20px 50px rgba(15, 6, 1, 0.18);

    /* ---- Typography ---- */
    --font-sans: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-display: "Poppins", "Segoe UI", system-ui, sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", "SF Mono", "Menlo", "Consolas", "Courier New", monospace;

    --fs-2xs: 10px;
    --fs-xs:  12px;
    --fs-sm:  13px;
    --fs-md:  14px;
    --fs-base: 15px;
    --fs-lg:  16px;
    --fs-xl:  18px;
    --fs-2xl: 22px;
    --fs-3xl: 28px;
    --fs-4xl: 32px;
    --fs-5xl: 40px;
    --fs-6xl: 48px;
    --fs-7xl: 56px;

    --fw-regular: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;
    --fw-extrabold: 800;

    --lh-tight: 1.25;
    --lh-base:  1.5;

    /* ---- Layout (compact) ---- */
    --sidebar-width: 220px;
    --header-photo-height: 64px;
    --content-padding-x: 20px;
    --content-padding-y: 16px;
    --content-max-width: 1280px;

    /* ---- Transition ---- */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;

    /* ---- Z-index scale ---- */
    --z-dropdown:  100;
    --z-sticky:    200;
    --z-sidebar:   100;
    --z-overlay:   900;
    --z-modal:     1000;
    --z-toast:     1100;
}

/* ============================================================
   Reset & Base
   ============================================================ */

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

* {
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    color-scheme: light;
    /* Prevent iOS double-tap zoom delay site-wide on tappable nodes */
    touch-action: manipulation;
    /* Floating navbars / sticky targets won't be hidden under it */
    scroll-padding-top: var(--header-photo-height, 64px);
}

html,
body {
    min-height: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--fs-md);
    line-height: var(--lh-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

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

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

button {
    background: none;
    border: none;
    cursor: pointer;
}

a {
    color: var(--color-brand-700);
    text-decoration: none;
}

a:hover {
    color: var(--color-brand-600);
}

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    width: 100%;
}

/* Headings — base sizes; halaman tetap bisa override */
h1 {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-extrabold);
    color: var(--color-text-soft);
    line-height: var(--lh-tight);
    text-wrap: balance;
    scroll-margin-top: calc(var(--header-photo-height, 64px) + var(--space-3));
}

h2 {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: var(--color-text-soft);
    line-height: var(--lh-tight);
    text-wrap: balance;
    scroll-margin-top: calc(var(--header-photo-height, 64px) + var(--space-3));
}

h3 {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--color-text-soft);
    line-height: var(--lh-tight);
    text-wrap: balance;
    scroll-margin-top: calc(var(--header-photo-height, 64px) + var(--space-3));
}

h4 {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--color-text-soft);
}

h5,
h6 {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-text-soft);
}

/* Number columns / comparable values */
.tabular-nums,
.amount,
.money,
[data-tabular] {
    font-variant-numeric: tabular-nums;
}

/* Brand names / code tokens — wrap with translate="no" to disable auto-translate */
[translate="no"] {
    -webkit-user-select: text;
    user-select: text;
}

/* Focus state default — visible ring for a11y, no fallback for click users */
:where(a, button, input, select, textarea, summary, [tabindex]):focus {
    outline: none;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--color-brand-700);
    outline-offset: 2px;
}

/* Screen reader only */
.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 untuk keyboard */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 8px;
    background: var(--color-brand-700);
    color: var(--color-text-on-brand);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    z-index: var(--z-toast);
    transition: top var(--transition-fast);
}

.skip-to-content:focus,
.skip-to-content:focus-visible {
    top: 8px;
    color: var(--color-text-on-brand);
}

/* Native <select> on Windows dark mode — make scheme explicit */
select {
    color-scheme: light;
    background-color: var(--color-surface);
    color: var(--color-text);
}

/* Long content guards (opt-in utilities) */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2,
.line-clamp-3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}
.line-clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

.display-inline { display: inline; }

.break-words {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.min-w-0 { min-width: 0; }

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