/* ==========================================================================
   POST FOOTER - the foot of every blog post (2026-09-17).
   Markup: inc/ac-post-footer.php, called from single.php in this order:
     1. .ac-appcard  app card        AnxietyTestResult .app + Marketing/FinalCta
     2. .ac-pn       previous / next FLNextPreviousCard.module.css
     3. .ac-uni      Anxiety Univ.   FLTopCategories.module.css
   The crisis card (.ac-gethelp, footer.php / blog-modern.css) follows unchanged.

   Loaded on single posts only (header.php), after blog-modern.css.
   Values are the website's, rule for rule. px units on purpose: the theme pins
   html at 10px and .ac-article-wrap sets font-size 2.2rem for its `ch` measure,
   so nothing here may inherit a size.

   Blog-only additions, each marked "blog:":
     - font: the blog cannot load Overused Grotesk, so every block uses the
       blog's Instrument Sans (var(--font-secondary)), as the site menu does;
     - resets for the theme's global element rules (default.css `a:hover` red,
       h2 48px Times, Bootstrap p/h2 margins, .ac-badge sizes in blog-modern.css).

   The old .ac-app-promo / .ac-post-nav rules in blog-modern.css no longer match
   anything on posts and are left in place (harmless).

   Rollback: delete this file and its <link> in header.php (see inc/ac-post-footer.php).
   ========================================================================== */

.ac-appcard,
.ac-pn,
.ac-uni {
  font-family: var(--font-secondary, "Instrument Sans", sans-serif); /* blog */
  font-size: 16px; /* blog: do not inherit .ac-article-wrap's 2.2rem */
  line-height: 1.5;
  letter-spacing: 0;
}

.ac-appcard p,
.ac-appcard h2,
.ac-appcard ul,
.ac-uni p,
.ac-uni h2,
.ac-uni ul {
  margin: 0; /* blog: Bootstrap / default.css margins */
}

/* ==========================================================================
   1. APP CARD
   The quiz result card's .app (blue gradient, headline, one line, feature
   pills, store badges) with FinalCta's clouds and an optional phone.
   ========================================================================== */

.ac-appcard {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  align-items: end;
  gap: 16px;
  margin-top: 48px;
  padding: 28px 24px 0 32px;
  border-radius: 24px;
  color: #ffffff;
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(95, 175, 255, 0.55) 0%, rgba(95, 175, 255, 0) 60%),
    linear-gradient(160deg, #1d63d8 0%, #0d50b5 55%, #0a3f93 100%);
  box-shadow: 0 20px 40px rgba(13, 80, 181, 0.2);
}

/* FinalCta: soft CSS clouds (no image request). */
.ac-appcard-cloud {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(18px);
  background:
    radial-gradient(closest-side at 30% 60%, rgba(255, 255, 255, 0.28), transparent),
    radial-gradient(closest-side at 62% 45%, rgba(255, 255, 255, 0.22), transparent),
    radial-gradient(closest-side at 80% 70%, rgba(255, 255, 255, 0.16), transparent);
}

.ac-appcard-cloud-one {
  left: -80px;
  bottom: -90px;
  width: 460px;
  height: 200px;
}

.ac-appcard-cloud-two {
  right: -60px;
  top: -70px;
  width: 380px;
  height: 180px;
}

.ac-appcard-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding-bottom: 28px;
}

.ac-appcard .ac-appcard-eyebrow {
  margin-bottom: 8px;
  padding: 4px 11px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.ac-appcard .ac-appcard-title {
  margin-bottom: 6px;
  font-family: inherit;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
  text-wrap: balance;
}

.ac-appcard .ac-appcard-text {
  margin-bottom: 14px;
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.ac-appcard .ac-appcard-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  padding: 0;
  list-style: none;
}

.ac-appcard-feature {
  padding: 5px 11px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.ac-appcard .ac-appcard-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ac-appcard .ac-badge {
  width: 140px; /* blog: blog-modern.css sets 13.5rem */
  border-radius: 8px;
}

.ac-appcard .ac-badge:focus-visible {
  outline: 2px solid #ffffff; /* result card: .store a:focus-visible */
  outline-offset: 3px;
}

.ac-appcard .ac-appcard-note {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.85);
}

.ac-appcard .ac-appcard-disclaimer {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.7);
}

/* The phone rises from the bottom edge; the card clips its lower part. */
.ac-appcard-visual {
  position: relative;
  z-index: 1;
  align-self: end;
  height: 260px;
  overflow: hidden;
  line-height: 0;
}

.ac-appcard-phone {
  display: block;
  width: 200px;
  max-width: none;
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(5, 30, 80, 0.35));
}

@media (max-width: 767.98px) {
  .ac-appcard {
    grid-template-columns: minmax(0, 1fr) 150px;
    margin-top: 36px;
    padding: 24px 16px 0 24px;
  }

  .ac-appcard-visual {
    height: 210px;
  }

  .ac-appcard-phone {
    width: 150px;
  }
}

