/* =============================================
   専門家一覧・詳細ページCSS
   ============================================= */

/* h1アイコン */
h1 .h1-icon { display: inline-block; width: 1em !important; height: 1em !important; vertical-align: -0.1em; margin-right: 6px; color: currentColor; }

/* フィルター */
.expert-filters {
  margin-bottom: 32px;
}
.expert-filter-form {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.expert-filter-form .form-control {
  width: auto;
  min-width: 180px;
}
.expert-filter-form .select-wrapper {
  display: inline-block;
  width: auto;
}
.expert-filter-form .select-wrapper select {
  width: 100%;
}
@media (max-width: 640px) {
  .expert-filter-form {
    flex-wrap: wrap;
    gap: 8px;
  }
  .expert-filter-form .select-wrapper {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }
  .expert-filter-form .form-control {
    min-width: 0;
    font-size: .8rem;
  }
  .license-badges {
    width: 100%;
    gap: 6px;
  }
  .license-badge {
    padding: 5px 12px;
    font-size: .75rem;
  }
}
.license-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.license-badge {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-primary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.license-badge:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.license-badge.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

/* グリッド */
.expert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}
@media (max-width: 1024px) { .expert-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .expert-grid { grid-template-columns: 1fr; } }

/* カード */
.expert-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition), transform var(--transition);
  color: var(--text-primary);
  overflow: hidden;
}
.expert-card:hover {
  color: var(--text-primary);
}
.expert-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 0;
}
.expert-card-photo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-surface), var(--bg-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--bg-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.expert-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.expert-card-photo.is-logo {
  background: #fff;
  border-radius: var(--radius-md, 12px);
}
.expert-card-photo.is-logo img {
  object-fit: cover;
  transform: scale(1.4);
}
.expert-card-photo-icon {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
}
.expert-card-intro {
  flex: 1;
  min-width: 0;
}
.expert-card-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.expert-card-name {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  flex: 1;
  min-width: 0;
}
.expert-card-name-row .fav-btn {
  flex-shrink: 0;
  position: static;
}
.expert-card-office {
  font-size: .8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.expert-card-body {
  padding: 14px 20px 20px;
}
.expert-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.expert-card-meta .badge-primary {
  font-size: .75rem;
}
.expert-card-location {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: .8rem;
  color: var(--text-secondary);
}
.expert-card-location i,
.expert-card-location svg { width: 13px !important; height: 13px !important; flex-shrink: 0; }
.expert-card-phone {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .85rem;
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 10px;
}
.expert-card-phone i,
.expert-card-phone svg { width: 14px !important; height: 14px !important; flex-shrink: 0; }
.expert-card-products,
.expert-card-cases {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.expert-card-products svg,
.expert-card-cases svg { width: 14px !important; height: 14px !important; flex-shrink: 0; }
.expert-card-bio {
  font-size: .8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.expert-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
}
.expert-card-cta {
  display: block;
  text-align: center;
  padding: 10px;
  background: var(--accent-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: .875rem;
  font-weight: 600;
  transition: background var(--transition);
  white-space: nowrap;
}
.expert-card:hover .expert-card-cta {
  background: var(--accent-primary-dark, var(--accent-primary));
}

/* カード（レガシー横型：header無しフォールバック） */
.expert-card:not(:has(.expert-card-header)) {
  flex-direction: row;
  gap: 16px;
  padding: 20px;
}
.expert-card:not(:has(.expert-card-header)) .expert-card-photo {
  width: 60px;
  height: 60px;
  border: none;
  box-shadow: none;
}
.expert-card:not(:has(.expert-card-header)) .expert-card-body {
  padding: 0;
  flex: 1;
  min-width: 0;
}

/* =============================================
   記事内専門家セクション
   ============================================= */
.experts-section {
  margin: 48px 0 40px;
}
.experts-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 700;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-primary);
  margin-bottom: 8px;
}
.experts-section-title i,
.experts-section-title svg { width: 22px; height: 22px; flex-shrink: 0; color: var(--accent-primary); }
.experts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.experts-section-more {
  text-align: center;
  margin-top: 20px;
}
@media (max-width: 640px) {
  .experts-grid { grid-template-columns: 1fr; }
}

/* 詳細ページ */
.expert-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
}
.expert-detail-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}
.expert-detail-photo {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--border-color);
}
.expert-detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.expert-detail-photo.is-logo {
  background: #fff;
  border-radius: var(--radius-md, 12px);
}
.expert-detail-photo.is-logo img {
  object-fit: cover;
  transform: scale(1.4);
}
.expert-detail-info h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.expert-detail-license {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.expert-detail-office,
.expert-detail-location,
.expert-detail-phone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.expert-detail-office i,
.expert-detail-location i,
.expert-detail-phone i,
.expert-detail-office svg,
.expert-detail-location svg,
.expert-detail-phone svg { width: 16px !important; height: 16px !important; flex-shrink: 0; }
.expert-detail-phone a {
  color: var(--accent-primary);
  font-weight: 600;
}

.expert-detail-section {
  margin-bottom: 32px;
}
.expert-detail-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.expert-detail-section h2 i { width: 18px; height: 18px; flex-shrink: 0; }
.expert-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.expert-detail-bio {
  font-size: .95rem;
  line-height: 1.8;
  color: var(--text-secondary);
}
.expert-detail-cta {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  margin-top: 40px;
}
.expert-detail-cta h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.expert-detail-cta p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .expert-detail-header { flex-direction: column; align-items: center; text-align: center; }
  .expert-detail-license { justify-content: center; }
}

/* =============================================
   一括相談機能
   ============================================= */
.expert-card-wrap {
  position: relative;
}
.expert-card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 28px;
  height: 28px;
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.expert-card-check input { display: none; }
.expert-card-check i,
.expert-card-check svg { width: 16px; height: 16px; color: #fff; stroke: #fff; display: none; }
.expert-card-check:hover { border-color: var(--accent-primary); }
.expert-card-check input:checked ~ i,
.expert-card-check input:checked ~ svg { display: block; }
.expert-card-check:has(input:checked) {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}
.expert-card-wrap:has(input:checked) .expert-card {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(var(--accent-primary-rgb), .2);
}

.bulk-consult-guide {
  margin-bottom: 20px;
}
.bulk-consult-guide-count {
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.bulk-consult-guide-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .875rem;
  color: var(--text-tertiary);
  margin: 0;
}
.bulk-consult-guide-text i,
.bulk-consult-guide-text svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent-primary);
  stroke: var(--accent-primary);
}

.bulk-consult-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 20px rgba(0,0,0,.1);
  padding: 12px 16px;
  animation: bulkBarSlideUp .2s ease-out;
}
@keyframes bulkBarSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.bulk-consult-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.bulk-consult-count {
  font-weight: 600;
  font-size: .95rem;
  color: var(--text-primary);
}
