/*
Theme Name: Meddy Theme
Version: 0.2
*/

/* ====== Fonts ====== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@600;800&family=Noto+Sans+JP:wght@400;700;800&display=swap');

/* ====== CSS Variables ====== */
:root{
  --meddy-navy:#1A3C6E;
  --meddy-cobalt:#2A73B9;
  --meddy-mint:#63C5DA;
  --meddy-bg:#F6F8FA;
  --meddy-text:#333;
  --meddy-border:#E3E8EF;
  --radius-2:12px;
  --radius-3:20px;
  --shadow-1:0 8px 24px rgba(26,60,110,.12);
}

/* ====== Base ====== */
html,body{
  margin:0; padding:0;
  background:var(--meddy-bg);
  color:var(--meddy-text);
  font-family:"Noto Sans JP", Inter, system-ui, sans-serif;
  line-height:1.7;
}
*{ box-sizing:border-box; }
a{ color:var(--meddy-cobalt); text-decoration:none; }
a:hover{ text-decoration:underline; }
img{ max-width:100%; height:auto; display:block; }

/* ====== Layout ====== */
.container{ max-width:1160px; margin:0 auto; padding:0 16px; }

/* ====== Header (Frosted, non-sticky by default) ====== */
/* 固定したくなったら position: sticky; top:0; に変更 */
.site-header{
  position:relative; /* ← 非固定 */
  z-index:1000;
  background:rgba(255,255,255,0.6);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom:1px solid rgba(0,0,0,0.06);
  transition: background-color .3s ease, box-shadow .3s ease;
}
body.scrolled .site-header{
  background:rgba(255,255,255,0.8);
  box-shadow:0 8px 20px rgba(0,0,0,0.08);
}

