/* ==================================================================
   どの画面幅でも使えるページTop。書斎・本・過去問のどこにいても
   右下の青い栞から、現在のページの先頭へ戻れるようにする。
   ================================================================== */
.mobile-top-button {
  position: fixed;
  right: 18px;
  bottom: 22px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 94px;
  min-height: 54px;
  padding: 9px 18px;
  border: 2px solid #E8F5FF;
  border-radius: 28px;
  color: #FFFFFF;
  background: linear-gradient(160deg, #3A9BE8 0%, #1870C4 55%, #0C488E 100%);
  box-shadow: 0 5px 13px rgba(8,45,92,.48), inset 0 1px 0 rgba(255,255,255,.55);
  font: 800 18px/1.2 var(--serif);
  letter-spacing: .04em;
  cursor: pointer;
  transition: transform .16s cubic-bezier(.23,1,.32,1), box-shadow .16s cubic-bezier(.23,1,.32,1);
}
.mobile-top-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 16px rgba(8,45,92,.54), inset 0 1px 0 rgba(255,255,255,.55);
}
.mobile-top-button:active { transform: translateY(1px) scale(.97); }
.mobile-top-button:focus-visible { outline: 3px solid #FFDC70; outline-offset: 3px; }
@media (max-width: 700px) {
  /* 「管理人」と同じ大きさで、少し間を空けて右方向をはっきり示す。 */
  .profile-board h2 { display: flex; align-items: baseline; gap: 18px; flex-wrap: nowrap; white-space: nowrap; }
  .mobile-top-button {
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom) + 16px);
    min-width: 76px;
    min-height: 50px;
    padding: 8px 15px;
    font-size: 17px;
  }
  /* 模擬テストだけは下部に固定の採点欄があるため、Topボタンをその上へ逃がす。 */
  .page-moshi .mobile-top-button {
    bottom: calc(env(safe-area-inset-bottom) + 96px);
  }
}

/* 現在のページを離れてサイト入口へ戻るための、パンくず内の大きな道しるべ。 */
.breadcrumb .breadcrumb-site-top {
  min-height: 52px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  color: #FFFFFF;
  background: #B42329;
  border-radius: 4px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .02em;
  text-decoration: none;
  text-shadow: 0 1px rgba(70,14,17,.38);
  box-shadow: 0 2px 0 rgba(80,12,15,.34);
}
.breadcrumb .breadcrumb-site-top:hover {
  background: #971D22;
}
.breadcrumb .breadcrumb-site-top:focus-visible {
  outline: 3px solid #FFDC70;
  outline-offset: 3px;
}

/* スマホでは右壁の羊皮紙を、写真の下に浮かぶ小さな旅の案内書へ切り替える。
   横に長い書斎を動かさなくても、景色と説明を同じ画面で読めるようにする。 */
@media (max-width: 700px) {
  .world-landmark-scroll {
    position: fixed;
    z-index: 70;
    top: auto;
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom) + 120px);
    left: 12px;
    display: none;
    width: auto;
    height: min(250px, 31dvh);
    max-height: 250px;
  }
  .world-landmark-scroll.is-filled { display: block; }
  .world-scroll-page {
    inset: 12px 9px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 31px 24px 25px;
  }
  .world-scroll-roll {
    left: -5px;
    width: calc(100% + 10px);
    height: 22px;
  }
  .world-scroll-roll::before,
  .world-scroll-roll::after {
    top: 4px;
    width: 12px;
    height: 12px;
  }
  .world-scroll-kicker {
    margin: 0 0 7px;
    font-size: 13px;
    letter-spacing: .16em;
  }
  .world-scroll-kicker::before { margin-right: 5px; }
  .world-scroll-country {
    margin: 0 0 5px;
    padding: 2px 8px 3px;
    font-size: 13px;
  }
  .world-scroll-name {
    margin: 0 0 6px;
    padding-right: 14px;
    font-size: 24px;
    line-height: 1.22;
  }
  .world-scroll-category {
    margin: 0 0 7px;
    padding: 2px 7px;
    font-size: 12px;
  }
  .world-scroll-description {
    padding-top: 6px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.65;
  }
  .world-scroll-credit {
    position: static;
    margin: 10px 0 0;
    padding: 8px 0 0;
    border-top: 1px solid rgba(107,65,27,.30);
    font-size: 11px;
    line-height: 1.45;
  }
}

