/*
Theme Name: 五丁目新聞 シンプル
Theme URI: https://shinbun.5chome.tokyo/
Author: ケロシ
Description: 世界一シンプルで読みやすい「五丁目新聞」オンライン版のための最小テーマ。JSON-LD（構造化データ）とサイト共通キーワード（最大5つ）を内蔵。
Version: 1.9.2
License: GNU General Public License v2 or later
Text Domain: 5chome-shinbun-simple
*/

/* ---- 基本：読みやすさ優先 ---- */
:root{
  --maxw: 760px;
  --pad: 20px;
  --fg: #00fdff;
  --muted: #666;
  --bg: #fff;
  --rule: #e9e9e9;
  --accent:#00fdff;
}

*{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
               "Noto Sans JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  color: var(--fg);
  background:var(--bg);
  line-height:1.9;
  letter-spacing: .02em;
}

a{ color:var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }

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

.site-header{
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}
.site-title{
  margin:0;
  font-size: 28px;
  line-height:1.2;
  letter-spacing: .04em;
}
.site-title a{ color:inherit; }
.site-desc{
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.nav{
  margin-top: 14px;
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 14px;
}
.nav a{ color: var(--fg); opacity:.85; }
.nav a:hover{ opacity:1; }

.main{
  padding: 18px 0 40px;
}

.post-list{
  list-style: none;
  padding:0;
  margin:0;
}
.post-card{
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.post-card:last-child{ border-bottom:none; }
.post-meta{
  color: var(--muted);
  font-size: 13px;
}
.post-title{
  margin: 8px 0 8px;
  font-size: 22px;
  line-height: 1.4;
}
.excerpt{
  margin: 8px 0 0;
  color: var(--fg);
}

.article-title{
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.35;
}
.article-meta{
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--rule);
}

.article-body img{
  max-width: 100%;
  height: auto;
}
.article-body h2, .article-body h3{
  margin-top: 34px;
  line-height: 1.4;
}
.article-body blockquote{
  margin: 18px 0;
  padding: 2px 14px;
  border-left: 3px solid var(--rule);
  color: var(--fg);
}
.article-body pre{
  overflow:auto;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.article-body code{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .95em;
}

.pager{
  display:flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
}

.site-footer{
  border-top: 1px solid var(--rule);
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: 13px;
}

/* アクセシビリティ */
.skip-link{
  position:absolute; left:-999px; top:auto;
  width:1px; height:1px; overflow:hidden;
}
.skip-link:focus{
  left: var(--pad);
  top: 10px;
  width:auto; height:auto;
  padding: 8px 10px;
  background:#fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  z-index: 9999;
}


/* フォーム（最小限） */
.search-form{ display:flex; gap:8px; align-items:center; }
.search-field{
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  min-width: 200px;
}
.search-submit{
  padding: 8px 10px;
  border: 1px solid var(--rule);
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
}

/* WPのscreen-reader-text（テーマ側でも定義しておく） */
.screen-reader-text{
  border:0; clip:rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  height:1px; margin:-1px; overflow:hidden; padding:0;
  position:absolute !important; width:1px; word-wrap:normal !important;
}
.screen-reader-text:focus{
  clip:auto !important;
  clip-path:none;
  height:auto; width:auto;
  margin:0;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fff;
  z-index: 9999;
  position: static !important;
}

/* 読みやすさ：基本文字サイズを少しだけ上げる */
body{ font-size: 18px; }

/* ダークモード（OS設定に追従。シンプルに最小限） */
@media (prefers-color-scheme: dark){
  :root{
    --fg:#00fdff;
    --muted:#b7b7b7;
    --bg:#0e0f12;
    --rule:#26282e;
    --accent: #00fdff;
  }
  .search-submit{ background: transparent; color: var(--fg); }
  .search-field{ background: transparent; color: var(--fg); }
}

/* キーワード強調（ラインマーカー風） */
.shinbun-keyword-mark{
  font-weight: 800;
  color: #ffff00;
  padding: 0 .14em;
  border-radius: .2em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  /* マーカーの帯：シアン（#00fdff）を下半分に引く */
  background: linear-gradient(transparent 42%, rgba(0,253,255,.92) 42%, rgba(0,253,255,.92) 88%, transparent 88%);
}

/* アイキャッチ（縮尺比維持で全体表示 + 余白 + グレー背景） */
.featured-media{
  margin: 18px 0 22px;
  padding: 0;
  background: transparent;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--rule);

  /* Safari対策：flexの%幅計算がズレる事があるため、gridでセンタリング */
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  align-items: center;
}

/* ラッパ要素があっても幅100%に揃える */
.featured-media > a,
.featured-media > picture,
.featured-media > figure,
.featured-media > div{
  display: block;
  width: 100%;
}

.featured-media img{
  display:block;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  margin: 0 auto !important;
  justify-self: center;

  /* heroは切り抜かず“紙面そのまま”を優先 */
  object-fit: contain;
  object-position: center center;
}


/* ダークモード時もグレーの階調を少し整える */
@media (prefers-color-scheme: dark){
  .featured-media{ background:#1b1e23; }
}

/* トップ（投稿一覧）用：アイキャッチを小さくアイコン風に表示（全体表示・余白・グレー背景） */
.post-head{
  display:flex;
  gap: 14px;
  align-items: flex-start;
}
.post-head .post-title{ margin-top: 2px; }

.thumb-icon{
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  padding: 6px;
  background: #2a2d33; /* グレー系 */
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.thumb-icon img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto; /* 縮尺比維持 */
  display:block;
}
@media (prefers-color-scheme: dark){
  .thumb-icon{ background:#1b1e23; }
}

/* 関連リンク */
.related-links{
  margin: 28px 0 0;
  padding: 16px 14px;
  background: #2a2d33;
  border-radius: 14px;
}
.related-links h3{
  margin: 0 0 10px;
  font-size: 16px;
}
.related-links ul{
  margin: 0;
  padding-left: 1.1em;
}
.related-links li{ margin: 6px 0; }
.related-links a{ color: var(--accent); text-decoration: underline; }
@media (prefers-color-scheme: dark){
  .related-links{ background:#1b1e23; }
}

/* ---- サブナビ（回遊導線） ---- */
.sidebar{
  margin: 0;
}

@media (max-width: 859px){
  .sidebar{ margin-top: 22px; }
}
.sidebar .side-block{
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin: 0 0 14px;
  background: transparent;
}
.sidebar .side-title{
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.35;
}
.sidebar .side-list{
  margin: 0;
  padding-left: 1.1em;
}
.sidebar .side-item{
  margin: 7px 0;
}
.sidebar .side-item a{
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.sidebar .side-item a:hover{
  border-bottom-color: var(--accent);
}
.sidebar .side-note{
  margin: 10px 0 0;
  font-size: 12px;
  opacity: .82;
}

.sidebar .booth-cta{
  display:block;
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--marker, var(--accent));
  color: var(--fg);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

/* ---- 要点（3行）ボックス ---- */
.points-box{
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin: 18px 0 18px;
  background: transparent;
}
.points-box .points-title{
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: .02em;
}
.points-box ul{
  margin: 0;
  padding-left: 1.2em;
}
.points-box li{
  margin: 6px 0;
}
.points-box .points-note{
  margin: 10px 0 0;
  font-size: 12px;
  opacity: .8;
}

/* ---- トップページ：Lead(1) + 準Lead(4) + Latest ---- */
.home-block-title{
  margin: 18px 0 10px;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .78;
}
.home-lead{
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 16px 16px 12px;
  margin: 0 0 18px;
}
.home-lead .lead-inner{
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: start;
}
.home-lead .lead-thumb{
  width: 64px;
  height: 64px;
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--bg) 70%, #888 30%);
  border: 1px solid var(--rule);
}
.home-lead .lead-thumb img{
  width: 100%;
  height: 100%;
  object-fit: contain; /* 全体を見せる */
  display: block;
  padding: 6px;       /* 余白 */
  background: #3a3a3a; /* グレー系背景 */
}
.home-lead .lead-title{
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.25;
}
.home-lead .lead-title a{
  text-decoration: none;
}
.home-lead .lead-excerpt{
  margin: 10px 0 0;
}

.home-sublead{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 0 22px;
}
.home-sublead .sub-card{
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 12px 14px 10px;
}
.home-sublead .sub-title{
  margin: 6px 0 0;
  font-size: 16px;
  line-height: 1.3;
}
.home-sublead .sub-title a{ text-decoration:none; }

.home-latest{
  margin-top: 10px;
}

/* 2カラムにしたい場合（広い画面だけ、機能美の最小限） */
@media (min-width: 980px){
  .home-sublead{
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- トップページ：マガジン風レイアウト（参考スクショの骨格） ---- */
.home-mag{
  margin-top: 6px;
}
.home-mag-head{
  text-align: center;
  margin: 10px 0 18px;
}
.home-mag-head .home-mag-title{
  margin: 0;
  font-size: 22px;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.home-mag-head .home-mag-rule{
  display:inline-block;
  width: 22px;
  height: 1px;
  background: var(--rule);
  margin-top: 10px;
}

.home-mag-layout{
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

/* メイン：カードのグリッド */
.home-mag-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
@media (min-width: 860px){
  .home-mag-layout{
    grid-template-columns: 1fr 320px; /* 右ランキング */
    align-items: start;
  }
  .home-mag-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
  }
}
@media (min-width: 620px) and (max-width: 859px){
  .home-mag-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* カード */
.mag-card{
  border: 1px solid var(--rule);
  background: transparent;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.mag-thumb{
  aspect-ratio: 21 / 9;
  background: #3a3a3a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.mag-thumb img{
  width: 100%;
  height: 100%;
  object-fit: contain; /* 全体を見せる */
  padding: 10px;       /* 余白 */
  display:block;
}
.mag-body{
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mag-title{
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}
.mag-title a{ text-decoration:none; }
.mag-date{
  font-size: 12px;
  opacity: .8;
}

/* 右：ランキング（見た目だけ、機能は最小） */

.rank-title{
  margin: 0 0 8px;
  font-size: 0.92rem;
  line-height: 1.35;
  font-weight: 600;

  letter-spacing: .03em;
  text-transform: none;
  text-align: left;

  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.rank-tabs{
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 12px;
  letter-spacing: .06em;
  margin: 10px 0 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--rule);
}
.rank-tabs a, .rank-tabs button{
  text-decoration:none;
  opacity: .7;
  border-bottom: 2px solid transparent;
  padding-bottom: 6px;
}
.rank-tabs a.is-active, .rank-tabs button.is-active{
  opacity: 1;
  border-bottom-color: var(--accent);
}

.rank-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.rank-item{
  display: grid;
  grid-template-columns: 24px 56px 1fr;
  gap: 10px;
  align-items: start;
}
.rank-num{
  font-weight: 800;
  opacity: .85;
}
.rank-thumb{
  width: 56px;
  height: 42px;
  border: 1px solid var(--rule);
  background: #3a3a3a;
  overflow: hidden;
  border-radius: 8px;
}
.rank-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.rank-item a{
  text-decoration:none;
  font-size: 13px;
  line-height: 1.35;
  display: inline-block;
}

/* ---- トップページ：横幅を広く（カードを映えさせる） ---- */
.home .container{
  max-width: 1320px;
}
@media (min-width: 860px){
  .home-mag-layout{
    grid-template-columns: 1fr 360px; /* ランキングを少し余裕 */
  }
}

/* カードの機能美：余白/角/ホバー/見出しの密度 */
.mag-card{
  border-radius: 18px;
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease;
}
.mag-card:hover{
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--rule));
}
.mag-thumb{
  border-bottom: 0;
  background: color-mix(in srgb, var(--bg) 60%, #3a3a3a 40%);
}
.mag-thumb img{
  padding: 8px;
}
.mag-body{
  padding: 16px 16px 14px;
}
.mag-title{
  font-size: 17px;
  letter-spacing: .01em;
}
@media (min-width: 860px){
  .mag-title{ font-size: 18px; }
}

/* NEWSヘッドも少し締める */
.home-mag-head{
  margin: 10px 0 22px;
}
.home-mag-head .home-mag-title{
  font-size: 24px;
}

/* 右ランキングも角を揃える */
.rank-box{
  border-radius: 18px;
}
.rank-thumb{
  border-radius: 10px;
}

/* ---- 共通：横幅（トップと同じ器） ---- */
.container{
  max-width: 1320px;
}

/* ---- 記事ページ：本文 + 右RANKING（2カラム） ---- */
.content-layout{
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}
@media (min-width: 860px){
  .content-layout{
    grid-template-columns: 1fr 360px;
  }
}

/* 本文カード感（トップのカードとリズムを合わせる） */
.article-shell{
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 18px 18px 16px;
}

/* サイド：rank-box を sidebar.php でも使う */

/* ---- アイキャッチ：枠いっぱいに（フルブリード） ---- */
.mag-thumb img{
  object-fit: cover;  /* 枠いっぱい（必要に応じてトリミング） */
  padding: 0;
}
.mag-thumb{
  background: transparent;
}

/* 記事ページのアイキャッチも同様に（存在するクラスに幅広く対応） */
.shinbun-thumb img,
.article-thumb img,
.post-thumbnail img,
.entry-thumbnail img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
}

/* デフォルトの追従トップ */
.sidebar{
  --sticky-top: 16px;
  --rankbox-h: 0px;
}

/* 右カラムが出る幅だけ、個別stickyを有効化 */

/* ---- RANKING：基本スタイル（罫線を復活） ---- */
.rank-box{
  border: 1px solid var(--rule);
  padding: 18px 16px 14px;
  border-radius: 18px;
}
.home .rank-box{
  position: sticky;
  top: 16px;
}

/* ---- sidebar：BOOTHを上、RANKINGを下。RANKINGだけ追従 ---- */
.sidebar{
  --sticky-top: 16px;
}
@media (min-width: 860px){
  .sidebar .rank-box{
    position: sticky;
    top: var(--sticky-top);
  }
}
.sidebar .side-block{
  margin-bottom: 14px;
}

/* ---- トップページ（モバイル）：機能美の最適化 ---- */
@media (max-width: 620px){
  .home-mag-head{
    margin: 6px 0 14px;
  }
  .home-mag-head .home-mag-title{
    font-size: 20px;
    letter-spacing: .16em;
  }

  .home-mag-layout{
    gap: 16px;
  }
  .home-mag-grid{
    gap: 14px;
  }

  .mag-card{
    border-radius: 16px;
  }
  .mag-thumb{
    aspect-ratio: 16 / 10; /* スマホで少し情報量を稼ぐ */
  }
  .mag-body{
    padding: 14px 14px 12px;
    gap: 8px;
  }
  .mag-title{
    font-size: 18px;
    line-height: 1.35;
  }
  .mag-date{
    font-size: 12px;
  }

  /* スマホでは右カラムが下に来るので、stickyは無効（挙動の違和感回避） */
  .home .rank-box{
    position: static;
    top: auto;
  }

  /* RANKINGを“横スワイプ”にして圧縮し、回遊導線を強く */
  .rank-list{
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .rank-item{
    min-width: 260px;
    grid-template-columns: 20px 56px 1fr;
    scroll-snap-align: start;
    padding-right: 6px;
  }
  .rank-tabs{
    gap: 14px;
  }

  /* 横スクロールバーが気になりにくい調整 */
  .rank-list::-webkit-scrollbar{
    height: 6px;
  }
  .rank-list::-webkit-scrollbar-thumb{
    background: color-mix(in srgb, var(--accent) 35%, var(--rule));
    border-radius: 999px;
  }
}

  .home-mobile-head{
    margin: 8px 0 14px;
  }
  .home-mobile-head h2{
    margin: 0;
    font-size: 26px;
    letter-spacing: .02em;
  }
  .home-mobile-rule{
    height: 1px;
    background: var(--rule);
    margin-top: 10px;
  }

  .segmented{
    margin: 14px 0 16px;
    border: 1px solid var(--rule);
    border-radius: 999px;
    padding: 6px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .segmented a{
    text-decoration: none;
    display: block;
    text-align: center;
    padding: 12px 10px;
    border-radius: 999px;
    font-weight: 800;
    opacity: .82;
    border: 1px solid transparent;
  }
  .segmented a.is-active{
    opacity: 1;
    border-color: var(--rule);
    background: color-mix(in srgb, var(--bg) 80%, #ffffff 20%);
  }

  .news-list{
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 18px;
  }
  .news-item{
    display: grid;
    grid-template-columns: 104px 1fr;
    gap: 14px;
    align-items: start;
  }
  .news-thumb{
    width: 104px;
    height: 74px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--rule);
    background: #3a3a3a;
  }
  .news-thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .news-title{
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
    letter-spacing: .01em;
  }
  .news-title a{
    text-decoration: none;
  }
  .news-time{
    margin-top: 8px;
    font-size: 14px;
    opacity: .8;
  }

  /* トップのRANKINGは下に置く場合の見た目 */
  .home-mobile .rank-box{
    margin-top: 18px;
  }
}

/* ---- トップ（モバイル）：NHKニュース風のリストレイアウト（強制版） ---- */
@media (max-width: 820px){
  /* 既存カード系の影響を受けないように最低限のリセット */
  .home-mobile ul, .home-mobile li{ margin:0; padding:0; }
  .home-mobile a{ color: inherit; }

  .news-list{
    list-style: none;
    display: grid;
    gap: 18px;
  }

  .news-item{
    display: flex;
    gap: 14px;
    align-items: flex-start;
  }

  .news-thumb{
    flex: 0 0 112px;
    width: 112px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--rule);
    background: #3a3a3a;
    display: block;
  }

  .news-thumb img{
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
  }

  .news-main{
    flex: 1 1 auto;
    min-width: 0; /* 長いタイトルを折り返す */
  }

  .news-title{
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
    letter-spacing: .01em;
    word-break: break-word;
  }

  .news-time{
    margin-top: 8px;
    font-size: 14px;
    opacity: .8;
  }
}

/* ---- 記事（single/page）：モバイル最適化（読み心地 + 機能美） ---- */
@media (max-width: 820px){
  .single .content-layout,
  .page .content-layout{
    gap: 16px;
  }

  .single .article-shell,
  .page .article-shell{
    padding: 14px 14px 12px;
    border-radius: 16px;
  }

  .single .article-title,
  .page .article-title{
    font-size: 26px;
    line-height: 1.25;
    letter-spacing: .01em;
  }

  .single .article-meta,
  .page .article-meta{
    font-size: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  /* アイキャッチ（モバイルでも安定してセンタリング + 罫線/角丸を維持）
     Safariは flex+%幅+img でズレやすいので、ここも grid で固定 */
  .single .article-shell .featured-media,
  .page .article-shell .featured-media{
    margin: 14px 0 18px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: 14px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
  }
  .single .article-shell .featured-media img,
  .page .article-shell .featured-media img{
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    object-fit: contain;
  }
  .single .article-shell .featured-caption,
  .page .article-shell .featured-caption{
    padding: 10px 14px 0;
  }

  /* 本文の読み心地（小さすぎず、詰まりすぎず） */
  .single .article-body,
  .page .article-body{
    font-size: 18px;
    line-height: 1.85;
  }
  .single .article-body p,
  .page .article-body p{
    margin: 0 0 1.05em;
  }
  .single .article-body h2,
  .page .article-body h2{
    font-size: 22px;
    margin-top: 28px;
  }
  .single .article-body h3,
  .page .article-body h3{
    font-size: 20px;
    margin-top: 24px;
  }

  /* サイドは下に回るので sticky はOFF（挙動の違和感回避） */
  .single .sidebar .rank-box,
  .page .sidebar .rank-box{
    position: static;
    top: auto;
  }
  .single .sidebar .side-block,
  .page .sidebar .side-block{
    margin-bottom: 16px;
  }
}

/* ---- 一覧（archive/search等）：共通リストUI（左サムネ＋右テキスト） ---- */
.list-shell{
  padding: 18px 18px 12px;
  border-radius: 18px;
  border: 1px solid var(--rule);
  background: color-mix(in srgb, var(--bg) 92%, #ffffff 8%);
  box-shadow: 0 8px 26px rgba(0,0,0,.12);
}

.list-head{
  margin-bottom: 14px;
}
.list-head .list-title{
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}
.list-head .list-desc{
  margin-top: 8px;
  font-size: 14px;
  opacity: .85;
}

.news-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

@media (min-width: 821px){
  .news-item{
    display: grid;
    grid-template-columns: 172px 1fr;
    gap: 16px;
    align-items: start;
  }
  .news-thumb{
    width: 172px;
    height: 108px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--rule);
    background: #3a3a3a;
    display: block;
  }
  .news-thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .news-main{
    min-width: 0;
  }
  .news-title{
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
    letter-spacing: .01em;
    word-break: break-word;
  }
  .news-excerpt{
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.75;
    opacity: .92;
  }
  .news-time{
    margin-top: 10px;
    font-size: 13px;
    opacity: .78;
  }
}

/* 404 */
.notfound-actions{
  margin-top: 14px;
  display: grid;
  gap: 10px;
}
.notfound-actions a{
  text-decoration: none;
}

/* ---- iPhone mini等：横幅が縮む/ズレる対策（横スクロールを作らない） ---- */
html, body{ max-width: 100%; overflow-x: clip; }
@supports not (overflow-x: clip){
  html, body{ overflow-x: hidden; }
}

/* メディア/要素がはみ出して縮小表示になるのを予防 */
img, video, iframe, svg, canvas{ max-width: 100%; height: auto; }
table{ width: 100%; max-width: 100%; }
pre{ max-width: 100%; overflow: auto; }

/* ヘッダー検索：狭い端末で横幅オーバーしない */
.search-form{ flex-wrap: wrap; }
.search-form label{ flex: 1 1 auto; min-width: 0; }
.search-field{ min-width: 0; width: 100%; }
.search-submit{ flex: 0 0 auto; }

/* さらに狭い端末（iPhone 12 mini等） */
@media (max-width: 390px){
  :root{ --pad: 16px; } /* 余白を少し節約 */
  .site-title{ font-size: 24px; }
  .search-submit{ padding: 8px 9px; }
}

/* ---- モバイル：アイキャッチ等の“横はみ出し”を根絶（本文が切れないように） ---- */
.container,
.main,
.content-layout,
.article-shell,
.list-shell,
.sidebar{
  min-width: 0;
  width: 100%;
}

/* 画像/figureが幅を主張してレイアウトを引っ張るケースを強制的に封じる */
figure{ max-width: 100%; }
.featured-media{ max-width: 100%; }
.featured-media img{
  max-width: 100% !important;
  height: auto !important;
}

/* 極小幅（iPhone 12 mini等）：フルブリードの“負のマージン”を無効化して横はみ出し回避 */
@media (max-width: 390px){
  .single .article-shell .featured-media,
  .page .article-shell .featured-media{
    margin-left: 0 !important;
    margin-right: 0 !important;
    border: 1px solid var(--rule) !important;
    border-radius: 14px !important;
    overflow: hidden;
  }
  .single .article-shell .featured-caption,
  .page .article-shell .featured-caption{
    padding-left: 2px !important;
    padding-right: 2px !important;
  }
}

/* ---- アイキャッチ：センタリング + 罫線/丸角を維持（PC/モバイル共通で破綻しない） ---- */
.featured-media img{
  margin-left: auto;
  margin-right: auto;
}

/* mobile single/page フルブリードでも罫線と丸角を維持 */
@media (max-width: 820px){
  .single .article-shell .featured-media,
  .page .article-shell .featured-media{
    border: 1px solid var(--rule);
    border-radius: 14px;
    overflow: hidden;
    background: transparent;
  }
}

/* iPhone mini等：負マージンを無効化してもセンター＆枠を維持 */
@media (max-width: 390px){
  .single .article-shell .featured-media,
  .page .article-shell .featured-media{
    border: 1px solid var(--rule) !important;
    border-radius: 14px !important;
    overflow: hidden;
  }
}

/* ---- モバイル：アイキャッチ画像を「画像そのもの」をセンターに（透明余白/左右余白画像でも見栄え安定） ---- */
@media (max-width: 820px){
  .single .article-shell .featured-media,
  .page .article-shell .featured-media{
    display: flex;
    justify-content: center;
    align-items: center;
    /* 画像が透過PNGでも“地の色”が見えるように微差だけ付ける */
    background: color-mix(in srgb, var(--bg) 92%, #ffffff 8%);
  }

  .single .article-shell .featured-media img,
  .page .article-shell .featured-media img{
  width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
  }
}

/* ---- Safari対策：featured-media内の要素構成（img+figcaption）でセンタリングが崩れないように ---- */
@media (max-width: 820px){
  .single .article-shell .featured-media,
  .page .article-shell .featured-media{
    flex-direction: column; /* figcaptionが横並びになって“画像が左に見える”のを防ぐ */
    text-align: center;      /* text-align系のフォールバック */
  }
  .single .article-shell .featured-media img,
  .page .article-shell .featured-media img{
    display: block;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .single .article-shell .featured-caption,
  .page .article-shell .featured-caption{
    width: 100%;
    text-align: left; /* キャプションは読みやすく左寄せ */
  }
}


/* featured-media hard override (Safari/モバイルの一時的なレイアウト崩れ対策) */
.featured-media{ padding: 0 !important; }


/* featured-media no-negative-margin (古いCSSの残留やSafariの丸め誤差対策) */
@media (max-width: 820px){
  .single .article-shell .featured-media,
  .page .article-shell .featured-media{ margin-left: 0 !important; margin-right: 0 !important; }
}


/* Ranking tabs: functional (toggle) */
.rank-tabs button{
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.rank-tabs button.is-active{
  /* keep existing visual active indicator via class */
}

.rank-box .rank-list{
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rank-box .rank-list.is-active{
  display: block;
}

/* =========================
   English block (details/summary)
   ========================= */
.shinbun-en-details{
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 10px 12px;
  margin: 18px 0;
  background: color-mix(in srgb, var(--bg) 92%, #ffffff 8%);
}

.shinbun-en-details > summary{
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .02em;
  list-style: none;
  outline: none;
}

.shinbun-en-details > summary::-webkit-details-marker{
  display:none;
}

/* caret */
.shinbun-en-details > summary::before{
  content: "›";
  display: inline-block;
  margin-right: 8px;
  transform: rotate(0deg);
  transition: transform .18s ease;
  opacity: .9;
}

.shinbun-en-details[open] > summary::before{
  transform: rotate(90deg);
}

.shinbun-en-details[open]{
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

.shinbun-en{
  margin-top: 10px;
  font-size: 0.98rem;
  line-height: 1.55;
}

.shinbun-en[lang="en"]{
  letter-spacing: .01em;
}

/* mobile tighten */
@media (max-width: 480px){
  .shinbun-en-details{ padding: 9px 10px; }
  .shinbun-en{ font-size: 0.95rem; }
}

/* =========================
   Related posts by tags
   ========================= */
.related-by-tags{
  margin-top: 28px;
  padding: 0;
  border: none;
  background: transparent;
}

.related-by-tags .related-title,
.related-title{
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  font-weight: 800;
}

.related-simple{
  /* titles only + separators */
}

.related-item{
  display: block;
  padding: 14px 0;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
  letter-spacing: .02em;
  word-break: break-word;
}

.related-item:hover,
.related-item:focus{
  text-decoration: underline;
}

.related-sep{
  border: 0;
  border-top: 1px solid rgba(0,0,0,.35);
  margin: 0;
}

@media (max-width: 600px){
  .related-item{
    font-size: 16px;
    padding: 12px 0;
  }
}

/* =========================
   Hot Tags (last 30 days)
   ========================= */
.hot-tags-box{
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.hot-tags-title{
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.hot-tags-list{
  list-style: none;
  margin: 0;
  padding: 0;
}

.hot-tags-item{
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.hot-tags-item:last-child{
  border-bottom: none;
}

.hot-tags-rank{
  width: 1.8em;
  text-align: right;
  font-weight: 800;
  opacity: .8;
  font-variant-numeric: tabular-nums;
}

.hot-tags-link{
  display: inline-block;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
}

.hot-tags-link:hover{
  text-decoration: underline;
}

.hot-tags-score{
  margin-left: auto;
  font-size: 0.78rem;
  opacity: .75;
  font-variant-numeric: tabular-nums;
}


/* Center the RANKING heading only */
.rank-box > h3.rank-title{
  text-align: center;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
