.ugh-hub {
  --ugh-navy: #17365d;
  --ugh-blue: #2f6fa3;
  --ugh-border: #d9e3ec;
  --ugh-bg: #f6f9fc;
  --ugh-text: #22313f;
  --ugh-muted: #667788;
  margin: 1.5rem 0 2rem;
  color: var(--ugh-text);
}

/* Gear Hub固定ページでは、SWELLのページタイトルから本文先頭までの余白を専用調整する。 */
.ugh-gear-hub-page .post_content {
  margin-top: 1.25rem !important;
  padding-top: 0 !important;
}

.ugh-gear-hub-page .post_content > .wp-block-shortcode:first-child,
.ugh-gear-hub-page .post_content > .wp-block-group:first-child,
.ugh-gear-hub-page .wp-block-shortcode:has(.ugh-hub) {
  margin-top: 0 !important;
}

.ugh-gear-hub-page .wp-block-shortcode:has(.ugh-hub) .ugh-hub {
  margin-top: 0 !important;
}

.ugh-controls {
  display: grid;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--ugh-border);
  border-radius: 14px;
  background: var(--ugh-bg);
}

.ugh-filter-group {
  min-width: 0;
}

.ugh-filter-label {
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ugh-navy);
}

.ugh-filter-options {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 3px;
  scrollbar-width: thin;
}

.ugh-filter {
  flex: 0 0 auto;
  appearance: none;
  min-height: 35px;
  padding: 6px 12px;
  border: 1px solid #aebfd0;
  border-radius: 999px;
  background: #fff;
  color: var(--ugh-navy);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.ugh-filter:hover,
.ugh-filter:focus-visible {
  border-color: var(--ugh-navy);
  outline: none;
  box-shadow: 0 0 0 2px rgba(23, 54, 93, .12);
}

.ugh-filter.is-active {
  border-color: var(--ugh-navy);
  background: var(--ugh-navy);
  color: #fff;
}

.ugh-summary {
  margin: 11px 2px 9px;
  color: var(--ugh-muted);
  font-size: 13px;
}

.ugh-summary strong {
  color: var(--ugh-navy);
  font-size: 16px;
}

.ugh-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ugh-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--ugh-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 14px rgba(25, 51, 78, .06);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.ugh-card[hidden] {
  display: none !important;
}

.ugh-card:hover {
  transform: translateY(-2px);
  border-color: #b9cad9;
  box-shadow: 0 8px 22px rgba(25, 51, 78, .11);
}

.ugh-card-link {
  display: flex;
  height: 100%;
  flex-direction: column;
  color: inherit;
  text-decoration: none !important;
}

.ugh-card-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eaf1f7;
}

.ugh-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .22s ease;
}

.ugh-card:hover .ugh-card-image img {
  transform: scale(1.025);
}

.ugh-card-image--empty {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #eef5fb, #dfeaf4);
  color: var(--ugh-navy);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}

.ugh-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 13px 14px 14px;
}

.ugh-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.ugh-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #edf4fa;
  color: var(--ugh-navy);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
}

.ugh-card-title {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--ugh-text);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.5;
  text-decoration: none;
}

.ugh-card-more {
  margin-top: auto;
  padding-top: 13px;
  color: var(--ugh-blue);
  font-size: 12px;
  font-weight: 700;
}

.ugh-no-results,
.ugh-empty {
  padding: 18px;
  border: 1px solid var(--ugh-border);
  border-radius: 12px;
  background: var(--ugh-bg);
  color: var(--ugh-muted);
  text-align: center;
}

@media (max-width: 820px) {
  .ugh-gear-hub-page .post_content {
    margin-top: 0.9rem !important;
    padding-top: 0 !important;
  }

  .ugh-hub {
    margin: 0 0 1rem;
  }

  .ugh-gear-hub-page .wp-block-shortcode:has(.ugh-hub) {
    margin-top: 0 !important;
    padding-top: 0 !important;
  }

  .ugh-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .ugh-controls {
    gap: 5px;
    padding: 8px 9px;
    border-radius: 12px;
  }

  .ugh-filter-group + .ugh-filter-group {
    margin-top: 1px;
  }

  .ugh-filter-label {
    margin-bottom: 3px;
    font-size: 12px;
  }

  .ugh-filter-options {
    gap: 5px;
    padding-bottom: 1px;
  }

  .ugh-filter {
    min-height: 30px;
    padding: 4px 9px;
    font-size: 11.5px;
  }

  .ugh-summary {
    margin: 5px 2px 6px;
    font-size: 12px;
  }

  .ugh-summary strong {
    font-size: 15px;
  }

  .ugh-card {
    border-radius: 12px;
  }

  .ugh-card-body {
    padding: 8px 8px 9px;
  }

  .ugh-badges {
    gap: 4px;
    margin-bottom: 5px;
  }

  .ugh-badge {
    min-height: 19px;
    padding: 2px 6px;
    font-size: 9px;
    line-height: 1.2;
  }

  .ugh-card-title {
    font-size: 14px;
    line-height: 1.35;
  }

  .ugh-card-more {
    margin-top: 5px;
    padding-top: 0;
    font-size: 11px;
    line-height: 1.25;
  }

  .ugh-hub[data-ugh-type="reel"] .ugh-controls {
    padding: 7px 8px;
  }

  .ugh-hub[data-ugh-type="reel"] .ugh-filter-options {
    gap: 4px;
  }

  .ugh-hub[data-ugh-type="reel"] .ugh-filter {
    min-height: 29px;
    padding: 4px 8px;
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .ugh-grid {
    gap: 8px;
  }

  .ugh-card-body {
    padding: 7px;
  }

  .ugh-badge {
    font-size: 9px;
  }

  .ugh-card-title {
    font-size: 13.5px;
  }
}
