/* common.css — Global tokens, typography, navigation, sticky tool rail, shared components, dialogs, responsive shell */

:root {
  --bg: #f6f9fb;
  --surface: #fff;
  --surface-2: #f0f5f8;
  --surface-3: #e8f0f5;
  --text: #1c3443;
  --text-2: #4c6574;
  --text-3: #546b78;
  --blue: #285f7f;
  --blue-deep: #193d55;
  --accent: #7ccef4;
  --line: #dce7ed;
  --line-strong: #c5d7e1;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 12px 40px rgba(27,62,83,.065);
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --font-sans: "Noto Sans JP","Yu Gothic",sans-serif;
  --font-en: "Inter","Noto Sans JP",sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 128px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font: 400 15px/1.75 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.35;
  letter-spacing: -.025em;
}

h1 {
  font-size: clamp(36px,4.2vw,56px);
  font-weight: 700;
}

h2 {
  font-size: clamp(25px,2.6vw,34px);
  font-weight: 700;
}

h3 {
  font-size: clamp(19px,2vw,25px);
  font-weight: 650;
}

p {
  color: var(--text-2);
}

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: -80px;
  left: 16px;
  background: #fff;
  padding: 12px 16px;
  border: 2px solid var(--blue);
}

.skip-link:focus {
  top: 12px;
}

.eyebrow {
  color: var(--blue);
  font: 700 11px/1.6 var(--font-en);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eyebrow--light {
  color: #b4e4f7;
}

.note-text {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 16px;
}

.site-head {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.site-head__inner {
  height: 100%;
  max-width: 1680px;
  margin: auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.045em;
  white-space: nowrap;
}

.brand__mark {
  width: 32px;
  height: 32px;
  background: var(--blue-deep);
  color: #fff;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font: 26px/1 var(--font-en);
}

.brand__sub {
  font: 600 10px var(--font-en);
  color: var(--text-3);
  letter-spacing: .13em;
  border-left: 1px solid var(--line-strong);
  padding-left: 12px;
}

.site-head__note {
  color: var(--text-3);
  font: 600 10px var(--font-en);
  letter-spacing: .16em;
}

.site-head__note span {
  margin: 0 12px;
  color: #a3b7c2;
}

.tabs {
  position: sticky;
  top: 0;
  background: #f8fafc;
  border-bottom: 1px solid var(--line-strong);
  z-index: 50;
}

.tabs__inner {
  display: flex;
  max-width: 1680px;
  margin: auto;
  padding: 0 32px;
  height: 56px;
  align-items: stretch;
  gap: 4px;
}

.page-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 112px;
  padding: 0 16px;
  color: var(--text-2);
  font: 700 12px/1.3 var(--font-en);
  letter-spacing: .045em;
  border-bottom: 3px solid transparent;
  transition: background .2s,color .2s;
}

.page-tab:hover {
  background: #edf3f7;
  color: var(--blue);
}

.page-tab.is-active {
  background: #fff;
  color: var(--blue-deep);
  border-bottom-color: var(--blue);
}

.page-tab__idx {
  font-size: 10px;
  font-weight: 500;
  color: #7d94a2;
}

.mobile-navigation,
.menu-toggle {
  display: none;
}

.workspace {
  max-width: 1680px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 64px minmax(0,1fr) 246px;
  min-height: calc(100vh - 112px);
}

.workspace.is-panel-collapsed {
  grid-template-columns: 64px minmax(0,1fr);
}

.workspace.is-panel-collapsed .context-panel {
  display: none;
}

.tool-rail {
  background: #f3f7fa;
  border-right: 1px solid var(--line);
  padding: 24px 8px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
}

.rail-tool {
  height: 44px;
  width: 44px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  background: transparent;
  font: 27px/1 var(--font-en);
  transition: background .2s;
}

.rail-tool:hover {
  background: #e4eff5;
  color: var(--blue-deep);
}

.rail-divider {
  width: 28px;
  height: 1px;
  background: var(--line-strong);
  margin: 8px 0;
}

.canvas-wrap {
  min-width: 0;
  padding: 24px 32px 0;
  background: var(--bg);
}

.document-bar {
  height: 40px;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  color: var(--text-2);
  font: 600 11px/1 var(--font-en);
  letter-spacing: .035em;
}

.document-bar__dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--blue);
}

.document-bar__view {
  font-weight: 500;
  font-size: 10px;
  color: var(--text-3);
}

.canvas {
  background: #fff;
  border: 1px solid var(--line);
  min-height: 75vh;
  box-shadow: var(--shadow);
  padding: clamp(24px,3.2vw,56px);
}

