/*
 * AI Glossary -- front end
 * Everything is scoped under .aig so the theme (Divi or otherwise) is untouched and
 * cannot bleed in. Re-skin by overriding the tokens below in your theme CSS, e.g.
 *   .aig { --aig-accent: #e4002b; }
 */

.aig {
  /* All colours come from the theme's spotlight.css (:root --fc-*), same as /use-cases/.
     The second value is only a fallback for when spotlight.css is not loaded. */
  --aig-navy:      var(--fc-navy, #22314A);
  --aig-deep:      var(--fc-deep, #27436C);
  --aig-slate:     var(--fc-slate, #415A80);
  --aig-slate-light: var(--fc-slate-light, #556D91);
  --aig-accent:    var(--fc-blue, #0099FF);
  --aig-link:      var(--fc-blue-deep, #006BB2);
  --aig-accent-2:  var(--fc-sky, #0099ff);
  --aig-ink:       var(--fc-deep, #27436C);   /* dark text on light = spotlight deep blue */
  --aig-text:      var(--fc-navy, #22314A);
  --aig-muted:     var(--fc-mute, #7F91A8);
  --aig-grey:      var(--fc-grey, #B3B8C6);
  --aig-line:      var(--fc-line, hsl(214 22% 88%));
  --aig-soft:      var(--fc-soft, hsl(210 28% 96%));
  --aig-page:      var(--fc-page, hsl(210 25% 98%));
  --aig-card:      var(--fc-surface, #FFFFFF);
  --aig-radius:    var(--fc-radius, 6px);
  --aig-shadow:    inset 0 0 0 0 #DAE0E7;
  --aig-shadow-lg: inset 0 0 0 1px var(--aig-accent), 0 10px 28px rgba(34, 49, 74, .10);
  --aig-font:      var(--fc-font, "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  --aig-wrap:      1240px;
  --aig-sticky-top: 0px;

  font-family: var(--aig-font);
  color: var(--aig-text);
  background: var(--aig-page);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.admin-bar .aig { --aig-sticky-top: 32px; }
@media (max-width: 782px) { body.admin-bar .aig { --aig-sticky-top: 0px; } }

.aig *, .aig *::before, .aig *::after { box-sizing: border-box; }
/* The theme styles every "body p" (kirkstyle.css / kirkstyle_dark.css). Inside the glossary,
   paragraphs inherit from their component instead; component classes below still win. */
.aig :where(p) { color: inherit; font-family: inherit; font-size: inherit; line-height: inherit; font-weight: inherit; padding: 0; }
.aig :where(h2, h3, h4) { font-family: var(--aig-font); color: var(--aig-deep); padding: 0; letter-spacing: -.015em; }
.aig a { color: var(--aig-link); text-decoration: none; }
.aig a:focus-visible, .aig button:focus-visible, .aig summary:focus-visible, .aig input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--aig-accent) 55%, transparent); outline-offset: 2px; border-radius: 6px;
}
.aig [hidden] { display: none !important; }
.aig-wrap { width: 100%; max-width: var(--aig-wrap); margin: 0 auto; padding: 0 15px; position: relative; z-index: 1; }
.aig-arrow { display: inline-block; transition: transform .2s ease; }

/* ---------------------------------------------------------------- hero
   Same structure and values as the /use-cases/ hero: <header class="... hero">,
   <span class="eyebrow">, plain <h1>. With the theme's kirkstyle_dark.css loaded,
   .hero::before (glow), .eyebrow and .hero h1 come from that file unchanged; the
   :where() rules below are zero-specificity fallbacks for when it isn't loaded. */
.aig-hero { position: relative; overflow: hidden; background: var(--aig-navy); color: #fff; padding: 80px 0 100px; }
.aig-hero__inner { position: relative; z-index: 1; }
.aig-hero--center .aig-hero__inner { text-align: center; }

:where(.aig-hero) :where(.eyebrow) { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 8px; color: #0099FF; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
:where(.aig-hero) h1 { font-size: clamp(52px, 7vw, 60px); line-height: 1.1; color: #f5f7fb; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 20px; }
.aig .aig-hero a.eyebrow { color: var(--aig-accent); }
.aig .aig-hero a.eyebrow:hover { color: #fff; }

.aig .aig-hero__lead { font-family: "Inter Tight", var(--aig-font); font-weight: 300; font-size: 18px; line-height: 1.5; color: rgba(255, 255, 255, .82); margin: 0; }

.aig-crumbs { font-size: 13px; margin: 0 0 22px; }
.aig-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; }
.aig-hero--center .aig-crumbs ol { justify-content: center; }
.aig .aig-crumbs li { display: flex; align-items: center; color: rgba(255, 255, 255, .7); margin: 0; padding: 0; font-size: 13px; line-height: 1.5; }
.aig-crumbs li + li::before { content: "\00b7"; color: rgba(255, 255, 255, .4); margin: 0 8px; }
.aig .aig-crumbs a { color: rgba(255, 255, 255, .7); }
.aig .aig-crumbs a:hover { color: #fff; }
.aig-crumbs [aria-current] { color: #fff; }

.aig-hero__stats { list-style: none; display: flex; gap: 28px; margin: 22px 0 0; padding: 0; font-size: 14px; color: #0099ff; }
.aig-hero--center .aig-hero__stats { justify-content: center; }
.aig .aig-hero__stats li { margin: 0; padding: 0; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, .7); }
.aig-hero__stats strong { color: #fff; font-weight: 700; }

/* ---------------------------------------------------------------- search */
.aig-hero--center .aig-search { margin-left: auto; margin-right: auto; }
.aig-hero--center .aig-search__label { text-align: center; }
.aig-search { margin-top: 36px; max-width: 720px; }
.aig-search__label { display: block; color: rgba(255,255,255,.82); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.aig-search__field { position: relative; display: flex; align-items: center; background: #fff; border-radius: 6px; box-shadow: 0 20px 40px -20px rgba(0,0,0,.5); transition: box-shadow .2s; }
.aig-search__field:focus-within { box-shadow: 0 0 0 3px rgba(0,153,255,.45), 0 20px 40px -20px rgba(0,0,0,.5); }
.aig .aig-search__input { flex: 1; min-width: 0; height: 60px; border: 0; background: transparent; padding: 0 20px; font: 500 17px/1 var(--aig-font); color: var(--aig-ink); box-shadow: none; outline: none; -webkit-appearance: none; appearance: none; border-radius: 6px 0 0 6px; }
.aig .aig-search__input::placeholder { color: #94a3b8; }
.aig .aig-search__input::-webkit-search-cancel-button { cursor: pointer; }
.aig-search__kbd { font: 600 12px/1 var(--aig-font); color: var(--aig-muted); border: 1px solid var(--aig-line); border-radius: 6px; padding: 5px 8px; margin-right: 8px; }
.aig-search__field:focus-within .aig-search__kbd { display: none; }
.aig .aig-search__btn { flex: none; width: 48px; height: 48px; margin-right: 6px; border: 0; border-radius: 4px; background: var(--aig-accent); color: #fff; display: grid; place-items: center; cursor: pointer; transition: background .2s, transform .2s; padding: 0; }
.aig .aig-search__btn:hover { background: var(--aig-link); }

/* ---------------------------------------------------------------- toolbar */
.aig-toolbar { position: sticky; top: var(--aig-sticky-top); z-index: 20; background: rgba(255,255,255,.94); -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--aig-line); }
.aig-toolbar .aig-wrap { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; padding-bottom: 14px; }
.aig-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -24px; padding: 2px 24px; }
.aig-chips::-webkit-scrollbar { display: none; }
/* Chips carry the spotlight .fc-chip class; these rules only add layout + the count badge
   and restate colours because ".aig a" would otherwise win over .fc-chip. */
.aig .aig-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
:where(.aig-chip) { font-size: 13.5px; font-weight: 500; padding: 7px 14px; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1px var(--aig-line); transition: box-shadow .15s, color .15s; }
.aig .aig-chip.fc-chip { color: var(--aig-link); }
.aig .aig-chip.fc-chip:hover { box-shadow: inset 0 0 0 1px var(--aig-accent); color: var(--aig-navy); }
.aig .aig-chip.fc-chip.is-active { background: var(--aig-navy); color: #fff; box-shadow: none; }
.aig-chip__n { font-size: 11.5px; font-weight: 600; color: var(--aig-slate-light); background: var(--aig-soft); border-radius: 6px; padding: 1px 7px; }
.aig-chip.is-active .aig-chip__n { background: rgba(255,255,255,.16); color: #fff; }

.aig-az { display: flex; flex-wrap: wrap; gap: 2px; }
.aig .aig-az__btn { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--aig-ink); font: 600 13px/1 var(--aig-font); cursor: pointer; transition: background .15s, color .15s; }
.aig .aig-az__btn:hover:not(:disabled) { background: var(--aig-soft); color: var(--aig-accent); }
.aig .aig-az__btn[aria-pressed="true"] { background: var(--aig-navy); color: #fff; }
.aig .aig-az__btn:disabled { color: #cbd5e1; cursor: default; }

/* ---------------------------------------------------------------- listing */
.aig-listing { padding-top: 32px; padding-bottom: 96px; }
.aig-listing__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; min-height: 32px; }
.aig-count { margin: 0; font-size: 14px; color: var(--aig-muted); }
.aig-count [data-count] { color: var(--aig-ink); font-weight: 700; }
.aig .aig-reset { border: 0; background: none; color: var(--aig-accent); font: 600 14px var(--aig-font); cursor: pointer; padding: 4px 0; }
.aig .aig-reset:hover { text-decoration: underline; }

/* Grid + cards use the spotlight .fc-grid / .fc-card classes, so shadow, border, radius,
   padding, hover and text colours come straight from spotlight.css. The :where() rules are
   zero-specificity fallbacks with the same values, used only if spotlight.css is off. */
:where(.aig-grid) { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 22px; }
.aig .aig-grid.fc-grid { padding-bottom: 0; }
:where(.aig-card) { display: flex; flex-direction: column; background: var(--aig-card); border-radius: 8px; box-shadow: var(--aig-shadow); padding: 24px 24px 20px; color: var(--aig-navy); transition: box-shadow .15s, transform .15s; }
:where(.aig-card):hover { box-shadow: var(--aig-shadow-lg); }
.aig .aig-card { position: relative; } /* anchor for the full-card link */

:where(.aig-card) :where(.aig-card__title) { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 6px; color: var(--aig-deep); }
.aig .fc-card .aig-card__title { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 6px; padding: 0; color: var(--aig-deep); }
.aig .aig-card__link { color: inherit;}
a.aig-card__link:hover{ color: inherit;}
.aig .aig-card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card is the link */
/* .fc-card__meta is a <p>; restated so the theme's "body p" rule can't recolour it */
.aig .fc-card .fc-card__meta { font-size: 13px; line-height: 1.55; color: var(--signal, var(--aig-accent)); margin: 0 0 16px; }
:where(.aig-card) dl { margin: 0 0 16px; }
:where(.aig-card) dt { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--aig-slate-light); margin: 0 0 3px; }
:where(.aig-card) dd { margin: 0 0 12px; font-size: 14.5px; line-height: 1.5; color: var(--aig-navy); }
.aig .aig-card__excerpt { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
:where(.aig-card) :where(.fc-tags) { display: flex; flex-wrap: wrap; gap: 6px; margin: auto 0 14px; }
:where(.aig-card) :where(.fc-tag) { font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 6px; background: var(--aig-soft); color: var(--aig-grey); }
:where(.aig-card) :where(.fc-card__read) { font-size: 14px; font-weight: 600; color: var(--aig-link); margin-top: auto; }
:where(.aig-card) :where(.fc-card__read)::after { content: " \2192"; }
.aig .fc-card .fc-tags + .fc-card__read { margin-top: 0; }
.aig-related__all:hover .aig-arrow { transform: translateX(4px); }
.aig-card.is-entering { animation: aig-in .25s ease both; }
@keyframes aig-in { from { opacity: 0; transform: translateY(6px); } }

.aig-empty { text-align: center; padding: 72px 24px; border: 1px dashed var(--aig-line); border-radius: var(--aig-radius); background: var(--aig-soft); }
.aig-empty__title { font-size: 1.2rem; font-weight: 700; color: var(--aig-ink); margin: 0 0 6px; }
.aig-empty p { margin: 0 0 16px; }
.aig .aig-btn { display: inline-flex; align-items: center; height: 42px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--aig-accent); color: #fff; font: 600 14px var(--aig-font); cursor: pointer; }
.aig .aig-btn:hover { background: var(--aig-link); }

/* ---------------------------------------------------------------- load more */
.aig-more { position: relative; display: flex; justify-content: center; margin: 40px 0 8px; }
.aig-more__sentinel { position: absolute; top: -200px; left: 0; width: 1px; height: 1px; }
.aig .aig-more__btn { background: #fff; color: var(--aig-link); box-shadow: inset 0 0 0 1px var(--aig-line); height: 46px; padding: 0 24px; }
.aig .aig-more__btn:hover { background: #fff; color: var(--aig-navy); box-shadow: inset 0 0 0 1px var(--aig-accent); }

/* ---------------------------------------------------------------- single */
.aig-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-areas: "side main"; gap: 64px; padding-top: 56px; padding-bottom: 88px; align-items: start; }
.aig-article { grid-area: main; min-width: 0; max-width: 780px; }
.aig-sidebar { grid-area: side; position: sticky; top: calc(var(--aig-sticky-top) + 24px); max-height: calc(100vh - var(--aig-sticky-top) - 48px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }

.aig-tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px; padding: 0; }
.aig-tags li { margin: 0; padding: 0; }
.aig .aig-tag { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--aig-soft); color: var(--aig-ink); font-size: 13px; font-weight: 500; }
.aig .aig-tag:hover { background: #e6edfb; color: var(--aig-accent); }

.aig-prose { font-size: 1.0625rem; line-height: 1.8; color: var(--aig-text); }
.aig-prose > :first-child { margin-top: 0; }
.aig-prose h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); line-height: 1.25; font-weight: 700; margin: 2.2em 0 .7em; scroll-margin-top: calc(var(--aig-sticky-top) + 24px); }
.aig-prose h3 { font-size: 1.25rem; line-height: 1.35; font-weight: 700; margin: 1.8em 0 .5em; scroll-margin-top: calc(var(--aig-sticky-top) + 24px); }
.aig-prose h4 { font-size: 1.05rem; font-weight: 700; margin: 1.5em 0 .4em; }
.aig-prose p { margin: 0 0 1.2em; }
.aig-prose ul, .aig-prose ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.aig-prose li { margin: .4em 0; padding-left: .2em; }
.aig-prose ul li::marker { color: var(--aig-accent); }
.aig-prose strong, .aig-prose b { color: var(--aig-ink); font-weight: 650; }
.aig-prose a { color: var(--aig-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--aig-accent) 40%, transparent); }
.aig-prose a:hover { text-decoration-color: currentColor; }
.aig-prose a[data-glossary-link] { text-decoration-style: dotted; }
.aig-prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--aig-accent); color: var(--aig-ink); font-style: italic; }
.aig-prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .95em; display: block; overflow-x: auto; }
.aig-prose th, .aig-prose td { border: 1px solid var(--aig-line); padding: 10px 12px; text-align: left; vertical-align: top; }
.aig-prose th { background: var(--aig-soft); color: var(--aig-ink); }
.aig-prose code { background: var(--aig-soft); padding: 2px 6px; border-radius: 5px; font-size: .9em; }

.aig-back { margin: 48px 0 0; font-weight: 600; font-size: 15px; }
.aig-back a:hover .aig-arrow { transform: translateX(-4px); }

/* sidebar index */
.aig-index { border-right: 1px solid var(--aig-line); padding-right: 24px; }
.aig-index__title { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.aig-index__title a { color: var(--aig-muted); }
.aig-index__title a:hover { color: var(--aig-accent); }
.aig-index__group { border-bottom: 1px solid var(--aig-line); }
.aig-index__group summary { list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; cursor: pointer; font-weight: 600; font-size: 15px; color: var(--aig-ink); }
.aig-index__group summary::-webkit-details-marker { display: none; }
.aig-index__group summary::after { content: ""; flex: none; width: 8px; height: 8px; border-right: 2px solid var(--aig-muted); border-bottom: 2px solid var(--aig-muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; margin-left: 4px; }
.aig-index__group[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.aig-index__group summary > span:first-child { flex: 1; }
.aig-index__n { font-size: 12px; color: var(--aig-muted); font-weight: 500; }
.aig-index ul { list-style: none; margin: 0 0 12px; padding: 0; }
.aig-index li { margin: 0; padding: 0; }
.aig-index li a { display: block; padding: 6px 10px; margin-left: 0px; border-radius: 7px; font-size: 14px; line-height: 1.4; color: var(--aig-text); }
.aig-index li a:hover { background: var(--aig-soft); color: var(--aig-ink); }
.aig-index li a.is-current { background: #e8efff; color: var(--aig-accent); font-weight: 600; }

/* related */
.aig-related { background: var(--aig-soft); padding: 72px 0 88px; border-top: 1px solid var(--aig-line); }
.aig-related__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.aig .aig-related__head h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; margin: 0; }
.aig-related__all { font-weight: 600; font-size: 15px; white-space: nowrap; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1024px) {
  .aig-layout { grid-template-columns: 1fr; grid-template-areas: "main" "side"; gap: 48px; }
  .aig-sidebar { position: static; max-height: none; overflow: visible; }
  .aig-index { border-right: 0; padding-right: 0; border-top: 1px solid var(--aig-line); padding-top: 24px; }
}
@media (max-width: 640px) {
  .aig-wrap { padding: 0 16px; }
  .aig-chips { margin: 0 -16px; padding: 2px 16px; }
  .aig .aig-search__input { height: 54px; font-size: 16px; padding: 0 14px; }
  .aig-search__kbd { display: none; }
  .aig .aig-search__btn { width: 42px; height: 42px; }
  .aig-az { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .aig-az::-webkit-scrollbar { display: none; }
  .aig .aig-az__btn { flex: none; }
  .aig-card { padding: 22px 20px 20px; }
  .aig-grid { gap: 16px; }
  .aig-layout { padding-top: 36px; padding-bottom: 56px; }
  .aig-related { padding: 48px 0 56px; }
  .aig-related__head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .aig *, .aig *::before, .aig *::after { transition: none !important; animation: none !important; }
}
