/* ============================================================
   Glow Card — cursor-proximity BORDER glow (Noir Editorial, gold)
   v2.3: inner light "spot" removed (per Roman) — only the glowing
         BORDER segment near the cursor + the :hover lift remain.
         Removed: base fill/core radial (background-image) and the
         screen-blend overlay (.nc-glow-card__inner). Kept: ::before
         border-ring glow, corner-radius + flex fixes, translate lift.
   v2.2: hover lift restored via independent `translate` (sidesteps
         `.nc-reveal.is-in{transform:none}`); reveal entrance untouched.
   v2:   localized spot following the cursor (card-local --mx/--my).
   No background-attachment:fixed → robust under filter/transform
   ancestors (.nc-reveal leaves filter:blur(0)).
   ============================================================ */

:root {
  --glow-hue:          46;          /* #D4AF37 classic gold */
  --glow-bg:           #111111;     /* matches --color-bg-surface */
  --glow-backdrop:     rgba(153,153,153,0.08);
  --glow-size:         200;         /* spotlight radius px — reach of the border glow */
  --glow-border:       2;           /* border width px */
  --glow-radius:       14;          /* corner radius px */

  /* opacity knobs */
  --glow-border-opacity: 1.0;       /* glowing border segment (active knob) */
  /* --glow-fill-opacity / --glow-core-opacity / --glow-overlay-opacity:
     no longer used — inner fill spot + screen overlay removed in v2.3. */

  --glow-lift:           4px;       /* :hover lift distance (knob) */
}

/* ── Base card ─────────────────────────────────────────────── */
.nc-glow-card {
  --border-size: calc(var(--glow-border, 2) * 1px);
  --spot:        calc(var(--glow-size, 200) * 1px);
  --on:          0;                 /* 0 idle → 1 hover (JS toggles) */

  position: relative;
  isolation: isolate;               /* contain stacking within the card */
  border-radius: calc(var(--glow-radius, 14) * 1px);
  border: var(--border-size) solid var(--glow-backdrop);
  background-color: var(--glow-bg);
  overflow: hidden;
  box-shadow: 0 1rem 2rem -1rem hsl(0 0% 0% / 0.6);

  /* inner fill spotlight removed (v2.3) — card body stays flat. */

  transition: border-color .3s ease, box-shadow .3s ease;
}

/* ── Border glow — only the segment near the cursor ─────────── */
.nc-glow-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: var(--border-size);
  pointer-events: none;

  background: radial-gradient(
    calc(var(--spot) * 0.9) calc(var(--spot) * 0.9)
    at calc(var(--mx, -9999) * 1px) calc(var(--my, -9999) * 1px),
    hsl(var(--glow-hue) 100% 62% / calc(var(--glow-border-opacity) * var(--on))) 0%,
    transparent 72%
  );
  background-repeat: no-repeat;
  filter: brightness(1.9);

  /* show gradient only in the border ring */
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
}

/* ── Top glow overlay — DISABLED (v2.3) ─────────────────────── */
/* JS still injects .nc-glow-card__inner for structure, but the screen-blend
   light spot it carried is removed; hide it so no spot reads over content. */
.nc-glow-card__inner { display: none; }

/* ── Content wrapper (sits above the border layer) ──────────── */
.nc-glow-card__content {
  position: relative;
  z-index: 1;
  height: 100%;
}

/* ============================================================
   THEME INTEGRATION — noircraftlab Selected Work cards
   Scoped to .article-grid so generic .nc-glow-card stays reusable.
   ============================================================ */

/* Match theme corner radius (--radius-lg: 12px) instead of generic 14 */
.article-grid .nc-glow-card,
.home-services__grid .nc-glow-card { --glow-radius: 12; }

/* glow-card.js wraps card children in .nc-glow-card__content; that wrapper is
   not flex, which breaks .article-grid .card's column layout (.card-body uses
   flex:1 to fill height + bottom-align meta/live links). Restore the chain. */
.article-grid .nc-glow-card__content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

/* Selected Work cards put a full-bleed, OPAQUE screenshot inside __content
   (z-index:1), which paints over the border-glow ring (::before, z-index:0).
   Lift the ring above the screenshot so the cursor-proximity edge glow shows.
   Scoped to .article-grid only — Services cards have transparent content and
   never needed this. The ring is masked to the 2px edge + pointer-events:none,
   so nothing covers the screenshot, the floating glass panel, or the text. */
.article-grid .nc-glow-card::before { z-index: 2; }

/* ── :hover lift — via independent `translate` ───────────────────────
   Theme's `.card:hover{transform:translateY(-4px)}` is pinned away by
   `.nc-reveal.is-in{transform:none}`. We use the separate `translate`
   property (composes with transform, not reset by it). Reveal entrance
   keeps its own transform/.6s timing; this just adds a snappy hover lift. */
.article-grid .card.nc-glow-card,
.home-services__grid .home-service.nc-glow-card {
  will-change: translate;
  transition: translate .25s ease, border-color .3s ease, box-shadow .3s ease;
}
.article-grid .card.nc-glow-card:hover,
.home-services__grid .home-service.nc-glow-card:hover {
  translate: 0 calc(-1 * var(--glow-lift, 4px));
}

/* Respect reduced-motion: no lift (reveal is already disabled for these users). */
@media (prefers-reduced-motion: reduce) {
  .article-grid .card.nc-glow-card,
  .home-services__grid .home-service.nc-glow-card { transition: none; }
  .article-grid .card.nc-glow-card:hover,
  .home-services__grid .home-service.nc-glow-card:hover { translate: none; }
}
