/*
Theme Name: クリニックノート
Theme URI: https://clinic-note.net
Author: Media Dev Team
Description: 医療・ヘルスケア専門メディア「クリニックノート」（https://clinic-note.net）。正しい医療情報を、わかりやすく伝えるテーマ。
Version: 3.4.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: clinic-note
Tags: blog, two-columns, right-sidebar, custom-menu, featured-images, translation-ready
*/

:root {
  --ink: #1a2b2e;
  --muted: #6a787c;
  --line: #e2e8ea;
  --bg: #f5f7f8;
  --white: #fff;
  --teal: #0f6d75;
  --teal-soft: #e7f3f4;
  --font: "IBM Plex Sans JP", "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  --max: 1080px;
  --side: 280px;
  --gap: 36px;
  --pad: 20px;
  --r: 10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
  overflow-x: clip;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--teal); }
ul, ol { list-style: none; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus {
  position: fixed; left: 8px; top: 8px; z-index: 9999;
  background: var(--white); padding: 8px 14px; border-radius: 6px;
}

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.chip {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 2px 10px;
  border-radius: 999px;
  line-height: 1.6;
}
.chip--sm { font-size: .65rem; padding: 1px 8px; }

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 24px var(--pad) 16px;
  text-align: center;
}
.site-title { line-height: 0; }
.site-title a { display: inline-block; }
.site-logo { height: 44px; width: auto; margin: 0 auto; }
.site-desc {
  margin-top: 8px;
  font-size: .78rem;
  color: var(--muted);
}

.site-nav { border-top: 1px solid var(--line); }
.site-nav__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  justify-content: center;
  position: relative;
}
.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 6px;
  padding: 7px 12px;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.nav-menu ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.nav-menu a {
  display: block;
  padding: 12px 14px;
  font-size: .85rem;
  font-weight: 600;
}
.nav-menu a:hover { color: var(--teal); }

