/* =============================================
   SIL Evangelist / Researcher Page
   デザイン版: ページ固有レイアウト・コンポーネント
   依存: sil-design-tokens.css, sil-components.css
   ============================================= */

/* --- Title tag tokens (2-tone: 役職系 / 資格系) --- */
.designLP {
  --t-title-c: #1a5296;      --t-title-bg: #e8f0fe;
  --t-sec-c: #00695c;        --t-sec-bg: #e0f2f1;
}

/* ============================================================
   TITLE BADGES (shared between featured & wp cards)
   ============================================================ */
/* 役職系（青） */
.designLP .badge.fellow,
.designLP .badge.chief-sc,
.designLP .badge.senior,
.designLP .badge.special,
.designLP .badge.associate       { background: var(--t-title-bg); color: var(--t-title-c); }

/* 資格系（ティール） */
.designLP .badge.sec-master,
.designLP .badge.sec-principal   { background: var(--t-sec-bg);   color: var(--t-sec-c); }

/* Filter button colors (matching 2-tone badges) */
.designLP .lib-filter__btn[data-filter="fellow"],
.designLP .lib-filter__btn[data-filter="chief-sc"],
.designLP .lib-filter__btn[data-filter="senior-special"],
.designLP .lib-filter__btn[data-filter="special"],
.designLP .lib-filter__btn[data-filter="associate-special"] { --_fc: var(--t-title-c); }
.designLP .lib-filter__btn[data-filter="security-master"],
.designLP .lib-filter__btn[data-filter="security-principal"]{ --_fc: var(--t-sec-c); }

/* Filter buttons: title filters on the first row, security filters on the second */
.designLP .lib-filter__btns {
  display: block;
}
.designLP .lib-filter__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.designLP .lib-filter__row + .lib-filter__row {
  margin-top: 10px;
}

/* ============================================================
   RESEARCHER CARD GRID
   ============================================================ */

/* Grid override: 3 columns, card layout with gap */
.designLP .wp-grid:has(.wp-card--researcher) {
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 30px;
  border-top: none;
}

/* Card: flexbox column + photo absolutely positioned top-right.
   Name / tags avoid photo with padding-right.
   Keywords / theme sit below, full width — never affected by photo. */
.designLP .wp-card--researcher {
  cursor: pointer;
  position: relative;
  flex-direction: column;
  background: #fff;
  border: none;
  border-radius: var(--dlp-radius, 12px);
  box-shadow: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  overflow: visible;
  padding: 24px 24px 20px;
  transition: transform .22s, box-shadow .22s;
}

/* Researcher card is the link itself */
.designLP a.wp-card--researcher {
  color: inherit;
  text-decoration: none;
}
.designLP a.wp-card--researcher:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--dlp-primary) 45%, transparent);
  outline-offset: 3px;
}
.designLP a.wp-card--researcher .wp-go {
  pointer-events: none;
}

/* Body: flex column, stretches to fill card height */
.designLP .wp-card--researcher .wp-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0;
}

/* Photo: absolute, out of flow */
.designLP .wp-card--researcher .wp-thumb {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 85px;
  height: 85px;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
}
.designLP .wp-card--researcher .wp-thumb img {
  position: absolute;
  top: 0;
  bottom: auto;
  left: 50%;
  right: auto;
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: contain;
  border-radius: 50%;
  transform: translateX(-50%);
}

/* Photo helpers: use only when the source image needs individual adjustment */
.designLP .wp-card--researcher .wp-thumb.thumb-zoom-sm img {
  transform: translateX(-50%) scale(1.08);
}
.designLP .wp-card--researcher .wp-thumb.thumb-zoom-md img {
  transform: translateX(-50%) scale(1.16);
}
.designLP .wp-card--researcher .wp-thumb.thumb-zoom-lg img {
  transform: translateX(-50%) scale(1.24);
}
.designLP .wp-card--researcher .wp-thumb.thumb-pos-up img { top: -4%; }
.designLP .wp-card--researcher .wp-thumb.thumb-pos-down img { top: 4%; }

