/**
 * Custom media homepage (P2) — front-page.php only.
 *
 * Token-driven (see tokens.css) — no hardcoded colors. Builds on global.css's
 * primitives (.wynx-eyebrow, .wynx-seal) rather than redefining them; only
 * local sizing/spacing overrides are scoped under a homepage ancestor class
 * so they never leak into other pages. Mobile-first; breakpoints ~600/900px.
 * Enqueued with dep `wynx-global`, so it loads — and can safely build on —
 * after tokens.css/global.css print.
 */

/* ==========================================================================
 * Shared section rhythm
 * ========================================================================== */

.wynx-section {
  padding-block: 3rem;
  border-top: 1px solid var(--wynx-line);
}

.wynx-section .wynx-eyebrow {
  margin: 0 0 1.5rem;
}

@media (min-width: 900px) {
  .wynx-section {
    padding-block: 4rem;
  }
}

/* ==========================================================================
 * 1. Hero
 * ========================================================================== */

.wynx-hero {
  padding-block: 3rem 3.5rem;
  border-bottom: 1px solid var(--wynx-line);
}

.wynx-hero .wynx-eyebrow {
  margin: 0 0 1.25rem;
}

.wynx-hero__title {
  margin: 0 0 1.25rem;
  max-width: 20ch;
  font-family: var(--wynx-serif);
  font-size: 1.75rem;
  line-height: 1.45;
  color: var(--color_htag);
}

.wynx-hero__subtitle {
  margin: 0 0 2rem;
  max-width: 48ch;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--wynx-muted);
}

.wynx-hero__seal {
  margin-bottom: 2rem;
}

.wynx-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-bottom: 2rem;
}

.wynx-hero__record {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0;
  font-family: var(--wynx-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: var(--wynx-muted);
}

.wynx-hero__record-item {
  padding-left: 1.25rem;
  border-left: 1px solid var(--wynx-line);
}

.wynx-hero__record-item:first-child {
  padding-left: 0;
  border-left: none;
}

@media (min-width: 600px) {
  .wynx-hero__title {
    max-width: 22ch;
    font-size: 2.25rem;
  }
}

@media (min-width: 900px) {
  .wynx-hero {
    padding-block: 4.5rem 4rem;
  }

  .wynx-hero__title {
    max-width: 24ch;
    font-size: 2.75rem;
  }
}

/* ==========================================================================
 * Buttons — homepage CTAs (navy fill / hairline ghost)
 * ========================================================================== */

.wynx-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.875rem 1.75rem;
  border: 1px solid var(--color_main);
  background-color: var(--color_main);
  color: var(--color_footer_text);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.wynx-btn:hover,
.wynx-btn:focus-visible {
  background-color: var(--color_main_dark);
  border-color: var(--color_main_dark);
  color: var(--color_footer_text);
  text-decoration: none;
}

.wynx-btn--ghost {
  background-color: transparent;
  border-color: var(--wynx-line);
  color: var(--color_text);
}

.wynx-btn--ghost:hover,
.wynx-btn--ghost:focus-visible {
  border-color: var(--wynx-brass);
  background-color: transparent;
  color: var(--wynx-brass-ink);
}

/* ==========================================================================
 * 2. Start here — hub card
 * ========================================================================== */

.wynx-hubCard {
  display: flex;
  flex-direction: column;
  border-left: 3px solid var(--wynx-brass);
  background-color: var(--wynx-surface);
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
}

.wynx-hubCard:hover,
.wynx-hubCard:focus-visible {
  background-color: var(--wynx-brass-tint);
  text-decoration: none;
  color: inherit;
}

.wynx-hubCard__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  flex: none;
}

.wynx-hubCard__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wynx-hubCard__body {
  padding: 1.5rem;
}

.wynx-hubCard__title {
  margin: 0 0 0.75rem;
  font-family: var(--wynx-serif);
  font-size: 1.375rem;
  line-height: 1.5;
  color: var(--color_htag);
}

.wynx-hubCard__excerpt {
  margin: 0 0 1rem;
  color: var(--wynx-muted);
  line-height: 1.8;
}

.wynx-hubCard__cta {
  font-family: var(--wynx-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--wynx-brass-ink);
}

