/* ==========================================================================
   archive-course.css — LearnDash courses archive (sfwd-courses CPT, /courses/)

   ╔════════════════════════════════════════════════════════════════════════╗
   ║  OFF-LIMITS WITHOUT EXPLICIT PERMISSION — locked 2026-05-17            ║
   ║                                                                        ║
   ║  This stylesheet AND its companion template                            ║
   ║  (archive-sfwd-courses.php) are the LIVE courses-catalogue gateway     ║
   ║  for the WordPress 101 product line. Christopher has reviewed the      ║
   ║  rendered output and signed off on it.                                 ║
   ║                                                                        ║
   ║  DO NOT edit either file without per-change authorization from         ║
   ║  Christopher — not for "improvements," not for refactors, not for      ║
   ║  drive-by minification, not as part of a larger sweep that touches     ║
   ║  other archive-*.css files. The page is the front door to the $249    ║
   ║  conversion surface; surprise edits cost money.                        ║
   ║                                                                        ║
   ║  Bug fixes for visibly broken render are an exception, but flag        ║
   ║  them on the way through.                                              ║
   ║                                                                        ║
   ║  Cascade trap note: .site-shell is un-layered in main.css and beats    ║
   ║  any layered margin-bottom / padding-inline override on elements       ║
   ║  that carry both .site-shell and a course-archive__* class. The        ║
   ║  un-layered block at the bottom of this file is the escape — do not    ║
   ║  fold it back into @layer page-types or the rhythm will silently       ║
   ║  collapse to .site-shell defaults again.                               ║
   ║  See memory: reference_thisismyurl_site_shell_layer_trap               ║
   ║                                                                        ║
   ║  Memory: reference_thisismyurl_wp101_course_page_locked                ║
   ╚════════════════════════════════════════════════════════════════════════╝

   Loaded conditionally via inc/setup.php on
   `is_post_type_archive('sfwd-courses')`. Tokens + base are inherited
   through the main stylesheet (also enqueued). Built 2026-05-17 alongside
   archive-sfwd-courses.php as the bespoke courses-catalogue gateway,
   replacing the generic archive.php fallback that was rendering /courses/
   as a thin "ARCHIVE / Courses / Browse all / All items" page.

   Authored into the `page-types` layer to sit at the same cascade level
   as archive-service.css, archive-podcast.css, etc.

   BEM prefix: .course-archive__*  (parallel to .course-detail__* on the
   single-course surface, so the two related surfaces read as one product
   family in the stylesheet alphabetical listing).
   ========================================================================== */

