/* ============================================
   資材ダウンロードページ (materials.html / materials/download.html)
   ============================================
   カラーは style.css / movie.css / seminar.css と共通:
     見出し #063179 / リンク #0E5394 / 淡色 #E4EBF9 / 補助テキスト #4a6280
   フォーム・完了表示・手順 (sem-steps) は seminar.css / movie.css のクラスを共用する。
*/

/* ---------- カードグリッド ---------- */

.mat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px 24px;
  align-items: stretch;
}

.mat-empty {
  color: #777;
  font-size: 14px;
  padding: 24px 0;
  text-align: center;
}

/* ---------- カード ---------- */

.mat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1.5px solid #e1e7f0;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(6, 49, 121, 0.05);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.mat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(6, 49, 121, 0.14);
  border-color: #c9d5e8;
}

.mat-card.is-selected {
  border-color: #1f5fa8;
  box-shadow: 0 0 0 3px rgba(31, 95, 168, 0.16), 0 12px 28px rgba(6, 49, 121, 0.12);
}

/* サムネイル（表紙）: 淡色の背景に冊子風の影付きで表示 */
.mat-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  padding: 22px 24px 0;
  background:
    radial-gradient(120% 90% at 50% 110%, rgba(255, 255, 255, 0.9), rgba(228, 235, 249, 0.6) 60%, #e4ebf9 100%);
  overflow: hidden;
}

.mat-thumb img {
  display: block;
  max-width: 62%;
  max-height: 100%;
  width: auto;
  height: auto;
  align-self: end;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 10px 26px rgba(6, 49, 121, 0.22), 0 2px 6px rgba(6, 49, 121, 0.12);
  transition: transform 0.35s;
}

.mat-card:hover .mat-thumb img {
  transform: translateY(-4px);
}

.mat-kind {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: #063179;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.5;
}

.mat-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 10px;
  padding: 18px 20px 20px;
}

.mat-title {
  margin: 0;
  color: #063179;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.mat-subtitle {
  margin: -4px 0 0;
  color: #4a6280;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.mat-desc {
  margin: 0;
  color: #33415c;
  font-size: 14px;
  line-height: 1.8;
}

.mat-audience {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid #063179;
  background: #f5f8fd;
  border-radius: 0 6px 6px 0;
  color: #33415c;
  font-size: 13px;
  line-height: 1.7;
}

.mat-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}

.mat-meta li {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: #eef2f9;
  color: #4a6280;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ---------- 選択トグル（チェックボックス） ---------- */

.mat-select {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 12px 14px;
  border: 1.5px solid #c9d5e8;
  border-radius: 10px;
  background: #fff;
  color: #063179;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.mat-select:hover {
  background: #f5f8fd;
  border-color: #1f5fa8;
}

.mat-select input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.mat-select-box {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid #9fb1cc;
  border-radius: 6px;
  background: #fff;
  color: #fff;
  transition: background 0.15s, border-color 0.15s;
}

.mat-select-box svg {
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s, transform 0.15s;
}

.mat-select input:checked ~ .mat-select-box {
  background: #1f5fa8;
  border-color: #1f5fa8;
}

.mat-select input:checked ~ .mat-select-box svg {
  opacity: 1;
  transform: scale(1);
}

.mat-select input:focus-visible ~ .mat-select-box {
  outline: 3px solid rgba(42, 92, 200, 0.35);
  outline-offset: 2px;
}

.mat-card.is-selected .mat-select {
  background: #1f5fa8;
  border-color: #1f5fa8;
  color: #fff;
}

.mat-card.is-selected .mat-select-box {
  background: #fff;
  border-color: #fff;
  color: #1f5fa8;
}

.mat-select-text::before {
  content: "この資材を希望する";
}

.mat-card.is-selected .mat-select-text::before {
  content: "選択中（クリックで解除）";
}

/* ---------- 申し込みフォーム: 選択中の資材 ---------- */

.mat-selected-summary {
  padding: 14px 18px;
  border-radius: 10px;
  background: #f5f8fd;
  border: 1px solid #d5dce8;
}

.mat-selected-summary-title {
  margin: 0 0 6px;
  color: #063179;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.mat-selected-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.mat-selected-list li {
  position: relative;
  padding-left: 1.2em;
  color: #33415c;
  font-size: 14px;
  line-height: 1.7;
}

.mat-selected-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #1f5fa8;
  font-weight: 700;
}

.mat-selected-empty {
  margin: 0;
  color: #b3261e;
  font-size: 14px;
  line-height: 1.7;
}

.mat-selected-empty a {
  color: #0E5394;
  text-decoration: underline;
}

/* ---------- ダウンロードページ ---------- */

.mat-dl-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.mat-dl-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid #d5dce8;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(6, 49, 121, 0.04);
}

.mat-dl-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.mat-dl-info .mat-kind {
  position: static;
  justify-self: start;
}

.movie-page p.mat-dl-title {
  margin: 0;
  color: #063179;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.movie-page p.mat-dl-file {
  margin: 0;
  color: #4a6280;
  font-size: 12.5px;
  line-height: 1.6;
  word-break: break-all;
}

.mat-dl-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 999px;
  background: #1f5fa8;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(6, 49, 121, 0.2);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.mat-dl-btn:hover {
  background: #174b86;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(6, 49, 121, 0.28);
  opacity: 1;
}

.mat-dl-btn.is-disabled {
  background: #c9d5e8;
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

@media (max-width: 600px) {
  .mat-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .mat-thumb {
    aspect-ratio: 16 / 10;
    padding: 18px 20px 0;
  }
  .mat-thumb img {
    max-width: 44%;
  }
  .mat-body {
    padding: 16px 16px 18px;
  }
  .mat-title {
    font-size: 16px;
  }
  .mat-dl-item {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }
  .mat-dl-btn {
    justify-content: center;
  }
}
