/* ==========================================================================
   MySoundMix Tweaks v1.0.9 — accessibility + dark-mode fixes
   Additive overrides only; the theme and ClearWave plugin stay untouched.

   Dark mode is keyed on html[data-msf-scheme="dark"], which our own
   script sets (see msf-tweaks.js + the wp_head early marker), instead of
   the theme's attribute — so the completed dark theme below applies
   deterministically.
   ========================================================================== */

/* ---------- 1. Dark mode: complete the half-applied theme ----------
   The theme applies dark text colors but ships no dark surfaces,
   leaving near-white text on white. Flip the theme.json palette
   tokens so the whole block theme follows. */
html[data-msf-scheme="dark"] {
  color-scheme: dark;
  --wp--preset--color--base: #0a1428 !important;
  --wp--preset--color--contrast: #edf2f9 !important;
  --wp--preset--color--secondary: #122036 !important;
  --wp--preset--color--muted: #9db1cc !important;
}
html[data-msf-scheme="dark"] body {
  background-color: var(--wp--preset--color--base) !important;
  color: var(--wp--preset--color--contrast) !important;
}
html[data-msf-scheme="dark"] header.wp-block-template-part,
html[data-msf-scheme="dark"] footer.wp-block-template-part {
  background-color: var(--wp--preset--color--base) !important;
  color: var(--wp--preset--color--contrast) !important;
}
/* The theme hard-codes .site-header to translucent white, which paints
   over the dark header background above and leaves nav links unreadable
   (light text on a light bar). Re-tint it in dark mode. */
html[data-msf-scheme="dark"] .site-header,
html[data-color-scheme="dark"] .site-header {
  background: rgba(10, 20, 40, 0.94) !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}
/* The theme's language-bar top border is a hardcoded light line */
html[data-msf-scheme="dark"] .language-bar,
html[data-color-scheme="dark"] .language-bar {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}
/* Nav + language links were ~1.2:1 in the broken dark state */
html[data-msf-scheme="dark"] .wp-block-navigation a,
html[data-msf-scheme="dark"] .language-bar__link {
  color: var(--wp--preset--color--contrast) !important;
}
/* Plain content links need lightening on dark surfaces (not buttons) */
html[data-msf-scheme="dark"] a:not(.wp-block-button__link):not(.wp-element-button) {
  color: #8fb4ff;
}
/* Keep buttons on-brand in dark mode */
html[data-msf-scheme="dark"] .wp-block-button__link,
html[data-msf-scheme="dark"] .wp-element-button {
  background-color: var(--wp--preset--color--primary) !important;
  color: #ffffff !important;
}

/* ---------- 2. Skip link: restore a visible focus indicator ----------
   The theme overrides WP core's :focus style, hiding the skip link. */
.skip-link.screen-reader-text:focus {
  position: fixed !important;
  top: 5px !important;
  left: 5px !important;
  z-index: 100000 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  padding: 15px 23px 14px !important;
  clip-path: none !important;
  clip: auto !important;
  overflow: visible !important;
  background-color: #f1f1f1 !important;
  color: #21759b !important;
  font-size: 1em !important;
  line-height: normal !important;
  text-decoration: none !important;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6) !important;
}

/* ---------- 3. Safety warning: wrap, never truncate ----------
   Safety-critical copy must not ellipsize mid-sentence. */
.tool-clearwave__safety {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  text-align: center !important;
  line-height: 1.4 !important;
}

/* ---------- 4. Stop button: ring only for keyboard focus ----------
   Its default outline is identical to the :focus-visible ring. */
.tool-clearwave__stop:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

/* ---------- 5. 44px minimum touch targets (WCAG 2.5.8) ---------- */
.language-bar__link,
.site-footer__list a,
.wp-block-navigation__container > li > a,
a.more-link {
  min-height: 44px !important;
  display: inline-flex !important;
  align-items: center !important;
}
label:has(> [data-scheme]),
[data-scheme] {
  min-height: 44px !important;
  min-width: 44px !important;
}
/* Volume slider thumb: was ~20px, below the 24px AA minimum */
.tool-clearwave input[type="range"]::-webkit-slider-thumb {
  width: 28px !important;
  height: 28px !important;
}
.tool-clearwave input[type="range"]::-moz-range-thumb {
  width: 28px !important;
  height: 28px !important;
}

/* ---------- 6. Header: allow wrapping on narrow screens ----------
   The theme switcher, language links and CTA sit outside the
   collapsible nav and can crowd a 375px header. */
@media (max-width: 781px) {
  header.wp-block-template-part .wp-block-group {
    flex-wrap: wrap !important;
    row-gap: 0.5rem !important;
  }
}

