/* レーシックマップ フロントエンド共通 — モバイルファースト */

/* ===== リセット・変数 ===== */
:root {
  --lmap-primary: #1d6fb8;
  --lmap-primary-dark: #155a96;
  --lmap-accent: #0ea47a;
  --lmap-danger: #dc3545;
  --lmap-warn: #f59e0b;
  --lmap-bg: #f4f6f9;
  --lmap-surface: #ffffff;
  --lmap-border: #dde1e7;
  --lmap-text: #1a1d23;
  --lmap-text-secondary: #5a6070;
  --lmap-radius: 10px;
  --lmap-shadow: 0 2px 8px rgba(0,0,0,.08);
  --lmap-font: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  /* セクション間ギャップ（見出しには margin を置かず、ここで余白を付ける） */
  --lmap-gap: 16px;
}

/* ===== 見出しは margin を持たない（余白はセクション側で付ける） =====
   SWELL の .post_content h2/h3 デフォルト margin（h2 は 5.6em = 約90px など）が
   プラグインの仮想ページでは過剰なので 0 に統一。背景色・padding・font-size は
   SWELL のスタイルをそのまま活かす。 */
.lmap-seo-page .post_content h2,
.lmap-seo-page .post_content h3,
.lmap-clinic-single .post_content h2,
.lmap-clinic-single .post_content h3 {
  margin-top: 0;
  margin-bottom: 0;
}
.lmap-seo-page .post_content p,
.lmap-clinic-single .post_content p {
  margin-top: 0;
  margin-bottom: 0.4em;
}
.lmap-seo-page .post_content ul,
.lmap-seo-page .post_content ol,
.lmap-clinic-single .post_content ul,
.lmap-clinic-single .post_content ol {
  margin-top: 0;
  margin-bottom: 0.4em;
}
/* 検索ショートコードや地域ページのカード内 h3 は SWELL の
   .post_content h3 デフォルト（margin 3em/2em）が当たって巨大になるため、
   特異度を上げて抑制する */
.post_content .lmap-card-name,
.post_content .lmap-clinic-cards h3,
.post_content .lmap-results-list h3 {
  margin: 0 0 4px;
  padding: 0;
  font-size: 15px;
  line-height: 1.35;
}

/* ===== エリアページのマップ (16:9・下のリストも視野に入る高さ) ===== */
.lmap-page-map {
  margin: 0 0 var(--lmap-gap);
  border-radius: var(--lmap-radius);
  overflow: hidden;
  border: 1px solid var(--lmap-border);
}
.lmap-page-map .lmap-static-map,
.lmap-page-map .lmap-map {
  width: 100%;
}
.lmap-page-map .lmap-static-map {
  aspect-ratio: 16 / 9;
  max-height: 56vh;
}
.lmap-page-map .lmap-map {
  height: 100% !important;
}

/* ===== ページング（横並びのボタン形式） ===== */
.lmap-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 4px;
  font-family: var(--lmap-font);
}
.lmap-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--lmap-border);
  border-radius: 8px;
  background: var(--lmap-surface);
  color: var(--lmap-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  box-sizing: border-box;
}
.lmap-pagination a.page-numbers:hover {
  background: #f0f4ff;
  border-color: var(--lmap-primary);
  color: var(--lmap-primary);
}
.lmap-pagination .page-numbers.current {
  background: var(--lmap-primary);
  border-color: var(--lmap-primary);
  color: #fff;
  cursor: default;
}
.lmap-pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  color: var(--lmap-text-secondary);
  min-width: 24px;
  padding: 0 4px;
}
.lmap-pagination .page-numbers.prev,
.lmap-pagination .page-numbers.next {
  padding: 0 12px;
}