@layer page-types {

  /* ========================================================================
     Page chassis
     ======================================================================== */

  .course-archive {
    /* Reserve room at the bottom on mobile so any fixed-bottom site
       chrome (chat widget, cookie banner) doesn't clip the footer CTA.
       Desktop ignores this. */
    margin-top: 1.5rem;
  }
  @media (max-width: 860px) {
    .course-archive {
      padding-bottom: 1rem;
    }
  }

  /* ========================================================================
     Hero — navy surface matching single-sfwd-courses.php hero
     ======================================================================== */

  .course-archive__hero {
    background: var(--color-accent-strong);
    color: #ffffff;
    /* Symmetric padding so the left rail matches the top/bottom inset
       — matches the single-course hero treatment. Padding-inline is
       overridden un-layered at the bottom of this file (see header note
       on the cascade trap). */
    padding-block: clamp(2rem, 1rem + 4vw, 4rem);
    border-radius: var(--radius-card);
  }

  .course-archive__hero-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    align-items: center;
    margin-top: 1.25rem;
  }
  @media (min-width: 880px) {
    .course-archive__hero-layout {
      grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
      gap: 3rem;
    }
  }
  .course-archive__hero-layout--single {
    grid-template-columns: minmax(0, 1fr);
  }
  @media (min-width: 880px) {
    .course-archive__hero-layout--single {
      grid-template-columns: minmax(0, 1fr);
      max-width: 64ch;
    }
  }

  .course-archive__hero-text {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
    min-width: 0;
  }

  .course-archive__eyebrow {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-gold);
  }

  .course-archive__title {
    margin: 0;
    font-size: clamp(1.85rem, 1.25rem + 2.4vw, 3rem);
    line-height: 1.12;
    letter-spacing: -0.015em;
    font-weight: 700;
    color: #ffffff;
  }

  .course-archive__lede {
    margin: 0;
    font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.2rem);
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
    max-width: 58ch;
  }

  .course-archive__cta-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.25rem;
    margin-top: 0.5rem;
  }
  .course-archive__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.85rem 1.4rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background-color 140ms var(--ease-standard),
                color 140ms var(--ease-standard),
                border-color 140ms var(--ease-standard);
  }
  .course-archive__cta--primary {
    background: var(--color-gold);
    color: var(--color-accent-strong);
    border: 2px solid var(--color-gold);
  }
  .course-archive__cta--primary:hover,
  .course-archive__cta--primary:focus-visible {
    background: #ffffff;
    border-color: #ffffff;
    color: var(--color-accent-strong);
  }
  .course-archive__cta-secondary {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    font-size: 0.95rem;
    transition: text-decoration-color 140ms var(--ease-standard),
                color 140ms var(--ease-standard);
  }
  .course-archive__cta-secondary:hover,
  .course-archive__cta-secondary:focus-visible {
    color: var(--color-gold);
    text-decoration-color: var(--color-gold);
  }

  .course-archive__hero-portrait {
    margin: 0;
    border-radius: var(--radius-card);
    overflow: hidden;
    aspect-ratio: 4 / 5;
    background: rgba(255, 255, 255, 0.04);
  }
  .course-archive__hero-portrait-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* ========================================================================
     Instructor credibility strip — one line, beneath the hero
     ======================================================================== */

  .course-archive__instructor-strip {
    padding-block: 0.85rem;
    border-bottom: 1px solid var(--color-border);
  }
  .course-archive__instructor-line {
    margin: 0;
    font-size: max(0.875rem, 14px);
    line-height: 1.5;
    color: var(--color-text-medium);
  }
  .course-archive__instructor-link {
    color: var(--color-text-strong);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--color-gold);
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
  }
  .course-archive__instructor-link:hover,
  .course-archive__instructor-link:focus-visible {
    color: var(--color-accent-strong);
    text-decoration-color: var(--color-accent-strong);
  }

  /* ========================================================================
     Listing — grid + cards
     ======================================================================== */

  .course-archive__listing {
    scroll-margin-top: var(--scroll-margin-anchor, 112px);
  }
  .course-archive__listing-header {
    margin: 0 0 1.5rem;
  }
  .course-archive__listing-heading {
    margin: 0;
    font-size: var(--fs-h2);
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--color-text-strong);
    font-weight: 700;
  }

  .course-archive__grid {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  @media (min-width: 600px) and (max-width: 899px) {
    .course-archive__grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  @media (min-width: 900px) {
    .course-archive__grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 1.75rem;
    }
  }

  /* N=1 layout: centered single card at a deliberate max width rather
     than a 3-up grid with two ghost columns. */
  .course-archive__grid--single {
    grid-template-columns: minmax(0, 480px);
    justify-content: center;
  }
  @media (min-width: 600px) and (max-width: 899px) {
    .course-archive__grid--single {
      grid-template-columns: minmax(0, 480px);
    }
  }
  @media (min-width: 900px) {
    .course-archive__grid--single {
      grid-template-columns: minmax(0, 480px);
    }
  }

  .course-archive__card-cell {
    /* The ul renders <li> wrappers around each card; the card itself is
       the article. List-style is suppressed on the grid above. */
    display: block;
  }

  .course-archive__card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--color-border);
    border-top: 3px solid var(--color-gold);
    border-radius: var(--radius-card);
    overflow: hidden;
    height: 100%;
    transition: box-shadow 160ms var(--ease-standard),
                border-color 160ms var(--ease-standard);
  }
  .course-archive__card:hover,
  .course-archive__card:focus-within {
    border-color: var(--color-gold);
    box-shadow: 0 4px 16px rgba(10, 34, 64, 0.08);
  }

  /* DEAD CODE (2026-05-17): the .course-archive__card-media block is no
     longer emitted by archive-sfwd-courses.php. Designer's call was that
     the archive card's job is scanning efficiency (which / cost / what /
     click), and the feature image was fighting the grid rather than
     serving that job. Brand atmosphere now lives on the single-course
     landing's sticky offer card instead. These rules are kept here as a
     restoration path; if the decision reverses, uncommenting the
     template block re-activates these styles immediately. Separate
     cleanup pass can remove this CSS once we are confident the decision
     holds across the catalog's next two course launches. */
  .course-archive__card-media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--color-surface-alt);
  }
  .course-archive__card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .course-archive__card-body {
    padding: 1.25rem 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    flex: 1;
  }

  .course-archive__card-format {
    margin: 0;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--color-gold-text, var(--color-accent));
  }

  .course-archive__card-title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    font-weight: 700;
    color: var(--color-text-strong);
  }
  .course-archive__card-title-link {
    color: inherit;
    text-decoration: none;
    background-image: linear-gradient(to right, var(--color-gold) 0, var(--color-gold) 100%);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size 200ms var(--ease-standard);
  }
  .course-archive__card-title-link:hover,
  .course-archive__card-title-link:focus-visible {
    background-size: 100% 2px;
  }

  .course-archive__card-lede {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--color-text);
  }

  .course-archive__card-meta {
    margin: 0.2rem 0 0;
    padding: 0.85rem 0 0;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
  }
  .course-archive__card-meta-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--color-text-medium);
  }
  .course-archive__card-meta-row dt {
    /* Visually-hidden dt; the value carries the visible meaning and the
       dt label is announced by screen readers (see archive template). */
  }
  .course-archive__card-meta-value {
    margin: 0;
    color: var(--color-text-medium);
  }
  .course-archive__card-meta-value--price {
    color: var(--color-text-strong);
    font-weight: 700;
    font-size: 1.15rem;
  }

  .course-archive__card-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.75rem 1.15rem;
    margin-top: auto;
    background: var(--color-accent-strong);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-accent-strong);
    transition: background-color 140ms var(--ease-standard),
                border-color 140ms var(--ease-standard);
  }
  .course-archive__card-cta:hover,
  .course-archive__card-cta:focus-visible {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #ffffff;
  }

  /* Empty state — fallback when have_posts() returns false. */
  .course-archive__empty {
    padding: 2rem 1.5rem;
    background: var(--color-surface-alt);
    border-radius: var(--radius-card);
    text-align: center;
  }
  .course-archive__empty-heading {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-strong);
  }
  .course-archive__empty-body {
    margin: 0;
    font-size: 0.95rem;
    color: var(--color-text-medium);
    line-height: 1.55;
  }
  .course-archive__empty-body a {
    color: var(--color-accent-strong);
    font-weight: 600;
  }

  /* Pagination — uses theme defaults; this rule just spaces it. */
  .course-archive__pagination {
    margin-top: 2rem;
  }

  /* ========================================================================
     Cross-pillar deflectors — two routes, post-grid
     ======================================================================== */

  .course-archive__deflectors-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
  }
  @media (min-width: 760px) {
    .course-archive__deflectors-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 1.5rem;
    }
  }

  .course-archive__deflector {
    padding: 1.5rem 1.65rem;
    background: var(--color-surface-alt);
    border-radius: var(--radius-card);
    border-left: 3px solid var(--color-accent);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .course-archive__deflector-heading {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.3;
    font-weight: 700;
    color: var(--color-text-strong);
  }
  .course-archive__deflector-body {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--color-text);
  }
  .course-archive__deflector-cta {
    align-self: flex-start;
    margin-top: 0.25rem;
    color: var(--color-accent-strong);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--color-gold);
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .course-archive__deflector-cta:hover,
  .course-archive__deflector-cta:focus-visible {
    color: var(--color-accent);
    text-decoration-color: var(--color-accent);
  }

  /* ========================================================================
     FAQ — inherits archive-gateway-faq base from main.css
     Outer spacing handled in the un-layered block at the bottom.
     ======================================================================== */

  .course-archive__faq {
    /* Visual treatment inherited; only the wrapping rhythm is set
       un-layered below. */
  }

  /* ========================================================================
     Footer CTA — plain text + button, no decorative card
     ======================================================================== */

  .course-archive__footer-cta {
    text-align: center;
    padding: 1.5rem 0 0;
  }
  .course-archive__footer-cta-heading {
    margin: 0 0 0.6rem;
    font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2rem);
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: var(--color-text-strong);
    font-weight: 700;
  }
  .course-archive__footer-cta-body {
    margin: 0 auto 1.25rem;
    font-size: 1rem;
    line-height: 1.55;
    color: var(--color-text);
    max-width: 60ch;
  }
  .course-archive__footer-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0.85rem 1.5rem;
    background: var(--color-accent-strong);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-accent-strong);
    transition: background-color 140ms var(--ease-standard),
                border-color 140ms var(--ease-standard);
  }
  .course-archive__footer-cta-button:hover,
  .course-archive__footer-cta-button:focus-visible {
    background: var(--color-accent);
    border-color: var(--color-accent);
  }

  /* ========================================================================
     "Coming soon" placeholder cards (2026-05-17, design-pass-2)
     ------------------------------------------------------------------------
     Inert cards rendered for sfwd-courses entries in `draft` status, so
     visitors browsing the catalogue see the shape of what's coming
     without an active CTA. The card carries the same dimensions as a
     published-course card (so the grid grid lines up) but a quieter
     visual register: muted tinted background, dashed border, no top
     gold-stripe accent, no hover lift, default cursor.
     ======================================================================== */

  .course-archive__card--placeholder {
    background: var(--color-surface-alt);
    border: 1px dashed var(--color-border-strong);
    border-top: 1px dashed var(--color-border-strong);
    cursor: default;
  }
  .course-archive__card--placeholder:hover,
  .course-archive__card--placeholder:focus-within {
    /* Suppress the published-card hover lift — placeholder is inert. */
    border-color: var(--color-border-strong);
    box-shadow: none;
  }
  .course-archive__card--placeholder .course-archive__card-format {
    /* "Coming soon" eyebrow — gold-toned to read as future-tense, not
       muted-failed-to-load. */
    color: var(--color-gold-text, var(--color-accent));
  }
  .course-archive__card--placeholder .course-archive__card-title {
    color: var(--color-text-medium);
  }
  .course-archive__card--placeholder .course-archive__card-lede {
    color: var(--color-text-medium);
    font-style: italic;
  }

  /* ========================================================================
     Reduced motion
     ======================================================================== */

  @media (prefers-reduced-motion: reduce) {
    .course-archive__cta,
    .course-archive__cta-secondary,
    .course-archive__card,
    .course-archive__card-title-link,
    .course-archive__card-cta,
    .course-archive__deflector-cta,
    .course-archive__footer-cta-button {
      transition: none;
    }
  }

}

