/*
Theme Name: Funny Cats
Theme URI: https://example.com/funny-cats
Author: wp-base
Description: 猫グッズレビュー専用WordPressテーマ（落ち着いたデザイン）。
Version: 0.3.0
License: GPL-2.0-or-later
Text Domain: funny-cats
*/

/* CSS Variables */
:root {
  --bg: #F6F2EB;          /* 生成り系の落ち着いた背景 */
  --paper: #FAF7F2;       /* 背景に寄せた用紙色（記事面） */
  --ink: #3a3a3a;         /* やや控えめの文字色 */
  --muted: #9a9186;       /* くすみトーン（薄め） */
  --link: #3b3b6e;        /* 穏やかな濃紺 */
  --line: #efe8de;        /* さらに薄い区切り線 */
  --radius: 10px;
  --max: 1100px;
}

/* Base Reset & Typography */
body {
  margin: 0; 
  font-family: Inter, "Noto Serif JP", serif;
  background: var(--bg); 
  color: var(--ink);
  line-height: 1.7; 
  font-size: 16px;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: var(--max); margin: auto; padding: 0 20px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; }
.site-header .header-hero img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 12/1; /* 以前の半分の高さ相当 */
  object-fit: cover;
  min-height: 70px;
}
@media (max-width: 640px) {
  .site-header .header-hero img { min-height: 60px; }
}

/* Brand & Logo */
.brand { display: flex; align-items: center; }
.brand { gap: 12px; }
.brand .site-title {
  font-weight: 700;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.1;
  color: var(--ink);
}
.brand .site-title:hover { text-decoration: underline; }
.custom-logo-link { display: inline-block; }
.custom-logo { 
  height: auto; 
  max-height: 40px; 
  width: auto; 
  max-width: 200px; 
}

.nav { display: flex; align-items: center; }
.nav ul { display: flex; gap: 24px; list-style: none; margin: 0; padding: 0; }
/* 特定性を高めて WP デフォルトの list-style を無効化 */
.site-header .nav ul { list-style: none !important; padding-left: 0 !important; }
.site-header .nav li { list-style: none !important; }
.site-header .nav li::marker { content: none; }
/* UL が出力されない環境でも崩れないように直接 li を整形 */
.nav > li { list-style: none; margin-left: 24px; }
.nav > li:first-child { margin-left: 0; }
.nav li { list-style: none; }
.nav a { font-weight: 600; font-size: 14px; }

/* Hero */
.hero { position: relative; }

/* CLS対策: ヒーロー画像 */
.hero img { 
  width: 100%; 
  height: auto; 
  display: block; 
  aspect-ratio: 3/1; 
  object-fit: cover; 
  min-height: 256px; 
}

/* Sections */
h2.section-title { 
  font-size: 18px; 
  margin: 30px 0 16px; 
  border-bottom: 1px solid var(--line); 
  padding-bottom: 6px; 
}

.fc-thumb-missing { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  width: 100%; 
  border-radius: var(--radius); 
  border: 2px dashed var(--accent); 
  background: repeating-linear-gradient(45deg, rgba(217,203,184,0.15), rgba(217,203,184,0.15) 10px, rgba(250,247,242,0.15) 10px, rgba(250,247,242,0.15) 20px); 
  color: var(--muted); 
  font-size: 12px; 
  letter-spacing: 0.12em; 
  text-transform: uppercase; 
}

.fc-thumb-missing--card { 
  aspect-ratio: 4/3; 
  min-height: 120px; 
}

.fc-thumb-missing--wide { 
  aspect-ratio: 16/9; 
  min-height: 140px; 
}

/* Latest Posts - Flat List */
.posts { display: grid; gap: 22px; }
.post { 
  display: grid; 
  gap: 8px; 
  border-top: 1px solid var(--line); 
  padding-top: 18px; 
}
.post:first-child { border-top: none; padding-top: 0; }

/* CLS対策: 最新記事の画像 */
/* 以降: 記事ページの読みやすさ向上スタイル */

