/* CRM資料一覧領域専用CSS。#crm-public-resources 配下にのみ影響する。
   breadcrumb/h1/lead-box/section-innerは本家CSS（common.css/page.css）が
   スタイルするため、ここでは新規要素（ピル・カードグリッド）だけを定義する。 */

#crm-public-resources .crm-public-resources__body {
  padding-top: 0;
}

#crm-public-resources .crm-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 32px;
}

#crm-public-resources .crm-pill {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 10px;
  font-size: 14px;
  background: #ddd;
  color: #333;
  text-decoration: none;
}

#crm-public-resources .crm-pill--active {
  background: #a9132c;
  color: #fff;
}

#crm-public-resources .crm-empty {
  margin-top: 40px;
  color: #666;
}

#crm-public-resources .crm-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 20px;
}

#crm-public-resources .crm-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  font-size: 14px;
}

#crm-public-resources .crm-pagination a:first-child { justify-self: start; }
#crm-public-resources .crm-pagination a:last-child { justify-self: end; }
#crm-public-resources .crm-pagination a { color: #a9132c; text-decoration: underline; }

@media screen and (min-width: 769px) and (max-width: 1024px) {
  #crm-public-resources .crm-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media all and (min-width: 1025px) {
  #crm-public-resources .crm-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

#crm-public-resources .crm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #bbb;
  background: #fff;
  padding: 20px;
  text-decoration: none;
}

#crm-public-resources .crm-card:hover {
  opacity: 0.8;
}

#crm-public-resources .crm-card__thumb {
  display: flex !important;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9 !important;
  align-items: center;
  justify-content: center;
  overflow: hidden !important;
  background: #f1f0ee;
  color: #666;
}

#crm-public-resources .crm-card__thumb-img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

#crm-public-resources .crm-card__badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  border-radius: 999px;
  background: #f1f0ee;
  padding: 3px 10px;
  margin-top: 12px;
  font-size: 11px;
  font-weight: bold;
  color: #666;
}

#crm-public-resources .crm-card__badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#crm-public-resources .crm-card__badge-row .crm-card__chevron {
  position: static;
  margin-top: 12px;
  transform: none;
  line-height: 1;
}

#crm-public-resources .crm-card__title {
  margin-top: 8px;
  padding-right: 18px;
  font-size: 20px;
  line-height: 1.3;
  color: #444;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#crm-public-resources .crm-card__summary {
  margin-top: 8px;
  padding-right: 18px;
  font-size: 14px;
  color: #666;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#crm-public-resources .crm-card__chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 28px;
  color: #444;
}

@media screen and (max-width: 768px) {
  #crm-public-resources .crm-card__title {
    font-size: 17px;
  }
}

/* 資料詳細ページ */
#crm-public-resources .crm-detail__badge {
  margin-bottom: 8px;
}

#crm-public-resources .crm-detail__list {
  padding-left: 0;
  list-style: none;
}

#crm-public-resources .crm-detail__bullet {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

#crm-public-resources .crm-detail__dot {
  color: #a9132c;
}

#crm-public-resources .crm-detail__toc {
  padding-left: 20px;
}

#crm-public-resources .crm-detail__toc li {
  margin-bottom: 4px;
}

/* 「この資料のポイント」本文（CRMの簡易記法から生成） */
#crm-public-resources .crm-highlights__body h3 {
  margin: 28px 0 10px;
  padding-left: 10px;
  border-left: 4px solid #a9132c;
  font-size: 17px;
  line-height: 1.5;
}

#crm-public-resources .crm-highlights__body h3:first-child {
  margin-top: 0;
}

#crm-public-resources .crm-highlights__body p {
  margin: 0 0 14px;
  line-height: 1.9;
}

#crm-public-resources .crm-highlights__body ul {
  margin: 0 0 14px;
  padding-left: 22px;
  list-style: disc;
}

