/* == Common Header Styles == */

:root {
  --bg: #0c0c0c;
  --fg: #fafaf8;
  --max-width: 1200px;
  --space: 16px;
  /* Typography tokens */
  --font-heading: "Zen Old Mincho", serif;
}
h1, h2, h3, p {
  text-align: left;
}

/* === Base Reset & Typography === */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  height: 100%;
}

body {
  margin: 0;
  padding-top: 80px;
  /* Make the page a flex column so the footer can be pushed to the bottom */
  display: flex;
  flex-direction: column;
  min-height: 100dvh; /* use dynamic viewport height for mobile address bars */

  background-color: var(--fg);
  color: var(--bg);
  font-family: var(--font-heading);
  font-optical-sizing: auto;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color-scheme: dark;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: underline;
  transition: opacity 0.2s ease;
}

a:hover {
  opacity: 0.85;
}

a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* === Font Utilities === */
.zen-old-mincho-regular {
  font-family: "Zen Old Mincho", serif;
  font-weight: 400;
}

.zen-old-mincho-black {
  font-family: "Zen Old Mincho", serif;
  font-weight: 900;
}

/* === Header Base === */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--bg);
  color: var(--fg);
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem var(--space);
}

/* === Logo === */
.header-logo img {
  height: 80px;
  width: auto;
  display: block;
}

/* === Hamburger Menu === */
.menu-button {
  width: 60px;
  height: 60px;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-button span {
  position: absolute;
  display: block;
  height: 3px;
  width: 36px;
  background-color: var(--fg);
  border-radius: 2.25px;
  transition: all 0.3s ease;
}

.menu-button span:nth-child(1) {
  top: 15px;
}

.menu-button span:nth-child(2) {
  top: 27px;
}

.menu-button span:nth-child(3) {
  top: 39px;
}

/* === Active State (X Animation) === */
.menu-button.is-active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.menu-button.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-button.is-active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* === Spacer for Fixed Header === */
.header-spacer {
  height: 56px;
}

.page-title {
  position: relative;
  display: inline-block;
}

.page-title-text {
  position: absolute;
  inset: 0;
  opacity: 0;
  user-select: text; /* コピー可能 */
}

.page-title-image {
  display: block;
  height: 80px;
  width: auto;
}

/* === Main Content Container === */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space);
}

/* === Sticky Footer Support === */
main,
.site-main {
  flex: 1 0 auto; /* take remaining vertical space */
}

/* === Headings & Paragraphs === */
h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}

p {
  margin: 0 0 1em;
}

/* === Global Heading Sizes (Standardized for Web Readability) === */
h1 {
  font-size: clamp(28px, 3.5vw, 48px);
  font-weight: 900;
}

h2 {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 900;
}

h3 {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 900;
}

p {
  font-size: clamp(15px, 1.4vw, 17px);
  font-weight: 400;
  line-height: 1.75;
}

/* === Menu Button Line Animation === */
.menu-button.is-active span:nth-child(1) {
  opacity: 0;
}

.menu-button.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-button.is-active span:nth-child(3) {
  opacity: 0;
}

/* === Overlay (Scrim) === */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(12, 12, 12, 0.6);
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 900;
}

.scrim.is-visible {
  opacity: 1;
}

.no-scroll {
  overflow: hidden;
}

.site-footer {
  background-color: #0c0c0c; /* 黒背景 */
  color: #fafaf8; /* 白文字 */
  text-align: center;
  padding: 0rem 0;
  font-family: "Zen Old Mincho", serif;
  font-size: 1.2rem;
  margin-top: auto;
}

/* === Slide-out Menu Panel === */
.menu-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(360px, 86vw);
  height: 100dvh;
  background: rgba(12, 12, 12, 0.98);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.menu-panel.is-open {
  transform: translateX(0);
}

.menu-panel__inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.menu-panel__header {
  display: flex;
  justify-content: flex-end;
}

.menu-close {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 36px;
  line-height: 1;
  width: 56px;
  height: 56px;
  cursor: pointer;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-list a {
  color: var(--fg);
  text-decoration: none;
  font-size: clamp(16px, 2.2vw, 20px);
  letter-spacing: 0.02em;
}

.menu-list a:hover {
  text-decoration: underline;
}

/* ハンバーガーのバー：変形・不透明度のアニメ */
.hamburger-bar {
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease, bottom 0.2s ease;
}

/* === ページ遷移フェード === */
.page-transition {
  position: fixed;
  inset: 0;
  background-color: #fafaf8;
  /* choose.html の背景色 */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  z-index: 2000;
}

.page-transition.is-active {
  opacity: 1;
  pointer-events: all;
}

/* === Route Fade-In (opt-in) === */
body.fade-in {
  opacity: 0;
}

body.fade-in.is-loaded {
  opacity: 1;
  transition: opacity 0.45s ease;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {

  body.fade-in,
  body.fade-in.is-loaded {
    transition: none !important;
    opacity: 1 !important;
  }
}

/* ===== Menu panel: tappable button-like items with subtle separators ===== */
#site-menu.menu-panel {
  /* ensure our overrides apply on this page without breaking common styles */
}
#site-menu .menu-panel__inner {
  padding: 16px;
}
#site-menu .menu-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
}
#site-menu .menu-list li {
  margin: 0;
}
#site-menu .menu-list li + li {
  margin-top: 10px; /* spacing between items */
}
#site-menu .menu-list a {
  position: relative;
  display: block;
  padding: 14px 16px;
  min-height: 48px; /* comfortable touch target */
  color: #fafaf8;
  text-decoration: none;
  font-family: "Zen Old Mincho", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.06s ease, filter 0.2s ease, border-color 0.2s ease;
}
/* subtle horizontal separator before each item except the first (inside padding area) */
#site-menu .menu-list li + li a::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: -6px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
#site-menu .menu-list a:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}
#site-menu .menu-list a:active {
  transform: translateY(0);
  filter: brightness(1.05);
}

/* Compact tweaks on small phones */
@media (max-width: 500px) {
  #site-menu .menu-panel__inner {
    padding: 12px;
  }
  #site-menu .menu-list li + li {
    margin-top: 8px;
  }
  #site-menu .menu-list a {
    padding: 13px 14px;
    border-radius: 10px;
  }
  #site-menu .menu-list li + li a::before {
    left: 12px;
    right: 12px;
  }
}