/* ============================================================
   AKMB Beetle Archive — /beetle/
   Design: Natural History Museum × Modern Search DB
   ============================================================ */

:root {
  --ba-bg:        #F6F5F0;
  --ba-text:      #171A17;
  --ba-green:     #1F3A1A;
  --ba-green-lt:  #2D5220;
  --ba-card:      #FFFFFF;
  --ba-border:    #E2DDD5;
  --ba-muted:     #8C8880;
  --ba-tag-bg:    #EEECEA;
  --ba-shadow:    0 1px 4px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.05);
  --ba-radius:    10px;
  --ba-hero-h:    480px;
}

/* ── サイトヘッダーを非表示（beetle archiveはheroがナビ兼ねる）── */
body.post-type-archive-beetle .site-header,
body.tax-beetle_type .site-header {
  display: none;
}

/* ── Page background ───────────────────────── */
body.post-type-archive-beetle,
body.tax-beetle_type {
  background: var(--ba-bg);
}

/* ── Hero nav（ヒーロー内ナビ） ─────────────── */
.ba-hero-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 40px;
  height: 60px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.ba-hero-nav__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 28px;
  text-decoration: none;
}
.ba-hero-nav__logo img {
  height: 32px;
  width: auto;
  filter: brightness(0) invert(1);
  display: block;
}
.ba-hero-nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
}
.ba-hero-nav__link {
  display: inline-flex;
  align-items: center;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  border-radius: 6px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.ba-hero-nav__link:hover { color: #fff; background: rgba(255,255,255,.1); }
.ba-hero-nav__link.is-current {
  color: #fff;
  font-weight: 700;
  background: rgba(255,255,255,.12);
}
.ba-hero-nav__actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.ba-hero-nav__menu-btn {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  background: none;
  border: none;
  color: rgba(255,255,255,.75);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
}
.ba-hero-nav__menu-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

/* Mobile drawer */
.ba-hero-drawer {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  z-index: 20;
  background: rgba(15,28,15,.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.1);
  padding: 8px 0 12px;
}
.ba-hero-drawer a {
  display: block;
  padding: 11px 24px;
  font-size: 15px;
  color: rgba(255,255,255,.8);
  text-decoration: none;
  transition: background .15s;
}
.ba-hero-drawer a:hover { background: rgba(255,255,255,.06); color: #fff; }

/* ── Hero ──────────────────────────────────── */
.ba-hero {
  position: relative;
  min-height: var(--ba-hero-h);
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #0A160A 0%, #1A3018 60%, #0E1E10 100%);
  overflow: hidden;
  margin-bottom: 48px;
}
.ba-hero__img {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: auto;
  opacity: .88;
  filter: saturate(0.85) contrast(1.05);
}
.ba-hero__overlay {
  position: absolute;
  inset: 0;
  /* 左（テキスト）: 濃く → 右（生体）: 透明 */
  background: linear-gradient(
    to right,
    rgba(8,18,8,.97)  0%,
    rgba(8,18,8,.94)  18%,
    rgba(8,18,8,.82)  35%,
    rgba(8,18,8,.50)  52%,
    rgba(8,18,8,.15)  68%,
    rgba(8,18,8,.00)  82%
  );
}
.ba-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 620px;
  padding: 100px 40px 60px 60px;
}
.ba-hero__credit {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 10px;
  color: rgba(255,255,255,.35);
  z-index: 2;
}
.ba-hero__credit a { color: rgba(255,255,255,.45); text-decoration: none; }
.ba-hero__credit a:hover { color: rgba(255,255,255,.7); }
.ba-hero__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  margin-bottom: 12px;
}
.ba-hero__title {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -.01em;
}
.ba-hero__desc {
  font-size: 15px;
  color: rgba(255,255,255,.7);
  line-height: 1.6;
  margin: 0 0 28px;
}

/* Search form */
.ba-search {
  display: flex;
  max-width: 560px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.ba-search__input {
  flex: 1;
  height: 52px;
  padding: 0 16px 0 44px;
  font-size: 15px;
  border: none;
  outline: none;
  background: #fff;
  color: var(--ba-text);
  font-family: inherit;
}
.ba-search__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ba-muted);
  pointer-events: none;
}
.ba-search__wrap {
  position: relative;
  flex: 1;
  display: flex;
}
.ba-search__btn {
  height: 52px;
  padding: 0 24px;
  background: var(--ba-green);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
  white-space: nowrap;
}
.ba-search__btn:hover { background: var(--ba-green-lt); }

