/* HOMER interface motion. Load after the presentation styles.
   This file never targets the ball, game document, page-swipe layers, or image
   framing transforms. Native scrolling and dialog dismissal remain immediate. */
body[data-homer-theme="blue-glass"] {
  --h-motion-quick: 120ms;
  --h-motion-routine: 180ms;
  --h-motion-panel: 240ms;
  --h-motion-exit: 160ms;
  --h-motion-ease: cubic-bezier(.2,0,0,1);
  --h-motion-out: cubic-bezier(.3,0,1,1);
  --h-focus-color: #3267a5;
  --h-plate-shadow-rest: 0 18px 32px -16px rgba(28,61,94,.24),0 4px 10px rgba(28,61,94,.06);
  --h-plate-shadow-hover: 0 22px 36px -16px rgba(28,61,94,.28),0 5px 12px rgba(28,61,94,.08);
  --h-plate-shadow-press: 0 9px 20px -12px rgba(28,61,94,.22),0 2px 6px rgba(28,61,94,.07);
}

/* The hit target and reviewed crop stay still. Depth alone signals that a
   product can open, so a nearby bookmark never moves under the pointer. */
body[data-homer-theme="blue-glass"] .shop-card .shop-photo,
body[data-homer-theme="blue-glass"] :is(.daily-glass-media,a.daily-art,a.daily-product-art) {
  transition: box-shadow var(--h-motion-routine) var(--h-motion-ease);
}
body[data-homer-theme="blue-glass"] .home-issue:hover .daily-glass-media,
body[data-homer-theme="blue-glass"] :is(a.daily-art,a.daily-product-art):hover {
  transform: none;
}
@media (hover:hover) and (pointer:fine) {
  body[data-homer-theme="blue-glass"] .shop-card .shop-photo:has(> .shop-product-open:hover),
  body[data-homer-theme="blue-glass"] .home-issue:hover .daily-glass-media,
  body[data-homer-theme="blue-glass"] :is(a.daily-art,a.daily-product-art):hover {
    box-shadow: var(--h-plate-shadow-hover);
  }
}
body[data-homer-theme="blue-glass"] .shop-card .shop-photo:has(> .shop-product-open:active),
body[data-homer-theme="blue-glass"] .home-issue:active .daily-glass-media,
body[data-homer-theme="blue-glass"] :is(a.daily-art,a.daily-product-art):active {
  box-shadow: var(--h-plate-shadow-press);
  transition-duration: var(--h-motion-quick);
}

/* Controls respond at their own surface; no global button animation can leak
   into the golf-ball controls or an embedded game. */
body[data-homer-theme="blue-glass"] :is(
  .shop-bookmark,.member-save,.shop-filter-chip,.shop-dock-filter,
  .shop-tools .text-btn,.shop-categories button,.product-browse a,
  .product-purchase-actions .btn,.product-secondary-actions .social-link,
  .social-gallery-controls button,.social-detail-thumbs button,
  .daily-listen a,.daily-pill,.daily-tools :is(a,button),
  .home-issue-read,.homer-follow a,.updates-fields .btn,
  .saved-entry-actions .btn,.saved-heading-actions .btn,
  .member-save-retry,[data-gallery-retry]
) {
  transition: background-color var(--h-motion-quick) var(--h-motion-ease),
    border-color var(--h-motion-quick) var(--h-motion-ease),
    color var(--h-motion-quick) var(--h-motion-ease),
    box-shadow var(--h-motion-quick) var(--h-motion-ease);
}
body[data-homer-theme="blue-glass"] .shop-bookmark,
body[data-homer-theme="blue-glass"] .shop-bookmark:active:not(:disabled) {
  transform: none;
}
body[data-homer-theme="blue-glass"] .shop-bookmark svg {
  transition: transform var(--h-motion-quick) var(--h-motion-ease),
    opacity var(--h-motion-quick) var(--h-motion-ease);
}
body[data-homer-theme="blue-glass"] .shop-bookmark:active:not(:disabled) svg {
  transform: scale(.9);
}
body[data-homer-theme="blue-glass"] .shop-bookmark::before {
  transition: background-color var(--h-motion-quick) var(--h-motion-ease),
    border-color var(--h-motion-quick) var(--h-motion-ease),
    box-shadow var(--h-motion-quick) var(--h-motion-ease);
}
body[data-homer-theme="blue-glass"] :is(
  .member-save,.shop-dock-filter,.shop-tools .text-btn,.daily-listen a,
  .daily-pill,.product-purchase-actions .btn,.updates-fields .btn,
  .saved-entry-actions .btn,.saved-heading-actions .btn
):active:not(:disabled) {
  box-shadow: inset 0 2px 5px rgba(26,49,75,.15);
}
body[data-homer-theme="blue-glass"] :is(.social-gallery-controls button,.dialog-close):active:not(:disabled) {
  background-color: #e4edf6;
}

/* Save color and icon fill still follow the confirmed aria-pressed state.
   A pending request has no success flourish or endlessly running spinner. */
