/* ================================================================
   ABC Failures — ARTBUILD OS
   Common Failures resource hub. Premium glass.
   Class prefix: .abf
   ================================================================ */

.abf {
  --c-bg: #0a0d13;
  --c-bg-2: #0d1119;
  --c-card: #121724;
  --c-card-2: #171d2c;
  --c-border: #1e2636;
  --c-border-2: #2a3447;
  --c-text: #eaeef6;
  --c-muted: #93a0b5;
  --c-dim: #6b7689;

  --c-orange: #f97316;
  --c-orange-2: #fb923c;
  --c-green: #22c55e;
  --c-blue: #3b82f6;
  --c-red: #ef4444;
  --c-amber: #f59e0b;
  --c-teal: #14b8a6;
  --c-purple: #a855f7;

  --c-orange-rgb: 249, 115, 22;
  --c-orange-2-rgb: 251, 146, 60;
  --c-blue-rgb: 59, 130, 246;

  --c-font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --c-font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --c-radius: 14px;
  --c-radius-sm: 10px;
  --c-radius-lg: 20px;
  --c-radius-pill: 999px;
  --c-speed: .22s;
  --c-ease: cubic-bezier(.22, 1, .36, 1);
  --c-glass-bg: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  --c-glass-border: rgba(255, 255, 255, .08);
  --c-glass-border-hover: rgba(255, 255, 255, .16);
  --c-glass-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 24px 48px -24px rgba(0, 0, 0, .6);
  --c-glass-shadow-hover: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 32px 64px -24px rgba(0, 0, 0, .7);
  --c-grid-texture:
    repeating-linear-gradient(0deg, rgba(var(--c-orange-2-rgb), .07) 0 2px, transparent 2px 18px),
    repeating-linear-gradient(90deg, rgba(var(--c-orange-2-rgb), .05) 0 2px, transparent 2px 24px);

  width: auto;
  max-width: none !important;
  margin-left: calc(var(--wp--style--root--padding-left, 0px) * -1);
  margin-right: calc(var(--wp--style--root--padding-right, 0px) * -1);
  overflow-x: clip;
  box-sizing: border-box;
  color-scheme: dark;

  background:
    radial-gradient(1100px 700px at 12% -8%, rgba(var(--c-orange-rgb), .08), transparent 60%),
    radial-gradient(800px 560px at 92% 8%, rgba(var(--c-blue-rgb), .05), transparent 60%),
    linear-gradient(180deg, var(--c-bg-2), var(--c-bg));

  color: var(--c-text);
  font-family: var(--c-font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding: 0 24px 56px;
}

.abf *, .abf *::before, .abf *::after { box-sizing: border-box; }
.abf a { color: inherit; text-decoration: none; }
.abf img { display: block; width: 100%; max-width: 100%; height: auto; }
.abf svg { width: 1em; height: 1em; flex: none; }
.abf ul { margin: 0; padding: 0; list-style: none; }
.abf h1, .abf h2, .abf h3, .abf p { margin: 0; }

.abf :focus-visible {
  outline: 2px solid var(--c-orange);
  outline-offset: 2px;
  border-radius: 4px;
}

.abf-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 0 0;
  min-width: 0;
}

.abf-i { flex: none; }

/* ---------- Glass primitive ---------- */
.abf-glass {
  position: relative;
  isolation: isolate;
  background: var(--c-glass-bg), var(--c-card);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--c-radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--c-glass-shadow);
  transition: transform .28s var(--c-ease), box-shadow .28s ease, border-color .28s ease;
}
.abf-glass::before {
  content: "";
  position: absolute;
  inset: -40% -40% auto auto;
  width: 70%;
  height: 70%;
  background: radial-gradient(circle, var(--glow, rgba(249, 115, 22, .25)), transparent 70%);
  filter: blur(10px);
  z-index: -1;
  opacity: .5;
  transition: opacity .3s ease;
  pointer-events: none;
}
.abf-glass:hover::before { opacity: .8; }
.abf-card.abf-glass:hover {
  transform: translateY(-3px);
  border-color: var(--c-glass-border-hover);
  box-shadow: var(--c-glass-shadow-hover), 0 0 0 1px var(--glow-border);
}

