/* 会社DB（/blog/db/）の資料DLサイドバー  inc/db-sidebar-dl.php */

.db-dl-side {
  display: none;
}

@media (min-width: 1280px) {
  /* sticky を効かせるため、DBページに限って横方向の overflow を clip にする */
  body.db-dl-page,
  body.db-dl-page .overlay-contact,
  body.db-dl-page .overlay-contact_inner,
  body.db-dl-page #wrap {
    overflow-x: clip;
  }

  .db-dl-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    column-gap: 40px;
    align-items: start;
  }

  .db-dl-layout > .db-dl-main {
    min-width: 0;
  }

  .db-dl-side {
    display: block;
    position: sticky;
    top: 10.4rem;
    max-height: calc(100vh - 10.4rem - 100px); /* 右下の追従CTAと重ならない高さ */
    overflow-y: auto;
    transition: opacity 0.3s ease;
  }

  .db-dl-side.is-hidden {
    opacity: 0;
    pointer-events: none;
  }

  /* 比較表は本文の列に収め、はみ出す分は横スクロール（三木さん指示 10/3） */
}

.db-dl-layout .wp-block-table:has(.db-compare-table),
.db-dl-layout .db-condition-table {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.db-dl-layout .db-compare-table:not(.wp-block-table *):not(.db-condition-table *) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* カード */
.db-dl-card {
  padding: 24px 22px 26px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 40px -24px rgba(13, 27, 69, 0.35);
  color: #0d1b45;
}

.db-dl-card__label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #e2475a;
}

.db-dl-card__thumb {
  display: block;
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  background: #f3f5f9;
}

.db-dl-card__thumb img,
.db-dl-card__img {
  display: block;
  width: 100%;
  height: auto;
}

.db-dl-card__title {
  margin-top: 14px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.5;
}

.db-dl-card__desc {
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.8;
  color: #2c3a5e;
}

.db-dl-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  min-height: 56px;
  padding: 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff8c94 0%, #ff6f7f 100%);
  box-shadow: 0 14px 30px -12px rgba(255, 111, 127, 0.6);
  color: #fff !important;
  font-size: 17px;
  font-weight: 800;
  text-decoration: none !important;
  text-shadow: 0 1px 2px rgba(160, 30, 50, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.db-dl-card__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -12px rgba(255, 111, 127, 0.75);
}

.db-dl-card__sub {
  display: block;
  margin-top: 14px;
  font-size: 15px;
  line-height: 1.6;
  color: #0d1b45 !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .db-dl-side,
  .db-dl-card__btn {
    transition: none;
  }
}

/* =========================================================
   相談ブロック（比較の直後・ページ末尾）と「ニュートラルワークスに相談する」ボックス
   出力：_admin/db-hub.php queryy_db_hub_render_consult_cta() → inc/db-sidebar-dl.php nworks_db_render_nw_box()
   ※ 1rem = 10px（テーマ共通）
   ========================================================= */
body.db-dl-page .db-consult-cta {
  margin: 4rem 0 1.6rem;
  padding: 3.6rem 2.8rem;
  background: #f4f7fc;
  border: 0;
  border-radius: 1.6rem;
}

body.db-dl-page .db-consult-cta__title {
  color: #0d1b45;
  font-size: clamp(2.2rem, 2.2vw, 2.8rem);
  font-weight: 800;
  line-height: 1.5;
}

body.db-dl-page .db-consult-cta__text {
  max-width: 64rem;
  margin: 1.2rem auto 2.4rem !important;
  color: #2b3550;
  font-size: 1.7rem;
  line-height: 1.85;
}

body.db-dl-page .db-consult-cta .db-consult-cta__button {
  background: linear-gradient(135deg, #ff8c94 0%, #ff6f7f 100%);
  border-color: transparent;
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  text-shadow: 0 0.1rem 0.2rem rgba(160, 30, 50, 0.35);
  box-shadow: 0 1.4rem 3rem -1.2rem rgba(255, 111, 127, 0.6);
}

.db-nw-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 32rem);
  gap: 3.2rem;
  align-items: center;
  margin: 0 0 4.8rem;
  padding: 3.6rem 3.6rem 3.6rem 4rem;
  border-radius: 1.6rem;
  background: linear-gradient(120deg, #0d1b45, #1b3f8f 60%, #1b76df);
  color: #fff;
}

