/*
 * JOULS global design foundation.
 * Scope: Astra/Gutenberg/plugin primitives only. Page-specific composition stays in site.css.
 * Source of truth: docs/BRAND_GUIDELINES.md + website/design-system/MASTER.md.
 */

:root {
  --jouls-white: #FFFFFF;
  --jouls-ink: #101411;
  --jouls-volt: #B8ED3D;
  --jouls-stone: #D7D8CE;
  --jouls-graphite: #5C625B;
  --jouls-success: #2F7D4B;
  --jouls-warning: #A85F15;
  --jouls-danger: #C03932;
  --jouls-radius-sm: 6px;
  --jouls-radius: 8px;
  --jouls-radius-lg: 12px;
  --jouls-control-height: 48px;
  --jouls-focus-ring: 0 0 0 3px rgba(184, 237, 61, .65);
  --jouls-border: 1px solid var(--jouls-stone);

  /* Safety net: keep Astra variables inside the approved JOULS palette. */
  --ast-global-color-0: var(--jouls-volt);
  --ast-global-color-1: var(--jouls-ink);
  --ast-global-color-2: var(--jouls-ink);
  --ast-global-color-3: var(--jouls-graphite);
  --ast-global-color-4: var(--jouls-white);
  --ast-global-color-5: var(--jouls-white);
  --ast-global-color-6: var(--jouls-stone);
  --ast-global-color-7: var(--jouls-stone);
  --ast-global-color-8: var(--jouls-ink);
}

html {
  color-scheme: light;
  background: var(--jouls-white);
}

body,
.ast-separate-container,
.ast-page-builder-template,
.site-content,
#page {
  background: var(--jouls-white);
  color: var(--jouls-graphite);
}

body,
button,
input,
select,
textarea {
  font-family: "Archivo Semi Condensed", "Arial Narrow", Arial, sans-serif;
  font-stretch: 85%;
}

body {
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: var(--jouls-ink);
  background: var(--jouls-volt);
}

h1,
h2,
h3,
h4,
h5,
h6,
.entry-title,
.widget-title {
  color: var(--jouls-ink);
  font-family: "Archivo Semi Condensed", "Arial Narrow", Arial, sans-serif;
  font-stretch: 85%;
  font-weight: 650;
  line-height: 1.08;
  text-wrap: balance;
}

p,
li,
dd,
dt,
figcaption,
.wp-block-post-excerpt,
.entry-content {
  color: inherit;
}

a,
.entry-content a,
.widget a {
  color: var(--jouls-ink);
  text-decoration-color: var(--jouls-volt);
  text-decoration-thickness: .12em;
  text-underline-offset: .18em;
}

a:hover,
a:focus-visible,
.entry-content a:hover,
.entry-content a:focus-visible,
.widget a:hover,
.widget a:focus-visible {
  color: var(--jouls-graphite);
  text-decoration-color: var(--jouls-volt);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--jouls-ink);
  outline-offset: 3px;
  box-shadow: var(--jouls-focus-ring);
}