/* ---------- 7. Respect reduced-motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  .tool-clearwave *,
  .tool-clearwave *::before,
  .tool-clearwave *::after {
    animation: none !important;
    transition: none !important;
  }
  html {
    scroll-behavior: auto !important;
  }
}

/* ================================================================
 * v1.0.3 — Blog + Pages UI polish (light & dark)
 * ================================================================ */

/* --- 1. Hide dates on blog index / archive query loops --- */
.wp-block-query .wp-block-post-date {
  display: none !important;
}

/* --- 2. Blog index: clean card feed --- */
.wp-block-query .wp-block-post-template {
  padding: 0;
  margin: 0;
}
.wp-block-query .wp-block-post-template .wp-block-post {
  background: #ffffff;
  border: 1px solid #e6ecf5;
  border-radius: 18px;
  overflow: hidden;
  margin: 0 0 1.75rem 0 !important;
  box-shadow: 0 1px 3px rgba(7, 20, 51, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.wp-block-query .wp-block-post-template .wp-block-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(0, 82, 255, 0.12);
}
.wp-block-query .wp-block-post-featured-image {
  margin: 0 !important;
  overflow: hidden;
}
.wp-block-query .wp-block-post-featured-image img {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.wp-block-query .wp-block-post:hover .wp-block-post-featured-image img {
  transform: scale(1.03);
}
.wp-block-query .wp-block-post-title {
  font-size: 1.3rem !important;
  line-height: 1.35 !important;
  font-weight: 700;
  padding: 1.25rem 1.5rem 0 1.5rem;
  margin: 0 !important;
}
.wp-block-query .wp-block-post-title a {
  color: #071433;
  text-decoration: none !important;
}
.wp-block-query .wp-block-post-title a:hover {
  color: #0052ff;
}
.wp-block-query .wp-block-post-excerpt {
  color: #5c6b86;
  font-size: 1rem;
  line-height: 1.65;
  padding: 0.6rem 1.5rem 0 1.5rem;
  margin: 0 !important;
}
.wp-block-query .wp-block-post-excerpt__more-link,
.wp-block-query .wp-block-post-excerpt .wp-block-post-excerpt__more-link {
  display: inline-block;
  margin: 0.9rem 1.5rem 1.5rem 1.5rem;
  color: #0052ff;
  font-weight: 600;
  text-decoration: none !important;
}
.wp-block-query .wp-block-post-excerpt__more-link:hover {
  text-decoration: underline !important;
}
.wp-block-query .wp-block-post-excerpt__more-link::after {
  content: " \2192";
}
/* Category / tag chips on cards */
.wp-block-query .wp-block-post-terms {
  padding: 1rem 1.5rem 0 1.5rem;
  font-size: 0.8rem;
}
.wp-block-query .wp-block-post-terms a {
  display: inline-block;
  background: #f0f7ff;
  color: #0052ff;
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  margin: 0 0.4rem 0.4rem 0;
  text-decoration: none !important;
  font-weight: 600;
}
/* Pagination */
.wp-block-query-pagination {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  padding: 1rem 0 2rem 0;
}
.wp-block-query-pagination .page-numbers {
  display: inline-block;
  min-width: 2.75rem;
  text-align: center;
  padding: 0.55rem 0.9rem;
  border: 1px solid #e6ecf5;
  border-radius: 12px;
  color: #071433;
  text-decoration: none !important;
  font-weight: 600;
}
.wp-block-query-pagination .page-numbers.current {
  background: #0052ff;
  border-color: #0052ff;
  color: #ffffff;
}

/* --- 3. Single post: comfortable reading --- */
.single-post .wp-block-post-content,
.single-post .entry-content {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.single-post .wp-block-post-content p,
.single-post .entry-content p {
  line-height: 1.8;
  margin-bottom: 1.25rem;
}
.single-post .wp-block-post-content h2,
.single-post .entry-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}
.single-post .wp-block-post-content h3,
.single-post .entry-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}
.single-post .wp-block-post-content ul,
.single-post .wp-block-post-content ol,
.single-post .entry-content ul,
.single-post .entry-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}
.single-post .wp-block-post-content li,
.single-post .entry-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}
.single-post .wp-block-post-content blockquote,
.single-post .entry-content blockquote {
  border-left: 4px solid #0052ff;
  background: #f0f7ff;
  border-radius: 0 14px 14px 0;
  padding: 1.1rem 1.4rem;
  margin: 1.75rem 0;
  font-style: normal;
}
.single-post .wp-block-post-content blockquote p,
.single-post .entry-content blockquote p {
  margin-bottom: 0;
}
.single-post .wp-block-post-content img,
.single-post .entry-content img {
  border-radius: 14px;
}
.single-post .wp-block-post-content figcaption,
.single-post .entry-content figcaption {
  color: #5c6b86;
  font-size: 0.9rem;
  text-align: center;
  margin-top: 0.5rem;
}
/* Prev / next post links as cards */
.wp-block-post-navigation-link a,
.post-navigation .nav-links a {
  display: block;
  border: 1px solid #e6ecf5;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  text-decoration: none !important;
  color: #071433;
  font-weight: 600;
}
.wp-block-post-navigation-link a:hover,
.post-navigation .nav-links a:hover {
  border-color: #0052ff;
  color: #0052ff;
}

