/* ============================================================
 * page_ebook.css  -  /digitalbook/ (デジタルカタログ一覧)
 * 他ページと統一: メイン --main_corp_color (#01479e) を踏襲、
 * サブアクセントとして紙質感のベージュを限定保持。
 * ============================================================ */

html { font-size: 62.5%; }

:root {
  --ebook-text:        #242323;
  --ebook-text-sub:    #6e6e6e;
  --ebook-line:        #e6e8ec;
  --ebook-bg-soft:     #f6f7f9;
  --ebook-accent:      #01479e;
  --ebook-accent-deep: #013a82;
  --ebook-warm:        #c8ad7f;
  --ebook-radius:      8px;
}

.ebook-page {
  color: var(--ebook-text);
  font-family: source-han-sans-japanese, "Noto Sans JP", sans-serif;
  -webkit-text-size-adjust: 100%;
  padding-bottom: 100px;
}

.sp-br { display: none; }
@media (max-width: 768px) {
  .sp-br { display: inline; }
}

/* ---------- Hero ---------- */
.ebook-hero {
  background: linear-gradient(180deg, var(--ebook-bg-soft) 0%, #ffffff 100%);
  padding: calc(100px + clamp(24px, 5vw, 64px)) 5% clamp(56px, 7vw, 88px);
  text-align: center;
}
.ebook-hero__inner { max-width: 880px; margin: 0 auto; }
.ebook-hero__eyebrow {
  font-size: 11px; letter-spacing: .3em;
  color: var(--ebook-text-sub); font-weight: 500;
  margin-bottom: 20px; text-transform: uppercase;
}
.ebook-hero__title {
  font-size: clamp(24px, 4.5vw, 38px);
  font-weight: 600; line-height: 1.6;
  margin: 0 0 20px; color: var(--ebook-text);
}
.ebook-hero__lead {
  font-size: clamp(14px, 1.8vw, 15px);
  line-height: 1.95; margin: 0 0 12px;
  color: var(--ebook-text-sub);
}
.ebook-hero__note {
  font-size: 13px; color: var(--ebook-text-sub);
  letter-spacing: .04em; margin: 0 0 36px;
}
.ebook-hero__cta {
  display: inline-block; color: var(--ebook-accent);
  text-decoration: none; font-size: 14px; letter-spacing: .08em;
  border-bottom: 1px solid currentColor;
  padding: 4px 4px;
  background: none; border-radius: 0;
  transition: color .2s ease;
}
.ebook-hero__cta:hover { color: var(--ebook-accent-deep); }
.ebook-hero__cta-arrow { display: inline-block; margin-left: 6px; transition: transform .2s; }
.ebook-hero__cta:hover .ebook-hero__cta-arrow { transform: translateY(3px); }

@media (max-width: 768px) {
  .ebook-hero { padding-top: calc(50px + 32px); }
}

/* ---------- Section common ---------- */
.ebook-section-title {
  text-align: center;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600; margin: 0 0 40px; color: var(--ebook-text);
  position: relative; padding-bottom: 12px;
}
.ebook-section-title::after {
  content: ""; display: block; width: 32px; height: 1px;
  background: var(--ebook-accent); margin: 12px auto 0;
}

/* ---------- Catalog list ---------- */
.ebook-list {
  padding: clamp(56px, 7vw, 88px) 5%;
  background: var(--ebook-bg-soft);
}
.ebook-list__inner { max-width: 1200px; margin: 0 auto; }
.ebook-list__desc {
  text-align: center; color: var(--ebook-text-sub);
  font-size: 14px; margin: -24px 0 32px;
}
.ebook-list__empty {
  text-align: center; padding: 60px 20px;
  background: #fff; border-radius: var(--ebook-radius);
  color: var(--ebook-text-sub); line-height: 2;
}

/* ---------- Filter ---------- */
.ebook-filter {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center; margin: 0 0 32px;
}
.ebook-filter__btn {
  border: 1px solid var(--ebook-line); background: #fff;
  color: var(--ebook-text-sub); padding: 8px 20px; border-radius: 999px;
  font-size: 13px; cursor: pointer;
  transition: all .2s ease;
}
.ebook-filter__btn:hover { border-color: var(--ebook-accent); color: var(--ebook-accent); }
.ebook-filter__btn.is-active {
  background: var(--ebook-accent); color: #fff; border-color: var(--ebook-accent);
}

/* ---------- Grid + Card ---------- */
.ebook-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 24px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 1000px) {
  .ebook-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .ebook-grid { grid-template-columns: 1fr; gap: 20px; }
}

