/* =========================================================
   AWS学習ナビ - affiliate.css (アフィリエイトカード専用)
   Amazonアソシエイト / Udemy 教材カード
   ========================================================= */

/* ---------- インライン書籍カード（本文中） ---------- */
.affiliate-card {
  display: flex; gap: 16px; align-items: stretch;
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin: 26px 0; position: relative; overflow: hidden;
}
.affiliate-card::before {
  content: "PR"; position: absolute; top: 10px; right: 12px;
  font-size: .65rem; font-weight: 800; letter-spacing: .08em; color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; background: var(--bg);
}
.affiliate-card .ac-cover {
  flex: 0 0 110px; width: 110px; border-radius: var(--radius-sm); overflow: hidden;
  background: var(--bg-elev); box-shadow: var(--shadow-sm);
}
.affiliate-card .ac-cover img { width: 100%; height: 100%; object-fit: cover; }
.affiliate-card .ac-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.affiliate-card .ac-tag {
  font-size: .7rem; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .06em;
}
.affiliate-card .ac-title { font-size: 1.02rem; font-weight: 700; margin: 0; color: var(--text); line-height: 1.4; }
.affiliate-card .ac-author { font-size: .82rem; color: var(--text-muted); margin: 0; }
.affiliate-card .ac-desc { font-size: .85rem; color: var(--text-muted); margin: 0; }
.affiliate-card .ac-cta { margin-top: auto; }
.affiliate-card .ac-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: #0f1117; font-weight: 800; font-size: .85rem;
  padding: 9px 16px; border-radius: var(--radius-sm); transition: .15s;
}
.affiliate-card .ac-btn:hover { background: var(--accent-2); color: #0f1117; }
.affiliate-card .ac-btn::before { content: ""; width: 14px; height: 14px; background: #0f1117;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 4h-2l-1 2v2h2l3.6 7.6-1.4 2.5c-.2.3-.2.7 0 1 .2.3.5.4.8.4h11v-2h-10.4l1-2h7.5c.4 0 .7-.2.9-.6l3.4-7c.1-.3.1-.6-.1-.9-.2-.2-.5-.3-.8-.3h-14.7l-.9-2zm0 16a2 2 0 100 4 2 2 0 000-4zm12 0a2 2 0 100 4 2 2 0 000-4z'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M7 4h-2l-1 2v2h2l3.6 7.6-1.4 2.5c-.2.3-.2.7 0 1 .2.3.5.4.8.4h11v-2h-10.4l1-2h7.5c.4 0 .7-.2.9-.6l3.4-7c.1-.3.1-.6-.1-.9-.2-.2-.5-.3-.8-.3h-14.7l-.9-2zm0 16a2 2 0 100 4 2 2 0 000-4zm12 0a2 2 0 100 4 2 2 0 000-4z'/></svg>") center/contain no-repeat; }

/* ---------- おすすめ教材セクション（2×2グリッド） ---------- */
.materials-section { margin: 40px 0; padding: 24px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); }
.materials-section .ms-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.materials-section .ms-head h3 { margin: 0; font-size: 1.25rem; }
.materials-section .ms-head .ms-icon { font-size: 1.4rem; }
.materials-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.material-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; transition: .18s; position: relative;
}
.material-card:hover { border-color: rgba(255,153,0,.45); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.material-card .mc-top { display: flex; gap: 12px; }
.material-card .mc-cover { flex: 0 0 76px; width: 76px; border-radius: 6px; overflow: hidden; background: var(--bg-elev); }
.material-card .mc-cover img { width: 100%; height: 100%; object-fit: cover; }
.material-card .mc-type {
  font-size: .68rem; font-weight: 800; padding: 2px 8px; border-radius: 999px;
  align-self: flex-start; letter-spacing: .04em;
}
.material-card .mc-type.book   { color: var(--accent); border: 1px solid rgba(255,153,0,.4); }
.material-card .mc-type.udemy  { color: var(--purple); border: 1px solid rgba(168,85,247,.4); }
.material-card .mc-title { font-size: .92rem; font-weight: 700; margin: 0; line-height: 1.4; color: var(--text); }
.material-card .mc-meta { font-size: .78rem; color: var(--text-muted); margin: 0; }
.material-card .mc-rating { color: var(--accent); font-size: .82rem; letter-spacing: .04em; }
.material-card .mc-btn {
  margin-top: auto; text-align: center; background: var(--bg-card-2); border: 1px solid var(--border);
  color: var(--text); font-weight: 700; font-size: .82rem; padding: 9px; border-radius: var(--radius-sm); transition: .15s;
}
.material-card .mc-btn:hover { background: var(--accent); border-color: var(--accent); color: #0f1117; }

/* ---------- サイドバー書籍ウィジェット ---------- */
.book-widget-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.book-widget-item:last-child { border-bottom: 0; }
.book-widget-item .bw-cover { flex: 0 0 56px; width: 56px; border-radius: 5px; overflow: hidden; background: var(--bg-elev); }
.book-widget-item .bw-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-widget-item .bw-body { min-width: 0; }
.book-widget-item .bw-title { font-size: .85rem; font-weight: 700; color: var(--text); margin: 0 0 3px; line-height: 1.35; }
.book-widget-item .bw-title a { color: var(--text); }
.book-widget-item .bw-title a:hover { color: var(--accent); }
.book-widget-item .bw-link { font-size: .76rem; color: var(--accent); font-weight: 700; }

/* PRラベル（ウィジェット用） */
.pr-note { font-size: .7rem; color: var(--text-dim); margin-top: 8px; }
.pr-note::before { content: "※ "; }
