/**
 * Blockforge Starter — base frontend styles
 * Uses CSS custom properties (--bf-*) from design tokens / presets.
 */

:root {
  --bf-color-primary: #2445a7;
  --bf-color-primary-contrast: #ffffff;
  --bf-color-background: #ffffff;
  --bf-color-surface: #f4f6fa;
  --bf-color-text: #172033;
  --bf-color-muted: #667085;
  --bf-color-border: #d0d5dd;
  --bf-color-error: #b42318;
  --bf-color-success: #027a48;
  --bf-font-body: "Source Sans 3", system-ui, sans-serif;
  --bf-font-heading: "Source Serif 4", Georgia, serif;
  --bf-button-radius: 8px;
  --bf-card-radius: 16px;
  --bf-header-height: 72px;
  --bf-section-space: 4rem;
  --bf-content-width: 760px;
  --bf-wide-width: 1200px;
}

@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap");

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--bf-font-body);
  color: var(--bf-color-text);
  background: var(--bf-color-background);
}

/* Subtle scroll / lazy-load reveals (enhanced by reveal.js). */
.bf-reveal {
  opacity: 0;
  transform: translateY(0.45rem);
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--bf-reveal-delay, 0ms);
  will-change: opacity, transform;
}
.bf-reveal.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* Hero: keyframes so the entrance always plays after load (transitions often skip). */
.bf-reveal--hero {
  opacity: 0;
  transform: translateY(0.55rem);
  transition: none;
}
.bf-reveal--hero.is-visible {
  animation: bf-hero-reveal 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--bf-reveal-delay, 0ms);
}
@keyframes bf-hero-reveal {
  from {
    opacity: 0;
    transform: translateY(0.55rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.bf-reveal-img {
  opacity: 0;
  transition: opacity 0.75s ease;
}
.bf-reveal-img.is-loaded {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .bf-reveal,
  .bf-reveal--hero,
  .bf-reveal-img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.bf-site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: var(--bf-header-height);
  border-bottom: 1px solid var(--bf-color-border);
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bf-color-background) 92%, transparent);
}

.bf-site-header__inner {
  width: min(100%, var(--bf-wide-width));
  margin-inline: auto;
}

.bf-site-footer {
  margin-top: var(--bf-section-space);
}

/* Focus visibility */
:focus-visible {
  outline: 2px solid var(--bf-color-primary);
  outline-offset: 2px;
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="tel"],
textarea,
select {
  width: 100%;
  max-width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--bf-color-border);
  border-radius: var(--bf-button-radius);
  background: var(--bf-color-background);
  color: var(--bf-color-text);
  font: inherit;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--bf-color-primary);
}

button,
.wp-element-button,
.wp-block-button__link {
  border-radius: var(--bf-button-radius);
}

/* Utility containers used by blocks */
.bf-container {
  width: min(100% - 2rem, var(--bf-wide-width));
  margin-inline: auto;
}

.bf-container--narrow {
  width: min(100% - 2rem, var(--bf-content-width));
}

img {
  max-width: 100%;
  height: auto;
}

/* 404 / empty search */
.bf-not-found {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.bf-not-found__inner {
  max-width: 36rem;
  margin-inline: auto;
}

.bf-not-found .bf-eyebrow {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--bf-color-muted, #667085);
}

.bf-not-found__heading {
  margin: 0;
  font-family: var(--bf-font-heading, Georgia, serif);
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 450;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.bf-not-found__text {
  margin: 1.25rem auto 2rem;
  max-width: 32rem;
  color: var(--bf-color-muted, #667085);
  font-size: 1.05rem;
  line-height: 1.7;
}

.bf-not-found__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.bf-not-found--inline {
  margin-top: 2rem;
}