.site-footer {
  padding: 24px 0 32px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font: 500 11px/1.4 var(--font-en);
  letter-spacing: .06em;
  color: var(--text-3);
}

.context-panel {
  background: #f2f6f9;
  border-left: 1px solid var(--line);
  padding: 32px 20px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.context-panel__eyebrow {
  color: var(--text-3);
  font: 600 10px var(--font-en);
  letter-spacing: .15em;
}

.context-panel__head {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-strong);
  margin-bottom: 16px;
}

.context-panel__head h2 {
  margin-top: 4px;
  font: 700 14px/1.3 var(--font-en);
  letter-spacing: .08em;
}

.toc {
  display: grid;
  gap: 4px;
}

.toc-link {
  min-height: 42px;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  color: var(--text-2);
  border-radius: 6px;
  font: 600 11px/1.5 var(--font-en);
  transition: background .2s;
}

.toc-link span {
  font-size: 10px;
  color: var(--text-3);
}

.toc-link:hover,
.toc-link.is-current {
  background: #e1edf4;
  color: var(--blue-deep);
}

.toc-link.is-current {
  box-shadow: inset 2px 0 var(--blue);
}

.panel-meta {
  margin-top: 40px;
  display: grid;
  gap: 16px;
  font: 500 10px var(--font-en);
  color: var(--text-3);
  letter-spacing: .08em;
}

.panel-meta__line {
  height: 1px;
  background: var(--line-strong);
}

.context-panel__extra {
  margin-top: 24px;
}

.mobile-panel-toggle,
.panel-scrim {
  display: none;
}

.page-intro {
  padding: 8px 0 40px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}

.page-intro h1 {
  font-family: var(--font-en);
  margin: 12px 0 16px;
}

.page-intro p:last-child {
  font-size: 15px;
}

.page-intro--tight {
  margin-bottom: 24px;
  padding-bottom: 24px;
}

.section {
  padding: 16px 0 40px;
  scroll-margin-top: 120px;
}

.section--with-rule {
  border-top: 1px solid var(--line);
  padding-top: 48px;
  margin-top: 8px;
}

.section-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 24px;
}

.section-header h2 {
  margin-top: 8px;
}

.section-lead {
  font-size: 14px;
  line-height: 1.8;
  margin-top: 10px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  min-height: 48px;
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .015em;
  transition: background .2s,transform .2s,color .2s;
  white-space: normal;
  text-align: center;
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button--primary {
  background: var(--blue);
  color: #fff;
}

.button--primary:hover {
  background: var(--blue-deep);
}

.button--light {
  background: #fff;
  color: #17384e;
}

.button--light:hover {
  background: #eaf3f8;
}

.button--ghost-light {
  background: transparent;
  color: #fff;
  border-color: #9fb8c8;
}

.button--ghost-light:hover {
  background: rgba(255,255,255,.12);
}

.button--outline {
  background: #fff;
  color: var(--blue);
  border-color: var(--line-strong);
}

.button--outline:hover {
  background: #eff6f9;
}

.button--small {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 12px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  margin-top: 24px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--blue);
  color: var(--blue-deep);
  font: 700 12px/1.5 var(--font-en);
  letter-spacing: .05em;
}

.text-link:hover {
  color: var(--blue);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  font-size: 11px;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  border-radius: 40px;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 16px;
}

.feature-link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  min-height: 205px;
  border: 1px solid var(--line);
  background: #fff;
  transition: background .2s,border-color .2s;
}

.feature-link:hover {
  background: #f5fafc;
  border-color: #abc9da;
}

.feature-link__no {
  font: 700 11px var(--font-en);
  letter-spacing: .1em;
  color: var(--blue);
}

.feature-link strong {
  font-size: 22px;
  line-height: 1.4;
}

.feature-link>span:nth-child(3) {
  font-size: 13px;
  color: var(--text-2);
}

.feature-link__arrow {
  position: absolute;
  right: 24px;
  top: 24px;
  color: var(--blue);
  font-size: 18px;
}

.bottom-cta {
  padding: 32px;
  background: #eff5f8;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 16px;
  margin-top: 32px;
}

.bottom-cta p {
  font-size: 14px;
}

.notice {
  padding: 20px 24px;
  border-left: 3px solid var(--blue);
  display: grid;
  gap: 4px;
  background: var(--surface-2);
  font-size: 13px;
}

.notice span {
  color: var(--text-2);
}

.art-placeholder {
  background: #e5edf3;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  color: #44677c;
  font: 700 14px var(--font-en);
  letter-spacing: .08em;
  text-align: center;
  padding: 24px;
}

