/* الگوی صالح — button styles, button colour, menu selection + hover effects.
   Picked in «تنظیمات ظاهر» → «دکمه‌ها و منو»:
   html[data-btn]        default (as designed) · mac · flat · outline · tonal
   html[data-btn-color]  primary (default) · accent · ink
   html[data-navfx]      glide (default) · glow · line · none    → js/nav-fx.js moves .nav-ind
   html[data-navhover]   tint (default) · spot · lift · none
   Motion per Emil Kowalski: ease-out, ≤300ms for UI, hover gated to fine pointers, press = scale(.97). */

/* ---------- button colour ---------- */
html[data-btn-color="accent"] { --btn: var(--mint-700); --btn-fg: #fff; }
html[data-btn-color="ink"]    { --btn: var(--navy-800); --btn-fg: var(--paper); }
html[data-theme="shab"][data-btn-color="accent"] { --btn-fg: var(--on-primary); }

/* ---------- button styles ---------- */
/* mac — capsule of tinted glass, the way macOS draws its prominent buttons */
html[data-btn="mac"] .btn { border-radius: var(--r-full); }
html[data-btn="mac"] .btn--primary {
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .03) 52%, rgba(0, 0, 0, .05)), color-mix(in srgb, var(--btn) 94%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -1px 0 rgba(0, 0, 0, .16), 0 1px 2px rgba(0, 0, 0, .12), 0 8px 18px -10px color-mix(in srgb, var(--btn) 70%, transparent);
}
html[data-btn="mac"] .btn--primary:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, .06) 52%, rgba(0, 0, 0, .03)), color-mix(in srgb, var(--btn) 97%, transparent); }
html[data-btn="mac"] .btn--primary:active { filter: brightness(.94); }
html[data-btn="mac"] .btn { transition: transform 160ms var(--ease-out), filter 150ms ease, box-shadow 150ms ease; }
html[data-btn="mac"] .btn--quiet {
  background: linear-gradient(180deg, rgba(var(--rim-rgb), .55), rgba(var(--rim-rgb), .12)), rgba(var(--surface-rgb), .4);
  -webkit-backdrop-filter: blur(12px) saturate(180%); backdrop-filter: blur(12px) saturate(180%);
  border-color: rgba(var(--rim-rgb), calc(.7 * var(--rim-o, 1)));
  box-shadow: inset 0 1px 0 rgba(var(--rim-rgb), calc(.9 * var(--rim-o, 1))), 0 1px 2px rgba(var(--shadow-rgb), .08), 0 4px 10px -6px rgba(var(--shadow-rgb), .2);
}
html[data-btn="mac"] .btn--quiet:hover { background: linear-gradient(180deg, rgba(var(--rim-rgb), .7), rgba(var(--rim-rgb), .2)), rgba(var(--surface-rgb), .55); }

/* flat — solid colour, no light, no shadow */
html[data-btn="flat"] .btn--primary { background-image: none; box-shadow: none; }
html[data-btn="flat"] .btn--quiet { background: rgba(var(--ink-rgb), .06); border-color: transparent; box-shadow: none; }
html[data-btn="flat"] .btn--quiet:hover { background: rgba(var(--ink-rgb), .1); }

/* outline — line only, fills softly on hover */
html[data-btn="outline"] .btn--primary { background: transparent; color: var(--btn); border: 1.5px solid var(--btn); box-shadow: none; }
html[data-btn="outline"] .btn--primary:hover { background: color-mix(in srgb, var(--btn) 9%, transparent); }
html[data-btn="outline"] .btn--quiet { background: transparent; border: 1.5px solid var(--line-strong); box-shadow: none; }

/* tonal — a light wash of the colour, text in the colour */
html[data-btn="tonal"] .btn--primary { background: color-mix(in srgb, var(--btn) 14%, rgba(var(--surface-rgb), .7)); color: color-mix(in srgb, var(--btn) 92%, #000); box-shadow: none; }
html[data-theme="shab"][data-btn="tonal"] .btn--primary { color: var(--btn); }
html[data-btn="tonal"] .btn--primary:hover { background: color-mix(in srgb, var(--btn) 22%, rgba(var(--surface-rgb), .7)); }
html[data-btn="tonal"] .btn--quiet { background: rgba(var(--surface-rgb), .5); border-color: transparent; }

/* menu line colour («رنگ خط منو»): green (brand accent, default) or blue (theme primary) */
:root { --nav-line: var(--mint-500); }
html[data-navcolor="primary"] { --nav-line: var(--navy-600); }

/* ---------- menu selection indicator (.nav-ind, placed by js/nav-fx.js) ---------- */
.nav { position: relative; }  /* .tabbar is already position: fixed, which anchors the indicator */
.nav a, .tabbar a { position: relative; z-index: 1; }
.nav-ind { position: absolute; z-index: 0; top: 0; left: 0; pointer-events: none; border-radius: var(--r-md); will-change: transform; }
.tabbar .nav-ind { border-radius: 20px; }
/* with an indicator on, the item itself drops its own background */
html:not([data-navfx="none"]) .nav-ready a[aria-current="page"] { background: none !important; box-shadow: none !important; }

/* glide — a glass pill */
html[data-navfx="glide"] .nav-ind, html:not([data-navfx]) .nav-ind {
  background: linear-gradient(180deg, rgba(var(--surface-rgb), .96), rgba(var(--surface-rgb), .74));
  box-shadow: inset 0 1px 0 rgba(var(--rim-rgb), calc(.95 * var(--rim-o, 1))), inset 0 0 0 1px rgba(var(--rim-rgb), calc(.5 * var(--rim-o, 1))),
              0 1px 2px rgba(var(--shadow-rgb), .08), 0 8px 18px -8px rgba(var(--shadow-rgb), .26);
}
/* glow — a lightly tinted pill with a soft line of light underneath, like light pooling under glass */
html[data-navfx="glow"] .nav-ind {
  background: color-mix(in srgb, var(--btn) 7%, rgba(var(--surface-rgb), .55));
  box-shadow: inset 0 1px 0 rgba(var(--rim-rgb), calc(.8 * var(--rim-o, 1))), inset 0 0 0 1px color-mix(in srgb, var(--btn) 12%, transparent);
}
html[data-navfx="glow"] .nav-ind::after { /* the line of light under the item */
  content: ""; position: absolute; inset-inline: 26%; inset-block-end: 3px; height: 2px; border-radius: 2px;
  background: color-mix(in srgb, var(--nav-line) 95%, transparent);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--nav-line) 55%, transparent), 0 4px 12px 2px color-mix(in srgb, var(--nav-line) 25%, transparent);
}
html[data-navfx="glow"] .tabbar .nav-ind::after { inset-inline: 32%; inset-block-end: 3px; }
html[data-navfx="glow"] .nav-ready a[aria-current="page"] { color: var(--navy-800); }
/* line — just a slim bar */
html[data-navfx="line"] .nav-ind { background: none; }
html[data-navfx="line"] .nav-ind::before {
  content: ""; position: absolute; inset-block: 9px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--nav-line);
}
html[data-navfx="line"] .tabbar .nav-ind::before { inset-block: auto 3px; inset-inline: 34%; width: auto; height: 2.5px; background: var(--nav-line); } /* under the label, like «درخشش» */
/* line/glow under the label: give the label room above it */
html:is([data-navfx="line"], [data-navfx="glow"]) .tabbar a { padding-bottom: 12px; }

