/*
Theme Name: 3分で分かる やさしいAndroid解説
Theme URI: https://wakaru-android.com/
Author: サポむす
Description: Androidの使い方・設定・トラブルをやさしく解説するサイト用テーマ。テーマ有効化時に固定ページ・投稿・カテゴリ・タグ・アイキャッチを自動作成します。
Version: 1.0.0
Text Domain: wakaru-android
*/

/* =============================================
   CSS変数・リセット・ベーススタイル
   ============================================= */
:root {
  --green: #2fbf71;
  --green-dark: #159653;
  --green-soft: #eaf8f0;
  --orange-soft: #fff3df;
  --ink: #263238;
  --muted: #65717a;
  --bg: #f7faf8;
  --line: #e1e8e3;
  --shadow: 0 8px 24px rgba(38, 50, 56, .08);
  --r: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.85;
  font-size: 17px;
}

a { text-decoration: none; color: inherit; }
button, input { font-family: inherit; }

/* =============================================
   ヘッダー
   ============================================= */
.header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1120px;
  margin: auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo { display: flex; align-items: center; gap: 12px; }

.logo-mark {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: url('https://wakaru-android.com/wp-content/uploads/2026/04/img-favicon.png') center / cover no-repeat;
  flex-shrink: 0;
}

.logo-title { font-weight: 900; font-size: 1.14rem; line-height: 1.25; }
.logo-title span { display: block; font-size: .75rem; color: var(--muted); font-weight: 700; }

.nav { display: flex; gap: 8px; flex-wrap: wrap; }

.nav-link {
  display: inline-block;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 800;
  border-radius: 999px;
  padding: 8px 14px;
}

.nav-link:hover { background: var(--green); color: #fff; }

/* =============================================
   ヒーローセクション
   ============================================= */
.hero {
  background: linear-gradient(135deg, #eaf8f0 0%, #fff 48%, #fff3df 100%);
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  max-width: 1120px;
  margin: auto;
  padding: 48px 20px 42px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 36px;
  align-items: center;
}

.badge {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--green-dark);
  font-weight: 900;
  font-size: .86rem;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  line-height: 1.25;
  margin: 0 0 16px;
  font-weight: 900;
}

.hero h1 em { font-style: normal; color: var(--green-dark); }
.hero p { font-size: 1.08rem; color: #43515a; margin: 0 0 22px; }

.hero-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
}

/* =============================================
   メインレイアウト
   ============================================= */
.main {
  max-width: 1120px;
  margin: 42px auto 60px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
}

.section-title { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.section-title h2 { font-size: 1.35rem; margin: 0; font-weight: 900; }
.section-title::after { content: ''; height: 2px; background: var(--line); flex: 1; }

/* =============================================
   カード・グリッド
   ============================================= */
.cat-grid,
.article-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 36px;
}

.card,
.cat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: 0 4px 12px rgba(38, 50, 56, .04);
  transition: .18s;
}

.card:hover,
.cat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: #b8dfc8;
}

.card img {
  width: 100%;
  border-radius: 14px;
  display: block;
  margin-bottom: 12px;
}

.cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cat-icon { font-size: 2rem; }

.card h3,
.cat-card h3 { margin: .2em 0 .4em; line-height: 1.45; font-size: 1.02rem; }

.card p,
.cat-card p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.65; }

.tag {
  display: inline-block;
  background: var(--green-soft);
  color: var(--green-dark);
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
  padding: 3px 10px;
  margin-bottom: 8px;
}

/* =============================================
   サイドバー
   ============================================= */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { display: none; }

.side-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: 0 4px 12px rgba(38, 50, 56, .04);
}

.side-list { display: flex; flex-direction: column; gap: 8px; }

.side-list a {
  background: var(--bg);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  color: var(--ink);
}

/* =============================================
   人気記事サイドバー
   ============================================= */
