/* 空間介紹頁 · CIS：墨／紙／黃一擊 · 余白節奏 */

/* ——— Hero ——— */
.space-hero {
  padding: 40px 0 20px;
  text-align: left;
  border-bottom: none;
  background: var(--paper);
}

.space-hero .eyebrow {
  margin-bottom: 18px;
}

.space-hero h1 {
  font-size: clamp(2.1rem, 4.8vw, 3.4rem);
  line-height: 1.22;
  font-weight: 500;
  margin: 0;
  max-width: 12em;
  text-wrap: balance;
}

.space-hero .lede {
  max-width: 36rem;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.02rem, 1.6vw, 1.12rem);
  font-weight: 300;
  line-height: 1.9;
}

.space-hero .hero-media {
  max-width: 960px;
  margin: 36px 0 0;
}

.space-hero .hero-media img,
.floor-media img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px;
  background: var(--paper);
  box-sizing: border-box;
}

.space-hero .hero-media[hidden] {
  display: none;
}

/* ——— Markdown / Menu（展開內容） ——— */
.md-content {
  line-height: 1.85;
  color: var(--ink-soft);
  font-size: 1.02rem;
  font-weight: 300;
}

.md-content h2,
.md-content h3 {
  color: var(--ink);
  font-weight: 500;
  margin-top: 1.4em;
  margin-bottom: 0.45em;
}

.md-content p {
  margin-bottom: 0.9em;
}

.md-content ul,
.md-content ol {
  margin-bottom: 0.9em;
  padding-left: 1.2em;
}

.md-content li {
  margin-bottom: 0.4em;
}

.menu-empty {
  padding: 20px 0;
  text-align: left;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 1.05rem;
}

.menu-group {
  margin-bottom: 40px;
}

.menu-group__head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--ink);
}

.menu-group__zh {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: .04em;
}