.ebook-card {
  background: #fff;
  border-radius: var(--ebook-radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: none;
  border: 1px solid var(--ebook-line);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ebook-card.is-selected {
  border-color: var(--ebook-accent);
  box-shadow: 0 0 0 1px var(--ebook-accent);
}
.ebook-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.06); }

.ebook-card__preview-btn {
  border: none; background: none; padding: 0;
  cursor: pointer; display: block; width: 100%;
  text-align: left;
}
.ebook-card__thumb-wrap {
  display: block; position: relative;
  aspect-ratio: 4 / 3; background: var(--ebook-bg-soft);
  overflow: hidden;
}
.ebook-card__thumb-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.ebook-card__preview-btn:hover .ebook-card__thumb-wrap img { transform: scale(1.02); }
.ebook-card__noimg {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--ebook-text-sub); font-size: 13px;
}
.ebook-card__peek-label {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(36,36,36,.85); color: #fff;
  padding: 6px 12px; border-radius: 4px; font-size: 12px;
  letter-spacing: .05em;
  opacity: 0; transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
}
.ebook-card__preview-btn:hover .ebook-card__peek-label,
.ebook-card__preview-btn:focus-visible .ebook-card__peek-label {
  opacity: 1; transform: translateY(0);
}

.ebook-card__body {
  padding: 16px 16px 20px;
  display: flex; flex-direction: column;
  flex: 1;
}
.ebook-card__subtitle {
  color: var(--ebook-warm); font-size: 11px;
  letter-spacing: .15em; margin: 0 0 6px;
  font-weight: 600;
}
.ebook-card__title {
  font-size: 16px; font-weight: 600;
  margin: 0 0 8px; line-height: 1.5; color: var(--ebook-text);
}
.ebook-card__catch {
  font-size: 13px; line-height: 1.7;
  color: var(--ebook-text-sub); margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.ebook-card__meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 16px;
}
.ebook-card__tag {
  background: var(--ebook-bg-soft); color: var(--ebook-text-sub);
  font-size: 11px; padding: 4px 10px;
  border-radius: 4px; letter-spacing: .05em;
}
.ebook-card__pages {
  color: var(--ebook-text-sub); font-size: 11px;
  align-self: center;
}
.ebook-card__select {
  margin-top: auto;
  display: block; cursor: pointer;
  border: 1px solid var(--ebook-line);
  border-radius: 6px; padding: 10px;
  text-align: center; font-size: 13px;
  color: var(--ebook-text);
  transition: all .2s ease;
  user-select: none;
}
.ebook-card__select:hover { border-color: var(--ebook-accent); color: var(--ebook-accent); }
.ebook-card__checkbox {
  position: absolute; opacity: 0; pointer-events: none;
}
.ebook-card__select-checked { display: none; }
.ebook-card.is-selected .ebook-card__select {
  background: var(--ebook-accent); border-color: var(--ebook-accent); color: #fff;
}
.ebook-card.is-selected .ebook-card__select-default { display: none; }
.ebook-card.is-selected .ebook-card__select-checked { display: inline; }
.ebook-card.is-hidden { display: none; }

