/* CryptoFrame — components: sections, cards, hero layouts, ticker, term
   buttons, FAQ, glossary, events, ads, market slots, pagination. */

/* ---------- Sections ---------- */

.cfx-section { position: relative; }
.cfx-section--space-none { padding-block: 0; }
.cfx-section--space-sm   { padding-block: calc(var(--cfx-section-gap) * .45); }
.cfx-section--space-md   { padding-block: calc(var(--cfx-section-gap) * .8); }
.cfx-section--space-lg   { padding-block: var(--cfx-section-gap); }

.cfx-section--bg-surface { background: var(--cfx-surface); }
.cfx-section--bg-accent  { background: rgba(var(--cfx-primary-rgb), .08); }
.cfx-section--bg-dark    { background: var(--cfx-secondary); color: var(--cfx-on-secondary); }
.cfx-section--bg-dark h2, .cfx-section--bg-dark h3, .cfx-section--bg-dark .cfx-card__title a { color: #fff; }
.cfx-section--bg-custom  { background: var(--cfx-section-bg, transparent); }

.cfx-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding-bottom: .55rem;
  border-bottom: 2px solid var(--cfx-heading);
}
.cfx-section__title { margin: 0; font-size: var(--cfx-fs-2); }
.cfx-section__more {
  flex: 0 0 auto;
  font-family: var(--cfx-font-label);
  font-size: var(--cfx-fs-sm);
  font-weight: 600;
  text-decoration: none;
}

/* ---------- Card grid ---------- */

.cfx-cards {
  display: grid;
  gap: calc(var(--cfx-gutter) * .9);
  grid-template-columns: repeat(var(--cfx-cols-m, 1), minmax(0, 1fr));
}
@media (min-width: 783px) {
  .cfx-cards { grid-template-columns: repeat(var(--cfx-cols-t, 2), minmax(0, 1fr)); }
}
@media (min-width: 1025px) {
  .cfx-cards { grid-template-columns: repeat(var(--cfx-cols-d, 3), minmax(0, 1fr)); }
  .cfx-cards--cols-1 { --cfx-cols-d: 1; }
  .cfx-cards--cols-2 { --cfx-cols-d: 2; }
  .cfx-cards--cols-3 { --cfx-cols-d: 3; }
  .cfx-cards--cols-4 { --cfx-cols-d: 4; }
  .cfx-cards--cols-5 { --cfx-cols-d: 5; }
  .cfx-cards--cols-6 { --cfx-cols-d: 6; }
}

.cfx-cards--list { grid-template-columns: 1fr !important; gap: 0; }

/* Horizontal cards: media beside copy, in however many columns are configured. */
.cfx-cards--horizontal > .cfx-card { flex-direction: row; align-items: stretch; }
.cfx-cards--horizontal > .cfx-card .cfx-card__media { flex: 0 0 40%; position: relative; min-height: 7rem; }
.cfx-cards--horizontal > .cfx-card .cfx-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
}
.cfx-cards--horizontal > .cfx-card .cfx-card__body { flex: 1 1 auto; min-width: 0; }
@media (max-width: 600px) {
  .cfx-cards--horizontal > .cfx-card { flex-direction: column; }
  /* Return the image to normal flow, or the absolutely positioned fill above
     would leave a zero-height media box and the image would vanish. */
  .cfx-cards--horizontal > .cfx-card .cfx-card__media { flex: 0 0 auto; position: static; min-height: 0; }
  .cfx-cards--horizontal > .cfx-card .cfx-card__img {
    position: static;
    height: auto;
    aspect-ratio: 3 / 2;
  }
}
.cfx-cards--scroll {
  display: flex;
  gap: calc(var(--cfx-gutter) * .8);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: .6rem;
}
.cfx-cards--scroll > * { flex: 0 0 min(20rem, 78vw); scroll-snap-align: start; }

/* ---------- Card ---------- */

.cfx-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--cfx-card);
  border-radius: var(--cfx-radius-card);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.cfx-cards-elevated .cfx-card { box-shadow: var(--cfx-shadow-1); }
.cfx-cards-elevated .cfx-card:hover { box-shadow: var(--cfx-shadow-2); }
.cfx-cards-bordered .cfx-card { border: var(--cfx-border-width) solid var(--cfx-border); }
.cfx-cards-bordered .cfx-card:hover { border-color: var(--cfx-primary); }
.cfx-cards-flat .cfx-card { background: transparent; border-radius: 0; }
.cfx-cards-glass .cfx-card {
  background: var(--cfx-glass-bg);
  border: 1px solid var(--cfx-hairline);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cfx-card__media { display: block; overflow: hidden; background: var(--cfx-surface); }
/*
 * A fixed ratio plus `cover` is what keeps a portrait upload from rendering at
 * its natural height and blowing the card out. Nothing below may set
 * `aspect-ratio: auto` without also giving the media box a definite height —
 * see the hero rules for how that is done.
 */
.cfx-card__img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; object-position: center; transition: transform .4s ease; }
.cfx-card:hover .cfx-card__img { transform: scale(1.035); }

