/* ============================================================
   mg-single.css v2 — Medical GEO 記事ページ
   エディトリアル2カラム（クリーム地・Noto Sans JP）
   ============================================================ */

/* ── Cocoon Override ────────────────────────────────────── */
body.mgs-page .entry-header,
body.mgs-page .entry-title,
body.mgs-page .breadcrumb,
body.mgs-page .breadcrumbs,
body.mgs-page .entry-footer,
body.mgs-page .after-entry,
body.mgs-page .pager-post-navi,
body.mgs-page .sns-buttons,
body.mgs-page .sns-follow-buttons,
body.mgs-page .entry-meta,
body.mgs-page .author,
body.mgs-page .byline,
body.mgs-page .post-author,
body.mgs-page #sidebar,
body.mgs-page .sidebar { display: none !important; }

body.mgs-page { background: #f6f5f2 !important; }
body.mgs-page #content,
body.mgs-page #primary,
body.mgs-page .site-main,
body.mgs-page article.entry,
body.mgs-page .entry-body,
body.mgs-page .main,
body.mgs-page #main-column {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
body.mgs-page .entry-content {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* ── Scope tokens ───────────────────────────────────────── */
.mgs-layout {
  --bg:        #f6f5f2;
  --surface:   #ffffff;
  --ink:       #26343c;
  --ink-strong:#143444;
  --navy:      #0f3a4f;
  --navy-d:    #0a2c3d;
  --brand:     #1a56db;
  --brand-d:   #1342b0;
  --teal:      #4f8f86;
  --line:      #e7e3d9;
  --line-2:    #eeebe3;
  --muted:     #6c7a82;
  --muted-2:   #94a3ab;
  --r:         18px;
  --r-sm:      12px;
  font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
}
.mgs-layout, .mgs-layout * { box-sizing: border-box; }

/* ══════════════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════════════ */
.mgs-layout {
  background: #f6f5f2;
  padding: 44px 0 88px;
}
.mgs-layout__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: minmax(0,1fr) 320px;
  gap: 48px;
  align-items: start;
}
.mgs-main { min-width: 0; }
@media (max-width: 1040px) { .mgs-layout__inner { padding: 0 24px; gap: 36px; } }
@media (max-width: 900px)  {
  .mgs-layout__inner { grid-template-columns: 1fr; gap: 44px; }
}
@media (max-width: 480px)  { .mgs-layout__inner { padding: 0 16px; } }

/* ══════════════════════════════════════════════════════════
   ARTICLE HEAD
══════════════════════════════════════════════════════════ */
.mgs-arthead { margin-bottom: 26px; }
.mgs-arthead__cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.mgs-badge {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  background: var(--teal);
  padding: 5px 14px;
  border-radius: 999px;
  text-decoration: none;
  transition: opacity .15s;
}
.mgs-badge:hover { opacity: .85; }
.mgs-arthead__title {
  font-size: clamp(25px, 3.4vw, 37px);
  font-weight: 900;
  line-height: 1.45;
  color: var(--ink-strong);
  letter-spacing: .01em;
  margin: 0 0 18px;
}
.mgs-arthead__meta { display: flex; flex-wrap: wrap; gap: 18px; }
.mgs-arthead__meta-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted);
}

/* ══════════════════════════════════════════════════════════
   EYECATCH CARD
══════════════════════════════════════════════════════════ */
.mgs-eyecatch {
  margin: 0 0 30px;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  line-height: 0;
}
.mgs-eyecatch__img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ══════════════════════════════════════════════════════════
   CTA BANNERS