/* ===== バッジ ===== */
.lmap-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--lmap-font);
  background: #e9ecef;
  color: #5a6070;
  letter-spacing: .02em;
}
.lmap-badge.is-yes  { background: #d1fae5; color: #065f46; }
.lmap-badge.is-no   { background: #fee2e2; color: #991b1b; }
.lmap-badge.is-unknown { background: #e9ecef; color: #5a6070; }
.lmap-badge-conf { font-weight: 400; font-size: 11px; opacity: .8; }

/* SWELL の .l-mainContent / .post_content の幅・余白・背景をそのまま使うため、
   .lmap-clinic-single は独自のレイアウト指定を持たない（h2/h1 の色も SWELL に任せる）。 */

/* パンくずは SWELL の .p-breadcrumb / swell_breadcrumb_list_data フィルタに任せる。 */

/* ===== バッジ行 ===== */
.lmap-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--lmap-gap);
}

/* ===== 基本情報 ===== */
.lmap-clinic-basics {
  border: 1px solid var(--lmap-border);
  border-radius: var(--lmap-radius);
  padding: 12px 14px;
  margin-bottom: var(--lmap-gap);
  background: var(--lmap-surface);
}
.lmap-clinic-basics dl {
  margin: 0;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 0 10px;
}
.lmap-clinic-basics dt,
.lmap-clinic-basics dd {
  padding: 6px 0;
  border-bottom: 1px solid var(--lmap-border);
  margin: 0;
}
.lmap-clinic-basics dt:last-of-type,
.lmap-clinic-basics dd:last-of-type { border-bottom: none; }
.lmap-clinic-basics dt {
  font-size: 11px;
  font-weight: 700;
  color: var(--lmap-text-secondary);
  letter-spacing: .04em;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.lmap-clinic-basics dd {
  font-size: 14px;
  word-break: break-word;
}
.lmap-clinic-basics dd a { color: var(--lmap-primary); }

/* ===== マップ（クリニック詳細／16:9 でエリアページと統一） ===== */
.lmap-clinic-map {
  margin-bottom: var(--lmap-gap);
  border-radius: var(--lmap-radius);
  overflow: hidden;
  border: 1px solid var(--lmap-border);
}
.lmap-clinic-map #lmap-single-map {
  width: 100%;
  height: auto !important;
  aspect-ratio: 16 / 9;
  max-height: 56vh;
  display: block;
}
.lmap-map-links {
  background: var(--lmap-surface);
  padding: 8px 12px;
  margin: 0;
  font-size: 13px;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--lmap-border);
}
.lmap-map-links a {
  color: var(--lmap-primary);
  text-decoration: none;
  font-weight: 600;
}
.lmap-map-links a:hover { text-decoration: underline; }

/* ===== 対応状況・レビューセクションを目立たせる装飾（薄背景＋左アクセント） =====
   H2 は SWELL の濃紺背景をそのまま活かし、負マージンで section 幅いっぱいに伸ばす。
   H2 直下の本文側に適度な余白を与えて「目立たせる」ブロックに。 */
.lmap-clinic-support,
.lmap-reviews {
  margin-bottom: calc(var(--lmap-gap) + 6px);
  background: #f0f7ff;
  border-left: 4px solid var(--lmap-primary);
  border-radius: var(--lmap-radius);
  padding: 0 16px 16px;
  overflow: hidden;
}
/* section 内 H2 は padding を打ち消して section の幅いっぱいに */
.lmap-clinic-support > h2,
.lmap-reviews > h2 {
  margin: 0 -16px 14px !important;
}
/* H2 以外の直接子要素の間隔を確保（中身を詰めすぎないように） */
.lmap-clinic-support > *:not(h2) + *:not(h2),
.lmap-reviews > *:not(h2) + *:not(h2) {
  margin-top: 12px;
}
/* レビューが 0 件のときの案内文は点線の枠で強調（件数の有無も目立たせる） */
.lmap-reviews > p:first-of-type {
  margin: 0;
  padding: 14px 16px;
  background: var(--lmap-surface);
  border: 1px dashed var(--lmap-border);
  border-radius: 8px;
  color: var(--lmap-text-secondary);
  text-align: center;
  font-size: 14px;
  line-height: 1.55;
}
/* 平均評価行（レビューあり）は中央寄せで大きく見せる */
.lmap-reviews > p:first-of-type:has(.lmap-avg-rating) {
  background: #fffbeb;
  border-color: #fde68a;
  border-style: solid;
  color: var(--lmap-text);
}
/* h2 は SWELL の .post_content h2（濃紺背景＋白文字）をそのまま使うので、
   ここでは色・背景の上書きをしない。 */
