/* =========================================================
 * お役立ち資料一覧（archive-download.php）
 * 改修案ワイヤフレーム「お役立ち資料一覧ページ」をもとにした表示
 * ========================================================= */
.da {
  --da-ink: #1b1f1e;
  --da-muted: #5f6866;
  --da-line: #dfe3e0;
  --da-teal: #0f8f8a;
  --da-brand: #00aebb;
  --da-wp: #fdd000;
  color: var(--da-ink);
}
/* テーマの main（overflow:hidden）だと右カラムの追従（sticky）が効かないため、見た目が同じ clip にする */
body.post-type-archive-download .global_contents { overflow: clip; }
.da a { color: inherit; text-decoration: none; }
.da img { display: block; max-width: 100%; }
.da button { font: inherit; color: inherit; }
.da h1, .da h2 { background: none; padding: 0; border: 0; }

/* ---------- 見出し（DOWNLOAD） ---------- */
.da-hero { position: relative; overflow: hidden; background: #f4f4f4; text-align: center; padding: 36px 20px 26px; margin-bottom: 28px; }
.da-hero__bg { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font-size: clamp(56px, 9vw, 104px); font-weight: 900; line-height: 1; color: #fff; white-space: nowrap; pointer-events: none; }
.da .da-hero__h { position: relative; font-size: clamp(26px, 3.4vw, 36px); font-weight: 900; margin: 0 0 10px; line-height: 1.3; letter-spacing: .06em; }
.da-hero__p { position: relative; margin: 0; font-size: 14px; line-height: 1.8; }

.da-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px 64px; }

/* ---------- 2カラム ---------- */
.da-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; }
.da-layout > * { min-width: 0; }
.da-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px; }
.da-main > * { min-width: 0; }

.da-sec__title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.da .da-sec__title h2 { font-size: 19px; margin: 0; padding: 0 !important; line-height: 1.5; } /* テーマの section h2 の左余白を打ち消す */
#download-all { scroll-margin-top: 100px; }

/* ---------- 横スクロールの段（新着資料・よく読まれている資料）：横に3枚、残りは横スクロール ---------- */
.da-rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 32px) / 3); gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.da-rail .da-card { scroll-snap-align: start; }

