/**
 * Dafa Theme — visual polish layer (additive only).
 *
 * Loaded last (after site.css / sidebar-v3.css / mobile-navigation.css).
 * Contains no layout changes: every rule refines texture, motion or state
 * styling on top of the existing design system. All colors derive from the
 * --dafa-* custom properties (via color-mix where a tint is needed), so both
 * day and night modes adapt automatically; motion rules are wrapped in
 * `@media (prefers-reduced-motion: no-preference)`.
 *
 * @package DafaTheme
 */

/* -------------------------------------------------------------------------
 * 1. Hero — layered brand gradients.
 * Two soft radial glows sit behind the hero copy (and behind the backdrop
 * imagery in the banner layout), adding depth without touching the layout.
 * The accent variable is brighter at night, so both modes stay balanced.
 * ------------------------------------------------------------------------- */
.home-hero {
  background:
    radial-gradient(58% 88% at 86% 8%, color-mix(in srgb, var(--dafa-accent) 9%, transparent) 0%, transparent 62%),
    radial-gradient(44% 70% at 6% 96%, color-mix(in srgb, var(--dafa-accent) 6%, transparent) 0%, transparent 66%),
    var(--dafa-surface);
}

/* -------------------------------------------------------------------------
 * 2. Hero — typography rhythm.
 * ------------------------------------------------------------------------- */
.home-hero__title {
  letter-spacing: -0.032em;
  line-height: 1.06;
}

.home-hero__description {
  line-height: 1.65;
}

/* -------------------------------------------------------------------------
 * 3. Hero — CTA micro-interactions (lift + branded shadow).
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .home-hero-ai__submit,
  .home-hero .scope-search__submit {
    transition:
      transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1),
      background-color 180ms ease;
  }

  .home-hero-ai__submit:hover,
  .home-hero .scope-search__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px color-mix(in srgb, var(--dafa-accent) 34%, transparent);
  }

  .home-hero-ai__submit:active,
  .home-hero .scope-search__submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--dafa-accent) 26%, transparent);
  }

  .home-hero__quick-link {
    transition: color 180ms ease;
  }
}

.home-hero__quick-link:hover {
  color: var(--dafa-accent-strong);
}

.home-hero--banner.home-hero--overlay-dark .home-hero__quick-link:hover {
  color: #fff;
}

/* -------------------------------------------------------------------------
 * 4. Cards — unified hover lift, thumbnail zoom and title feedback.
 * One shared easing curve keeps every card motion consistent.
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  .entry-card {
    transition:
      transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1),
      border-color 220ms ease;
  }

  .entry-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--dafa-shadow);
    border-color: color-mix(in srgb, var(--dafa-accent) 30%, var(--dafa-border));
  }

  .entry-card__media img {
    transition: transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .entry-card:hover .entry-card__media img {
    transform: scale(1.045);
  }
}

.entry-card:hover .entry-card__title a {
  color: var(--dafa-accent-strong);
}

/* Dark mode: soften the resting border so card surfaces read as a distinct
 * layer above the page background instead of a hard outline. */
html.dafa-color-dark .entry-card,
body.dafa-color-dark .entry-card {
  border-color: color-mix(in srgb, var(--dafa-border) 82%, transparent);
}

html.dafa-color-dark .entry-card:hover,
body.dafa-color-dark .entry-card:hover {
  border-color: color-mix(in srgb, var(--dafa-accent) 38%, var(--dafa-border));
}

/* -------------------------------------------------------------------------
 * 5. Section headings — brand bar marker + tracking.
 * ------------------------------------------------------------------------- */
.section-heading h2 {
  position: relative;
  padding-left: 18px;
  letter-spacing: -0.02em;
}

.section-heading h2::before {
  position: absolute;
  top: 0.16em;
  bottom: 0.16em;
  left: 0;
  width: 5px;
  border-radius: 3px;
  background: linear-gradient(
    180deg,
    var(--dafa-accent) 0%,
    color-mix(in srgb, var(--dafa-accent) 55%, transparent) 100%
  );
  content: "";
}

.section-heading a {
  transition: color 180ms ease;
}

/* -------------------------------------------------------------------------
 * 6. Footer — link transitions and spacing rhythm.
 * ------------------------------------------------------------------------- */
.site-footer {
  padding-block: 56px 46px;
}

.footer-widgets {
  gap: 32px;
  margin-bottom: 40px;
}

.site-footer a {
  transition: color 180ms ease;
}

.footer-nav a:hover,
.footer-nav button:hover {
  color: var(--dafa-accent);
}

/* -------------------------------------------------------------------------
 * 7. Keyboard focus — reinforce the brand ring inside cards, where the
 * global outline can visually collide with the card border radius.
 * ------------------------------------------------------------------------- */
.entry-card__media:focus-visible,
.entry-card__title a:focus-visible {
  border-radius: 6px;
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * 8. Branded text selection.
 * ------------------------------------------------------------------------- */
::selection {
  background: var(--dafa-accent);
  color: var(--dafa-on-accent);
  text-shadow: none;
}

/* -------------------------------------------------------------------------
 * 9. Slim scrollbars (WebKit + Firefox). Colors come from the mode-aware
 * variables, so day/night both stay subtle; the thumb picks up the brand
 * accent on hover.
 * ------------------------------------------------------------------------- */
html {
  scrollbar-color: color-mix(in srgb, var(--dafa-text-soft) 42%, var(--dafa-surface)) transparent;
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 2px solid var(--dafa-bg);
  border-radius: 8px;
  background: color-mix(in srgb, var(--dafa-text-soft) 38%, var(--dafa-surface));
}

::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--dafa-accent) 55%, var(--dafa-surface));
}

/* -------------------------------------------------------------------------
 * 10. Global control transitions — one shared timing for links, buttons and
 * form fields so every state change feels like the same product.
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  a {
    transition: color 180ms ease;
  }

  .button,
  button,
  input[type="submit"] {
    transition:
      transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
      box-shadow 180ms ease,
      background-color 180ms ease,
      border-color 180ms ease,
      color 180ms ease;
  }

  input:not([type]),
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="url"],
  input[type="tel"],
  input[type="password"],
  input[type="number"],
  select,
  textarea {
    transition:
      border-color 180ms ease,
      box-shadow 180ms ease,
      background-color 180ms ease;
  }
}

/* -------------------------------------------------------------------------
 * 11. Primary-nav inline SVG icons (replaced dashicons): keep the glyph
 * box aligned inside the 20px inline-grid slot from mobile-navigation.css.
 * ------------------------------------------------------------------------- */
.primary-navigation .dafa-nav-icon svg {
  display: block;
}