/* Global buttons: Volt action by default; Ink is the deliberate hover/pressed state. */
:where(
  button,
  input[type="button"],
  input[type="reset"],
  input[type="submit"],
  .ast-button,
  .button,
  .wp-element-button,
  .wp-block-button__link,
  .forminator-button
) {
  min-height: var(--jouls-control-height);
  border: 1px solid var(--jouls-volt);
  border-radius: var(--jouls-radius);
  background: var(--jouls-volt);
  color: var(--jouls-ink);
  font: inherit;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

:where(
  button,
  input[type="button"],
  input[type="reset"],
  input[type="submit"],
  .ast-button,
  .button,
  .wp-element-button,
  .wp-block-button__link,
  .forminator-button
):hover {
  border-color: var(--jouls-ink);
  background: var(--jouls-ink);
  color: var(--jouls-white);
  transform: translateY(-1px);
}

:where(
  button,
  input[type="button"],
  input[type="reset"],
  input[type="submit"],
  .ast-button,
  .button,
  .wp-element-button,
  .wp-block-button__link,
  .forminator-button
):active {
  transform: translateY(0);
}

:where(button, input, select, textarea):disabled,
:where(button, input, select, textarea)[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.wp-block-button.is-style-outline > .wp-block-button__link,
.wp-block-button__link.is-style-outline,
.jouls-button--secondary {
  border-color: var(--jouls-ink);
  background: var(--jouls-white);
  color: var(--jouls-ink);
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button__link.is-style-outline:hover,
.jouls-button--secondary:hover {
  border-color: var(--jouls-ink);
  background: var(--jouls-ink);
  color: var(--jouls-white);
}

/* Form controls, including native Gutenberg and Forminator fields. */
:where(
  input[type="text"],
  input[type="email"],
  input[type="url"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="date"],
  input[type="time"],
  select,
  textarea,
  .forminator-input,
  .forminator-select,
  .forminator-textarea
) {
  min-height: var(--jouls-control-height);
  border: 1px solid var(--jouls-graphite);
  border-radius: var(--jouls-radius-sm);
  background: var(--jouls-white);
  color: var(--jouls-ink);
  box-shadow: none;
}

textarea,
.forminator-textarea {
  min-height: 128px;
}

:where(
  input[type="text"],
  input[type="email"],
  input[type="url"],
  input[type="tel"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="date"],
  input[type="time"],
  select,
  textarea,
  .forminator-input,
  .forminator-select,
  .forminator-textarea
):focus {
  border-color: var(--jouls-ink);
  outline: 2px solid transparent;
  box-shadow: var(--jouls-focus-ring);
}

::placeholder {
  color: var(--jouls-graphite);
  opacity: .8;
}

.forminator-ui .forminator-label,
.forminator-ui .forminator-description,
.forminator-ui .forminator-checkbox-label,
.forminator-ui .forminator-radio-label {
  color: var(--jouls-ink);
  font-family: inherit;
}

.forminator-ui .forminator-error-message {
  color: var(--jouls-danger);
}

.forminator-ui .forminator-response-message.forminator-success {
  border-color: var(--jouls-success);
  background: var(--jouls-white);
  color: var(--jouls-success);
}

.forminator-ui .forminator-response-message.forminator-error {
  border-color: var(--jouls-danger);
  background: var(--jouls-white);
  color: var(--jouls-danger);
}

/* Gutenberg primitives. */
hr,
.wp-block-separator {
  border-color: var(--jouls-stone);
}

.wp-block-quote,
blockquote {
  margin-inline: 0;
  border-left: 4px solid var(--jouls-volt);
  background: var(--jouls-white);
  color: var(--jouls-ink);
}

.wp-block-table table,
table {
  border-color: var(--jouls-stone);
  background: var(--jouls-white);
  color: var(--jouls-ink);
}

.wp-block-table th,
.wp-block-table td,
th,
td {
  border-color: var(--jouls-stone);
}

code,
kbd,
samp,
pre {
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

pre,
.wp-block-code {
  border: var(--jouls-border);
  border-radius: var(--jouls-radius);
  background: var(--jouls-white);
  color: var(--jouls-ink);
}

/* Astra/global shell normalization. */
.ast-container,
.ast-separate-container .ast-article-single,
.ast-separate-container .ast-article-post,
.ast-separate-container .comments-count-wrapper,
.ast-separate-container .ast-comment-list li.depth-1,
.ast-separate-container .comment-respond,
.ast-separate-container .related-posts-title-wrapper,
.ast-separate-container .post-navigation {
  background: var(--jouls-white);
}

.ast-primary-header-bar,
.ast-mobile-header-wrap .ast-primary-header-bar {
  background: var(--jouls-white);
  border-color: var(--jouls-stone);
}

.main-header-menu .menu-link,
.ast-header-break-point .main-header-menu .menu-link {
  color: var(--jouls-ink);
}

.main-header-menu .menu-item:hover > .menu-link,
.main-header-menu .current-menu-item > .menu-link,
.main-header-menu .current-menu-ancestor > .menu-link {
  color: var(--jouls-graphite);
}

.site-footer,
.site-primary-footer-wrap,
.site-below-footer-wrap {
  background: var(--jouls-white);
  color: var(--jouls-graphite);
  border-color: var(--jouls-stone);
}

/* Breadcrumbs stay quiet but clearly interactive. */
.jouls-breadcrumbs,
.rank-math-breadcrumb {
  color: var(--jouls-graphite);
  font-size: .875rem;
}

.jouls-breadcrumbs a,
.rank-math-breadcrumb a {
  color: var(--jouls-ink);
}

/* Structured FAQ Manager: replace its neutral defaults with JOULS tokens. */
.sfm-section {
  --sfm-border: var(--jouls-stone);
  --sfm-surface: var(--jouls-white);
  --sfm-text: var(--jouls-ink);
  --sfm-muted: var(--jouls-graphite);
  --sfm-accent: var(--jouls-ink);
  background: var(--jouls-white);
}

.sfm-faq-item {
  background: var(--jouls-white);
}

.sfm-faq-question {
  min-height: var(--jouls-control-height);
  color: var(--jouls-ink);
}

.sfm-faq-question:hover,
.sfm-faq-question:focus-visible {
  color: var(--jouls-ink);
}

.sfm-faq-question::after {
  color: var(--jouls-ink);
}

.sfm-faq-item[open] > .sfm-faq-question::after {
  color: var(--jouls-ink);
}

.sfm-eyebrow {
  color: var(--jouls-graphite);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

/* Dark JOULS surfaces always declare their foreground explicitly. */
.jouls-contrast-section,
.jouls-final-cta {
  background: var(--jouls-ink);
  color: var(--jouls-white);
}

.jouls-contrast-section :where(h1, h2, h3, h4, h5, h6),
.jouls-final-cta :where(h1, h2, h3, h4, h5, h6) {
  color: var(--jouls-white);
}

/* Volt surfaces keep Ink foreground for strong brand contrast. */
.jouls-coach-band {
  background: var(--jouls-volt);
  color: var(--jouls-ink);
}

.jouls-coach-band :where(h1, h2, h3, h4, h5, h6) {
  color: var(--jouls-ink);
}

/* Do not reintroduce off-brand tinted page surfaces. */
.jouls-resources-tease {
  background: var(--jouls-white);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto;
    transition-duration: .01ms;
    animation-duration: .01ms;
    animation-iteration-count: 1;
  }
}