/* ---------- Modal ---------- */
.ebook-modal {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.ebook-modal.is-open { opacity: 1; pointer-events: auto; }
.ebook-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.ebook-modal__panel {
  position: relative;
  background: #fff;
  width: min(720px, 92vw);
  max-height: 88vh;
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  transform: translateY(20px);
  transition: transform .3s ease;
}
.ebook-modal.is-open .ebook-modal__panel { transform: translateY(0); }
.ebook-modal__close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.06); color: var(--ebook-text);
  font-size: 20px; cursor: pointer; z-index: 2;
  transition: background .2s;
}
.ebook-modal__close:hover { background: rgba(0,0,0,.12); }
.ebook-modal__body {
  padding: 32px 28px 24px;
  overflow-y: auto;
}
.ebook-modal__subtitle {
  color: var(--ebook-warm); font-size: 12px;
  letter-spacing: .15em; font-weight: 600;
  margin: 0 0 6px;
}
.ebook-modal__title {
  font-size: 20px; font-weight: 600;
  margin: 0 0 8px; line-height: 1.5;
}
.ebook-modal__catch {
  font-size: 14px; line-height: 1.8;
  color: var(--ebook-text-sub); margin: 0 0 16px;
}
.ebook-modal__meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.ebook-modal__meta span {
  background: var(--ebook-bg-soft); color: var(--ebook-text-sub);
  font-size: 11px; padding: 4px 10px;
  border-radius: 4px;
}
.ebook-modal__highlights {
  background: var(--ebook-bg-soft); border-radius: var(--ebook-radius);
  padding: 16px 18px; margin-bottom: 20px;
}
.ebook-modal__highlights-head {
  margin: 0 0 8px; font-size: 13px; font-weight: 600;
  color: var(--ebook-accent);
}
.ebook-modal__highlights ul {
  margin: 0; padding-left: 1.2em;
  font-size: 13px; line-height: 1.9; color: var(--ebook-text);
}
.ebook-modal__preview-head {
  font-size: 13px; color: var(--ebook-text-sub); margin: 0 0 10px;
  font-weight: 600;
}
.ebook-modal__preview-hint {
  font-size: 11px; color: var(--ebook-text-sub); font-weight: normal;
  margin-left: 6px;
}
.ebook-modal__scroll {
  display: flex; gap: 12px;
  overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.ebook-modal__scroll img {
  flex: 0 0 auto;
  width: min(260px, 70vw);
  height: auto; max-height: 360px; object-fit: contain;
  background: #f5f5f5; border-radius: 6px;
  scroll-snap-align: start;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.ebook-modal__footer {
  padding: 16px 20px;
  border-top: 1px solid #eee;
  display: flex; justify-content: center;
}
.ebook-modal__select-btn {
  background: var(--ebook-accent); color: #fff;
  border: none; border-radius: 999px;
  padding: 14px 36px; font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.ebook-modal__select-btn:hover { background: var(--ebook-accent-deep); }
.ebook-modal__select-btn.is-selected { background: var(--ebook-text-sub); }
.ebook-modal__select-checked { display: none; }
.ebook-modal__select-btn.is-selected .ebook-modal__select-default { display: none; }
.ebook-modal__select-btn.is-selected .ebook-modal__select-checked { display: inline; }

@media (max-width: 600px) {
  .ebook-modal__body { padding: 24px 18px 16px; }
  .ebook-modal__title { font-size: 17px; }
  .ebook-modal__scroll img { width: min(220px, 78vw); }
}

/* ---------- Sticky CTA bar ---------- */
.ebook-sticky {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 90;
  background: #fff;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  padding: 12px 5%;
  transform: translateY(110%);
  transition: transform .3s ease;
}
.ebook-sticky.is-visible { transform: translateY(0); }
.ebook-sticky__inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.ebook-sticky__count {
  font-size: 14px; color: var(--ebook-text);
}
.ebook-sticky__count strong {
  color: var(--ebook-accent); font-size: 22px;
  font-family: inherit; font-feature-settings: 'tnum';
  margin: 0 4px;
}
.ebook-sticky__cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--ebook-accent); color: #fff; text-decoration: none;
  padding: 14px 28px; border-radius: 999px;
  font-size: 15px; font-weight: 600;
  transition: background .2s;
}
.ebook-sticky__cta:hover { background: var(--ebook-accent-deep); }
.ebook-sticky__cta.is-disabled {
  background: #ccc; pointer-events: none; opacity: .7;
}
.ebook-sticky__arrow { transition: transform .2s; }
.ebook-sticky__cta:hover .ebook-sticky__arrow { transform: translateX(4px); }

@media (max-width: 600px) {
  .ebook-sticky__inner { gap: 8px; }
  .ebook-sticky__cta { padding: 12px 16px; font-size: 13px; }
  .ebook-sticky__count { font-size: 12px; }
  .ebook-sticky__count strong { font-size: 18px; }
}

/* ---------- FAQ ---------- */
.ebook-faq {
  padding: clamp(56px, 7vw, 88px) 5%;
  background: #fff;
}
.ebook-faq__inner { max-width: 800px; margin: 0 auto; }
.ebook-faq__list { margin: 0; }
.ebook-faq__list dt {
  font-weight: 600; padding: 18px 0 6px;
  border-top: 1px solid var(--ebook-line);
  position: relative; padding-left: 28px;
}
.ebook-faq__list dt::before {
  content: "Q."; position: absolute; left: 0; top: 18px;
  color: var(--ebook-accent); font-weight: 700;
  font-family: inherit;
}
.ebook-faq__list dt:first-child { border-top: none; }
.ebook-faq__list dd {
  margin: 0 0 18px;
  padding-left: 28px;
  font-size: 14px; line-height: 1.9; color: var(--ebook-text-sub);
}

/* ---------- Form page additions ---------- */
.ebook-form-wrap {
  max-width: 760px; margin: 0 auto;
  padding: calc(100px + clamp(24px, 5vw, 48px)) 5% clamp(48px, 7vw, 80px);
}
@media (max-width: 768px) {
  .ebook-form-wrap { padding-top: calc(50px + 24px); }
}
.ebook-form-error {
  background: #fff5f5; border: 1px solid #f5c2c7;
  color: #842029; padding: 12px 16px; border-radius: 8px;
  margin-bottom: 20px; font-size: 13px; line-height: 1.7;
}
.ebook-form {
  background: #fff; padding: clamp(20px, 4vw, 32px);
  border-radius: var(--ebook-radius);
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.ebook-form__item { margin-bottom: 22px; }
.ebook-form__label {
  display: block; font-weight: 600;
  margin-bottom: 8px; font-size: 14px; color: var(--ebook-text);
}
.ebook-form__label--required::after { content: " *"; color: #c44; }
.ebook-form__input {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--ebook-line); border-radius: 6px;
  font-size: 15px; font-family: inherit;
  background: #fff;
  box-sizing: border-box;
}
.ebook-form__input:focus {
  outline: none; border-color: var(--ebook-accent);
  box-shadow: 0 0 0 2px rgba(1,71,158,.15);
}
.ebook-form__hint {
  font-size: 12px; color: var(--ebook-text-sub); margin: 6px 0 0;
}
.ebook-form__radio-group {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.ebook-form__radio {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1px solid var(--ebook-line);
  border-radius: 999px; cursor: pointer; font-size: 13px;
}
.ebook-form__radio input { accent-color: var(--ebook-accent); }
.ebook-form__checkbox {
  display: inline-flex; gap: 8px; align-items: flex-start;
  cursor: pointer; font-size: 13px; line-height: 1.7;
}
.ebook-form__checkbox input {
  margin-top: 4px; accent-color: var(--ebook-accent);
}
.ebook-form__checkbox a {
  color: var(--ebook-accent); text-decoration: underline;
}
.ebook-form__note {
  font-size: 12px; color: var(--ebook-text-sub); line-height: 1.8;
  background: var(--ebook-bg-soft); padding: 12px 14px;
  border-radius: 6px;
}
.ebook-form__buttons {
  text-align: center; margin-top: 24px;
}
.ebook-form__submit {
  background: var(--ebook-accent); color: #fff; border: none;
  padding: 16px 48px; border-radius: 999px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  transition: background .2s;
}
.ebook-form__submit:hover:not(:disabled) {
  background: var(--ebook-accent-deep);
}
.ebook-form__submit:disabled {
  background: #ccc; cursor: not-allowed;
}
.ebook-form-selected {
  background: var(--ebook-bg-soft);
  border-radius: var(--ebook-radius);
  padding: 20px 24px;
  margin-bottom: 28px;
}
.ebook-form-selected__head {
  font-weight: 600; font-size: 15px;
  margin: 0 0 12px; color: var(--ebook-text);
}
.ebook-form-selected__list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 8px;
}
.ebook-form-selected__list li {
  display: flex; gap: 12px; align-items: center;
  background: #fff; padding: 10px 14px; border-radius: 6px;
  font-size: 13px;
}
.ebook-form-selected__list img {
  width: 56px; height: 42px; object-fit: cover; border-radius: 4px;
}
.ebook-form-selected__edit {
  display: inline-block; margin-top: 14px;
  font-size: 12px; color: var(--ebook-accent);
  text-decoration: underline;
}
.ebook-form-empty {
  text-align: center; padding: 40px 20px;
  background: var(--ebook-bg-soft); border-radius: var(--ebook-radius);
  color: var(--ebook-text-sub); margin-bottom: 28px;
}
.ebook-form-empty a {
  display: inline-block; margin-top: 12px;
  color: var(--ebook-accent); text-decoration: underline;
}

/* ============================================================
   QMS3 ($block->render()) 出力 HTML 用のスタイル
   .ebook-form-wrap 内に scope して他フォーム (.l-inquiry 等) に影響させない
   ============================================================ */
.ebook-form-wrap .form__block {
  background: #fff;
  padding: clamp(20px, 4vw, 32px);
  border-radius: var(--ebook-radius);
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.ebook-form-wrap .form__row {
  margin-bottom: 22px;
}
.ebook-form-wrap .form__row:last-child {
  margin-bottom: 0;
}
.ebook-form-wrap .form__row-header {
  margin-bottom: 8px;
}
.ebook-form-wrap .form__label,
.ebook-form-wrap .form__label label,
.ebook-form-wrap .form__label span {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--ebook-text);
  margin: 0;
  line-height: 1.6;
}
.ebook-form-wrap .form__row--required .form__label > label::after,
.ebook-form-wrap .form__row--required .form__label > span::after {
  content: " *";
  color: #c44;
}
.ebook-form-wrap .form__field-group {
  display: block;
}
.ebook-form-wrap .form__field-unit {
  display: block;
}
.ebook-form-wrap .form__field input[type="text"],
.ebook-form-wrap .form__field input[type="email"],
.ebook-form-wrap .form__field input[type="tel"],
.ebook-form-wrap .form__field input[type="number"],
.ebook-form-wrap .form__field input[type="password"],
.ebook-form-wrap .form__field textarea,
.ebook-form-wrap .form__field select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ebook-line);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  box-sizing: border-box;
  line-height: 1.5;
}
.ebook-form-wrap .form__field input:focus,
.ebook-form-wrap .form__field textarea:focus,
.ebook-form-wrap .form__field select:focus {
  outline: none;
  border-color: var(--ebook-accent);
  box-shadow: 0 0 0 2px rgba(1,71,158,.15);
}
.ebook-form-wrap .form__body-notice,
.ebook-form-wrap .form__header-notice {
  margin-top: 6px;
}
.ebook-form-wrap .form__body-notice-item,
.ebook-form-wrap .form__header-notice-item {
  font-size: 12px;
  color: var(--ebook-text-sub);
  line-height: 1.7;
  background: transparent;
  border: none;
  padding: 0;
}
.ebook-form-wrap .form__message {
  font-size: 12px;
  color: #c44;
  margin-top: 4px;
  min-height: 0;
}
.ebook-form-wrap .form__message:empty {
  display: none;
}
.ebook-form-wrap .form__row.has-error .form__field input,
.ebook-form-wrap .form__row.has-error .form__field textarea,
.ebook-form-wrap .form__row.has-error .form__field select {
  border-color: #c44;
  background: #fff5f5;
}
.ebook-form-wrap .form__prepend,
.ebook-form-wrap .form__append {
  font-size: 13px;
  color: var(--ebook-text-sub);
}

