/* ============================================================
 * 正監建装 物件マップ — サイトCSS
 * ============================================================ */

/* ----- リセット ----- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic",
               "Meiryo", system-ui, sans-serif;
  color: #2c3e50;
  background: #f7f7f5;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: #2c3e50; text-decoration: none; transition: color .15s; }
a:hover { color: #e74c3c; }
ul { list-style: none; margin: 0; padding: 0; }

/* ----- レイアウト ----- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5em;
}

/* ----- ヘッダー ----- */
.site-header {
  background: #fff;
  border-bottom: 3px solid #34495e;
  padding: 1em 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.site-header__inner { display: flex; align-items: center; }
.site-header__home {
  display: inline-block;
  color: inherit;
}
.site-header__home:hover { color: inherit; }
.site-logo {
  margin: 0;
  font-size: 1.5em;
  font-weight: 700;
  color: #34495e;
  letter-spacing: 0.05em;
  transition: color .15s;
}
.site-header__home:hover .site-logo { color: #e74c3c; }
.site-tagline {
  margin: 0.2em 0 0;
  font-size: 0.7em;
  color: #888;
  letter-spacing: 0.18em;
}

/* ----- ヒーロー ----- */
.hero {
  padding: 3em 0 2em;
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, #f7f7f5 100%);
}
.hero-title {
  margin: 0 0 0.5em;
  font-size: 2em;
  color: #34495e;
  letter-spacing: 0.05em;
}
.hero-lead {
  margin: 0;
  color: #666;
}

/* ----- 地図 ----- */
.map-section { padding: 0 0 3em; }
.map-canvas {
  height: 60vh;
  min-height: 400px;
  width: 100%;
  background: #ddd;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 1;
}

/* ----- カテゴリ ----- */
.categories-section {
  padding: 3em 0 4em;
  background: #fff;
}
.section-title {
  margin: 0 0 1.8em;
  font-size: 1.4em;
  text-align: center;
  color: #34495e;
}
.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: #34495e;
  margin: 0.5em auto 0;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5em;
}
.category-block {
  border: 1px solid #eee;
  border-top: 4px solid var(--cat-color, #34495e);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.category-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.category-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8em 1em;
  background: var(--cat-color, #34495e);
  color: #fff;
}
.category-block__title {
  margin: 0;
  font-size: 1em;
  font-weight: 600;
}
.category-block__count {
  font-size: 0.85em;
  background: rgba(255,255,255,0.2);
  padding: 0.15em 0.7em;
  border-radius: 999px;
}
.category-block__list { padding: 0.5em 0; }
.property-item { border-bottom: 1px dotted #e8e8e8; }
.property-item:last-child { border-bottom: none; }
.property-item__link {
  display: block;
  padding: 0.7em 1em;
  transition: background 0.15s;
}
.property-item__link:hover {
  background: #fafafa;
  color: #2c3e50;
}
.property-item__name {
  display: block;
  font-weight: 600;
  font-size: 0.95em;
}
.property-item__address {
  display: block;
  font-size: 0.8em;
  color: #888;
  margin-top: 0.2em;
}
.category-block__empty {
  padding: 0.8em 1em;
  color: #aaa;
  font-size: 0.85em;
  text-align: center;
}

/* ----- マーカー(divIcon) ----- */
.shokan-marker {
  background: transparent !important;
  border: none !important;
}
.shokan-marker__dot {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: transform 0.15s;
}
.shokan-marker:hover .shokan-marker__dot {
  transform: scale(1.2);
}

/* ----- マップポップアップ ----- */
.map-popup { min-width: 200px; }
.map-popup__imglink {
  display: block;
  margin-bottom: 0.5em;
  line-height: 0;
}
.map-popup__img {
  width: 200px;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}
.map-popup__cat {
  display: inline-block;
  padding: 0.15em 0.7em;
  border-radius: 3px;
  font-size: 0.75em;
  color: #fff;
  margin-bottom: 0.4em;
}
.map-popup__name {
  display: block;
  font-weight: 700;
  font-size: 1.05em;
  color: #2c3e50;
  margin-bottom: 0.3em;
}
.map-popup__name:hover {
  color: #e74c3c;
  text-decoration: underline;
}
.map-popup__addr {
  margin: 0;
  font-size: 0.8em;
  color: #777;
}

/* ----- フッター ----- */
.site-footer {
  background: #34495e;
  color: #ddd;
  padding: 2em 0;
  text-align: center;
}
.site-footer small { font-size: 0.85em; }

/* ----- 物件詳細ページ ----- */
.property-page {
  padding: 2.5em 0 4em;
  background: #fafafa;
  min-height: 60vh;
}
.breadcrumb {
  margin-bottom: 1.5em;
  font-size: 0.9em;
}
.breadcrumb__link { color: #666; }
.breadcrumb__link:hover { color: #e74c3c; }

.property-detail {
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  overflow: hidden;
  border-top: 4px solid var(--cat-color, #34495e);
}
.property-detail__header {
  padding: 2em 2em 1.5em;
  border-bottom: 1px solid #eee;
}
.property-detail__cat-badge {
  display: inline-block;
  padding: 0.25em 0.9em;
  background: var(--cat-color, #34495e);
  color: #fff;
  font-size: 0.8em;
  border-radius: 3px;
  margin-bottom: 0.7em;
  letter-spacing: 0.05em;
}
.property-detail__name {
  margin: 0 0 0.5em;
  font-size: 1.6em;
  color: #2c3e50;
  letter-spacing: 0.03em;
}
.property-detail__address {
  margin: 0;
  color: #666;
  font-size: 0.95em;
}
.property-detail__section {
  padding: 1.5em 2em;
  border-bottom: 1px solid #eee;
}
.property-detail__section:last-child { border-bottom: none; }
.property-detail__section-title {
  margin: 0 0 0.7em;
  font-size: 1.05em;
  color: #34495e;
  border-left: 4px solid var(--cat-color, #34495e);
  padding-left: 0.6em;
}
.property-detail__description {
  margin: 0;
  color: #555;
  line-height: 1.8;
}
.placeholder-note {
  margin: 0;
  padding: 0.9em 1.1em;
  background: #f7f7f5;
  border-left: 3px solid #ccc;
  color: #888;
  font-size: 0.9em;
}

/* ----- 写真スライダー(Swiper) ----- */
.property-gallery {
  --swiper-theme-color: var(--cat-color, #34495e);
}
.property-gallery__main {
  width: 100%;
  height: 480px;
  background: #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.8em;
}
.property-gallery__main .swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
}
.property-gallery__main .swiper-zoom-container {
  width: 100%;
  height: 100%;
}
.property-gallery__main .swiper-zoom-container img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  cursor: zoom-in;
}
/* ナビボタン */
.property-gallery__main .swiper-button-prev,
.property-gallery__main .swiper-button-next {
  color: #fff;
  background: rgba(0,0,0,0.45);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  --swiper-navigation-size: 18px;
  transition: background .15s;
}
.property-gallery__main .swiper-button-prev:hover,
.property-gallery__main .swiper-button-next:hover {
  background: rgba(0,0,0,0.7);
}
/* ページネーション */
.property-gallery__main .swiper-pagination-bullet {
  background: #fff;
  opacity: 0.6;
}
.property-gallery__main .swiper-pagination-bullet-active {
  background: var(--cat-color, #34495e);
  opacity: 1;
}

/* サムネ */
.property-gallery__thumbs {
  height: 70px;
  margin-bottom: 0.5em;
}
.property-gallery__thumbs .swiper-slide {
  opacity: 0.55;
  cursor: pointer;
  border-radius: 3px;
  overflow: hidden;
  width: auto !important;
  height: 100%;
  transition: opacity .2s, outline-color .2s;
  outline: 2px solid transparent;
  outline-offset: -2px;
}
.property-gallery__thumbs .swiper-slide:hover { opacity: 0.85; }
.property-gallery__thumbs .swiper-slide-thumb-active {
  opacity: 1;
  outline-color: var(--cat-color, #34495e);
}
.property-gallery__thumbs img {
  height: 100%;
  width: auto;
  object-fit: cover;
  display: block;
}

.property-gallery__hint {
  margin: 0.4em 0 0;
  font-size: 0.78em;
  color: #999;
  text-align: right;
}

/* ----- 写真ギャラリー: カテゴリ縦並び (Phase 7-6) ----- */
.property-images {
  --cat-color: var(--cat-color, #34495e);
}
.property-images__group + .property-images__group {
  margin-top: 2em;
  padding-top: 1.5em;
  border-top: 1px solid #eee;
}
.property-images__heading {
  margin: 0 0 0.8em;
  padding-left: 0.6em;
  font-size: 1em;
  font-weight: 600;
  color: #2c3e50;
  border-left: 3px solid var(--cat-color, #34495e);
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}
.property-images__heading-count {
  font-size: 0.85em;
  color: #999;
  font-weight: 400;
}

/* ----- PDF ビューア(PDF.js + タブ) ----- */
.property-pdf {
  --cat-color: var(--cat-color, #34495e);
}
.property-pdf__tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 2px solid #eee;
  margin-bottom: 0;
}
.property-pdf__tab {
  background: transparent;
  border: none;
  padding: 0.7em 1.2em;
  font-family: inherit;
  font-size: 0.88em;
  cursor: pointer;
  color: #666;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  border-radius: 3px 3px 0 0;
  transition: color .15s, border-color .15s, background .15s;
}
.property-pdf__tab:hover {
  background: #f7f7f5;
  color: #2c3e50;
}
.property-pdf__tab.is-active {
  color: var(--cat-color, #34495e);
  border-bottom-color: var(--cat-color, #34495e);
  font-weight: 600;
}
.property-pdf__viewer {
  height: 600px;
  border: 1px solid #ddd;
  background: #f4f4f4;
  border-radius: 0 4px 4px 4px;
  overflow: hidden;
}
.property-pdf__iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
/* SP のみ可視: 別タブで生PDFを開くリンク(PC は非表示) */
.property-pdf__open-native {
  display: none;
  margin: 0.6em 0 0;
}
.property-pdf__open-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.65em 1em;
  background: var(--cat-color, #34495e);
  color: #fff;
  border-radius: 4px;
  font-size: 0.9em;
  letter-spacing: 0.03em;
  min-height: 44px;
  box-sizing: border-box;
  transition: opacity .15s, transform .15s;
}
.property-pdf__open-link:hover {
  color: #fff;
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ----- エラーページ(404 / 500) ----- */
.error-page {
  padding: 4em 0 5em;
  background: #fafafa;
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-card {
  background: #fff;
  padding: 3em 2.5em;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  text-align: center;
  max-width: 480px;
  width: 100%;
}
.error-card__code {
  margin: 0 0 0.2em;
  font-size: 4em;
  font-weight: 700;
  color: #34495e;
  letter-spacing: 0.05em;
  line-height: 1;
}
.error-card__title {
  margin: 0 0 0.7em;
  font-size: 1.3em;
  color: #2c3e50;
}
.error-card__message {
  margin: 0 0 1.8em;
  color: #777;
  line-height: 1.7;
  font-size: 0.95em;
}
.error-card__back {
  display: inline-block;
  padding: 0.75em 1.8em;
  background: #34495e;
  color: #fff;
  border-radius: 4px;
  font-size: 0.9em;
  letter-spacing: 0.05em;
  transition: background .15s, transform .15s;
}
.error-card__back:hover {
  background: #2c3e50;
  color: #fff;
  transform: translateY(-2px);
}

/* ----- レスポンシブ ----- */
@media (max-width: 720px) {
  .hero { padding: 2em 0 1em; }
  .hero-title { font-size: 1.4em; }
  .map-canvas { height: 50vh; min-height: 300px; }
  .categories-section { padding: 2em 0 3em; }
  .category-grid {
    grid-template-columns: 1fr;
    gap: 1em;
  }
  .site-logo { font-size: 1.2em; }

  /* 物件詳細ページ */
  .property-page { padding: 1.5em 0 3em; }
  .property-detail__header { padding: 1.4em 1.2em 1em; }
  .property-detail__name { font-size: 1.3em; }
  .property-detail__section { padding: 1em 1.2em; }

  /* エラーページ */
  .error-page { padding: 2.5em 0 3em; }
  .error-card { padding: 2em 1.5em; }
  .error-card__code { font-size: 3em; }

  /* 写真スライダー */
  .property-gallery__main { height: 280px; }
  .property-gallery__thumbs { height: 56px; }
  .property-gallery__main .swiper-button-prev,
  .property-gallery__main .swiper-button-next {
    width: 32px;
    height: 32px;
    --swiper-navigation-size: 14px;
  }

  /* PDF ビューア */
  .property-pdf__viewer { height: 480px; }

  /* PDFタブを横スクロール化(1行維持、SP UI 標準パターン) */
  .property-pdf__tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .property-pdf__tab {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.85em;
    padding: 0.7em 0.95em;
    min-height: 44px;
  }
}

/* ============================================================
 * 狭スマホ向け追い込み(iPhone SE/12 mini 375px 想定)
 * ============================================================ */
@media (max-width: 480px) {
  /* コンテナ余白を少し詰める */
  .container { padding: 0 1em; }

  /* ヘッダー圧縮 */
  .site-header { padding: 0.55em 0; }
  .site-logo   { font-size: 1.05em; letter-spacing: 0.03em; }
  .site-tagline { font-size: 0.62em; letter-spacing: 0.12em; }

  /* ヒーロー圧縮 */
  .hero { padding: 1.2em 0 0.6em; }
  .hero-title { font-size: 1.2em; margin-bottom: 0.3em; }
  .hero-lead  { font-size: 0.9em; }

  /* 地図(縦長スマホで使いやすく) */
  .map-canvas { height: 55vh; min-height: 320px; }

  /* カテゴリセクション */
  .categories-section { padding: 1.6em 0 2.2em; }
  .section-title      { font-size: 1.2em; margin-bottom: 1.2em; }
  .property-item__link { padding: 0.85em 1em; min-height: 44px; }

  /* マップポップアップ画像をポップアップ幅に追従 */
  .map-popup__img {
    width: 100%;
    max-width: 220px;
  }

  /* 物件詳細 */
  .property-page { padding: 1em 0 2.5em; }
  .property-detail__header  { padding: 1.1em 1em 0.9em; }
  .property-detail__name    { font-size: 1.2em; }
  .property-detail__address { font-size: 0.88em; }
  .property-detail__section { padding: 0.9em 1em; }
  .property-detail__section-title { font-size: 1em; }

  /* 写真スライダー(SP最適化) */
  .property-gallery__main   { height: 260px; }
  .property-gallery__thumbs { height: 50px; }
  .property-gallery__main .swiper-button-prev,
  .property-gallery__main .swiper-button-next {
    width: 30px;
    height: 30px;
    --swiper-navigation-size: 13px;
  }
  .property-gallery__hint { font-size: 0.72em; }

  /* PDFビューア:高さを抑える + 別タブで開くリンクを露出 */
  .property-pdf__viewer { height: 380px; }
  .property-pdf__open-native { display: block; }

  /* エラーページ */
  .error-card { padding: 1.6em 1.2em; }
  .error-card__code { font-size: 2.4em; }
  .error-card__title { font-size: 1.1em; }
  .error-card__back { padding: 0.8em 1.4em; min-height: 44px; }

  /* フッター */
  .site-footer { padding: 1.5em 0; }
  .site-footer small { font-size: 0.78em; }
}
