/* ==========================================================
   ページカード（画像 + テキスト構造）
========================================================== */

/* ページカードの基本構造 */
.page-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--bg3);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
}

/* ---- 画像ゾーン ---- */
.page-img-wrap {
  flex-shrink: 0;
  width: 100%;
  overflow: hidden;
  position: relative;
  background: var(--bg);
}

/* 画像高さバリエーション */
.page-img-wrap.h-full  { height: 100%; flex: 1; }
.page-img-wrap.h-60    { height: 60%;  flex: none; }
.page-img-wrap.h-50    { height: 50%;  flex: none; }
.page-img-wrap.h-40    { height: 40%;  flex: none; }
.page-img-wrap.h-none  { display: none; }

.page-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  /* 画像の遅延ロード対応 */
  content-visibility: auto;
}

/* 画像オーバーレイ（グラデーション） */
.page-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 40%,
    rgba(13,13,24,0.55) 100%
  );
  pointer-events: none;
}

/* 画像なしプレースホルダー */
.page-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  opacity: 0.18;
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
}

/* ---- テキストゾーン ---- */
.page-text {
  flex: 1;
  padding: 18px 18px 14px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.page-text::-webkit-scrollbar { width: 2px; }
.page-text::-webkit-scrollbar-thumb { background: var(--border); }

/* タグ */
.page-tag {
  display: inline-block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 7px;
}

/* タイトル */
.page-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 9px;
}

/* 区切り線 */
.page-divider {
  width: 28px;
  height: 2px;
  background: var(--grad);
  border-radius: 100px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

/* 本文 */
.page-body-text {
  font-size: 0.78rem;
  color: var(--text2);
  line-height: 1.85;
  margin-bottom: 11px;
}

/* キャプション（画像直下） */
.page-caption {
  font-size: 0.65rem;
  color: var(--text3);
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ハイライトボックス */
.pg-hl {
  background: rgba(108,99,255,0.09);
  border: 1px solid rgba(108,99,255,0.22);
  border-radius: var(--r-sm);
  padding: 10px 13px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 11px;
}

.pg-hl-icon { font-size: 0.95rem; flex-shrink: 0; margin-top: 1px; }

.pg-hl-text {
  font-size: 0.74rem;
  color: var(--accent);
  line-height: 1.6;
}

/* 統計カード */
.pg-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 11px;
}

.pg-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 9px 8px;
  text-align: center;
}

.pg-stat-n {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pg-stat-l {
  display: block;
  font-size: 0.58rem;
  color: var(--text3);
  margin-top: 2px;
}

/* リスト */
.pg-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 11px;
}

.pg-list-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text2);
  padding: 8px 10px;
  background: var(--card);
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
}

.pg-list-icon { flex-shrink: 0; font-size: 0.85rem; }

/* ---- 企業紹介テンプレート ---- */
.company-page {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.company-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.company-name {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.35;
}

.company-catch {
  font-size: 0.78rem;
  color: var(--accent-b);
  font-weight: 600;
  line-height: 1.6;
}

.company-points {
  margin-top: 2px;
}

.company-link-area {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.company-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(72,198,239,0.35);
  background: linear-gradient(135deg, rgba(108,99,255,0.2), rgba(72,198,239,0.2));
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform var(--fast) var(--ease),
              border-color var(--fast) var(--ease),
              background var(--fast) var(--ease);
}

.company-link-btn:hover,
.company-link-btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent-b);
  background: linear-gradient(135deg, rgba(108,99,255,0.35), rgba(72,198,239,0.35));
  outline: none;
}

.company-url {
  margin-top: 7px;
  font-size: 0.64rem;
  color: var(--text3);
  line-height: 1.5;
  word-break: break-all;
}

.company-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.company-tag-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text2);
  font-size: 0.62rem;
  font-weight: 600;
}

/* ---- PDF画像企業テンプレート ---- */
.pdf-company-page {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.pdf-page-image {
  height: 100%;
  background: #111;
}

.pdf-page-image::after {
  background: none;
}

.pdf-page-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #0f0f15;
}

.pdf-company-overlay {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(8, 9, 15, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.1);
}

.pdf-company-name {
  min-width: 0;
  font-size: 0.68rem;
  color: var(--text2);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdf-company-link {
  flex-shrink: 0;
  min-height: 30px;
  font-size: 0.66rem;
}

/* ==========================================================
   特殊レイアウト（表紙・章扉・奥付）
========================================================== */

/* ---- 表紙 ---- */
.page-cover {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  text-align: center;
  background: linear-gradient(160deg, #13123a 0%, #0d0d18 50%, #1a0b28 100%);
  position: relative;
  overflow: hidden;
}

.page-cover::before {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle,
    rgba(108,99,255,0.18) 0%, transparent 70%);
  border-radius: 50%;
  top: -80px; right: -80px;
  pointer-events: none;
}

.page-cover::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle,
    rgba(72,198,239,0.12) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -50px; left: -50px;
  pointer-events: none;
}

.cover-eyebrow {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: var(--grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border: 1px solid rgba(108,99,255,0.3);
  padding: 4px 13px;
  border-radius: 100px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}

.cover-icon-wrap {
  font-size: 3.8rem;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 20px rgba(108,99,255,0.45));
  position: relative;
  z-index: 1;
}

.cover-title-main {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.18;
  background: linear-gradient(135deg, #fff 0%, #b0baff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 11px;
  position: relative;
  z-index: 1;
}

.cover-subtitle {
  font-size: 0.76rem;
  color: var(--text);
  letter-spacing: 0.08em;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

.cover-sep {
  width: 34px;
  height: 2px;
  background: var(--grad);
  border-radius: 100px;
  margin: 0 auto 16px;
  position: relative;
  z-index: 1;
}

.cover-author {
  font-size: 0.7rem;
  color: var(--text3);
  letter-spacing: 0.14em;
  position: relative;
  z-index: 1;
}

/* ---- 章扉 ---- */
.page-chapter {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 0 32px;
  position: relative;
  overflow: hidden;
}

.chapter-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.chapter-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(13,13,24,0.22) 0%,
    rgba(13,13,24,0.85) 55%,
    rgba(13,13,24,0.97) 100%
  );
}

.chapter-content {
  position: relative;
  z-index: 1;
  padding: 0 22px;
}

.chapter-no {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 9px;
}

.chapter-title {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
}

.chapter-desc {
  font-size: 0.78rem;
  color: var(--text2);
  line-height: 1.7;
  margin-bottom: 18px;
}

.chapter-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chapter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text2);
}

.chapter-item::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---- 奥付 ---- */
.page-colophon {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  text-align: center;
  background: var(--bg3);
}

.colo-logo { font-size: 2.4rem; margin-bottom: 12px; }

.colo-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.colo-sep {
  width: 34px;
  height: 1px;
  background: var(--border);
  margin: 0 auto 16px;
}

.colo-info {
  width: 100%;
  max-width: 210px;
  text-align: left;
  margin-bottom: 16px;
}

.colo-row {
  display: flex;
  gap: 8px;
  font-size: 0.74rem;
  color: var(--text2);
  margin-bottom: 6px;
}

.colo-row strong {
  color: var(--text3);
  min-width: 52px;
  flex-shrink: 0;
}

.colo-copy {
  font-size: 0.66rem;
  color: var(--text3);
  margin-bottom: 4px;
}

.colo-note {
  font-size: 0.61rem;
  color: var(--text3);
}