/* VanillaVoice custom styles on top of Bulma. */

img {
  user-select: none;
}

.inline-svg {
  display: inline-block;
  line-height: 0;
}

.inline-svg svg {
  border-radius: 9999px;
  padding: 3px;
}

.inline-svg.is-64 svg {
  width: 64px;
  height: 64px;
}

.inline-svg.is-96 svg {
  width: 96px;
  height: 96px;
}

.is-cover {
  object-fit: cover;
  height: 100% !important;
  width: 100% !important;
  padding: 3px;
}

.miniflag svg {
  width: 32px;
  height: 24px;
}

.is-mutted {
  color: #7a7a7a;
}

.is-clickable {
  cursor: pointer;
}

/* Inline SVG icons, sized like Font Awesome's .svg-inline--fa. */
.icon-svg {
  display: inline-block;
  height: 1em;
  width: 1em;
  vertical-align: -0.125em;
  overflow: visible;
}

.wi-5 {
  min-width: 1.5rem;
  width: 1.5rem;
}

.semitag {
  border: 0;
  margin: 0 0.1rem 0.5rem 0.1rem;
}

/* Selected-voice dashed ring, from the legacy Home/Help pages. */
.circle__spin {
  position: absolute;
  left: 0px;
  top: 0px;
  width: 64px;
  height: 64px;
}

.circle__spin svg {
  width: 100%;
  height: 100%;
  padding: 0px;
  animation: spin 10s linear infinite;
}

.circle__spin circle {
  stroke-width: 2;
  stroke-dasharray: 5, 5;
  fill: none;
  stroke: black;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

.shakex {
  animation: shakex-animation 4.72s ease infinite;
  transform-origin: 50% 50%;
}

@keyframes shakex-animation {
  0% { transform: translate(0, 0); }
  1.78571% { transform: translate(5px, 0); }
  3.57143% { transform: translate(0, 0); }
  5.35714% { transform: translate(5px, 0); }
  7.14286% { transform: translate(0, 0); }
  8.92857% { transform: translate(5px, 0); }
  10.71429% { transform: translate(0, 0); }
  100% { transform: translate(0, 0); }
}

.shakey {
  animation: shakey-animation 4.72s ease;
  transform-origin: 50% 50%;
}

@keyframes shakey-animation {
  0% { transform: translate(0, 0); }
  1.78571% { transform: translate(0, 0); }
  3.57143% { transform: translate(0, 5px); }
  5.35714% { transform: translate(0, 0); }
  7.14286% { transform: translate(0, 5px); }
  8.92857% { transform: translate(0, 0); }
  10.71429% { transform: translate(0, 5px); }
  100% { transform: translate(0, 0); }
}

/* Sticky footer layout and footer link color. */
.main {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.main > .section {
  flex: 1;
}

/* The page content sits closer to the navbar than Bulma's default 3rem. */
.main > .page-content {
  padding-top: 1rem;
}

footer a {
  color: gray;
}

.link-list li {
  margin-bottom: 0.25rem;
}

.ccards > * {
  padding: 0.3rem;
  height: 1.5rem;
}

/* Cookie consent bar (fixed bottom-right). */
#cookie-bar {
  bottom: 20px;
  right: 20px;
  position: fixed;
  display: block;
  z-index: 5000;
}

/* Admin per-user action row: keeps the POST forms/buttons evenly spaced. */
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Read-only impersonation banner: small, bottom-left. */
.impersonation-banner {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 1000;
  margin: 0;
  padding: 0.5rem 0.6rem;
  font-size: 0.8rem;
  width: auto;
  max-width: 24rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.impersonation-banner span {
  flex: 1 1 auto;
}

.impersonation-banner form {
  flex: 0 0 auto;
  margin: 0;
}

/* Log Out is a POST form (CSRF) styled as a navbar item. */
.navbar-dropdown form {
  margin: 0;
}

.navbar-dropdown button.navbar-item {
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

/* Recording delete: fade/slide the card out, then collapse its space. */
.recording-card {
  overflow: hidden;
}

.recording-card.is-collapsing {
  opacity: 0;
  transform: translateX(1.5rem);
  margin-bottom: 0 !important;
  border-width: 0;
  transition: height 0.3s ease, margin-bottom 0.3s ease, opacity 0.25s ease,
    transform 0.25s ease;
}

/* Brief shake if the delete request fails, so the card does not vanish. */
.recording-card.is-error {
  animation: shakex-animation 0.4s ease;
}

.recording-empty {
  margin: 0.75rem 0;
}

/* Subtle back-to-home link at the top of every non-home page. It is a plain
 * text link, pulled up into the section's top padding so it adds little space. */
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: #7a7a7a;
  margin-bottom: 1.25rem;
}

.back-home:hover,
.back-home:focus {
  color: #485fc7;
}

@media (prefers-reduced-motion: reduce) {
  .recording-card.is-collapsing {
    transition: none;
  }
}

/* The decorative intro illustration only fits the two-column desktop layout
 * (the hero columns use is-desktop, so they first stack at <=1023px). */
@media (max-width: 1023px) {
  #character-intro {
    display: none;
  }
}