/* Suggest */
.ba-suggest {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  z-index: 100;
  display: none;
  max-height: 360px;
  overflow-y: auto;
}
.ba-suggest.is-open { display: block; }
.ba-suggest__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background .1s;
  text-decoration: none;
  color: var(--ba-text);
}
.ba-suggest__item:hover,
.ba-suggest__item.is-focused { background: var(--ba-tag-bg); }
.ba-suggest__thumb {
  width: 44px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--ba-tag-bg);
}
.ba-suggest__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--ba-muted);
  text-align: center;
  line-height: 1.3;
}
.ba-suggest__name { font-size: 14px; font-weight: 600; }
.ba-suggest__sci  { font-size: 11px; color: var(--ba-muted); font-style: italic; }
.ba-suggest__type { font-size: 10px; color: var(--ba-muted); margin-top: 2px; }
.ba-suggest__empty { padding: 16px; font-size: 14px; color: var(--ba-muted); text-align: center; }

/* Popular chips */
.ba-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.ba-chips__label {
  font-size: 12px;
  color: rgba(255,255,255,.5);
  align-self: center;
}
.ba-chip {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px;
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.85);
  border: 1px solid rgba(255,255,255,.2);
  text-decoration: none;
  transition: background .15s;
}
.ba-chip:hover { background: rgba(255,255,255,.22); color: #fff; }

/* ── Type cards (クワガタ/カブトムシ) ────────── */
.ba-types {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 56px;
}
.ba-type-card {
  position: relative;
  min-height: 200px;
  border-radius: var(--ba-radius);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  text-decoration: none;
  background: #1A2A1A;
}
.ba-type-card__bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
  width: 100%;
  height: 100%;
  opacity: .55;
  transition: transform .4s ease, opacity .3s;
}
.ba-type-card:hover .ba-type-card__bg { transform: scale(1.04); opacity: .65; }
.ba-type-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,.1) 60%);
}
.ba-type-card__body {
  position: relative;
  z-index: 1;
  padding: 24px;
  width: 100%;
}
.ba-type-card__title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.ba-type-card__sub {
  font-size: 13px;
  color: rgba(255,255,255,.65);
  display: flex;
  align-items: center;
  gap: 6px;
}
.ba-type-card__sub::after {
  content: '→';
  font-size: 14px;
  color: rgba(255,255,255,.5);
}