/* ---------- Thanks page ---------- */
.ebook-thanks {
  text-align: center;
  padding: calc(100px + clamp(24px, 5vw, 64px)) 5% clamp(56px, 7vw, 88px);
  max-width: 720px; margin: 0 auto;
}
.ebook-thanks__icon {
  font-size: 48px; color: var(--ebook-accent); margin-bottom: 16px;
}
.ebook-thanks__title {
  font-size: 24px; font-weight: 600; margin: 0 0 16px;
}
.ebook-thanks__lead {
  font-size: 15px; line-height: 1.9; color: var(--ebook-text-sub);
  margin-bottom: 32px;
}
.ebook-thanks__list {
  background: var(--ebook-bg-soft); border-radius: var(--ebook-radius);
  padding: 20px 24px; text-align: left;
  list-style: none; margin: 0 0 32px;
}
.ebook-thanks__list li {
  padding: 8px 0; font-size: 14px;
}
.ebook-thanks__back {
  display: inline-block;
  padding: 14px 32px;
  background: var(--ebook-accent); color: #fff;
  text-decoration: none; border-radius: 999px;
  font-size: 14px;
  transition: background .2s;
}
.ebook-thanks__back:hover { background: var(--ebook-accent-deep); }

/* ---------- Focus visible ---------- */
.ebook-card__preview-btn:focus-visible,
.ebook-filter__btn:focus-visible,
.ebook-hero__cta:focus-visible,
.ebook-modal__close:focus-visible,
.ebook-sticky__cta:focus-visible,
.ebook-form__submit:focus-visible {
  outline: 2px solid var(--ebook-accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.ebook-card__select:focus-within {
  outline: 2px solid var(--ebook-accent);
  outline-offset: 2px;
}