/* ---------- hover effects (only where a real pointer can hover) ---------- */
@media (hover: hover) and (pointer: fine) {
  .nav a .icon, .tabbar a .icon { transition: transform 200ms var(--ease-out); }
  /* spot — a soft light follows the pointer across the item (js/nav-fx.js sets --mx/--my) */
  html[data-navhover="spot"] :is(.nav a, .tabbar a, .nav-btn):hover {
    background: radial-gradient(90px circle at var(--mx, 50%) var(--my, 50%), rgba(var(--rim-rgb), calc(.75 * var(--rim-o, 1) + .1)), rgba(var(--rim-rgb), 0) 70%), rgba(var(--surface-rgb), .25);
  }
  /* lift — the icon steps forward a touch */
  html[data-navhover="lift"] :is(.nav a, .nav-btn):hover .icon { transform: translateX(-3px) scale(1.08); }
  html[data-navhover="lift"] .tabbar a:hover .icon { transform: translateY(-2px) scale(1.08); }
  html[data-navhover="lift"] :is(.nav a, .nav-btn):hover { background: none; }
  /* none */
  html[data-navhover="none"] :is(.nav a, .tabbar a, .nav-btn):hover { background: none; }
}
html[data-navhover] .nav a:active, html[data-navhover] .tabbar a:active { transform: scale(.97); transition: transform 160ms var(--ease-out); }

/* ---------- «نشان ردیف بعدی»: how the next session stands out in a list (html[data-rowmark]) ---------- */
.timeline .is-next a { position: relative; }
/* stripe (default) — soft tint with a side bar */
html:not([data-rowmark]) .timeline .is-next a,
html[data-rowmark="stripe"] .timeline .is-next a { background: rgba(var(--accent-soft-rgb), .55); box-shadow: inset -2px 0 0 var(--mint-500); }
/* glass — a raised glass pill, no bar */
html[data-rowmark="glass"] .timeline .is-next a {
  background: linear-gradient(180deg, rgba(var(--surface-rgb), .95), rgba(var(--surface-rgb), .7));
  box-shadow: inset 0 1px 0 rgba(var(--rim-rgb), calc(.95 * var(--rim-o, 1))), inset 0 0 0 1px rgba(var(--rim-rgb), calc(.55 * var(--rim-o, 1))),
              0 1px 2px rgba(var(--shadow-rgb), .07), 0 10px 22px -12px rgba(var(--shadow-rgb), .3);
}
/* shamseh — a small eslimi rosette marks the row, no fill */
html[data-rowmark="shamseh"] .timeline .is-next a { padding-inline-start: 34px; }
html[data-rowmark="shamseh"] .timeline .is-next a::before {
  content: ""; position: absolute; inset-inline-start: 6px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  background: var(--orn-ink); -webkit-mask: var(--orn-shamseh) center / contain no-repeat; mask: var(--orn-shamseh) center / contain no-repeat;
}
html[data-rowmark="shamseh"] .timeline .is-next strong { color: var(--navy-600); }
/* dot — a small live dot with a slow, soft halo */
html[data-rowmark="dot"] .timeline .is-next a { padding-inline-start: 28px; }
html[data-rowmark="dot"] .timeline .is-next a::before {
  content: ""; position: absolute; inset-inline-start: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%;
  background: var(--mint-500); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .18);
}
@media (prefers-reduced-motion: no-preference) {
  html[data-rowmark="dot"] .timeline .is-next a::before { animation: rowmark-halo 2.4s cubic-bezier(0.23, 1, 0.32, 1) infinite; }
  @keyframes rowmark-halo { 0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .45); } 70%, 100% { box-shadow: 0 0 0 9px rgba(var(--accent-rgb), 0); } }
}
html[data-rowmark="dot"] .timeline .is-next strong { color: var(--navy-600); }

@media (prefers-reduced-motion: reduce) { .nav-ind { transition: none !important; } }
.nav-ind { transform-origin: 0 0; }