/* Optional photo backgrounds */
.designLP .wp-card--researcher .wp-thumb.thumb-bg-gray {
  background: linear-gradient(145deg, #e9edf1, #cbd2d9 58%, #e2e6ea);
}
.designLP .wp-card--researcher .wp-thumb.thumb-bg-blue {
  background: linear-gradient(145deg, #e6eef6, #c5d7e6 58%, #e0eaf2);
}
.designLP .wp-card--researcher .wp-thumb.thumb-bg-beige {
  background: linear-gradient(145deg, #eee9df, #d8cdbd 58%, #e9e2d7);
}
.designLP .wp-card--researcher .wp-thumb.thumb-bg-green {
  background: linear-gradient(145deg, #e4efeb, #c4d9d1 58%, #dce9e4);
}

/* Name: first via order, avoid photo */
.designLP .wp-card--researcher .wp-name {
  order: -1;
  padding-right: 99px; /* 85 photo + 14 gap */
  font-size: 18px;
  font-weight: 700;
  color: var(--dlp-ink);
  margin-bottom: 12px;
  line-height: 1.3;
}

/* Tags: avoid photo, min 2-line height for alignment */
.designLP .wp-card--researcher .wp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-content: flex-start;
  padding-right: 99px;
  min-height: 36px; /* ≈ badge 2 lines */
}
.designLP .wp-card--researcher .badge {
  font-size: 10.5px;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: .01em;
}

/* Theme / Keywords: full card width, never pushed by photo */
.designLP .wp-card--researcher .wp-keywords {
  order: 1;
  margin-top: 12px;
  margin-bottom: 0;
  padding-top: 12px;
  border-top: 1px solid var(--dlp-line-2);
  font-size: 13.5px;
  line-height: 1.65;
  font-weight: 600;
  color: var(--dlp-primary);
}

.designLP .wp-card--researcher .wp-bottom {
  order: 2;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--dlp-line-2);
}

/* If keywords exist, let their divider serve the whole lower area */
.designLP .wp-card--researcher .wp-keywords + .wp-bottom {
  padding-top: 0;
  border-top: 0;
}

.designLP .wp-card--researcher .wp-bottom .wp-theme {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  border-top: 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: #333b46;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Theme-only cards can use four lines and keep four lines' minimum height */
.designLP .wp-card--researcher:not(:has(.wp-keywords)) .wp-theme {
  -webkit-line-clamp: 4;
  min-height: calc(1.7em * 4);
}

/* Arrow sits at the lower right beside the theme */
.designLP .wp-card--researcher .wp-bottom .wp-go {
  flex: 0 0 auto;
  margin: 0 0 1px auto;
}

/* Hidden state for filter */
.designLP .wp-card--researcher.is-hidden {
  display: none;
}

/* No Results Message */
.designLP .filter-no-results {
  display: none;
  text-align: center;
  padding: 3em 1em;
  color: var(--dlp-ink-3);
  font-size: 15px;
  width: 100%;
  grid-column: 1 / -1;
}
.designLP .filter-no-results.is-visible {
  display: block;
}

/* ============================================================
   PAGE-SPECIFIC TYPOGRAPHY TUNING
   Researcher page readability adjustments
   ============================================================ */

/* ============================================================
   LEAD / DESCRIPTION TEXT
   ============================================================ */
.designLP .lib-desc {
  margin-top: 32px;
}

/* Keep the Researcher description and filter visually separated. */
.designLP .lib-desc + .lib-filter {
  margin-top: 32px;
}
/* Researcher page only: slightly denser than the shared section lead because the description is long. */
.pageLaboratoryOrganization .sec-lead {
  font-size: 17.5px;
  font-weight: 400;
  max-width: 880px;
}

.pageLaboratoryOrganization .sec-lead strong {
  color: var(--dlp-body-color);
  font-weight: 600;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .designLP .wp-card--researcher .wp-thumb {
    top: 10px;
    right: 10px;
  }
}
@media (max-width: 860px) {
  /* Researcher grid: 2 columns */
  .designLP .wp-grid:has(.wp-card--researcher) {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 8px;
  }
  .designLP .wp-card--researcher {
    padding: 20px 18px 16px;
  }
  .designLP .wp-card--researcher .wp-thumb {
    top: 8px;
    right: 10px;
    width: 72px;
    height: 72px;
  }
  .designLP .wp-card--researcher .wp-name,
  .designLP .wp-card--researcher .wp-tags {
    padding-right: 86px; /* 72 photo + 14 gap */
  }
  .designLP .wp-card--researcher .wp-name {
    font-size: 16px;
  }
  .designLP .wp-card--researcher .wp-tags {
    min-height: auto;
  }

  /*SP版の称号説明を16pxに*/
  .pageLaboratoryOrganization .sec-lead {
    font-size: 16px;
  }
}
@media (max-width: 520px) {
  /* Researcher grid: 1 column */
  .designLP .wp-grid:has(.wp-card--researcher) {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .designLP .wp-card--researcher {
    padding: 22px 16px;
  }
}