.cfx-card__body { display: flex; flex-direction: column; gap: .3rem; padding: .95rem 1rem 1.05rem; }
.cfx-cards-flat .cfx-card__body { padding-inline: 0; }

.cfx-card__title { margin: 0; font-size: var(--cfx-fs-1); line-height: 1.25; }
.cfx-card__title a { color: var(--cfx-heading); text-decoration: none; }
.cfx-card__title a:hover { color: var(--cfx-primary); }

.cfx-card__excerpt { margin: .25rem 0 0; font-size: var(--cfx-fs-sm); color: var(--cfx-muted); }

.cfx-card__rank {
  position: absolute;
  top: .5rem; right: .7rem;
  font-size: var(--cfx-fs-3);
  font-weight: 700;
  color: rgba(var(--cfx-primary-rgb), .28);
  line-height: 1;
}

/* Card variants */
.cfx-card--lead .cfx-card__title { font-size: var(--cfx-fs-4); }
.cfx-card--lead .cfx-card__img { aspect-ratio: 16 / 9; max-height: 46vh; }

.cfx-card--feature .cfx-card__title { font-size: var(--cfx-fs-2); }
.cfx-card--feature .cfx-card__img { max-height: 34vh; }

.cfx-card--banner { border-radius: var(--cfx-radius-card); }
.cfx-card--banner .cfx-card__img { aspect-ratio: 21 / 9; max-height: 52vh; }
.cfx-card--banner .cfx-card__title { font-size: var(--cfx-fs-5); }

