:root {
  --bfh-blue: #092b7a;
  --bfh-blue-50: #eef3ff;
  --bfh-blue-100: #dbe6ff;
  --bfh-blue-200: #bfd1ff;
  --bfh-blue-700: #092b7a;
  --bfh-blue-800: #07225f;
  --bfh-blue-900: #05183f;
}

body {
  font-feature-settings: "liga" 1, "kern" 1;
}

.brand-mark svg {
  display: block;
}

.brand-mark--wide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8rem;
}

.icon--bfh-logo {
  color: #092b7a;
  fill: #092b7a;
  width: 8rem;
  height: 4rem;
}

.icon--bfh-logo use,
.icon--bfh-logo path,
.icon--bfh-logo g {
  fill: #092b7a !important;
}

.bfh-kicker {
  color: var(--bfh-blue-700);
}

.bfh-account-button:hover .bfh-account-icon {
  background: var(--bfh-blue-800);
}

.bfh-soft-panel {
  border: 1px solid var(--bfh-blue-200);
  background: var(--bfh-blue-50);
}

.bfh-soft-title {
  color: var(--bfh-blue-800);
}

.bfh-soft-strong {
  color: var(--bfh-blue-900);
}

.bfh-soft-text {
  color: var(--bfh-blue-700);
}

[x-cloak] {
  display: none !important;
}

#article-form .generate-label-loading {
  display: none !important;
}

#write-articles-workspace[data-writing="true"] .wizard-step {
  opacity: 0.72;
}

#write-articles-workspace[data-writing="true"] .wizard-step:nth-child(2) {
  opacity: 1;
  background-color: #1c1917;
  color: white;
}

#write-articles-workspace[data-writing="true"] .wizard-step:nth-child(2) span:first-child {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.article-writing-state {
  display: none;
}

#article-form.htmx-request #generate-article-button {
  cursor: wait;
  opacity: 0.8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  animation: generate-button-breathe 1.6s ease-in-out infinite;
}

#generate-article-button {
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

#article-form.htmx-request .generate-label-default {
  display: none !important;
}

#article-form.htmx-request .generate-label-loading {
  display: inline-flex !important;
}

.article-writing-state.htmx-request {
  display: block;
  animation: writing-state-settle 0.25s ease both;
}

.loading-dots {
  display: inline-flex;
  min-width: 1.5rem;
}

.loading-dot {
  animation: loading-dot-fade 1.2s infinite;
  opacity: 0.2;
}

.loading-dot.dot-2 {
  animation-delay: 0.2s;
}

.loading-dot.dot-3 {
  animation-delay: 0.4s;
}

@keyframes loading-dot-fade {
  0%,
  80%,
  100% {
    opacity: 0.2;
  }

  40% {
    opacity: 1;
  }
}

@keyframes generate-button-breathe {
  0%,
  100% {
    transform: translateY(0);
    background-color: #1c1917;
  }

  50% {
    transform: translateY(-1px);
    background-color: #292524;
  }
}

@keyframes writing-state-settle {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.generation-block {
  animation: generation-block-rise 0.28s ease both;
}

.generation-block--active {
  position: relative;
  overflow: hidden;
}

.generation-block--active::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(219, 234, 254, 0.55) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: writing-block-shimmer 1.7s ease-in-out infinite;
  pointer-events: none;
}

.generation-output {
  animation: generation-output-settle 0.55s ease both;
}

.article-draft-canvas {
  color: #1f2937;
  line-height: 1.9;
}

.article-draft-canvas--live {
  min-height: 420px;
}

.article-review-canvas {
  outline: none;
}

.article-review-canvas:focus {
  box-shadow: 0 0 0 3px rgba(9, 43, 122, 0.12);
}

.article-draft-canvas > * + * {
  margin-top: 1.15rem;
}

.article-draft-canvas h1,
.article-draft-canvas h2,
.article-draft-canvas h3 {
  color: #111827;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.article-draft-canvas h1 {
  margin-bottom: 1.1rem;
  font-size: 2rem;
}

.article-draft-canvas h2 {
  margin-top: 2rem;
  margin-bottom: 0.85rem;
  font-size: 1.45rem;
}

.article-draft-canvas p,
.article-draft-canvas li {
  font-size: 1.04rem;
}

.article-draft-canvas ul,
.article-draft-canvas ol {
  margin: 1rem 0 1rem 1.5rem;
  padding-left: 1rem;
}

.article-draft-canvas ul {
  list-style: disc;
}

.article-draft-canvas ol {
  list-style: decimal;
}

.article-draft-canvas li {
  margin: 0.35rem 0;
  padding-left: 0.15rem;
}

.article-draft-canvas li > ul,
.article-draft-canvas li > ol {
  margin-top: 0.45rem;
  margin-bottom: 0.45rem;
}

.article-draft-canvas a {
  color: var(--bfh-blue-700);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.15em;
}

.article-draft-canvas a:hover {
  color: var(--bfh-blue-800);
}

.article-live-static + .article-live-static,
.generation-block + .generation-block,
.article-live-static + .generation-block,
.generation-block + .article-live-static {
  margin-top: 0.45rem;
}

.write-sidebar--compact .bfh-soft-panel {
  opacity: 0.88;
}

.variable-insert {
  position: relative;
  display: inline-block;
  min-width: 2ch;
}

.variable-insert__hint,
.variable-insert__value {
  display: inline-block;
  white-space: pre-wrap;
}

.variable-insert__hint {
  color: var(--bfh-blue-700);
  font-weight: 500;
  animation: variable-insert-hint 0.95s ease forwards;
  animation-delay: var(--insert-delay, 0ms);
}

.variable-insert__value {
  position: absolute;
  inset: 0;
  color: #1f2937;
  opacity: 0;
  transform: translateY(2px);
  animation: variable-insert-value 0.85s ease forwards;
  animation-delay: calc(var(--insert-delay, 0ms) + 460ms);
}

@keyframes generation-block-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes variable-insert-hint {
  0% {
    opacity: 0;
    transform: translateY(2px);
  }

  25%,
  55% {
    opacity: 1;
    transform: translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateY(-2px);
  }
}

@keyframes variable-insert-value {
  0% {
    opacity: 0;
    transform: translateY(2px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes generation-output-settle {
  0% {
    opacity: 0;
    transform: translateY(8px);
    background-color: rgba(219, 234, 254, 0.75);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    background-color: transparent;
  }
}

@keyframes writing-block-shimmer {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }

  20% {
    opacity: 1;
  }

  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}
