/* Astro 移行で追加したスタイル（旧 jQuery アニメーションの置き換え・ブロック要素の補完）
   元テーマの style.css / smart.css は極力そのまま残し、差分はこのファイルに書く。 */

/* スマホメニュー：jQuery animate → クラス切替 */
#smart_btn { background: none; border: 0; padding: 0; }
@media only screen and (max-width: 800px) {
  #nav { display: block; visibility: hidden; opacity: 0; transition: right .4s, opacity .4s, visibility .4s; }
  #cover, #header { left: 0; transition: left .4s; }
  body.nav-open #nav { right: 0; opacity: 1; visibility: visible; }
  body.nav-open #cover, body.nav-open #header { left: -230px; }
}

/* ページトップ：スクロール時のみ表示 */
#pagetop { opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; }
#pagetop.show { opacity: 1; visibility: visible; }

/* おすすめ記事（手動選定）：ランキングの王冠アイコンを星に差し替え */
#top_ranking h2.toph2 { background-image: url(img/recommend.svg); }

/* 一覧サムネイル：遅延読み込み画像の比率を固定 */
ul.blog_list img, ul.wpp-list img, #recommend_list li img { aspect-ratio: 490 / 230; object-fit: cover; width: 100%; height: auto; }

/* 本文：ブロックエディタ由来の要素 */
.content_post img { max-width: 100%; height: auto; }
.content_post iframe[src*="youtube.com"] { width: 100%; max-width: 560px; height: auto; aspect-ratio: 16 / 9; }
.content_post audio { width: 100%; max-width: 560px; }
.content_post figure { margin: 1em 0; }
.content_post .wp-block-columns { display: flex; gap: 1.5em; flex-wrap: wrap; }
.content_post .wp-block-column { flex: 1 1 240px; min-width: 0; }
.content_post pre { overflow-x: auto; padding: 1em; background: #f5f5f5; border-radius: 4px; }

/* シェアボタン（外部スクリプトなしのリンクのみ） */
ul.share_links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 15px 0; }
ul.share_links a { display: inline-block; padding: 4px 12px; border-radius: 3px; color: #fff; text-decoration: none; font-size: .85em; }
ul.share_links .x a { background: #000; }
ul.share_links .hatena a { background: #00a4de; }
ul.share_links .line a { background: #06c755; }

/* ページ送り（旧 wp_pagenavi 相当） */
.pagelink { text-align: center; margin: 30px 0; }
.pagelink a, .pagelink span { display: inline-block; min-width: 2.2em; padding: 6px 8px; margin: 2px; border: 1px solid #ccc; text-decoration: none; }
.pagelink span.current { background: #1170c7; color: #fff; border-color: #1170c7; }

/* 検索ページ（Pagefind） */
#search_page { margin: 20px 0 40px; }