.cfx-card--list {
  flex-direction: row;
  gap: .9rem;
  align-items: flex-start;
  padding-block: .85rem;
  border-bottom: 1px solid var(--cfx-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none !important;
}
.cfx-card--list .cfx-card__media { flex: 0 0 6.5rem; border-radius: calc(var(--cfx-radius-card) * .6); }
.cfx-card--list .cfx-card__img { aspect-ratio: 3 / 2; }
.cfx-card--list .cfx-card__body { padding: 0; }
.cfx-card--list .cfx-card__title { font-size: var(--cfx-fs-base); }

.cfx-card--compact .cfx-card__title { font-size: var(--cfx-fs-base); }

.cfx-card--immersive { border-radius: calc(var(--cfx-radius-card) * 1.2); }
.cfx-card--immersive .cfx-card__img { aspect-ratio: 16 / 9; max-height: 54vh; }
.cfx-card--immersive .cfx-card__title { font-size: var(--cfx-fs-5); }

.cfx-card--glass {
  background: var(--cfx-glass-bg);
  border: 1px solid var(--cfx-hairline);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.cfx-card--nomedia .cfx-card__body { padding-top: 1.05rem; }

/* ---------- Lead + grid loop ---------- */

/*
 * The lead card sits in its own full-width row. Without an explicit cap a 16:9
 * image at container width is over 670px tall, which pushes every other
 * headline below the fold — the opposite of what a lead is for. Media heights
 * are therefore capped in viewport units as well as by ratio, and the whole
 * loop switches to a two-column arrangement once there is room.
 */
.cfx-loop--mixed { display: grid; gap: calc(var(--cfx-gutter) * .9); }

@media (min-width: 1025px) {
  .cfx-loop--mixed { grid-template-columns: 1.55fr 1fr; align-items: start; }
  .cfx-loop__lead { grid-column: 1; }
  .cfx-loop--mixed > .cfx-cards { grid-column: 2; grid-template-columns: 1fr; }
  .cfx-loop--mixed > .cfx-cards > .cfx-card { flex-direction: row; gap: .9rem; background: transparent; box-shadow: none; }
  .cfx-loop--mixed > .cfx-cards > .cfx-card .cfx-card__media { flex: 0 0 6.5rem; border-radius: calc(var(--cfx-radius-card) * .6); }
  .cfx-loop--mixed > .cfx-cards > .cfx-card .cfx-card__body { padding: 0 0 .85rem; }
  .cfx-loop--mixed > .cfx-cards > .cfx-card .cfx-card__title { font-size: var(--cfx-fs-base); }
  .cfx-loop--mixed > .cfx-cards > .cfx-card .cfx-card__excerpt { display: none; }
}

.cfx-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-top: .4rem;
  font-size: var(--cfx-fs-xs);
  color: var(--cfx-muted);
}
.cfx-meta__item + .cfx-meta__item::before { content: "·"; margin-right: .55rem; opacity: .6; }
.cfx-meta__author,
.cfx-meta__reading { white-space: nowrap; }
.cfx-meta a { color: inherit; text-decoration: none; }
.cfx-meta a:hover { color: var(--cfx-primary); }
.cfx-meta__avatar img { border-radius: 50%; }

/* ---------- Hero ---------- */

.cfx-hero { display: grid; gap: calc(var(--cfx-gutter) * .9); }

/*
 * Hero arrangement.
 *
 * The rule that matters here is that the lead sets the height and every
 * companion column stretches to match it. Previously .cfx-hero__main,
 * __banner, __magmain and __magside carried no styling at all, so each column
 * sized itself independently from its own content — which is why the lead and
 * the side list ended at different heights and the whole block looked lopsided.
 *
 * The lead's image is capped in viewport units; the side columns then fill
 * whatever height that produces, so the two edges always line up.
 */
.cfx-hero__main .cfx-card__img,
.cfx-hero__banner .cfx-card__img,
.cfx-hero__magmain .cfx-card__img,
.cfx-hero__stage .cfx-card__img { max-height: 44vh; }

.cfx-hero__solo { max-width: 46rem; margin-inline: auto; }
.cfx-hero__solo .cfx-card__img { max-height: 38vh; }

/* Lead columns: the card fills the track rather than sitting at its top. */
.cfx-hero__main,
.cfx-hero__magmain,
.cfx-hero__stage,
.cfx-hero__banner { display: flex; min-width: 0; }
.cfx-hero__main > .cfx-card,
.cfx-hero__magmain > .cfx-card,
.cfx-hero__stage > .cfx-card,
.cfx-hero__banner > .cfx-card { flex: 1 1 auto; min-width: 0; }

/*
 * Side column.
 *
 * `grid-auto-rows: 1fr` alone does not produce equal columns here, and the
 * reason is circular: a grid row is sized by its tallest item, so with both
 * columns set to auto the side column's own content decides the row height,
 * `1fr` then resolves against that same content, and the side ends up driving
 * the layout rather than filling it — visibly overshooting the lead.
 *
 * Breaking the circle needs one definite height for both columns to resolve
 * against, which is what the min-height on the container below provides. Once
 * the row has a known height the lead's media flexes to fill it, the side rows
 * divide it evenly, and both edges land on the same line.
 */
.cfx-hero__side { min-width: 0; }
.cfx-hero__side > .cfx-card { display: flex; flex-direction: column; min-height: 0; }
/*
 * `flex-basis: 0`, not `auto`. With `auto` the media box is sized from its
 * content — the image — so the card grows to the image's natural height and the
 * row overshoots. With `0` the box takes only the space the flex line has left.
 *
 * The image is then taken out of flow entirely and stretched to fill that box.
 * That is what makes the height definite: `height: 100%` on an in-flow child of
 * an auto-height parent resolves to `auto`, which is the natural image height
 * again — the exact loop this replaces.
 */
.cfx-hero__side > .cfx-card .cfx-card__body { flex: 0 0 auto; }

@media (min-width: 1025px) {
  .cfx-hero--a .cfx-hero__split,
  .cfx-hero--d .cfx-hero__mag { min-height: clamp(26rem, 56vh, 38rem); }

  /* The lead fills the row instead of being sized by its own image ratio. */
  .cfx-hero__main > .cfx-card,
  .cfx-hero__magmain > .cfx-card { display: flex; flex-direction: column; }
  .cfx-hero__main > .cfx-card .cfx-card__media,
  .cfx-hero__magmain > .cfx-card .cfx-card__media { flex: 1 1 0; min-height: 0; position: relative; }
  .cfx-hero__main > .cfx-card .cfx-card__img,
  .cfx-hero__magmain > .cfx-card .cfx-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    max-height: none;
    object-fit: cover;
  }
  .cfx-hero__main > .cfx-card .cfx-card__body,
  .cfx-hero__magmain > .cfx-card .cfx-card__body { flex: 0 0 auto; }

  /* minmax(0, 1fr) rather than 1fr: without the zero minimum a row refuses to
     shrink below its content and the even split breaks again. */
  .cfx-hero__side { grid-auto-rows: minmax(0, 1fr); }

  /* Desktop only: below this breakpoint the hero stacks and there is no definite
     row height for an absolutely positioned image to fill, so the media keeps
     its ordinary fixed ratio instead. */
  .cfx-hero__side > .cfx-card .cfx-card__media { flex: 1 1 0; min-height: 4rem; position: relative; }
  .cfx-hero__side > .cfx-card .cfx-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
  }
}

