/*
 * 2nd-train公式ブログ（blog.2nd-train.net）の CSS
 * BlogShell build が /home/kusanagi/blog_2ndtrain/static/assets/blog.css に写す。変えたら Model/Blogbuilder.php の CSSVER を上げる
 * 色は 2nd-train（Material Design for Bootstrap）に合わせる：帯 #ff5722・地 #eee・リンク #009688
 * 後半は WordPress の本文の HTML（旧エディタ・ブロック）が前提にしている規則（alignleft・wp-caption など）
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #eee;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.8;
}
a { color: #009688; }
a:hover, a:focus { color: #00695c; }
img { max-width: 100%; height: auto; }

/* 上：ロゴ・「公式ブログ」・カテゴリの帯 */
.blog-header { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.blog-header-inner {
  max-width: 1000px; margin: 0 auto; padding: 10px 12px;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
}
.blog-logo img { display: block; width: 240px; height: auto; }
.blog-name {
  display: inline-block; padding: 2px 12px; border-radius: 3px;
  background: #ff5722; color: #fff; font-weight: bold; text-decoration: none; letter-spacing: .05em;
}
.blog-name:hover, .blog-name:focus { background: #e64a19; color: #fff; }
.blog-nav { background: #ff5722; }
.blog-nav ul {
  max-width: 1000px; margin: 0 auto; padding: 0 6px; list-style: none;
  display: flex; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.blog-nav ul::-webkit-scrollbar { display: none; }
.blog-nav a { display: block; padding: 9px 12px; color: rgba(255,255,255,.92); text-decoration: none; font-size: 14px; }
.blog-nav a:hover, .blog-nav a:focus { color: #fff; background: rgba(0,0,0,.12); }
.blog-nav .is-current a { color: #fff; font-weight: bold; box-shadow: inset 0 -3px 0 #fff; }

/* 中身 */
.blog-main { max-width: 820px; margin: 0 auto; padding: 16px 10px 8px; }
.blog-card {
  background: #fff; border-radius: 2px; margin: 0 0 16px; padding: 16px;
  box-shadow: 0 1px 6px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.12);
}
.blog-crumb { font-size: 13px; color: #777; margin-bottom: 6px; }
.blog-crumb a { color: #777; }
.blog-title { font-size: 24px; line-height: 1.45; margin: 0 0 8px; font-weight: bold; }
.blog-listtitle { font-size: 20px; line-height: 1.45; margin: 0 0 8px; padding-left: 10px; border-left: 5px solid #ff5722; }
.blog-pageno { font-size: 14px; font-weight: normal; color: #777; }
.blog-sectiontitle { font-size: 17px; margin: 0 0 8px; padding-left: 10px; border-left: 5px solid #ff5722; }
.blog-meta { font-size: 13px; color: #777; margin: 0 0 16px; }
.blog-catlabel {
  display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 10px;
  background: #fbe9e7; color: #d84315; text-decoration: none; font-size: 12px; line-height: 20px;
}

/* 一覧 */
.blog-list { list-style: none; margin: 0; padding: 0; }
.blog-item + .blog-item { border-top: 1px solid #eee; }
.blog-item a { display: flex; gap: 12px; padding: 12px 0; color: #333; text-decoration: none; }
.blog-item a:hover .blog-itemtitle, .blog-item a:focus .blog-itemtitle { color: #009688; text-decoration: underline; }
.blog-thumb { flex: 0 0 120px; width: 120px; height: 90px; overflow: hidden; border-radius: 2px; background: #f5f5f5; }
.blog-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-thumb img.is-noimage { object-fit: contain; padding: 10px; }
.blog-itembody { display: flex; flex-direction: column; min-width: 0; }
.blog-itemtitle { font-weight: bold; line-height: 1.5; }
.blog-itemmeta { font-size: 12px; color: #888; margin-top: 2px; }
.blog-itemsummary { font-size: 13px; color: #666; line-height: 1.6; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 600px) {
  .blog-thumb { flex-basis: 200px; width: 200px; height: 150px; }
  .blog-itemtitle { font-size: 18px; }
}

/* ページ送り・前後の記事 */
.blog-pager { display: flex; justify-content: space-between; align-items: center; margin: 0 0 16px; font-size: 15px; }
.blog-pager a, .blog-pager .is-disabled { display: inline-block; padding: 8px 14px; background: #fff; border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.15); text-decoration: none; }
.blog-pager .is-disabled { color: #bbb; box-shadow: none; background: transparent; }
.blog-pagerpos { color: #777; }
.blog-prevnext { display: flex; gap: 12px; margin: 0 0 16px; }
.blog-prevnext a { flex: 1 1 0; min-width: 0; background: #fff; padding: 10px 12px; border-radius: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.15); text-decoration: none; color: #333; }
.blog-older { text-align: right; margin-left: auto; }
.blog-pnlabel { display: block; font-size: 12px; color: #009688; }
.blog-pntitle { display: block; font-size: 14px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* タグ・コメント */
.blog-tags { list-style: none; margin: 20px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.blog-tags li { font-size: 13px; color: #666; background: #f5f5f5; border-radius: 3px; padding: 0 8px; }
.blog-commentlist { list-style: none; margin: 0; padding: 0; }
.blog-comment { padding: 10px 0; border-top: 1px solid #eee; }
.blog-comment.is-reply { margin-left: 24px; padding-left: 12px; border-left: 3px solid #ffccbc; }
.blog-commentmeta { margin: 0; font-size: 13px; color: #888; }
.blog-commentauthor { font-weight: bold; color: #555; margin-right: 6px; }
.blog-commentbody { font-size: 15px; overflow-wrap: anywhere; }
.blog-commentclosed { margin: 10px 0 0; font-size: 13px; color: #888; }

/* 広告（WordPress のころと同じユニット。Blog.ctp・Blogs/article.ctp） */
.blog-ad { text-align: center; margin: 0 0 16px; overflow: hidden; }
.blog-card.blog-ad { padding: 8px; }

/* 2nd-train へ */
.blog-to2nd { text-align: center; }
.blog-to2nd p { margin: 0 0 10px; }
.blog-button { display: inline-block; padding: 8px 22px; background: #ff5722; color: #fff; border-radius: 2px; text-decoration: none; font-weight: bold; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.blog-button:hover, .blog-button:focus { background: #e64a19; color: #fff; }

/* 下 */
.blog-footer { text-align: center; padding: 16px 10px 28px; font-size: 13px; color: #777; }
.blog-footer-links { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.blog-footer a { color: #555; }
.blog-copy { margin: 0; }

/* ===== 本文（WordPress の HTML） ===== */
.blog-body { overflow-wrap: anywhere; }
.blog-body::after { content: ""; display: block; clear: both; }
.blog-body p { margin: 0 0 1em; }
.blog-body h2, .blog-body h3, .blog-body h4, .blog-body h5 { line-height: 1.45; margin: 1.6em 0 .6em; }
.blog-body h2 { font-size: 21px; padding: 4px 0 4px 10px; border-left: 5px solid #ff5722; background: #fafafa; }
.blog-body h3 { font-size: 19px; padding-bottom: 4px; border-bottom: 2px solid #ffccbc; }
.blog-body h4 { font-size: 17px; padding-left: 8px; border-left: 3px solid #ff8a65; }
.blog-body h5 { font-size: 16px; }
.blog-body ul, .blog-body ol { padding-left: 1.5em; margin: 0 0 1em; }
.blog-body blockquote { margin: 1em 0; padding: 8px 14px; border-left: 4px solid #ddd; background: #fafafa; color: #555; }
.blog-body img { max-width: 100%; height: auto; }
.blog-body iframe, .blog-body video, .blog-body embed, .blog-body object { max-width: 100%; }
.blog-body table { border-collapse: collapse; margin: 0 0 1em; display: block; max-width: 100%; overflow-x: auto; }
.blog-body th, .blog-body td { border: 1px solid #ddd; padding: 4px 8px; }
.blog-body th { background: #f5f5f5; }
.blog-body pre { overflow-x: auto; background: #f5f5f5; padding: 8px; }
.blog-body hr { border: 0; border-top: 1px solid #ddd; margin: 1.5em 0; }
.blog-amazon a { display: inline-block; margin: 2px 6px 2px 0; padding: 2px 12px; border: 1px solid #ff9900; border-radius: 3px; color: #c45500; text-decoration: none; font-size: 14px; }

/* 寄せ（旧エディタ） */
.alignleft { float: left; margin: .3em 1.2em .8em 0; }
.alignright { float: right; margin: .3em 0 .8em 1.2em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; text-align: center; }
.alignnone { margin: .3em 0 .8em; }
img.aligncenter { display: block; }
/* キャプション（[caption] を WordPress が展開した形。幅は style で 1034px などが付くので max-width で抑える） */
.wp-caption { max-width: 100%; margin-bottom: 1em; }
.wp-caption img { display: block; margin: 0 auto; }
.wp-caption.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text, .blog-body figcaption { font-size: 13px; color: #777; text-align: center; line-height: 1.5; margin: .3em 0 0; }
.blog-body figure { margin: 0 0 1em; max-width: 100%; }
/* ブロックエディタ（9 本） */
.wp-block-image { margin: 0 0 1em; }
.wp-block-image img { height: auto; }
.wp-block-image .aligncenter, .wp-block-image.aligncenter { text-align: center; }
.wp-block-embed { margin: 0 0 1em; }
.wp-block-embed__wrapper { position: relative; }
.wp-block-embed.is-type-video .wp-block-embed__wrapper { padding-top: 56.25%; }
.wp-block-embed.is-type-video iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.has-text-align-center { text-align: center; }
.has-text-align-right { text-align: right; }
.wp-block-table { overflow-x: auto; }
/* X の埋め込み（widgets.js が読めないときも読めるように） */
.blog-body .twitter-tweet { margin: 1em auto; }
@media (max-width: 599px) {
  .blog-main { padding: 10px 6px 4px; }
  .blog-card { padding: 12px; }
  .blog-title { font-size: 21px; }
  .blog-logo img { width: 200px; }
  /* 狭い画面では回り込ませない */
  .alignleft, .alignright { float: none; display: block; margin: .5em auto; }
}