/* 窓辺の旧ソファーを、大きな三人掛けビロードソファーへ差し替える。 */
.floor-sofa {
  left: -20px;
  bottom: 58px;
  width: 700px;
  height: 394px;
  object-fit: contain;
  filter: drop-shadow(10px 14px 15px rgba(20, 9, 2, .64)) saturate(.98);
}
.page-harbor {
  min-width: 0;
  background: #1b2d38;
}
.page-harbor .site-header {
  position: relative;
  z-index: 3;
  border-bottom-color: #b28a43;
  box-shadow: 0 3px 15px rgba(16, 25, 29, .38);
}
.page-harbor #main-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
.page-harbor .site-footer {
  position: relative;
  z-index: 3;
  margin: 0;
}
.harbor-stage {
  box-sizing: border-box;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  min-height: calc(100svh - 82px);
  padding: clamp(24px, 4vw, 54px) 22px 30px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(18, 31, 38, .08) 0%, transparent 38%, rgba(17, 25, 28, .08) 60%, rgba(16, 24, 27, .38) 100%),
    url("../images/harbor-departure-north-europe-v1.webp") 50% 50% / cover no-repeat;
}
.harbor-stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 100px rgba(23, 33, 36, .18);
}
.harbor-heading {
  width: min(680px, calc(100vw - 44px));
  padding: 17px 26px 19px;
  border: 1px solid rgba(228, 190, 113, .9);
  background:
    linear-gradient(180deg, rgba(92, 51, 22, .90), rgba(57, 31, 16, .88)),
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(255,255,255,.025) 12px 13px);
  color: #f7e6bd;
  text-align: center;
  text-shadow: 0 2px 3px #241208;
  box-shadow: inset 0 0 0 3px rgba(255, 220, 151, .08), 0 7px 24px rgba(15, 22, 25, .36);
}
.harbor-heading p { margin: 0; }
.harbor-kicker {
  font-size: 12px;
  letter-spacing: .3em;
  color: #d8b46b;
}
.harbor-number {
  margin-top: 5px !important;
  font-size: 13px;
  letter-spacing: .12em;
}
body.page-harbor .harbor-heading h1 {
  margin: 5px 0 0;
  font-family: "Noto Serif JP", serif;
  font-size: clamp(31px, 4.4vw, 52px);
  letter-spacing: .13em;
  color: #fff0c9;
}
.harbor-departure-card {
  align-self: end;
  width: min(720px, calc(100vw - 44px));
  margin-top: 28px;
  padding: 22px clamp(20px, 4vw, 40px) 20px;
  border: 2px solid #bd9144;
  background:
    linear-gradient(180deg, rgba(73, 42, 21, .90), rgba(49, 29, 18, .92)),
    repeating-linear-gradient(90deg, transparent 0 11px, rgba(255,255,255,.025) 11px 12px);
  color: #f4e3bc;
  text-align: center;
  box-shadow: inset 0 0 0 4px rgba(247, 220, 158, .08), 0 9px 34px rgba(7, 15, 20, .52);
}
.harbor-card-kicker {
  margin: 0;
  color: #d9b56e;
  font-size: 12px;
  letter-spacing: .22em;
}
body.page-harbor .harbor-departure-card h2 {
  margin: 6px 0 9px;
  font-family: "Noto Serif JP", serif;
  font-size: clamp(23px, 3.4vw, 38px);
  letter-spacing: .07em;
  color: #fff0c9;
}
.harbor-departure-card > p:not(.harbor-card-kicker) {
  margin: 0;
  line-height: 1.8;
}
.harbor-actions {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 12px;
  margin-top: 18px;
}
.harbor-actions a {
  min-height: 52px;
  border: 1px solid #d3ab5d;
  text-decoration: none;
}
body.page-harbor a.harbor-board-link {
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 7px;
  align-items: center;
  padding: 10px 18px;
  background: linear-gradient(180deg, #8e581f, #593013);
  color: #fff1c8;
  box-shadow: inset 0 0 0 2px rgba(255, 228, 172, .13), 0 3px 8px rgba(8, 12, 14, .42);
}
body.page-harbor a.harbor-board-link:visited { color: #fff1c8; }
.harbor-board-link span:first-child { font-size: 12px; }
.harbor-board-link strong {
  font-family: "Noto Serif JP", serif;
  font-size: 18px;
  letter-spacing: .05em;
}
body.page-harbor a.harbor-return-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: rgba(39, 27, 20, .74);
  color: #ead9b3;
  font-size: 13px;
}
body.page-harbor .harbor-actions a:hover,
body.page-harbor .harbor-actions a:focus-visible {
  filter: brightness(1.12);
  outline: 2px solid #fff1c4;
  outline-offset: 3px;
}
.harbor-credit {
  position: absolute;
  right: 10px;
  bottom: 5px;
  margin: 0;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  text-shadow: 0 1px 3px #000;
}
@media (max-width: 700px) {
  .harbor-stage {
    min-height: calc(100svh - 58px);
    padding: 18px 12px 24px;
    background-position: 72% 50%;
  }
  .harbor-heading,
  .harbor-departure-card { width: calc(100vw - 24px); }
  .harbor-heading { padding: 13px 14px 15px; }
  .harbor-kicker { font-size: 10px; }
  .harbor-departure-card {
    margin-top: 24px;
    padding: 17px 15px 16px;
  }
  .harbor-departure-card > p:not(.harbor-card-kicker) {
    font-size: 13px;
    line-height: 1.7;
  }
  .harbor-actions { flex-direction: column; }
  .harbor-board-link { grid-template-columns: auto 1fr auto; }
  .harbor-return-link { min-height: 44px !important; }
  .harbor-credit { font-size: 9px; }
}

/* 港を経由した人だけに見せる、二枚絵の到着演出。 */
body.voyage-intro-open { overflow: hidden; }
.voyage-intro[hidden] { display: none !important; }
.voyage-intro {
  position: fixed;
  z-index: 2147483600;
  inset: 0;
  overflow: hidden;
  background: #17100c;
  color: #fff1cc;
  opacity: 1;
  transition: opacity 650ms ease;
}
.voyage-intro.is-leaving { opacity: 0; }
.voyage-intro__scene,
.voyage-intro__mist {
  position: absolute;
  inset: -2%;
}
.voyage-intro__scene {
  background-position: center;
  background-size: cover;
  filter: blur(18px) brightness(1.42) saturate(.65);
  transform: scale(1.055);
  transition: opacity 2050ms ease, filter 2500ms ease, transform 6200ms ease;
}
.voyage-intro__scene--departure {
  z-index: 1;
  opacity: .18;
  background-image: url("../images/arrival-japan-departure-v1.webp");
}
.voyage-intro__scene--arrival {
  z-index: 2;
  opacity: 0;
  background-image: url("../images/arrival-europe-from-japan-v1.webp");
}
.voyage-intro.is-running .voyage-intro__scene {
  filter: blur(0) brightness(1) saturate(1);
  transform: scale(1);
}
.voyage-intro.is-running .voyage-intro__scene--departure { opacity: 1; }
.voyage-intro.is-arrived .voyage-intro__scene--departure { opacity: 0; }
.voyage-intro.is-arrived .voyage-intro__scene--arrival { opacity: 1; }
.voyage-intro__mist {
  z-index: 3;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 24% 52%, rgba(255, 249, 226, .88), transparent 49%),
    linear-gradient(105deg, rgba(235, 242, 239, .74), transparent 55%);
  opacity: .82;
  filter: blur(20px);
  transition: opacity 3000ms ease, transform 6200ms ease;
}
.voyage-intro.is-running .voyage-intro__mist {
  opacity: .2;
  transform: translateX(-7%);
}
.voyage-intro.is-arrived .voyage-intro__mist { opacity: .06; }
.voyage-intro__caption {
  position: absolute;
  z-index: 4;
  left: clamp(22px, 6vw, 94px);
  bottom: clamp(62px, 11vh, 132px);
  max-width: min(600px, calc(100vw - 44px));
  padding: 16px 22px 18px;
  border-left: 4px solid #d8aa58;
  background: linear-gradient(90deg, rgba(31, 19, 12, .82), rgba(31, 19, 12, .15));
  text-shadow: 0 2px 8px #120b07;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 850ms ease, transform 850ms ease;
}
.voyage-intro__caption span,
.voyage-intro__caption strong { display: block; }
.voyage-intro__caption span {
  margin-bottom: 5px;
  color: #e7c98f;
  font-size: clamp(13px, 2vw, 18px);
  letter-spacing: .18em;
}
.voyage-intro__caption strong {
  font-family: "Noto Serif JP", serif;
  font-size: clamp(26px, 5vw, 54px);
  letter-spacing: .08em;
}
.voyage-intro.is-running .voyage-intro__caption--departure {
  opacity: 1;
  transform: translateY(0);
}
.voyage-intro__caption--arrival { opacity: 0; }
.voyage-intro.is-arrived .voyage-intro__caption--departure { opacity: 0; }
.voyage-intro.is-arrived .voyage-intro__caption--arrival {
  opacity: 1;
  transform: translateY(0);
}
.voyage-intro__skip {
  position: absolute;
  z-index: 5;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  min-width: 132px;
  min-height: 44px;
  border: 1px solid rgba(255, 225, 170, .7);
  border-radius: 3px;
  background: rgba(39, 24, 15, .78);
  color: #fff0cb;
  cursor: pointer;
  backdrop-filter: blur(5px);
}
.voyage-intro__skip:hover,
.voyage-intro__skip:focus-visible {
  background: rgba(91, 51, 22, .94);
  outline: 2px solid #fff0c4;
  outline-offset: 3px;
}
@media (max-width: 700px) {
  .voyage-intro__scene { background-position: 62% center; }
  .voyage-intro__caption {
    left: 14px;
    bottom: calc(max(16px, env(safe-area-inset-bottom)) + 62px);
    max-width: calc(100vw - 28px);
    padding: 12px 15px 14px;
  }
}