@media (min-width: 600px) {
  .wynx-hubCard {
    flex-direction: row;
    align-items: stretch;
  }

  .wynx-hubCard__media {
    width: 38%;
    aspect-ratio: auto;
  }

  .wynx-hubCard__body {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* ==========================================================================
 * 3. Categories showcase
 * ========================================================================== */

.wynx-categoryGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background-color: var(--wynx-line);
  border: 1px solid var(--wynx-line);
}

.wynx-categoryCard {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background-color: var(--color_bg);
  text-decoration: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.wynx-categoryCard:hover,
.wynx-categoryCard:focus-visible {
  background-color: var(--wynx-brass-tint);
  text-decoration: none;
}

.wynx-categoryCard__name {
  font-family: var(--wynx-serif);
  font-size: 1.0625rem;
  color: var(--color_text);
}

.wynx-categoryCard:hover .wynx-categoryCard__name,
.wynx-categoryCard:focus-visible .wynx-categoryCard__name {
  color: var(--wynx-brass-ink);
}

.wynx-categoryCard__count {
  flex: none;
  font-family: var(--wynx-mono);
  font-size: 0.8125rem;
  color: var(--wynx-muted);
}

/* ==========================================================================
 * 4. Latest articles
 * ========================================================================== */

.wynx-cardGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.wynx-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--wynx-line);
  transition: border-color 0.2s ease;
}

.wynx-card:hover {
  border-color: var(--wynx-brass);
}

.wynx-card__mediaLink {
  display: block;
}

.wynx-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  display: block;
}

.wynx-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wynx-card__body {
  padding: 1.25rem;
}

.wynx-card__badge {
  margin-bottom: 0.625rem;
  font-family: var(--wynx-mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.wynx-card__badge a {
  color: var(--wynx-brass-ink);
  text-decoration: none;
}

.wynx-card__badge a:hover {
  text-decoration: underline;
}

.wynx-card__title {
  margin: 0 0 0.75rem;
  font-family: var(--wynx-serif);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.wynx-card__title a {
  color: var(--color_htag);
  text-decoration: none;
}

.wynx-card__title a:hover {
  color: var(--wynx-brass-ink);
  text-decoration: none;
}

.wynx-card__meta {
  display: flex;
  gap: 1rem;
  margin: 0;
  font-family: var(--wynx-mono);
  font-size: 0.75rem;
  color: var(--wynx-muted);
}

@media (min-width: 600px) {
  .wynx-cardGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .wynx-cardGrid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
 * 5. Author / E-E-A-T band
 * ========================================================================== */

.wynx-authorBand {
  background-color: var(--color_main);
  color: var(--color_footer_text);
  border-top: 1px solid var(--wynx-brass);
}

.wynx-authorBand__inner {
  display: grid;
  grid-template-columns: minmax(0, 20rem) 1fr;
  align-items: center;
}

.wynx-authorBand__profile {
  padding-right: 3rem;
}

.wynx-authorBand__eyebrow {
  color: var(--wynx-brass);
  margin-bottom: 1.25rem;
}

.wynx-authorBand__seal {
  gap: 1rem;
}

.wynx-authorBand .wynx-seal__mark {
  width: 3.5rem;
  height: 3.5rem;
  font-size: 0.875rem;
}

.wynx-authorBand .wynx-seal__credential {
  color: var(--wynx-brass);
}

.wynx-authorBand__name {
  color: var(--color_footer_text);
  font-family: var(--wynx-serif);
  font-size: 1.125rem;
}

.wynx-authorBand__detail {
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  padding-left: 3rem;
}

.wynx-authorBand__bio {
  max-width: 60ch;
  margin: 0 0 1.25rem;
  line-height: 1.9;
  color: var(--color_footer_text);
  opacity: 0.9;
}

.wynx-authorBand__link {
  font-weight: 700;
  color: var(--color_footer_text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.wynx-authorBand__link:hover {
  color: var(--wynx-brass);
}

@media (max-width: 899px) {
  .wynx-authorBand__inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .wynx-authorBand__profile {
    padding-right: 0;
  }

  .wynx-authorBand__detail {
    border-left: 0;
    padding-left: 0;
  }
}

/* ==========================================================================
 * 6. Subscribe band
 * ========================================================================== */

.wynx-homeSubscribe {
  max-width: 32rem;
  padding: 2rem;
  border: 1px solid var(--wynx-brass);
  border-top: 1px solid var(--wynx-brass);
}

.wynx-homeSubscribe__title {
  margin: 0.5rem 0 0.5rem;
  font-family: var(--wynx-serif);
  font-size: 1.125rem;
  color: var(--color_htag);
}

.wynx-homeSubscribe__text {
  margin: 0;
  color: var(--wynx-muted);
  line-height: 1.8;
}

/* ==========================================================================
 * Motion
 * ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .wynx-hubCard,
  .wynx-categoryCard,
  .wynx-categoryCard__name,
  .wynx-card,
  .wynx-btn {
    transition: none;
  }
}

/* Front-page header nav color fix
   -------------------------------------------------------------------------
   With the MV removed, SWELL still colours `.l-header__inner` white (a
   leftover from the transparent-over-hero overlay), so the global-nav links
   (which use `color: inherit`) render white on our light hero. Force the
   solid-header navy. Front-page only (home.css is enqueued only here). */
.l-header .l-header__inner {
  color: var(--color_header_text);
}