.art-placeholder--powder {
  background: #e3edf4;
}

.art-placeholder--lavender {
  background: #e9e7f0;
}

.art-placeholder--mint {
  background: #e2eeec;
}

.art-placeholder--peach {
  background: #efe7e4;
}

.art-placeholder--stone {
  background: #e9ecef;
}

.art-placeholder__cross {
  font-size: 60px;
  font-weight: 400;
  line-height: 1;
  color: #95b4c6;
}

.art-placeholder small {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  color: #687f8e;
}

.profile-placeholder {
  aspect-ratio: 1/1;
  border: 1px solid var(--line-strong);
  background: #e8f1f7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  position: relative;
  padding: 24px;
}

.profile-placeholder__file {
  position: absolute;
  left: 14px;
  top: 14px;
  font: 600 11px var(--font-en);
  color: var(--text-2);
}

.profile-placeholder__icon {
  font-size: 88px;
  font-weight: 400;
  line-height: 1;
  color: #8aafc5;
}

.profile-placeholder__label {
  position: absolute;
  bottom: 14px;
  font: 500 10px var(--font-en);
  letter-spacing: .08em;
  color: var(--text-3);
}

.profile-placeholder--large {
  width: 100%;
  max-width: 320px;
}

.field input,
.field textarea,
.search-field input,
.gallery-mobile-filters select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #bfcfda;
  background: #fff;
  border-radius: 6px;
  padding: 12px 16px;
  outline: 0;
  color: var(--text);
  transition: border-color .2s,box-shadow .2s;
}

.field textarea {
  resize: vertical;
  min-height: 180px;
}

.field input:focus,
.field textarea:focus,
.search-field input:focus,
.gallery-mobile-filters select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(40,95,127,.14);
}

.field input::placeholder,
.field textarea::placeholder,
.search-field input::placeholder {
  color: #748b98;
}

.artwork-data {
  display: grid;
  grid-template-columns: 120px 1fr;
  row-gap: 16px;
  column-gap: 24px;
  font-size: 13px;
}

.artwork-data dt {
  color: var(--text-3);
}

.artwork-data dd {
  margin: 0;
  color: var(--text);
}

.dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16,33,47,.72);
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
}