/* Phones: text only, the phone image is not loaded into view. */
@media (max-width: 575.98px) {
  .ac-appcard {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 20px 0;
    border-radius: 24px;
  }

  .ac-appcard-visual {
    display: none;
  }

  .ac-appcard-copy {
    padding-bottom: 22px;
  }

  .ac-appcard .ac-appcard-title {
    font-size: 21px;
  }

  .ac-appcard .ac-badge {
    width: calc(50% - 5px);
    max-width: 150px;
  }
}

/* ==========================================================================
   2. PREVIOUS / NEXT (FLNextPreviousCard)
   ========================================================================== */

.ac-pn {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 40px;
}

.ac-pn-cell {
  display: flex;
  min-width: 0;
}

/* Only a next card (the newest post has no next, the oldest no previous):
   keep a lone next card on the right. */
.ac-pn-only-next .ac-pn-cell-next {
  grid-column: 2;
}

.ac-pn .ac-pn-card {
  display: flex;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(13, 80, 181, 0.1);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(14, 20, 23, 0.04);
  color: #14171a;
  text-decoration: none;
  transition:
    transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.ac-pn .ac-pn-card:hover {
  transform: translateY(-3px);
  border-color: rgba(13, 80, 181, 0.28);
  box-shadow: 0 16px 32px rgba(13, 80, 181, 0.1);
  color: #14171a;
}

.ac-pn .ac-pn-card:focus-visible {
  outline: 3px solid #0d50b5;
  outline-offset: 3px;
}

/* Next card mirrors the previous one: thumbnail on the right, text aligned right. */
.ac-pn .ac-pn-card-next {
  flex-direction: row-reverse;
  text-align: right;
}

.ac-pn-thumb {
  position: relative;
  flex: 0 0 140px;
  min-height: 96px;
  overflow: hidden;
  border-radius: 14px;
  background: #edf3ff;
}

/* next/image `fill` */
.ac-pn-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.ac-pn .ac-pn-card:hover .ac-pn-thumb img {
  transform: scale(1.04);
}

.ac-pn-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 4px 0;
}

.ac-pn-card-next .ac-pn-body {
  align-items: flex-end;
}

.ac-pn-overline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #0d50b5;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.ac-pn-arrow {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.ac-pn .ac-pn-card:hover .ac-pn-arrow {
  transform: translateX(3px);
}

.ac-pn .ac-pn-card-prev:hover .ac-pn-arrow {
  transform: translateX(-3px);
}

.ac-pn-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  color: #14171a;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

/* blog: the website shrinks the thumbnail below a 767px viewport, when a card is
   about 330px wide. The blog's cards are that narrow at desktop widths too, so
   the same step follows the card's own width. */
.ac-pn-cell {
  container: ac-pn / inline-size;
}

@media (max-width: 767px) {
  .ac-pn-thumb {
    flex-basis: 112px;
  }

  .ac-pn-title {
    font-size: 15px;
  }
}

@container ac-pn (max-width: 360px) {
  .ac-pn .ac-pn-card,
  .ac-pn .ac-pn-card-next {
    gap: 12px;
  }

  .ac-pn-thumb {
    flex-basis: 96px;
  }

  .ac-pn-title {
    font-size: 15px;
  }
}

/* Stacked on phones; both cards read left to right with the thumbnail first. */
@media (max-width: 575px) {
  .ac-pn {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 32px;
  }

  .ac-pn-only-next .ac-pn-cell-next {
    grid-column: auto;
  }

  .ac-pn .ac-pn-card,
  .ac-pn .ac-pn-card-next {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 18px;
    text-align: left;
  }

  .ac-pn-card-next .ac-pn-body {
    align-items: flex-start;
  }

  .ac-pn-thumb {
    flex-basis: 96px;
    height: 72px;
    min-height: 0;
    border-radius: 12px;
  }

  .ac-pn-title {
    font-size: 15px;
    -webkit-line-clamp: 2;
  }
}

/* ==========================================================================
   3. EXPLORE THE ANXIETY UNIVERSITY (FLTopCategories)
   Anxiety University stage colours (Marketing/constants.js):
   color #C959B7 (fills only, never text), ink #A63D95 (text), tint #FAEEF8.
   ========================================================================== */

.ac-uni {
  --tc-stage: #c959b7;
  --tc-ink: #a63d95;
  --tc-tint: #faeef8;
  --tc-text: #14171a;
  --tc-grey: #5b5a5d;

  position: relative;
  /* blog: no bottom margin. The post section's own bottom padding (.section-xl-py)
     already separates it from the crisis card (footer.php), the same gap the
     previous/next row had before. */
  margin-top: 40px;
  margin-bottom: 0;
  padding: 32px;
  overflow: hidden;
  border: 1px solid rgba(201, 89, 183, 0.18);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--tc-tint) 0%, #ffffff 220px);
  box-shadow: 0 10px 28px rgba(14, 20, 23, 0.05);
}

/* Thin stage-colour accent along the top edge, as on the site menu cards. */
.ac-uni::before {
  content: "";
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--tc-stage);
  opacity: 0.85;
}

