/* 外科ネット - 新デザインスタイル */
:root {
  --primary: #0d6efd;
  --primary-dark: #0a4fae;
  --accent: #ff6b35;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #212529;
  --muted: #6c757d;
  --border: #dee2e6;
  --radius: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.logo { color: #fff; font-size: 1.4rem; font-weight: 700; text-decoration: none; }
.main-nav { display: flex; gap: 18px; }
.main-nav a { color: rgba(255,255,255,.9); text-decoration: none; font-size: .95rem; }
.main-nav a:hover { color: #fff; text-decoration: underline; }

/* メイン */
main.container { padding: 28px 16px 48px; }

h1 { font-size: 1.7rem; margin-bottom: 16px; line-height: 1.3; }
h2 { font-size: 1.25rem; margin: 36px 0 16px; padding-bottom: 8px; border-bottom: 3px solid var(--primary); }

/* ヒーロー */
.hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; border-radius: var(--radius); padding: 40px 32px; margin-bottom: 32px; }
.hero h1 { font-size: 2rem; margin-bottom: 8px; }
.hero p { opacity: .9; margin-bottom: 20px; font-size: .98rem; }

.search-box { display: flex; gap: 8px; max-width: 560px; }
.search-box input {
  flex: 1; padding: 12px 16px; border: none; border-radius: 6px; font-size: 1rem;
}
.search-box button {
  padding: 12px 24px; background: var(--accent); color: #fff; border: none;
  border-radius: 6px; font-size: 1rem; cursor: pointer;
}
.search-box button:hover { opacity: .9; }

/* 都道府県一覧 */
.pref-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px; list-style: none;
}
.pref-list a {
  display: block; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: var(--text); font-size: .95rem;
  transition: all .15s;
}
.pref-list a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

/* サイト一覧 */
.site-list { list-style: none; }
.site-list li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 10px;
}
.site-list a { color: var(--primary); text-decoration: none; }
.site-list a:hover { text-decoration: underline; }
.site-list small { color: var(--muted); }

/* ランダム紹介 */
.random-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.random-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.random-list a { color: var(--primary); text-decoration: none; }
.random-list a:hover { text-decoration: underline; }

/* パンくず */
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

