/* =============================================================================
   Components — the reusable kit. Every piece here is documented live on
   /styleguide. Class prefix `aft-` keeps the system namespaced and greppable.
   Depends on tokens.css + base.css.
   ========================================================================== */

/* --- Eyebrow / kicker label (Space Mono) --------------------------------- */
.aft-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-mono);
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.aft-eyebrow--magenta { color: var(--accent-text); }
.aft-eyebrow--lime { color: var(--c-lime); }
.aft-eyebrow::before {
  content: "";
  width: 1.4rem;
  height: 2px;
  background: currentColor;
  display: inline-block;
}
.aft-eyebrow--bare::before { display: none; }

/* Expressive marketing kicker. Size remains a separate decision. */
.aft-eyebrow--expressive {
  font-family: var(--font-sans);
  letter-spacing: var(--tracking-snug);
  word-spacing: 0.3em;
}
/* Size modifier only: it does not silently change the label's type role. */
.aft-eyebrow--lg {
  font-size: var(--fs-eyebrow-lg);
}
/* At this size + weight, bright magenta clears WCAG's 3:1 large-text
   threshold (~3.6:1 on white) — the darker --accent-text ink variant is
   only needed for small eyebrow text. */
.aft-eyebrow--lg.aft-eyebrow--magenta { color: var(--c-magenta); }

/* --- Buttons and text actions ------------------------------------------- */
.aft-btn {
  --_action-accent: var(--c-magenta);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.85em 1.5em;
  font-family: var(--font-sans);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-snug);
  word-spacing: 0.15em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--c-ink);
  background: var(--c-white);
  border: var(--bw) solid var(--c-ink);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 calc(var(--action-edge) * -1) 0 var(--_action-accent);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  text-align: center;
}
.aft-btn:hover {
  transform: translate(calc(var(--lift) * -1), calc(var(--lift) * -1));
  box-shadow: var(--lift) var(--lift) 0 var(--_action-accent),
              inset 0 calc(var(--action-edge) * -1) 0 var(--_action-accent);
}
.aft-btn:active {
  transform: none;
  box-shadow: inset 0 calc(var(--action-edge) * -1) 0 var(--_action-accent);
}
.aft-btn:disabled,
.aft-btn[aria-disabled="true"] {
  color: var(--text-faint);
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: inset 0 calc(var(--action-edge) * -1) 0 var(--c-line);
}
.aft-btn--primary { background: var(--c-white); }
.aft-btn--primary-ink {
  color: var(--c-white);
  background: var(--c-ink);
}
.aft-btn--secondary {
  background: transparent;
  box-shadow: none;
}
.aft-btn--secondary:hover { box-shadow: var(--lift) var(--lift) 0 var(--_action-accent); }
.aft-btn--secondary:active { box-shadow: none; }
.aft-btn--inverse {
  --_action-accent: var(--c-lime);
  color: var(--c-ink);
  background: var(--c-white);
}

.aft-text-action {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  line-height: 1.3;
  color: var(--c-ink);
  text-decoration-line: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: var(--bw);
  text-underline-offset: var(--sp-1);
  transition: text-decoration-color var(--dur) var(--ease);
}
.aft-text-action:hover { text-decoration-color: var(--c-magenta); }
.aft-text-action--brush::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  height: var(--action-edge);
  background: var(--c-magenta);
  clip-path: polygon(0 35%, 15% 5%, 38% 28%, 62% 0, 82% 30%, 100% 12%,
                     98% 85%, 74% 65%, 45% 100%, 20% 70%, 2% 92%);
}
.aft-text-action--lime::after { background: var(--c-lime); }

/* Sizes */
.aft-btn--lg { padding: 1.05em 2em; font-size: var(--fs-base); }
.aft-btn--sm { padding: 0.6em 1.1em; font-size: var(--fs-xs); }
.aft-btn--block { display: flex; width: 100%; }

/* --- Brush stroke accent -------------------------------------------------- */
/* A thin, hand-drawn highlighter/paint swipe under one accent word. Wrap the
   word in <span class="aft-brush"> (magenta) or add --lime for use on dark
   backgrounds. */
