/* SANZEN オウンドメディア（メディアTOP・記事・一覧）
   配色は LP (assets/css/style.css) の変数に合わせる。LPには読み込まない */
:root {
  --sky: #025CD2;
  --sky-deep: #024099;
  --sky-light: #8FB5DE;
  --sky-pale: #E8EDF3;
  --sky-mist: #F3FAFF;
  --sunshine: #EBCB8A;
  --orange: #E8772E;
  --orange-deep: #D2611A;
  --bg: #ffffff;
  --text: #333333;
  --text-deep: #024099;
  --muted: #868686;
  --line: #E3E8EF;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }

/* ---------- Header ---------- */
.site-header {
  background:
    url("../img/media/header-sky.jpg") center / cover no-repeat,
    linear-gradient(180deg, #7FB8EE 0%, #CFE6FA 100%);
}
.site-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 24px;
  text-align: center;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.brand__logo {
  height: 48px;
  width: auto;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,.92);
}
.brand--footer .brand__logo { padding: 0; background: none; }
.brand__name {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--sky-deep);
  text-shadow: 0 1px 0 rgba(255,255,255,.8);
}
.brand__tagline {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--sky-deep);
  letter-spacing: .04em;
}

/* ---------- Global nav ---------- */
.gnav { background: var(--sky); }
.gnav__toggle { display: none; }
.gnav__list {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}
.gnav__list a {
  display: block;
  padding: 15px 36px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .04em;
  transition: background .15s;
}
.gnav__list a:hover,
.gnav__list .current-menu-item > a,
.gnav__list a[aria-current="page"] { background: var(--sky-deep); }

/* ---------- Layout ---------- */
.layout {
  max-width: 1100px;
  margin: 0 auto;
  padding: 44px 20px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 44px;
}
.section-title {
  margin: 0 0 20px;
  padding-left: 12px;
  border-left: 5px solid var(--sky);
  font-size: 20px;
  color: var(--text-deep);
}

/* ---------- Post cards ---------- */
.post-card + .post-card { border-top: 1px solid var(--line); }
.post-card a {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 20px;
  padding: 20px 0;
}
.post-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 6px;
  background: var(--sky-pale);
}
.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.post-card a:hover .post-card__thumb img { transform: scale(1.04); }
.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sunshine);
  color: #5A3E08;
  font-size: 11px;
  font-weight: 700;
}
.post-card__body { display: flex; flex-direction: column; }
.post-card__title {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-deep);
}
.post-card a:hover .post-card__title { text-decoration: underline; }
.post-card__excerpt {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__date {
  margin-top: auto;
  padding-top: 8px;
  align-self: flex-end;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Pagination ---------- */
.next-page {
  display: block;
  margin-top: 24px;
  padding: 12px;
  border: 1px solid var(--sky);
  border-radius: 4px;
  text-align: center;
  color: var(--sky);
  font-weight: 700;
  transition: background .15s, color .15s;
}
.next-page:hover { background: var(--sky); color: #fff; }
.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}
.pagination .page-numbers {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--sky);
  font-weight: 700;
}
.pagination .page-numbers.dots { border-color: transparent; color: var(--muted); }
.pagination .page-numbers.current {
  background: var(--sunshine);
  border-color: var(--sunshine);
  color: #5A3E08;
}

/* ---------- Sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 32px; }
.search {
  display: flex;
  border: 1px solid #C9D2DE;
  border-radius: 4px;
  overflow: hidden;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.search button {
  border: 0;
  background: none;
  padding: 0 14px;
  color: var(--muted);
  cursor: pointer;
}
.widget__title {
  margin: 0 0 14px;
  padding: 10px 14px;
  background: var(--sky);
  color: #fff;
  font-size: 15px;
  letter-spacing: .04em;
}
.popular { counter-reset: rank; }
.popular li + li { margin-top: 14px; }
.popular a {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  font-size: 13px;
  line-height: 1.55;
}
.popular a::before {
  counter-increment: rank;
  content: counter(rank);
  position: absolute;
  top: -4px;
  left: -4px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sky-deep);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  z-index: 1;
}
.popular img {
  width: 96px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
}
.popular a:hover span { text-decoration: underline; color: var(--sky-deep); }

.cta {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 18px;
  text-align: center;
  background: var(--sky-mist);
}
.cta__kicker {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 12px;
  border-radius: 999px;
  background: var(--sky-deep);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.cta__head {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.45;
  color: var(--text-deep);
}
.cta__img { border-radius: 4px; margin-bottom: 12px; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.cta__sub { margin: 0 0 12px; font-size: 12px; color: var(--text); }
.cta__btn {
  display: block;
  padding: 14px 10px;
  border-radius: 6px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 0 var(--orange-deep);
  transition: transform .1s, box-shadow .1s;
}
.cta__btn:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--orange-deep); }

/* ---------- Footer ---------- */
.pagetop {
  display: block;
  padding: 10px;
  background: var(--sky-light);
  color: #fff;
  text-align: center;
  font-weight: 700;
  letter-spacing: .06em;
}
.site-footer { background: var(--sky-mist); }
.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 32px;
}
.brand--footer .brand__logo { height: 26px; }
.brand--footer .brand__name { font-size: 16px; text-shadow: none; }
.footer-links { display: flex; gap: 20px; font-size: 13px; }
.footer-links a:hover { text-decoration: underline; }
.copyright { margin: 0 0 0 auto; font-size: 12px; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 48px; padding: 28px 16px 56px; }
}
@media (max-width: 640px) {
  .site-header__inner { padding: 20px 16px 18px; }
  .brand { gap: 10px; }
  .brand__logo { height: 34px; padding: 6px 10px; }
  .brand__name { font-size: 20px; }
  .brand__tagline { font-size: 11px; }

  .gnav__toggle {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: 0;
    background: var(--sky);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
  }
  .gnav__toggle::after { content: "☰"; float: right; }
  .gnav__list { display: none; flex-direction: column; }
  .gnav__list.is-open { display: flex; }
  .gnav__list a { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.2); }

  .post-card a { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 16px 0; }
  .post-card__title { font-size: 14px; margin-bottom: 0; }
  .post-card__excerpt { display: none; }
  .badge { font-size: 10px; padding: 1px 8px; top: 6px; left: 6px; }

  .site-footer__inner { flex-direction: column; align-items: flex-start; }
  .copyright { margin-left: 0; }
}