#crm-public-resources .crm-highlights__body li {
  margin-bottom: 4px;
  line-height: 1.8;
}

#crm-public-resources .crm-highlights__body strong {
  font-weight: bold;
  color: #333;
}

/* 単独CTAボタンの中央寄せ。本家サイト側の.three-columnは3カラムグリッド前提で、
   ボタン1個だけを入れるとグリッドの1カラム目に寄って左右バランスが崩れるため、
   このアプリ側で完全にコントロールできる専用クラスを用意する。 */
#crm-public-resources .crm-single-cta {
  display: flex;
  justify-content: center;
}

/* 資料ダウンロード導線ボタン（本家サイトのRedButtonを模したCTA） */
#crm-public-resources .crm-cta-button {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 300px;
  border: 1px solid #d41224;
  background: #d41224;
  padding: 10px 25px;
  text-align: center;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
  background-image: url('/brand/icon_dainari.png');
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 11px 18px;
}

#crm-public-resources .crm-cta-button:hover {
  background-color: #fff;
  color: #d41224;
  background-image: url('/brand/icon_dainari_hover.png');
}

#crm-public-resources .crm-cta-button:disabled,
#crm-public-resources .crm-cta-button[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* ダウンロードフォーム */
#crm-public-resources .crm-form-field {
  display: block;
  font-size: 14px;
  margin-bottom: 16px;
}

#crm-public-resources .crm-form-field__label {
  font-weight: bold;
  color: #444;
}

#crm-public-resources .crm-form-field__required {
  margin-left: 4px;
  color: #d41224;
  font-size: 12px;
}

#crm-public-resources .crm-form-field input[type="text"],
#crm-public-resources .crm-form-field input[type="email"],
#crm-public-resources .crm-form-field input[type="tel"] {
  display: block;
  width: 100%;
  border: 1px solid #bbb;
  padding: 8px 12px;
  font-size: 14px;
  color: #444;
  margin-top: 4px;
  box-sizing: border-box;
}

#crm-public-resources .crm-form-field--invalid input {
  border-color: #d97706;
  background: #fffbeb;
}

#crm-public-resources .crm-field-error {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #f0b429;
  background: #fff8e6;
  color: #92400e;
  font-size: 12px;
  line-height: 1.5;
}

#crm-public-resources .crm-field-error::before {
  content: "⚠ ";
}

#crm-public-resources .crm-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 16px;
}

@media all and (min-width: 769px) {
  #crm-public-resources .crm-form-grid {
    grid-template-columns: 1fr 1fr;
  }
  #crm-public-resources .crm-form-grid .crm-form-field--full {
    grid-column: 1 / -1;
  }
}

#crm-public-resources .crm-form-checkboxes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

@media all and (min-width: 769px) {
  #crm-public-resources .crm-form-checkboxes {
    grid-template-columns: 1fr 1fr;
  }
}

#crm-public-resources .crm-form-checkboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #bbb;
  padding: 8px 12px;
  font-size: 14px;
  color: #444;
  cursor: pointer;
}

/* 本家サイト側の継承CSSがinput[type=checkbox]に position:absolute（+縮小されるtransform）
   を当てており、flexレイアウトから外れて文字の上に重なって見えていた
   （実測: position:absoluteでlabelの外を基準に配置され、16px指定でも実描画は8x8に縮小）。
   position/transformを明示的に上書きして通常のflexアイテムに戻す。 */
#crm-public-resources .crm-form-checkboxes input[type="checkbox"] {
  position: static !important;
  transform: none !important;
  flex-shrink: 0 !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
}

#crm-public-resources .crm-form-checkboxes label span {
  flex: 1;
  min-width: 0;
}

#crm-public-resources .crm-form-error {
  border: 1px solid #d41224;
  background: #fdecee;
  padding: 12px 16px;
  font-size: 14px;
  color: #d41224;
  margin-bottom: 16px;
}

#crm-public-resources .crm-form-note {
  font-size: 12px;
  line-height: 20px;
  color: #666;
  margin-top: 16px;
}