/* Magazine layout: a ranked list beside the lead, ruled rather than boxed. */
.cfx-hero__magside {
  display: grid;
  align-content: start;
  min-width: 0;
  gap: 0;
}
@media (min-width: 1025px) {
  .cfx-hero__magside { align-content: stretch; grid-auto-rows: minmax(0, 1fr); }
  .cfx-hero__magside .cfx-card--list { align-items: center; }
}
.cfx-hero__magside .cfx-card--list { padding-block: .8rem; }
.cfx-hero__magside .cfx-card--list:first-child { padding-top: 0; }
.cfx-hero__magside .cfx-card--list:last-child { border-bottom: 0; padding-bottom: 0; }

/* Banner layout: one wide plate, then an even row beneath it. */
.cfx-hero__banner > .cfx-card { width: 100%; }

/* Immersive layout: the deck sits under the stage, never beside it. */
.cfx-hero__stage { min-width: 0; }

/*
 * Empty grid tracks are prevented in PHP, not here. `:empty` does not match an
 * element containing whitespace, and a PHP template always emits newlines
 * inside its containers — so a CSS-side guard would silently never fire. The
 * hero degrades its layout before rendering instead.
 */

.cfx-hero__split { display: grid; gap: calc(var(--cfx-gutter) * .9); align-items: stretch; }
@media (min-width: 1025px) {
  .cfx-hero__split { grid-template-columns: 1.65fr 1fr; }
  /* align-content is deliberately not set: the rows are 1fr and must divide the
     lead's height between them rather than packing to the top. */
  .cfx-hero__side { display: grid; gap: calc(var(--cfx-gutter) * .9); }
}

.cfx-hero__cols { display: grid; gap: calc(var(--cfx-gutter) * .9); }
@media (min-width: 783px) { .cfx-hero__cols { grid-template-columns: repeat(3, 1fr); } }

.cfx-hero__row { display: grid; gap: calc(var(--cfx-gutter) * .9); }
@media (min-width: 783px) { .cfx-hero__row { grid-template-columns: repeat(3, 1fr); } }

.cfx-hero__mag { display: grid; gap: calc(var(--cfx-gutter) * .9); }
@media (min-width: 1025px) { .cfx-hero__mag { grid-template-columns: 1.8fr 1fr; } }

.cfx-hero__immersive { position: relative; display: grid; gap: calc(var(--cfx-gutter) * .9); }
.cfx-hero__deck { display: grid; gap: calc(var(--cfx-gutter) * .8); }
@media (min-width: 783px) { .cfx-hero__deck { grid-template-columns: repeat(3, 1fr); } }

/* Background treatments */
/*
 * The grid is a texture, not a chart. It was previously drawn in the hairline
 * colour at 48px, which reads as graph paper tiled edge to edge — especially on
 * light schemes. It now uses a dedicated, far fainter token, a larger cell, and
 * a mask that fades it out down the page so it never competes with content.
 */
.cfx-bg-grid .cfx-main {
  position: relative;
}
.cfx-bg-grid .cfx-main::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--cfx-texture) 1px, transparent 1px),
    linear-gradient(to bottom, var(--cfx-texture) 1px, transparent 1px);
  background-size: 88px 88px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), transparent 62%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.85), transparent 62%);
}
.cfx-bg-mesh .cfx-main {
  background-image:
    radial-gradient(45rem 22rem at 12% -8%, rgba(var(--cfx-primary-rgb), .18), transparent 60%),
    radial-gradient(38rem 20rem at 88% 4%, rgba(var(--cfx-accent-rgb), .16), transparent 62%);
  background-repeat: no-repeat;
}
.cfx-bg-aurora .cfx-main {
  background-image:
    radial-gradient(60rem 26rem at 20% -10%, rgba(var(--cfx-primary-rgb), .26), transparent 62%),
    radial-gradient(48rem 24rem at 80% 6%, rgba(var(--cfx-accent-rgb), .22), transparent 60%),
    radial-gradient(40rem 20rem at 50% 30%, rgba(var(--cfx-secondary-rgb), .16), transparent 65%);
  background-repeat: no-repeat;
}
.cfx-bg-noise .cfx-main::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 1;
  background-image: repeating-conic-gradient(var(--cfx-heading) 0% 25%, transparent 0% 50%);
  background-size: 3px 3px;
}

/* ---------- Ticker ---------- */

