/*
Theme Name: Chikuwa
Theme URI: https://chikuwaenglish.com/
Author: Chikuwa
Description: chikuwaenglish.com / chikuwadelicious.com のためのカード型ブログテーマ。クリーム地×ちくわゴールド、スタイル切替（ティール/コーラル）で2サイト共通利用できます。スクロールリビール、人気記事ランキング、関連記事、シェアボタン、AdSense枠つき。
Version: 1.2.1
Requires at least: 6.2
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: chikuwa
Tags: blog, one-column, two-columns, custom-colors, block-patterns, full-site-editing
*/

/* ========= 基本 ========= */
body {
  overflow-x: hidden;
}
a { text-decoration: none; }
a:hover { text-decoration: underline; }

/* ちくわマーク（ドーナツ） */
.ck-mark {
  position: relative;
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #F2BE5C, #D98F35 70%, #B96F22);
  display: inline-block; flex-shrink: 0;
}
.ck-mark::before {
  content: ""; position: absolute; inset: 11px;
  background: var(--wp--preset--color--base, #FBF6EC); border-radius: 50%;
}

/* ========= ヘッダー ========= */
.ck-sticky {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 246, 236, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--wp--preset--color--line, #EADFC9);
}
.ck-site-title a {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 900; font-size: 19px; color: inherit;
}
.ck-site-title a:hover { text-decoration: none; }
.ck-tagline { font-size: 10.5px; color: #8A7A62; letter-spacing: .06em; margin-top: 0; }
.ck-nav a { font-weight: 700; font-size: 13.5px; padding: 8px 14px; border-radius: 99px; color: inherit; }
.ck-nav a:hover { background: #F1E7D2; text-decoration: none; }

/* wp_nav_menu 出力（外観→メニューで設定したメニュー） */
.ck-menu {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.ck-menu .sub-menu {
  display: none; position: absolute; z-index: 60;
  margin: 6px 0 0; padding: 8px; list-style: none;
  background: #fff; border: 1px solid var(--wp--preset--color--line, #EADFC9);
  border-radius: 14px; box-shadow: 0 14px 34px rgba(70, 45, 10, .14);
  min-width: 180px; flex-direction: column; gap: 2px;
}
.ck-menu > li { position: relative; }
.ck-menu > li:hover > .sub-menu,
.ck-menu > li:focus-within > .sub-menu { display: flex; }
.ck-menu .sub-menu a { display: block; border-radius: 10px; }
.ck-menu .current-menu-item > a { background: var(--wp--preset--color--accent-soft); color: var(--wp--preset--color--accent-dark); }

/* フッター内メニュー */
.ck-footer .ck-menu { gap: 10px; }
.ck-footer .ck-menu .sub-menu { position: static; display: none; }
.ck-footer .ck-menu a { padding: 6px 10px; font-size: 13px; }
.ck-footer .ck-menu a:hover { background: rgba(251, 246, 236, .12); }
.ck-footer .ck-menu .current-menu-item > a { background: rgba(251, 246, 236, .12); color: #FBF6EC; }

@media (max-width: 700px) {
  .ck-menu { justify-content: flex-start; }
}

/* ========= ヒーロー ========= */
.ck-hero { position: relative; overflow: hidden; }
.ck-hero-kicker {
  display: inline-block; padding: 7px 16px; border-radius: 99px;
  background: var(--wp--preset--color--accent-soft); color: var(--wp--preset--color--accent-dark);
  font-weight: 700; font-size: 13px;
}
.ck-hero h1 { line-height: 1.32; }
.ck-hero-highlight {
  position: relative; display: inline-block; padding: 0 8px; color: #fff;
  background: var(--wp--preset--color--accent); border-radius: 10px;
  transform: rotate(-1.5deg);
}
.ck-donut, .ck-donut-2, .ck-donut-3 {
  position: absolute; border-radius: 50%; pointer-events: none;
  animation: ck-floaty 9s ease-in-out infinite;
}
.ck-donut { top: -60px; right: -80px; width: 280px; height: 280px; opacity: .28;
  background: radial-gradient(circle at 35% 28%, #F5CB76, #E0A050 68%, #C07C2E); }
.ck-donut-2 { top: -30px; right: 60px; width: 120px; height: 120px; opacity: .35;
  border: 26px solid #E9C687; animation-duration: 7s; animation-delay: 1s; }
.ck-donut-3 { bottom: -40px; left: -50px; width: 180px; height: 180px; opacity: .5;
  border: 38px solid #EFD9AC; animation-duration: 11s; }
@keyframes ck-floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(6deg); }
}

/* ヒーロー2カラム（テキスト＋画像パネル） */
.ck-hero-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
  gap: 44px; align-items: center; position: relative; z-index: 1;
}
@media (max-width: 900px) { .ck-hero-inner { grid-template-columns: 1fr; } }
.ck-hero-visual {
  position: relative; min-height: 300px; border-radius: 28px;
  background: var(--wp--preset--color--accent-soft);
  transform: rotate(1.2deg);
}
.ck-hero-image { margin: 0; height: 100%; }
.ck-hero-image img {
  width: 100%; height: 100%; min-height: 300px; object-fit: cover;
  border-radius: 28px; display: block;
}
.ck-hero-image img:not([src]), .ck-hero-image img[src=""] { display: none; }
.ck-hero-badge {
  position: absolute; left: -18px; bottom: 26px;
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--wp--preset--color--line, #EADFC9);
  border-radius: 99px; padding: 10px 18px;
  font-weight: 700; font-size: 13px;
  box-shadow: 0 10px 26px rgba(70, 45, 10, .12);
}
.ck-hero-badge-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--wp--preset--color--accent);
  animation: ck-pulse 1.6s ease-in-out infinite;
}
@keyframes ck-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.8); }
}

/* ========= ティッカー ========= */
.ck-ticker {
  background: #33291E; color: #F5E8CE; overflow: hidden; padding: 12px 0;
  transform: rotate(-.6deg); margin: 8px -10px 0;
  border-top: 3px solid var(--wp--preset--color--accent);
  border-bottom: 3px solid var(--wp--preset--color--accent);
}
.ck-ticker-track { display: flex; width: max-content; animation: ck-marquee 26s linear infinite; }
.ck-ticker-track span {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 900; font-size: 15px; letter-spacing: .14em; white-space: nowrap;
  padding: 0 17px; display: inline-flex; align-items: center; gap: 34px;
}
.ck-ticker-track span::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--wp--preset--color--accent); display: inline-block;
}
@keyframes ck-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ========= レイアウト（本文＋サイドバー） ========= */
.ck-layout { display: grid; grid-template-columns: 1fr 320px; gap: 44px; align-items: start; }
@media (max-width: 900px) { .ck-layout { grid-template-columns: 1fr; } }
.ck-sidebar { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 24px; }

