/**
 * Dafa Theme — color discipline & hierarchy layer (additive, site-wide).
 *
 * Loaded after polish-v2. Goal: neutrals carry the interface; brand orange
 * is reserved for primary actions, current states and rare accents
 * (60-30-10). Every selector maps to markup verified in the theme source.
 *
 * @package DafaTheme
 */

/* =========================================================================
 * B1. Header nav badges → borderless text labels.
 * DOM: inc/navigation.php emits .dafa-nav-badge--exclusive / --vip / --ai
 * inside primary-nav links. site.css (570-602) gives each a saturated tint;
 * badges are pointer-events:none, so the hover tint is driven by the parent
 * link. Resting state is now identical across all three; the semantic color
 * only returns on hover of the parent menu item.
 * ========================================================================= */

.dafa-nav-badge {
  --dafa-nav-badge-ink: var(--dafa-text-soft);

  border: 0;
  background: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .dafa-nav-badge {
    transition: color 160ms ease;
  }
}

.primary-navigation a:hover .dafa-nav-badge--exclusive,
.primary-navigation a:focus-visible .dafa-nav-badge--exclusive {
  --dafa-nav-badge-ink: var(--dafa-accent-strong);
}

.primary-navigation a:hover .dafa-nav-badge--vip,
.primary-navigation a:focus-visible .dafa-nav-badge--vip {
  --dafa-nav-badge-ink: color-mix(in srgb, #8c6500 55%, var(--dafa-text));
}

.primary-navigation a:hover .dafa-nav-badge--ai,
.primary-navigation a:focus-visible .dafa-nav-badge--ai {
  --dafa-nav-badge-ink: color-mix(in srgb, #315f9f 55%, var(--dafa-text));
}

/* =========================================================================
 * B2. Control hierarchy.
 * Everyday actions use the neutral control tokens in site.css; download,
 * payment and membership acquisition keep their dedicated brand styles.
 * ========================================================================= */

.home-hero__quick-link {
  font-weight: 620;
}

/* =========================================================================
 * B3. Unified chip language.
 * One neutral pill spec (padding / radius / 1px border / 12.5px / soft ink)
 * for tag clouds, archive hot-tag chips and resource filter pills. Brand
 * color appears only on hover / active. Footer chips keep their dark-band
 * variant (higher-specificity rules in polish-v2.css win there).
 * ========================================================================= */

.archive-subs__chip,
.resource-filters__row a,
.wp-block-tag-cloud a {
  padding: 5px 12px;
  border: 1px solid var(--dafa-border);
  border-radius: 999px;
  background: transparent;
  color: var(--dafa-text-soft);
  font-size: 12.5px;
  line-height: 1.5;
}

.archive-subs__chip:is(:hover, :focus-visible):not([aria-disabled="true"]),
.resource-filters__row a:is(:hover, :focus-visible):not([aria-disabled="true"]),
.wp-block-tag-cloud a:is(:hover, :focus-visible):not([aria-disabled="true"]) {
  border-color: var(--dafa-accent);
  background: transparent;
  color: var(--dafa-accent-strong);
  text-decoration: none;
}

/* Selected choices remain unfilled; brand ink and a fine border identify the selection. */
.resource-filters__row a.is-active,
.archive-subs__chip.is-current {
  font-weight: 650;
  background: transparent;
  color: var(--dafa-accent-strong);
  border-color: var(--dafa-accent);
}

/* =========================================================================
 * B4. Semantic-color containment.
 * File-type chips (PDF/DOC/XLS…) keep their identity colors — they are
 * status semantics, not decoration. Their tinted backgrounds (polish-v2)
 * are further desaturated so they stop competing with the brand orange.
 * ========================================================================= */

.entry-card__filetype {
  background: color-mix(in srgb, currentColor 9%, transparent);
}

/* =========================================================================
 * B5. Type hierarchy ladder.
 * Desktop targets: page H1 40-44 / section H2 28-30 / card H3 20.
 * Hero display type is the deliberate exception and stays as-is.
 * ========================================================================= */

.archive-hero h1,
.archive-title,
.search-hero h1,
.vip-hero h1 {
  font-size: clamp(32px, 4vw, 44px);
  letter-spacing: -0.03em;
}

.section-heading h2 {
  font-size: clamp(24px, 2.6vw, 30px);
}

.entry-card__title {
  font-size: 20px;
}

/* Page subtitles step down clearly below the H1. */
.archive-description {
  color: var(--dafa-text-soft);
  font-size: 15px;
}

/* Breadcrumbs recede to wayfinding metadata. */
.dafa-breadcrumbs {
  color: var(--dafa-text-soft);
  font-size: 12.5px;
}

/* =========================================================================
 * Owner-requested removals (2026-09-03)
 * ========================================================================= */

/* Header VIP summary chip: drop the soft background + gradient, keep the
 * border-top rule and text color from site.css. Same specificity (0,3,0),
 * this file loads later. */
.header-actions .header-user__summary--vip[data-dafa-vip-tier] {
  background-color: transparent;
  background-image: none;
}

/* =========================================================================
 * Color-mode switcher relocated to the footer bottom bar.
 * The markup keeps its original classes (.mobile-color-mode*) so
 * color-mode.js keeps binding; these rules re-skin it for the dark footer
 * band and make it visible on every viewport (base rule hides it).
 * ========================================================================= */
.site-footer .mobile-color-mode {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.site-footer .mobile-color-mode__label {
  margin: 0;
  color: var(--dafa-footer-muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.site-footer .mobile-color-mode__options {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--dafa-footer-line);
  border-radius: 999px;
  background: rgb(255 255 255 / 6%);
}

.site-footer .mobile-color-mode__option {
  display: inline-flex;
  width: auto;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--dafa-footer-muted);
  font-size: 12px;
  font-weight: 560;
  cursor: pointer;
}

.site-footer .mobile-color-mode__option svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-footer .mobile-color-mode__option:hover,
.site-footer .mobile-color-mode__option:focus-visible {
  background: rgb(255 255 255 / 10%);
  color: #fff;
}

.site-footer .mobile-color-mode__option:focus-visible {
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.site-footer .mobile-color-mode__option[aria-checked="true"] {
  border-color: transparent;
  background: var(--dafa-footer-ink);
  color: #161c27;
  font-weight: 680;
}

.site-footer .mobile-color-mode__option:active {
  transform: none;
}

/* Footer bottom bar: nav + switcher + copyright on one row, wrapping
 * gracefully on small screens. */
.site-footer .footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
}

@media (max-width: 640px) {
  .site-footer .footer-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