/* =========================================================
   記事詳細（single）
   ========================================================= */
.breadcrumb {
  margin-bottom: 18px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breadcrumb a { color: var(--sky); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }
.breadcrumb span[aria-current] { margin: 0; }

.badge--inline { position: static; display: inline-block; }
.article__title {
  margin: 12px 0 10px;
  font-size: 28px;
  line-height: 1.45;
  color: var(--text-deep);
}
.article__meta {
  display: flex;
  gap: 16px;
  margin: 0 0 20px;
  font-size: 12px;
  color: var(--muted);
}
.article__eyecatch {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
}

/* 本文 */
.entry { margin-top: 32px; font-size: 16px; line-height: 1.95; }
.entry :where(p) { margin: 0; }
.entry > * { margin-bottom: 0; }
.entry > * + * { margin-top: 1.4em; }
.entry a { color: var(--sky); text-decoration: underline; }
.entry strong { color: var(--text-deep); }
/* 見出し・表ヘッダー内の太字は親の色に揃える（原稿で見出しごと太字のケース） */
.entry h2 strong, .entry h3 strong, .entry h4 strong,
.entry th strong, .entry .toc strong { color: inherit; }
.entry mark {
  background: linear-gradient(transparent 60%, rgba(235, 203, 138, .7) 60%) !important;
  color: inherit !important;
  font-weight: 700;
}
.entry h2 {
  margin: 2.6em 0 0;
  padding: 14px 18px;
  border-radius: 6px;
  background: var(--sky);
  color: #fff;
  font-size: 22px;
  line-height: 1.5;
}
.entry h3 {
  margin: 2em 0 0;
  padding: 4px 0 8px 14px;
  border-left: 5px solid var(--sky);
  border-bottom: 1px solid var(--line);
  color: var(--text-deep);
  font-size: 19px;
  line-height: 1.5;
}
.entry h2 + *, .entry h3 + * { margin-top: 1em; }
.entry ul, .entry ol { padding-left: 1.5em; }
.entry ul { list-style: disc; }
.entry ol { list-style: decimal; }
.entry li + li { margin-top: .3em; }
.entry img { border-radius: 6px; height: auto; }
.entry figcaption { margin-top: 6px; font-size: 12px; color: var(--muted); text-align: center; }
.entry .has-small-font-size { font-size: 12px !important; color: var(--muted); }
.entry * + .has-small-font-size { margin-top: .6em; }

/* 目次 */
.toc {
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--sky-mist);
}
.toc__title { font-weight: 800; color: var(--text-deep); }
.entry .toc ol { margin-top: .6em; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--sky); text-decoration: underline; }

/* 表 */
.entry .wp-block-table { margin-left: 0; margin-right: 0; overflow-x: auto; }
.entry table { width: 100%; min-width: 480px; border-collapse: collapse; font-size: 14px; }
.entry .wp-block-table figcaption { text-align: left; }
.entry .wp-block-table thead { border-bottom: 0; }
.entry .wp-block-table th, .entry .wp-block-table td { border: 1px solid var(--line); }
.entry .wp-block-table thead th { border-color: var(--sky-deep); }
.entry th, .entry td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; }
.entry thead th { background: var(--sky-deep); color: #fff; }
.entry tbody tr:nth-child(even) { background: var(--sky-mist); }

/* 引用 */
.entry blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: 18px 22px 18px 52px;
  position: relative;
  background: var(--sky-pale);
  border-radius: 8px;
  color: #444;
}
.entry blockquote::before {
  content: "“";
  position: absolute;
  left: 16px;
  top: 0;
  font-size: 56px;
  line-height: 1;
  color: var(--sky-light);
  font-family: Georgia, serif;
}