/* Article Shell */
.fc-article {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.fc-article header h1 {
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.3;
  margin: 0 0 8px;
}
.fc-article .post-meta {
  color: var(--muted);
  font-size: 14px;
}
.fc-article .fc-badge {
  display: inline-block;
  background: #f1eee8;
  color: #5a544d;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}

/* Article Content */
.fc-article .entry-content {
  max-width: 780px;
  margin: 18px auto 0;
  font-size: clamp(16px, 1.7vw, 17px);
  line-height: 1.9;
  word-break: auto-phrase;
}
.fc-article .entry-content > * + * { margin-top: 1.1em; }

/* Headings rhythm */
.fc-article .entry-content h2 {
  font-size: clamp(22px, 2.4vw, 28px);
  margin: 2.2em 0 .8em;
  padding-bottom: .45em;
  border-bottom: 2px solid var(--line);
}
.fc-article .entry-content h3 {
  font-size: clamp(18px, 2vw, 22px);
  margin: 1.8em 0 .6em;
}
.fc-article .entry-content h4 { font-size: 17px; margin: 1.2em 0 .3em; }

/* Paragraphs & Emphasis */
.fc-article .entry-content p { margin: .9em 0; }
.fc-article .entry-content strong { font-weight: 700; }
.fc-article .entry-content em { font-style: italic; }

/* Lists */
.fc-article .entry-content ul, 
.fc-article .entry-content ol { padding-left: 1.4em; }
.fc-article .entry-content li + li { margin-top: .35em; }

/* Media */
.fc-article .entry-content img,
.fc-article .entry-content figure img {
  border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.fc-article .entry-content figure { margin: 1.2em 0; }

/* Blockquote */
.fc-article .entry-content blockquote {
  margin: 1.2em 0;
  padding: .8em 1em;
  background: #f9f6f1;
  border-left: 4px solid #d8cfbf;
  color: #4b463f;
}

/* Table */
.fc-article .entry-content table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.fc-article .entry-content th,
.fc-article .entry-content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.fc-article .entry-content thead th {
  background: #fbf9f5;
  font-weight: 700;
}
.fc-article .entry-content tr:last-child td { border-bottom: none; }

/* Links */
.fc-article .entry-content a { text-decoration: underline; text-underline-offset: 2px; }
.fc-article .entry-content a:hover { opacity: .9; }

/* WP ボタンブロックを通常リンクに中立化（aタグはボタン見た目にしない） */
.wp-block-button__link {
  display: inline !important;
  background: transparent !important;
  color: var(--link) !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

/* Prev/Next navigation */
.fc-article .post-navigation .nav-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* 実ボタン要素のスタイル（button/submit） */
.fc-article .entry-content button,
.fc-article .entry-content input[type="button"],
.fc-article .entry-content input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #2d2d72;
  color: #fff;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
  transition: background .15s ease, opacity .15s ease;
}
.fc-article .entry-content button:hover,
.fc-article .entry-content input[type="button"]:hover,
.fc-article .entry-content input[type="submit"]:hover { background: #22225a; }
.fc-article .entry-content button:disabled,
.fc-article .entry-content input[type="button"]:disabled,
.fc-article .entry-content input[type="submit"]:disabled { opacity: .6; cursor: not-allowed; }

/* ボタンバリエーション */
.fc-article .entry-content button.secondary,
.fc-article .entry-content input[type="button"].secondary,
.fc-article .entry-content input[type="submit"].secondary {
  background: #e9e2d8;
  color: #2b2b2b;
  border-color: var(--line);
}
.fc-article .entry-content button.outline,
.fc-article .entry-content input[type="button"].outline,
.fc-article .entry-content input[type="submit"].outline {
  background: transparent;
  color: var(--link);
  border-color: var(--link);
}

/* Responsive tweaks */
@media (max-width: 640px) {
  .fc-article { padding: 16px; }
  .fc-article .entry-content { font-size: 16px; }
  .fc-article .entry-content table { font-size: 14px; }
}
.post img,
.post .fc-thumb-missing { 
  width: 100%; 
  height: auto; 
  border-radius: var(--radius); 
  aspect-ratio: 16/9; 
  object-fit: cover; 
}

.post img[src*="rakuten"]{ 
  aspect-ratio: unset; 
  min-height: unset; 
}


.post h3 { margin: 0; font-size: 18px; }
.post .meta { font-size: 12px; color: var(--muted); }

/* Sidebar */
.grid { display: grid; grid-template-columns: 1fr 260px; gap: 40px; }
@media (max-width: 900px) { 
  .grid { grid-template-columns: 1fr; } 
}
.profile { text-align: center; margin-top: 30px; }

/* CLS対策: プロフィール画像 */
.profile img { 
  width: 90px; 
  height: 90px; 
  border-radius: 50%; 
  margin: 0 auto 10px; 
  object-fit: cover; 
  aspect-ratio: 1/1; 
}

.profile .name { font-weight: 700; }
.profile .bio { font-size: 14px; color: var(--muted); }
.list { 
  list-style: none; 
  padding: 0; 
  margin: 0; 
  border-top: 1px solid var(--line); 
}
.list li { 
  margin: 0; 
  border-bottom: 1px solid var(--line); 
  padding: 8px 0; 
}

/* Sidebar widgets */
aside h2,
aside h2.wp-block-heading,
aside .widget-title,
aside h2.section-title {
  font-size: 16px !important;
  margin: 20px 0 10px !important;
  padding-bottom: 6px !important;
  border-bottom: 1px solid var(--line) !important;
}

/* Search (block + classic) */
aside .wp-block-search__inside-wrapper { display: flex; gap: 8px; align-items: center; }
aside .wp-block-search__input,
aside input[type="search"] {
  height: 36px !important;
  font-size: 14px !important;
  padding: 6px 8px !important;
}
aside .wp-block-search__button,
aside .search-form input[type="submit"],
aside .search-form button {
  height: 36px !important;
  font-size: 14px !important;
  padding: 0 12px !important;
}

/* Footer */
.site-footer { 
  margin-top: 40px; 
  border-top: 1px solid var(--line); 
  padding: 20px 0; 
  font-size: 14px; 
  color: var(--muted); 
  text-align: center; 
}

/* Single: center layout and content width */
.main.container .fc-article {
  max-width: 900px;
  margin: 24px auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.main.container .fc-article .entry-content {
  max-width: 720px;
  margin: 16px auto 0;
}
.breadcrumb { font-size: 13px; color: var(--muted); margin: 8px 0 16px; }
.breadcrumb a { color: var(--link); }

/* Product info box */
.product-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 16px;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  margin: 20px 0;
}
.product-box .thumb img { 
  width: 100%; height: auto; object-fit: cover; border-radius: 8px; aspect-ratio: 1/1; 
}
.product-box .meta h4 { margin: 0 0 6px; font-size: 18px; }
.product-box .meta .spec { font-size: 14px; color: var(--muted); }
.product-box .actions { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.product-box .actions button { 
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 14px; border-radius: 8px; border: 1px solid transparent; cursor: pointer;
}
.product-box .actions button.primary { background: #2d2d72; color: #fff; }
.product-box .actions button.secondary { background: #e9e2d8; color: #2b2b2b; border-color: var(--line); }

@media (max-width: 640px) {
  .main.container .fc-article { padding: 16px; }
  .main.container .fc-article .entry-content { max-width: none; }
  .product-box { grid-template-columns: 1fr; }
}

/* ===== Custom tweaks: article readability & pickup item styling ===== */
/* 全体の可読性を微調整 */
.fc-article { max-width: var(--max); margin: 24px auto; padding: 0 20px; }
.fc-article h1 { line-height: 1.25; margin: 8px 0 12px; }
.fc-article .post-meta { color: var(--muted); font-size: 14px; }

/* (single-hero は header 表示へ移行したため削除) */

/* 本文のリズムと見出し装飾 */
.fc-article .entry-content { font-size: 17px; line-height: 1.8; }
.fc-article .entry-content h2 { 
  margin: 2rem 0 1rem; 
  padding-bottom: .5rem; 
  border-bottom: 2px solid var(--line);
}
.fc-article .entry-content h3 { 
  margin: 1.5rem 0 0.75rem; 
  padding-left: .6rem; 
  border-left: 4px solid var(--link);
}
.fc-article .entry-content p { margin: 1rem 0; }
.fc-article .entry-content ul, 
.fc-article .entry-content ol { margin: 1rem 0 1.25rem 1.25rem; }
.fc-article .entry-content li { margin: .4rem 0; }

/* 引用・注意書き */
.fc-article .entry-content blockquote {
  margin: 1.25rem 0; padding: .9rem 1rem; background: var(--paper);
  border-left: 4px solid var(--line);
}

/* anchorは通常リンクの見た目を維持（ボタン化しない） */

/* 表（仕様まとめ）の体裁 */
.fc-article .entry-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.fc-article .entry-content th, 
.fc-article .entry-content td { border: 1px solid var(--line); padding: .6rem .7rem; }
.fc-article .entry-content th { background: #fff; text-align: left; }

/* Popular Posts のカードを軽く整える（ホーム用） */
.popular-grid article { 
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.popular-grid article h3 { margin: .75rem 1rem 1rem; font-size: 1.05rem; }

/* 画像の角丸・影（本文内） */
.fc-article .entry-content img { border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

@media (max-width: 640px) {
  .fc-article { padding: 0 16px; }
  .fc-article .entry-content { font-size: 16px; }
}
/* ===== end custom tweaks ===== */
