/*
 * Foundation: Utilities
 *
 * Common utility classes for spacing, layout, typography, and states.
 * Follows Rails utility-first approach while maintaining semantic naming.
 */

/* Visibility Utilities */
.hidden {
  display: none;
}

/* SVG Icon Styling */
svg {
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
}

/* Icon size variants */
.icon {
  width: var(--icon-size-md);
  height: var(--icon-size-md);
  flex-shrink: 0;
}

/* Turbo Frame Styles */
turbo-frame {
  display: block;
}

/* Reduce motion for users who prefer it - target specific animated elements */
@media (prefers-reduced-motion: reduce) {
  dialog.modal-dialog {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================================
   WHERE A TAP GOES
   One look per destination, everywhere, so people can tell before they tap:
   - a › chevron: a new page (.link-chevron after link text, .row-chevron at
     the end of a whole-row link);
   - no chevron, a button shape: opens a sheet, panel or modal, or acts;
   - a ⌄ that turns over: opens in place (.disclosure-chevron in a summary);
   - ↗: leaves the app.
   Every whole-row link shows a background on hover and while pressed.
   ============================================================================ */

.link-chevron::after,
.row-chevron::after {
  content: "";
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("/assets/chevron-right-8a128b85.svg") center / contain no-repeat;
  mask: url("/assets/chevron-right-8a128b85.svg") center / contain no-repeat;
}

.link-chevron::after {
  display: inline-block;
  width: 0.95em;
  height: 0.95em;
  margin-left: 2px;
  vertical-align: -0.12em;
}

a.row-chevron {
  position: relative;
  padding-right: 40px;
}

.row-chevron::after {
  position: absolute;
  top: 50%;
  right: 14px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  color: var(--tx3);
}

a.row-chevron,
a.row-chevron:hover {
  color: inherit;
}

@media (hover: hover) {
  a.row-chevron:hover {
    background: var(--sf2);
  }
}

a.row-chevron:active {
  background: color-mix(in srgb, var(--sf2) 92%, var(--tx));
  opacity: 1;
}

.disclosure-chevron {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  vertical-align: -0.2em;
  transition: transform var(--spring-dur) var(--spring);
}

details[open] > summary .disclosure-chevron {
  transform: rotate(180deg);
}