@media (max-width: 860px) {
  .scene-plaque {
    top: 2.5%;
    left: 50%;
    width: 400px;
    padding: 10px 16px 11px;
    transform: translateX(-50%);
  }
  .scene-plaque > span { font-size: 14px; }
  .scene-plaque h2 { font-size: 27px; }
  .scene-plaque p { display: none; }
  .scene-path {
    right: auto;
    left: 50%;
    bottom: 2.8%;
    min-width: 244px;
    min-height: 72px;
    padding: 10px 20px 11px;
    transform: translateX(-50%);
  }
  .scene-path span { font-size: 14px; }
  .scene-path strong { font-size: 22px; }
}

@media (hover: hover) and (max-width: 860px) {
  .scene-path:hover { transform: translate(-50%, -4px); }
}
@media (max-width: 860px) {
  .zone-gallery .eisha-hikari {
    opacity: .34;
  }
}
@media (prefers-reduced-motion: reduce) {
  .zone-gallery .eisha-hikari {
    opacity: .42;
    animation: none;
  }
}

/* 港では館内へ戻る木札を画面右端へ固定する。 */
.scene-path.scene-path-page-edge {
  position: fixed;
  z-index: 90;
  top: 50%;
  bottom: auto;
  width: 188px;
  min-width: 0;
  min-height: 62px;
  padding: 8px 12px 9px;
  background:
    linear-gradient(90deg, rgba(255, 231, 176, .08), transparent 22% 78%, rgba(0, 0, 0, .12)),
    linear-gradient(180deg, rgba(105, 62, 27, .72), rgba(46, 24, 9, .78));
  text-align: center;
  transform: translateY(-50%);
  box-shadow: inset 0 0 0 2px rgba(28,13,4,.30), 0 5px 13px rgba(5,2,0,.45);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.scene-path.scene-path-page-edge[hidden] { display: none; }
.scene-path.scene-path-page-edge.scene-path-next {
  right: 14px;
  left: auto;
  border-radius: 6px 0 0 6px;
}
.scene-path.scene-path-page-edge.scene-path-previous {
  right: auto;
  left: 14px;
  border-radius: 0 6px 6px 0;
}
.scene-path.scene-path-page-edge.scene-path-next span::after {
  content: " →";
  color: #F0CE7E;
}
.scene-path.scene-path-page-edge.scene-path-previous span::before {
  content: "← ";
  color: #F0CE7E;
}
.scene-path.scene-path-page-edge strong {
  margin-top: 4px;
  font-size: 17px;
  line-height: 1.35;
}
.scene-path.scene-path-page-edge span { font-size: 12px; }
@media (hover: hover) {
  .scene-path.scene-path-page-edge:hover {
    border-color: #F0CE7E;
    background: linear-gradient(180deg, rgba(142, 96, 48, .82), rgba(81, 48, 25, .86));
    transform: translateY(-50%);
  }
}
@media (max-width: 520px) {
  .scene-path.scene-path-page-edge {
    width: 150px;
    min-height: 56px;
    padding: 7px 9px 8px;
    display: none;
  }
  .scene-path.scene-path-page-edge.scene-path-next { right: 8px; }
  .scene-path.scene-path-page-edge.scene-path-previous { left: 8px; }
  .scene-path.scene-path-page-edge span { font-size: 10px; }
  .scene-path.scene-path-page-edge strong { font-size: 14px; }
}

/* 閲覧室・目録机・演習室で共通に見える、戻り札とページ栞。
   青や赤の汎用UIを避け、木と真鍮の館内備品として統一する。 */
body:not(.page-library) .breadcrumb .breadcrumb-site-top {
  color: #FFF2C7;
  border: 1px solid #C79A4F;
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(255,221,139,.14), transparent 26% 74%, rgba(0,0,0,.16)),
    linear-gradient(180deg, #86562A, #3D210D);
  box-shadow: inset 0 1px 0 rgba(255,235,176,.38), inset 0 -2px 0 rgba(27,12,4,.54), 0 3px 7px rgba(46,21,5,.28);
  text-shadow: 0 1px 2px #160803;
}
@media (hover: hover) {
  body:not(.page-library) .breadcrumb .breadcrumb-site-top:hover {
    color: #FFF9E3;
    border-color: #F1CB77;
    background: linear-gradient(180deg, #A8723B, #573016);
  }
}