/* ---------- 資料カード：表紙画像＋種類バッジ・#タグ＋対象 ---------- */
.da-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; color: inherit; }
.da-card[hidden] { display: none; }
.da-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #eef3f2; border: 1px solid var(--da-line); transition: border-color .15s; }
.da-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.da-card:hover .da-thumb { border-color: var(--da-teal); }
.da-card:hover .da-thumb img { transform: scale(1.03); }
.da-thumb__tt { position: absolute; left: 12px; right: 12px; bottom: 10px; font-size: 13px; font-weight: 700; line-height: 1.4; }
.da-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.da-kindrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.da-kind { flex: none; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; border-radius: 4px; padding: 2px 10px; line-height: 1.7; }
.da-kind--sv { background: var(--da-brand); color: #fff; }
.da-kind--wp { background: var(--da-wp); color: #222; }
.da-tags { font-size: 12px; color: var(--da-muted); line-height: 1.6; }
.da-tgt { font-size: 12px; color: var(--da-muted); line-height: 1.6; }

/* ---------- 絞り込み ---------- */
.da-filters { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 16px 18px; border-radius: 10px; background: #f6f7f5; }
.da-frow { display: flex; align-items: flex-start; gap: 10px 16px; min-width: 0; }
.da-flabel { flex: none; width: 6.5em; padding-top: 6px; font-size: 12px; font-weight: 700; color: var(--da-muted); }
.da-chips, .da-tagset { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; flex: 1; }
.da .da-chip { border: 1px solid var(--da-line); background: #fff; border-radius: 999px; padding: 5px 14px; font-size: 13px; line-height: 1.5; cursor: pointer; }
.da .da-chip[aria-pressed="true"] { background: var(--da-ink); border-color: var(--da-ink); color: #fff; }
.da .da-tag { border: 1px solid var(--da-line); background: #fff; border-radius: 4px; padding: 5px 11px; font-size: 12.5px; line-height: 1.4; cursor: pointer; text-align: left; }
.da .da-tag:hover { background: #f2f2f2; }
.da .da-tag[aria-pressed="true"] { background: var(--da-brand); border-color: var(--da-brand); color: #fff; }
.da-factions { display: flex; justify-content: flex-end; }
.da .da-clear { border: 1px solid var(--da-ink); background: #fff; border-radius: 999px; padding: 6px 18px; font-size: 13px; font-weight: 700; cursor: pointer; }
.da .da-clear:hover { background: var(--da-ink); color: #fff; }
.da .da-clear:disabled { opacity: .35; cursor: default; background: #fff; color: var(--da-ink); }

.da-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 18px; margin-top: 22px; } /* PCは横3列 */
.da-empty { grid-column: 1 / -1; text-align: center; color: var(--da-muted); padding: 30px; margin: 0; }
.da-empty[hidden] { display: none; }
.da-more-wrap { display: flex; justify-content: center; margin-top: 28px; }
.da .da-btn { border: 1px solid var(--da-ink); background: #fff; border-radius: 999px; padding: 10px 32px; font-weight: 700; cursor: pointer; }
.da .da-btn:hover { background: var(--da-ink); color: #fff; }
.da-btn[hidden] { display: none; }

/* ---------- 右カラム：お問い合わせ（追従） ---------- */
.da-side { align-self: stretch; }
.da-cta { position: sticky; top: 104px; z-index: 5; border-radius: 12px; background: var(--da-brand); padding: 20px 18px; display: flex; flex-direction: column; gap: 8px; }
.da-cta__lb { font-size: 11px; font-weight: 700; letter-spacing: .18em; color: #fff; opacity: .9; }
.da-cta__h { font-size: 16px; line-height: 1.5; color: #fff; margin-bottom: 4px; }
.da-cta a { display: block; text-align: center; border-radius: 999px; font-weight: 700; font-size: 13.5px; padding: 10px 12px; }
.da .da-cta__b1 { background: #fff; color: #007f88; }
.da .da-cta__b2 { background: #f3c318; border: 1px solid #f3c318; color: #111; } /* 30分のオンライン相談：黄色地に黒字（/works/ と同じ） */
.da .da-cta__b1:hover { background: #f0fbfc; }
.da .da-cta__b2:hover { background: #e6b70f; border-color: #e6b70f; }

/* ---------- スマホ・タブレット下部の相談バー ---------- */
.da-spbar { display: none; }

/* ---------- 画面幅ごと ---------- */
@media (max-width: 1000px) {
  .da-layout { grid-template-columns: 1fr; }
  .da-side { display: none; }
  .da-spbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; align-items: center; justify-content: space-between; gap: 10px; background: var(--da-brand); color: #fff; padding: 10px 16px; font-size: 13px; font-weight: 700; }
  .da-spbar__btns { display: flex; gap: 8px; flex: none; }
  .da .da-spbar a { border: 1px solid #fff; border-radius: 999px; padding: 7px 16px; white-space: nowrap; text-align: center; }
  .da .da-spbar__b1 { background: #fff; color: #007f88; }
  .da .da-spbar__b2 { background: transparent; color: #fff; }
  body.post-type-archive-download { padding-bottom: 60px; }
  /* すべての資料は横2列 */
  .da-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
}
@media (max-width: 640px) {
  .da-hero__p br { display: none; }
  .da-inner { padding: 0 16px 48px; }
  .da-rail { grid-auto-columns: minmax(210px, 1fr); }
  .da-frow { flex-direction: column; gap: 6px; }
  .da-flabel { width: auto; padding-top: 0; }
  .da .da-chip { padding: 4px 12px; font-size: 12.5px; }
  .da-filters { padding: 14px; }
  /* 下部バー：ボタン2つを同じ幅で並べる（左の文言は出さない） */
  .da-spbar__lb { display: none; }
  .da-spbar__btns { flex: 1; }
  .da .da-spbar a { flex: 1; padding: 9px 6px; }
}

/* ---------- 横スクロールの段：右（左）に続きがあることが分かるように、ぼかしと矢印ボタンを付ける（/method/ と同じ。js/download-archive.js） ---------- */
.da-rail-wrap { position: relative; }
.da-rail-wrap::before,
.da-rail-wrap::after { content: ""; position: absolute; top: 0; bottom: 8px; width: 48px; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .2s; }
.da-rail-wrap::before { left: 0; background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0)); }
.da-rail-wrap::after { right: 0; background: linear-gradient(to left, #fff, rgba(255, 255, 255, 0)); }
.da-rail-wrap.has-prev::before,
.da-rail-wrap.has-next::after { opacity: 1; }
.da .da-rail-btn { position: absolute; top: var(--da-btn-top, 80px); z-index: 2; width: 42px; height: 42px; margin-top: -21px; padding: 0; border: 1px solid var(--da-line); border-radius: 50%; background: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .16); cursor: pointer; display: none; place-items: center; transition: transform .15s, box-shadow .15s; }
.da-rail-btn::before { content: ""; width: 10px; height: 10px; border-top: 2.5px solid var(--da-ink); border-right: 2.5px solid var(--da-ink); }
.da .da-rail-btn--next { right: -14px; }
.da-rail-btn--next::before { transform: translateX(-2px) rotate(45deg); }
.da .da-rail-btn--prev { left: -14px; }
.da-rail-btn--prev::before { transform: translateX(2px) rotate(-135deg); }
.da .da-rail-btn:hover { transform: scale(1.06); box-shadow: 0 4px 14px rgba(0, 0, 0, .22); }
.da-rail-btn:focus-visible { outline: 2px solid var(--da-teal); outline-offset: 2px; }
.da-rail-wrap.has-next .da-rail-btn--next,
.da-rail-wrap.has-prev .da-rail-btn--prev { display: grid; }
/* スマホは指で横にスワイプするので、矢印ボタンは出さずにぼかしだけ */
@media (max-width: 640px) {
  .da .da-rail-btn { display: none !important; }
}