.aft-brush {
  position: relative;
  display: inline-block;
}
.aft-brush::after {
  content: "";
  position: absolute;
  left: 4%; right: 8%; bottom: -0.16em;
  height: 0.135em;
  background: var(--c-magenta);
  clip-path: polygon(
    0% 30%, 10% 10%, 25% 0%, 45% 15%, 65% 25%, 85% 35%, 100% 45%,
    100% 55%, 85% 60%, 65% 68%, 45% 78%, 25% 88%, 10% 95%, 0% 70%
  );
  transform: rotate(0.5deg);
}
.aft-brush::before {
  content: "";
  position: absolute;
  right: -12%; bottom: -0.2em;
  width: 1.4em; height: 0.3em;
  background:
    radial-gradient(circle, var(--c-magenta) 45%, transparent 46%) 8% 35% / 0.08em 0.08em no-repeat,
    radial-gradient(circle, var(--c-magenta) 45%, transparent 46%) 42% 65% / 0.055em 0.055em no-repeat,
    radial-gradient(circle, var(--c-magenta) 45%, transparent 46%) 72% 15% / 0.04em 0.04em no-repeat,
    radial-gradient(circle, var(--c-magenta) 45%, transparent 46%) 95% 50% / 0.03em 0.03em no-repeat;
}
.aft-brush--lime::after,
.aft-brush--lime::before { background-color: var(--c-lime); }
.aft-brush--lime::before {
  background:
    radial-gradient(circle, var(--c-lime) 45%, transparent 46%) 8% 35% / 0.08em 0.08em no-repeat,
    radial-gradient(circle, var(--c-lime) 45%, transparent 46%) 42% 65% / 0.055em 0.055em no-repeat,
    radial-gradient(circle, var(--c-lime) 45%, transparent 46%) 72% 15% / 0.04em 0.04em no-repeat,
    radial-gradient(circle, var(--c-lime) 45%, transparent 46%) 95% 50% / 0.03em 0.03em no-repeat;
}

/* --- Tags / category chips (Space Mono) ---------------------------------- */
.aft-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.34em 0.7em;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--c-ink);
  background: var(--c-paper-2);
  border: 2px solid var(--c-ink);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.aft-tag--magenta { background: var(--c-magenta); color: var(--c-ink); }
.aft-tag--lime    { background: var(--c-lime);    color: var(--c-ink); }
.aft-tag--ink     { background: var(--c-ink);     color: var(--c-white); }
.aft-tag--soft    { background: var(--c-magenta-soft); border-color: var(--c-magenta); color: var(--accent-text); }

/* Interactive filter chip (button/checkbox styled) */
.aft-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.5em 1em;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--c-ink);
  background: var(--c-white);
  border: 2px solid var(--c-line);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.aft-chip:hover { border-color: var(--c-ink); }
.aft-chip[aria-pressed="true"], .aft-chip.is-active {
  background: var(--c-ink); color: var(--c-white); border-color: var(--c-ink);
}

/* --- Cards --------------------------------------------------------------- */
.aft-card {
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border: var(--bw) solid var(--c-ink);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* Lift-on-hover card — gains its neon shadow when you reach for it. */
.aft-card--lift { cursor: pointer; }
.aft-card--lift:hover {
  transform: translate(calc(var(--lift) * -1), calc(var(--lift) * -1));
  box-shadow: var(--shadow-magenta);
}
.aft-card--shadow    { box-shadow: var(--shadow-ink); }
.aft-card--shadow-magenta { box-shadow: var(--shadow-magenta); }
.aft-card--shadow-lime    { box-shadow: var(--shadow-lime); }
.aft-card--ink { background: var(--c-ink); color: var(--c-on-ink); border-color: var(--c-ink); }

/* --- Concise carousel ---------------------------------------------------- */
.aft-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.aft-carousel__track {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-block: var(--sp-1);
  scrollbar-width: none;
}
.aft-carousel__track::-webkit-scrollbar { display: none; }
.aft-carousel__slide {
  flex: 0 0 var(--carousel-card-width);
  scroll-snap-align: start;
}
.aft-carousel__slide .aft-carousel-card { height: 100%; }
.aft-carousel-card { position: relative; min-height: var(--carousel-card-min-height); }
.aft-carousel-card__title {
  font-size: var(--fs-base);
  font-weight: var(--fw-heavy);
  letter-spacing: var(--tracking-snug);
  line-height: var(--lh-snug);
}
.aft-carousel-card__title-link { color: inherit; text-decoration: none; }
.aft-carousel-card__title-link:hover,
.aft-carousel-card__title-link:focus-visible { color: var(--accent-text); }
.aft-carousel-card__title-link::after { content: ""; position: absolute; inset: 0; }
.aft-carousel-card__foot { margin-top: auto; }
.aft-carousel-card__location { font-size: var(--fs-sm); color: var(--text-muted); }
.aft-carousel-card__deadline {
  margin-top: var(--sp-1);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-faint);
}
.aft-carousel-card__tag { margin-top: var(--sp-3); }
.aft-carousel__arrow {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: var(--size-control);
  height: var(--size-control);
  font-size: var(--fs-lg);
  line-height: 1;
  background: var(--c-white);
  color: var(--c-ink);
  border: var(--bw-thick) solid var(--c-ink);
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.aft-carousel__arrow:hover {
  transform: translate(calc(var(--lift) * -1), calc(var(--lift) * -1));
  box-shadow: var(--lift) var(--lift) 0 var(--c-lime);
}

/* --- Featured pair ------------------------------------------------------- */
.aft-featured-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-5);
  align-items: stretch;
}
.aft-featured-card {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: var(--sp-5);
  align-items: center;
  padding: var(--sp-5);
  border: var(--bw-thick) solid var(--c-ink);
  border-radius: var(--radius-xl);
}
.aft-featured-card--light {
  background: var(--c-white);
  box-shadow: var(--shadow-magenta);
}
.aft-featured-card--dark {
  background: var(--c-ink);
  color: var(--c-on-ink);
  box-shadow: var(--shadow-lime);
}
.aft-featured-card__media {
  aspect-ratio: 1;
  overflow: hidden;
  border: var(--bw) solid var(--c-ink);
  border-radius: var(--radius);
}
.aft-featured-card__media img { width: 100%; height: 100%; object-fit: cover; }
.aft-featured-card__meta { margin-top: var(--sp-2); font-size: var(--fs-sm); }
.aft-featured-card--light .aft-featured-card__meta { color: var(--text-muted); }
.aft-featured-card--dark .aft-featured-card__meta { color: var(--c-on-ink-muted); }
.aft-featured-card__status { margin-top: var(--sp-4); }
@media (max-width: 56rem) { .aft-featured-pair { grid-template-columns: 1fr; } }
@media (max-width: 34rem) { .aft-featured-card { grid-template-columns: 1fr; } }