/* ページング */
.pager { display: flex; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pager a, .pager span {
  display: inline-block; min-width: 36px; padding: 6px 10px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px; text-decoration: none; color: var(--primary);
}
.pager .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ランキング */
.rank-list { list-style: none; counter-reset: rank; }
.rank-list li { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; }
.rank-num { font-weight: 700; font-size: 1.1rem; color: var(--accent); min-width: 28px; }

/* 詳細ページ */
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.keywd { color: var(--muted); font-size: .9rem; }
.cats { color: var(--primary); font-weight: 600; }
.site-url a { color: var(--accent); }

/* スポンサーリンク（Google検索結果風） */
.sp-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 1件 = 検索結果1カード */
.sp-result {
  padding: 12px 4px;
  border-radius: 8px;
  line-height: 1.5;
}
.sp-result + .sp-result {
  border-top: 1px solid #e8eaed;
}

/* タイトル（青リンク・Googleの #1a0dab 系） */
.sp-title a {
  color: #1a0dab;
  font-size: 1.02rem;
  font-weight: 400;
  text-decoration: none;
  line-height: 1.4;
  display: inline-block;
}
.sp-title a:hover {
  text-decoration: underline;
}
.sp-title a:visited {
  color: #681da8;
}

/* URL（グリーン・Googleの #202124 グレーに） */
.sp-url {
  color: #202124;
  font-size: .78rem;
  margin: 2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* スニペット（説明文・Googleのグレー） */
.sp-snippet {
  color: #4d5156;
  font-size: .86rem;
  line-height: 1.55;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* サイト内リンク（関連ページ・Googleのサイトリンク風） */
.sp-sitelinks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 8px;
}
.sp-sitelink a {
  color: #1a0dab;
  font-size: .8rem;
  text-decoration: none;
  position: relative;
  padding-left: 10px;
}
.sp-sitelink a::before {
  content: "›";
  position: absolute;
  left: 0;
  top: 0;
  color: #dadce0;
  font-weight: 700;
}
.sp-sitelink a:hover {
  text-decoration: underline;
}

/* コンテンツ */
.content-list { list-style: none; }
.content-list li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 10px;
}
.content-list a { color: var(--primary); text-decoration: none; }
.content-list a:hover { text-decoration: underline; }
.content-list small { color: var(--muted); }
.content-more { margin-top: 12px; text-align: right; }
.content-more a { color: var(--primary); }
.content-article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.content-date { color: var(--muted); font-size: .85rem; margin-bottom: 16px; }
.content-body { line-height: 1.9; }
.content-body h2 { font-size: 1.2rem; margin-top: 28px; }
.content-body h3 { font-size: 1.05rem; margin-top: 22px; }
.content-body p { margin: 12px 0; }
.content-body img { max-width: 100%; height: auto; }
.empty { color: var(--muted); padding: 20px 0; }

/* 医院詳細テーブル */
.detail-table { width: 100%; border-collapse: collapse; margin: 16px 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.detail-table th { text-align: left; width: 130px; padding: 10px 14px; background: #f1f5fb; border-bottom: 1px solid var(--border); font-size: .9rem; }
.detail-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.detail-table tr:last-child th, .detail-table tr:last-child td { border-bottom: none; }

/* トップSEOコンテンツ */
.seo-top-content { margin-top: 40px; }
.seo-top-content h2 {
  font-size: 1.3rem; margin: 36px 0 14px; padding-bottom: 8px;
  border-bottom: 3px solid var(--primary);
}
.seo-top-content h3 { font-size: 1.05rem; margin: 22px 0 10px; }
.seo-top-content p { margin: 10px 0; line-height: 1.9; }
.seo-top-content ul { margin: 10px 0 10px 24px; }
.seo-top-content li { margin: 4px 0; }
.seo-top-content a { color: var(--primary); text-decoration: none; }
.seo-top-content a:hover { text-decoration: underline; }
.pref-hot { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pref-all { columns: 3; column-gap: 24px; }
@media (max-width: 640px) { .pref-all { columns: 2; } }

/* 都道府県ページSEOコンテンツ */
.pref-seo-content { margin-top: 40px; }
.pref-seo-content h2 {
  font-size: 1.25rem; margin: 36px 0 14px; padding-bottom: 8px;
  border-bottom: 3px solid var(--primary);
}
.pref-seo-content h3 { font-size: 1.05rem; margin: 22px 0 10px; }
.pref-seo-content p { margin: 10px 0; line-height: 1.9; }
.pref-seo-content ul { margin: 10px 0 10px 24px; }
.pref-seo-content li { margin: 6px 0; }
.pref-top-list a { color: var(--primary); text-decoration: none; }
.pref-top-list a:hover { text-decoration: underline; }
.pref-areas li, .pref-tips li { list-style: disc; }

/* 個別詳細ページSEOコンテンツ */
.item-seo-content { margin-top: 40px; }
.item-seo-content h2 {
  font-size: 1.25rem; margin: 36px 0 14px; padding-bottom: 8px;
  border-bottom: 3px solid var(--primary);
}
.item-seo-content h3 { font-size: 1.05rem; margin: 22px 0 10px; }
.item-seo-content p { margin: 10px 0; line-height: 1.9; }

/* 施設プロフィールカード */
.facility-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.facility-head { margin-bottom: 16px; }
.facility-head h1 { font-size: 1.6rem; margin-bottom: 8px; }
.facility-cats {
  display: inline-block; background: #f1f5fb; color: var(--primary);
  border-radius: 4px; padding: 4px 12px; font-size: .85rem; font-weight: 600;
}
.facility-info { width: 100%; border-collapse: collapse; margin: 12px 0; }
.facility-info th {
  text-align: left; width: 140px; padding: 10px 14px;
  background: #f8fafc; border-bottom: 1px solid var(--border); font-size: .9rem;
}
.facility-info td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.facility-desc { margin: 16px 0; line-height: 1.9; }
.facility-link a {
  display: inline-block; background: var(--primary); color: #fff;
  padding: 10px 20px; border-radius: 6px; text-decoration: none; font-weight: 600;
}
.facility-link a:hover { opacity: .9; }

/* カテゴリページ サイトカードグリッド */
.site-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; margin: 16px 0;
}
.site-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; transition: all .15s;
}
.site-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.site-card a { color: var(--primary); text-decoration: none; }
.site-card a:hover { text-decoration: underline; }
.site-card p { margin-top: 6px; color: var(--muted); font-size: .88rem; line-height: 1.6; }

/* 関連施設（同じエリア） */
.similar-facilities { margin-top: 40px; }
.similar-facilities h2 {
  font-size: 1.25rem; margin: 36px 0 14px; padding-bottom: 8px;
  border-bottom: 3px solid var(--primary);
}
.similar-facilities > p { margin: 10px 0; color: var(--muted); }

/* フッター */
.site-footer { background: #212529; color: rgba(255,255,255,.8); padding: 28px 0; margin-top: 48px; font-size: .85rem; }
.site-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.site-footer nav { margin-top: 8px; }

/* モバイル */
@media (max-width: 640px) {
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 1.5rem; }
  .pref-list { grid-template-columns: repeat(2, 1fr); }
  .site-header .container { flex-direction: column; align-items: flex-start; }
}

/* ---------- テーマ別レイアウト ---------- */

/* テーマB: モダンポータル（2カラム・ヘッダー中央） */
.header-center .container { flex-direction: column; align-items: center; text-align: center; }
.header-center .tagline { color: rgba(255,255,255,.85); font-size: .9rem; margin: 4px 0 8px; }
.main-with-sidebar { display: grid; grid-template-columns: 1fr; gap: 24px; }
.footer-columns .footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.footer-columns .footer-2col { grid-template-columns: 1fr 1fr; }
.footer-note { color: rgba(255,255,255,.7); font-size: .85rem; }

/* テーマC: ミニマル（角丸0・背景白） */
body.theme-c { background: #fff; }
body.theme-c .pref-list a { border-radius: 0; box-shadow: none; }
body.theme-c .site-list li { border-radius: 0; }
body.theme-c .hero { background: #fff; color: var(--text); border-bottom: 3px solid var(--primary); }
body.theme-c .hero p { color: var(--muted); }

/* テーマD: タイル型（カテゴリタイルを大きく） */
body.theme-d .pref-list { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
body.theme-d .pref-list a { padding: 20px 14px; text-align: center; font-weight: 600; }
body.theme-d .hero { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
body.theme-d .hero p { color: var(--muted); }

/* テーマB 2カラム（大きい画面） */
@media (min-width: 768px) {
  .main-with-sidebar { grid-template-columns: 1fr 280px; }
}

/* LPパンくず的リンク（スポンサーURLの隣） */
.sp-lpcrumb {
  color: #4d5156;
  font-size: .78rem;
}
.sp-lpcrumb a {
  color: #1a0dab;
  text-decoration: none;
}
.sp-lpcrumb a:hover {
  text-decoration: underline;
}

/* LPページ（スポンサー紹介） */
.sp-lp {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-top: 12px;
  line-height: 1.9;
}
.sp-lp h1 { font-size: 1.6rem; margin-bottom: 16px; }
.sp-lp h2 {
  font-size: 1.2rem; margin: 30px 0 12px; padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}
.sp-lp h3 { font-size: 1.05rem; margin: 20px 0 8px; }
.sp-lp p { margin: 10px 0; }
.lp-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff; border-radius: var(--radius); padding: 30px 26px; margin-bottom: 20px;
}
.lp-hero h1 { color: #fff; margin-bottom: 8px; }
.lp-lead { opacity: .92; }
.lp-official a {
  display: inline-block; background: var(--primary); color: #fff;
  padding: 10px 22px; border-radius: 6px; text-decoration: none; font-weight: 600; margin-top: 16px;
}
.lp-official a:hover { opacity: .9; }
.lp-links { list-style: none; padding-left: 0; }
.lp-links li { margin: 6px 0; }
.lp-links a { color: var(--primary); text-decoration: none; }
.lp-links a:hover { text-decoration: underline; }