.cfx-ticker {
  background: var(--cfx-ticker-bg, var(--cfx-surface));
  color: var(--cfx-ticker-fg, var(--cfx-heading));
  border-bottom: var(--cfx-border-width) solid var(--cfx-border);
  overflow: hidden;
}
.cfx-ticker__inner { display: flex; align-items: center; gap: .9rem; min-height: 2.5rem; }
.cfx-ticker__label {
  flex: 0 0 auto;
  padding: .2rem .55rem;
  background: var(--cfx-primary);
  color: var(--cfx-on-primary);
  border-radius: 3px;
  font-family: var(--cfx-font-label);
  font-size: var(--cfx-fs-xs);
  font-weight: 700;
  letter-spacing: var(--cfx-ls-label);
  text-transform: uppercase;
}
.cfx-ticker__viewport { flex: 1 1 auto; overflow: hidden; min-width: 0; }
.cfx-ticker__track {
  display: flex;
  gap: 2.2rem;
  margin: 0; padding: 0;
  list-style: none;
  white-space: nowrap;
  will-change: transform;
  animation: cfx-marquee var(--cfx-ticker-speed, 40s) linear infinite;
}
.cfx-ticker--reverse .cfx-ticker__track { animation-direction: reverse; }
.cfx-ticker--pausable:hover .cfx-ticker__track,
.cfx-ticker__track:focus-within { animation-play-state: paused; }
.cfx-ticker__item { font-size: var(--cfx-fs-sm); }
.cfx-ticker__item a { color: inherit; text-decoration: none; }
.cfx-ticker__item a:hover { text-decoration: underline; }
.cfx-ticker__slot { flex: 0 0 auto; }

@keyframes cfx-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .cfx-ticker__track { animation: none; overflow-x: auto; }
}
.cfx-motion-reduced .cfx-ticker__track { animation: none; }

/* ---------- Term buttons ---------- */

.cfx-termbuttons { margin-block: 1.2rem; }
.cfx-termbuttons__label {
  display: block;
  margin-bottom: .5rem;
  font-family: var(--cfx-font-label);
  font-size: var(--cfx-fs-xs);
  letter-spacing: var(--cfx-ls-label);
  text-transform: var(--cfx-case-label);
  color: var(--cfx-muted);
}
.cfx-termbuttons ul { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.cfx-termbuttons a {
  display: inline-block;
  padding: .38rem .8rem;
  font-family: var(--cfx-font-button);
  font-size: var(--cfx-fs-sm);
  text-decoration: none;
  color: var(--cfx-heading);
  background: var(--cfx-surface);
  border: var(--cfx-border-width) solid transparent;
  border-radius: var(--cfx-radius-pill);
  transition: background-color .16s ease, color .16s ease, border-color .16s ease;
}
.cfx-termbuttons a:hover { background: var(--cfx-primary); color: var(--cfx-on-primary); }

.cfx-termbuttons--pills a { border-radius: var(--cfx-radius-pill); }
.cfx-termbuttons--rounded a { border-radius: var(--cfx-radius-button); }
.cfx-termbuttons--outlined a { background: transparent; border-color: var(--cfx-border); border-radius: var(--cfx-radius-button); }
.cfx-termbuttons--outlined a:hover { border-color: var(--cfx-primary); background: transparent; color: var(--cfx-primary); }
.cfx-termbuttons--links a { background: transparent; padding: .1rem 0; color: var(--cfx-link); text-decoration: underline; }
.cfx-termbuttons--links ul { gap: .3rem 1.1rem; }
.cfx-termbuttons--links a:hover { background: transparent; color: var(--cfx-hover); }

/* ---------- Breadcrumbs & pagination ---------- */

.cfx-breadcrumbs { margin-bottom: 1rem; font-size: var(--cfx-fs-xs); color: var(--cfx-muted); }
.cfx-breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.cfx-breadcrumbs li + li::before { content: "/"; margin-right: .4rem; opacity: .55; }
.cfx-breadcrumbs a { color: inherit; text-decoration: none; }
.cfx-breadcrumbs a:hover { color: var(--cfx-primary); text-decoration: underline; }

.cfx-pagination { margin-top: 2rem; }
.cfx-pagination ul { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.cfx-pagination a, .cfx-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  padding-inline: .6rem;
  border: var(--cfx-border-width) solid var(--cfx-border);
  border-radius: var(--cfx-radius-button);
  text-decoration: none;
  color: var(--cfx-heading);
  font-size: var(--cfx-fs-sm);
}
.cfx-pagination .current { background: var(--cfx-primary); border-color: var(--cfx-primary); color: var(--cfx-on-primary); }
.cfx-pagination a:hover { border-color: var(--cfx-primary); color: var(--cfx-primary); }

/* ---------- Archive heads ---------- */

.cfx-archive__head { margin-bottom: 1.6rem; }
.cfx-archive__title { margin: 0 0 .35rem; font-size: var(--cfx-fs-5); }
.cfx-archive__desc { color: var(--cfx-muted); max-width: 68ch; }
.cfx-archive__count { color: var(--cfx-muted); font-size: var(--cfx-fs-sm); }

.cfx-authorhead { display: flex; gap: 1.2rem; align-items: flex-start; margin-bottom: 1.8rem; }
.cfx-authorhead__avatar { border-radius: 50%; flex: 0 0 auto; }
.cfx-authorhead__bio { color: var(--cfx-muted); max-width: 62ch; }
.cfx-authorhead__link { font-size: var(--cfx-fs-sm); }
.cfx-authorhead__link a { color: var(--cfx-link); }

.cfx-catintro { margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid var(--cfx-border); }
.cfx-catintro__title { font-size: var(--cfx-fs-2); }
.cfx-catfeatured, .cfx-catlatest, .cfx-catanalysis, .cfx-related { margin-block: 2.2rem; }

/* ---------- FAQ ---------- */

.cfx-faq { margin-block: 2.4rem; }
.cfx-faq__title { font-size: var(--cfx-fs-3); }
.cfx-faq__list { display: grid; gap: .55rem; }
.cfx-faq__item {
  background: var(--cfx-card);
  border: var(--cfx-border-width) solid var(--cfx-border);
  border-radius: var(--cfx-radius-card);
  overflow: hidden;
}
.cfx-faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  cursor: pointer;
  font-family: var(--cfx-font-heading);
  font-weight: 600;
  color: var(--cfx-heading);
  list-style: none;
}
.cfx-faq__q::-webkit-details-marker { display: none; }
.cfx-faq__q::after { content: "+"; flex: 0 0 auto; font-size: 1.25em; color: var(--cfx-primary); }
.cfx-faq__item[open] .cfx-faq__q::after { content: "−"; }
.cfx-faq__a { padding: 0 1rem 1rem; color: var(--cfx-text); }

