/* =========================================================
   brand.css (brand.html)
   - Logo grid + Text list + Search filter
   - Scoped by .brand-page
   ========================================================= */

/* =========================================================
   Layout / Base
   ========================================================= */

.brand-page {
  padding-bottom: 44px;
}

.brand-page .brand-filter {
  box-sizing: border-box;
}

.brand-page .brand-logos,
.brand-page .brand-list,
.brand-page .brand-filter {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.brand-page .page-hero {
  max-width: 980px;
  margin-bottom: 20px;
  padding-left: 20px;
  padding-right: 20px;
  height: auto;
  min-height: 0;
}

.brand-page .page-hero {
  margin-top: 0;
  padding-top: 0;
}

.brand-page .page-lead {
  margin: 0;
  line-height: 1.7;
}

/* Section headings */
.brand-page .section-head {
  margin-top: 40px;
  margin-bottom: 10px;
}

.brand-page .section-title {
  margin: 0;
  color: var(--prm-gold);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.section-title i {
  margin-right: 6px;
  font-size: 0.9em;
  vertical-align: middle;
}


/* =========================================================
   Search / Filter (publisher-like card)
   ========================================================= */

.brand-filter {
  margin-top: 0;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid var(--prm-gray);
  border-radius: 2px;
  background: #fff;

  /* iOS Safari / overflow safety */
  min-width: 0;
}

.brand-filter__label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--prm-gold);
}

.brand-filter__box {
  position: relative;
  min-width: 0;
}

.brand-filter__input {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  padding: 0 40px 0 12px;
  border: 1px solid var(--prm-gray);
  border-radius: 2px;
  font-size: 14px;
  outline: none;
}

.brand-filter__input:focus {
  border-color: var(--prm-gold);
}

.brand-filter__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.brand-filter__clear {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 1px solid var(--prm-gray);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  line-height: 26px;
  font-size: 16px;
  color: var(--prm-subtext);
}

.brand-filter__clear:hover {
  border-color: var(--prm-gold);
  color: var(--prm-gold);
}

.brand-filter__hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--prm-subtext);
}

/* Count line */
.search-count {
  margin: 6px 0 0;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--prm-text-sub, #666);
}

#searchCountNum {
  font-variant-numeric: tabular-nums;
}

/* Sticky search bar
.brand-filter {
  position: sticky;
  top: 6px;
  z-index: 20;
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.92);
}
*/


/* =========================================================
   Kana navigation (index buttons)
   ========================================================= */

.brand-page .brand-kana {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 14px 0 18px;
  padding: 0;
  overflow-x: visible;
}

@media (max-width: 768px) {
  .brand-page .brand-kana {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
  }
}

.brand-kana__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--prm-gray);
  border-radius: 2px;
  background: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--prm-gold);
}

.brand-kana__btn:hover {
  border-color: var(--prm-gold);
  background: var(--prm-ivory);
  color: var(--prm-gold);
}

.brand-kana__btn:active {
  transform: translateY(1px);
}

.brand-kana__btn:focus-visible {
  outline: 2px solid var(--prm-gold);
  outline-offset: 2px;
}

.brand-page .brand-kana {
  background: transparent;
}


/* =========================================================
   Logo grid
   ========================================================= */

.brand-grid {
  list-style: none;
  margin-bottom: 80px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 39px 14px;
}

/* Card */
.brand-card {
  margin: 0;
}

.brand-card__link {
  display: block;
  height: 100%;
  padding: 12px 12px 10px;
  border: 1px solid #e2e2e2;
  border-radius: 2px;
  background: #fff;
  text-decoration: none;
}

.brand-card.is-disabled {
  opacity: 0.88; /* subtle difference, not unavailable */
}

.brand-card.is-disabled .brand-card__link {
  cursor: default;
}

.brand-card__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  margin-bottom: 8px;
}

.brand-card__logo img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 52px;
}

.brand-card__name {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  color: #222;
}

