/* Shared theme tokens (--ay-*) for the public surface. Owned by the theme stream.
   Light is the default. Dark is the single «Ashiyan Night» look: the values below equal the --an-* tokens of ashiyan-night.css
   (tests/test_theme_contrast.py keeps them equal and checks every contrast pair). Page CSS must use var(--ay-*) only. */
:root{
  color-scheme:light;
  --ay-bg:#F6F7FA;
  --ay-surface:#FFFFFF;
  --ay-surface-2:#EEF1F6;
  --ay-surface-3:#E5EAF4;
  --ay-border:#DDE2EC;
  --ay-border-strong:#7C8799;
  --ay-text:#101D35;
  --ay-text-muted:#55637A;
  --ay-accent:#85630F;
  --ay-accent-soft:#F5ECD6;
  --ay-accent-fill-hi:#EAD39C;
  --ay-accent-fill-lo:#C6A563;
  --ay-accent-fill:linear-gradient(135deg,var(--ay-accent-fill-hi),var(--ay-accent-fill-lo));
  --ay-on-accent:#0B1426;
  --ay-ok:#047857;
  --ay-bad:#B91C1C;
  --ay-warn:#92600A;
  --ay-focus:#1D4ED8;

  /* Elevation and shadows */
  --ay-shadow-sm:0 1px 3px rgba(16,29,53,.07),0 1px 2px rgba(16,29,53,.04);
  --ay-shadow-md:0 6px 18px rgba(16,29,53,.08),0 2px 6px rgba(16,29,53,.04);
  --ay-shadow-lg:0 14px 32px rgba(16,29,53,.11),0 4px 10px rgba(16,29,53,.05);
  --ay-shadow-glow:0 0 24px rgba(198,165,99,.35);

  /* Radius scale */
  --ay-r-sm:8px;
  --ay-r-md:14px;
  --ay-r-lg:20px;
  --ay-r-xl:26px;
  --ay-r-pill:999px;

  /* Transitions */
  --ay-tr-fast:150ms cubic-bezier(.2,.8,.2,1);
  --ay-tr-base:240ms cubic-bezier(.2,.8,.2,1);

  /* Shared typography, rhythm and touch targets; no page-specific palette. */
  --ay-font:Vazirmatn,Tahoma,sans-serif;
  --ay-text-sm:12px;
  --ay-text-base:14px;
  --ay-leading:1.7;
  --ay-space-1:4px;
  --ay-space-2:8px;
  --ay-space-3:12px;
  --ay-space-4:16px;
  --ay-space-6:24px;
  --ay-touch:44px;
}

html.dark{
  color-scheme:dark;
  --ay-bg:#080F20;
  --ay-surface:#101D35;
  --ay-surface-2:#182B45;
  --ay-surface-3:#213753;
  --ay-border:#2A3750;
  --ay-border-strong:#7C8EA6;
  --ay-text:#F5F4F0;
  --ay-text-muted:#A8B5C7;
  --ay-accent:#C6A563;
  --ay-accent-soft:#2A2414;
  --ay-accent-fill-hi:#EAD39C;
  --ay-accent-fill-lo:#C6A563;
  --ay-accent-fill:linear-gradient(135deg,var(--ay-accent-fill-hi),var(--ay-accent-fill-lo));
  --ay-on-accent:#0B1426;
  --ay-ok:#5CC9A0;
  --ay-bad:#F08A8A;
  --ay-warn:#E8B864;
  --ay-focus:#8DB8F2;

  /* Night elevation and shadows */
  --ay-shadow-sm:0 2px 6px rgba(0,0,0,.45);
  --ay-shadow-md:0 8px 24px -6px rgba(0,0,0,.65),0 0 0 1px rgba(198,165,99,.12);
  --ay-shadow-lg:0 18px 42px -10px rgba(0,0,0,.80),0 0 0 1px rgba(198,165,99,.18);
  --ay-shadow-glow:0 0 30px rgba(198,165,99,.40);
}

/* theme switch button (components/theme_switch.html, or the floating fallback mounted by theme_switch.js) */
.ay-theme-switch{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  padding:0;
  border-radius:50%;
  border:1px solid var(--ay-border-strong);
  background:var(--ay-surface);
  color:var(--ay-text);
  cursor:pointer;
  font:inherit;
  transition:border-color var(--ay-tr-fast),background var(--ay-tr-fast),transform var(--ay-tr-fast);
}
.ay-theme-switch:hover{
  background:var(--ay-surface-2);
  border-color:var(--ay-accent);
  transform:scale(1.05);
}
.ay-theme-switch:focus-visible{
  outline:2px solid var(--ay-focus);
  outline-offset:2px;
}
.ay-theme-switch svg{
  width:20px;
  height:20px;
  display:block;
  transition:transform var(--ay-tr-fast);
}
.ay-theme-switch .ay-moon{display:block}
.ay-theme-switch .ay-sun{display:none}
html.dark .ay-theme-switch .ay-moon{display:none}
html.dark .ay-theme-switch .ay-sun{display:block;color:var(--ay-accent)}

.ay-theme-float{
  position:fixed;
  inset-inline-end:max(12px,env(safe-area-inset-left),env(safe-area-inset-right));
  top:calc(10px + env(safe-area-inset-top));
  z-index:60;
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  opacity:.94;
  box-shadow:var(--ay-shadow-md);
}
.ay-theme-float svg{width:20px;height:20px}

/* Light-only luxury palette; values centralised without changing existing visuals.
   Page styles reference these tokens rather than hard-coded hex colours. */
:root{
  --ay-luxe-08182f:#08182f;
  --ay-luxe-10223d:#10223d;
  --ay-luxe-112c4e:#112c4e;
  --ay-luxe-142943:#142943;
  --ay-luxe-20466e:#20466e;
  --ay-luxe-64748b:#64748b;
  --ay-luxe-7a581a:#7a581a;
  --ay-luxe-8e713a:#8E713A;
  --ay-luxe-9d762e:#9d762e;
  --ay-luxe-be9046:#be9046;
  --ay-luxe-e1d5bf:#e1d5bf;
  --ay-luxe-e6c17a:#e6c17a;
  --ay-luxe-faf3e3:#faf3e3;
  --ay-luxe-faf7f0:#faf7f0;
  --ay-luxe-fff0c3:#fff0c3;
  --ay-luxe-fff8e8:#fff8e8;
  --ay-luxe-ffffff:#ffffff;
}
