/* ============================================================
   CLOSE BUTTON — a × that closes what it sits in (CloseButton.astro; first on the reveal card, 23.11.2026; the windows'
   close since 24.11.2026). Two sizes; the host places it (position, margins), the button keeps its look.
   Requires: tokens.css
   - s (default): the icon at 24 (close.svg) in a square of --close-btn-size (32 by default, the CardArrow s circle, so a ×
     in a corner lines up with an arrow in the opposite one); a 44 touch area (--tap-min) round it, unseen. No fill: it
     sits on its host's ground. The reveal card (/routines).
   - l (.close-btn--l): the icon at 24 in a square of --close-btn-size (48 by default; a window sets its own,
     --window-close), corners 20 (a 12 button + 8, the window's bar); filled with its ground (--close-btn-fill, the
     window's own fill: unseen, yet a long text scrolls under the square, not under the bare icon), Surface on hover.
     On a dark ground it is dark glass, as the menu: content scrolling under it shows blurred (review 11.11.2026), the
     page black on hover. The windows (window.css .window__close).
   ============================================================ */
:where(.close-btn) { position: relative; } /* low: a host's own position wins whatever order the files load in */
.close-btn {
  display: grid;
  place-items: center;
  flex: none; /* a square in a row stays a square */
  width: var(--close-btn-size, var(--space-md));
  height: var(--close-btn-size, var(--space-md));
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}
.close-btn svg { width: var(--space); height: var(--space); }
.close-btn::before { content: ""; position: absolute; inset: calc((var(--close-btn-size, var(--space-md)) - var(--tap-min)) / 2); }
.close-btn:focus-visible { outline: var(--border-thick) solid var(--color-accent-indigo); outline-offset: var(--border-thin); }

/* l */
.close-btn--l {
  width: var(--close-btn-size, var(--space-lg));
  height: var(--close-btn-size, var(--space-lg));
  border-radius: calc(var(--radius-md) + var(--space-xs)); /* 20 */
  background: var(--close-btn-fill, var(--color-bg-white));
  transition: background-color var(--duration-hover) var(--ease-hover);
}
.close-btn--l::before { content: none; } /* 48 is past the 44 to tap */
.theme-dark .close-btn--l {
  background: var(--color-glass-dark); -webkit-backdrop-filter: var(--glass-filter-dark); backdrop-filter: var(--glass-filter-dark);
}
/* the icon alone, its square filled only on hover (a filled square read as one more field): Surface on a light ground,
   the page black on a dark one */
@media (hover: hover) {
  .close-btn--l:hover { background: var(--color-surface); }
  .theme-dark .close-btn--l:hover { background: var(--color-bg); }
}