/* Cover */
.cover {
  margin: 28px 0 0;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.cover__main {
  display: grid;
  grid-template-rows: auto 1fr;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.cover__media {
  display: block;
  line-height: 0;
  background: var(--teal-soft);
}
.cover__media img,
.cover__media .noimg {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.cover__body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cover__title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.45;
}
.cover__title a:hover { color: var(--teal); }
.cover__ex {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.7;
}
.cover__body time {
  font-size: .75rem;
  color: var(--muted);
  margin-top: auto;
}

.cover__side {
  display: flex;
  flex-direction: column;
}
.cover__side li {
  flex: 1;
  border-bottom: 1px solid var(--line);
}
.cover__side li:last-child { border-bottom: 0; }
.cover__side a {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  height: 100%;
  color: inherit;
}
.cover__side a:hover { background: #fafbfb; color: inherit; }
.cover__side-thumb {
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
}
.cover__side-thumb img,
.cover__side-thumb .noimg {
  width: 80px;
  height: 60px;
  object-fit: cover;
}
.cover__side-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.cover__side-title {
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cover__side a:hover .cover__side-title { color: var(--teal); }
.cover__side time { font-size: .7rem; color: var(--muted); }

/* Layout */
.layout {
  margin: 32px 0 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side);
  gap: var(--gap);
  align-items: start;
}
.layout__main { min-width: 0; }

.section { margin-bottom: 8px; }
.section__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--teal);
}
.section__more { margin-top: 24px; text-align: center; }
.btn {
  display: inline-block;
  padding: 10px 28px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--teal);
  background: var(--white);
}
.btn:hover { background: var(--teal); color: #fff; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* Cards / list */
.post-list { display: grid; gap: 14px; }
.card {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.card__thumb {
  display: block;
  line-height: 0;
  background: var(--teal-soft);
}
.card__thumb img,
.card__thumb .noimg {
  width: 100%;
  height: 100%;
  min-height: 130px;
  object-fit: cover;
}
.card__body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}
.card__title a:hover { color: var(--teal); }
.card__ex {
  font-size: .84rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__date {
  margin-top: auto;
  font-size: .72rem;
  color: var(--muted);
}

.page-head {
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--teal);
}
.page-head__title { font-size: 1.15rem; font-weight: 700; }
.page-head__desc { margin-top: 6px; font-size: .85rem; color: var(--muted); }

/* Sidebar */
.sidebar { min-width: 0; }
.widget {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  margin-bottom: 16px;
}
.widget__title {
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.rank { display: flex; flex-direction: column; }
.rank__item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.rank__item:last-child { border-bottom: 0; padding-bottom: 0; }
.rank__item:first-child { padding-top: 0; }
.rank__num {
  font-size: .9rem;
  font-weight: 800;
  color: var(--teal);
  text-align: center;
  line-height: 1.4;
}
.rank__link {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: inherit;
}
.rank__link:hover { color: inherit; }
.rank__thumb { border-radius: 6px; overflow: hidden; line-height: 0; }
.rank__thumb img,
.rank__thumb .noimg {
  width: 64px;
  height: 48px;
  object-fit: cover;
}
.rank__title {
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rank__link:hover .rank__title { color: var(--teal); }

.cat-list li { border-bottom: 1px solid var(--line); }
.cat-list li:last-child { border-bottom: 0; }
.cat-list a {
  display: block;
  padding: 9px 0;
  font-size: .85rem;
}

.search-form { display: flex; gap: 6px; }
.search-form .search-field {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  font: inherit;
  font-size: .84rem;
  background: var(--bg);
}
.search-form .search-submit {
  border: 0;
  background: var(--teal);
  color: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Single */
.breadcrumb {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; }
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li + li::before { content: "›"; margin: 0 8px; opacity: .4; }

.article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px 30px;
}
.article__header { margin-bottom: 8px; }
.article__title {
  margin: 10px 0 12px;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.4;
}
.article__meta {
  font-size: .8rem;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.article__thumb {
  margin: 18px 0;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}
.article__thumb img,
.article__thumb .noimg { width: 100%; }
.article__thumb .noimg { aspect-ratio: 16 / 9; min-height: 0; }

.entry-content { font-size: 1rem; }
.entry-content > * + * { margin-top: 1.35em; }
.entry-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  padding: 10px 14px;
  background: var(--teal-soft);
  border-left: 3px solid var(--teal);
}
.entry-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.entry-content ul,
.entry-content ol { padding-left: 1.5em; }
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content blockquote {
  border-left: 3px solid var(--teal);
  padding: 12px 16px;
  background: var(--bg);
  color: var(--muted);
}
.entry-content a { color: var(--teal); text-decoration: underline; }
.entry-content img { border-radius: 8px; }
.entry-content table {
  border-collapse: collapse;
  width: 100%;
  display: block;
  overflow-x: auto;
}
.entry-content th,
.entry-content td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  font-size: .9rem;
}
.entry-content th { background: var(--teal-soft); }

.article__footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.article__tags a {
  display: inline-block;
  font-size: .72rem;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 3px 10px;
  margin: 0 6px 6px 0;
}
.article__share {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
}
.share {
  display: inline-block;
  color: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .74rem;
}
.share--x { background: #0f1419; }
.share--fb { background: #1877f2; }
.share--line { background: #06c755; }

.related {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.related__item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  color: inherit;
}
.related__item:hover { color: inherit; }
.related__item:hover .related__title { color: var(--teal); }
.related__thumb { display: block; line-height: 0; }
.related__thumb img,
.related__thumb .noimg {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.related__title {
  display: block;
  padding: 12px;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.45;
}

.pagination { margin-top: 28px; text-align: center; }
.pagination .nav-links {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.pagination .page-numbers {
  display: inline-block;
  min-width: 36px;
  padding: 7px 11px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .84rem;
}
.pagination .page-numbers.current {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* Footer */
.site-footer {
  background: #243336;
  color: #a8b4b7;
}
.site-footer__inner { padding: 36px var(--pad) 0; }
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  padding-bottom: 24px;
}
.site-footer__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 0;
}
.site-footer__name a { color: inherit; display: inline-block; }
.site-footer__logo {
  height: 36px;
  width: auto;
  display: block;
}
.site-footer__desc { margin-top: 10px; font-size: .82rem; }
.site-footer__label {
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}
.site-footer ul { display: flex; flex-direction: column; gap: 8px; }
.site-footer a { color: #a8b4b7; font-size: .84rem; }
.site-footer a:hover { color: #fff; }
.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 14px 0 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .74rem;
}

.noimg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: linear-gradient(135deg, #c5dde0, #0f6d75 70%);
}
.error-page {
  max-width: 560px;
  margin: 40px auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 40px 24px;
  text-align: center;
}
.error-code {
  font-size: 3rem;
  font-weight: 800;
  color: var(--teal);
}

@media (max-width: 900px) {
  .cover { grid-template-columns: 1fr; }
  .cover__main { border-right: 0; border-bottom: 1px solid var(--line); }
  .layout { grid-template-columns: 1fr; gap: 28px; }
  .related { grid-template-columns: repeat(2, 1fr); }
  .site-footer__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .site-header__inner { padding: 18px 16px 12px; }
  .site-logo { height: 38px; }
  .nav-toggle {
    display: inline-block;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
  }
  .site-nav__inner {
    justify-content: flex-start;
    min-height: 46px;
    padding: 8px 16px;
  }
  .nav-menu { display: none; width: 100%; }
  .nav-menu.is-open { display: block; }
  .nav-menu ul { flex-direction: column; }
  .nav-menu a {
    padding: 11px 4px;
    border-bottom: 1px solid var(--line);
  }
  .container { padding: 0 16px; }
  .cover { margin-top: 18px; }
  .cover__title { font-size: 1.15rem; }
  .card { grid-template-columns: 1fr; }
  .article { padding: 20px 16px; }
  .article__title { font-size: 1.35rem; }
  .related { grid-template-columns: 1fr; }
  .layout { margin: 24px 0 40px; }
}
