/*
Theme Name:   Aero
Theme URI:    https://example.com/aero
Author:       Your Name
Author URI:   https://example.com
Description:  シンプル・ミニマル・ワンカラムのWordPressクラシックテーマ。
Version:      1.1
License:      GNU General Public License v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  aero
Tags:         one-column, blog, accessibility-ready
*/

/* ============================================================
   2. CSS カスタムプロパティ（ライトモード デフォルト）
   ============================================================ */
:root {
  /* カラーパレット */
  --color-bg: #ffffff;
  --color-surface: #f5f5f5;
  --color-text: #1a1a1a;
  --color-muted: #6b7280;
  --color-accent: #2563eb;
  --color-border: #e5e7eb;
  --color-link: #2563eb;
  --color-link-hover: #1d4ed8;

  /* スペーシング変数 */
  --space-xs: 0.5rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: 4rem;

  /* レイアウト */
  --max-width: 720px;
  --radius: 4px;
}



/* ============================================================
   3. Reset / Base
   ============================================================ */

/* 全要素のbox-sizingをborder-boxに統一 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* ページ基本スタイル：余白リセットとフォント設定 */
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family:
    "Hiragino Sans",
    "Hiragino Kaku Gothic ProN",
    "Noto Sans JP",
    "Yu Gothic Medium",
    "Meiryo",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 1rem;
  line-height: 1.8;
}

/* 画像がコンテナをはみ出さないようにする */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* リンクの基本スタイル */
a {
  color: var(--color-link);
  text-decoration: none;
}

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

/* フォーカスを視覚的に示す（アクセシビリティ対応） */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* 見出しの基本スタイル */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: var(--space-l);
  margin-bottom: var(--space-s);
  line-height: 1.3;
  color: var(--color-text);
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  font-weight: 700;
}

h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

h4 {
  font-size: 1.125rem;
  font-weight: 600;
}

h5,
h6 {
  font-size: 1rem;
  font-weight: 600;
}

p {
  margin: 0 0 var(--space-s);
}

/* 引用ブロックのスタイル */
blockquote {
  margin: var(--space-m) 0;
  padding: var(--space-xs) var(--space-m);
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface);
  color: var(--color-muted);
  border-radius: 0 var(--radius) var(--radius) 0;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* インラインコードのスタイル */
code {
  font-size: 0.9rem;
  line-height: 1.6;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.1em 0.4em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* コードブロックのスタイル */
pre {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-s);
  overflow-x: auto;
  line-height: 1.6;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
}

/* 水平線のスタイル */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-l) 0;
}

/* テーブルのスタイル */
table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-m) 0;
}

th,
td {
  border: 1px solid var(--color-border);
  padding: var(--space-xs) var(--space-s);
  text-align: left;
}

th {
  background: var(--color-surface);
  font-weight: 600;
}

/* リストのスタイル */
ul,
ol {
  padding-left: var(--space-m);
  margin: 0 0 var(--space-s);
}

li {
  margin-bottom: 0.25rem;
}

/* ============================================================
   4. Layout（body, main, wrapper）
   ============================================================ */

/* スキップリンク：Tabキーフォーカス時のみ表示（アクセシビリティ） */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-accent);
  color: #fff;
  padding: var(--space-xs) var(--space-s);
  z-index: 999;
  font-size: 0.875rem;
}

.skip-link:focus {
  top: 0;
}

/* サイト全体のラッパー */
.site {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* メインコンテンツエリア：コンテンツが少なくてもフッターを下に */
.site-content {
  flex: 1;
}

/* コンテンツの最大幅と中央揃え */
main,
.site-header-inner,
.site-footer-inner {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-s);
}

/* ============================================================
   5. Header
   ============================================================ */

/* サイトヘッダー全体 */
.site-header {
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--space-s);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  /* スクロール時にヘッダーがフワっと浮く */
  transition: box-shadow 0.2s;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-s);
}

/* サイトタイトルのリンク */
.site-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.site-title a {
  color: var(--color-text);
  text-decoration: none;
}