.menu-group__en {
  font-family: var(--latin);
  font-size: .86rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item__names {
  min-width: 0;
}

.menu-item__zh {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
}

.menu-item__en {
  margin-left: .7em;
  font-family: var(--latin);
  font-size: .86rem;
  letter-spacing: .03em;
  color: var(--muted);
}

.menu-item__note {
  margin-top: 5px;
  font-size: .84rem;
  color: var(--muted);
  font-weight: 300;
}

.menu-item__price {
  flex: 0 0 auto;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.menu-item__price .now {
  font-family: var(--latin);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.menu-item__price .orig {
  display: block;
  margin-top: 2px;
  font-size: .78rem;
  color: var(--muted);
}

.menu-notice {
  margin-top: 8px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .84rem;
  color: var(--ink-soft);
}

@media (max-width: 640px) {
  .menu-item__en {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }
}

/* ——— 樓層目錄 ——— */
.space-dir {
  padding: 8px 0 72px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.space-dir__wrap {
  /* inherits .wrap from markup */
}

.space-dir__cue {
  margin: 0 0 20px;
  padding: 0;
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: var(--latin);
}

.space-dir__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}

.space-dir__viz {
  position: sticky;
  top: 90px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
  min-height: 420px;
  padding: 0;
  margin: 0;
}

.space-dir__svg {
  width: 100%;
  max-height: 520px;
  height: auto;
  overflow: hidden;
  display: block;
}

.space-dir__side {
  min-width: 0;
  padding-top: 0;
}

.space-dir__floor {
  cursor: pointer;
  outline: none;
  transition: opacity .35s ease, transform .45s cubic-bezier(.22, 1, .36, 1);
  transform-box: fill-box;
  transform-origin: center;
}

.space-dir__floor:focus-visible .slab-top {
  stroke: var(--ink);
  stroke-width: 2.2;
}

.space-dir__floor .slab-top {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 1.35;
  transition: fill .3s ease, stroke .3s ease, stroke-width .3s ease;
}

.space-dir__floor .slab-side {
  fill: var(--paper-deep);
  stroke: var(--ink);
  stroke-width: 1.1;
  opacity: .92;
}

.space-dir__floor .slab-face {
  fill: var(--paper-alt);
  stroke: var(--ink);
  stroke-width: 1.1;
}

.space-dir__floor .furn {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .72;
}

.space-dir__floor .furn-fill {
  fill: var(--paper-deep);
  stroke: var(--ink-soft);
  stroke-width: 1;
  opacity: .85;
}

.space-dir__floor .accent-dot {
  fill: var(--accent);
  stroke: none;
  opacity: 0;
  transition: opacity .3s ease;
}

.space-dir__floor.is-dim {
  opacity: .34;
}

.space-dir__floor.is-active {
  opacity: 1;
  transform: translate(0, -8px);
}

/* 黃一擊：只在等角圖選中樓板 */
.space-dir__floor.is-active .slab-top {
  fill: var(--accent);
  stroke: var(--ink);
  stroke-width: 1.8;
}

.space-dir__floor.is-active .accent-dot {
  opacity: 0; /* 黃已在樓板，不再多一點 */
}

.space-dir__floor:hover:not(.is-active) {
  opacity: .72;
}

.space-dir__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1.5px solid var(--ink);
  min-width: 0;
}

.space-dir__item {
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.space-dir__btn {
  all: unset;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr) 1.25rem;
  gap: 10px 14px;
  width: 100%;
  padding: 18px 4px 18px 0;
  cursor: pointer;
  transition: background .2s ease;
}

.space-dir__btn:hover,
.space-dir__btn:focus-visible {
  background: transparent;
}

.space-dir__btn:hover .space-dir__name,
.space-dir__btn:focus-visible .space-dir__name {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

.space-dir__btn[aria-pressed="true"] {
  background: transparent;
}

.space-dir__btn[aria-pressed="true"] .space-dir__no {
  color: var(--ink);
}

.space-dir__item.is-open .space-dir__btn {
  padding-bottom: 10px;
}

.space-dir__item.is-open .space-dir__hint {
  display: none;
}

.space-dir__no {
  font-family: var(--latin);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--muted);
  align-self: start;
  padding-top: .12em;
}

.space-dir__meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

.space-dir__kicker {
  display: block;
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3em;
  font-family: var(--latin);
}

.space-dir__name {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.12rem, 2vw, 1.38rem);
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
}

.space-dir__hint {
  display: block;
  margin-top: .4em;
  font-size: .86rem;
  color: var(--ink-soft);
  font-weight: 300;
  line-height: 1.55;
}

.space-dir__chev {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.45em;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .3s ease, border-color .2s ease;
  justify-self: end;
  align-self: start;
}

.space-dir__btn[aria-expanded="true"] .space-dir__chev {
  transform: rotate(225deg);
  margin-top: 0.75em;
  border-color: var(--ink);
}

/* ——— 手風琴詳情（非卡片） ——— */
.space-panel--accordion {
  padding: 0 !important;
  background: transparent;
  border-bottom: none;
  max-width: none;
  width: 100%;
  margin: 0;
  display: block;
}

.space-panel--accordion[hidden] {
  display: none !important;
}

.space-panel--accordion .space-panel__inner {
  max-width: none;
  margin: 0;
  padding: 4px 1.5rem 22px 3.4rem;
  animation: space-panel-in .35s cubic-bezier(.22, 1, .36, 1) both;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.space-panel--accordion .space-panel__head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: 14px 0 0;
  padding: 0;
  border-bottom: none;
  order: 10;
}

.space-panel--accordion .space-panel__no,
.space-panel--accordion .space-panel__title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.space-panel--accordion .floor-media {
  order: 1;
  max-width: 100%;
  margin: 12px 0 16px;
}

.space-panel--accordion .space-panel__close {
  all: unset;
  box-sizing: border-box;
  cursor: pointer;
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.space-panel--accordion .space-panel__close:hover,
.space-panel--accordion .space-panel__close:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.space-panel--accordion .md-content {
  order: 2;
  max-width: none;
}

.space-panel--accordion .space-panel__menu {
  order: 3;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.space-panel--accordion .space-panel__menu[hidden] {
  display: none;
}

.space-panel--accordion .space-panel__menu-title {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 500;
  margin: 0 0 18px;
}

@keyframes space-panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 860px) {
  .space-hero {
    padding: 36px 0 20px;
  }

  .space-hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.4rem);
  }

  .space-dir {
    padding: 4px 0 56px;
  }

  .space-dir__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .space-dir__viz {
    position: relative;
    top: auto;
    padding: 0 0 4px;
  }

  .space-dir__svg {
    margin: 0 auto;
  }

  .space-dir__cue {
    text-align: left;
    margin-bottom: 14px;
  }

  .space-dir__btn {
    grid-template-columns: 2.8rem minmax(0, 1fr) 1.1rem;
    padding: 16px 2px;
  }

  .space-panel--accordion .space-panel__inner {
    padding-left: 2.8rem;
    padding-right: 0.5rem;
  }
}

@media (max-width: 720px) {
  .space-dir__viz {
    min-height: 320px;
  }

  .space-dir__svg {
    max-height: 380px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .space-dir__floor,
  .space-dir__floor .slab-top,
  .space-dir__floor .accent-dot,
  .space-dir__chev,
  .space-panel--accordion .space-panel__inner {
    transition: none !important;
    animation: none !important;
  }

  .space-dir__floor.is-active {
    transform: none;
  }
}