/* HEADING */

.ac-uni-head {
  display: grid;
  gap: 8px;
  max-width: 640px;
}

.ac-uni .ac-uni-eyebrow {
  width: max-content;
  margin: 0;
  padding: 5px 12px;
  border-radius: 100px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(201, 89, 183, 0.3);
  color: var(--tc-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-transform: uppercase;
}

.ac-uni .ac-uni-heading {
  margin: 0;
  color: var(--tc-text);
  font-family: inherit;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.ac-uni .ac-uni-lead {
  margin: 0;
  color: var(--tc-grey);
  font-size: 16px;
  line-height: 1.5;
}

/* CARDS
   blog: the column count follows the block's own width, not the viewport. The
   blog's article measure is narrower than the website's (about 590px at a 1280px
   viewport vs 1016px there), where three columns cannot fit a 64px icon and a
   text. 3 columns from 760px of block width (the website's cards are ~300px),
   otherwise 2, and 1 on phones (media query below). Browsers without container
   queries get 2 / 2 / 1. */

.ac-uni {
  container: ac-uni / inline-size;
}

.ac-uni .ac-uni-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.ac-uni-item {
  display: flex;
  min-width: 0;
}

.ac-uni .ac-uni-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(13, 80, 181, 0.09);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 6px 18px rgba(14, 20, 23, 0.04);
  color: var(--tc-text);
  text-decoration: none;
  transition:
    transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.ac-uni .ac-uni-card:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 89, 183, 0.4);
  box-shadow: 0 16px 32px rgba(166, 61, 149, 0.12);
  color: var(--tc-text);
}

.ac-uni .ac-uni-card:focus-visible {
  outline: 3px solid #0d50b5;
  outline-offset: 3px;
}

.ac-uni-icon-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--tc-tint);
  box-shadow: inset 0 0 0 1px rgba(201, 89, 183, 0.14);
}

.ac-uni-icon {
  display: block;
  width: 52px;
  height: 52px;
  max-width: none;
  object-fit: contain;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.ac-uni .ac-uni-card:hover .ac-uni-icon {
  transform: scale(1.08) rotate(-3deg);
}

.ac-uni-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding-top: 2px;
}

.ac-uni-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.ac-uni-text {
  color: var(--tc-grey);
  font-size: 14px;
  line-height: 1.4;
}

.ac-uni-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--tc-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.ac-uni-arrow {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.ac-uni .ac-uni-card:hover .ac-uni-arrow,
.ac-uni .ac-uni-cta:hover .ac-uni-arrow {
  transform: translateX(3px);
}

/* CTA */

.ac-uni .ac-uni-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 13px 22px;
  border-radius: 100px;
  background: #0d50b5; /* --new-v2-dark-blue */
  box-shadow: 0 10px 22px rgba(13, 80, 181, 0.22);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.ac-uni .ac-uni-cta:hover {
  background: #0a3f8f;
  box-shadow: 0 14px 28px rgba(13, 80, 181, 0.3);
  color: #ffffff;
}

.ac-uni .ac-uni-cta:focus-visible {
  outline: 3px solid #0d50b5;
  outline-offset: 3px;
}

.ac-uni .ac-uni-cta-arrow {
  width: 18px;
  height: 18px;
}

/* RESPONSIVE */

@container ac-uni (min-width: 760px) {
  .ac-uni .ac-uni-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 575px) {
  .ac-uni {
    margin-top: 32px;
    margin-bottom: 0;
    padding: 24px 16px 20px;
    border-radius: 24px;
  }

  .ac-uni::before {
    left: 20px;
    right: 20px;
  }

  .ac-uni .ac-uni-heading {
    font-size: 22px;
  }

  .ac-uni .ac-uni-lead {
    font-size: 15px;
  }

  /* One horizontal list card per row: long category names stay readable. */
  .ac-uni .ac-uni-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 20px;
  }

  .ac-uni .ac-uni-card {
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
  }

  .ac-uni-icon-tile {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .ac-uni-icon {
    width: 46px;
    height: 46px;
  }

  .ac-uni-name {
    font-size: 15.5px;
  }

  .ac-uni-text {
    font-size: 13.5px;
  }

  .ac-uni .ac-uni-cta {
    justify-content: center;
    width: 100%;
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ac-pn .ac-pn-card,
  .ac-pn-thumb img,
  .ac-pn-arrow,
  .ac-uni .ac-uni-card,
  .ac-uni-icon,
  .ac-uni-arrow {
    transition: none;
  }

  .ac-pn .ac-pn-card:hover,
  .ac-pn .ac-pn-card:hover .ac-pn-thumb img,
  .ac-pn .ac-pn-card:hover .ac-pn-arrow,
  .ac-uni .ac-uni-card:hover,
  .ac-uni .ac-uni-card:hover .ac-uni-icon,
  .ac-uni .ac-uni-card:hover .ac-uni-arrow,
  .ac-uni .ac-uni-cta:hover .ac-uni-arrow {
    transform: none;
  }
}
