/* tema-chiaro.css — light theme of the Albero app (html.ak-light): paper background, ink text, gold accents.
 * Off by default. On: app.html?tema=chiaro, or a host site adds the class itself (corsi.warin.it does, and passes
 * its own palette and fonts by setting the --akl-* tokens below on <html>).
 * The symbolic colours of sefirot, channels, signs and planets stay as they are. */
html.ak-light {
  --akl-paper: #efeef6; --akl-paper-deep: #e2e0ee; --akl-ink: #221d15; --akl-ink-soft: #625f72; --akl-gold: #a07c33;
  --akl-gold-soft: #c6a566; --akl-line: #d1cee0; --akl-card: #f9f8fd; --akl-surface: #ffffff;
}
html.ak-light, html.ak-light body {
  --bg: var(--akl-paper);
  --glass: var(--akl-card);
  --glass-2: var(--akl-card);
  --line: var(--akl-line);
  --gold: var(--akl-gold);
  --text: var(--akl-ink);
  --muted: var(--akl-ink-soft);
  --akl-tint: color-mix(in srgb, var(--akl-gold) 12%, transparent);
  --akl-tint-soft: color-mix(in srgb, var(--akl-gold) 6%, transparent);
  color-scheme: light;
}

/* background: plain paper, no night sky */
html.ak-light body, html.ak-light body.ak-mod { background: var(--akl-paper); color: var(--akl-ink); }
html.ak-light body.ak-mod::before { display: none; }
html.ak-light #bg-canvas { display: none; }

/* ---------- reading panel ---------- */
html.ak-light body.ak-mod #detail {
  background: var(--akl-card); -webkit-backdrop-filter: none; backdrop-filter: none; text-shadow: none;
  border-left: 1px solid var(--akl-line);
}
html.ak-light body.ak-mod #detail .m-sheet-head { background: linear-gradient(to bottom, var(--akl-card) 70%, transparent); }
html.ak-light .dt-title { color: var(--akl-ink); }
html.ak-light .dt-sub, html.ak-light .dt-meta { color: var(--akl-ink-soft); }
html.ak-light .dt-block h3 { color: var(--akl-gold); }
html.ak-light .dt-block { border-top-color: var(--akl-line); }
html.ak-light .dt-block p, html.ak-light #detail { color: var(--akl-ink); }
html.ak-light .rows .row, html.ak-light .pl-row, html.ak-light .aspect { border-bottom-color: var(--akl-line); }
html.ak-light .pl-row:hover { background: var(--akl-tint-soft); }
html.ak-light .dt-back { border-color: var(--akl-line); color: var(--akl-ink-soft); }
html.ak-light #detail::-webkit-scrollbar-thumb { background: var(--akl-line); }

/* ---------- icon bar (views + legend) ---------- */
html.ak-light body.ak-mod #topbar #ak-views { border-color: var(--akl-line); background: var(--akl-card); }
html.ak-light body.ak-mod #topbar #ak-views button,
html.ak-light body.ak-mod #ak-legend button { color: var(--akl-ink-soft); }
html.ak-light body.ak-mod #ak-legend button:hover { color: var(--akl-ink); background: var(--akl-tint-soft); }
html.ak-light body.ak-mod #topbar #ak-views button.ak-on,
html.ak-light body.ak-mod #topbar #ak-views button.ak-body-btn.on,
html.ak-light body.ak-mod #topbar #ak-views .view-switch button.active,
html.ak-light body.ak-mod #ak-legend button.on { color: var(--akl-gold); background: var(--akl-tint); }
html.ak-light body.ak-mod #ak-legend,
html.ak-light body.ak-mod #ak-legend #lab-wheel,
html.ak-light body.ak-mod #topbar #ak-legend { border-color: var(--akl-line); }
html.ak-light #topbar, html.ak-light.ak-fill #topbar { border-bottom-color: var(--akl-line); background: transparent; }
html.ak-light #icon-rail { background: var(--akl-paper); border-right-color: var(--akl-line); }

/* ---------- colours you can change from /admin/albero-colori ----------
   Every --ak-* below is a default: an admin value is written inline on <html> by app2.js (loadSkyColors)
   and wins over these. Keep them at the html level (not on body), or the admin value would be shadowed. */
