/*
Theme Name: AI Foundry Base
Theme URI: https://homoplasticus.com/
Author: AI Foundry
Description: Generic block-first WordPress parent theme for AI Foundry client sites.
Requires at least: 6.9
Tested up to: 6.9
Requires PHP: 8.1
Version: 0.1.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ai-foundry-base
Tags: full-site-editing, block-patterns, editor-style, custom-colors, custom-logo, e-commerce
*/

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
}

.aif-shell,
.aif-site-header__inner,
.aif-site-footer__inner {
  width: min(var(--wp--custom--shell--wide, 82.5rem), calc(100vw - 2rem));
  margin-inline: auto;
}

.aif-site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--wp--preset--color--foam);
  backdrop-filter: blur(16px);
  background: color-mix(in srgb, var(--wp--preset--color--porcelain) 88%, transparent);
}

.aif-site-header .wp-block-navigation {
  gap: var(--wp--preset--spacing--sm);
}

.aif-site-footer {
  color: var(--wp--preset--color--foam);
  background: var(--wp--preset--gradient--editorial-depth);
}

.aif-site-footer a {
  color: inherit;
}

.aif-card,
.aif-panel {
  transition:
    transform var(--wp--custom--motion--base) ease,
    box-shadow var(--wp--custom--motion--base) ease,
    border-color var(--wp--custom--motion--base) ease;
}

.aif-card:hover,
.aif-panel:hover {
  border-color: color-mix(in srgb, var(--wp--preset--color--water) 36%, var(--wp--preset--color--foam));
  box-shadow: var(--wp--custom--shadow--card);
  transform: translateY(-0.2rem);
}

.is-style-hp-eyebrow,
.hp-eyebrow,
.is-style-hp-card-meta,
.hp-card__meta {
  color: var(--wp--preset--color--water);
  font-size: var(--wp--preset--font-size--sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.is-style-hp-section-lede,
.hp-section__lede,
.hp-page-hero__lede {
  max-width: 42rem;
  color: color-mix(in srgb, var(--wp--preset--color--ink) 88%, var(--wp--preset--color--white));
  font-size: var(--wp--custom--hero--subtitle-size, var(--wp--preset--font-size--lg));
}

.is-style-hp-hero-subtitle {
  font-size: var(--wp--custom--hero--subtitle-size, var(--wp--preset--font-size--lg));
}

.is-style-hp-accent-divider,
.hp-divider {
  width: 5rem;
  min-width: 5rem;
  border: 0;
  border-top: 2px solid var(--wp--preset--color--gold);
  opacity: 1;
}

.wp-block-button.is-style-hp-ghost > .wp-block-button__link,
.hp-button--ghost .wp-block-button__link,
.hp-button--ghost.wp-block-button > .wp-block-button__link,
.hp-button.hp-button--ghost .wp-block-button__link {
  color: currentColor;
  background: transparent;
  border: 1px solid currentColor;
}

.hp-checklist,
.hp-mini-list {
  padding-left: 0;
  list-style-type: none;
}

.hp-checklist li,
.hp-mini-list li {
  position: relative;
  padding-left: 1.65rem;
  list-style-type: none;
}

.hp-checklist li + li,
.hp-mini-list li + li {
  margin-top: 0.75rem;
}

.hp-checklist li::before,
.hp-mini-list li::before {
  content: "";
  position: absolute;
  top: 0.55rem;
  left: 0;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--wp--preset--color--water);
  box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--wp--preset--color--water) 18%, transparent);
}

.wp-block-list.is-style-hp-pill-list,
.hp-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.wp-block-list.is-style-hp-pill-list li,
.hp-pill-list li,
.hp-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.3rem;
  margin: 0;
  padding: 0.55rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--wp--preset--color--foam) 70%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--wp--preset--color--card) 88%, transparent);
  color: inherit;
  font-size: var(--wp--preset--font-size--xs);
  font-weight: 700;
}

.wp-block-group.is-style-hp-notice,
.hp-notice {
  border-left: 4px solid var(--wp--preset--color--water);
  border-radius: var(--wp--custom--radius--md);
  background: color-mix(in srgb, var(--wp--preset--color--porcelain) 78%, var(--wp--preset--color--white));
  padding: var(--wp--preset--spacing--md);
}

.hp-pattern-hero h1 {
  font-size: var(--wp--custom--hero--title-size, var(--wp--preset--font-size--2xl));
  font-weight: var(--wp--custom--hero--title-weight, 700);
  line-height: 0.92;
}

