/* ==========================================================
   3Dマップ / スライドショー / 物件詳細
   ========================================================== */

/* ---------- Map search (home) ---------- */
.map-search {
  display: grid; grid-template-columns: 360px 1fr; height: min(78vh, 760px); min-height: 560px;
  background: var(--paper); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.map-side { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-height: 0; }
.map-side__filters { padding: 16px; border-bottom: 1px solid var(--line); display: grid; gap: 12px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--grey-soft); border-radius: 999px; padding: 4px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 7px 4px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.area-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.area-chips::-webkit-scrollbar { display: none; }
.area-chip {
  flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font-size: .8rem;
  display: inline-flex; gap: 6px; align-items: center;
}
.area-chip b { font-size: .7rem; background: var(--brand-soft); color: var(--brand); border-radius: 999px; padding: 0 6px; }
.area-chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.area-chip[aria-pressed="true"] b { background: var(--brand); color: #fff; }
.map-side__row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.map-side__row .field { flex: 1; }
.map-side__count { padding: 10px 16px; font-size: .8rem; color: var(--muted); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 700; font-size: .8rem; }
.link-btn:hover { text-decoration: underline; }
.map-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; display: grid; gap: 6px; align-content: start; }
.map-item {
  display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 8px; border-radius: 10px; cursor: pointer; border: 1px solid transparent;
  transition: background .15s, border-color .15s; text-align: left; width: 100%; background: transparent;
}
.map-item:hover, .map-item.is-active { background: var(--cream); border-color: var(--line); }
.map-item img { width: 72px; height: 56px; object-fit: cover; border-radius: 8px; }
.map-item__name { font-weight: 700; font-size: .9rem; display: block; line-height: 1.4; }
.map-item__sub { font-size: .75rem; color: var(--muted); display: block; }
.map-item__price { font-family: var(--ff-head); font-weight: 800; color: var(--brand); font-size: 1rem; }
.map-item__top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.map-item .status { font-size: .65rem; padding: 1px 8px; }

.map-wrap { position: relative; min-height: 0; }
.map { position: absolute; inset: 0; }
.map-tools {
  position: absolute; left: 12px; top: 12px; z-index: 2; display: flex; gap: 6px; flex-wrap: wrap;
}
.map-tool {
  border: 0; background: rgba(255,255,255,.95); box-shadow: var(--shadow-sm); border-radius: 999px; padding: 7px 14px; font-size: .8rem; font-weight: 700; color: var(--navy);
}
.map-tool[aria-pressed="true"] { background: var(--navy); color: #fff; }
.map-legend {
  position: absolute; right: 12px; bottom: 28px; z-index: 2; background: rgba(255,255,255,.95); border-radius: 10px; padding: 8px 12px; font-size: .72rem;
  box-shadow: var(--shadow-sm); display: grid; gap: 4px;
}
.map-legend span { display: flex; align-items: center; gap: 6px; }
.map-legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.map-hint { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 2; background: rgba(11, 37, 69,.85); color: #fff; font-size: .75rem; padding: 6px 14px; border-radius: 999px; pointer-events: none; transition: opacity .6s; white-space: nowrap; }
.map-hint.is-hidden { opacity: 0; }

.map-fallback { display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--grey-soft) 0 12px, #f6f7f9 12px 24px); }
.map-fallback__msg { background: #fff; padding: 20px 24px; border-radius: var(--radius); max-width: 360px; display: grid; gap: 6px; text-align: center; box-shadow: var(--shadow-sm); font-size: .9rem; color: var(--muted); }
.map-fallback__msg b { color: var(--navy); }

/* mobile: map on top, list as drawer */
@media (max-width: 900px) {
  .map-search { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .map-side { display: contents; }
  .map-side__filters { order: 1; border-bottom: 1px solid var(--line); }
  .map-wrap { order: 2; height: 56vh; }
  .map-side__count { order: 3; border-top: 1px solid var(--line); }
  .map-list { order: 4; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; padding: 10px; gap: 10px; }
  .map-item { flex: 0 0 78%; scroll-snap-align: start; border-color: var(--line); background: #fff; }
  .map-legend { display: none; }
}

/* ---------- Pins ---------- */
.pin {
  border: 0; padding: 0; background: transparent; display: flex; align-items: center; gap: 0;
  filter: drop-shadow(0 4px 6px rgba(11, 37, 69,.35)); transition: transform .2s; transform-origin: bottom center; position: relative;
}
.pin::after {
  content: ''; position: absolute; left: 16px; bottom: -7px; border: 7px solid transparent; border-top-color: var(--pin-c); border-bottom: 0;
}
.pin__icon {
  width: 32px; height: 32px; border-radius: 50%; background: var(--pin-c); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 1rem;
  border: 2px solid #fff; z-index: 1;
}
.pin__price {
  background: #fff; color: var(--navy); font-weight: 800; font-size: .75rem; padding: 3px 10px 3px 14px; margin-left: -10px; border-radius: 0 999px 999px 0;
  white-space: nowrap;
}
.pin--apartment { --pin-c: var(--brand); }
.pin--parking { --pin-c: var(--navy); }
.pin--full { opacity: .72; }
.pin--full .pin__icon { filter: saturate(.35); }
.pin:hover, .pin.is-active { transform: scale(1.18); z-index: 10; }
.pin.is-active .pin__price { background: var(--navy); color: #fff; }
.pin.is-hidden { display: none; }

.station-pin span {
  background: var(--navy); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 6px; white-space: nowrap; display: block;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.office-pin { display: flex; align-items: center; gap: 6px; background: #fff; padding: 4px 10px 4px 4px; border-radius: 999px; font-size: .75rem; font-weight: 800; color: var(--navy); box-shadow: var(--shadow-sm); cursor: pointer; border: 2px solid var(--brand); }
.office-pin__sun { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 50% 70%, var(--brand-2), var(--brand) 60%); position: relative; overflow: hidden; }
.office-pin__sun::after { content: ''; position: absolute; inset: 62% 0 0; background: var(--navy); }

/* popup */
.maplibregl-popup-content { padding: 0; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); font-family: var(--ff); }
.maplibregl-popup-close-button { font-size: 18px; width: 28px; height: 28px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); z-index: 2; }
.map-popup { display: block; text-decoration: none; color: var(--ink); width: 260px; }
.map-popup img { width: 100%; height: 130px; object-fit: cover; }
.map-popup__body { padding: 10px 14px 12px; display: grid; gap: 2px; }
.map-popup__body .status { justify-self: start; font-size: .65rem; }
.map-popup__body strong { font-size: .95rem; }
.map-popup__body span { font-size: .78rem; color: var(--muted); }
.map-popup .price { font-size: 1.2rem; }
.map-popup__more { color: var(--brand) !important; font-weight: 700; }
.map-popup--text { padding: 12px 14px; display: grid; gap: 2px; width: auto; }
.map-popup--text span { font-size: .78rem; color: var(--muted); }

/* ---------- Slideshow ---------- */
.slideshow { outline: none; }
.ss__stage { position: relative; overflow: hidden; border-radius: var(--radius); background: #081a33; aspect-ratio: 3 / 2; touch-action: pan-y; user-select: none; cursor: grab; }
.ss__stage:active { cursor: grabbing; }
.ss__track { display: flex; height: 100%; transition: transform .5s cubic-bezier(.22,.8,.25,1); }
.ss__slide { flex: 0 0 100%; margin: 0; height: 100%; }
.ss__slide img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ss__nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); color: var(--navy); font-size: 1.8rem; line-height: 1; display: grid; place-items: center; padding-bottom: 4px;
  box-shadow: var(--shadow-sm); opacity: .85; transition: opacity .2s, transform .2s;
}
.ss__nav:hover { opacity: 1; transform: translateY(-50%) scale(1.06); }
.ss__nav--prev { left: 14px; } .ss__nav--next { right: 14px; }
.ss__bar { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 12px; display: flex; justify-content: space-between; align-items: center; background: linear-gradient(transparent, rgba(0,0,0,.55)); color: #fff; pointer-events: none; }
.ss__counter { font-size: .85rem; font-weight: 700; letter-spacing: .05em; background: rgba(0,0,0,.35); padding: 2px 10px; border-radius: 999px; }
.ss__tools { display: flex; gap: 6px; pointer-events: auto; }
.ss__tool { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(6px); font-size: .9rem; }
.ss__tool:hover { background: rgba(255,255,255,.35); }
.ss__progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255,255,255,.15); }
.ss__progress span { display: block; height: 100%; width: 0; background: var(--brand); }
.ss__thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.ss__thumb { flex: 0 0 96px; aspect-ratio: 3 / 2; border: 2px solid transparent; border-radius: 8px; overflow: hidden; padding: 0; background: var(--grey-soft); opacity: .6; transition: opacity .2s, border-color .2s; }
.ss__thumb img { width: 100%; height: 100%; object-fit: cover; }
.ss__thumb:hover { opacity: .9; }
.ss__thumb.is-active { opacity: 1; border-color: var(--brand); }

/* 写真が1枚のときは送りボタン・枚数・サムネイルを隠す */
.slideshow.is-single .ss__nav, .slideshow.is-single .ss__counter, .slideshow.is-single .ss__thumbs { display: none; }
.slideshow.is-single .ss__stage { cursor: default; }
.slideshow.is-placeholder .ss__bar, .slideshow.is-placeholder .ss__progress { display: none; }
.slideshow.is-full { position: fixed; inset: 0; z-index: 1000; background: rgba(8,14,25,.96); display: flex; flex-direction: column; padding: 16px; }
.slideshow.is-full .ss__stage { flex: 1; aspect-ratio: auto; background: transparent; border-radius: 0; }
.slideshow.is-full .ss__slide img { object-fit: contain; }
.slideshow.is-full .ss__thumbs { justify-content: center; }
@media (max-width: 600px) {
  .ss__nav { width: 38px; height: 38px; font-size: 1.5rem; }
  .ss__thumb { flex-basis: 72px; }
}

/* ---------- Detail page ---------- */
.detail { padding: 28px 0 80px; }
.detail__head { display: flex; justify-content: space-between; gap: 16px; align-items: end; flex-wrap: wrap; margin-bottom: 20px; }
.detail__head h1 { font-family: var(--ff-head); font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin: 6px 0 4px; }
.detail__addr { color: var(--muted); margin: 0; font-size: .92rem; }
.detail__tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.detail__price { text-align: right; }
.detail__price .price { font-size: 2.4rem; display: block; line-height: 1.1; }
.detail__price small { color: var(--muted); }
.detail__grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.detail__aside { position: sticky; top: calc(var(--header-h) + 16px); display: grid; gap: 16px; }
@media (max-width: 960px) {
  .detail__grid { grid-template-columns: minmax(0, 1fr); }
  .detail__aside { position: static; }
  .detail__price { text-align: left; }
}
.block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-top: 24px; }
.block h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.block h2::before { content: ''; width: 4px; height: 1.1em; background: var(--brand); border-radius: 2px; }
.keyfacts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px; }
.keyfact { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.keyfact b { display: block; font-family: var(--ff-head); font-size: 1.35rem; color: var(--navy); }
.keyfact span { font-size: .75rem; color: var(--muted); }
@media (max-width: 600px) { .keyfacts { grid-template-columns: repeat(2, 1fr); } }
.spec { width: 100%; border-collapse: collapse; font-size: .92rem; }
.spec th, .spec td { border-bottom: 1px solid var(--line); padding: 12px 8px; text-align: left; vertical-align: top; }
.spec th { width: 32%; color: var(--muted); font-weight: 700; font-size: .82rem; background: var(--cream); }
.features { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.features li { background: var(--brand-soft); color: var(--brand-ink); font-size: .82rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.features li::before { content: '✓ '; }
.mini-map { height: 360px; border-radius: 12px; overflow: hidden; position: relative; }
.mini-map .map { position: absolute; inset: 0; }
.contact-card { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 24px; display: grid; gap: 12px; }
.contact-card h3 { margin: 0; font-size: 1rem; }
.contact-card .cta__tel { font-size: 1.7rem; }
.contact-card small { opacity: .75; }
.cost { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.cost h3 { font-size: .95rem; margin-bottom: 8px; }
.cost dl { display: grid; grid-template-columns: 1fr auto; margin: 0; font-size: .88rem; }
.cost dt, .cost dd { margin: 0; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.cost dd { text-align: right; font-weight: 700; }
.cost .total dt, .cost .total dd { border: 0; padding-top: 10px; font-size: 1rem; color: var(--brand); }

.not-found { text-align: center; padding: 100px 16px; }

/* ---------- 営業カレンダー ---------- */
.cal { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.cal__head { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 8px; }
.cal__btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; min-width: 36px; height: 36px; padding: 0 12px; font-weight: 700; color: var(--navy); font-size: .85rem; }
.cal__prev, .cal__next { font-size: 1.3rem; line-height: 1; padding: 0 0 3px; }
.cal__btn:hover:not(:disabled) { border-color: var(--navy); }
.cal__btn:disabled { opacity: .35; cursor: default; }
.cal__months { display: grid; grid-template-columns: repeat(var(--cal-months), minmax(0, 1fr)); gap: 28px; }
@media (max-width: 720px) { .cal__months { grid-template-columns: minmax(0, 1fr); } }
.cal__title { font-family: var(--ff-head); font-size: 1.15rem; margin: 0 0 10px; color: var(--navy); }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal__wd { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal__wd.is-sun, .cal__cell.is-sun { color: #d0483b; }
.cal__wd.is-sat, .cal__cell.is-sat { color: var(--navy); }
.cal__cell {
  aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; font-size: .9rem; font-weight: 700;
  background: var(--cream); color: var(--ink); position: relative;
}
.cal__cell--empty { background: transparent; }
.cal__cell--regular { background: var(--grey-soft); color: var(--muted) !important; }
.cal__cell--regular::after, .cal__cell--special::after { content: '休'; position: absolute; bottom: 3px; font-size: .55rem; font-weight: 700; opacity: .8; }
.cal__cell--special { background: var(--alert-soft); color: var(--alert) !important; }
.cal__cell--extra { background: var(--green-soft); color: var(--green) !important; }
.cal__cell--extra::after { content: '営'; position: absolute; bottom: 3px; font-size: .55rem; font-weight: 700; }
.cal__cell.is-past { opacity: .4; }
.cal__cell.is-today { box-shadow: inset 0 0 0 2px var(--navy); }
.cal__cell.is-today::before { content: '今日'; position: absolute; top: -7px; font-size: .55rem; background: var(--navy); color: #fff; padding: 0 5px; border-radius: 999px; line-height: 1.5; }
.cal__notes { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; font-size: .8rem; }
.cal__note { display: flex; gap: 8px; align-items: center; }
.cal__note b { font-weight: 700; }
.cal__note::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cal__note--special::before { background: var(--alert); }
.cal__note--extra::before { background: var(--green); }
.cal__legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.cal__legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal__dot { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.cal__dot--open { background: var(--cream); border: 1px solid var(--line); }
.cal__dot--regular { background: var(--grey-soft); border: 1px solid #d5d9e0; }
.cal__dot--special { background: var(--alert-soft); border: 1px solid #f4c4c0; }
.cal__dot--extra { background: var(--green-soft); border: 1px solid #b9e3cd; }

/* 営業状況バッジ */
.open-status { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; }
.open-status::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: #9aa3b2; flex: none; }
.open-status.is-open::before { background: #3ecf8e; box-shadow: 0 0 0 4px rgba(62,207,142,.25); }
.hours-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px; align-items: start; }
@media (max-width: 900px) { .hours-grid { grid-template-columns: minmax(0, 1fr); } }
.hours-card { display: grid; gap: 14px; }
.hours-card .open-status { font-size: 1rem; background: var(--paper); border: 1px solid var(--line); padding: 12px 16px; border-radius: var(--radius); }