.dialog {
  background: #fff;
  width: min(100%,1080px);
  max-height: min(88vh,900px);
  overflow: auto;
  box-shadow: 0 20px 70px rgba(0,0,0,.18);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.dialog__head {
  min-height: 56px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dialog__head p {
  font: 700 12px var(--font-en);
  color: var(--blue-deep);
}

.dialog__close {
  border: 0;
  background: transparent;
  font-size: 28px;
  color: var(--text);
  width: 40px;
  height: 40px;
}

.dialog__body {
  display: grid;
  grid-template-columns: minmax(0,7fr) minmax(220px,3fr);
  gap: 0;
  min-height: 340px;
}

.dialog__art {
  background: #e6edf3;
  min-height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.dialog__art img {
  height: auto;
  max-height: 75vh;
  max-width: 100%;
  object-fit: contain;
}

.dialog__art .art-placeholder {
  width: 100%;
  height: 100%;
  min-height: 460px;
}

.dialog__info {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: start;
  gap: 16px;
}

.dialog__info h2 {
  font-size: 24px;
}

.dialog__info p {
  font-size: 13px;
}

.dialog__pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: auto;
  padding-top: 24px;
}

.dialog__pager button {
  background: #fff;
  border: 1px solid var(--line-strong);
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 5px;
  color: var(--blue-deep);
}

.dialog__pager button:disabled {
  opacity: .45;
}

/* Sticky toolbar fix: grid column stays full height, inner controls stay in view. */
.tool-rail {
  display: block;
  padding: 0 8px;
  align-self: stretch;
}
.tool-rail__inner {
  position: sticky;
  top: 80px; /* 56px fixed tab bar + 24px breathing room */
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  padding: 24px 0;
  z-index: 5;
}
.context-panel {
  align-self: start; /* Prevent sticky element stretching to grid height. */
}

@media (max-width:1120px) {
  .workspace {
    grid-template-columns: 56px minmax(0,1fr) 208px;
  }

  .context-panel {
    padding: 24px 12px;
  }

  .canvas-wrap {
    padding: 16px 16px 0;
  }

  .canvas {
    padding: 32px;
  }

  .page-tab {
    min-width: 96px;
    padding: 0 8px;
  }

  .tabs__inner {
    padding: 0 16px;
  }
}

@media (max-width:900px) {
  .workspace {
    grid-template-columns: 56px minmax(0,1fr);
  }

  .context-panel {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    height: auto;
    max-height: 75vh;
    overflow: auto;
    z-index: 100;
    padding: 24px;
    border-top: 1px solid var(--line-strong);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -20px 60px rgba(18,44,65,.12);
  }

  .workspace.is-mobile-panel-open .context-panel {
    display: block;
  }

  .workspace.is-panel-collapsed {
    grid-template-columns: 56px minmax(0,1fr);
  }

  .mobile-panel-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 70;
    border: 1px solid #fff;
    background: var(--blue-deep);
    color: #fff;
    border-radius: 36px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    box-shadow: 0 8px 24px rgba(23,53,71,.16);
    font-weight: 650;
    font-size: 12px;
  }

  .panel-scrim:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(26,48,65,.35);
    z-index: 90;
  }

  .toc {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .context-panel__head {
    padding-bottom: 16px;
  }

  .panel-meta {
    display: none;
  }

  .context-panel__extra {
    margin-top: 16px;
  }

  .site-footer {
    padding-bottom: 88px;
  }
}

@media (max-width:680px) {
  html {
    scroll-padding-top: 80px;
  }

  .site-head {
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 60;
  }

  .site-head__inner {
    padding: 0 20px;
  }

  .site-head__note,
  .brand__sub,
  .tabs,
  .tool-rail {
    display: none;
  }

  .menu-toggle {
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    min-width: 44px;
    height: 44px;
  }

  .hamburger {
    width: 19px;
    height: 2px;
    background: var(--text);
    position: relative;
    display: block;
  }

  .hamburger:before,
  .hamburger:after {
    content: "";
    width: 19px;
    height: 2px;
    background: var(--text);
    position: absolute;
    left: 0;
  }

  .hamburger:before {
    top: -6px;
  }

  .hamburger:after {
    top: 6px;
  }

  .mobile-navigation:not([hidden]) {
    display: grid;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: #fff;
    z-index: 59;
    padding: 12px 20px 20px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .mobile-navigation a {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    font: 700 13px var(--font-en);
  }

  .mobile-navigation a[aria-current="page"] {
    color: var(--blue);
    background: #f1f6f9;
  }

  .workspace,
  .workspace.is-panel-collapsed {
    display: block;
  }

  .canvas-wrap {
    padding: 0;
    background: #fff;
  }

  .document-bar {
    display: none;
  }

  .canvas {
    border: 0;
    box-shadow: none;
    padding: 24px 20px 32px;
  }

  .site-footer {
    padding: 24px 20px 100px;
    border-top: 1px solid var(--line);
  }

  .page-intro {
    padding: 24px 0 32px;
    margin-bottom: 32px;
  }

  .page-intro h1 {
    font-size: 42px;
  }

  .section {
    padding: 8px 0 32px;
    scroll-margin-top: 88px;
  }

  .section--with-rule {
    padding-top: 40px;
  }

  .section-header {
    margin-bottom: 20px;
  }

  .section-header h2 {
    font-size: 28px;
  }

  .profile-placeholder--large {
    max-width: 220px;
  }

  .link-grid {
    grid-template-columns: 1fr;
  }

  .feature-link {
    padding: 24px;
    min-height: 156px;
  }

  .art-placeholder__cross {
    font-size: 40px;
  }

  .art-placeholder {
    font-size: 11px;
    gap: 6px;
    padding: 12px;
  }

  .art-placeholder small {
    font-size: 10px;
  }

  .dialog-overlay {
    padding: 12px;
  }

  .dialog {
    max-height: 92vh;
  }

  .dialog__body {
    grid-template-columns: 1fr;
  }

  .dialog__art,
  .dialog__art .art-placeholder {
    min-height: 260px;
    max-height: 48vh;
  }

  .dialog__art .art-placeholder {
    height: 280px;
  }

  .dialog__info {
    padding: 20px;
    gap: 12px;
  }

  .dialog__info h2 {
    font-size: 21px;
  }

  .dialog__head {
    padding: 8px 16px;
  }
}

@media (max-width:380px) {
  .button-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion:reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* Keep fallback images readable without adding heavy visual treatment. */
.dialog__art > .art-image{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;}

/* 矢印の文字表示を統一 */
.button [aria-hidden="true"],
.feature-link__arrow,
.rail-tool [aria-hidden="true"] {
    font-family: Arial, Helvetica, sans-serif;
    font-variant-emoji: text;
}

/* 新しいヘッダーロゴ */
.brand__logo {
    display: block;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: contain;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .brand__logo {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
}