/* ==========================================================================
   Un-layered section-rhythm + inset-card padding overrides

   `.site-shell` is declared un-layered in main.css with
   `margin: 0 auto; padding-inline: 1.125rem`. Cascade-layer rules —
   including everything inside `@layer page-types` above — always lose to
   un-layered rules of equal specificity, so the `margin-bottom` and
   `padding-inline` declarations on .course-archive__hero / __listing /
   __deflectors / __faq / __footer-cta inside the layer would be silently
   overridden by .site-shell's defaults on every section that shares both
   class hooks.

   The fix is to escape the layer for these two property buckets only.
   The rest of the file (colour, layout, padding-block, type) stays
   cleanly inside @layer page-types; only the bottom-margin tokens and
   the hero's inline padding leak out to compete on the same un-layered
   plane as `.site-shell`.

   Pattern matches single-course.css. See memory:
     reference_thisismyurl_site_shell_layer_trap
   ========================================================================== */

.course-archive__hero,
.course-archive__instructor-strip,
.course-archive__listing,
.course-archive__deflectors,
.course-archive__faq,
.course-archive__footer-cta {
  margin-bottom: clamp(3rem, 2rem + 2vw, 5rem);
}

/* Hero is an inset card; its inline padding needs to match the vertical
   inset, not inherit .site-shell's narrow page gutter. */
.course-archive__hero {
  padding-inline: clamp(2rem, 1rem + 4vw, 4rem);
}