/* --- Ordered process steps ---------------------------------------------- */
.aft-process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-5);
  margin-top: var(--sp-7);
  text-align: center;
}
.aft-process-step__icon {
  display: grid;
  place-items: center;
  width: var(--size-process-icon);
  height: var(--size-process-icon);
  margin-inline: auto;
  border: var(--bw-thick) solid var(--c-ink);
  border-radius: 50%;
}
.aft-process-step:nth-child(odd) .aft-process-step__icon { color: var(--c-magenta-ink); }
.aft-process-step:nth-child(even) .aft-process-step__icon { color: var(--c-lime-ink); }
.aft-process-step__icon svg { width: 1.75rem; height: 1.75rem; }
.aft-process-step h3 { margin-top: var(--sp-4); font-size: var(--fs-base); }
.aft-process-step p { margin-top: var(--sp-2); font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 56rem) { .aft-process { grid-template-columns: 1fr 1fr; } }
@media (max-width: 30rem) { .aft-process { grid-template-columns: 1fr; } }

/* --- Panels (the big 50/50 blocks) --------------------------------------- */
.aft-panel {
  position: relative;
  background: var(--c-white);
  border: var(--bw-thick) solid var(--c-ink);
  border-radius: var(--radius-xl);
  padding: clamp(1.75rem, 4vw, 3rem);
  height: 100%;
}

/* --- Field / form controls ----------------------------------------------- */
.aft-field { display: flex; flex-direction: column; gap: var(--sp-2); }
.aft-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}
.aft-input,
.aft-textarea,
.aft-select {
  width: 100%;
  padding: 0.8em 1em;
  font-size: var(--fs-sm);
  color: var(--c-ink);
  background: var(--c-white);
  border: 2px solid var(--c-ink);
  border-radius: var(--radius);
  transition: box-shadow var(--dur) var(--ease);
}
.aft-input::placeholder, .aft-textarea::placeholder { color: var(--text-faint); }
.aft-input:focus-visible,
.aft-textarea:focus-visible,
.aft-select:focus-visible {
  outline: none;
  box-shadow: var(--shadow-magenta-sm);
}
.aft-textarea { min-height: 7rem; resize: vertical; }

/* Search field with a pill shape, common on the directory */
.aft-search {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.3em 0.4em 0.3em 1.1em;
  background: var(--c-white);
  border: 2px solid var(--c-ink);
  border-radius: var(--radius-pill);
}
.aft-search input { border: none; outline: none; flex: 1; background: none; padding: 0.5em 0; }

/* --- Badge (small status pip) -------------------------------------------- */
.aft-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}
.aft-badge::before {
  content: "";
  width: 0.55em; height: 0.55em;
  border-radius: 50%;
  background: var(--c-lime);
  border: 1px solid var(--c-ink);
}

/* --- Divider with a mono caption ----------------------------------------- */
.aft-rule {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  color: var(--text-faint);
}
.aft-rule::before, .aft-rule::after {
  content: ""; flex: 1; height: 2px; background: var(--c-line);
}

/* --- Link with animated underline ---------------------------------------- */
.aft-link {
  color: var(--c-ink);
  font-weight: var(--fw-medium);
  background-image: linear-gradient(var(--c-magenta), var(--c-magenta));
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size var(--dur) var(--ease);
  padding-bottom: 2px;
}
.aft-link:hover, .aft-link:focus-visible { background-size: 100% 2px; }
