/* ============================================================
   RKD Sports India — Accessibility layer
   Loaded after the theme stylesheets so these rules win without
   needing !important. Covers three gaps the site had nothing for:
   a keyboard skip link, a visible focus indicator, and respect for
   the operating system's reduced-motion setting.
   ============================================================ */

/* ── Skip to content ─────────────────────────────────────────
   Keyboard and screen-reader users otherwise tab through the whole
   top bar, nav and mega-menu on every page before reaching content.
   Off-screen until focused, then pinned to the top-left. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 12px 20px;
  background: var(--red, #d62828);
  color: #fff;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm, 8px) 0;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
  outline: 3px solid var(--dark-blue, #1a2c5b);
  outline-offset: 2px;
}

/* ── Visible focus ───────────────────────────────────────────
   :focus-visible only paints for keyboard interaction, so mouse
   users see no change while keyboard users get a clear indicator.
   Applied broadly because the theme defines no focus styling. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--dark-blue, #1a2c5b);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Inputs sit on white cards where the dark-blue ring can read as a
   border; give them the brand ring instead for contrast. */
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-color: var(--red, #d62828);
}

/* ── Screen-reader-only utility ──────────────────────────────
   For labels that must exist for assistive tech but not on screen. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Reduced motion ──────────────────────────────────────────
   The theme carries 138 transitions and animations. Users who ask
   their OS for reduced motion get near-instant state changes rather
   than none at all, so hover and open/close feedback is preserved. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto !important; }
}

/* ── Layout stability ────────────────────────────────────────
   Product imagery is square by design. Giving the containers an
   aspect ratio reserves the space before the image arrives, which
   stops cards from jumping as the grid populates. */
.product-card img,
.related-card img,
.wishlist-item img,
.summary-item img,
.cart-item img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  width: 100%;
  height: auto;
}

/* Blog imagery is landscape and rendered by JS from the posts API, so it
   cannot carry width/height attributes in the markup. */
.blog-card-image img,
.related-post-image img,
.article-featured-image img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
  height: auto;
}