/* ── Section common ─────────────────────────── */
.ba-section {
  margin-bottom: 56px;
}
.ba-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 0 12px;
  border-bottom: 2px solid var(--ba-text);
}
.ba-section-head h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--ba-text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ba-section-head__icon { font-size: 18px; }
.ba-section-head__desc { font-size: 12px; color: var(--ba-muted); margin-left: 8px; font-weight: 400; }
.ba-section-head__more {
  font-size: 13px;
  color: var(--ba-green);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.ba-section-head__more:hover { text-decoration: underline; }

/* ── Popular species grid ───────────────────── */
.ba-popular-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--ba-border) transparent;
}
.bc-card-pop {
  flex: 0 0 200px;
  scroll-snap-align: start;
  background: var(--ba-card);
  border-radius: var(--ba-radius);
  border: 1px solid var(--ba-border);
  overflow: hidden;
  text-decoration: none;
  color: var(--ba-text);
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.bc-card-pop:hover {
  box-shadow: var(--ba-shadow);
  transform: translateY(-2px);
}
.bc-card-pop__thumb {
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  background: var(--ba-tag-bg);
  flex-shrink: 0;
}
.bc-card-pop__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bc-card-pop__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.bc-card-pop__placeholder span:first-child {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .18em;
  color: #C8C4B8;
}
.bc-card-pop__placeholder span:last-child {
  font-size: 9px;
  letter-spacing: .12em;
  color: #C8C4B8;
}
.bc-card-pop__body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.bc-card-pop__name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.bc-card-pop__sci  { font-size: 11px; color: var(--ba-muted); font-style: italic; }
.bc-card-pop__origin { font-size: 11px; color: var(--ba-muted); margin-top: 2px; }
.bc-card-pop__meta { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.bc-card-pop__meta-row { font-size: 11px; color: var(--ba-muted); display: flex; align-items: center; gap: 4px; }
.bc-card-pop__stars { color: #C8A800; letter-spacing: 1px; font-size: 12px; }
.bc-card-pop__price { font-size: 12px; font-weight: 700; color: var(--ba-text); margin-top: 4px; }

/* ── Group grid ─────────────────────────────── */
.ba-group-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.ba-group-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--ba-card);
  border: 1px solid var(--ba-border);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: var(--ba-text);
  transition: border-color .15s, box-shadow .15s;
}
.ba-group-card:hover {
  border-color: var(--ba-green);
  box-shadow: 0 0 0 1px var(--ba-green);
}
.ba-group-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--ba-tag-bg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.ba-group-card__icon img { width: 100%; height: 100%; object-fit: cover; }
.ba-group-card__text { flex: 1; min-width: 0; }
.ba-group-card__name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ba-group-card__sub  { font-size: 11px; color: var(--ba-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.ba-group-card__arr  { font-size: 14px; color: var(--ba-muted); flex-shrink: 0; }

/* ── Origin grid ─────────────────────────────── */
.ba-origin-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.ba-origin-card {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 3/4;
  text-decoration: none;
  display: flex;
  align-items: flex-end;
  background: #1A2A1A;
}
.ba-origin-card__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .6;
  transition: transform .3s, opacity .3s;
}
.ba-origin-card:hover .ba-origin-card__bg { transform: scale(1.06); opacity: .75; }
.ba-origin-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.7) 0%, transparent 60%);
}
.ba-origin-card__name {
  position: relative;
  z-index: 1;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  padding: 8px;
  text-align: center;
  width: 100%;
  line-height: 1.3;
}