/* ---------- Buttons ---------- */
.abf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--c-radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--c-speed), border-color var(--c-speed), color var(--c-speed), transform var(--c-speed), box-shadow var(--c-speed);
  -webkit-tap-highlight-color: transparent;
}
.abf-btn--primary { background: var(--c-orange); color: #fff; }
.abf-btn--primary:hover {
  background: var(--c-orange-2);
  border-color: var(--c-orange-2);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(var(--c-orange-rgb), .3);
}
.abf-btn--action { background: var(--c-orange); border-color: var(--c-orange); color: #fff; }
.abf-btn--action:hover {
  background: var(--c-orange-2);
  border-color: var(--c-orange-2);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(var(--c-orange-rgb), .3);
}
.abf-btn--outline {
  background: transparent;
  border-color: var(--c-border-2);
  color: var(--c-muted);
}
.abf-btn--outline:hover {
  border-color: var(--c-orange);
  color: var(--c-orange);
  background: color-mix(in srgb, var(--c-orange) 8%, transparent);
}

/* ---------- Reveal ---------- */
[data-abf-reveal] > * {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .45s ease, transform .45s ease;
}
[data-abf-reveal].is-visible > * { opacity: 1; transform: none; }
[data-abf-reveal].is-visible > *:nth-child(2) { transition-delay: .04s; }
[data-abf-reveal].is-visible > *:nth-child(3) { transition-delay: .08s; }
[data-abf-reveal].is-visible > *:nth-child(4) { transition-delay: .12s; }
[data-abf-reveal].is-visible > *:nth-child(5) { transition-delay: .16s; }
.abf.no-js [data-abf-reveal] > * { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .abf *, .abf *::before, .abf *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
  [data-abf-reveal] > * { opacity: 1; transform: none; }
}

/* ---------- Breadcrumb ---------- */
.abf-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 12.5px;
  color: var(--c-dim);
}
.abf-breadcrumb__sep { color: var(--c-dim); }

/* ---------- Hero ---------- */
.abf-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--c-radius);
  margin-bottom: 20px;
  min-height: 360px;
  display: flex;
  align-items: flex-end;
}
.abf-hero__media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.abf-hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(10, 13, 19, .97) 0%, rgba(10, 13, 19, .82) 48%, rgba(10, 13, 19, .25) 100%);
}
.abf-hero__body {
  position: relative;
  z-index: 1;
  padding: 34px;
  width: 100%;
}
.abf-hero__eyebrow {
  display: block;
  color: var(--c-orange-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.abf-hero__title {
  font-family: var(--c-font-display);
  font-size: clamp(34px, 4vw, 58px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  max-width: 760px;
}
.abf-hero__lead {
  margin-top: 12px;
  max-width: 680px;
  color: var(--c-muted);
  font-size: 16px;
  line-height: 1.55;
}
.abf-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}
.abf-hero-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--c-radius-sm);
  background: rgba(13, 17, 25, .7);
  border: 1px solid var(--c-border-2);
  backdrop-filter: blur(6px);
}
.abf-hero-stat__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(var(--c-orange-rgb), .16);
  color: var(--c-orange);
}
.abf-hero-stat strong { display: block; font-family: var(--c-font-display); font-size: 17px; font-weight: 700; }
.abf-hero-stat span { font-size: 11px; color: var(--c-muted); }

/* ---------- Search ---------- */
.abf-search {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
  padding: 20px;
  border: 1px solid var(--c-glass-border);
  border-radius: var(--c-radius);
  background:
    radial-gradient(420px 220px at 90% 0%, rgba(var(--c-orange-rgb), .15), transparent 64%),
    var(--c-glass-bg),
    var(--c-card);
  box-shadow: var(--c-glass-shadow);
}
.abf-search__input {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  min-height: 52px;
  border-radius: var(--c-radius-sm);
  background: rgba(18, 23, 36, .86);
  border: 1px solid var(--c-border-2);
  color: var(--c-dim);
  transition: border-color var(--c-speed), box-shadow var(--c-speed);
}
.abf-search__input:focus-within {
  border-color: var(--c-orange);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-orange) 14%, transparent);
}
.abf-search__input input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--c-text);
  font-family: inherit;
  font-size: 15px;
  min-width: 0;
}
.abf-search__input input::placeholder { color: var(--c-dim); }
.abf-search__input input:focus { outline: none; }

