/* bobnoblog v2.4.21 — double border on click/focus only, not hover.
 * The original 2px card border is the INSIDE line.  An actual outline is
 * the OUTSIDE line, with a 3px transparent gap between them. The gentle
 * shadow is just a glow, never used as a substitute for the second line.
 * Keep no-card-motion, linked-only effects, and focus indication.
 */
:where(
  .homepage a.study-feature[href],
  .homepage a.study-link[href],
  .homepage a.gadget-card[href],
  .homepage #other a.bnb-other__card[href],
  .homepage .latest-card:has(.latest-card__link[href]),
  .homepage .bnb-highlight-card:has(a[href]),
  .bnb-archive-page .bnb-archive-card:has(.bnb-archive-card__link[href]),
  .bnb-article-page .bnb-article-related__card a[href],
  .content-page__paper .entry-content a.bnc-linkcard[href],
  .content-page__paper .entry-content a.blogcard-wrap[href],
  .content-page__paper .entry-content .wp-block-bobnoblog-article-card a.bnc-linkcard[href]
) {
  transform: none !important;
  outline: 2px solid transparent !important;
  outline-offset: 3px !important;
  transition: border-color .18s ease, outline-color .18s ease, box-shadow .18s ease !important;
}

/* Hover: light up the INNER border, but keep the OUTER line transparent. */
@media (hover: hover) and (pointer: fine) {
  :is(
    .homepage a.study-feature[href],
    .homepage a.study-link[href],
    .homepage a.gadget-card[href],
    .homepage #other a.bnb-other__card[href],
    .homepage .latest-card:has(.latest-card__link[href]),
    .homepage .bnb-highlight-card:has(a[href]),
    .bnb-archive-page .bnb-archive-card:has(.bnb-archive-card__link[href]),
    .bnb-article-page .bnb-article-related__card a[href],
    .content-page__paper .entry-content a.bnc-linkcard[href],
    .content-page__paper .entry-content a.blogcard-wrap[href],
    .content-page__paper .entry-content .wp-block-bobnoblog-article-card a.bnc-linkcard[href]
  ):hover {
    transform: none !important;
    border-color: #7ccaff !important;
    outline: 2px solid transparent !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 13px rgba(51,151,236,.16) !important;
  }
}

/* Click (:active/:focus-within) and keyboard focus: separated double ring. */
:is(
  .homepage a.study-feature[href],
  .homepage a.study-link[href],
  .homepage a.gadget-card[href],
  .homepage #other a.bnb-other__card[href],
  .homepage .latest-card:has(.latest-card__link[href]),
  .homepage .bnb-highlight-card:has(a[href]),
  .bnb-archive-page .bnb-archive-card:has(.bnb-archive-card__link[href]),
  .bnb-article-page .bnb-article-related__card a[href],
  .content-page__paper .entry-content a.bnc-linkcard[href],
  .content-page__paper .entry-content a.blogcard-wrap[href],
  .content-page__paper .entry-content .wp-block-bobnoblog-article-card a.bnc-linkcard[href]
):focus-within,
:is(
  .homepage a.study-feature[href],
  .homepage a.study-link[href],
  .homepage a.gadget-card[href],
  .homepage #other a.bnb-other__card[href],
  .homepage .latest-card:has(.latest-card__link[href]),
  .homepage .bnb-highlight-card:has(a[href]),
  .bnb-archive-page .bnb-archive-card:has(.bnb-archive-card__link[href]),
  .bnb-article-page .bnb-article-related__card a[href],
  .content-page__paper .entry-content a.bnc-linkcard[href],
  .content-page__paper .entry-content a.blogcard-wrap[href],
  .content-page__paper .entry-content .wp-block-bobnoblog-article-card a.bnc-linkcard[href]
):active {
  transform: none !important;
  border-color: #a0ddff !important;
  outline: 2px solid #74caff !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 13px rgba(51,151,236,.26) !important;
}

/* The outline belongs to the CARD, not an additional outline on its child link. */
.homepage .latest-card .latest-card__link:focus-visible,
.homepage .bnb-highlight-card > a:focus-visible,
.bnb-archive-page .bnb-archive-card__link:focus-visible,
.bnb-article-page .bnb-article-related__card a:focus-visible,
.content-page__paper .entry-content a:is(.bnc-linkcard,.blogcard-wrap):focus-visible {
  outline: none !important;
}
/* For link cards which themselves take focus, show the ring on the card (not remove it). */
.bnb-article-page .bnb-article-related__card a[href]:focus-visible,
.content-page__paper .entry-content a:is(.bnc-linkcard,.blogcard-wrap)[href]:focus-visible {
  outline: 2px solid #74caff !important;
  outline-offset: 3px !important;
}

/* Respect reduced motion and keep all cards in place on mobile/touch. */
@media (hover: none), (prefers-reduced-motion: reduce) {
  :where(
    .homepage a.study-feature[href], .homepage a.study-link[href],
    .homepage a.gadget-card[href], .homepage #other a.bnb-other__card[href],
    .homepage .latest-card, .homepage .bnb-highlight-card,
    .bnb-archive-page .bnb-archive-card,
    .bnb-article-page .bnb-article-related__card a[href],
    .content-page__paper .entry-content a:is(.bnc-linkcard,.blogcard-wrap)[href]
  ) { transform: none !important; }
}