/* Origin gradient fallbacks */
.ba-origin-card--japan    { background: linear-gradient(135deg,#2D5A8E,#1A3A5E); }
.ba-origin-card--indonesia{ background: linear-gradient(135deg,#5A8E2D,#2E5A1A); }
.ba-origin-card--ph       { background: linear-gradient(135deg,#8E5A2D,#5A2E1A); }
.ba-origin-card--malaysia { background: linear-gradient(135deg,#2D8E5A,#1A5A2E); }
.ba-origin-card--thailand { background: linear-gradient(135deg,#8E2D5A,#5A1A2E); }
.ba-origin-card--latam    { background: linear-gradient(135deg,#5A2D8E,#2E1A5A); }
.ba-origin-card--africa   { background: linear-gradient(135deg,#8E7A2D,#5A4A1A); }
.ba-origin-card--others   { background: linear-gradient(135deg,#4A4A4A,#2A2A2A); }

/* ── Results section ─────────────────────────── */
.ba-results {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
  margin-bottom: 60px;
}
.ba-results-full {
  grid-column: 1 / -1;
}

/* Filter sidebar */
.ba-sidebar {
  position: sticky;
  top: 20px;
  background: var(--ba-card);
  border: 1px solid var(--ba-border);
  border-radius: var(--ba-radius);
  padding: 20px;
}
.ba-sidebar__title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ba-muted);
  margin: 0 0 16px;
}
.ba-filter-group { margin-bottom: 20px; }
.ba-filter-group__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ba-text);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ba-border);
}
.ba-filter-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--ba-text);
  cursor: pointer;
  user-select: none;
}
.ba-filter-item input[type=checkbox] {
  width: 14px;
  height: 14px;
  accent-color: var(--ba-green);
  cursor: pointer;
  flex-shrink: 0;
}
.ba-filter-more {
  font-size: 12px;
  color: var(--ba-green);
  cursor: pointer;
  padding: 2px 0;
  display: none;
}
.ba-filter-more.is-visible { display: block; }
.ba-sidebar__reset {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--ba-muted);
  text-decoration: none;
  padding: 8px;
  border: 1px solid var(--ba-border);
  border-radius: 6px;
  margin-top: 4px;
  transition: background .15s;
}
.ba-sidebar__reset:hover { background: var(--ba-tag-bg); }

/* Results main */
.ba-main {}
.ba-main-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ba-main-count {
  font-size: 14px;
  color: var(--ba-muted);
}
.ba-main-count strong { color: var(--ba-text); font-size: 18px; }
.ba-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ba-muted);
}
.ba-sort select {
  font-size: 13px;
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--ba-border);
  border-radius: 6px;
  background: var(--ba-card);
  color: var(--ba-text);
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%238C8880'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  outline: none;
}
.ba-sort select:focus { border-color: var(--ba-green); }

/* Active filters */
.ba-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.ba-active-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--ba-green);
  color: #fff;
  border-radius: 20px;
  font-size: 12px;
  text-decoration: none;
}
.ba-active-tag__x { font-size: 14px; line-height: 1; opacity: .7; }
.ba-active-tag__x:hover { opacity: 1; }

/* Beetle card (grid) */
.bc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.bc-card {
  background: var(--ba-card);
  border: 1px solid var(--ba-border);
  border-radius: var(--ba-radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ba-text);
  transition: box-shadow .2s, transform .2s;
  display: flex;
  flex-direction: column;
}
.bc-card:hover {
  box-shadow: var(--ba-shadow);
  transform: translateY(-2px);
}
.bc-card__thumb {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--ba-tag-bg);
  flex-shrink: 0;
}
.bc-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.bc-card__placeholder-l1 {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
  color: #C4BFB5;
}
.bc-card__placeholder-l2 {
  font-size: 9px;
  letter-spacing: .14em;
  color: #C4BFB5;
}
.bc-card__body { padding: 12px; flex: 1; display: flex; flex-direction: column; }
.bc-card__name { font-size: 14px; font-weight: 700; line-height: 1.4; margin-bottom: 3px; }
.bc-card__sci  { font-size: 11px; color: var(--ba-muted); font-style: italic; margin-bottom: 8px; }
.bc-card__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.bc-card__tag  {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--ba-tag-bg);
  color: var(--ba-muted);
}
.bc-card__meta { margin-top: auto; display: flex; flex-direction: column; gap: 3px; }
.bc-card__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ba-muted);
}
.bc-card__meta-val { font-weight: 600; color: var(--ba-text); }
.bc-stars { color: #C8A800; letter-spacing: 1px; font-size: 12px; }

/* Horizontal card (mobile) */
.bc-card-h {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ba-card);
  border: 1px solid var(--ba-border);
  border-radius: var(--ba-radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ba-text);
  padding: 0;
  transition: box-shadow .15s;
}
.bc-card-h:hover { box-shadow: var(--ba-shadow); }
.bc-card-h__thumb {
  width: 90px;
  aspect-ratio: 1/1;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--ba-tag-bg);
}
.bc-card-h__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc-card-h__body { flex: 1; min-width: 0; padding: 10px 12px 10px 0; }
.bc-card-h__name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-card-h__sci  { font-size: 11px; color: var(--ba-muted); font-style: italic; }
.bc-card-h__meta { display: flex; gap: 10px; margin-top: 5px; flex-wrap: wrap; }
.bc-card-h__meta-item { font-size: 11px; color: var(--ba-muted); }
.bc-card-h__arr { padding-right: 12px; color: var(--ba-muted); font-size: 16px; flex-shrink: 0; }