html.ak-light {
  /* the Tree at rest */
  --ak-sphere-keep: 1;                   /* sefirot discs in the pure colour chosen in admin (night theme: .4) */
  --ak-channel-keep: 1;                  /* lit channels in the pure colour of their sign (night theme: .7) */
  --ak-tree-edge: color-mix(in srgb, var(--akl-ink) 24%, var(--akl-paper));   /* rings of sefirot and channel borders */
  --ak-channel-off: var(--akl-surface);  /* empty and cusp channels */
  --ak-channel-off-edge: color-mix(in srgb, var(--akl-ink) 22%, var(--akl-paper));
  --ak-channel-off-text: var(--akl-ink);
  --ak-sphere-text: #ffffff;             /* names on the sefirot (astro-names lettering) */
  --ak-sphere-verb: #e8c468;             /* verbs under the names */
  /* the Tree with something selected */
  --ak-focus: #e8c468;                   /* glow and ring of what is selected */
  --ak-focus-channel: #f0d488;           /* a selected channel */
  --ak-focus-text: #120d02;              /* the label on a selected channel */
  --ak-recess: color-mix(in srgb, var(--akl-ink) 16%, var(--akl-paper));      /* sefirot left out */
  --ak-recess-channel: var(--akl-surface);                                    /* channels left out */
  --ak-recess-text: var(--akl-ink-soft);
  /* the wheel */
  --ak-wheel-ring: var(--akl-line);
  --ak-wheel-text: var(--akl-ink-soft);
  --ak-wheel-grey: #565b6e;              /* band of a sign with nothing in it */
  --ak-wheel-band-on: .24;               /* band opacity: sign with planets */
  --ak-wheel-band-faded: .12;            /* sign touched only by a cusp */
  --ak-wheel-band-off: .10;              /* empty sign */
  --ak-wheel-dim: .1;                    /* bands of the signs not selected */
  --ak-wheel-dim-text: .85;              /* names, letters and planets of the signs not selected */
  --ak-wheel-focus: #f0d488;             /* the selected sign and planet */
  /* body (Chakra view) */
  --ak-body-outline: var(--akl-ink);     /* the profile of the man */
  /* aspects (lines on the wheel and symbols in the lists) */
  --ak-aspect-conjunction: #f2b705;      /* yellow */
  --ak-aspect-opposition: #e5231b;       /* bright red */
  --ak-aspect-trine: #1f9d3a;            /* green */
  --ak-aspect-square: #ef6c00;           /* orange */
  --ak-aspect-sextile: #1565d8;          /* blue */
  --ak-aspect-opacity: .85;              /* aspect lines when none is selected */
}

/* ---------- zodiac wheel (SVG attributes lose to CSS) ---------- */
html.ak-light #wheel-svg > circle, html.ak-light #wheel-svg > line:not(.wtick):not(.wasp) { stroke: var(--ak-wheel-ring); }
/* aspect lines: their own strong colours on paper (stroke comes from ASPECTS / --ak-aspect-*), clearly visible */
html.ak-light body.ak-fused #wheel-svg .wasp:not(.wasp-sel) { opacity: var(--ak-aspect-opacity) !important; }
html.ak-light #wheel-svg .wasp { stroke-width: 2px; }
html.ak-light #wheel-svg .wsign, html.ak-light #wheel-svg .whouse { fill: var(--ak-wheel-text); }
html.ak-light #wheel-svg .wplanet-hit circle { fill: var(--akl-surface); }
html.ak-light body.ak-nodots #wheel-svg .wplanet.wplanet-sm { stroke: var(--akl-paper); filter: none; }

/* ---------- tree: soften the night glow, keep the symbolic colours ---------- */
html.ak-light #tree-svg { filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--akl-ink) 14%, transparent)); }

/* ---------- empty-chart note ---------- */
html.ak-light body.ak-fused.natal-empty #wheel-empty {
  background: var(--akl-card); border-color: var(--akl-line); color: var(--akl-ink);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--akl-ink) 10%, transparent);
}
html.ak-light #wheel-empty a { color: var(--akl-gold); }

/* ---------- mobile ---------- */
html.ak-light #m-tabbar, html.ak-light body.ak-mod #m-tabbar { background: var(--akl-paper-deep); border-top-color: var(--akl-line); }
html.ak-light #m-tabbar button { color: var(--akl-ink-soft); }
html.ak-light #m-tabbar button.active { color: var(--akl-gold); }
html.ak-light #m-tabbar button.active .ic { filter: none; }
@media (max-width: 979px) {
  html.ak-light #detail, html.ak-light body.ak-mod #detail { background: var(--akl-card); border-top: 1px solid var(--akl-line); }
  html.ak-light body.ak-mod #topbar #ak-views { background: var(--akl-card); }
}

