/*
 * Research Tools Hub / Kakenhi.com Design Policy v2.2
 * Scope: only the [kakenhi_tools_hub] output. No site-wide styles.
 * Tokens are owned by the shared UI shell/core, not by this plugin.
 */
/* R9: use the same category heading markup, typescale and colors as /find/, /write/, /learn/.
   The R5 stylesheet is loaded on the tools page by the Tools Hub plugin.
   Fallbacks below keep the header readable if the theme's R5 stylesheet is absent. */
.kth-wrap.kcom-r5-hub {
  --r5-ink: #202f40;
  --r5-muted: #586b7c;
  --r5-line: #dce5ec;
  --r5-accent: #1b6678;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  /* The tools page already has a .content-shell--app top padding. */
  padding: clamp(8px, 2.2vw, 28px) 0 48px;
  color: var(--r5-ink);
}
.kth-wrap .kcom-r5-hub__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 26px;
  font-size: 12px;
  color: var(--r5-muted);
}
.kth-wrap .kcom-r5-hub__breadcrumb a { color: var(--r5-accent); text-decoration: none; }
.kth-wrap .kcom-r5-hub__breadcrumb a:hover { text-decoration: underline; }
.kth-wrap .kcom-r5-hub__header {
  padding: 0 0 23px;
  margin: 0;
  border-bottom: 1px solid var(--r5-line);
}
.kth-wrap .kcom-r5-card__number {
  display: block;
  margin: 0 0 7px;
  color: var(--r5-accent);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: .08em;
}
.kth-wrap .kcom-r5-hub__header h1 {
  margin: 3px 0 10px;
  color: var(--r5-ink);
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 700;
  line-height: 1.3;
}
.kth-wrap .kcom-r5-hub__header p {
  margin: 0;
  color: var(--r5-muted);
  font-size: 15px;
  line-height: 1.65;
}
.kth-wrap .kcom-r5-hub__section { margin-top: 28px; }
.kth-wrap .kcom-r5-hub__section h2 {
  margin: 0 0 16px;
  padding: 0;
  color: var(--r5-ink);
  font-size: 20px;
  line-height: 1.45;
}
.kth-wrap .kth-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 0; /* Section title already separates the header from tool links. */
}
.kth-wrap .kth-item {
  margin: 0;
  border-bottom: 1px solid var(--kcom-color-border, #DCE5E1);
}
.kth-wrap .kth-link {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 100px;
  padding: 18px 8px;
  color: var(--kcom-color-text, #1F2937);
  text-decoration: none;
  background-color: transparent;
  transition: background-color 150ms ease, color 150ms ease;
}
.kth-wrap .kth-link:hover {
  background-color: var(--kcom-color-subtle-bg, #F7FAF9);
  color: var(--kcom-color-primary-hover, #115E59);
}
.kth-wrap .kth-link:focus-visible {
  outline: 3px solid var(--kcom-color-primary, #0F766E);
  outline-offset: 2px;
  background-color: var(--kcom-color-subtle-bg, #F7FAF9);
}
.kth-wrap .kth-link:hover .kth-title,
.kth-wrap .kth-link:focus-visible .kth-title {
  text-decoration: underline;
  text-underline-offset: .18em;
}
.kth-wrap .kth-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--kcom-color-border, #DCE5E1);
  border-radius: 14px;
  background: #FFFFFF;
  color: var(--kcom-color-primary, #0F766E);
}
.kth-wrap .kth-icon svg {
  width: 28px;
  height: 28px;
  overflow: visible;
}
.kth-wrap .kth-link:hover .kth-icon,
.kth-wrap .kth-link:focus-visible .kth-icon {
  border-color: var(--kcom-color-primary, #0F766E);
  background-color: var(--kcom-color-subtle-bg, #F7FAF9);
}
.kth-wrap .kth-copy { display: block; min-width: 0; }
.kth-wrap .kth-title {
  display: block;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.45;
}
.kth-wrap .kth-description {
  display: block;
  margin-top: 5px;
  color: var(--kcom-color-muted, #64748B);
  font-size: 15px;
  line-height: 1.6;
}
.kth-wrap .kth-meta {
  display: block;
  margin-top: 7px;
  color: var(--kcom-color-muted, #64748B);
  font-size: 14px;
}
.kth-wrap .kth-open {
  color: var(--kcom-color-primary, #0F766E);
  font-size: 18px;
}
.kth-wrap .kth-empty {
  color: var(--kcom-color-muted, #64748B);
  font-size: 16px;
}
@media (max-width: 600px) {
  .kth-wrap.kcom-r5-hub { padding-top: 8px; }
  .kth-wrap .kth-link {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    min-height: 88px;
    gap: 12px;
    padding: 16px 4px;
  }
  .kth-wrap .kth-icon { width: 48px; height: 48px; border-radius: 12px; }
  .kth-wrap .kth-icon svg { width: 24px; height: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .kth-wrap .kth-link { transition: none; }
}