.lmap-support-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--lmap-border);
}
.lmap-support-row:last-of-type { border-bottom: none; }
.lmap-support-label {
  font-weight: 700;
  min-width: 80px;
  color: var(--lmap-text-secondary);
  font-size: 13px;
}
.lmap-sl-yes { color: #059669; font-weight: 700; font-size: 16px; }
.lmap-sl-no  { color: #dc2626; font-weight: 700; font-size: 16px; }
.lmap-sl-uk  { color: #9ca3af; font-weight: 600; font-size: 15px; }
.lmap-sl-conf { font-size: 12px; font-weight: 400; opacity: .75; margin-left: 2px; }

.lmap-fb-intro {
  margin: 8px 0 4px;
  font-size: 13px;
  color: var(--lmap-text-secondary);
}
.lmap-fb-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.lmap-fb-btn {
  padding: 8px 8px;
  border: 1px solid var(--lmap-border);
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--lmap-font);
  font-weight: 600;
  color: var(--lmap-text);
  line-height: 1.3;
  text-align: center;
  transition: background .15s, border-color .15s;
  min-height: 40px;
}
.lmap-fb-btn:hover  { background: #e8f0fb; border-color: var(--lmap-primary); color: var(--lmap-primary); }
.lmap-fb-btn:active { background: #d0e4f7; }
.lmap-fb-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== カスタムHTML ===== */
.lmap-clinic-custom {
  margin-bottom: var(--lmap-gap);
}

/* ===== レビューセクション ===== */
.lmap-reviews {
  margin-bottom: var(--lmap-gap);
}
.lmap-avg-rating {
  font-size: 22px;
  font-weight: 700;
  color: var(--lmap-warn);
}
.lmap-review-list { list-style: none; padding: 0; margin: 6px 0; }
.lmap-review-list li {
  border-top: 1px solid var(--lmap-border);
  padding: 8px 0;
}
.lmap-review-list li:first-child { border-top: none; padding-top: 0; }
.lmap-review-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--lmap-text-secondary);
  margin-bottom: 4px;
}
.lmap-review-rating { color: var(--lmap-warn); font-weight: 700; font-size: 14px; }
.lmap-review-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--lmap-text);
  white-space: pre-wrap;
}
.lmap-violation-btn {
  background: none;
  border: none;
  color: #adb5bd;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: var(--lmap-font);
}
.lmap-violation-btn:hover { color: var(--lmap-danger); background: #fff5f5; }

/* ===== レビュー投稿フォーム ===== */
/* h3 は SWELL の .post_content h3 スタイルを流用する（上書きしない）。 */
.lmap-review-form {
  background: var(--lmap-bg);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.lmap-review-form label {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--lmap-text-secondary);
}
.lmap-review-form input[type="text"],
.lmap-review-form textarea {
  padding: 8px 10px;
  border: 1px solid var(--lmap-border);
  border-radius: 6px;
  font-size: 15px;
  font-family: var(--lmap-font);
  background: var(--lmap-surface);
  color: var(--lmap-text);
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.lmap-review-form input[type="text"]:focus,
.lmap-review-form textarea:focus {
  outline: none;
  border-color: var(--lmap-primary);
  box-shadow: 0 0 0 3px rgba(29,111,184,.12);
}
.lmap-review-form textarea { min-height: 88px; resize: vertical; line-height: 1.55; }
.lmap-review-form button[type="submit"] {
  padding: 10px;
  background: var(--lmap-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--lmap-font);
  cursor: pointer;
  min-height: 42px;
  transition: background .15s;
}
.lmap-review-form button[type="submit"]:hover { background: var(--lmap-primary-dark); }
.lmap-review-form button[type="submit"]:disabled { opacity: .6; cursor: not-allowed; }

.lmap-rating-stars {
  display: inline-flex;
  gap: 4px;
  font-size: 26px;
  cursor: pointer;
  user-select: none;
  margin-top: 2px;
}
.lmap-rating-star { color: #dee2e6; transition: color .1s; }
.lmap-rating-star.is-on { color: var(--lmap-warn); }

/* ===== 違反報告モーダル ===== */
.lmap-modal {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 12px;
}
.lmap-modal-inner {
  background: var(--lmap-surface);
  border-radius: var(--lmap-radius);
  padding: 16px;
  width: 100%;
  max-width: 400px;
  display: grid;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.lmap-modal-inner h3 { margin: 0; font-size: 16px; }
.lmap-modal-inner label { font-size: 13px; display: grid; gap: 4px; font-weight: 600; color: var(--lmap-text-secondary); }
.lmap-modal-inner select,
.lmap-modal-inner textarea {
  padding: 6px 10px;
  border: 1px solid var(--lmap-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--lmap-font);
  width: 100%;
  box-sizing: border-box;
  background: var(--lmap-surface);
}
.lmap-modal-buttons { display: flex; gap: 8px; justify-content: flex-end; }
.lmap-modal-buttons button {
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--lmap-font);
  font-weight: 600;
  border: none;
  min-height: 38px;
}
.lmap-violation-send { background: var(--lmap-primary); color: #fff; }
.lmap-violation-send:hover { background: var(--lmap-primary-dark); }
.lmap-violation-cancel { background: #e9ecef; color: var(--lmap-text); }
.lmap-violation-cancel:hover { background: #dee2e6; }

/* ===== トースト通知 ===== */
.lmap-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1e293b;
  color: #fff;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--lmap-font);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  z-index: 10000;
  white-space: nowrap;
  max-width: 90vw;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.lmap-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 近隣クリニック ===== */
.lmap-clinic-nearby {
  margin-bottom: var(--lmap-gap);
}
.lmap-nearby-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.lmap-nearby-grid li a {
  display: block;
  padding: 8px 12px;
  border: 1px solid var(--lmap-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--lmap-text);
  transition: background .15s;
}
.lmap-nearby-grid li a:hover { background: #f0f4ff; border-color: var(--lmap-primary); }
.lmap-nearby-grid strong { display: block; font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.lmap-nearby-grid span { font-size: 12px; color: var(--lmap-text-secondary); }

@media (min-width: 480px) {
  .lmap-nearby-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== 監修者ボックス ===== */
.lmap-supervisor {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--lmap-radius);
  padding: 12px 14px;
  margin-bottom: var(--lmap-gap);
}
.lmap-supervisor-body { display: flex; gap: 12px; align-items: flex-start; }
.lmap-supervisor img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.lmap-supervisor-name { font-weight: 700; font-size: 14px; margin: 0 0 2px; }
.lmap-supervisor-title { font-size: 12px; color: #78350f; margin: 0 0 4px; }
.lmap-supervisor-bio { margin: 0; font-size: 13px; line-height: 1.55; }

/* ===== 免責 ===== */
.lmap-clinic-disclaimer {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--lmap-surface);
  border-radius: var(--lmap-radius);
  font-size: 11px;
  color: var(--lmap-text-secondary);
  line-height: 1.55;
  border: 1px solid var(--lmap-border);
}

/* ===== クリニックカード一覧 ===== */
.lmap-clinic-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.lmap-clinic-cards .lmap-card {
  border: 1px solid var(--lmap-border);
  border-radius: var(--lmap-radius);
  background: var(--lmap-surface);
  overflow: hidden;
}
.lmap-clinic-cards .lmap-card-link {
  display: block;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
}
.lmap-clinic-cards .lmap-card-link:hover { background: #f0f4ff; }
.lmap-clinic-cards h3 { margin: 0 0 2px; font-size: 15px; font-weight: 700; }
.lmap-clinic-cards p { margin: 2px 0; font-size: 12px; color: var(--lmap-text-secondary); }

@media (min-width: 600px) {
  .lmap-clinic-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ===== .lmap-page-lead (リード文) ===== */
.lmap-page-lead {
  margin: 0 0 var(--lmap-gap);
  color: var(--lmap-text-secondary);
  font-size: 14px;
}

/* ===== エリアページ内の section 間ギャップを短く ===== */
.lmap-seo-page .post_content > section {
  margin-bottom: var(--lmap-gap);
}
.lmap-seo-page .post_content > section:last-child {
  margin-bottom: 0;
}

/* ===== 市区町村/サブエリアのグリッドリンク ===== */
.lmap-city-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.lmap-city-grid li a {
  display: block;
  padding: 6px 10px;
  border: 1px solid var(--lmap-border);
  border-radius: 6px;
  background: var(--lmap-surface);
  text-decoration: none;
  color: var(--lmap-text);
  font-size: 13px;
}
.lmap-city-grid li a:hover { background: #f0f4ff; border-color: var(--lmap-primary); }