.site-title a:hover {
  color: var(--color-accent);
}

/* サイトの説明文（キャッチフレーズ） */
.site-description {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.4;
}

/* ヘッダー右側のコントロールエリア（ナビ＋ボタン） */
.header-controls {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ============================================================
   6. Navigation
   ============================================================ */

/* グローバルナビゲーション */
.global-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.global-nav a {
  display: block;
  padding: 0.375rem var(--space-xs);
  color: var(--color-text);
  font-size: 0.9375rem;
  border-radius: var(--radius);
  /* タッチターゲット最小44pxを確保 */
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}

.global-nav a:hover {
  background: var(--color-surface);
  color: var(--color-accent);
  text-decoration: none;
}

/* 現在のページのナビリンク */
.global-nav .current-menu-item > a,
.global-nav .current-page-item > a {
  color: var(--color-accent);
  font-weight: 600;
}

/* ハンバーガーボタン（モバイルのみ表示） */
.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--color-text);
  /* デスクトップでは非表示 */
  display: none;
}

/* ハンバーガーアイコンの線 */
.menu-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 20px;
}

.menu-toggle-icon span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ハンバーガーメニューが開いているときのアニメーション */
.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   7. Main / Article
   ============================================================ */

main {
  padding-block: var(--space-l);
}

/* 記事コンテンツのスタイル */
.entry-content {
  color: var(--color-text);
}

/* 記事コンテンツ内の見出しに上部マージン */
.entry-content h2 {
  margin-top: var(--space-xl);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--color-border);
}

.entry-content h3 {
  margin-top: var(--space-l);
}

/* アイキャッチ画像 */
.entry-thumbnail {
  margin-bottom: var(--space-m);
  border-radius: var(--radius);
  overflow: hidden;
}

.entry-thumbnail img {
  width: 100%;
  height: auto;
}

/* 記事ヘッダー */
.entry-header {
  margin-bottom: var(--space-m);
}

.entry-title {
  margin-top: 0;
  margin-bottom: var(--space-xs);
}

.entry-title a {
  color: var(--color-text);
  text-decoration: none;
}

.entry-title a:hover {
  color: var(--color-accent);
}

/* 記事フッター（前後記事ナビ） */
.entry-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-m);
  border-top: 1px solid var(--color-border);
}

/* 単一記事の前後ナビ */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-m);
  margin-top: var(--space-l);
}

.nav-previous,
.nav-next {
  display: flex;
  flex-direction: column;
}

.nav-next {
  text-align: right;
  align-items: flex-end;
}

.post-navigation .nav-subtitle {
  font-size: 0.75rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

/* ============================================================
   8. Post Meta（投稿メタ情報）
   ============================================================ */

/* 投稿日・カテゴリなどのメタ情報 */
.entry-meta {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
  margin-bottom: var(--space-xs);
}

.entry-meta a {
  color: var(--color-muted);
}

.entry-meta a:hover {
  color: var(--color-accent);
}

/* メタ情報の区切り文字 */
.entry-meta .sep {
  color: var(--color-border);
}

/* カテゴリラベル */
.cat-links a {
  display: inline-block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--radius) * 2);
  padding: 0.1em 0.6em;
  font-size: 0.8125rem;
}

/* タグラベル */
.tags-links a {
  display: inline-block;
  color: var(--color-muted);
  font-size: 0.8125rem;
}

.tags-links a::before {
  content: "#";
}

/* ============================================================
   9. Post List（一覧ページ）
   ============================================================ */

/* 記事一覧のリスト */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* 記事カードのスタイル */
.post-list-item {
  padding-block: var(--space-l);
  border-bottom: 1px solid var(--color-border);
}

.post-list-item:first-child {
  padding-top: 0;
}