/* ---------- Table of contents ---------- */

.cfx-toc {
  margin-block: 1.6rem;
  padding: 1rem 1.1rem;
  background: var(--cfx-surface);
  border-left: 3px solid var(--cfx-primary);
  border-radius: var(--cfx-radius-card);
}
.cfx-toc__title { margin: 0 0 .55rem; font-size: var(--cfx-fs-base); }
.cfx-toc__list { margin: 0; padding-left: 1.15rem; display: grid; gap: .3rem; }
.cfx-toc__item { margin: 0; }
.cfx-toc__item--h3 { margin-left: .9rem; font-size: var(--cfx-fs-sm); }
.cfx-toc__item--h4 { margin-left: 1.8rem; font-size: var(--cfx-fs-sm); opacity: .85; }
.cfx-toc a { color: var(--cfx-text); text-decoration: none; }
.cfx-toc a:hover, .cfx-toc a.is-active { color: var(--cfx-primary); text-decoration: underline; }

/* ---------- Glossary ---------- */

.cfx-glossary__az ul { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 0 1.6rem; padding: 0; list-style: none; }
.cfx-glossary__az a, .cfx-glossary__az span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem; height: 2rem;
  border: var(--cfx-border-width) solid var(--cfx-border);
  border-radius: var(--cfx-radius-button);
  font-family: var(--cfx-font-data);
  font-size: var(--cfx-fs-sm);
  text-decoration: none;
  color: var(--cfx-heading);
}
.cfx-glossary__az span { opacity: .35; }
.cfx-glossary__az a:hover { background: var(--cfx-primary); border-color: var(--cfx-primary); color: var(--cfx-on-primary); }

.cfx-glossary__group { margin-bottom: 2rem; scroll-margin-top: calc(var(--cfx-sticky-offset) + 1rem); }
.cfx-glossary__letter {
  font-size: var(--cfx-fs-3);
  padding-bottom: .3rem;
  border-bottom: 2px solid var(--cfx-heading);
}
.cfx-glossary__list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .7rem; }
@media (min-width: 783px) {
  .cfx-glossary__list--cols-2 { grid-template-columns: repeat(2, 1fr); }
  .cfx-glossary__list--cols-3 { grid-template-columns: repeat(3, 1fr); }
  .cfx-glossary__list--cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.cfx-glossary__item a { font-weight: 600; color: var(--cfx-heading); text-decoration: none; }
.cfx-glossary__item a:hover { color: var(--cfx-primary); }
.cfx-glossary__short { display: block; font-size: var(--cfx-fs-xs); color: var(--cfx-muted); }

/* ---------- Events ---------- */

.cfx-eventgrid { display: grid; gap: calc(var(--cfx-gutter) * .8); grid-template-columns: 1fr; }
@media (min-width: 783px) {
  .cfx-eventgrid--cols-2 { grid-template-columns: repeat(2, 1fr); }
  .cfx-eventgrid--cols-3 { grid-template-columns: repeat(3, 1fr); }
  .cfx-eventgrid--cols-4 { grid-template-columns: repeat(4, 1fr); }
}
.cfx-eventcard {
  padding: 1.1rem;
  background: var(--cfx-card);
  border: var(--cfx-border-width) solid var(--cfx-border);
  border-radius: var(--cfx-radius-card);
  border-top: 3px solid var(--cfx-accent);
}
.cfx-eventcard__date { margin: 0 0 .35rem; font-size: var(--cfx-fs-xs); color: var(--cfx-accent); }
.cfx-eventcard__title { margin: 0 0 .35rem; font-size: var(--cfx-fs-1); }
.cfx-eventcard__title a { color: var(--cfx-heading); text-decoration: none; }
.cfx-eventcard__where { margin: 0; font-size: var(--cfx-fs-sm); color: var(--cfx-muted); }

/* ---------- CTA ---------- */

.cfx-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.4rem;
  padding: clamp(1.4rem, 3vw, 2.4rem);
  background: var(--cfx-card);
  border: var(--cfx-border-width) solid var(--cfx-border);
  border-radius: var(--cfx-radius-card);
}
.cfx-cta__body { flex: 1 1 22rem; min-width: 0; }
.cfx-cta__action { flex: 0 0 auto; }
.cfx-cta__title { margin: 0 0 .4rem; font-size: var(--cfx-fs-3); }
.cfx-cta__text { margin: 0; color: var(--cfx-muted); max-width: 56ch; }