══════════════════════════════════════════════════════════ */
.mgs-banner {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 22px;
  border-radius: var(--r-sm);
  text-decoration: none;
  margin: 30px 0;
  transition: transform .18s ease, box-shadow .18s ease;
}
.mgs-banner:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(15,58,79,.18); }
.mgs-banner--blue { background: var(--brand); color: #fff; }
.mgs-banner--dark { background: var(--navy); color: #fff; }
.mgs-banner__icon {
  width: 46px; height: 46px; flex-shrink: 0;
  background: rgba(255,255,255,.16);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.mgs-banner__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mgs-banner__label { font-size: 11px; font-weight: 600; opacity: .82; letter-spacing: .03em; }
.mgs-banner__title { font-size: 16px; font-weight: 800; line-height: 1.45; }
.mgs-banner__cta {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  font-size: 13px; font-weight: 700; white-space: nowrap;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.3);
  padding: 9px 15px; border-radius: 8px;
}
@media (max-width: 560px) {
  .mgs-banner { flex-wrap: wrap; padding: 16px; }
  .mgs-banner__cta { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════════════════════
   ARTICLE CONTENT（クリーム地・H2は白ブロック）
══════════════════════════════════════════════════════════ */
.mgs-content {
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.95;
  letter-spacing: .01em;
}
.mgs-content > *:first-child { margin-top: 0; }

.mgs-content h2 {
  font-size: clamp(20px, 2.4vw, 24px);
  font-weight: 900;
  color: var(--ink-strong);
  line-height: 1.5;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--navy);
  border-radius: 4px 10px 10px 4px;
  padding: 16px 20px;
  margin: 3em 0 1.3em;
}
.mgs-content h3 {
  font-size: clamp(17px, 2vw, 19px);
  font-weight: 800;
  color: var(--ink-strong);
  line-height: 1.55;
  margin: 2.2em 0 .9em;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}
.mgs-content h3::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--teal);
  transform: translateY(-3px);
}
.mgs-content h4 {
  font-size: 16.5px; font-weight: 700; color: var(--ink-strong);
  margin: 1.8em 0 .7em;
}
.mgs-content p { margin: 0 0 1.5em; }
.mgs-content ul, .mgs-content ol { margin: 0 0 1.6em; padding-left: 1.4em; }
.mgs-content li { margin-bottom: .6em; line-height: 1.9; }
.mgs-content ul li::marker { color: var(--teal); }
.mgs-content ol li::marker { color: var(--navy); font-weight: 700; }
.mgs-content strong { color: var(--navy); font-weight: 700; }
.mgs-content a {
  color: var(--brand); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1.5px;
}
.mgs-content a:hover { color: var(--brand-d); }

/* 表 */
.mgs-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.8em 0;
  font-size: 14.5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.mgs-content thead th { background: var(--navy); color: #fff; font-weight: 700; }
.mgs-content th, .mgs-content td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--line-2);
  border-right: 1px solid var(--line-2);
  text-align: left;
  vertical-align: top;
  line-height: 1.7;
}
.mgs-content th:last-child, .mgs-content td:last-child { border-right: none; }
.mgs-content tbody tr:last-child td { border-bottom: none; }
.mgs-content tbody th { background: #f7f9fa; font-weight: 700; color: var(--ink-strong); }
.mgs-content tbody tr:nth-child(even) td { background: #fbfaf7; }

/* 図・画像 */
.mgs-content figure { margin: 2em 0; text-align: center; }
.mgs-content img {
  max-width: 100%; height: auto; display: block; margin: 1.4em auto;
  border-radius: var(--r-sm);
}
.mgs-content figure img { margin: 0 auto; border: 1px solid var(--line); }
.mgs-content figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }
.mgs-content svg { max-width: 100%; height: auto; }

/* 引用 */
.mgs-content blockquote {
  margin: 1.8em 0; padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 0 10px 10px 0;
  color: var(--ink);
}
@media (max-width: 560px) {
  .mgs-content { font-size: 15.5px; }
  .mgs-content table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ══════════════════════════════════════════════════════════
   TAGS
══════════════════════════════════════════════════════════ */
.mgs-tags {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 36px 0 44px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.mgs-tags__label { font-size: 12px; color: var(--muted-2); font-weight: 700; margin-right: 4px; }
.mgs-tag {
  font-size: 12px; color: var(--muted); background: #f4f2ec;
  border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px;
  text-decoration: none; transition: background .15s, color .15s;
}
.mgs-tag:hover { background: #eef4f3; color: var(--teal); }

/* ══════════════════════════════════════════════════════════
   RELATED
══════════════════════════════════════════════════════════ */
.mgs-related { margin-top: 8px; }
.mgs-related__heading {
  font-size: 19px; font-weight: 900; color: var(--ink-strong);
  margin: 0 0 20px; padding-left: 14px;
  border-left: 6px solid var(--navy);
  line-height: 1.4;
}
.mgs-related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 640px) { .mgs-related__grid { grid-template-columns: 1fr; } }
.mgs-related__card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden; text-decoration: none;
  transition: box-shadow .18s, transform .18s;
}
.mgs-related__card:hover { box-shadow: 0 8px 22px rgba(15,58,79,.12); transform: translateY(-3px); }
.mgs-related__thumb { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: #f1efe8; }
.mgs-related__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.mgs-related__card:hover .mgs-related__thumb img { transform: scale(1.05); }
.mgs-related__noimg {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: #cdd6cf; background: linear-gradient(135deg,#f6f5f2,#eef4f3);
}
.mgs-related__body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.mgs-related__title {
  font-size: 13.5px; font-weight: 700; color: var(--ink-strong); line-height: 1.55; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mgs-related__date { font-size: 11px; color: var(--muted-2); margin-top: auto; }

/* ══════════════════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════════════════ */
.mgs-sidebar { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 24px; }
@media (max-width: 900px) { .mgs-sidebar { position: static; } }

.mgs-widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.mgs-widget__head {
  padding: 18px 22px 0;
  font-size: 16px; font-weight: 900; color: var(--ink-strong);
}
.mgs-widget--plain .mgs-widget__head { position: relative; }
.mgs-widget--plain .mgs-widget__head::after {
  content: ''; display: block; height: 2px; background: var(--navy);
  margin-top: 12px;
}
.mgs-widget__body { padding: 18px 22px 22px; }
.mgs-widget--plain .mgs-widget__body { padding-top: 16px; }

/* eyebrow / title for colored widgets */
.mgs-widget__eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .12em; margin: 0 0 6px; opacity: .8; }
.mgs-widget__ttl { font-size: 19px; font-weight: 900; line-height: 1.4; margin: 0 0 12px; }
.mgs-widget__lead { font-size: 13.5px; line-height: 1.8; margin: 0 0 16px; }

/* primary（診断）＝ブランドブルー */
.mgs-widget--primary { background: var(--brand); border-color: transparent; color: #fff; }
.mgs-widget--primary .mgs-widget__eyebrow { color: #cfe0ff; }
.mgs-widget--primary .mgs-widget__ttl { color: #fff; }
.mgs-widget--primary .mgs-widget__lead { color: #e7effd; }

/* dark（相談）＝ネイビー */
.mgs-widget--dark { background: var(--navy); border-color: transparent; color: #fff; }
.mgs-widget--dark .mgs-widget__eyebrow { color: #9fc6d3; }
.mgs-widget--dark .mgs-widget__ttl { color: #fff; }
.mgs-widget--dark .mgs-widget__lead { color: #d3e2e8; }

.mgs-widget__checklist { list-style: none; margin: 0 0 18px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mgs-widget__checklist li {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,.95);
  padding-left: 24px; position: relative; line-height: 1.5;
}
.mgs-widget__checklist li::before {
  content: ''; position: absolute; left: 0; top: 2px; width: 16px; height: 16px;
  background: rgba(255,255,255,.22); border-radius: 50%;
}
.mgs-widget__checklist li::after {
  content: ''; position: absolute; left: 4px; top: 6px; width: 8px; height: 4px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg);
}
.mgs-widget__btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 13px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 800; text-decoration: none;
  transition: transform .16s, background .16s; cursor: pointer;
}
.mgs-widget__btn--light { background: #fff; color: var(--brand); }
.mgs-widget__btn--light:hover { background: #eef4ff; transform: translateY(-1px); }
.mgs-widget__btn--outline { background: rgba(255,255,255,.12); color: #fff; border: 1.5px solid rgba(255,255,255,.4); }
.mgs-widget__btn--outline:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
.mgs-widget__note { font-size: 11px; color: rgba(255,255,255,.6); text-align: center; margin: 10px 0 0; }

/* 検索 */
.mgs-search { display: flex; gap: 8px; }
.mgs-search__input {
  flex: 1; min-width: 0; font-size: 14px; color: var(--ink);
  background: #f4f2ec; border: 1px solid var(--line); border-radius: 999px;
  padding: 11px 16px;
}
.mgs-search__input:focus { outline: none; border-color: var(--brand); background: #fff; }
.mgs-search__btn {
  flex-shrink: 0; width: 46px; border: none; border-radius: 999px;
  background: var(--navy); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .16s;
}
.mgs-search__btn:hover { background: var(--navy-d); }

/* 新着 */
.mgs-recent { list-style: none; margin: 0; padding: 0; }
.mgs-recent__item { border-bottom: 1px solid var(--line-2); }
.mgs-recent__item:last-child { border-bottom: none; }
.mgs-recent__link { display: flex; gap: 12px; align-items: flex-start; padding: 13px 0; text-decoration: none; transition: opacity .15s; }
.mgs-recent__link:hover { opacity: .72; }
.mgs-recent__thumb { width: 66px; height: 46px; border-radius: 8px; overflow: hidden; flex-shrink: 0; background: #f1efe8; }
.mgs-recent__thumb img { width: 100%; height: 100%; object-fit: cover; }
.mgs-recent__noimg { width: 100%; height: 100%; background: linear-gradient(135deg,#f6f5f2,#eef4f3); }
.mgs-recent__text { flex: 1; min-width: 0; }
.mgs-recent__title {
  font-size: 12.5px; font-weight: 700; color: var(--ink-strong); line-height: 1.55; margin: 0 0 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mgs-recent__date { font-size: 11px; color: var(--muted-2); }

/* テーマ（カテゴリ） */
.mgs-widget-cats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mgs-widget-cats li { border-bottom: 1px solid var(--line-2); }
.mgs-widget-cats li:last-child { border-bottom: none; }
.mgs-widget-cats__link {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px; text-decoration: none; transition: padding-left .15s;
}
.mgs-widget-cats__link:hover { padding-left: 10px; }
.mgs-widget-cats__name { font-size: 13.5px; font-weight: 600; color: var(--ink-strong); }
.mgs-widget-cats__count {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: #f4f2ec; padding: 2px 10px; border-radius: 999px; min-width: 30px; text-align: center;
}

/* ══════════════════════════════════════════════════════════
   v3 追加：パンくず / 運営者(E-E-A-T) / モバイル固定CTA
══════════════════════════════════════════════════════════ */
/* パンくず */
.mgs-breadcrumb{display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:12.5px;color:#6c7a82;margin:0 0 18px}
.mgs-breadcrumb a{color:#4f8f86;text-decoration:none}
.mgs-breadcrumb a:hover{text-decoration:underline}
.mgs-breadcrumb__sep{color:#c4ccd0}
.mgs-breadcrumb__current{color:#94a3ab;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:min(60vw,520px)}

/* 運営者（E-E-A-T）ボックス */
.mgs-author{display:flex;gap:18px;align-items:flex-start;margin:36px 0 8px;padding:22px 24px;background:#fff;border:1px solid #e7e3d9;border-radius:16px}
.mgs-author__logo{flex-shrink:0;width:120px}
.mgs-author__logo img{width:100%;height:auto;display:block}
.mgs-author__name{font-size:15px;font-weight:900;color:#143444;margin:0 0 8px}
.mgs-author__desc{font-size:13px;line-height:1.85;color:#4b5a62;margin:0 0 12px}
.mgs-author__links{display:flex;gap:10px;flex-wrap:wrap}
.mgs-author__links a{font-size:13px;font-weight:700;text-decoration:none;padding:8px 16px;border-radius:8px}
.mgs-author__links a:first-child{background:#1a56db;color:#fff}
.mgs-author__links a:last-child{background:#eef4f3;color:#0f3a4f;border:1px solid #d7e4e1}
@media(max-width:560px){.mgs-author{flex-direction:column;gap:12px}.mgs-author__logo{width:150px}}

/* モバイル固定CTAバー（スマホのみ） */
.mgs-mobcta{display:none}
@media(max-width:900px){
  .mgs-mobcta{display:flex;gap:8px;position:fixed;left:0;right:0;bottom:0;z-index:9999;
    padding:9px 10px calc(9px + env(safe-area-inset-bottom));background:rgba(255,255,255,.96);
    backdrop-filter:blur(8px);border-top:1px solid #e7e3d9;box-shadow:0 -4px 20px rgba(15,58,79,.12)}
  .mgs-mobcta__btn{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;
    font-size:14px;font-weight:800;text-decoration:none;padding:12px 8px;border-radius:11px}
  .mgs-mobcta__btn--primary{background:linear-gradient(135deg,#1a56db,#1342b0);color:#fff}
  .mgs-mobcta__btn--sub{background:#0f3a4f;color:#fff}
  body.mgs-page{padding-bottom:64px}
}