.brand-card__en {
  display: block;
  font-size: 11px;
  line-height: 1.35;
  color: #666;
}

.brand-card.is-text .brand-card__logo {
  display: none;
}

.brand-card__link:hover,
.brand-card__link:focus-visible {
  border-color: #bdbdbd;
}


/* =========================================================
   Text list
   ========================================================= */

.brand-list__wrap {
  margin-top: 10px;
}

/* Group section (ア / カ / サ...) */
.brand-group {
  margin: 22px 0 26px;
  scroll-margin-top: 16px;
}

.brand-group__title {
  margin: 0 0 10px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--prm-gray);
  color: var(--prm-gold);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.brand-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px 16px;
}

.brand-line {
  margin: 0;
}

/* Row layout (4 columns) */
.brand-line__link {
  display: grid;
  grid-template-columns: 1.4fr 1.3fr 1.8fr 0.6fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 2px;
  text-decoration: none;
}

.brand-line__col {
  min-width: 0;
}

.brand-line__en {
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #666;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.brand-line__jp {
  color: #222;
}

.brand-line__item {
  color: #444;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.4;
}

.brand-line__country {
  color: #666;
  text-align: right;
  white-space: nowrap;
}

.brand-line__link:hover,
.brand-line__link:focus-visible {
  background: #f4f4f4;
}

/* Empty state */
.brand-empty {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid #e2e2e2;
  border-radius: 2px;
  background: #fafafa;
  color: #333;
  line-height: 1.7;
}


/* =========================================================
   Responsive
   ========================================================= */

/* Tablet */
@media (max-width: 1024px) {
  .brand-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .brand-lines {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* iPad mini / smaller tablets */
@media (max-width: 820px) {
  .brand-page .page-hero,
  .brand-page .brand-logos,
  .brand-page .brand-list,
  .brand-page .brand-filter {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-grid {
    gap: 12px;
  }

  .brand-page .brand-lines {
    gap: 12px 20px;
  }

  .brand-page .brand-line__link {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .brand-page .brand-line__country {
    text-align: left;
  }

  .brand-page .brand-line__link {
    margin-bottom: 15px;
  }

  /* Mid width: make typography closer to mobile */
  .brand-page .brand-line__en {
    font-size: 16px;
    line-height: 1.4;
    font-weight: 500;
    margin-bottom: 2px;
  }

  .brand-page .brand-line__jp {
    font-size: 11.5px;
    line-height: 1.35;
    color: #666;
    margin-bottom: 4px;
  }

  .brand-page .brand-line__item {
    font-size: 12.5px;
    line-height: 1.35;
    color: #555;
  }

  .brand-page .brand-line__country {
    font-size: 12.5px;
    color: #777;
  }

  .brand-page .brand-line__jp {
    font-size: 12px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .brand-group__title {
    font-size: 22px;
  }

  .brand-group {
    scroll-margin-top: 72px;
  }

  /* iOS: input 16px to avoid zoom */
  @supports (-webkit-touch-callout: none) {
    .brand-filter__input {
      font-size: 16px;
    }
  }
}

@media (max-width: 520px) {
  .brand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .brand-card__logo {
    height: 46px;
  }

  .brand-card__logo img {
    max-height: 46px;
  }

  .brand-lines {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  /* Single-column row on small screens */
  .brand-line__link {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .brand-line__link {
    margin-bottom: 15px;
  }

  .brand-line__country {
    text-align: left;
  }

  .brand-line__en {
    font-size: 16px;
    line-height: 1.4;
    font-weight: 500;
    margin-bottom: 2px;
  }

  .brand-line__jp {
    font-size: 11.5px;
    line-height: 1.35;
    color: #666;
    margin-bottom: 4px;
  }

  .brand-line__item {
    font-size: 12.5px;
    line-height: 1.35;
    color: #555;
  }

  .brand-line__country {
    font-size: 12.5px;
    color: #777;
  }
}