/* ---------- Custom sections ---------- */

.cfx-custom { min-width: 0; }
.cfx-custom--image img,
.cfx-custom--video video { width: 100%; border-radius: var(--cfx-radius-card); }
.cfx-custom--video video { display: block; }
.cfx-custom--embed iframe,
.cfx-custom--embed .wp-embedded-content { width: 100%; border-radius: var(--cfx-radius-card); }
.cfx-custom--embed > *,
.cfx-custom--shortcode > * { max-width: 100%; }
.cfx-custom--text { max-width: 68ch; }

/* Feed items carry no media, so they need their own rhythm. */
.cfx-card--feed { border: var(--cfx-border-width) solid var(--cfx-border); }
.cfx-card--feed .cfx-card__title { font-size: var(--cfx-fs-base); }
.cfx-feed { display: grid; gap: .5rem; }
.cfx-feed--list .cfx-card--feed { border: 0; border-bottom: 1px solid var(--cfx-border); border-radius: 0; }

.cfx-noresults__title { font-size: var(--cfx-fs-3); }
.cfx-loop { min-width: 0; }
.cfx-glossary { min-width: 0; }

/* ---------- Ads & market slots ---------- */

.cfx-ad { margin-block: 1.6rem; text-align: center; }
.cfx-ad__label {
  display: block;
  margin-bottom: .35rem;
  font-family: var(--cfx-font-label);
  font-size: var(--cfx-fs-xs);
  letter-spacing: var(--cfx-ls-label);
  text-transform: uppercase;
  color: var(--cfx-muted);
}
.cfx-ad__body img { margin-inline: auto; }

.cfx-slot { margin-block: 1.2rem; }
.cfx-slot--empty {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: 1rem;
  border: 1px dashed var(--cfx-border);
  border-radius: var(--cfx-radius-card);
  color: var(--cfx-muted);
  font-size: var(--cfx-fs-sm);
  text-align: center;
}
.cfx-slot--empty span { font-family: var(--cfx-font-label); color: var(--cfx-heading); }
.cfx-slot--empty small { font-size: var(--cfx-fs-xs); }

/* ---------- Search form ---------- */

.cfx-searchform { display: flex; gap: .5rem; }
.cfx-searchform__input { flex: 1 1 auto; }
.cfx-searchform__submit {
  flex: 0 0 auto;
  padding: .62rem 1.1rem;
  background: var(--cfx-primary);
  color: var(--cfx-on-primary);
  border: 0;
  border-radius: var(--cfx-radius-button);
  font-family: var(--cfx-font-button);
  font-weight: 600;
  cursor: pointer;
}

/* ---------- Widgets ---------- */

.cfx-widget {
  padding: 1.1rem;
  background: var(--cfx-card);
  border: var(--cfx-border-width) solid var(--cfx-border);
  border-radius: var(--cfx-radius-card);
}
.cfx-sidebar-minimal .cfx-widget { background: transparent; border: 0; padding: 0; }
.cfx-sidebar-bordered .cfx-widget { background: transparent; }
.cfx-sidebar-glass .cfx-widget {
  background: var(--cfx-glass-bg);
  border-color: var(--cfx-hairline);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cfx-widget__title {
  margin: 0 0 .7rem;
  font-size: var(--cfx-fs-base);
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--cfx-heading);
}
.cfx-widget ul { list-style: none; margin: 0; padding: 0; }
.cfx-widget li { padding: .35rem 0; border-bottom: 1px solid var(--cfx-border); font-size: var(--cfx-fs-sm); }
.cfx-widget li:last-child { border-bottom: 0; }
.cfx-widget a { color: var(--cfx-heading); text-decoration: none; }
.cfx-widget a:hover { color: var(--cfx-primary); }