/* 記事カードのアイキャッチ画像 */
.post-list-thumbnail {
  margin-bottom: var(--space-s);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.post-list-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-list-item:hover .post-list-thumbnail img {
  transform: scale(1.02);
}

/* 記事カードのタイトル */
.post-list-title {
  margin: var(--space-xs) 0;
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  font-weight: 700;
  line-height: 1.4;
}

.post-list-title a {
  color: var(--color-text);
  text-decoration: none;
}

.post-list-title a:hover {
  color: var(--color-accent);
}

/* 記事カードの抜粋テキスト */
.post-list-excerpt {
  color: var(--color-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin: var(--space-xs) 0 0;
}

/* ページネーション */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: var(--space-xs);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--color-text);
  transition: background 0.15s, color 0.15s;
}

.pagination a:hover {
  background: var(--color-surface);
  color: var(--color-accent);
  text-decoration: none;
}

/* 現在のページ番号 */
.pagination .current {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
  font-weight: 600;
}

/* アーカイブページの見出し */
.archive-header {
  margin-bottom: var(--space-l);
  padding-bottom: var(--space-m);
  border-bottom: 2px solid var(--color-border);
}

.archive-title {
  margin: 0 0 var(--space-xs);
}

.archive-description {
  color: var(--color-muted);
  margin: 0;
}

/* ============================================================
   10. Comments（コメント）
   ============================================================ */

/* コメントエリア全体 */
.comments-area {
  margin-top: var(--space-xl);
  padding-top: var(--space-m);
  border-top: 2px solid var(--color-border);
}

/* コメント件数の見出し */
.comments-title {
  margin-top: 0;
  margin-bottom: var(--space-m);
}

/* コメント一覧リスト */
.comment-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.comment-list li + li {
  margin-top: var(--space-m);
}

/* 子コメント（返信）のインデント */
.comment-list .children {
  list-style: none;
  padding-left: var(--space-m);
  margin-top: var(--space-m);
}

/* コメント本体 */
.comment-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-s);
}

/* コメント者のアバター */
.comment-author img {
  border-radius: 50%;
  flex-shrink: 0;
}

/* コメントの詳細情報 */
.comment-meta {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin-bottom: var(--space-xs);
}

.comment-author .fn {
  font-weight: 600;
  color: var(--color-text);
  font-style: normal;
}

/* コメント本文 */
.comment-content p {
  margin: 0 0 var(--space-xs);
}

.comment-content p:last-child {
  margin-bottom: 0;
}

/* 返信リンク */
.reply {
  margin-top: var(--space-xs);
  font-size: 0.875rem;
}

/* 未承認コメントのメッセージ */
.comment-awaiting-moderation {
  color: var(--color-muted);
  font-style: italic;
  font-size: 0.875rem;
}

/* コメント投稿フォームエリア */
#respond {
  margin-top: var(--space-xl);
}

/* "コメントを書く"などの見出し */
#reply-title {
  margin-top: 0;
  margin-bottom: var(--space-m);
}

/* コメントフォームの注意書き */
#respond p {
  margin-bottom: var(--space-s);
}

/* コメントフォームの各フィールド */
#respond input[type="text"],
#respond input[type="email"],
#respond input[type="url"],
#respond textarea {
  width: 100%;
  padding: var(--space-xs) var(--space-s);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  /* フォーカス時のアウトラインはfocus-visibleで管理 */
  outline: none;
  transition: border-color 0.15s;
}

#respond input[type="text"]:focus,
#respond input[type="email"]:focus,
#respond input[type="url"]:focus,
#respond textarea:focus {
  border-color: var(--color-accent);
}

/* コメントのテキストエリア */
#respond textarea {
  min-height: 8rem;
  resize: vertical;
}

/* コメント送信ボタン */
#respond input[type="submit"] {
  display: inline-block;
  padding: var(--space-xs) var(--space-m);
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, transform 0.1s;
}

#respond input[type="submit"]:hover {
  background: var(--color-link-hover);
}

#respond input[type="submit"]:active {
  transform: scale(0.98);
}

/* ============================================================
   11. Footer
   ============================================================ */

/* サイトフッター全体 */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding-block: var(--space-m);
  margin-top: auto;
}

.site-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-s);
  text-align: center;
}

