/*
 * Foundation: Base Styles
 *
 * Global reset, typography, and base element styling following Rails conventions.
 * Includes progressive enhancement and accessibility features.
 */

/* Note: The global reset (* selector), html, and body base styles are
 * defined in application.css as the canonical entry point.
 * This file extends those base styles with additional layout rules. */

/* Zoom out content when modal or panel has content - iOS card effect */
body:has(#panel .panel-content) .app-content,
body:has(dialog.modal-dialog[open]) .app-content {
  transform: scale(var(--scale-zoom));
  transform-origin: center center;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* Custom thin scrollbar for Webkit browsers */
.app-content::-webkit-scrollbar {
  width: 6px;
}

.app-content::-webkit-scrollbar-track {
  background: transparent;
}

.app-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.app-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-lighter);
}

/* Progressive Enhancement - CSS Feature Support */
@supports (container-type: inline-size) {
  .content-main {
    container-type: inline-size;
  }
}

/* Reduced motion preference support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive Media */
img,
video,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

picture {
  display: contents;
}

iframe,
embed,
object {
  max-width: 100%;
}

/* Disable iOS long-press context menu on all links */
a {
  -webkit-touch-callout: none;
  user-select: none;
}

/* Horizontal dividers */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0 var(--space-lg);
}