.hp-pattern-hero .hp-hero-subtitle {
  font-size: var(--wp--custom--hero--subtitle-size, var(--wp--preset--font-size--lg));
}

/* Generic card and surface styles for any client theme. */
.wp-block-group.is-style-aif-card,
.aif-surface-card {
  border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink-soft) 24%, transparent);
  border-radius: var(--wp--custom--radius--lg);
  background: color-mix(in srgb, var(--wp--preset--color--card) 94%, transparent);
  box-shadow: var(--wp--custom--shadow--card);
}

.wp-block-group.is-style-aif-surface-quiet,
.aif-surface-quiet {
  border: 1px solid color-mix(in srgb, var(--wp--preset--color--foam) 80%, transparent);
  border-radius: var(--wp--custom--radius--md);
  background: color-mix(in srgb, var(--wp--preset--color--porcelain) 86%, var(--wp--preset--color--white));
}

/* Shared metric styling for stat and KPI strips. */
.aif-stat-band {
  color: var(--wp--preset--color--foam);
  border-radius: var(--wp--custom--radius--lg);
  background: var(--wp--preset--gradient--editorial-depth);
  box-shadow: var(--wp--custom--shadow--strong);
}

.aif-stat-band__value {
  color: var(--wp--preset--color--white);
  font-size: clamp(2.4rem, 1.8rem + 2.2vw, 4rem);
  font-weight: 700;
  line-height: 1;
}

.aif-stat-band__label {
  color: color-mix(in srgb, var(--wp--preset--color--foam) 90%, var(--wp--preset--color--white));
  font-size: var(--wp--preset--font-size--sm);
}

/* Timeline primitives for core columns layouts. */
.wp-block-columns.is-style-aif-timeline {
  position: relative;
  gap: var(--wp--preset--spacing--md);
}

.wp-block-columns.is-style-aif-timeline .wp-block-column {
  position: relative;
}

.wp-block-columns.is-style-aif-timeline .wp-block-column + .wp-block-column::before {
  content: "";
  position: absolute;
  top: 1.6rem;
  left: calc(var(--wp--preset--spacing--md) * -0.5);
  width: var(--wp--preset--spacing--md);
  border-top: 2px solid color-mix(in srgb, var(--wp--preset--color--water) 30%, transparent);
}

/* Compact table style for checklist-heavy pages. */
.wp-block-table.is-style-aif-compact-table table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink-soft) 22%, transparent);
  border-radius: var(--wp--custom--radius--md);
  overflow: hidden;
}

.wp-block-table.is-style-aif-compact-table th {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: var(--wp--preset--font-size--xs);
}

.wp-block-table.is-style-aif-compact-table th,
.wp-block-table.is-style-aif-compact-table td {
  border-color: color-mix(in srgb, var(--wp--preset--color--ink-soft) 20%, transparent);
  padding: 0.7rem 0.9rem;
}

/* Accordion details style for docs/checklists. */
.wp-block-details.is-style-aif-accordion {
  border: 1px solid color-mix(in srgb, var(--wp--preset--color--ink-soft) 20%, transparent);
  border-radius: var(--wp--custom--radius--md);
  background: color-mix(in srgb, var(--wp--preset--color--card) 95%, transparent);
  padding: 0.9rem 1rem;
}

.wp-block-details.is-style-aif-accordion + .wp-block-details.is-style-aif-accordion {
  margin-top: var(--wp--preset--spacing--sm);
}

.wp-block-details.is-style-aif-accordion summary {
  color: var(--wp--preset--color--ink);
  font-weight: 600;
  cursor: pointer;
}

.wp-block-details.is-style-aif-accordion[open] {
  box-shadow: var(--wp--custom--shadow--card);
}

/* Default legal prose wrappers shared by any client pages. */
.aif-legal-prose {
  color: color-mix(in srgb, var(--wp--preset--color--ink) 92%, var(--wp--preset--color--white));
}

.aif-legal-prose h2,
.aif-legal-prose h3,
.aif-legal-prose h4 {
  margin-top: var(--wp--preset--spacing--lg);
}

.aif-legal-prose p,
.aif-legal-prose li {
  font-size: var(--wp--preset--font-size--md);
  line-height: 1.7;
}

@media (max-width: 782px) {
  .aif-site-header {
    position: static;
  }

  .aif-site-header__inner,
  .aif-site-footer__inner,
  .aif-shell {
    width: min(calc(100vw - 1.5rem), var(--wp--custom--shell--wide, 82.5rem));
  }

  .wp-block-columns.is-style-aif-timeline .wp-block-column + .wp-block-column::before {
    content: none;
  }
}

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

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