.header-inner{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:14px 0;
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand-logo{
  display:inline-grid; place-items:center; width:36px; height:36px;
  border-radius:10px; color:#fff; font-weight:800; font-size:18px;
  background:linear-gradient(135deg,var(--meddy-navy),var(--meddy-cobalt));
  box-shadow:var(--shadow-1);
}
.brand-title{ font-weight:800; letter-spacing:.4px; color:var(--meddy-navy); }
.brand-sub{ font-size:12px; color:#5b6b7f; }

/* ====== Global Navigation ====== */
.nav{ display:flex; align-items:center; }
.nav ul.menu{
  display:flex; gap:18px;
  list-style:none; margin:0; padding:0;
}
.nav ul.menu > li{ list-style:none; }
.nav ul.menu a{
  display:inline-block;
  padding:8px 10px;
  border-radius:10px;
  color:#1a3c6e;
  font-weight:600;
  text-decoration:none;
  transition: color .2s ease, background-color .2s ease;
}
.nav ul.menu a:hover,
.nav .current-menu-item > a{
  background:rgba(26,60,110,.08);
  text-decoration:none;
}

/* Header Search */
.search input[type="search"]{
  width:230px; max-width:52vw;
  padding:8px 12px; border:1px solid var(--meddy-border);
  border-radius:12px; background:#fff; outline:none;
}
@media (max-width:880px){
  .nav{ display:none; }
  .search input[type="search"]{ width:160px; }
}

/* ====== Footer ====== */
.site-footer{
  margin-top:28px; padding:24px 0;
  color:#5b6b7f; border-top:1px solid var(--meddy-border);
  background:#fff;
}
.foot-grid{
  display:grid; grid-template-columns:2fr 1fr 1fr; gap:16px;
}
.foot-title{ margin:0 0 10px; color:#24324a; font-size:15px; }
.foot-small{ font-size:12.5px; }
@media (max-width:900px){ .foot-grid{ grid-template-columns:1fr; } }

/* Footer nav (WPメニュー連携用) */
.footer-nav{ text-align:center; margin-top:20px; }
.footer-menu{ list-style:none; padding:0; display:inline-flex; gap:20px; margin:0; }
.footer-menu a{ color:#666; text-decoration:none; font-size:14px; }
.footer-menu a:hover{ color:#1a73e8; text-decoration:underline; }

/* Footer bottom bar */
.foot-bottom{
  border-top:1px solid rgba(0,0,0,.06);
  background:#fff8;
  backdrop-filter: blur(6px) saturate(130%);
}
.foot-bottom-inner{
  display:flex; align-items:center; gap:16px; justify-content:space-between;
  padding:10px 0;
}
.foot-mini a{ font-size:12px; color:#4a4a4a; text-decoration:none; }
.foot-mini a:hover{ text-decoration:underline; }
.copy{ color:#666; font-size:12px; white-space:nowrap; }
.to-top{
  border:1px solid rgba(0,0,0,.08); border-radius:8px; background:#fff;
  padding:6px 10px; cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,.06);
}
.to-top:hover{ transform: translateY(-1px); }
@media (max-width:640px){
  .foot-bottom-inner{ flex-direction:column; align-items:flex-start; gap:8px; }
}

/* ====== Home / Top (front-page) ====== */
.hero{ padding:28px 0; }
.hero-grid{ display:grid; grid-template-columns:2fr 1fr; gap:18px; }
.card{
  background:#fff; border:1px solid var(--meddy-border);
  border-radius:20px; box-shadow:var(--shadow-1); overflow:hidden;
}
.card-media img{ width:100%; height:auto; aspect-ratio:16/9; object-fit:cover; }
.card-body{ padding:16px 16px 20px; }
.card-title{ margin:0 0 8px; font-size:22px; line-height:1.35; color:var(--meddy-navy); }
.card-desc{ margin:6px 0 0; color:#445; }
.meta{
  display:flex; flex-wrap:wrap; gap:10px; color:#5b6b7f; font-size:13px; margin:8px 0 0;
}
.btn{
  display:inline-flex; align-items:center; gap:8px; padding:10px 14px;
  background:var(--meddy-navy); color:#fff; border-radius:12px;
  box-shadow:var(--shadow-1); text-decoration:none;
}
.btn:hover{ opacity:.95; text-decoration:none; }

.side-stack{ display:grid; gap:12px; }
.side-item{
  display:grid; grid-template-columns:96px 1fr; gap:12px; align-items:center;
  padding:10px; border:1px solid var(--meddy-border);
  border-radius:14px; background:#fff;
}
.side-item .thumb{ width:100%; aspect-ratio:16/10; border-radius:10px; overflow:hidden; background:#eef2f7; }
.side-item .thumb img{ width:100%; height:100%; object-fit:cover; }
.side-item h4{ margin:0; font-size:14.5px; color:#24324a; }

.row{ padding:10px 0; }
.row-head{ display:flex; align-items:flex-end; justify-content:space-between; margin:10px 4px; }
.row-title{ font-size:18px; color:#24324a; margin:0; }
.link-more{ color:var(--meddy-cobalt); font-weight:700; text-decoration:none; }
.link-more:hover{ text-decoration:underline; }

.cat-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.cat-card{
  padding:18px; border-radius:16px; border:1px solid var(--meddy-border);
  background:#fff; box-shadow:var(--shadow-1);
}
.cat-card h3{ margin:0 0 8px; color:var(--meddy-navy); }

.grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.post{
  background:#fff; border:1px solid var(--meddy-border);
  border-radius:16px; overflow:hidden; box-shadow:var(--shadow-1);
}
.post .thumb img{ width:100%; aspect-ratio:16/9; object-fit:cover; }
.post h4{ margin:10px 12px 6px; font-size:16px; color:#24324a; }
.post .meta{ margin:0 12px 12px; }

@media (max-width:960px){ .hero-grid{ grid-template-columns:1fr; } }
@media (max-width:900px){ .grid, .cat-grid{ grid-template-columns:1fr; } }

/* ====== Buttons (generic) ====== */
.btn-primary{
  display:inline-block; padding:10px 16px; font-weight:700;
  border-radius:12px; background:var(--meddy-cobalt); color:#fff;
  text-decoration:none; transition: transform .08s ease, box-shadow .2s ease;
}
.btn-primary:hover{ transform: translateY(-1px); box-shadow:0 6px 16px rgba(0,0,0,.12); }

/* ====== Contact Form 7 (統一) ====== */
.wpcf7 form{
  max-width:720px; margin:30px auto; background:#fff;
  border:1px solid #e3e7ee; border-radius:20px;
  box-shadow:0 4px 8px rgba(0,0,0,0.04); padding:25px;
}
.wpcf7 form label{
  display:block; margin:12px 0 6px; color:#24324a; font-weight:700;
}
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 textarea{
  width:100%; padding:10px; border:1px solid #ccc;
  border-radius:12px; background:#fafafa; transition:all .2s ease;
}
.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 textarea:focus{
  border-color:#4169e1; background:#fff; outline:none;
}
.wpcf7 input[type="submit"]{
  margin-top:12px; padding:10px 18px; border:none; border-radius:12px;
  background:#213c8c; color:#fff; cursor:pointer; font-weight:bold;
}
.wpcf7 input[type="submit"]:hover{ background:#2e4ab6; }
.wpcf7-list-item-label{ color:#333; }
.wpcf7-acceptance{ margin-top:12px; display:block; }

/* ====== Utility ====== */
.hidden{ display:none !important; }
.center{ text-align:center; }
.mt-0{ margin-top:0 !important; }
.mb-0{ margin-bottom:0 !important; }
/* 現在地・祖先メニューもハイライト */
.nav .current-menu-item > a,
.nav .current-menu-ancestor > a,
.nav .current_page_item > a {
  background: rgba(26,60,110,.12);
  color: #1a3c6e;
  text-decoration: none;
}
.nav a:focus-visible,
.btn:focus-visible,
.btn-primary:focus-visible,
.cta-btn:focus-visible {
  outline: 3px solid rgba(33,76,178,.45);
  outline-offset: 2px;
  border-radius: 10px;
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
/* 広告ボックス（AdSense等） */
.ad-box { margin: 20px 0; text-align: center; }
.ad-box ins { display:block; }

/* 記事下CTA */
.cta-box{
  background:#f9fbff; border:1px solid #dbe3f2; border-radius:16px;
  padding:20px; box-shadow:0 4px 12px rgba(26,60,110,.08); margin-top:32px;
}
.cta-box h2{ margin:0 0 10px; color:#1a3c6e; font-size:18px; }
.cta-box ul{ margin:0 0 12px 1.2em; }
.cta-btn{
  display:inline-block; background:var(--meddy-cobalt); color:#fff;
  font-weight:700; padding:10px 18px; border-radius:12px; text-decoration:none;
}
.cta-btn:hover{ background:#1a4f9f; }
/* 表の標準化 */
article table{ width:100%; border-collapse: collapse; margin:16px 0; background:#fff; }
article th, article td{ border:1px solid #e3e8ef; padding:10px; }
article th{ background:#f4f7fb; color:#24324a; }

/* メモ・注意 */
.note{
  background:#fffaf2; border:1px solid #ffe3b5; border-left:4px solid #ffb74d;
  padding:12px 14px; border-radius:12px; margin:14px 0;
}

/* バッジ（“新薬”など） */
.badge{
  display:inline-block; padding:3px 8px; border-radius:999px;
  background:#e8f1ff; color:#1a3c6e; font-size:12px; font-weight:700;
}
/* サムネイルの枠を先に確保してガタつきを防ぐ */
.thumb img, .card-media img, .post .thumb img { aspect-ratio: 16/9; object-fit: cover; }
.toc{
  background:#fff; border:1px solid #e3e8ef; border-radius:16px; padding:16px;
}
.toc h3{ margin:0 0 8px; font-size:16px; color:#1a3c6e; }
.toc ol{ margin:0; padding-left:1.2em; }
.article-meta-band{display:flex;flex-wrap:wrap;gap:10px;font-size:13px;color:#5b6b7f;margin:10px 0 14px}
.badge{padding:2px 8px;border-radius:999px;font-weight:700}
.badge-A{background:#e6f5ec;color:#0f8b3a;border:1px solid #bfe6cf}
.badge-B{background:#eef3ff;color:#1a3c6e;border:1px solid #cddcff}
.badge-C{background:#fff2e6;color:#b65a00;border:1px solid #ffd6ad}
.article-note{margin:8px 0 16px;padding:10px 12px;border:1px solid #ffe5b3;border-radius:12px;background:#fffaf0;color:#6b4e00;font-size:13px}
/* ====== 本文内リンク/参考文献のボックス ====== */
.links-box, .refs-box{
  margin: 26px 0;
  padding: 18px 18px 14px;
  background: #fff;
  border: 1px solid var(--meddy-border);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
}
.links-title, .refs-title{
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--meddy-navy);
}
.links-list, .refs-list{
  margin: 0 0 4px 18px;
}
.links-list li, .refs-list li{
  margin: 6px 0;
  line-height: 1.6;
}
.links-list a{ color: var(--meddy-cobalt); text-decoration: none; }
.links-list a:hover{ text-decoration: underline; }
