/* ==========================================================================
   AVAND Coffee Roasters — Design Tokens & Local Typography (RTL)
   Style Direction: Art-House Editorial Coffee Commerce (Assembly-inspired)
   ========================================================================== */

/* Local Vazirmatn Font Faces (Zero External CDN Dependency) */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('../assets/fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Core Palette (brain/brand.md) */
  --bg-paper: #F6F4EF;
  --bg-paper-alt: #EFECE5;
  --bg-surface: #FFFFFF;
  --bg-hero: #1A0E0C;
  --bg-bar: #464433;
  --bg-footer: #111111;

  --text-ink: #111111;
  --text-muted: #5C5852;
  --text-on-dark: #F6F4EF;
  --text-on-dark-muted: rgba(246, 244, 239, 0.88);
  --text-on-dark-subtle: rgba(246, 244, 239, 0.76);

  --accent-brass: #B07D4F;
  --accent-brass-hover: #96663C;
  --accent-live: #4D6B53;
  --status-success: #3F5D47;
  --status-danger: #8C2D3C;

  /* Coffee Flavor Profile Codes */
  --flavor-floral: #C88A3B;
  --flavor-berry: #8C2D3C;
  --flavor-caramel: #B07D4F;
  --flavor-chocolate: #3B241E;
  --flavor-fermented: #4D6B53;

  /* Hairlines & Dividers */
  --border-hairline: 1px solid rgba(17, 17, 17, 0.14);
  --border-hairline-strong: 1px solid rgba(17, 17, 17, 0.28);
  --border-hairline-dark: 1px solid rgba(246, 244, 239, 0.16);
  --border-hairline-brass: 1px solid rgba(176, 125, 79, 0.45);

  /* Typography */
  --font-sans: 'Vazirmatn', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace;

  --text-2xs: 0.6875rem;  /* 11px */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 0.96875rem;/* 15.5px */
  --text-md: 1.0625rem;   /* 17px */
  --text-lg: 1.25rem;     /* 20px */
  --text-xl: clamp(1.375rem, 2.2vw, 1.875rem);
  --text-2xl: clamp(1.75rem, 3.4vw, 2.75rem);
  --text-3xl: clamp(2.25rem, 4.8vw, 3.75rem);

  --leading-tight: 1.25;
  --leading-snug: 1.45;
  --leading-normal: 1.75;

  /* Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Layout Dimensions */
  --container-max: 1380px;
  --container-pad: clamp(1rem, 3vw, 2.5rem);
  --header-tier1-h: 34px;
  --header-tier2-h: 34px;
  --header-tier3-h: 66px;
  --drawer-width: 440px;

  /* Radii (Crisp Editorial Geometry) */
  --radius-none: 0px;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-pill: 9999px;

  /* Subtle Editorial Shadows */
  --shadow-megamenu: 0 24px 48px rgba(17, 17, 17, 0.11);
  --shadow-drawer: 24px 0 64px rgba(17, 17, 17, 0.2);
  --shadow-drawer-right: -24px 0 64px rgba(17, 17, 17, 0.2);
  --shadow-toast: 0 12px 32px rgba(17, 17, 17, 0.24);

  /* Motion Timing */
  --ease-editorial: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-snappy: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-med: 320ms;
  --dur-slow: 560ms;

  /* Z-Index Layers */
  --z-header: 100;
  --z-megamenu: 110;
  --z-search: 120;
  --z-backdrop: 200;
  --z-drawer: 210;
  --z-toast: 250;
}

/* ==========================================================================
   Editorial Base Reset (RTL First)
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  direction: rtl;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-ink);
  background-color: var(--bg-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-ink);
  background-color: var(--bg-paper);
  overflow-x: clip;
}

body.av-scroll-locked {
  overflow: hidden;
}

main {
  flex: 1 0 auto;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

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

input,
select,
textarea {
  font-size: max(16px, 1rem);
}

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

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

/* Accessible Focus Ring (strictly keyboard :focus-visible) */
:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-brass);
  outline-offset: 2px;
}

/* Utilities */
.av-nowrap {
  white-space: nowrap;
}
.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;
}

.av-num {
  font-variant-numeric: tabular-nums;
}

.av-mono {
  font-family: var(--font-mono);
  direction: ltr;
  unicode-bidi: isolate;
}

.av-skip-link {
  position: fixed;
  top: -100%;
  right: var(--space-4);
  z-index: 999;
  padding: var(--space-2) var(--space-4);
  background: var(--text-ink);
  color: var(--text-on-dark);
  font-size: var(--text-sm);
  font-weight: 500;
}

.av-skip-link:focus {
  top: var(--space-3);
}