/* Load more */
.ba-loadmore {
  text-align: center;
  margin: 28px 0 0;
}
.ba-loadmore__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 36px;
  background: var(--ba-green);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.ba-loadmore__btn:hover { background: var(--ba-green-lt); }
.ba-loadmore__btn:disabled { opacity: .5; cursor: default; }
.ba-loadmore__count { font-size: 13px; color: var(--ba-muted); margin-top: 8px; }

/* ── Mobile filter bar ──────────────────────── */
.ba-mobile-bar {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}
.ba-filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--ba-card);
  border: 1px solid var(--ba-border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ba-text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color .15s;
}
.ba-filter-toggle.has-filter { border-color: var(--ba-green); color: var(--ba-green); }
.ba-sort-mobile select {
  padding: 9px 28px 9px 12px;
  font-size: 14px;
  border: 1px solid var(--ba-border);
  border-radius: 8px;
  background: var(--ba-card);
  color: var(--ba-text);
  font-family: inherit;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M0 0l6 8 6-8z' fill='%238C8880'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  outline: none;
}
.ba-mobile-bar .ba-main-count { margin-left: auto; }

/* ── Filter Modal ───────────────────────────── */
.ba-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.ba-modal-overlay.is-open { display: block; }
.ba-modal {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background: var(--ba-card);
  border-radius: 16px 16px 0 0;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.25,.8,.25,1);
}
.ba-modal-overlay.is-open .ba-modal { transform: translateY(0); }
.ba-modal__handle {
  width: 40px;
  height: 4px;
  background: var(--ba-border);
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
}
.ba-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--ba-border);
  flex-shrink: 0;
}
.ba-modal__title { font-size: 16px; font-weight: 700; }
.ba-modal__close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--ba-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.ba-modal__body {
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
}
.ba-modal__footer {
  padding: 16px 20px;
  border-top: 1px solid var(--ba-border);
  flex-shrink: 0;
  display: flex;
  gap: 10px;
}
.ba-modal__apply {
  flex: 1;
  padding: 14px;
  background: var(--ba-green);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}
.ba-modal__clear {
  padding: 14px 20px;
  background: transparent;
  color: var(--ba-muted);
  font-size: 14px;
  border: 1px solid var(--ba-border);
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1100px) {
  .ba-origin-grid { grid-template-columns: repeat(4, 1fr); }
  .bc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  :root { --ba-hero-h: 480px; }
  .ba-hero-nav { padding: 0 20px; }
  .ba-hero-nav__links { display: none; }
  .ba-hero-nav__menu-btn { display: inline-flex; }
  .ba-hero__inner { padding: 80px 20px 40px; }
  /* モバイルは上から下へのグラデーション */
  .ba-hero__overlay {
    background: linear-gradient(
      to bottom,
      rgba(8,18,8,.75)  0%,
      rgba(8,18,8,.88)  40%,
      rgba(8,18,8,.96)  70%,
      rgba(8,18,8,.98) 100%
    );
  }
  .ba-types { gap: 10px; }
  .ba-group-grid { grid-template-columns: repeat(2, 1fr); }
  .ba-results { grid-template-columns: 1fr; }
  .ba-sidebar { display: none; }
  .ba-mobile-bar { display: flex; flex-wrap: wrap; }
  .bc-grid { display: none; }
  .ba-mobile-list { display: flex; flex-direction: column; gap: 10px; }
}
@media (max-width: 600px) {
  .ba-hero__title { font-size: 26px; }
  .ba-types { grid-template-columns: 1fr; }
  .ba-type-card { min-height: 140px; }
  .ba-origin-grid { grid-template-columns: repeat(4, 1fr); }
  .bc-card-pop { flex: 0 0 160px; }
}
@media (min-width: 861px) {
  .ba-mobile-list { display: none; }
}
