/* 全体レイアウト */
.container { flex: 1; }
.page-body {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
}
.blocks {
  height: 100%;
  padding: 20px 0;
  box-sizing: border-box;
}
.pdf-archive-container {
  display: flex;
  height: 100%;
}

.container-has-sidebar .pdf-main-content {
  width: 80%;
  padding: 10px;
}

/* サイドバー（画像左側のメニュー） */
.side-blocks {
  max-width: 220px;
  width: 20%;
  padding: 10px;
  flex-shrink: 1;
}

.side-menu-toggle {
  display: none;
}

.sidebar {
  width: 100%;
  position: sticky;
  top: 20px;
  align-self: flex-start;
}

.side-menu {
  width: 100%;
  font-size: 13px;
  font-weight: bold;
  border: 1px solid #ddd;
  background: #f3f3f3;
}

.side-menu-title {
  margin: 0;
  padding: 8px 10px 8px 24px;
  position: relative;
  background: #dfeff4;
  color: #111;
  font-size: 13px;
  font-weight: bold;
  border-bottom: 1px solid #ddd;
}

.side-menu-title::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 8px;
  height: 8px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #68c6e8;
}

.side-menu-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.side-menu-list > li {
  border-bottom: 1px solid #ddd;
  background: linear-gradient(#fafafa, #eeeeee);
}

.side-menu-list > li:last-child {
  border-bottom: none;
}

.side-menu-list > li > a {
  display: block;
  position: relative;
  padding: 8px 8px 8px 20px;
  color: #111;
  text-decoration: none;
  line-height: 1.2;
  border-left: 4px solid transparent;
  box-sizing: border-box;
  transition: background 0.2s ease, color 0.2s ease;
}

.side-menu-list > li > a::before {
  content: "›";
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  color: #0066aa;
  font-size: 16px;
  font-weight: normal;
}

.side-menu-list > li > a:hover {
  background: #e8f4fb;
  color: #005bac;
}

/* 現在ページ */
.sidebar .side-menu-list > li.active > a {
  background: linear-gradient(to bottom, #0b63bd, #004b99) !important;
  color: #fff !important;
  font-weight: bold;
  border-left: 4px solid #4dd0ff;
}

/* 現在ページの矢印 */
.sidebar .side-menu-list > li.active > a::before {
  color: #fff !important;
}

/* 現在ページ hover時 */
.sidebar .side-menu-list > li.active > a:hover {
  background: linear-gradient(to bottom, #0b63bd, #004b99) !important;
  color: #fff !important;
}

/* メインコンテンツ */
.pdf-main-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* 画像の青いタイトル部分 */
.page-title {
  width: 100%;
  height: 56px;
  padding-left: 24px;
  box-sizing: border-box;
  border-radius: 3px 3px 0 0;
  border-bottom: 4px solid #c7d5ea;
  background:
    radial-gradient(ellipse at 62% 100%, rgba(120,160,210,.45) 0%, rgba(70,110,170,.35) 28%, transparent 55%),
    repeating-linear-gradient(0deg, transparent 0px, transparent 2px, rgba(255,255,255,.45) 3px, transparent 4px),
    linear-gradient(90deg, #0b2f75 0%, #123b86 45%, #1d4f9a 100%);
  font-size: 16px/*var(--font-size-page-title)*/;
  font-weight: bold;
  line-height: 56px;
  color: #ffffff/*var(--color-font-page-title)*/;
}

.pdf-flex-main {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* 年度タブのスタイル */
.pdf-tabs-nav-responsive {
  display: flex;
  gap: 5px;
  margin-bottom: 1px;
}

/* PDFリスト（白背景の枠） */
.pdf-tabs-content {
  display: flex;
  flex-direction: column;
  background: #f9f9f9;
  border: 1px solid #ccc;
  padding: 20px;
  flex: 1;
}

.pdf-item-raw {
  border-bottom: 1px solid black;
  margin-top: 10px;
}

.pdf-item-bottom {
  display: flex;
}

.pdf-link {
  display: flex;
  align-items: center;
  padding: 5px 0;
  color: #0033cc;
  text-decoration: none;
}

.pdf-link:hover {
  text-decoration: underline
}

.pdf-link-icon {
    width: 12px;
    height: 12px;
    border: 2px solid #007bff;
    border-radius: 50%;
    margin-right: 10px;
    flex-shrink: 0;
    display: inline-block;
}

.pdf-pagination {
  margin-top: 30px;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.pdf-list-area {
  flex: 1;
}

p.no-data-msg {
  font-weight: bold;
  font-size: 24px;
  text-decoration: underline;
  padding: 10px;
  text-align: center;
  font-style: italic;
}

/* --- ページネーション --- */
.pagination {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
  }

  /* 戻る・次へボタン */
  .page-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border: 1.5px solid #d0d0d0;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    font-weight: 500;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    user-select: none;
  }

  .page-nav-btn:hover:not(:disabled) {
    border-color: #3a7bff;
    color: #3a7bff;
    background: #f0f4ff;
  }

  .page-nav-btn:active:not(:disabled) {
    background: #e0eaff;
  }

  .page-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
  }

  .page-nav-btn svg {
    flex-shrink: 0;
  }

  /* ===== 入力フィールド部分 ===== */
  .page-input-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  /* テキスト入力＋プルダウンを1つのフィールドに見せるコンテナ */
  .page-input-field {
    display: inline-flex;
    align-items: stretch;
    border: 1.5px solid #d0d0d0;
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
  }

  .page-input-field:focus-within {
    border-color: #3a7bff;
    box-shadow: 0 0 0 3px rgba(58, 123, 255, 0.12);
  }

  /* テキスト入力部 */
  .page-input-text {
    width: 56px;
    border: none;
    outline: none;
    padding: 8px 8px;
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    color: #1a1a1a;
    background: transparent;
    text-align: center;
  }

  /* スピナー非表示 */
  .page-input-text::-webkit-inner-spin-button,
  .page-input-text::-webkit-outer-spin-button { -webkit-appearance: none; }
  .page-input-text[type=number] { -moz-appearance: textfield; }

  /* 区切り線 */
  .page-input-divider {
    width: 1px;
    background: #d0d0d0;
    flex-shrink: 0;
    margin: 6px 0;
    transition: background 0.15s;
  }

  .page-input-field:focus-within .page-input-divider {
    background: #b0c8ff;
  }

  /* 総ページ数表示 */
  .page-input-total {
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    border-right: 1px solid #d0d0d0;
    user-select: none;
  }

  /* プルダウン部 */
  .page-input-select-wrapper {
    position: relative;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .page-input-select {
    position: absolute;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    outline: none;
    background: transparent;
    padding: 8px 26px 8px 8px;
    font-size: 13px;
    color: #3a7bff;
    cursor: pointer;
    font-weight: 500;
    top: 0;
    left: 0;
    opacity: 0;
  }

  .page-input-select-arrow {
    pointer-events: none;
    color: #3a7bff;
    font-size: 15px;
    line-height: 1;
    pointer-events: none;
  }

  /* エラー状態 */
  .page-input-field.is-error {
    border-color: #e03e3e;
    box-shadow: 0 0 0 3px rgba(224, 62, 62, 0.1);
  }

  .page-input-error-msg {
    font-size: 11px;
    color: #e03e3e;
    min-height: 15px;
    text-align: center;
  }

/* --- タブボタン --- */
.tab-btn {
  /* ボタン標準スタイルのリセット */
  appearance: none;
  -webkit-appearance: none;
  border: none;
  font-family: inherit;
  font-size: inherit;

  padding: 8px 20px;
  background: #e0e0e0;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  flex: 0 0 calc(20% - (5px * 4 / 5));
}

.tab-btn.active {
  background: #0056ac;
  color: #fff;
}

/* フォーカス時のアクセシビリティ対応（任意ですが推奨） */
.tab-btn:focus-visible,
.page-num:focus-visible {
  outline: 2px solid #0056ac;
  outline-offset: 2px;
}

/* スマホ表示 */
@media (max-width: 929px) {
  /* ページ全体 */
  .side-blocks {
    width: 10%;
    padding: 0;
  }

  .container-has-sidebar .pdf-main-content {
    width: 90%;
    padding: 0;
  }

  .page-body {
    padding: 0 10px;
  }

  /* サイドメニュー */
  .sidebar {
    position: fixed;
    left: -220px;
    top: var(--main-top, 0px);
    width: 220px;
    height: calc(100vh - var(--main-top, 0px));
    z-index: 1000;
    background: #fff;
    transition: left 0.3s ease;
    overflow-y: auto;
  }

  .sidebar.is-open {
    left: 0;
  }

  .side-menu-toggle {
    display: block;
    position: fixed;
    left: 0;
    top: calc(var(--main-top, 0px) + 20px);
    z-index: 1001;
    width: 32px;
    height: 70px;
    background: #005bac;
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: left 0.3s ease;
  }

  .sidebar.is-open + .side-menu-toggle,
  .side-menu-toggle.open {
    left: 220px !important;
  }
  .tab-btn {
	padding: 5px 10px;
  }
  .page-input-text {
	width: auto;
    padding: 8px 4px;
	font-size: 12px;
  }
  .page-input-total {
	font-size: 12px;
  }
  .page-nav-btn {
    padding: 8px 8px;
    font-size: 12px;
  }
}