/* --- 4. Pages: calmer vertical rhythm --- */
.page .wp-block-post-title,
.page .entry-title {
  margin-bottom: 1.5rem;
  line-height: 1.25;
}
.page .wp-block-post-content > *,
.page .entry-content > * {
  margin-bottom: 1.25rem;
}
.page .wp-block-post-content h2,
.page .entry-content h2 {
  margin-top: 2.25rem;
}

/* --- 5. Contact Form 7: clean fields --- */
.wpcf7-form {
  max-width: 640px;
}
.wpcf7-form p {
  margin-bottom: 1.1rem;
}
.wpcf7-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #071433;
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form textarea,
.wpcf7-form select {
  width: 100%;
  max-width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #d5deee;
  border-radius: 12px;
  font-size: 1rem;
  background: #ffffff;
  color: #071433;
  box-sizing: border-box;
}
.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
.wpcf7-form select:focus {
  outline: none;
  border-color: #0052ff;
  box-shadow: 0 0 0 3px rgba(0, 82, 255, 0.15);
}
.wpcf7-form input[type="submit"],
.wpcf7-form button[type="submit"] {
  background: #0052ff;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
}
.wpcf7-form input[type="submit"]:hover,
.wpcf7-form button[type="submit"]:hover {
  background: #0043d6;
}
.wpcf7-response-output {
  border-radius: 12px !important;
  padding: 1rem 1.25rem !important;
}

