/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Turbo Frames are inline by default; treat them as block so they participate
   in vertical-spacing utilities (space-y-*) and don't collapse against siblings. */
turbo-frame {
  display: block;
}

/* Lexxy editor — match body text size */
lexxy-editor {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Lexxy rendered content — match body text size */
.lexxy-content {
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Contracts inline the host's rich-text cancellation policy, so the Lexxy
   wrapper lands mid-document; keep it at the size of the clauses around it.
   The wrapper is a bare div, which gets no margin from `prose`, so the policy
   would otherwise sit flush against the heading above it. Give it the
   paragraph rhythm and flatten what it holds so the spacing doesn't double. */
.contract-body .lexxy-content {
  font-size: inherit;
  line-height: inherit;
  margin-block: 1.25em;
}

.contract-body .lexxy-content > :first-child { margin-top: 0; }
.contract-body .lexxy-content > :last-child { margin-bottom: 0; }

/* Onboarding theme preview — scroll one viewport down and back up on hover */
@keyframes theme-preview-scroll {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-700px); }
  100% { transform: translateY(0); }
}

.theme-preview-iframe {
  transition: transform 400ms ease-out;
}

.group:hover .theme-preview-iframe {
  animation: theme-preview-scroll 2200ms ease-in-out infinite;
}