/* ========= 記事カード ========= */
.ck-grid .wp-block-post-template { gap: 24px; }
.ck-grid .wp-block-post {
  background: #fff; border: 1px solid var(--wp--preset--color--line, #EADFC9);
  border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.2, .7, .25, 1), box-shadow .35s;
}
.ck-grid .wp-block-post:hover {
  transform: translateY(-6px) rotate(-.3deg);
  box-shadow: 0 20px 44px rgba(70, 45, 10, .13);
}
.ck-grid .wp-block-post-featured-image { margin: 0; }
.ck-grid .wp-block-post-featured-image img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; display: block; }
.ck-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ck-grid .wp-block-post-title {
  font-family: var(--wp--preset--font-family--display);
  font-size: 16.5px; line-height: 1.55; margin: 0;
}
.ck-grid .wp-block-post-title a { color: inherit; }
.ck-grid .wp-block-post-title a:hover { color: var(--wp--preset--color--accent-dark); text-decoration: none; }
.ck-grid .wp-block-post-excerpt { font-size: 13px; color: #6B5C46; margin: 0; }
.ck-grid .wp-block-post-date { font-size: 12px; color: #A6947A; }
.ck-grid .taxonomy-category { font-size: 11.5px; }
.ck-grid .taxonomy-category a {
  display: inline-block; padding: 5px 12px; border-radius: 99px;
  background: var(--wp--preset--color--accent); color: #fff; font-weight: 700;
}
.ck-grid .taxonomy-category a:hover { text-decoration: none; opacity: .9; }

/* ページネーション */
.wp-block-query-pagination { justify-content: center; margin-top: 24px; }
.wp-block-query-pagination a, .wp-block-query-pagination .current {
  min-width: 42px; height: 42px; padding: 0 14px; border-radius: 99px;
  background: #fff; border: 1px solid #E4D5B8; color: inherit;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}
.wp-block-query-pagination a:hover { background: #F1E7D2; text-decoration: none; }
.wp-block-query-pagination .current { background: #33291E; color: #FBF6EC; border-color: #33291E; }

/* ========= サイドバーウィジェット ========= */
.ck-widget {
  background: #fff; border: 1px solid var(--wp--preset--color--line, #EADFC9);
  border-radius: 20px; padding: 22px 24px;
}
.ck-widget-title {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 900; font-size: 17px; margin: 0 0 4px;
}
.ck-widget-en {
  font-size: 10.5px; letter-spacing: .22em; font-weight: 700;
  color: var(--wp--preset--color--accent-dark); margin: 0 0 14px;
}
.ck-avatar { width: 104px; height: 104px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px; display: block; }

/* 人気記事ランキング */
.ck-ranking { margin: 0; padding: 0; list-style: none; counter-reset: ck-rank; }
.ck-ranking li {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 11px 0; border-top: 1px solid #F1E7D2; counter-increment: ck-rank;
}
.ck-ranking li::before {
  content: counter(ck-rank);
  font-family: var(--wp--preset--font-family--display);
  font-weight: 900; font-size: 22px; line-height: 1.3;
  color: var(--wp--preset--color--accent); min-width: 20px;
}
.ck-ranking a { color: inherit; font-weight: 700; font-size: 13px; line-height: 1.6; }
.ck-ranking a:hover { color: var(--wp--preset--color--accent-dark); }

/* カテゴリーチップ */
.ck-catlist ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.ck-catlist li a {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px;
  background: var(--wp--preset--color--accent-soft); color: var(--wp--preset--color--accent-dark);
  font-weight: 700; font-size: 12.5px;
}
.ck-catlist li a:hover { background: var(--wp--preset--color--accent); color: #fff; text-decoration: none; }

/* ========= AdSense 枠 ========= */
.ck-ad { margin: 24px 0; text-align: center; }
.ck-ad-placeholder {
  border: 2px dashed #D8C7A4; border-radius: 14px; min-height: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: #A6947A; background: rgba(255, 255, 255, .5); padding: 16px;
}
.ck-ad-placeholder b { font-size: 10px; letter-spacing: .3em; }
.ck-ad-placeholder span { font-size: 12px; }

/* ========= 記事ページ ========= */
.ck-article .wp-block-post-title { font-size: 36px; line-height: 1.5; }
.ck-article .wp-block-post-featured-image img { border-radius: 24px; }
.ck-meta { color: #A6947A; font-size: 13px; }
.ck-article .wp-block-post-content h2 {
  padding: 14px 20px; border-radius: 14px;
  background: #33291E; color: #FBF6EC; font-size: 21px; margin-top: 40px;
}
.ck-article .wp-block-post-content h3 {
  border-left: 6px solid var(--wp--preset--color--accent);
  padding-left: 14px; font-size: 18px; margin-top: 32px;
}
.ck-article .wp-block-post-content blockquote {
  margin: 0 0 24px; padding: 18px 22px; border-radius: 14px;
  background: var(--wp--preset--color--accent-soft);
  border-left: 6px solid var(--wp--preset--color--accent); font-weight: 500;
}
.ck-article .wp-block-post-content mark,
.ck-article .wp-block-post-content strong.ck-marker {
  background: linear-gradient(transparent 62%, #F3D48A 62%);
}

/* シェアボタン */
.ck-share { display: flex; gap: 10px; margin: 24px 0; }
.ck-share a {
  flex: 1; padding: 11px 0; border-radius: 12px; color: #fff !important;
  text-align: center; font-weight: 700; font-size: 13px;
}
.ck-share a:hover { opacity: .85; text-decoration: none; }
.ck-share-x { background: #0F1419; }
.ck-share-fb { background: #1877F2; }
.ck-share-hb { background: #00A4DE; }
.ck-share-line { background: #06C755; }

/* 著者ボックス */
.ck-author-box {
  background: #fff; border: 1px solid var(--wp--preset--color--line, #EADFC9);
  border-radius: 20px; padding: 24px; margin: 44px 0;
}

/* 関連記事 */
.ck-related { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 18px 0 0; padding: 0; list-style: none; }
@media (max-width: 700px) { .ck-related { grid-template-columns: 1fr; } }
.ck-related li {
  background: #fff; border: 1px solid var(--wp--preset--color--line, #EADFC9);
  border-radius: 16px; overflow: hidden; transition: transform .3s, box-shadow .3s;
}
.ck-related li:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(70, 45, 10, .12); }
.ck-related img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.ck-related .ck-rel-body { padding: 14px 16px 16px; }
.ck-related .ck-rel-cat { font-size: 11px; font-weight: 700; color: var(--wp--preset--color--accent-dark); }
.ck-related a.ck-rel-title { display: block; color: inherit; font-weight: 700; font-size: 13.5px; line-height: 1.6; margin-top: 4px; }
.ck-related a.ck-rel-title:hover { color: var(--wp--preset--color--accent-dark); text-decoration: none; }

/* ========= アーカイブ ========= */
.ck-archive-hero {
  background: var(--wp--preset--color--accent-soft);
  border-bottom: 1px solid var(--wp--preset--color--line, #EADFC9);
}

/* ========= 404 ========= */
.ck-404-mark {
  position: relative; width: 104px; height: 104px; border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #F2BE5C, #D98F35 70%, #B96F22);
  display: inline-block; vertical-align: middle; margin: 0 10px;
  animation: ck-floaty 5s ease-in-out infinite;
}
.ck-404-mark::before {
  content: ""; position: absolute; inset: 32px;
  background: var(--wp--preset--color--base, #FBF6EC); border-radius: 50%;
}
.ck-404-num {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 900; font-size: 120px; line-height: 1; vertical-align: middle;
}

/* ========= フッター ========= */
.ck-footer { background: #2A2118; color: #D8C7A4; }
.ck-footer a { color: #D8C7A4; font-weight: 700; }
.ck-footer a:hover { color: #FBF6EC; }
.ck-footer .ck-mark::before { background: #2A2118; }
.ck-footer .wp-block-site-title a { color: #FBF6EC; font-size: 17px; }

/* ========= スクロールリビール ========= */
.ck-will-reveal { opacity: 0; transform: translateY(26px); }
.is-visible {
  opacity: 1 !important; transform: none !important;
  transition: opacity .8s ease, transform .8s cubic-bezier(.2, .7, .25, 1);
}
@media (prefers-reduced-motion: reduce) {
  .ck-will-reveal { opacity: 1; transform: none; }
  .ck-ticker-track, .ck-donut, .ck-donut-2, .ck-donut-3, .ck-404-mark { animation: none; }
}


/* ========= 旧記事の互換調整（v1.2.1） ========= */
/* 旧エディタ由来のインラインfont指定をテーマフォントに揃える */
.ck-article .wp-block-post-content [style*="font-family"] { font-family: inherit !important; }
/* 記事アイキャッチを一定サイズに統一（ロゴ・小画像の巨大表示を防ぐ） */
.ck-article .wp-block-post-featured-image img {
  width: 100%; height: 380px; object-fit: contain;
  background: var(--wp--preset--color--accent-soft);
  border-radius: 24px; padding: 12px; box-sizing: border-box;
}