body[data-homer-theme="blue-glass"] :is([data-save-product],[data-saved-key])[data-save-state="pending"] {
  opacity: .78;
  cursor: progress;
}
body[data-homer-theme="blue-glass"] .shop-bookmark[data-save-state="pending"] svg {
  opacity: .55;
  transform: none;
}
body[data-homer-theme="blue-glass"] :is([data-save-product],[data-saved-key])[data-save-state="error"] {
  opacity: 1;
}
body[data-homer-theme="blue-glass"] .shop-bookmark[data-save-state="error"]::before {
  border-color: #8d4f41;
}
body[data-homer-theme="blue-glass"] .member-save-feedback {
  flex-basis: 100%;
  grid-column: 1 / -1;
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid rgba(141,79,65,.25);
  border-radius: 10px;
  color: #613e36;
  background: #fff8f5;
  font: 400 12px/1.5 var(--h-sans);
  text-transform: none;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
body[data-homer-theme="blue-glass"] .member-save-retry,
body[data-homer-theme="blue-glass"] [data-gallery-retry] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 0;
  color: inherit;
  background: transparent;
  font: 600 12px/1.4 var(--h-sans);
  text-decoration: underline;
  text-underline-offset: 4px;
}
body[data-homer-theme="blue-glass"] :is(.member-save-feedback,[data-gallery-retry])[hidden] { display: none; }

/* Reserve status space only inside an existing multi-photo gallery. Pending
   thumbnails retain their photograph, while the large current view stays put. */
body[data-homer-theme="blue-glass"] .gallery-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 12px;
  min-height: 24px;
  margin-top: 6px;
  color: var(--bg-muted);
  font: 400 12px/1.5 var(--h-sans);
}
body[data-homer-theme="blue-glass"] .social-detail-thumbs button[aria-busy="true"] {
  outline: 2px dashed var(--h-focus-color);
  outline-offset: 2px;
}
body[data-homer-theme="blue-glass"] .social-gallery-controls button:disabled {
  opacity: .4;
  cursor: default;
}

/* Navigation labels stay anchored. A focus ring is immediate, never delayed by
   the decorative transitions on the control underneath it. */
body[data-homer-theme="blue-glass"] :is(.social-header .main-navigation a,.social-mobile-nav a) {
  transition: color var(--h-motion-quick) var(--h-motion-ease);
}
body[data-homer-theme="blue-glass"] :is(
  .shop-product-open,.shop-title,.shop-bookmark,.member-save,
  .shop-filter-chip,.shop-dock-filter,.shop-tools .text-btn,
  .shop-categories button,.product-browse a,.product-purchase-actions .btn,
  .product-secondary-actions .social-link,.social-photo-track,
  .social-gallery-controls button,.social-detail-thumbs button,
  .daily-listen a,.daily-pill,.daily-tools :is(a,button),
  .home-issue,.daily-edition-open,a.daily-art,a.daily-product-art,
  .social-header .main-navigation a,.social-mobile-nav a,
  .updates-fields :is(input,button),.member-save-retry,[data-gallery-retry]
):focus-visible {
  outline: 2px solid var(--h-focus-color);
  outline-offset: 4px;
}
body[data-homer-theme="blue-glass"] .home-issue:focus-visible { outline-offset: -5px; }
body[data-homer-theme="blue-glass"] .shop-product-open:focus-visible { outline-offset: -4px; }

/* A native modal owns focus and the top layer. Opening is a short, damped
   settle; removing open closes immediately, including during this animation. */
body[data-homer-theme="blue-glass"] #dialog {
  max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
body[data-homer-theme="blue-glass"] #dialog[open][data-dialog-motion] {
  animation: homer-dialog-enter var(--h-motion-panel) var(--h-motion-ease);
}
body[data-homer-theme="blue-glass"] #dialog[open][data-dialog-motion]::backdrop {
  animation: homer-backdrop-enter var(--h-motion-routine) var(--h-motion-ease);
}
body[data-homer-theme="blue-glass"] #dialog :is(.btn,.text-btn,.dialog-close) {
  transition: background-color var(--h-motion-quick) var(--h-motion-ease),
    color var(--h-motion-quick) var(--h-motion-ease),
    border-color var(--h-motion-quick) var(--h-motion-ease);
}
body[data-homer-theme="blue-glass"] #dialog :is(button,a,input,select,textarea):focus-visible {
  outline: 2px solid var(--h-focus-color);
  outline-offset: 3px;
}
body[data-homer-theme="blue-glass"] #toast.toast {
  bottom: max(24px,calc(env(safe-area-inset-bottom) + 16px));
  line-height: 1.5;
  animation: homer-backdrop-enter var(--h-motion-quick) var(--h-motion-ease);
}
@keyframes homer-dialog-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes homer-backdrop-enter { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion:reduce) {
  body[data-homer-theme="blue-glass"] {
    --h-motion-quick: 0ms;
    --h-motion-routine: 0ms;
    --h-motion-panel: 0ms;
    --h-motion-exit: 0ms;
  }
  body[data-homer-theme="blue-glass"] .shop-bookmark:active:not(:disabled) svg { transform: none; }
  body[data-homer-theme="blue-glass"] #dialog[open][data-dialog-motion],
  body[data-homer-theme="blue-glass"] #dialog[open][data-dialog-motion]::backdrop,
  body[data-homer-theme="blue-glass"] #toast.toast { animation: none; }
}