.abf-search__filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.abf-search__filter {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--c-radius-pill);
  background: rgba(10, 13, 19, .58);
  border: 1px solid var(--c-border-2);
  color: var(--c-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--c-speed), border-color var(--c-speed), background var(--c-speed), box-shadow var(--c-speed);
}
.abf-search__filter:hover { border-color: var(--c-orange); color: #fff; }
.abf-search__filter.is-active {
  border-color: var(--c-orange);
  background: color-mix(in srgb, var(--c-orange) 13%, rgba(10, 13, 19, .72));
  color: #fff;
  box-shadow: inset 0 -2px 0 var(--c-orange);
}

/* ---------- Case card grid ---------- */
.abf-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}
.abf-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--c-radius);
  overflow: hidden;
}

.abf-card__media {
  position: relative;
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: var(--c-card-2);
}
.abf-card__icon {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(10, 13, 19, .75);
  border: 1px solid rgba(var(--glow-rgb, 249, 115, 22), .5);
  color: rgb(var(--glow-rgb, 249, 115, 22));
}

.abf-card__body { padding: 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.abf-card__title {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.abf-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 8px;
}
.abf-card__tag {
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: var(--c-radius-pill);
  background: rgba(var(--glow-rgb, 249, 115, 22), .16);
  color: rgb(var(--glow-rgb, 249, 115, 22));
  font-size: 10.5px;
  font-weight: 700;
}
.abf-card__meta time {
  color: var(--c-dim);
  font-size: 10.5px;
  font-weight: 700;
}
.abf-card__text {
  color: var(--c-muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 14px;
}

.abf-card__metrics {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--c-glass-border);
}
.abf-card__metric { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.abf-card__metric-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--c-dim);
}
.abf-card__metric strong { font-size: 12.5px; font-weight: 700; color: var(--c-text); }
.abf-card__difficulty { color: rgb(var(--diff-rgb, 245, 158, 11)) !important; }

.abf-card__cta { margin-top: auto; width: 100%; font-size: 13px; }

/* ---------- Single article ---------- */
.abf-single {
  margin-top: 0;
}
.abf-breadcrumb a {
  color: var(--c-dim);
  text-decoration: none;
}
.abf-breadcrumb a:hover {
  color: var(--c-orange-2);
}
.abf-article-hero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  border-radius: var(--c-radius);
  margin-bottom: 22px;
}
.abf-article-hero__media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.abf-article-hero__body {
  position: relative;
  z-index: 1;
  padding: 34px;
  max-width: 820px;
}
.abf-article-hero__body h1 {
  margin-top: 12px;
  font-family: var(--c-font-display);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.abf-article-hero__body p {
  margin-top: 14px;
  color: var(--c-muted);
  font-size: 16px;
  line-height: 1.6;
}
.abf-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.abf-article-meta span {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(10, 13, 19, .72);
  border: 1px solid var(--c-border-2);
  color: var(--c-muted);
  font-size: 12px;
  font-weight: 700;
}
.abf-article-meta strong { color: var(--c-text); }
.abf-article-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
}
.abf-article-content,
.abf-article-aside {
  padding: 24px;
  border-radius: var(--c-radius);
}
.abf-article-content {
  color: var(--c-text);
}
.abf-article-content p,
.abf-article-content li {
  color: var(--c-muted);
  font-size: 15px;
  line-height: 1.75;
}
.abf-article-content h2 {
  margin: 28px 0 10px;
  font-family: var(--c-font-display);
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.abf-article-content ul {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-left: 20px;
  list-style: disc;
}
.abf-article-aside {
  align-self: start;
  position: sticky;
  top: 32px;
}
.abf-article-aside h2 {
  margin-bottom: 14px;
  font-family: var(--c-font-display);
  font-size: 18px;
}
.abf-article-aside dl,
.abf-article-aside div {
  display: grid;
  gap: 10px;
  margin: 0;
}
.abf-article-aside div {
  gap: 2px;
  padding: 10px 0;
  border-top: 1px solid var(--c-glass-border);
}
.abf-article-aside dt {
  color: var(--c-dim);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.abf-article-aside dd {
  margin: 0;
  color: var(--c-text);
  font-weight: 700;
}

/* ---------- Banner / newsletter (shared layout) ---------- */
.abf-banner, .abf-newsletter {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px 26px;
  border-radius: var(--c-radius);
  margin-bottom: 16px;
  min-width: 0;
}
.abf-banner__icon, .abf-newsletter__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(var(--c-orange-rgb), .14);
  color: var(--c-orange);
}
.abf-newsletter__icon { background: rgba(56, 189, 248, .14); color: #7dd3fc; }

.abf-banner__body, .abf-newsletter__body { flex: 1; min-width: 0; }
.abf-banner__body h3, .abf-newsletter__body h3 {
  font-family: var(--c-font-display);
  font-size: 16px;
  font-weight: 700;
}
.abf-banner__body p, .abf-newsletter__body p {
  margin-top: 5px;
  font-size: 13px;
  color: var(--c-muted);
}

.abf-banner__actions { display: flex; gap: 10px; flex: none; }

.abf-newsletter__form {
  display: flex;
  gap: 10px;
  flex: none;
}
.abf-newsletter__form input {
  min-height: 44px;
  min-width: 220px;
  padding: 0 14px;
  border-radius: var(--c-radius-sm);
  background: rgba(18, 23, 36, .86);
  border: 1px solid var(--c-border-2);
  color: var(--c-text);
  font-family: inherit;
  font-size: 13.5px;
  transition: border-color var(--c-speed), box-shadow var(--c-speed);
}
.abf-newsletter__form input::placeholder { color: var(--c-dim); }
.abf-newsletter__form input:focus {
  outline: none;
  border-color: var(--c-orange);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-orange) 14%, transparent);
}