/* コラム・ナレッジ：検索バー */
#crm-public-resources .crm-search-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

@media all and (min-width: 769px) {
  #crm-public-resources .crm-search-bar {
    flex-direction: row;
  }
}

#crm-public-resources .crm-search-bar__form {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
}

@media all and (min-width: 769px) {
  #crm-public-resources .crm-search-bar__form {
    flex-direction: row;
  }
}

#crm-public-resources .crm-search-bar input[type="text"] {
  flex: 1;
  border: 1px solid #bbb;
  padding: 10px 16px;
  font-size: 14px;
  box-sizing: border-box;
}

#crm-public-resources .crm-search-bar button,
#crm-public-resources .crm-search-bar__link {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #a9132c;
  padding: 10px 24px;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
}

#crm-public-resources .crm-search-bar__clear {
  color: #b20d2f;
  font-size: 13px;
  text-decoration: underline;
  white-space: nowrap;
}

#crm-public-resources .crm-search-bar button {
  background: #a9132c;
  color: #fff;
}

#crm-public-resources .crm-search-bar__link {
  background: #fff;
  color: #333;
}

#crm-public-resources .crm-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
  color: #666;
}

#crm-public-resources h2.crm-section-title {
  margin: 40px 0 20px;
  font-size: 24px;
  font-weight: bold;
  color: #444;
}

/* 著者カード・著者詳細ヘッダー */
#crm-public-resources .crm-author-card {
  display: block;
  border: 1px solid #bbb;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: inherit;
}

#crm-public-resources .crm-author-card:hover {
  opacity: 0.8;
}

#crm-public-resources .crm-author-photo {
  width: 112px;
  height: 112px;
  margin: 0 auto;
  border-radius: 50%;
  overflow: hidden;
  background: #f1f0ee;
}

#crm-public-resources .crm-author-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#crm-public-resources .crm-author-card__name {
  margin-top: 16px;
  font-size: 18px;
  color: #444;
}

#crm-public-resources .crm-author-card__role {
  font-size: 13px;
  color: #666;
}

#crm-public-resources .crm-author-card__profile {
  margin-top: 12px;
  font-size: 13px;
  color: #666;
  text-align: left;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}

#crm-public-resources .crm-author-header {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border: 1px solid #bbb;
  padding: 24px;
  margin-bottom: 40px;
}

@media all and (min-width: 769px) {
  #crm-public-resources .crm-author-header {
    flex-direction: row;
  }
}

#crm-public-resources .crm-author-header .crm-author-photo {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  margin: 0;
}

#crm-public-resources .crm-author-header__profile {
  margin-top: 16px;
  color: #444;
  white-space: pre-line;
}

#crm-public-resources .crm-author-header__expertise {
  margin-top: 16px;
  font-size: 13px;
  color: #666;
  white-space: pre-wrap;
}

/* 記事詳細 */
#crm-public-resources .crm-article__eyecatch {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  margin-bottom: 24px;
}

#crm-public-resources .crm-article__body {
  white-space: pre-wrap;
  line-height: 2;
  color: #444;
}

#crm-public-resources .crm-article__author-card {
  display: flex;
  gap: 16px;
  margin-top: 48px;
  border: 1px solid #bbb;
  padding: 20px;
  text-decoration: none;
  color: inherit;
}

#crm-public-resources .crm-article__author-card:hover {
  opacity: 0.8;
}

#crm-public-resources .crm-article__author-card .crm-author-photo {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  margin: 0;
}
  white-space: pre-line;

/* 資料詳細ページ下部の関連資料（2026-10-11） */
#crm-public-resources .crm-related .crm-grid {
  margin-top: 16px;
}

#crm-public-resources .crm-related__more {
  margin-top: 20px;
  text-align: right;
  font-size: 14px;
}

#crm-public-resources .crm-related__more a {
  color: #a9132c;
}
