/* fox.css - the approved 3D foxes, finished on every screen (JOB FOXES, 24 Nov 2026)
   Inese's rules (LESSONS.md, 12 and 24 Nov 2026):
     - ONE fox on a screen, a new pose on each page
     - decoration only: alt="", aria-hidden, it never covers a word or a button
     - on a laptop the fox is a companion: it stays in view at the side of the
       column while the page scrolls; on a phone it stays in the hero
     - the gentle movement is off when the device asks for reduced motion
   Loaded after site.css and laptop.css, so it only adds to the look. */

/* 1. the fox is a real picture now, so its box can be measured: the old
      background fox on the question text goes */
#ql-q .ql-qtext::after, #ql-subs .ql-qtext::after { content: none !important; }

/* 2. the fox beside a question (phone and small laptop): the text keeps its
      space, the fox never sits on a word */
.fox-q {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 78px; height: 104px; object-fit: contain; object-position: 50% 100%;
  pointer-events: none; user-select: none; animation: foxbob 4.5s ease-in-out infinite;
}
@media (min-width: 900px) { .fox-q { width: 168px; height: 158px; } }
.ql-qtext:has(> .fox-q) { position: relative; padding-right: 88px; min-height: 104px; }
@media (min-width: 900px) { .ql-qtext:has(> .fox-q) { padding-right: 200px; min-height: 168px; } }

/* 3. a screen with no hero: the fox stands on its own, right-aligned */
.fox-block {
  display: block; width: auto; height: auto; max-width: 104px; max-height: 170px;
  margin: 0 4px 8px auto; pointer-events: none; user-select: none;
  animation: foxbob 4.5s ease-in-out infinite;
}

/* 4. the companion: on a laptop the fox stays in view at the side of the
      column while the page scrolls (the script works out where there is room
      and puts it in --fox-left and --fox-maxw) */
@media (min-width: 1100px) {
  .fox-av.fox-float, .hero > .fox-av.fox-float, .ql-qtext > .fox-av.fox-float {
    position: fixed; left: var(--fox-left, auto); right: auto; top: 136px; bottom: auto;
    margin: 0 !important; transform: none;
    width: auto; height: 172px; max-width: var(--fox-maxw, 160px); max-height: 172px;
    z-index: 2; pointer-events: none; user-select: none;
    animation: foxbob 4.5s ease-in-out infinite;
  }
  /* the fox is out of the flow now, so the hero and the question get their
     space back - nothing else on the page moves */
  .fox-float-host.hero { min-height: 0; padding-right: 0; }
  .fox-float-host.ql-qtext { padding-right: 0; min-height: 0; }
  #ql-q .fox-float-host.ql-qtext, #ql-subs .fox-float-host.ql-qtext { padding-right: 0; min-height: 0; }
}

/* 5. the overlays: the site menu, the account panel, the side panel */
.fox-ov {
  display: block; width: auto; height: auto; max-width: 104px; max-height: 150px;
  margin: 0 0 6px auto; pointer-events: none; user-select: none;
  animation: foxbob 4.5s ease-in-out infinite;
}
/* the share pack header: the fox sits at the end of the pack's own header */
.fox-pack { position: absolute; right: 12px; top: 10px; margin: 0; max-width: 56px; max-height: 76px; }
.pp-h:has(> .fox-pack) { position: relative; padding-right: 78px; }
@media print { .fox-pack, .fox-ov { display: none !important; } }

/* 6. one fox at a time: while an overlay is open the page fox steps aside
      (Inese, 12 Nov: a panel may cover the fox) */
body.fox-overlay .fox-av { display: none !important; }

/* 7. the gentle movement is off when the device asks for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fox-av, .fox-q, .fox-block, .fox-ov, .fox-pack { animation: none !important; }
}