/* ---------------------------------------------------------------- */
/* Responsive                                                         */
/* ---------------------------------------------------------------- */

@media (max-width: 1024px) {
  .abf {
    padding: 0 18px 42px;
  }

  .abf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .abf-article-shell {
    grid-template-columns: 1fr;
  }

  .abf-article-aside {
    position: static;
  }
}

@media (max-width: 760px) {
  .abf {
    margin: 0;
    padding: 0 12px 32px;
  }

  .abf-container {
    padding-top: 24px;
  }

  .abf-breadcrumb {
    margin-bottom: 14px;
  }

  .abf-hero {
    min-height: 420px;
  }

  .abf-hero__body { padding: 22px; }
  .abf-hero__stats { flex-direction: column; }
  .abf-hero-stat { width: 100%; }

  .abf-search {
    padding: 16px;
  }

  .abf-search__filters {
    flex-wrap: nowrap;
    margin-inline: -16px;
    padding: 0 16px 4px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .abf-search__filter {
    flex: 0 0 auto;
  }

  .abf-grid { grid-template-columns: 1fr; }
  .abf-article-hero__body { padding: 24px; }

  .abf-banner, .abf-newsletter { flex-direction: column; align-items: flex-start; }
  .abf-banner__actions { width: 100%; flex-direction: column; }
  .abf-banner__actions .abf-btn { width: 100%; }
  .abf-newsletter__form { width: 100%; flex-direction: column; }
  .abf-newsletter__form input { min-width: 0; width: 100%; }
  .abf-newsletter__form .abf-btn { width: 100%; }
}

@media (max-width: 480px) {
  /* Prevent iOS auto-zoom on focus */
  .abf-search__input input,
  .abf-newsletter__form input { font-size: 16px; }
}

/* ---------------------------------------------------------------- */
/* Twenty Twenty-Five neutralization                                 */
/* ---------------------------------------------------------------- */

.is-layout-constrained > .abf,
.entry-content > .abf,
.is-layout-constrained > p:has(> .abf),
.entry-content > p:has(> .abf) {
  max-width: none !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
.is-layout-constrained > p:has(> .abf),
.entry-content > p:has(> .abf) {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
}

.has-global-padding > .abf.alignfull {
  margin-left: calc(var(--wp--style--root--padding-left) * -1);
  margin-right: calc(var(--wp--style--root--padding-right) * -1);
}

body:has(#abf-failures) { overflow-x: clip; }

body:has(.abf) {
  background: #0a0d13;
  overflow-x: clip;
}

body:has(.abf) .wp-site-blocks,
body:has(.abf) .entry-content,
body:has(.abf) .wp-block-post-content {
  background: transparent;
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body:has(.abf) .alignwide,
body:has(.abf) .alignfull {
  max-width: none !important;
  width: 100% !important;
}