.db-nw-box__eyebrow {
  display: inline-block;
  margin: 0 !important;
  padding: 0.4rem 1.2rem;
  border-radius: 99rem;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.db-nw-box__title {
  margin: 1.4rem 0 0 !important;
  color: #fff;
  font-size: clamp(2.2rem, 2vw, 2.8rem);
  font-weight: 800;
  line-height: 1.5;
  text-wrap: balance;
}

/* 見出し・説明・料金は単語の途中で折り返さない（10/4） */
.db-nw-box__title,
.db-nw-box__name,
.db-nw-box__lead,
.db-nw-box__price {
  word-break: keep-all;
  word-break: auto-phrase;
  overflow-wrap: anywhere;
  line-break: strict;
}

/* サムネがないときは1カラム（右半分を空けない） */
.db-nw-box:not(:has(.db-nw-box__thumb)) {
  grid-template-columns: minmax(0, 1fr);
}

.db-nw-box__name {
  margin: 1.2rem 0 0 !important;
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.5;
}

.db-nw-box__lead {
  margin: 0.8rem 0 0 !important;
  color: #d8e2f6;
  font-size: 1.7rem;
  line-height: 1.85;
}

.db-nw-box__price {
  margin: 1.2rem 0 0 !important;
  color: #fff;
  font-size: 1.9rem;
  line-height: 1.6;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.db-nw-box__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2rem;
  align-items: center;
  margin-top: 2.4rem;
}

.db-nw-box__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 5.6rem;
  padding: 0 3.2rem;
  border-radius: 99rem;
  background: linear-gradient(135deg, #ff8c94 0%, #ff6f7f 100%);
  color: #fff !important;
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none !important;
  text-shadow: 0 0.1rem 0.2rem rgba(160, 30, 50, 0.35);
  box-shadow: 0 1.4rem 3rem -1.2rem rgba(255, 111, 127, 0.6);
  transition: transform 0.3s ease;
}

.db-nw-box__btn:hover {
  transform: translateY(-0.2rem);
}

.db-nw-box__sub {
  color: #fff !important;
  font-size: 1.6rem;
  text-decoration: underline !important;
  text-underline-offset: 0.3em;
}

.db-nw-box__thumb {
  display: block;
  overflow: hidden;
  border-radius: 1.2rem;
  background: #fff;
}

.db-nw-box__img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 767px) {
  body.db-dl-page .db-consult-cta {
    padding: 2.8rem 2rem;
  }
  body.db-dl-page .db-consult-cta__text {
    font-size: 1.6rem;
  }
  .db-nw-box {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding: 2.8rem 2rem;
  }
  .db-nw-box__thumb {
    order: -1;
  }
  .db-nw-box__btn {
    width: 100%;
  }
}

/* NWボックス：相談の流れ（10/3） */
.db-nw-box__steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  font-weight: 700;
  color: #d8e2f6;
}
.db-nw-box__steps li {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
/* 矢印は前の項目の後ろに付ける（折り返したとき行頭に矢印が来ないように 10/4） */
.db-nw-box__steps li:not(:last-child)::after {
  content: "→";
  margin: 0 10px;
  color: rgba(216, 226, 246, 0.7);
}
.db-nw-box__steps li:last-child {
  padding: 2px 12px;
  border-radius: 99px;
  background: rgba(255, 140, 148, 0.18);
  color: #fff;
}

/* ハブ・費用ページの監修者・執筆者（10/3） */
.db-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 8px 0 28px;
  padding: 14px 0;
  border-top: 1px solid #e3e8f1;
  border-bottom: 1px solid #e3e8f1;
}
.db-byline__person {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}
.db-byline__avatar img {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}
.db-byline__text {
  display: grid;
  gap: 2px;
  line-height: 1.4;
}
.db-byline__label {
  font-size: 13px;
  font-weight: 700;
  color: #5a6684;
}
.db-byline__name {
  font-size: 17px;
  font-weight: 800;
  color: #0d1b45;
}
.db-byline__sub {
  font-size: 14px;
  color: #44527a;
}

/* 比較表の横スクロールのヒント（はみ出している表だけ。JSで .is-scrollable を付与） 10/3 */
.db-scroll-wrap {
  position: relative;
}
.db-scroll-wrap::before,
.db-scroll-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 56px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}
.db-scroll-wrap::before {
  left: 0;
  background: linear-gradient(90deg, #fff 10%, rgba(255, 255, 255, 0));
}
.db-scroll-wrap::after {
  right: 0;
  background: linear-gradient(270deg, #fff 10%, rgba(255, 255, 255, 0));
}
.db-scroll-wrap.is-scrollable:not(.is-end)::after {
  opacity: 1;
}
.db-scroll-wrap.is-scrollable.is-scrolled::before {
  opacity: 1;
}
.db-scroll-hint {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: #0d1b45;
  transition: opacity 0.3s ease;
}
.db-scroll-hint.is-on {
  display: inline-flex;
}
.db-scroll-hint.is-done {
  opacity: 0;
  pointer-events: none;
}
.db-scroll-hint__ico {
  display: inline-block;
  font-size: 16px;
  animation: db-scroll-nudge 1.2s ease-in-out 2;
}
@keyframes db-scroll-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce) {
  .db-scroll-hint__ico { animation: none; }
}