/* ---------- the Tree on paper ---------- */
/* empty and faded channels (data-ch, written by tree-view.js), and channels left out of a selection */
html.ak-light #tree-svg .conduit[data-ch="off"], html.ak-light #tree-svg .conduit[data-ch="faded"] { stroke: var(--ak-channel-off) !important; opacity: 1 !important; filter: none !important; }
html.ak-light body.ak-mod.ak-has-focus #tree-svg .conduit:not(.ak-focus) { stroke: var(--ak-recess-channel) !important; opacity: 1 !important; filter: none !important; }
html.ak-light #tree-svg .conduit-edge[data-ch="off"], html.ak-light #tree-svg .conduit-edge[data-ch="faded"],
html.ak-light body.ak-mod.ak-has-focus #tree-svg .conduit-edge:not(.ak-focus) { stroke: var(--ak-channel-off-edge) !important; opacity: 1 !important; }
html.ak-light #tree-svg text[data-ch="off"], html.ak-light #tree-svg text[data-ch="faded"],
html.ak-light #tree-svg.tree-view[data-lettering] text[data-ch="off"], html.ak-light #tree-svg.tree-view[data-lettering] text[data-ch="faded"] { fill: var(--ak-channel-off-text) !important; }
html.ak-light body.ak-mod.ak-has-focus #tree-svg text[data-li]:not(.ak-focus),
html.ak-light body.ak-mod.ak-has-focus #tree-svg text[data-ci]:not(.ak-focus) { fill: var(--ak-channel-off-text) !important; }
/* names and verbs on the sefirot (the ones left out of a selection follow the rules below) */
html.ak-light #tree-svg.tree-view .node .it { fill: var(--ak-sphere-text); }
html.ak-light #tree-svg.tree-view .node .verb { fill: var(--ak-sphere-verb); }
/* sefirot left out of a selection: --ak-recess discs, dark names */
html.ak-light body.ak-mod.ak-has-focus #tree-svg .node.ak-dim .it,
html.ak-light body.ak-mod.ak-has-focus #tree-svg .node.ak-dim .he { fill: var(--ak-recess-text) !important; }
html.ak-light body.ak-mod.ak-has-focus #tree-svg .node.ak-dim .verb { fill: var(--akl-gold) !important; }

/* ---------- wheel: a selected sign lights up and the others fade, but names, letters and planets stay readable ---------- */
html.ak-light #wheel-svg text.wdim, html.ak-light #wheel-svg .wplanet-hit.wdim { opacity: var(--ak-wheel-dim-text) !important; }

/* ---------- tooltips of the icon bar ---------- */
html.ak-light body.ak-mod #topbar [data-ak-tip]::after {
  background: var(--akl-surface); color: var(--akl-ink); border-color: var(--akl-line);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--akl-ink) 14%, transparent);
}

/* ---------- Chakra view: the profile of the man drawn in ink on paper (the engine draws it white) ---------- */
html.ak-light #body svg path { stroke: var(--ak-body-outline); stroke-width: .6; }

/* ---------- reading panel head: letters + arcana on top, a divider, then the title and the data on one line ---------- */
html.ak-light .dt-head { display: grid; grid-template-columns: 1fr auto; align-items: start; column-gap: 12px; }
html.ak-light .dt-head > div:first-child { display: contents; }
html.ak-light .dt-head .dt-he-row, html.ak-light .dt-head > div > .dt-he { grid-column: 1; grid-row: 1; }
html.ak-light .dt-head > .dt-cards, html.ak-light .dt-head > .dt-emblem { grid-column: 2; grid-row: 1; justify-self: end; }
html.ak-light .dt-head .dt-title, html.ak-light .dt-head .dt-sub, html.ak-light .dt-head .dt-meta { grid-column: 1 / -1; }
html.ak-light .dt-he-row ~ .dt-title, html.ak-light .dt-he ~ .dt-title { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--akl-line); }
/* the data line: wraps instead of hiding; each item its own colour (spans .dt-mi-N added by app2.js) */
html.ak-light .dt-head .dt-meta { white-space: normal; line-height: 1.7; }
html.ak-light .dt-meta .dt-mi { white-space: nowrap; }
html.ak-light .dt-meta .dt-mi-1 { color: var(--akl-ink-soft); }
html.ak-light .dt-meta .dt-mi-2 { color: var(--akl-gold); }
html.ak-light .dt-meta .dt-mi-3 { color: #5a7a5c; }
html.ak-light .dt-meta .dt-mi-4 { color: #7a5a8c; }
html.ak-light .dt-meta .dt-mi-5 { color: #4a6a8c; }
html.ak-light .dt-meta .dt-sep { color: var(--akl-line); padding: 0 .35em; }
/* letters on top, and the arcana as tall as the letters with their names */
@media (min-width: 980px) {
  html.ak-light .dt-head .dt-he, html.ak-light .dt-head .dt-he2 { font-size: 56px; }
  html.ak-light .dt-head > .dt-cards .dt-card { width: auto; height: 74px; }
}
@media (max-width: 979px) { html.ak-light .dt-head > .dt-cards .dt-card { width: auto; height: 52px; } }
/* arcana without the coloured glow */
html.ak-light .dt-card { box-shadow: none !important; }
/* the panel's back button becomes the arrow at the top of the icon rail (app2.js, #ak-back) */
html.ak-light #detail .dt-back { display: none; }
#ak-back { display: block; width: 100%; margin: 0 0 8px; padding: 8px 0; border: 1px solid var(--akl-line, rgba(214,184,121,.22)); border-radius: 12px;
  background: var(--akl-card, transparent); color: var(--akl-ink-soft, #8b93b8); font-size: 18px; line-height: 1; cursor: pointer; }
#ak-back:hover { color: var(--akl-gold, #e8c468); }
#ak-back[hidden] { display: none; }