/* --- 6. Dark theme: mirror the polish --- */
html[data-msf-scheme="dark"] .wp-block-query .wp-block-post-template .wp-block-post,
html[data-color-scheme="dark"] .wp-block-query .wp-block-post-template .wp-block-post {
  background: #122036;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
html[data-msf-scheme="dark"] .wp-block-query .wp-block-post-template .wp-block-post:hover,
html[data-color-scheme="dark"] .wp-block-query .wp-block-post-template .wp-block-post:hover {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
html[data-msf-scheme="dark"] .wp-block-query .wp-block-post-title a,
html[data-color-scheme="dark"] .wp-block-query .wp-block-post-title a {
  color: #edf2f9;
}
html[data-msf-scheme="dark"] .wp-block-query .wp-block-post-title a:hover,
html[data-color-scheme="dark"] .wp-block-query .wp-block-post-title a:hover {
  color: #7aa5ff;
}
html[data-msf-scheme="dark"] .wp-block-query .wp-block-post-excerpt,
html[data-color-scheme="dark"] .wp-block-query .wp-block-post-excerpt {
  color: #aebdd6;
}
html[data-msf-scheme="dark"] .wp-block-query .wp-block-post-excerpt__more-link,
html[data-color-scheme="dark"] .wp-block-query .wp-block-post-excerpt__more-link {
  color: #7aa5ff;
}
html[data-msf-scheme="dark"] .wp-block-query .wp-block-post-terms a,
html[data-color-scheme="dark"] .wp-block-query .wp-block-post-terms a {
  background: rgba(0, 82, 255, 0.18);
  color: #9db9ff;
}
html[data-msf-scheme="dark"] .wp-block-query-pagination .page-numbers,
html[data-color-scheme="dark"] .wp-block-query-pagination .page-numbers {
  border-color: rgba(255, 255, 255, 0.14);
  color: #edf2f9;
}
html[data-msf-scheme="dark"] .wp-block-query-pagination .page-numbers.current,
html[data-color-scheme="dark"] .wp-block-query-pagination .page-numbers.current {
  background: #0052ff;
  border-color: #0052ff;
  color: #ffffff;
}
html[data-msf-scheme="dark"] .single-post .wp-block-post-content blockquote,
html[data-msf-scheme="dark"] .single-post .entry-content blockquote,
html[data-color-scheme="dark"] .single-post .wp-block-post-content blockquote,
html[data-color-scheme="dark"] .single-post .entry-content blockquote {
  background: #122036;
  border-left-color: #0052ff;
}
html[data-msf-scheme="dark"] .single-post .wp-block-post-content figcaption,
html[data-msf-scheme="dark"] .single-post .entry-content figcaption,
html[data-color-scheme="dark"] .single-post .wp-block-post-content figcaption,
html[data-color-scheme="dark"] .single-post .entry-content figcaption {
  color: #aebdd6;
}
html[data-msf-scheme="dark"] .wp-block-post-navigation-link a,
html[data-msf-scheme="dark"] .post-navigation .nav-links a,
html[data-color-scheme="dark"] .wp-block-post-navigation-link a,
html[data-color-scheme="dark"] .post-navigation .nav-links a {
  border-color: rgba(255, 255, 255, 0.14);
  color: #edf2f9;
}
html[data-msf-scheme="dark"] .wpcf7-form label,
html[data-color-scheme="dark"] .wpcf7-form label {
  color: #edf2f9;
}
html[data-msf-scheme="dark"] .wpcf7-form input[type="text"],
html[data-msf-scheme="dark"] .wpcf7-form input[type="email"],
html[data-msf-scheme="dark"] .wpcf7-form input[type="tel"],
html[data-msf-scheme="dark"] .wpcf7-form input[type="url"],
html[data-msf-scheme="dark"] .wpcf7-form textarea,
html[data-msf-scheme="dark"] .wpcf7-form select,
html[data-color-scheme="dark"] .wpcf7-form input[type="text"],
html[data-color-scheme="dark"] .wpcf7-form input[type="email"],
html[data-color-scheme="dark"] .wpcf7-form input[type="tel"],
html[data-color-scheme="dark"] .wpcf7-form input[type="url"],
html[data-color-scheme="dark"] .wpcf7-form textarea,
html[data-color-scheme="dark"] .wpcf7-form select {
  background: #122036;
  border-color: rgba(255, 255, 255, 0.16);
  color: #edf2f9;
}

/* v1.0.5: header language bar — switcher right-aligned (theme centers it).
   Scoped to the header .language-bar wrapper so a footer copy keeps the
   theme's default alignment. */
.language-bar .language-bar__nav {
  justify-content: flex-end !important;
}

/* ==========================================================================
   v1.0.7 — dark-mode contrast fixes for theme components the theme leaves
   unstyled in dark mode (found in the 2026-10-20 visual audit):
   - Section headings keep the dark --cw-navy color while the Customizer
     darkens .cw-section backgrounds to #0a1428.
   - Step cards keep the theme's white background while their body text
     inherits the light dark-mode body color.
   - Homepage guide cards: the inner .cw-guide-card keeps a white
     background while the plugin lightens titles/excerpts -> unreadable.
   - Homepage FAQ question labels keep the dark text color on the
     darkened section.
   ========================================================================== */
html[data-msf-scheme="dark"] .cw-section h2,
html[data-msf-scheme="dark"] .cw-section-head h2,
html[data-color-scheme="dark"] .cw-section h2,
html[data-color-scheme="dark"] .cw-section-head h2 {
  color: #edf2f9 !important;
}
html[data-msf-scheme="dark"] .cw-step,
html[data-color-scheme="dark"] .cw-step {
  background: #122036 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-msf-scheme="dark"] .cw-step h3,
html[data-color-scheme="dark"] .cw-step h3 {
  color: #edf2f9 !important;
}
html[data-msf-scheme="dark"] .cw-step p,
html[data-color-scheme="dark"] .cw-step p {
  color: #aebdd6 !important;
}
html[data-msf-scheme="dark"] .cw-guide-card,
html[data-color-scheme="dark"] .cw-guide-card {
  background: #122036 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-msf-scheme="dark"] .cw-faq .wp-block-details summary,
html[data-color-scheme="dark"] .cw-faq .wp-block-details summary {
  color: #edf2f9 !important;
}

/* v1.0.8 — the devices promo panel (.cw-device-panel) keeps its light
   gradient in every mode by design. The v1.0.7 rule that lightens all
   .cw-section h2 headings in dark mode wrongly bleached this panel's
   heading too (white on near-white). Scope the panel back to dark text,
   since it always sits on a light surface. */
html[data-msf-scheme="dark"] .cw-device-panel h2,
html[data-color-scheme="dark"] .cw-device-panel h2 {
  color: #071433 !important;
}
html[data-msf-scheme="dark"] .cw-device-panel p,
html[data-color-scheme="dark"] .cw-device-panel p {
  color: #33455f !important;
}
html[data-msf-scheme="dark"] .cw-device-panel a:not(.wp-block-button__link):not(.wp-element-button),
html[data-color-scheme="dark"] .cw-device-panel a:not(.wp-block-button__link):not(.wp-element-button) {
  color: #0052ff !important;
}