/*
 * Term buttons inside a widget need their own rule.
 *
 * `.cfx-widget a:hover` and `.cfx-termbuttons a:hover` have identical
 * specificity (0,2,1), so the one written later in the file won — and that was
 * the widget rule, which set the text to the primary colour while the button
 * rule was setting the *background* to the same colour. The label was still
 * there, painted primary-on-primary. The extra class here settles it by
 * specificity rather than by source order.
 */
.cfx-widget .cfx-termbuttons a { color: var(--cfx-heading); }
.cfx-widget .cfx-termbuttons a:hover {
  background: var(--cfx-primary);
  color: var(--cfx-on-primary);
}

/* ---------- Social ---------- */

.cfx-social { display: flex; gap: .4rem; margin: .8rem 0 0; padding: 0; list-style: none; }
.cfx-social--topbar { margin: 0; }
.cfx-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem; height: 1.9rem;
  padding-inline: .35rem;
  border: 1px solid var(--cfx-hairline);
  border-radius: var(--cfx-radius-button);
  font-family: var(--cfx-font-label);
  font-size: var(--cfx-fs-xs);
  text-decoration: none;
  color: inherit;
}
.cfx-social__link:hover { background: var(--cfx-primary); border-color: var(--cfx-primary); color: var(--cfx-on-primary); }

/* ---------- 404 ---------- */

.cfx-404 { max-width: 44rem; padding-block: clamp(2rem, 6vw, 4rem); }
.cfx-404__title { font-size: var(--cfx-fs-6); margin-bottom: .5rem; }
.cfx-404__body { color: var(--cfx-muted); margin-bottom: 1.4rem; }

/* ---------- Archive head with section navigation ---------- */

/*
 * The category name and the section list share a baseline on wide screens: the
 * reader sees where they are and where else they can go in one glance, without
 * the list pushing the articles down the page. Below the breakpoint the list
 * wraps underneath, where it costs nothing.
 */
.cfx-archive__head--split { display: grid; gap: .9rem; }
.cfx-archive__headline { min-width: 0; }
.cfx-archive__sections { min-width: 0; }
.cfx-archive__sections .cfx-termbuttons { margin: 0; }

@media (min-width: 1025px) {
  .cfx-archive__head--split {
    grid-template-columns: minmax(0, 1fr) minmax(0, auto);
    align-items: end;
    column-gap: 2rem;
  }
  .cfx-archive__sections { justify-self: end; max-width: 34rem; }
  .cfx-archive__sections .cfx-termbuttons ul { justify-content: flex-end; }
  .cfx-archive__sections .cfx-termbuttons__label { text-align: right; }
}

/* ---------- Chips ---------- */

/*
 * A chip is for content that is only a label — glossary terms, related entries,
 * anything with no image, byline or date. Post cards were doing this job and
 * rendering as empty boxes with a heading adrift inside them.
 */
.cfx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cfx-chip {
  display: inline-flex;
  flex-direction: column;
  gap: .1rem;
  padding: .5rem .85rem;
  background: var(--cfx-surface);
  border: var(--cfx-border-width) solid var(--cfx-border);
  border-radius: var(--cfx-radius-button);
  text-decoration: none;
  color: var(--cfx-heading);
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.cfx-chip__label {
  font-family: var(--cfx-font-heading);
  font-size: var(--cfx-fs-sm);
  font-weight: 600;
  line-height: 1.2;
}

.cfx-chip__meta {
  font-size: var(--cfx-fs-xs);
  color: var(--cfx-muted);
  transition: color .16s ease;
}

.cfx-chip:hover,
.cfx-chip:focus-visible {
  background: var(--cfx-primary);
  border-color: var(--cfx-primary);
  color: var(--cfx-on-primary);
}
.cfx-chip:hover .cfx-chip__meta,
.cfx-chip:focus-visible .cfx-chip__meta { color: var(--cfx-on-primary); opacity: .78; }

/*
 * Depth effects target photographic cards. A chip has no image for a highlight
 * to travel across, so the pointer glow and the tilt are switched off here —
 * on a flat surface they read as a smear rather than as depth.
 */
.cfx-depth-5d .cfx-chip,
.cfx-depth-7d .cfx-chip,
.cfx-depth-9d .cfx-chip { transform: none !important; }
.cfx-chip::before,
.cfx-chip::after { display: none !important; }