/* コピーライトテキスト */
.site-copyright {
  font-size: 0.875rem;
  color: var(--color-muted);
  margin: 0;
}

/* フッターナビゲーション */
.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
}

.footer-nav a {
  font-size: 0.875rem;
  color: var(--color-muted);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  min-height: 44px;
}

.footer-nav a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

/* ============================================================
   12. Forms & Inputs（フォーム全般）
   ============================================================ */

/* 検索フォームのスタイル */
.search-form {
  display: flex;
  gap: var(--space-xs);
  max-width: 100%;
}

.search-field {
  flex: 1;
  padding: var(--space-xs) var(--space-s);
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
  min-height: 44px;
}

.search-field:focus {
  border-color: var(--color-accent);
}

/* 検索ボタン */
.search-submit {
  padding: var(--space-xs) var(--space-s);
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  transition: background 0.15s;
}

.search-submit:hover {
  background: var(--color-link-hover);
}

/* 詳細検索の結果・404のメッセージ */
.page-header {
  margin-bottom: var(--space-l);
  padding-bottom: var(--space-m);
  border-bottom: 2px solid var(--color-border);
}

.page-title {
  margin: 0 0 var(--space-xs);
}

/* ============================================================
   13. WordPress 標準クラス
   ============================================================ */

/* キャプション付き画像 */
.wp-caption {
  max-width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-xs);
}

.wp-caption img {
  display: block;
  width: 100%;
}

.wp-caption-text {
  font-size: 0.875rem;
  color: var(--color-muted);
  text-align: center;
  margin: var(--space-xs) 0 0;
}

/* 画像の配置クラス */
.alignleft {
  float: left;
  margin-right: var(--space-m);
  margin-bottom: var(--space-s);
}

.alignright {
  float: right;
  margin-left: var(--space-m);
  margin-bottom: var(--space-s);
}

.aligncenter {
  margin-inline: auto;
}

/* ギャラリーのクリアフィックス */
.gallery::after {
  content: "";
  display: table;
  clear: both;
}

/* スクリーンリーダー専用テキスト（見えないが読み上げられる） */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: var(--color-surface);
  clip: auto !important;
  clip-path: none;
  color: var(--color-text);
  display: block;
  font-size: 0.875rem;
  height: auto;
  left: var(--space-xs);
  padding: var(--space-xs) var(--space-s);
  top: var(--space-xs);
  width: auto;
  z-index: 100000;
}

/* sticky投稿のマーカー */
.sticky .post-list-title::after {
  content: "📌";
  margin-left: 0.5rem;
  font-size: 0.875rem;
}



/* ============================================================
   15. Responsive（@media min-width）モバイルファースト
   ============================================================ */

/* モバイル（デフォルト〜599px）の設定 */
.global-nav {
  /* モバイルではハンバーガーメニュー制御でVJSにより表示/非表示 */
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-s);
  z-index: 99;
}

/* ナビが開いている状態 */
.global-nav.is-open {
  display: block;
}

.global-nav.is-open ul {
  flex-direction: column;
  gap: 0;
}

.global-nav.is-open a {
  border-radius: 0;
  border-bottom: 1px solid var(--color-border);
}

.global-nav.is-open a:last-child {
  border-bottom: none;
}

/* ハンバーガーボタンはモバイルで表示 */
.menu-toggle {
  display: flex;
}

/* タブレット（600px以上） */
@media (min-width: 600px) {
  .post-navigation {
    gap: var(--space-l);
  }
}

/* デスクトップ（960px以上） */
@media (min-width: 960px) {
  /* デスクトップではハンバーガーを非表示にしてナビを表示 */
  .menu-toggle {
    display: none;
  }

  /* デスクトップではナビを常に表示 */
  .global-nav {
    display: block;
    position: static;
    background: transparent;
    border: none;
    padding: 0;
  }

  .global-nav ul {
    flex-direction: row;
  }

  .global-nav a {
    border-bottom: none;
  }

  .site-footer-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}


