/* Design tokens — Aoun Marketing brand guide v1.0 (2026). Light and dark themes (guide page 06).
   Wine leads, black carries it, white and black are grounds, gold is a small touch only.
   Variable names are kept from the first design system so every component picks up the brand. */
:root {
  color-scheme: light;

  /* brand palette (guide §02) */
  --wine: #6B172D;          /* primary buttons, links, full-width blocks */
  --wine-deep: #511022;     /* hover / pressed */
  --wine-mark: #5C2731;     /* logo mark on white only */
  --rose: #B9B0B4;          /* highlights and links on dark — grey by owner decision (was the guide's rose) */
  --rose-light: #ECE8E9;    /* selected element, image backgrounds (light grey) */
  --gold: #D4AD6A;          /* "إعلان" tag and thin decorative lines */
  --black: #0B0A0A;         /* dark grounds */
  --ink: #1A1214;           /* body text */
  --grey-btn: #6B6467;      /* buttons on dark */
  --ground: #F6F2F3;        /* light page ground */

  /* Theme-stable roles: dark panels (header, footer, side nav, admin band) and text that sits on them or on wine. */
  /* Light theme: one burgundy for every dark band (header, footer, side navs, admin band). Dark theme: black. */
  --panel: var(--wine-deep);
  --head-bg: var(--wine);
  --foot-bg: var(--wine-deep);
  --on-panel: #F6F2F3;
  --on-accent: #FFFFFF;
  --field-bg: #FFFFFF;      /* inputs and the home search box */
  --field-line: var(--line);

  /* Theme-aware roles (redefined for dark mode below). */
  --accent-text: var(--wine);     /* wine text and borders on light; light grey on dark */
  --btn-bg: var(--wine);
  --btn-bg-hover: var(--wine-deep);
  --cover-1: #ECE8E9;
  --cover-2: #F3F0F1;
  --cover-3: #E5E0E2;
  --cover-mark: var(--wine-mark);

  /* roles used across app.css */
  --night: var(--ink);
  --night-2: #3F0C1B;      /* hover / active on burgundy panels */
  --night-line: #7A3448;
  --saffron: var(--wine);
  --turquoise: var(--wine-mark);
  --teal-text: var(--wine);
  --lapis: var(--wine-deep);
  --clay: #B3261E;
  --plaster: var(--ground);
  --admin-ground: #EFE7EA;
  --surface: #FFFFFF;
  --muted: #625A5D;
  --ink-2: #3D3236;
  --on-dark-muted: #DCD2D5;
  --on-dark-subtle: #B5A8AC;
  --line: #E6DADE;
  --placeholder: #756D70;

  /* status fills (bg / fg) */
  --ok-bg: #E5F2EA;   --ok-fg: #1E6B45;
  --warn-bg: #FBF1DE; --warn-fg: #6B4A0E;
  --bad-bg: #FBE8E6;  --bad-fg: #8C1D18;
  --info-bg: #E7ECF8; --info-fg: #2B4583;
  --neutral-bg: var(--rose-light); --neutral-fg: var(--wine-deep);

  /* radius */
  --r-card: 16px;
  --r-panel: 20px;
  --r-input: 10px;
  --r-btn: 10px;
  --r-chip: 8px;
  --r-pill: 999px;
  --arch: 16px;
  /* Former octagon mask: now a rounded square, matching the brand's straight-edged geometry. */
  --octagon: inset(0 round 12px);

  /* spacing */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-12: 48px; --s-18: 72px;

  /* type (guide §03): Inter for Latin and digits, Almarai for Arabic; one family, no third font */
  --font-display: "Inter", "Almarai", "Segoe UI", Tahoma, sans-serif;
  --font-body: "Inter", "Almarai", "Segoe UI", Tahoma, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --focus: var(--wine);
  --page-max: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
}

/* Dark theme: the brand guide's dark home page — black ground, wine-black cards, light-grey links and highlights, grey buttons.
   Follows the device unless the visitor picked a theme (data-theme on <html>, set from a cookie by the server). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
      color-scheme: dark;
      --ground: #0B0A0A;
      --surface: #1A1517;
      --ink-soft: #F3ECEE;
      --night: #F3ECEE;
      --muted: #B9ADB1;
      --ink-2: #DCD2D5;
      --line: #3A3034;
      --placeholder: #9A8D92;
      --admin-ground: #120D0F;
      --rose-light: #262223;
      --panel: #120D0F;
  --field-bg: #241E20;
  --field-line: #4A3F43;
      --field-bg: #241E20;
      --field-line: #4A3F43;
  --head-bg: var(--black);
  --foot-bg: var(--black);
  --night-2: #2B1F23;
  --night-line: #3D2E33;
      --head-bg: var(--black);
      --foot-bg: var(--black);
      --night-2: #2B1F23;
      --night-line: #3D2E33;
      --accent-text: var(--rose);
      --teal-text: var(--rose);
      --saffron: var(--rose);
      --turquoise: #6B172D;
      --lapis: #511022;
      --focus: var(--rose);
      --btn-bg: var(--grey-btn);
      --btn-bg-hover: #7C7478;
      --cover-1: #1E1B1C;
      --cover-2: #222020;
      --cover-3: #1A1718;
      --cover-mark: var(--rose);
      --ok-bg: #12291D;   --ok-fg: #7ED3A1;
      --warn-bg: #2E2410; --warn-fg: #E9C77B;
      --bad-bg: #331314;  --bad-fg: #F29B96;
      --info-bg: #141D33; --info-fg: #9DB3F0;
      --neutral-bg: #262223; --neutral-fg: #D6CED1;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0B0A0A;
  --surface: #1A1517;
  --ink-soft: #F3ECEE;
  --night: #F3ECEE;
  --muted: #B9ADB1;
  --ink-2: #DCD2D5;
  --line: #3A3034;
  --placeholder: #9A8D92;
  --admin-ground: #120D0F;
  --rose-light: #262223;
  --panel: #120D0F;
  --field-bg: #241E20;
  --field-line: #4A3F43;
  --head-bg: var(--black);
  --foot-bg: var(--black);
  --night-2: #2B1F23;
  --night-line: #3D2E33;
  --accent-text: var(--rose);
  --teal-text: var(--rose);
  --saffron: var(--rose);
  --turquoise: #6B172D;
  --lapis: #511022;
  --focus: var(--rose);
  --btn-bg: var(--grey-btn);
  --btn-bg-hover: #7C7478;
  --cover-1: #1E1B1C;
  --cover-2: #222020;
  --cover-3: #1A1718;
  --cover-mark: var(--rose);
  --ok-bg: #12291D;   --ok-fg: #7ED3A1;
  --warn-bg: #2E2410; --warn-fg: #E9C77B;
  --bad-bg: #331314;  --bad-fg: #F29B96;
  --info-bg: #141D33; --info-fg: #9DB3F0;
  --neutral-bg: #262223; --neutral-fg: #D6CED1;
}