/* 記事末CTA */
.article-cta { margin-top: 56px; }
.article-cta__lead { margin: 0 0 10px; font-weight: 800; color: var(--text-deep); text-align: center; }
.cta--wide {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  text-align: left;
  padding: 22px;
  border: 2px solid var(--sky-light);
}
.cta--wide .cta__img { margin: 0; }
.cta--wide .cta__btn { display: inline-block; padding: 14px 32px; }

/* 監修者 */
.author {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  padding: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.author__avatar {
  flex: 0 0 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--sky-pale);
  color: var(--sky-deep);
  font-weight: 800;
  font-size: 24px;
}
.author__label { margin: 0; font-size: 11px; color: var(--muted); }
.author__name { margin: 0 0 4px; font-weight: 800; color: var(--text-deep); }
.author__desc { margin: 0; font-size: 13px; color: #555; }

/* 関連記事 */
.related { margin-top: 48px; }
.related__list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.related__list img { aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; margin-bottom: 8px; width: 100%; }
.related__list span { font-size: 13px; font-weight: 700; line-height: 1.55; color: var(--text-deep); }
.related__list a:hover span { text-decoration: underline; }

/* =========================================================
   ブロックスタイル（functions.php で register_block_style）
   エディタ側は media-editor.css に同内容
   ========================================================= */
/* グループ：POINT / 注意 */
.is-style-sanzen-point,
.is-style-sanzen-caution {
  position: relative;
  padding: 26px 22px 18px;
  border-radius: 8px;
  border: 2px solid var(--sky-light);
  background: #fff;
}
.is-style-sanzen-point::before,
.is-style-sanzen-caution::before {
  content: "POINT";
  position: absolute;
  top: -12px;
  left: 16px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--sky);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 24px;
}
.is-style-sanzen-caution { border-color: #F0B7A0; background: #FFF8F4; }
.is-style-sanzen-caution::before { content: "注意"; background: var(--orange-deep); }
.is-style-sanzen-point > * + *,
.is-style-sanzen-caution > * + * { margin-top: .8em; }

/* リスト：チェックリスト */
.entry ul.is-style-sanzen-checklist {
  list-style: none;
  padding: 18px 22px;
  border-radius: 8px;
  background: #FFFBF1;
  border: 1px solid var(--sunshine);
}
.is-style-sanzen-checklist li { position: relative; padding-left: 30px; font-weight: 700; }
.is-style-sanzen-checklist li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .45em;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--sky) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12l4 4 8-8' fill='none' stroke='%23fff' stroke-width='3'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* 詳細(details)：FAQ  summary=質問 / 中身=回答 */
.is-style-sanzen-faq { margin-bottom: 1.2em; }
.is-style-sanzen-faq > summary {
  position: relative;
  padding: 12px 40px 12px 48px;
  background: var(--sky-mist);
  border-radius: 6px;
  font-weight: 800;
  color: var(--text-deep);
  cursor: pointer;
  list-style: none;
}
.is-style-sanzen-faq > summary::-webkit-details-marker { display: none; }
.is-style-sanzen-faq > summary::after {
  content: "＋";
  position: absolute;
  right: 16px;
  top: 12px;
  color: var(--sky);
}
.is-style-sanzen-faq[open] > summary::after { content: "－"; }
.is-style-sanzen-faq > :not(summary) { position: relative; margin: 10px 0 0; padding: 0 16px 0 48px; }
.is-style-sanzen-faq > summary::before,
.is-style-sanzen-faq > :not(summary):first-of-type::before {
  position: absolute;
  left: 14px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}
.is-style-sanzen-faq > summary::before { content: "Q"; top: 12px; background: var(--sky); }
.is-style-sanzen-faq > :not(summary):first-of-type::before { content: "A"; top: 4px; background: var(--orange); }

/* ---------- WP 固有 ---------- */
.archive-desc { margin: -8px 0 20px; font-size: 13px; color: var(--muted); }
.no-posts { padding: 40px 0; color: var(--muted); }
.entry .aligncenter { margin-left: auto; margin-right: auto; }
.entry .wp-block-image { margin-left: 0; margin-right: 0; }
.entry .wp-block-image img { max-width: 100%; height: auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

/* サイドバーCTAを追従 */
.widget--sticky { position: sticky; top: 20px; }

@media (max-width: 900px) {
  .widget--sticky { position: static; }
}
@media (max-width: 640px) {
  .article__title { font-size: 21px; }
  .entry { font-size: 15px; }
  .entry h2 { font-size: 18px; padding: 12px 14px; }
  .entry h3 { font-size: 16px; }
  .cta--wide { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .cta--wide .cta__btn { display: block; }
  .related__list { grid-template-columns: minmax(0, 1fr); }
  .related__list a { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: start; }
  .related__list img { margin: 0; }
}