.side-box.popular-box {
  background: linear-gradient(180deg, #fff 0%, #f1fbf6 100%);
  border: 2px solid #b8dfc8;
}

.popular-title { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 1.1rem; }
.popular-title::before { content: '🏆'; font-size: 1.3rem; }

.popular-list {
  counter-reset: rank;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.popular-list a {
  counter-increment: rank;
  position: relative;
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 12px 11px 48px;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(38, 50, 56, .05);
}

.popular-list a::before {
  content: counter(rank);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--green);
  color: #fff;
  font-weight: 900;
}

.popular-list a:nth-child(1)::before { background: #f6b800; }
.popular-list a:nth-child(2)::before { background: #9aa4ad; }
.popular-list a:nth-child(3)::before { background: #c47a32; }

/* =============================================
   記事ページ
   ============================================= */
.article-wrap {
  max-width: 920px;
  margin: 34px auto 60px;
  padding: 0 20px;
}

.article-body {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 34px 38px;
  box-shadow: var(--shadow);
}

.article-body img.eyecatch {
  width: 100%;
  border-radius: 20px;
  margin-bottom: 22px;
}

.article-body h1 {
  font-size: clamp(1.55rem, 3.4vw, 2.3rem);
  line-height: 1.4;
  margin: .2em 0 .8em;
  font-weight: 900;
}

.article-body h2 {
  font-size: 1.35rem;
  margin: 1.8em 0 .7em;
  border-left: 6px solid var(--green);
  padding-left: 12px;
  line-height: 1.4;
}

.article-body h3 { font-size: 1.08rem; margin: 1.2em 0 .2em; color: var(--green-dark); }

.article-body .lead { font-size: 1.08rem; color: #43515a; }

.breadcrumb {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: .9rem;
  margin-bottom: 18px;
}

.breadcrumb a { color: var(--green-dark); font-weight: 800; }

/* =============================================
   記事内コンポーネント
   ============================================= */
.answer-box {
  background: #153525;
  color: #fff;
  border-radius: 20px;
  padding: 22px;
  margin: 24px 0;
}

.answer-box h2 { border: 0; padding: 0; margin: .2em 0 .6em; color: #fff; }

.answer-label {
  display: inline-block;
  background: var(--green);
  border-radius: 999px;
  padding: 4px 12px;
  margin: 0;
  font-weight: 900;
  font-size: .85rem;
}

.steps { counter-reset: s; list-style: none; padding: 0; }

.steps li {
  counter-increment: s;
  background: var(--green-soft);
  border: 1px solid #ccebd8;
  border-radius: 14px;
  padding: 12px 14px 12px 52px;
  margin: 10px 0;
  position: relative;
}

.steps li::before {
  content: counter(s);
  position: absolute;
  left: 14px;
  top: 12px;
  background: var(--green);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.note {
  background: var(--orange-soft);
  border: 1px solid #ffd89b;
  border-radius: 16px;
  padding: 16px;
  margin: 24px 0;
}

.article-tags {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 24px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.article-tags a {
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 900;
  border-radius: 999px;
  padding: 5px 12px;
}

/* =============================================
   次に読む記事
   ============================================= */
.next-reading {
  margin: 34px 0;
  padding: 22px;
  border-radius: 20px;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.next-reading h2 { margin-top: 0 !important; }

.next-reading-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.next-reading-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 3px 10px rgba(38, 50, 56, .05);
}

.next-reading-card img {
  width: 100%;
  border-radius: 12px;
  display: block;
  margin-bottom: 8px;
}

.next-reading-card strong { display: block; line-height: 1.45; font-size: .92rem; }

/* =============================================
   初心者向けカード
   ============================================= */
.beginner-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  margin-bottom: 34px;
  box-shadow: var(--shadow);
}

.beginner-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.beginner-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 10px;
}

.beginner-card img {
  width: 92px;
  height: 60px;
  object-fit: cover;
  border-radius: 10px;
  flex: none;
}

.beginner-card span { font-weight: 900; line-height: 1.45; }

/* =============================================
   固定ページ
   ============================================= */
.page-content {
  max-width: 920px;
  margin: 34px auto 60px;
  padding: 0 20px;
}

.page-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 34px 38px;
  box-shadow: var(--shadow);
}

.page-card h1 { font-size: 2rem; line-height: 1.4; }

.simple-list { display: grid; gap: 8px; }

.simple-list a {
  display: block;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 800;
}

/* =============================================
   フッター
   ============================================= */
.footer {
  background: #21302a;
  color: #dce7df;
  padding: 36px 20px;
  text-align: center;
}

.footer strong { display: block; color: #fff; font-size: 1.1rem; margin-bottom: 8px; }

.footer-grid {
  max-width: 1120px;
  margin: 24px auto 0;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
}

.footer-grid ul { list-style: none; padding: 0; margin: 10px 0; line-height: 2; }

.tag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.tag-chip {
  display: inline-block;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 2px 10px;
  margin: 3px 4px 3px 0;
  color: #dce7df;
  transition: background .18s, color .18s;
}

.tag-chip:hover {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.footer-copy {
  max-width: 1120px;
  margin: 20px auto 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: .86rem;
  color: #b7c7bd;
  text-align: center;
}

/* =============================================
   WordPressブロック補正
   ============================================= */
.wp-block-image img { height: auto; }

/* =============================================
   レスポンシブ
   ============================================= */
@media (max-width: 860px) {
  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .hero-inner,
  .main { grid-template-columns: 1fr; }

  .cat-grid,
  .article-grid { grid-template-columns: 1fr; }

  .nav { display: none; }

  .article-body { padding: 22px 16px; }

  .footer-grid { grid-template-columns: 1fr; }

  .next-reading-grid,
  .beginner-grid { grid-template-columns: 1fr; }

  .beginner-card img { width: 110px; height: 70px; }

  .page-card { padding: 22px 16px; }
}
