/*
Theme Name: FTS-MAXX
Theme URI: https://worker-fts.info
Author: KAZUMA
Author URI: https://worker-fts.info
Description: アフィリエイト特化型AIサイトビルダーWordPressテーマ。商品データを読み込むだけで,AIがLP・レビュー・比較記事・SEO権威記事を自動生成し,売れるアフィリエイトサイトを丸ごと構築します。
Version: 16.29.19
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fts-maxx
Tags: affiliate, ai, seo, responsive, e-commerce, blog
*/


/* =============================================================================
   CSS カスタムプロパティ設計思想:
   全カラー・スペーシング・タイポグラフィをCSS変数で一元管理し、
   AIによるデザイン変更コマンドが :root の変数を書き換えるだけで
   サイト全体に即時反映される構造にしている。
   ============================================================================= */

:root {
  /* ── カラーシステム（デフォルト: 洗練されたモダンライト）── */
  --am-primary:        #64748b;
  /* --am-primary-light 等の派生色はスキンのメインカラーから自動でニュアンスが決まるように、ここでは個別の色指定を廃止 */
  --am-secondary:      #ec4899;   /* セカンダリ（ピンク） */
  --am-accent:         #06b6d4;   /* アクセント（シアン） */

  /* ── 背景・サーフェス ── */
  --am-bg:             #fafafc;   /* ページ背景（清潔感のあるオフホワイト） */
  --am-bg-alt:         #f1f5f9;   /* セクション背景 */
  --am-surface:        #ffffff;   /* カード・パネル */
  --am-surface-hover:  #f8fafc;   /* ホバー時サーフェス */
  --am-border:         rgba(0, 0, 0, 0.06); /* 非常に繊細なボーダー */

  /* ── テキスト ── */
  --am-text-primary:   #0f172a;   /* メインテキスト（深いネイビー） */
  --am-text-secondary: #475569;   /* サブテキスト */
  --am-text-muted:     #94a3b8;   /* ミュートテキスト */

  /* Why: 見出しグラデーションなどの終点カラーをアクセントカラー（--am-accent）に連動させ、管理画面からの設定を反映します。 */
  --am-grad-primary:   linear-gradient(135deg, var(--am-primary) 0%, var(--am-accent) 100%);
  --am-grad-surface:   linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  --am-grad-glow:      radial-gradient(ellipse at center, rgba(59, 130, 246, 0.08), transparent 70%);

  /* ── ジオメトリ（形状） ── */
  --am-radius-default: 16px;
  --am-radius-button:  999px;
  --am-border-width:   1px;
  --am-border-style:   solid;
  
  /* ── 装飾 ── */
  --am-shadow-main:    0 12px 24px rgba(0, 0, 0, 0.05);
  --am-shadow-hover:   0 20px 48px rgba(0, 0, 0, 0.08);
  --am-glass-blur:     15px;
  --am-glass-bg:       rgba(255, 255, 255, 0.3);

  /* ── タイポグラフィ ── */
  --am-font-sans:      'Inter', 'Noto Sans JP', system-ui, -apple-system, sans-serif;
  --am-font-display:   'Outfit', 'Noto Sans JP', sans-serif;
  --am-font-mono:      'JetBrains Mono', 'Consolas', monospace;
  --am-font-weight-heading: 700;
  --am-letter-spacing:      0;

  --am-text-xs:    0.75rem;
  --am-text-sm:    0.875rem;
  --am-text-base:  1rem;
  --am-text-lg:    1.125rem;
  --am-text-xl:    1.25rem;
  --am-text-2xl:   1.5rem;
  --am-text-3xl:   1.875rem;
  --am-text-4xl:   2.25rem;
  --am-text-5xl:   3rem;

  /* ── スペーシング ── */
  --am-gap-xs:    0.25rem;
  --am-gap-sm:    0.5rem;
  --am-gap-md:    1rem;
  --am-gap-lg:    1.5rem;
  --am-gap-xl:    2rem;
  --am-gap-2xl:   3rem;
  --am-gap-3xl:   4rem;

  /* ── ボーダー半径（より丸みを帯びたデザインへ） ── */
  --am-radius-sm:   10px;
  --am-radius-md:   16px;
  --am-radius-lg:   24px;
  --am-radius-xl:   32px;
  --am-radius-full: 9999px;

  /* ── シャドウ（柔らかくモダンな影） ── */
  --am-shadow-sm:  0 2px 8px rgba(0, 0, 0, 0.04);
  --am-shadow-md:  0 12px 24px rgba(0, 0, 0, 0.05);
  --am-shadow-lg:  0 20px 48px rgba(0, 0, 0, 0.08);
  --am-shadow-glow: 0 8px 24px rgba(124, 58, 237, 0.2);

  /* ── トランジション ── */
  --am-transition-fast:   0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --am-transition-base:   0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --am-transition-slow:   0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* ── コンテナ幅 ── */
  --am-container:       1240px;
  --am-container-sm:    800px;
  --am-container-xs:    480px;

  /* ―― ヘッダー高さ ―― */
  --am-header-h:        72px;

  /* ―― モバイルメニュー2インラインバーの高さ（デフォルト：0 = バーなし）――
  /* Why: ヘッダー下配置の場合のみ .am-has-secondary-bar クラスでこの値を上書きし、
          ドロワーの top 計算に自動的にインラインバー分の高さを加算させるため。 */
  --am-secondary-bar-h: 0px;
}

body.am-has-secondary-bar {
  --am-secondary-bar-h: 42px;
}

/* =============================================================================
   ダークモード（必要に応じて手動またはオプションで付与）
   ============================================================================= */
/* ダークモード時は、スキンの色がベースになるが、一部のコントラストのみ調整が必要な場合のみここに記述する */
.am-dark-mode {
  /* スキンの色が優先されるため、ここでは色の直書きを廃止 */
}

/* =============================================================================
   リセット & ベーススタイル
   ============================================================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--am-font-sans);
  font-size: var(--am-text-base);
  color: var(--am-text-primary);
  background-color: var(--am-bg);
  line-height: 1.7;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--am-primary);
  text-decoration: none;
  transition: color var(--am-transition-fast);
}
a:hover { opacity: 0.8; }

/* =============================================================================
   レイアウト共通
   ============================================================================= */
.am-container {
  width: 100%;
  max-width: var(--am-container);
  margin-inline: auto;
  padding-inline: var(--am-gap-lg);
}

.am-container--sm {
  max-width: var(--am-container-sm);
}

/* =============================================================================
   タイポグラフィ共通
   ============================================================================= */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--am-font-display);
  font-weight: var(--am-font-weight-heading);
  color: var(--am-text-primary);
  line-height: 1.3;
  letter-spacing: var(--am-letter-spacing);
  margin-bottom: var(--am-gap-md);
}

h1 { font-size: var(--am-text-4xl); font-weight: 800; }
h2 { font-size: var(--am-text-3xl); font-weight: 700; }
h3 { font-size: var(--am-text-2xl); font-weight: 700; }
h4 { font-size: var(--am-text-xl);  font-weight: 600; }

p { margin-bottom: var(--am-gap-md); }

/* =============================================================================
   ボタン共通
   ============================================================================= */
.am-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 2rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--am-radius-button);
  transition: all var(--am-transition-base);
  cursor: pointer;
  border: var(--am-border-width) var(--am-border-style) transparent;
  gap: var(--am-gap-sm);
  white-space: nowrap;
}

.am-btn--primary {
  background: var(--am-grad-primary);
  color: #fff;
  box-shadow: var(--am-shadow-glow);
}
.am-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.15);
  color: #fff;
}

.am-btn--outline {
  background: transparent;
  color: var(--am-primary);
  border: 1.5px solid var(--am-primary);
}
.am-btn--outline:hover {
  background: var(--am-bg-alt);
  color: var(--am-primary);
}

.am-btn--ghost {
  background: rgba(255,255,255,0.05);
  color: var(--am-text-secondary);
  border: 1.5px solid var(--am-border);
}
.am-btn--ghost:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--am-primary);
  color: var(--am-text-primary);
}

.am-btn--lg { padding: 1rem 2rem; font-size: var(--am-text-base); }
.am-btn--sm { padding: 0.5rem 1rem;  font-size: var(--am-text-xs);  }

/* =============================================================================
   カード共通
   ============================================================================= */
.am-card {
  background: var(--am-surface);
  border: var(--am-border-width) var(--am-border-style) var(--am-border);
  border-radius: var(--am-radius-md);
  padding: var(--am-gap-xl);
  transition: all var(--am-transition-base);
  box-shadow: var(--am-shadow-main);
}
/* --- Sidebar Design Variants --- */
.am-sidebar-type-card .am-widget {
  background: var(--am-surface);
  border: var(--am-border-width) var(--am-border-style) var(--am-border);
  border-radius: var(--am-radius-md);
  padding: var(--am-gap-lg);
  margin-bottom: var(--am-gap-xl);
  box-shadow: var(--am-shadow-main);
}

.am-sidebar-type-clean .am-widget {
  background: transparent;
  border-bottom: 1px solid var(--am-border);
  padding: var(--am-gap-lg) 0;
  margin-bottom: var(--am-gap-lg);
}

.am-sidebar-type-soft-card .am-widget {
  background: var(--am-bg-alt);
  border-radius: var(--am-radius-md);
  padding: var(--am-gap-lg);
  margin-bottom: var(--am-gap-xl);
}

.am-sidebar-type-glass .am-widget {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(var(--am-glass-blur));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--am-radius-md);
  padding: var(--am-gap-lg);
  margin-bottom: var(--am-gap-xl);
  color: var(--am-text-secondary);
}

.am-sidebar-type-retro-box .am-widget {
  background: var(--am-surface);
  border: 3px solid #000;
  box-shadow: 6px 6px 0px #000;
  padding: var(--am-gap-lg);
  margin-bottom: var(--am-gap-2xl);
  border-radius: 0;
}

.am-sidebar-type-minimal .am-widget {
  padding: var(--am-gap-lg) 0;
  margin-bottom: var(--am-gap-xl);
}
.am-sidebar-type-minimal .am-widget-title {
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  border-bottom: 2px solid var(--am-primary);
  display: inline-block;
  margin-bottom: var(--am-gap-md);
}
.am-card:hover {
  background: var(--am-surface-hover);
  border-color: var(--am-primary);
  box-shadow: var(--am-shadow-hover);
  transform: translateY(-2px);
}

/* =============================================================================
   バッジ
   ============================================================================= */
.am-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--am-radius-full);
  font-size: var(--am-text-xs);
  font-weight: 600;
}
.am-badge--primary { background: rgba(124,58,237,0.15); color: var(--am-primary); }
.am-badge--success { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.am-badge--warning { background: rgba(245,158,11,0.15); color: #fcd34d; }
.am-badge--danger  { background: rgba(239,68,68 ,0.15); color: #fca5a5; }

/* =============================================================================
   ヘッダー
   ============================================================================= */
header.am-header,
.am-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--am-header-h);
  background-color: var(--am-header-bg) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--am-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  /* スキン別の疑似要素装飾(::before, ::after)に必要 */
  position: sticky;
}

.am-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: var(--am-container-width);
  margin: 0 auto;
  padding: 0 var(--am-gap-xl);
}

.am-header__logo {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--am-text-primary);
  text-decoration: none;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--am-primary) 0%, var(--am-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity 0.3s ease;
}

.am-header__logo:hover {
  opacity: 0.8;
}

.am-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.am-header__logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--am-text-primary);
  text-decoration: none;
  letter-spacing: -0.025em;
}

/* ナビゲーション */
.am-nav {
  display: flex;
  align-items: center;
  gap: var(--am-gap-xl);
  list-style: none;
}

/* PC用およびモバイル用のナビゲーションコンテナ表示制御
   Why: PC用メニューとモバイル用メニューの表示・非表示を明示的にコンテナ単位で制御します。 */
.am-nav-container-pc {
  display: block;
}
.am-nav-container-mobile {
  display: none;
}

/* =============================================================================
   モバイルメニュー2（インライン横スクロールバー）
   Why: ハンバーガードロワーとは独立した、常時表示のインラインナビゲーション。
        カテゴリ一覧などへの素早いアクセス用ショートカットとして機能する。
        PCでは非表示にし、モバイル画面のヘッダー直下にのみ表示する。
   ============================================================================= */
.am-nav-container-mobile-secondary {
  /* PCでは常に非表示 */
  display: none;
  width: 100%;
  height: 42px; /* 高さを42pxに固定 */
  background-color: var(--am-surface);
  border-bottom: 1px solid var(--am-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  /* Why: ドロワーメニュー（z-index: 99）の手前に表示されるよう、
          ヘッダー（z-index: 100）より低くドロワーより高い値を設定します。 */
  z-index: 98;
  position: relative;
}

/* Why: ヘッダー下に配置する場合のレイアウト定義。
        ヘッダーのすぐ下にくっついてスクロール追従し、JSアニメーションとも連動できるようにします。 */
.am-secondary-below-header {
  position: sticky;
  top: var(--am-header-h);
  z-index: 98;
}

.am-mobile-secondary-inner {
  height: 100%;
  overflow-x: auto;
  /* Why: スクロールバー非表示でタッチスクロールが自然に動くよう設定。
          -webkit-overflow-scrolling はiOSでの慣性スクロールを有効にします。 */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0;
}

.am-mobile-secondary-inner::-webkit-scrollbar {
  display: none;
}

/* インラインバー内のメニューリスト */
.am-nav-mobile-secondary {
  display: flex;
  align-items: center;
  height: 100%;
  /* Why: flex-wrap: nowrap で横1列を強制し、横スクロールが発生するようにします */
  flex-wrap: nowrap;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  /* Why: min-width: max-content でコンテナ幅に合わせた縮小を防ぎ、
          全メニュー項目が1行に並ぶよう保証します。 */
  min-width: max-content;
}

.am-nav-mobile-secondary > li {
  flex-shrink: 0;
  height: 100%;
}

.am-nav-mobile-secondary > li > a {
  display: block;
  height: 40px; /* 42px - border-bottom 2px */
  line-height: 40px; /* 文字を縦方向中央揃えに */
  padding: 0 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--am-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--am-transition-fast), border-color var(--am-transition-fast);
}


.am-nav-mobile-secondary > li > a:hover,
.am-nav-mobile-secondary > li.current-menu-item > a,
.am-nav-mobile-secondary > li.current-menu-ancestor > a {
  color: var(--am-primary);
  border-bottom-color: var(--am-primary);
  opacity: 1;
}
.am-header__nav a {
  text-decoration: none;
  color: var(--am-text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--am-transition-smooth);
}

.am-header__nav a:hover {
  color: var(--am-primary);
}

/* ハンバーガーメニュー（モバイル） */
.am-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--am-gap-sm);
}
.am-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--am-text-primary);
  border-radius: 2px;
  transition: all var(--am-transition-base);
}

/* Why: モバイルメニュー展開時、3本線が動きながら×に変化するアニメーションを実現するため。
   各span要素のY軸移動と回転を組み合わせることで交差する×を作ります。 */
.am-hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.am-hamburger.is-open span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}
.am-hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =============================================================================
   フッター
   ============================================================================= */
footer.am-footer,
.am-footer {
  background-color: var(--am-footer-bg) !important;
  color: var(--am-text-secondary);
  border-top: 1px solid var(--am-border);
  padding: var(--am-gap-4xl) 0 var(--am-gap-2xl);
  margin-top: 5rem;
}

.am-footer__inner {
  max-width: var(--am-container-width);
  margin: 0 auto;
  padding: 0 var(--am-gap-xl);
  display: grid;
  /* Why: ブランドエリア(320px固定)と、右側ウィジェットエリア(残りのスペース)を綺麗に2分割します */
  grid-template-columns: 320px 1fr;
  gap: var(--am-gap-3xl);
}

.am-footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--am-gap-md);
}

.am-footer__logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--am-text-primary);
  text-decoration: none;
}

.am-footer__grid {
  display: grid;
  /* Why: ウィジェットの数に関わらず自動的に列数を最適化（最小180px）し、
         フッターメニューの文字などが押しつぶされないようにします */
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--am-gap-2xl);
  margin-bottom: var(--am-gap-2xl);
}

.am-footer__desc {
  color: var(--am-text-secondary);
  font-size: var(--am-text-sm);
  line-height: 1.8;
  max-width: 320px;
}

.am-footer-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.am-footer-menu li {
  margin-bottom: 0.75rem;
}

.am-footer-menu a {
  color: var(--am-text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.am-footer-menu a:hover {
  color: var(--am-primary);
}

.am-footer__legal-link {
  margin-left: 1.5rem;
  color: var(--am-text-muted);
  font-size: var(--am-text-xs);
  text-decoration: none;
  transition: color 0.3s ease;
}

.am-footer__legal-link:hover {
  color: var(--am-primary);
}

.am-footer__copy {
  margin-top: var(--am-gap-4xl);
  padding-top: var(--am-gap-xl);
  border-top: 1px solid var(--am-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--am-text-muted);
  font-size: var(--am-text-xs);
}

/* =============================================================================
   スティッキーCTAバー（モバイル専用）
   – 記事ページでスクロールしても常に購入ボタンを表示する
   ============================================================================= */
.am-sticky-cta {
  display: none; /* PCでは非表示 */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--am-surface);
  border-top: 1px solid var(--am-border);
  padding: var(--am-gap-sm) var(--am-gap-md);
  gap: var(--am-gap-sm);
}

/* =============================================================================
   ユーティリティ
   ============================================================================= */
.am-text-gradient {
  background: var(--am-grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.am-section {
  padding: var(--am-gap-3xl) 0;
}

.am-section--alt {
  background: var(--am-bg-alt);
}

/* Why: 投稿カード（タイル）同士の余白（ギャップ）を管理画面の設定値（am-card-gap）でPC表示でも動的に制御できるように変更します。 */
.am-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--am-card-gap, var(--am-gap-xl)); }
.am-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--am-card-gap, var(--am-gap-xl)); }
.am-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--am-card-gap, var(--am-gap-xl)); }

.am-flex       { display: flex; }
.am-flex-col   { flex-direction: column; }
.am-items-center{ align-items: center; }
.am-justify-between { justify-content: space-between; }
.am-gap-md     { gap: var(--am-gap-md); }

.am-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =============================================================================
   レスポンシブ（モバイルファースト）
   ============================================================================= */
@media (max-width: 1024px) {
  :root { --am-container: 100%; }
  .am-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --am-text-4xl: 1.875rem;
    --am-text-3xl: 1.5rem;
    --am-text-2xl: 1.25rem;
  }

  /* モバイル表示時のナビゲーションコンテナ出し分け
     Why: モバイル表示時はPC用を完全に非表示にし、ヘッダー外に配置したモバイル用コンテナを表示します。 */
  .am-nav-container-pc {
    display: none;
  }
  .am-nav-container-mobile {
    display: block;
  }

  /* Why: モバイルメニュー2（インラインバー）はモバイル表示時のみ表示します。
          WordPress「外観 > メニュー」でメニューが割り当てられていない場合はそもそもHTML出力されないため、
          ここでは display を有効にするだけでよいです。 */
  .am-nav-container-mobile-secondary {
    display: block;
  }

  .am-nav-pc { display: none; }
  .am-nav-mobile { display: none; }
  .am-nav-mobile.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--am-bg);
    /* Why: ヘッダー（z-index: 100）の背面に回り込ませるため、ヘッダーの高さ分のパディングを上部に設けます。
          インラインバーがヘッダー下配置の場合は --am-secondary-bar-h 分も考慮します。 */
    padding: calc(var(--am-header-h) + var(--am-secondary-bar-h) + var(--am-gap-xl)) var(--am-gap-xl) var(--am-gap-xl);
    gap: var(--am-gap-lg);
    z-index: 99;
    overflow-y: auto; /* Why: メニュー項目が画面高さに収まらない場合にスクロール可能にします。 */
  }

  .am-hamburger { display: flex; }
  .am-grid-2, .am-grid-3, .am-grid-4, .am-post-grid {
    grid-template-columns: 1fr;
    /* Why: 管理画面のスライダーで設定した共通のタイル（カード）同士の余白を動的に適用します。 */
    gap: var(--am-card-gap, var(--am-gap-xl)) !important;
  }

  /* モバイル表示時のフッターレイアウト調整
     Why: 狭い画面ではブランドとメニューを縦積みにし、メニューの表示幅を最適化、
          またコピーライトなどのテキストを中央揃えにして配置を綺麗にします */
  .am-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--am-gap-2xl);
  }
  .am-footer__grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .am-footer__copy {
    flex-direction: column;
    gap: var(--am-gap-sm);
    text-align: center;
    align-items: center;
  }
  .am-footer__legal-link {
    margin-left: 0;
  }

  /* スティッキーCTAバーを表示 */
  .am-sticky-cta { display: flex; }
}

@media (max-width: 480px) {
  h1 { font-size: var(--am-text-3xl); }
}

/* ==========================================================================
   AffiliMax Modern UI & Micro Animations (Phase 2 Additions)
   ========================================================================== */

/* Typography & Base Variables Refinement */
:root {
    --am-radius-sm:   10px;
    --am-radius-md:   16px;
    --am-radius-lg:   24px;
    --am-radius-xl:   32px;
    --am-glass-bg: rgba(255, 255, 255, 0.8);
    --am-glass-border: rgba(255, 255, 255, 0.5);
    --am-shadow-lift: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    --am-transition-spring: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
    --am-transition-smooth: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Base Helpers */
.am-text-center { text-align: center; }
.am-border-radius-large { border-radius: var(--am-radius-lg); overflow: hidden; }

/* Micro Animations (Framer Motion equivalent in CSS) */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.am-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.am-hover-lift {
    transition: var(--am-transition-spring);
    will-change: transform;
}
.am-hover-lift:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--am-shadow-lift);
}

/* Glassmorphism Panel */
.am-glass-panel {
    background: var(--am-glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--am-glass-border);
    border-radius: var(--am-radius-md);
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

/* --- Single Page Layout --- */
/* 一覧系ページ（フロントページ、カテゴリー等のアーカイブ、検索結果）の1カラム設定時は、
   最大幅を 800px に制限せず、他のヘッダー画像やフル幅ボックスと揃えるために 1240px（var(--am-container)）を維持します。
   これにより、タイルカードが極端に狭く並んでレイアウトが崩れるのを防ぎます。 */
.home.am-cols-1 .am-single-container,
.front-page.am-cols-1 .am-single-container,
.archive.am-cols-1 .am-single-container,
.search.am-cols-1 .am-single-container {
    max-width: var(--am-container);
}

.am-single-container {
    display: grid;
    gap: var(--am-gap-2xl);
    max-width: var(--am-container);
    margin: 0 auto;
    padding-top: var(--am-gap-2xl);
    padding-bottom: var(--am-gap-2xl);
}

/* Why: アイキャッチ画像（通常またはオーバーレイ）がある場合、画像と本文の間の隙間を狭く（16px程度）調整し、不要な余白を削減して一体感を持たせます。 */
.am-hero-thumbnail + .am-single-container {
    padding-top: var(--am-gap-md);
}
.am-hero-thumbnail + .am-single-container .am-single-article {
    padding-top: var(--am-gap-md);
}

/* 1カラム（サイドバーなし） */
.am-cols-1 .am-single-container {
    grid-template-columns: 1fr;
    max-width: 800px;
}

/* 2カラム（標準：右サイドバー） */
.am-cols-2 .am-single-container {
    grid-template-columns: 1fr 320px;
}

/* 3カラム（両サイドバー） */
.am-cols-3 .am-single-container {
    grid-template-columns: 280px 1fr 280px;
}

.am-single-article,
.am-single-page {
    /* Why: 記事・固定ページエリアに枠・背景・影を設けず、ページ背景と一体化させてクリーンな読書体験を提供します */
    background: transparent;
    border-radius: 0;
    /* Why: 左右paddingは0にして本文幅を最大化します。縦方向のみ余白を確保します */
    padding: var(--am-article-padding, 2rem 0);
    box-shadow: none;
    border: none;
    margin-bottom: 4rem;
}


@media (max-width: 1024px) {
    .am-single-container {
        grid-template-columns: 1fr;
    }
}

.am-entry-header { margin-bottom: 2.5rem; text-align: center; }
.am-entry-title { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 1rem; color: var(--am-text-primary); }

.am-entry-meta { display: flex; align-items: center; justify-content: center; gap: 1rem; color: var(--am-text-secondary); font-size: 0.95rem; margin-bottom: 1rem; }
.am-cat-badge { background: var(--am-bg); color: var(--am-primary); padding: 0.25rem 0.75rem; border-radius: 999px; font-weight: 600; font-size: 0.85rem; }

.am-product-meta { display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 1.1rem; }
.am-rating { color: #f59e0b; font-weight: 700; }
.am-review-count { color: var(--am-text-muted); font-size: 0.9rem; }

.am-post-thumbnail { border-radius: var(--am-radius-md); overflow: hidden; margin-bottom: 3rem; box-shadow: var(--am-shadow-md); }
.am-post-thumbnail img { width: 100%; height: auto; display: block; object-fit: cover; aspect-ratio: 16/9; }

/* フルブリード・アイキャッチ画像（記事ページ用）
   Why: 記事タイトルの下に画面横幅いっぱいで迫力のあるビジュアルを表示するため、
        ヘッダー直後・コンテナ外に配置し、ビューポート全体を使います。
        margin-top に負値を入れることでヘッダーと隙間なく接続します。 */
.am-hero-thumbnail {
    width: 100%;
    overflow: hidden;
    max-height: 520px;
    background: var(--am-bg-alt);
}
.am-hero-thumbnail img {
    width: 100%;
    height: 100%;
    max-height: 520px;
    object-fit: cover;
    display: block;
    /* Why: 読み込み直後に上から流れ込むような演出で視覚的インパクトを与えます */
    animation: am-hero-reveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes am-hero-reveal {
    from { opacity: 0; transform: scale(1.04); }
    to   { opacity: 1; transform: scale(1); }
}
@media (max-width: 768px) {
    .am-hero-thumbnail { max-height: 240px; }
    .am-hero-thumbnail img { max-height: 240px; }
}


/* --- Content Typography (Skin Responsive) --- */

body:not(.am-disable-heading-fonts) .am-entry-content h2 {
  font-weight: 800;
  margin: 4rem 0 1.5rem;
  padding: 0.5rem 0;
  color: var(--am-text-primary);
  line-height: 1.3;
}

body:not(.am-disable-heading-fonts) .am-entry-content h3 {
  font-weight: 700;
  margin: 2.5rem 0 1.25rem;
  color: var(--am-text-primary);
}

body:not(.am-disable-heading-fonts) .am-entry-content h4 {
  font-weight: 700;
  margin: 2rem 0 1rem;
  color: var(--am-text-secondary);
}

/* --- H2 Style Variants (10 Types) --- */

/* --- Heading Style Variants (H2-H6 / 20 Types) --- */

/* 1. Left Border */
.am-h2-style-left-border .am-entry-content h2, .am-h3-style-left-border .am-entry-content h3,
.am-h4-style-left-border .am-entry-content h4, .am-h5-style-left-border .am-entry-content h5,
.am-h6-style-left-border .am-entry-content h6 {
  padding: 0.5rem 1.25rem;
  border-left: 6px solid var(--am-primary);
  background: transparent;
}

/* 2. Bottom Border */
.am-h2-style-bottom-border .am-entry-content h2, .am-h3-style-bottom-border .am-entry-content h3,
.am-h4-style-bottom-border .am-entry-content h4, .am-h5-style-bottom-border .am-entry-content h5,
.am-h6-style-bottom-border .am-entry-content h6 {
  padding-bottom: 0.8rem;
  border-bottom: 3px solid var(--am-primary);
}

/* 3. Bubble */
.am-h2-style-bubble .am-entry-content h2, .am-h3-style-bubble .am-entry-content h3,
.am-h4-style-bubble .am-entry-content h4, .am-h5-style-bubble .am-entry-content h5,
.am-h6-style-bubble .am-entry-content h6 {
  background: var(--am-bg-alt);
  color: var(--am-primary);
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--am-primary);
  display: inline-block;
}

/* 4. Stripe BG */
.am-h2-style-stripe-bg .am-entry-content h2, .am-h3-style-stripe-bg .am-entry-content h3,
.am-h4-style-stripe-bg .am-entry-content h4, .am-h5-style-stripe-bg .am-entry-content h5,
.am-h6-style-stripe-bg .am-entry-content h6 {
  background: repeating-linear-gradient(45deg, var(--am-bg-alt), var(--am-bg-alt) 10px, #ffffff 10px, #ffffff 20px);
  padding: 1rem;
  border-left: 8px solid var(--am-primary);
  border-radius: 4px;
}

/* 5. Underline Accent */
.am-h2-style-underline-accent .am-entry-content h2, .am-h3-style-underline-accent .am-entry-content h3,
.am-h4-style-underline-accent .am-entry-content h4, .am-h5-style-underline-accent .am-entry-content h5,
.am-h6-style-underline-accent .am-entry-content h6 {
  position: relative;
  padding-bottom: 1rem;
}
.am-h2-style-underline-accent .am-entry-content h2::after, .am-h3-style-underline-accent .am-entry-content h3::after,
.am-h4-style-underline-accent .am-entry-content h4::after, .am-h5-style-underline-accent .am-entry-content h5::after,
.am-h6-style-underline-accent .am-entry-content h6::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--am-primary);
  border-radius: 10px;
}

/* 6. Simple Line */
.am-h2-style-simple-line .am-entry-content h2, .am-h3-style-simple-line .am-entry-content h3,
.am-h4-style-simple-line .am-entry-content h4, .am-h5-style-simple-line .am-entry-content h5,
.am-h6-style-simple-line .am-entry-content h6 {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--am-border);
}

/* 7. Fill BG */
.am-h2-style-fill-bg .am-entry-content h2, .am-h3-style-fill-bg .am-entry-content h3,
.am-h4-style-fill-bg .am-entry-content h4, .am-h5-style-fill-bg .am-entry-content h5,
.am-h6-style-fill-bg .am-entry-content h6 {
  background: var(--am-primary);
  color: #fff;
  padding: 0.8rem 1.25rem;
  border-radius: var(--am-radius-md);
}

/* 8. Glass Accent */
.am-h2-style-glass-accent .am-entry-content h2, .am-h3-style-glass-accent .am-entry-content h3,
.am-h4-style-glass-accent .am-entry-content h4, .am-h5-style-glass-accent .am-entry-content h5,
.am-h6-style-glass-accent .am-entry-content h6 {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  padding: 0.8rem 1.25rem;
  border-radius: var(--am-radius-md);
  border: 1px solid var(--am-border);
  color: var(--am-primary);
}

/* 9. Double Border */
.am-h2-style-double-border .am-entry-content h2, .am-h3-style-double-border .am-entry-content h3,
.am-h4-style-double-border .am-entry-content h4, .am-h5-style-double-border .am-entry-content h5,
.am-h6-style-double-border .am-entry-content h6 {
  border-top: 2px solid var(--am-primary);
  border-bottom: 2px solid var(--am-primary);
  padding: 0.8rem 0;
}

/* 10. Gradient Underline */
.am-h2-style-gradient-underline .am-entry-content h2, .am-h3-style-gradient-underline .am-entry-content h3,
.am-h4-style-gradient-underline .am-entry-content h4, .am-h5-style-gradient-underline .am-entry-content h5,
.am-h6-style-gradient-underline .am-entry-content h6 {
  position: relative;
  padding-bottom: 0.8rem;
}
.am-h2-style-gradient-underline .am-entry-content h2::after, .am-h3-style-gradient-underline .am-entry-content h3::after,
.am-h4-style-gradient-underline .am-entry-content h4::after, .am-h5-style-gradient-underline .am-entry-content h5::after,
.am-h6-style-gradient-underline .am-entry-content h6::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--am-grad-primary);
}

/* 11. Stitched */
.am-h2-style-stitched .am-entry-content h2, .am-h3-style-stitched .am-entry-content h3,
.am-h4-style-stitched .am-entry-content h4, .am-h5-style-stitched .am-entry-content h5,
.am-h6-style-stitched .am-entry-content h6 {
  background: var(--am-primary);
  color: #fff;
  padding: 0.8rem 1.25rem;
  border-radius: 4px;
  box-shadow: 0 0 0 4px var(--am-primary);
  border: 1px dashed #fff;
  margin: 10px;
}

/* 12. Ribbon */
.am-h2-style-ribbon .am-entry-content h2, .am-h3-style-ribbon .am-entry-content h3,
.am-h4-style-ribbon .am-entry-content h4, .am-h5-style-ribbon .am-entry-content h5,
.am-h6-style-ribbon .am-entry-content h6 {
  position: relative;
  padding: 0.5rem 1rem;
  background: var(--am-primary);
  color: #fff;
  margin-left: -10px;
}
.am-h2-style-ribbon .am-entry-content h2::before, .am-h3-style-ribbon .am-entry-content h3::before,
.am-h4-style-ribbon .am-entry-content h4::before, .am-h5-style-ribbon .am-entry-content h5::before,
.am-h6-style-ribbon .am-entry-content h6::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  border: none;
  border-bottom: solid 10px transparent;
  border-right: solid 10px var(--am-primary-dark, #000);
  opacity: 0.5;
}

/* 13. Marker */
.am-h2-style-marker .am-entry-content h2, .am-h3-style-marker .am-entry-content h3,
.am-h4-style-marker .am-entry-content h4, .am-h5-style-marker .am-entry-content h5,
.am-h6-style-marker .am-entry-content h6 {
  background: linear-gradient(transparent 60%, var(--am-primary) 60%);
  opacity: 0.8;
  display: inline;
  padding: 0 0.5rem;
}

/* 14. Two-tone Line */
.am-h2-style-two-tone-line .am-entry-content h2, .am-h3-style-two-tone-line .am-entry-content h3,
.am-h4-style-two-tone-line .am-entry-content h4, .am-h5-style-two-tone-line .am-entry-content h5,
.am-h6-style-two-tone-line .am-entry-content h6 {
  border-bottom: solid 3px var(--am-border);
  position: relative;
  padding-bottom: 0.5rem;
}
.am-h2-style-two-tone-line .am-entry-content h2::after, .am-h3-style-two-tone-line .am-entry-content h3::after,
.am-h4-style-two-tone-line .am-entry-content h4::after, .am-h5-style-two-tone-line .am-entry-content h5::after,
.am-h6-style-two-tone-line .am-entry-content h6::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 25%;
  border-bottom: solid 3px var(--am-primary);
}

/* 15. Bracket */
.am-h2-style-bracket .am-entry-content h2, .am-h3-style-bracket .am-entry-content h3,
.am-h4-style-bracket .am-entry-content h4, .am-h5-style-bracket .am-entry-content h5,
.am-h6-style-bracket .am-entry-content h6 {
  display: inline-block;
  padding: 0 1rem;
  position: relative;
}
.am-h2-style-bracket .am-entry-content h2::before, .am-h3-style-bracket .am-entry-content h3::before,
.am-h4-style-bracket .am-entry-content h4::before, .am-h5-style-bracket .am-entry-content h5::before,
.am-h6-style-bracket .am-entry-content h6::before {
  content: '[';
  color: var(--am-primary);
  margin-right: 0.5rem;
  font-weight: 800;
}
.am-h2-style-bracket .am-entry-content h2::after, .am-h3-style-bracket .am-entry-content h3::after,
.am-h4-style-bracket .am-entry-content h4::after, .am-h5-style-bracket .am-entry-content h5::after,
.am-h6-style-bracket .am-entry-content h6::after {
  content: ']';
  color: var(--am-primary);
  margin-left: 0.5rem;
  font-weight: 800;
}

/* 16. Quote Style */
.am-h2-style-quote .am-entry-content h2, .am-h3-style-quote .am-entry-content h3,
.am-h4-style-quote .am-entry-content h4, .am-h5-style-quote .am-entry-content h5,
.am-h6-style-quote .am-entry-content h6 {
  position: relative;
  padding: 1rem 2rem;
  color: var(--am-text-primary);
}
.am-h2-style-quote .am-entry-content h2::before, .am-h3-style-quote .am-entry-content h3::before,
.am-h4-style-quote .am-entry-content h4::before, .am-h5-style-quote .am-entry-content h5::before,
.am-h6-style-quote .am-entry-content h6::before {
  content: '“';
  position: absolute;
  top: 0;
  left: 0;
  font-size: 3rem;
  color: var(--am-primary);
  opacity: 0.2;
  font-family: serif;
}

/* --- Pagination Styles --- */
/* Why: ページネーション（ページナビ）が味気ないデフォルトのテキスト表示から、中央揃えの美しく直感的な丸みを帯びたボタン風UIになるようリデザインします。
   環境依存によってテーマ独自のクラス名（.am-pagination）が反映されない場合や、HTML圧縮プラグイン等によってクラス文字列が `am-paginationam-fade-in-up` に結合されて出力される場合を想定し、複数の代表的セレクターを網羅します。 */
.am-pagination,
.pagination,
.navigation.pagination,
.am-paginationam-fade-in-up,
.navigation.am-pagination,
.navigation.am-paginationam-fade-in-up {
  display: flex;
  justify-content: center;
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
}
.am-pagination .nav-links,
.pagination .nav-links,
.navigation.pagination .nav-links,
.am-paginationam-fade-in-up .nav-links,
.navigation.am-pagination .nav-links,
.navigation.am-paginationam-fade-in-up .nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.am-pagination .page-numbers,
.pagination .page-numbers,
.navigation.pagination .page-numbers,
.am-paginationam-fade-in-up .page-numbers,
.navigation.am-pagination .page-numbers,
.navigation.am-paginationam-fade-in-up .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--am-radius-sm, 10px);
  font-family: var(--am-font-display, sans-serif);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: var(--am-border-width, 1px) solid var(--am-border);
  background-color: var(--am-surface);
  color: var(--am-text-secondary);
  transition: all var(--am-transition-base, 0.3s);
  box-shadow: var(--am-shadow-sm);
  cursor: pointer;
}
/* 通常のリンク付きページ番号のホバー動作 */
.am-pagination a.page-numbers:hover,
.pagination a.page-numbers:hover,
.navigation.pagination a.page-numbers:hover,
.am-paginationam-fade-in-up a.page-numbers:hover,
.navigation.am-pagination a.page-numbers:hover,
.navigation.am-paginationam-fade-in-up a.page-numbers:hover {
  border-color: var(--am-primary);
  color: var(--am-primary);
  background-color: var(--am-surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--am-shadow-md);
}
/* アクティブ（現在選択されている）ページ番号 */
.am-pagination .page-numbers.current,
.pagination .page-numbers.current,
.navigation.pagination .page-numbers.current,
.am-paginationam-fade-in-up .page-numbers.current,
.navigation.am-pagination .page-numbers.current,
.navigation.am-paginationam-fade-in-up .page-numbers.current {
  background: var(--am-grad-primary);
  color: #ffffff;
  border-color: transparent;
  box-shadow: none;
}
/* ドットの区切り記号（...） */
.am-pagination span.page-numbers.dots,
.pagination span.page-numbers.dots,
.navigation.pagination span.page-numbers.dots,
.am-paginationam-fade-in-up span.page-numbers.dots,
.navigation.am-pagination span.page-numbers.dots,
.navigation.am-paginationam-fade-in-up span.page-numbers.dots {
  background-color: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--am-text-muted);
  cursor: default;
}

/* 17. Paper Roll */
.am-h2-style-paper-roll .am-entry-content h2, .am-h3-style-paper-roll .am-entry-content h3,
.am-h4-style-paper-roll .am-entry-content h4, .am-h5-style-paper-roll .am-entry-content h5,
.am-h6-style-paper-roll .am-entry-content h6 {
  position: relative;
  background: var(--am-bg-alt);
  padding: 0.8rem 1.25rem;
  border-left: 5px solid var(--am-primary);
}
.am-h2-style-paper-roll .am-entry-content h2::after, .am-h3-style-paper-roll .am-entry-content h3::after,
.am-h4-style-paper-roll .am-entry-content h4::after, .am-h5-style-paper-roll .am-entry-content h5::after,
.am-h6-style-paper-roll .am-entry-content h6::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  border-width: 0 15px 15px 0;
  border-style: solid;
  border-color: #fff #fff var(--am-primary) var(--am-primary);
  opacity: 0.3;
  box-shadow: -1px 1px 2px rgba(0,0,0,0.1);
}

/* 18. Check Mark */
.am-h2-style-check-mark .am-entry-content h2, .am-h3-style-check-mark .am-entry-content h3,
.am-h4-style-check-mark .am-entry-content h4, .am-h5-style-check-mark .am-entry-content h5,
.am-h6-style-check-mark .am-entry-content h6 {
  position: relative;
  padding-left: 2rem;
}
.am-h2-style-check-mark .am-entry-content h2::before, .am-h3-style-check-mark .am-entry-content h3::before,
.am-h4-style-check-mark .am-entry-content h4::before, .am-h5-style-check-mark .am-entry-content h5::before,
.am-h6-style-check-mark .am-entry-content h6::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--am-primary);
  font-weight: 900;
}

/* 19. Dotted Bracket */
.am-h2-style-dotted-bracket .am-entry-content h2, .am-h3-style-dotted-bracket .am-entry-content h3,
.am-h4-style-dotted-bracket .am-entry-content h4, .am-h5-style-dotted-bracket .am-entry-content h5,
.am-h6-style-dotted-bracket .am-entry-content h6 {
  padding: 0.5rem 1rem;
  border: 1px dotted var(--am-primary);
  border-left: 8px solid var(--am-primary);
  background: var(--am-bg-alt);
}

/* 20. Overlap Circle */
.am-h2-style-overlap-circle .am-entry-content h2, .am-h3-style-overlap-circle .am-entry-content h3,
.am-h4-style-overlap-circle .am-entry-content h4, .am-h5-style-overlap-circle .am-entry-content h5,
.am-h6-style-overlap-circle .am-entry-content h6 {
  position: relative;
  padding-left: 1rem;
  z-index: 1;
}
.am-h2-style-overlap-circle .am-entry-content h2::before, .am-h3-style-overlap-circle .am-entry-content h3::before,
.am-h4-style-overlap-circle .am-entry-content h4::before, .am-h5-style-overlap-circle .am-entry-content h5::before,
.am-h6-style-overlap-circle .am-entry-content h6::before {
  content: "";
  position: absolute;
  background: var(--am-primary);
  width: 35px;
  height: 35px;
  border-radius: 50%;
  top: 50%;
  left: -10px;
  transform: translateY(-50%);
  z-index: -1;
  opacity: 0.15;
}

/* 10. Simple Line (Minimal) - Nordicと共用 */

/* Product Actions inside Single */
.am-product-quick-info { margin-bottom: 2.5rem; text-align: center; }
.am-product-quick-info .am-price { font-size: 1.5rem; margin-bottom: 1.5rem; }
.am-product-quick-info .am-price strong { font-size: 2rem; color: var(--am-text-main); }
.am-cta-wrapper { display: flex; flex-direction: column; gap: 0.75rem; max-width: 400px; margin: 0 auto; }
.am-cta-wrapper .am-btn { width: 100%; border-radius: var(--am-radius-button); font-weight: 700; text-decoration: none; padding: 1rem; transition: var(--am-transition-spring); }
.am-cta-wrapper .am-btn-large { font-size: 1.2rem; padding: 1.25rem; background: var(--am-grad-primary); color: #fff; box-shadow: var(--am-shadow-main); border: none; }
.am-cta-wrapper .am-btn-large:hover { transform: translateY(-3px) scale(1.02); box-shadow: var(--am-shadow-hover); }
.am-cta-wrapper .am-btn-secondary { background: #f1f5f9; color: #334155; }
.am-cta-wrapper .am-btn-secondary:hover { background: #e2e8f0; transform: translateY(-2px); }

/* --- Archive / Grid Styles --- */
/* Why: アーカイブ見出し全体の余白を個別記事（2.5rem）と揃え、余計な余白感を解消します */
.am-page-header { text-align: center; margin-bottom: 2.5rem; }
/* Why: カテゴリータイトル等が大きすぎる問題を解決するため、PCでは 2rem、スマホ等モバイル（768px以下）では 1.5rem に縮小し上品な佇まいにします */
.am-page-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; transition: font-size var(--am-transition-fast); }
@media (max-width: 768px) {
  .am-page-title { font-size: 1.5rem; }
}
/* Why: 見出しの縮小に合わせて説明文のサイズ・行高を整え、文字の主張を抑えて調和させます */
.am-archive-description { color: #64748b; font-size: var(--am-text-base, 1rem); max-width: 600px; margin: 0.75rem auto 0; line-height: 1.6; }



/* Why: 投稿カード（タイル）同士の余白（ギャップ）とカードの最小横幅を設定した共通の設定値（am-card-gap, am-card-min-width）で動的に制御できるように適用します。 */
.am-post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--am-card-min-width, 320px), 1fr)); gap: var(--am-card-gap, 2.5rem); padding: 1rem 0; }

.am-card-article { background: var(--am-surface); border-radius: var(--am-radius-md); overflow: hidden; box-shadow: var(--am-shadow-sm); border: 1px solid var(--am-border); display: flex; flex-direction: column; height: 100%; transition: var(--am-transition-base); /* Why: モバイル実機でのタッチスワイプ時に要素が左右へ横揺れ・バウンスするバグを防止するための設定 */ touch-action: pan-y; isolation: isolate; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.am-card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }

.am-card-thumbnail { position: relative; width: 100%; padding-top: 52%; overflow: hidden; background: #f8fafc; }
.am-card-thumbnail img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; /* Why: iOS/Safariなどのブラウザが画像を誤ってドラッグ移動の対象として認識し、横揺れを引き起こすのを完全に防止する */ user-drag: none; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.am-card-article:hover .am-card-thumbnail img { transform: scale(1.03); }

.am-card-price-badge { position: absolute; bottom: 1rem; right: 1rem; background: rgba(0, 0, 0, 0.7); color: #fff; padding: 0.4rem 0.8rem; border-radius: 999px; font-weight: 700; font-size: 0.9rem; backdrop-filter: blur(4px); }

.am-card-content { padding: 1.5rem; display: flex; flex-direction: column; flex-grow: 1; }
/* カテゴリーバッジ of テキストカラーおよび枠線には管理画面のアクセントカラー（--am-accent）を連動させます */
/* Why: カテゴリーバッジのカラーをアクセントカラーに連動させます。文字数が長くても省略せず全文を表示するため、max-width・text-overflow・white-space の制限を設けません。 */
.am-card-cat { display: inline-block; color: var(--am-accent); border: 1.5px solid var(--am-accent); padding: 3px 10px; border-radius: var(--am-radius-sm, 6px); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; background: transparent; line-height: 1.2; white-space: normal; word-break: break-word; vertical-align: bottom; }
/* 投稿カード内のタグ表示。カテゴリバッジの下に配置し、少し控えめなニュアンスカラーを適用します */
/* Why: タグはカテゴリバッジの下の行に配置するため display: block のコンテナ内で inline-block とし、省略処理も設けません。 */
.am-card-tag { display: inline-block; color: var(--am-text-secondary); font-size: 0.68rem; font-weight: 500; letter-spacing: 0.02em; line-height: 1.2; white-space: normal; word-break: break-word; vertical-align: bottom; }
/* タグ行ラッパー: カテゴリバッジの下に配置するための行コンテナ */
.am-card-tags-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
/* 個別記事タイトル下のタグ表示。省略せずにすべて表示させます */
/* Why: 記事ページでは十分な表示領域があるため、カード用タグと異なり最大幅制限（max-width）や省略処理（text-overflow: ellipsis）を無効化します。 */
.am-post-tag { display: inline-block; color: var(--am-text-secondary); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.02em; line-height: 1.2; vertical-align: bottom; }
.am-card-title { font-size: 1.25rem; font-weight: 700; line-height: 1.4; margin: 0 0 1rem 0; color: var(--am-text-main); }
.am-card-excerpt { color: #64748b; font-size: 0.95rem; line-height: 1.6; flex-grow: 1; margin-bottom: 1.5rem; }

.am-card-footer { display: flex; justify-content: space-between; align-items: center; pt-top: 1rem; border-top: 1px solid var(--am-border); padding-top: 1rem; }
.am-btn-text { color: var(--am-primary); font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; transition: var(--am-transition-smooth); }
.am-card-article:hover .am-btn-text { color: var(--am-primary-hover); gap: 4px; }
.am-card-date { color: #94a3b8; font-size: 0.85rem; }

/* --- Sidebar & Widget Styles --- */

.am-sidebar {
  padding: 2rem 0;
}

/* WordPress標準の .widget クラスも包含 */
.am-widget, .widget {
  background: var(--am-surface);
  border-radius: var(--am-radius-md);
  padding: 2rem;
  margin-bottom: 2.5rem;
  border: 1px solid var(--am-border);
  box-shadow: var(--am-shadow-md);
  transition: all 0.4s var(--am-transition-smooth);
  list-style: none;
}

.am-widget:hover, .widget:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* ウィジェット内のタイトル装飾 */
.am-widget__title, .widget-title, .widget h2 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--am-primary);
  color: var(--am-text-primary);
  position: relative;
}

.am-widget__title::after, .widget-title::after, .widget h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--am-accent);
}

/* ウィジェット内のリスト装飾 */
.am-widget ul, .widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.am-widget li, .widget li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--am-border);
  color: var(--am-text-secondary);
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.am-widget li:last-child, .widget li:last-child {
  border-bottom: none;
}

.am-widget a, .widget a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.am-widget a:hover, .widget a:hover {
  color: var(--am-primary);
  padding-left: 5px;
}

/* --- Sidebar Style Variants --- */

/* 1. Card (Standard/Forest/Sunset) */
.am-sidebar-style-card .am-widget {
  /* Default handled above */
}

/* 2. Clean (Ocean) */
.am-sidebar-style-clean .am-widget {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--am-border);
  border-radius: 0;
  box-shadow: none;
  padding: 1.5rem 0;
}

/* 3. Soft Card (Sakura) */
.am-sidebar-style-soft-card .am-widget {
  border-radius: 40px;
  border: none;
  box-shadow: 0 15px 40px rgba(0,0,0,0.04);
}

/* 4. Glass (Lavender/Glass) */
.am-sidebar-style-glass .am-widget {
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

/* 5. Minimal (Nordic/Minimal) */
.am-sidebar-style-minimal .am-widget {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 1rem 0;
}
.am-sidebar-style-minimal .am-widget__title {
  border-bottom: 1px solid var(--am-text-primary);
}

/* 6. Retro Box (Retro) */
.am-sidebar-style-retro-box .am-widget {
  background: #fff;
  border: 3px solid var(--am-text-primary);
  box-shadow: 10px 10px 0px var(--am-primary);
  border-radius: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .am-single-article { padding: var(--am-article-padding, 2rem 0); border-radius: 0; }
    .am-entry-title { font-size: 2rem; }
    .am-post-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   AffiliMax Premium Blocks (Phase 3)
   ========================================================================== */

/* 1. AIエキスパート・吹き出し (Expert Voice) */
.am-expert-bubble {
    display: flex;
    gap: 20px;
    margin-bottom: 2.5rem;
    align-items: flex-start;
}

.am-expert-bubble__avatar {
    flex-shrink: 0;
    width: 64px;
    text-align: center;
}

.am-expert-bubble__avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin-bottom: 8px;
    border: 2px solid var(--am-primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.am-expert-bubble__name {
    font-size: 11px;
    font-weight: 700;
    color: var(--am-text-secondary);
    line-height: 1.2;
}

.am-expert-bubble__content {
    position: relative;
    background: var(--am-surface);
    border: 1px solid var(--am-border);
    padding: 1.5rem;
    border-radius: 18px;
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--am-text-primary);
    box-shadow: var(--am-shadow-sm);
}

/* 吹き出しの三角部分 */
.am-expert-bubble__content::before {
    content: "";
    position: absolute;
    top: 20px;
    left: -8px;
    width: 16px;
    height: 16px;
    background: var(--am-surface);
    border-left: 1px solid var(--am-border);
    border-bottom: 1px solid var(--am-border);
    transform: rotate(45deg);
}

.am-expert-bubble--ai .am-expert-bubble__content {
    background: linear-gradient(135deg, var(--am-bg) 0%, var(--am-surface) 100%);
    border-color: var(--am-primary);
}

/* 2. 商品CTAパネル (Conversion Panel) */
.am-cta-panel {
    background: var(--am-surface);
    border: 2px solid var(--am-primary);
    border-radius: var(--am-radius-large);
    padding: 2rem;
    margin: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--am-shadow-lg);
}

.am-cta-panel::before {
    content: "SPECIAL OFFER";
    position: absolute;
    top: 10px;
    left: -35px;
    background: var(--am-primary);
    color: #fff;
    padding: 4px 40px;
    font-size: 10px;
    font-weight: 800;
    transform: rotate(-45deg);
}

.am-cta-panel__title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--am-text-primary);
}

.am-cta-panel__price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--am-primary);
    margin-bottom: 1.5rem;
}

.am-cta-panel__price span {
    font-size: 1rem;
    color: var(--am-text-muted);
    font-weight: 400;
    margin-left: 4px;
}

.am-cta-panel .am-btn {
    width: 100%;
    max-width: 300px;
    padding: 1.25rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .am-expert-bubble { gap: 12px; }
    .am-expert-bubble__avatar { width: 48px; }
    .am-expert-bubble__avatar img { width: 48px; height: 48px; }
    .am-cta-panel { padding: 1.5rem; }
}

/* 3. スマート比較表 (Smart Comparison Table) */
.am-comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 3rem 0;
    border-radius: var(--am-radius-lg);
    overflow: hidden;
    border: 1px solid var(--am-border);
    background: var(--am-surface);
}

.am-comparison-table th, 
.am-comparison-table td {
    padding: 1.25rem;
    text-align: center;
    border-bottom: 1px solid var(--am-border);
    border-right: 1px solid var(--am-border);
}

.am-comparison-table th:last-child, 
.am-comparison-table td:last-child {
    border-right: none;
}

.am-comparison-table thead th {
    background: var(--am-bg-alt);
    font-weight: 700;
    color: var(--am-text-primary);
}

.am-comparison-table tr:last-child td {
    border-bottom: none;
}

.am-comparison-table__recommend {
    background: var(--am-bg-alt) !important;
    position: relative;
}

.am-comparison-table__recommend::after {
    content: "RECOMMEND";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--am-primary);
    color: #fff;
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 0 0 4px 4px;
    font-weight: 800;
}

/* 4. スマート・プロセス (Success Steps) */
.am-steps {
    list-style: none;
    padding: 0;
    margin: 3rem 0;
}

.am-step-item {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
    position: relative;
    padding-bottom: 2rem;
}

.am-step-item:last-child {
    padding-bottom: 0;
}

.am-step-item:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 40px;
    left: 20px;
    width: 2px;
    height: calc(100% - 40px);
    background: var(--am-border);
}

.am-step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--am-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.am-step-content {
    padding-top: 6px;
}

.am-step-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--am-text-primary);
}

@media (max-width: 768px) {
    /* モバイル比較表をカード形式にトランスフォーム */
    .am-comparison-table, 
    .am-comparison-table thead, 
    .am-comparison-table tbody, 
    .am-comparison-table th, 
    .am-comparison-table td, 
    .am-comparison-table tr {
        display: block;
    }
    
    .am-comparison-table thead {
        display: none;
    }
    
    .am-comparison-table tr {
        border-bottom: 2px solid var(--am-primary);
        margin-bottom: 2rem;
        padding: 1rem;
    }
    
    .am-comparison-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border: none;
        border-bottom: 1px solid var(--am-border);
        text-align: right;
        padding: 0.75rem 0;
    }
    
    .am-comparison-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--am-text-secondary);
        text-align: left;
    }
}

/* =============================================================================
   スキン別 構造変更CSS v2
   全10スキンの骨格をCSSだけで根本から変える
   ============================================================================= */

/* ── OCEAN: ビジネス・プロ ──
   2段ヘッダー / カード左ボーダー / フッター中央 / 角丸ゼロ */
.am-skin-ocean .am-header { border-bottom:3px solid var(--am-primary); box-shadow:none; backdrop-filter:none; height:auto; padding:0; }
.am-skin-ocean .am-header__inner { flex-wrap:wrap; justify-content:center; padding:0 var(--am-gap-xl); }
.am-skin-ocean .am-header__logo { width:100%; text-align:center; padding:0.75rem 0 0.5rem; font-size:1.8rem; font-weight:900; letter-spacing:-0.03em; background:none; -webkit-text-fill-color:var(--am-primary); border-bottom:1px solid var(--am-border); }
.am-skin-ocean .am-nav { width:100%; justify-content:center; padding:0.5rem 0; gap:var(--am-gap-2xl); }
.am-skin-ocean .am-nav li a { font-weight:700; text-transform:uppercase; font-size:0.78rem; letter-spacing:0.08em; padding:0.3rem 0; border-bottom:2px solid transparent; }
.am-skin-ocean .am-nav li a:hover { border-bottom-color:var(--am-primary); }
.am-skin-ocean .am-card { border-radius:0; border:1px solid var(--am-border); border-left:5px solid var(--am-primary); box-shadow:0 1px 3px rgba(0,0,0,0.06); }
.am-skin-ocean .am-card:hover { border-left-color:var(--am-accent); box-shadow:0 4px 12px rgba(0,0,0,0.1); transform:none; }
.am-skin-ocean .am-card img { border-radius:0; }
/* Why: oceanスキンのam-single-articleはベースの枠なし設定を継承させます */
.am-skin-ocean .am-single-article { border-radius:0; border:none; box-shadow:none; background:transparent; }
.am-skin-ocean .am-entry-title { text-align:left; }
.am-skin-ocean .am-entry-header { text-align:left; }
.am-skin-ocean .am-footer { border-top:3px solid var(--am-primary); }
.am-skin-ocean .am-footer__inner { grid-template-columns:1fr 1fr 1fr; text-align:left; }
.am-skin-ocean .am-btn--primary,.am-skin-ocean .am-btn { border-radius:4px; }
.am-skin-ocean .am-badge--primary { border-radius:2px; }

/* ── SAKURA: ふわふわ ──
   浮遊ピルヘッダー / 枠なし丸カード / 微回転ホバー / 上丸フッター */
.am-skin-sakura .am-header { margin:1rem 1.5rem 0; border-radius:999px; border:none; box-shadow:0 8px 30px rgba(236,72,153,0.1); height:auto; padding:0.4rem 1rem; }
.am-skin-sakura .am-header__inner { justify-content:center; gap:var(--am-gap-xl); }
.am-skin-sakura .am-header__logo { font-size:1.3rem; font-weight:700; background:none; -webkit-text-fill-color:var(--am-primary); }
.am-skin-sakura .am-nav li a { font-size:0.85rem; font-weight:600; background:rgba(236,72,153,0.06); padding:0.3rem 0.8rem; border-radius:999px; }
.am-skin-sakura .am-nav li a:hover { background:rgba(236,72,153,0.15); }
.am-skin-sakura .am-card { border:none; border-radius:32px; box-shadow:0 8px 25px rgba(236,72,153,0.08); }
.am-skin-sakura .am-card:hover { box-shadow:0 16px 40px rgba(236,72,153,0.16); transform:translateY(-6px) rotate(-1deg); }
.am-skin-sakura .am-card img { border-radius:24px; margin:0.5rem; }
/* Why: sakuraスキンのam-single-articleはベースの枠なし設定を継承させます */
.am-skin-sakura .am-single-article { border-radius:0; border:none; box-shadow:none; background:transparent; padding:var(--am-article-padding, 2rem 0); }
.am-skin-sakura .am-entry-title { font-size:2rem; }
.am-skin-sakura .am-badge--primary { border-radius:999px; background:rgba(236,72,153,0.12); font-size:0.75rem; }
.am-skin-sakura .am-footer { border-top:none; border-radius:48px 48px 0 0; margin-top:3rem; padding-top:4rem; }
.am-skin-sakura .am-footer__copy { justify-content:center; }
.am-skin-sakura .am-btn--primary { border-radius:999px; box-shadow:0 6px 20px rgba(236,72,153,0.25); font-weight:700; }

/* ── FOREST: ネイチャー ──
   グラデ上ライン / 太左ボーダーカード / 緑グラデフッター / 丸ボタン */
.am-skin-forest .am-header { border-bottom:none; box-shadow:none; position:sticky; }
.am-skin-forest .am-header::before { content:''; position:absolute; top:0; left:0; right:0; height:5px; background:linear-gradient(90deg,#15803d,#4ade80,#a3e635); }
.am-skin-forest .am-header__logo { background:none; -webkit-text-fill-color:#15803d; font-weight:900; font-size:1.5rem; }
.am-skin-forest .am-nav li a { font-weight:700; color:#15803d !important; }
.am-skin-forest .am-card { border-radius:16px; border:2px solid #bbf7d0; border-left:8px solid #15803d; }
.am-skin-forest .am-card:hover { border-color:#15803d; box-shadow:0 8px 0 rgba(21,128,61,0.1); transform:translateY(-3px); }
/* Why: forestスキンのam-single-articleはベースの枠なし設定を継承させます */
.am-skin-forest .am-single-article { border-radius:0; border:none; box-shadow:none; background:transparent; }
.am-skin-forest .am-footer { border-top:8px solid #15803d; background:linear-gradient(180deg,#dcfce7 0%,#f0fdf4 100%) !important; }
.am-skin-forest .am-btn--primary { border-radius:12px; font-weight:800; background:#15803d; border:2px solid #14532d; }

/* ── NORDIC: 極限ミニマル ──
   テキストロゴ大文字 / 影ゼロ枠ゼロ / 1カラム(サイドバーなし) / 広い余白 */
.am-skin-nordic .am-header { height:auto; padding:2.5rem 0; border-bottom:1px solid #e2e8f0; box-shadow:none; backdrop-filter:none; }
.am-skin-nordic .am-header__logo { font-size:0.9rem; font-weight:300; text-transform:uppercase; letter-spacing:0.35em; background:none; -webkit-text-fill-color:#0f172a; }
.am-skin-nordic .am-nav { gap:var(--am-gap-2xl); }
.am-skin-nordic .am-nav li a { font-weight:300; text-transform:uppercase; letter-spacing:0.12em; font-size:0.75rem; color:#64748b !important; }
.am-skin-nordic .am-nav li a:hover { color:#0f172a !important; }
.am-skin-nordic .am-single-container { grid-template-columns:1fr !important; max-width:700px; }
.am-skin-nordic .am-sidebar { display:none !important; }
.am-skin-nordic .am-container.am-single-container { grid-template-columns:1fr !important; max-width:700px; }
.am-skin-nordic .am-container.am-single-container > aside { display:none !important; }
.am-skin-nordic .am-card { border:none; border-radius:0; box-shadow:none; border-bottom:1px solid #e2e8f0; padding:var(--am-gap-2xl) 0; background:transparent; }
.am-skin-nordic .am-card:hover { box-shadow:none; border-color:#0f172a; transform:none; background:transparent; }
.am-skin-nordic .am-card img { border-radius:0; }
.am-skin-nordic .am-single-article { border-radius:0; box-shadow:none; padding:0; background:transparent; border:none; }
.am-skin-nordic .am-entry-title { font-size:2.8rem; font-weight:300; letter-spacing:0.05em; }
.am-skin-nordic .am-footer { border-top:1px solid #e2e8f0; padding:2rem 0; background:#fff !important; }
.am-skin-nordic .am-footer__inner { grid-template-columns:1fr; text-align:center; }
.am-skin-nordic .am-footer__grid { display:none; }
.am-skin-nordic .am-footer__brand { align-items:center; }
.am-skin-nordic .am-btn--primary { border-radius:0; border:1.5px solid #334155; background:transparent; color:#334155; font-weight:400; letter-spacing:0.1em; text-transform:uppercase; font-size:0.8rem; }
.am-skin-nordic .am-btn--primary:hover { background:#334155; color:#fff; }

/* ── CANDY: ポップ・カラフル ──
   グラデーションヘッダー下線 / 2色ボーダーカード / スケールホバー / カラフルバッジ */
.am-skin-candy .am-header { border-bottom:none; box-shadow:0 4px 20px rgba(139,92,246,0.08); }
.am-skin-candy .am-header::after { content:''; position:absolute; bottom:0; left:0; right:0; height:4px; background:linear-gradient(90deg,#8b5cf6,#06b6d4,#ec4899,#f59e0b); }
.am-skin-candy .am-header__logo { background:linear-gradient(135deg,#8b5cf6,#06b6d4); -webkit-background-clip:text; -webkit-text-fill-color:transparent; font-weight:900; }
.am-skin-candy .am-nav li a { font-weight:700; font-size:0.85rem; }
.am-skin-candy .am-card { border-radius:24px; border:2px solid #e9d5ff; box-shadow:0 6px 20px rgba(139,92,246,0.08); position:relative; overflow:hidden; }
.am-skin-candy .am-card::before { content:''; position:absolute; top:0; left:0; right:0; height:4px; background:linear-gradient(90deg,#8b5cf6,#06b6d4); }
.am-skin-candy .am-card:hover { transform:translateY(-6px) scale(1.01); box-shadow:0 16px 40px rgba(139,92,246,0.15); border-color:#c4b5fd; }
/* Why: candyスキンのam-single-articleはベースの枠なし設定を継承させます */
.am-skin-candy .am-single-article { border-radius:0; border:none; box-shadow:none; background:transparent; position:relative; }
/* トップのグラデーション装飾線のみ残します */
.am-skin-candy .am-single-article::before { content:''; position:absolute; top:0; left:0; right:0; height:4px; background:linear-gradient(90deg,#8b5cf6,#06b6d4,#ec4899); }
.am-skin-candy .am-badge--primary { background:linear-gradient(135deg,rgba(139,92,246,0.15),rgba(6,182,212,0.15)); border-radius:999px; font-weight:700; }
.am-skin-candy .am-footer { border-top:none; position:relative; }
.am-skin-candy .am-footer::before { content:''; display:block; height:4px; background:linear-gradient(90deg,#8b5cf6,#06b6d4,#ec4899,#f59e0b); }
.am-skin-candy .am-btn--primary { background:linear-gradient(135deg,#8b5cf6,#06b6d4); border:none; border-radius:999px; box-shadow:0 6px 20px rgba(139,92,246,0.25); font-weight:700; }

/* ── RETRO: ブルータリズム ──
   太黒枠ヘッダー / ハードシャドウカード / 大文字ロゴ / 黄色フッター */
.am-skin-retro .am-header { border:none; border-bottom:5px solid #000; box-shadow:none; backdrop-filter:none; height:auto; padding:0.6rem 0; }
.am-skin-retro .am-header__logo { font-size:2.2rem; font-weight:900; text-transform:uppercase; letter-spacing:-0.03em; background:none; -webkit-text-fill-color:#000; }
.am-skin-retro .am-nav li a { font-weight:900; text-transform:uppercase; font-size:0.8rem; letter-spacing:0.05em; border:3px solid transparent; padding:0.25rem 0.5rem; }
.am-skin-retro .am-nav li a:hover { border-color:#000; background:#facc15; }
.am-skin-retro .am-card { border:4px solid #000; border-radius:0; box-shadow:8px 8px 0 #000; }
.am-skin-retro .am-card:hover { box-shadow:14px 14px 0 #000; transform:translate(-3px,-3px); border-color:#000; }
.am-skin-retro .am-card img { border-radius:0; border-bottom:4px solid #000; }
/* Why: retroスキンのam-single-articleはベースの枠なし設定を継承させます */
.am-skin-retro .am-single-article { border:none; box-shadow:none; border-radius:0; background:transparent; }
.am-skin-retro .am-badge--primary { border:3px solid #000; border-radius:0; background:#facc15; color:#000; font-weight:900; text-transform:uppercase; }
.am-skin-retro .am-footer { border-top:5px solid #000; background:#facc15 !important; color:#000; }
.am-skin-retro .am-footer__logo,.am-skin-retro .am-footer__desc,.am-skin-retro .am-footer-menu a,.am-skin-retro .am-footer__copy,.am-skin-retro .am-footer__copy p { color:#000 !important; }
.am-skin-retro .am-btn--primary { border:4px solid #000; border-radius:0; box-shadow:5px 5px 0 #000; background:#ef4444; color:#fff; font-weight:900; text-transform:uppercase; letter-spacing:0.05em; }
.am-skin-retro .am-btn--primary:hover { box-shadow:8px 8px 0 #000; transform:translate(-2px,-2px); }
.am-skin-retro .am-hamburger span { background:#000; height:3px; }

/* ── SUNSET: グラマー・マガジン ──
   グラデーション装飾 / カード下部グラデライン / リッチな影 / 太い見出し */
.am-skin-sunset .am-header { border-bottom:none; box-shadow:0 4px 20px rgba(225,29,72,0.06); }
.am-skin-sunset .am-header::after { content:''; position:absolute; bottom:0; left:5%; right:5%; height:3px; border-radius:999px; background:linear-gradient(90deg,#e11d48,#f59e0b,#e11d48); }
.am-skin-sunset .am-header__logo { background:linear-gradient(135deg,#e11d48,#f59e0b); -webkit-background-clip:text; -webkit-text-fill-color:transparent; font-weight:900; font-size:1.7rem; }
.am-skin-sunset .am-card { border-radius:20px; border:none; overflow:hidden; position:relative; box-shadow:0 8px 25px rgba(225,29,72,0.06); }
.am-skin-sunset .am-card::after { content:''; position:absolute; bottom:0; left:0; right:0; height:5px; background:linear-gradient(90deg,#e11d48,#f59e0b); }
.am-skin-sunset .am-card:hover { transform:translateY(-8px); box-shadow:0 20px 50px rgba(225,29,72,0.12); }
/* Why: sunsetスキンのam-single-articleはベースの枠なし設定を継承させます */
.am-skin-sunset .am-single-article { border-radius:0; border:none; box-shadow:none; background:transparent; }
.am-skin-sunset .am-entry-title { font-size:2.5rem; font-weight:800; }
.am-skin-sunset .am-footer { border-top:none; }
.am-skin-sunset .am-footer::before { content:''; display:block; height:5px; background:linear-gradient(90deg,#e11d48,#f59e0b,#e11d48); }
.am-skin-sunset .am-btn--primary { background:linear-gradient(135deg,#e11d48,#be123c); border:none; border-radius:12px; box-shadow:0 6px 25px rgba(225,29,72,0.25); font-weight:800; }

/* ── LAVENDER: ドリーミー ──
   半透明ヘッダー / ぼかしカード / 紫グロー / 浮遊感 */
.am-skin-lavender .am-header { background:rgba(255,255,255,0.5) !important; backdrop-filter:blur(24px); border-bottom:1px solid rgba(168,85,247,0.08); box-shadow:0 8px 30px rgba(168,85,247,0.04); }
.am-skin-lavender .am-header__logo { background:linear-gradient(135deg,#a855f7,#ec4899); -webkit-background-clip:text; -webkit-text-fill-color:transparent; font-weight:800; }
.am-skin-lavender .am-card { background:rgba(255,255,255,0.5); backdrop-filter:blur(12px); border:1px solid rgba(168,85,247,0.12); border-radius:28px; }
.am-skin-lavender .am-card:hover { background:rgba(255,255,255,0.75); box-shadow:0 12px 40px rgba(168,85,247,0.12); border-color:rgba(168,85,247,0.25); transform:translateY(-5px); }
/* Why: lavenderスキンのam-single-articleはベースの枠なし設定を継承させます */
.am-skin-lavender .am-single-article { background:transparent; backdrop-filter:none; border:none; border-radius:0; box-shadow:none; }
.am-skin-lavender .am-footer { background:rgba(245,243,255,0.7) !important; backdrop-filter:blur(16px); border-top:1px solid rgba(168,85,247,0.08); }
.am-skin-lavender .am-btn--primary { background:linear-gradient(135deg,#a855f7,#c084fc); border:none; border-radius:999px; box-shadow:0 6px 25px rgba(168,85,247,0.25); }
.am-skin-lavender .am-badge--primary { background:rgba(168,85,247,0.1); border-radius:999px; }

/* ── MINIMAL: エッセンシャル ──
   装飾完全排除 / 1カラム狭幅 / サイドバーなし / タイポ重視 / Medium風 */
.am-skin-minimal .am-header { border-bottom:none; box-shadow:none; backdrop-filter:none; height:auto; padding:2rem 0; }
.am-skin-minimal .am-header__logo { font-size:1.1rem; font-weight:700; letter-spacing:-0.04em; background:none; -webkit-text-fill-color:#171717; }
.am-skin-minimal .am-nav li a { font-weight:400; font-size:0.85rem; color:#525252 !important; }
.am-skin-minimal .am-nav li a:hover { color:#171717 !important; text-decoration:underline; }
.am-skin-minimal .am-single-container { grid-template-columns:1fr !important; max-width:680px; }
.am-skin-minimal .am-sidebar { display:none !important; }
.am-skin-minimal .am-container.am-single-container { grid-template-columns:1fr !important; max-width:680px; }
.am-skin-minimal .am-container.am-single-container > aside { display:none !important; }
.am-skin-minimal .am-card { border:none; border-radius:0; box-shadow:none; padding:var(--am-gap-2xl) 0; border-bottom:1px solid #e5e5e5; background:transparent; }
.am-skin-minimal .am-card:hover { box-shadow:none; transform:none; background:transparent; border-color:#171717; }
.am-skin-minimal .am-card img { border-radius:0; }
.am-skin-minimal .am-single-article { border-radius:0; box-shadow:none; background:transparent; padding:0; border:none; }
.am-skin-minimal .am-entry-title { font-size:3.2rem; font-weight:700; letter-spacing:-0.04em; line-height:1.15; }
.am-skin-minimal .am-entry-header { text-align:left; margin-bottom:3rem; }
.am-skin-minimal .am-entry-meta { justify-content:flex-start; }
.am-skin-minimal .am-footer { border-top:1px solid #e5e5e5; padding:1.5rem 0; background:#fff !important; }
.am-skin-minimal .am-footer__inner { grid-template-columns:1fr; text-align:center; }
.am-skin-minimal .am-footer__grid { display:none; }
.am-skin-minimal .am-footer__copy { justify-content:center; border-top:none; margin-top:0; padding-top:0; }
.am-skin-minimal .am-btn--primary { background:#171717; color:#fff; border-radius:0; border:none; font-weight:600; }
.am-skin-minimal .am-btn--primary:hover { background:#404040; }



/* =============================================================================
   レイアウトバリエーション
   ヘッダー5種 / フッター5種 / モバイルメニュー5種
   スキンとは独立して動作し、色はCSS変数でスキンに追従する
   ============================================================================= */

/* ━━━━ ヘッダー ━━━━ */

/* 1. header-classic: デフォルト（ロゴ左・ナビ右）— 特にCSSなし */

/* 2. header-center: ロゴ中央・ナビ下段 */
.am-header-center .am-header { height:auto; padding:0; }
.am-header-center .am-header__inner { flex-wrap:wrap; justify-content:center; padding:0 var(--am-gap-xl); }
.am-header-center .am-header__logo { width:100%; text-align:center; padding:0.8rem 0 0.4rem; border-bottom:1px solid var(--am-border); }
.am-header-center .am-nav { width:100%; justify-content:center; padding:0.5rem 0; gap:var(--am-gap-xl); }
.am-header-center .am-hamburger { position:absolute; right:var(--am-gap-xl); top:50%; transform:translateY(-50%); }

/* 3. header-split: ナビ左右分割・ロゴ中央 */
.am-header-split .am-header { height:auto; padding:0.8rem 0; }
.am-header-split .am-header__inner { justify-content:center; position:relative; }
.am-header-split .am-header__logo { order:2; margin:0 var(--am-gap-2xl); }
.am-header-split .am-nav { display:flex; }
.am-header-split .am-nav li:nth-child(-n+3) { order:1; }
.am-header-split .am-nav li:nth-child(n+4) { order:3; }

/* 4. header-minimal: ロゴ左・PC時もハンバーガーのみ */
.am-header-minimal .am-nav { display:none !important; }
.am-header-minimal .am-hamburger { display:flex !important; }
.am-header-minimal .am-header { height:auto; padding:0.8rem 0; }

/* 5. header-bar: 横一列フルワイド中央寄せ */
.am-header-bar .am-header { height:auto; padding:0.6rem 0; border-bottom:2px solid var(--am-primary); }
.am-header-bar .am-header__inner { justify-content:center; gap:var(--am-gap-2xl); }
.am-header-bar .am-header__logo { font-size:1.1rem; }
.am-header-bar .am-nav { gap:var(--am-gap-lg); }
.am-header-bar .am-nav li a { font-size:0.82rem; font-weight:600; padding:0.3rem 0.6rem; border-radius:6px; transition:background 0.2s; }
.am-header-bar .am-nav li a:hover { background:var(--am-bg-alt); }

/* ━━━━ フッター ━━━━ */

/* 1. footer-classic: デフォルト — 特にCSSなし */

/* 2. footer-centered: 全要素中央揃え
   Why: ウィジェットの個数が少ない場合でも偏らないようauto-fitカラムに最適化します */
.am-footer-centered .am-footer__inner { grid-template-columns:1fr; text-align:center; }
.am-footer-centered .am-footer__brand { align-items:center; }
.am-footer-centered .am-footer__desc { max-width:none; }
.am-footer-centered .am-footer__grid { grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); justify-content:center; justify-items:center; text-align:center; }
.am-footer-centered .am-footer__copy { justify-content:center; }

/* 3. footer-minimal: コピーライトのみ */
.am-footer-minimal .am-footer__inner { display:none; }
.am-footer-minimal .am-footer { padding:var(--am-gap-lg) 0; }
.am-footer-minimal .am-footer__copy { margin-top:0; padding-top:0; border-top:none; justify-content:center; }

/* 4. footer-columns: 4カラム均等グリッド
   Why: ブランドエリアを1列分、残りのウィジェットエリアを3列スパンさせて等幅に並べます */
.am-footer-columns .am-footer__inner { grid-template-columns:repeat(4,1fr); gap:var(--am-gap-xl); }
.am-footer-columns .am-footer__brand { grid-column:span 1; }
.am-footer-columns .am-footer__grid { grid-column:span 3; grid-template-columns:repeat(3,1fr); gap:var(--am-gap-md); }

/* 5. footer-banner: 大ブランドセクション + 薄いバー */
.am-footer-banner .am-footer__inner { grid-template-columns:1fr; text-align:center; gap:var(--am-gap-xl); }
.am-footer-banner .am-footer__logo { font-size:2rem; }
.am-footer-banner .am-footer__desc { max-width:none; font-size:1rem; }
.am-footer-banner .am-footer__grid { display:none; }
.am-footer-banner .am-footer__copy { background:var(--am-bg-alt); margin:0 calc(-1 * var(--am-gap-xl)); padding:var(--am-gap-md) var(--am-gap-xl); border-top:none; justify-content:center; border-radius:0; }

/* ━━━━ モバイルメニュー ━━━━ */

/* 1. mobile-slide-right: 右からスライド（デフォルト）
   Why: topを0にすることで、ヘッダーが引っ込んだ際やhd-pillスキン時の見切れを完全に解消します。 */
@media (max-width:768px) {
  .am-mobile-slide-right .am-nav-mobile.is-open {
    position:fixed;
    /* Why: インラインバーを8ッダー下配置の場合は --am-secondary-bar-h 分だけ下にズラして開始位置を即時調整します。 */
    top:calc(var(--am-header-h) + var(--am-secondary-bar-h));
    right:0; bottom:0; left:auto;
    width:75%; max-width:320px;
    background:var(--am-bg); padding:var(--am-gap-xl); z-index:99;
    flex-direction:column; gap:var(--am-gap-lg);
    box-shadow:-10px 0 30px rgba(0,0,0,0.1);
    animation:slideFromRight 0.3s ease;
    overflow-y:auto;
  }
  @keyframes slideFromRight { from { transform:translateX(100%); } to { transform:translateX(0); } }
}

/* 2. mobile-slide-left: 左からスライド
   Why: スライド右と同様に、ヘッダーに連動しないようtop:0かつスクロール可能にします。 */
@media (max-width:768px) {
  .am-mobile-slide-left .am-nav-mobile.is-open {
    position:fixed;
    /* Why: インラインバーを8ッダー下配置の場合は --am-secondary-bar-h 分だけ下にズラして開始位置を即時調整します。 */
    top:calc(var(--am-header-h) + var(--am-secondary-bar-h));
    left:0; bottom:0; right:auto;
    width:75%; max-width:320px;
    background:var(--am-bg); padding:var(--am-gap-xl); z-index:99;
    flex-direction:column; gap:var(--am-gap-lg);
    box-shadow:10px 0 30px rgba(0,0,0,0.1);
    animation:slideFromLeft 0.3s ease;
    overflow-y:auto;
  }
  @keyframes slideFromLeft { from { transform:translateX(-100%); } to { transform:translateX(0); } }
}

/* 3. mobile-fullscreen: 全画面オーバーレイ
   Why: z-indexを99にし、ハンバーガーボタン（z-index: 100）が隠れないようにして閉じる操作を維持します。 */
@media (max-width:768px) {
  .am-mobile-fullscreen .am-nav-mobile.is-open {
    position:fixed; inset:0;
    background:var(--am-bg); z-index:99;
    flex-direction:column; justify-content:center; align-items:center;
    gap:var(--am-gap-2xl); padding:calc(var(--am-header-h) + var(--am-gap-xl)) var(--am-gap-2xl) var(--am-gap-2xl);
    animation:fadeInOverlay 0.3s ease;
    overflow-y:auto;
  }
  .am-mobile-fullscreen .am-nav-mobile.is-open li a { font-size:1.5rem; font-weight:700; }
  @keyframes fadeInOverlay { from { opacity:0; } to { opacity:1; } }
}

/* 4. mobile-bottom-sheet: 下からスライド */
@media (max-width:768px) {
  .am-mobile-bottom-sheet .am-nav-mobile.is-open {
    position:fixed; bottom:0; left:0; right:0; top:auto;
    max-height:60vh;
    background:var(--am-bg); z-index:99;
    flex-direction:column; gap:var(--am-gap-lg);
    padding:var(--am-gap-xl) var(--am-gap-xl) var(--am-gap-3xl);
    border-radius:24px 24px 0 0;
    box-shadow:0 -10px 30px rgba(0,0,0,0.1);
    animation:slideFromBottom 0.3s ease;
    overflow-y:auto;
  }
  .am-mobile-bottom-sheet .am-nav-mobile.is-open::before {
    content:''; display:block; width:40px; height:4px;
    background:var(--am-border); border-radius:999px;
    margin:0 auto var(--am-gap-md);
  }
  @keyframes slideFromBottom { from { transform:translateY(100%); } to { transform:translateY(0); } }
}

/* 5. mobile-dropdown: ヘッダー下に展開
   Why: position:fixed に変更し、ヘッダー直下（top: var(--am-header-h)）に固定追従させます。 */
@media (max-width:768px) {
  .am-mobile-dropdown .am-nav-mobile.is-open {
    position:fixed;
    /* Why: インラインバーを8ッダー下配置の場合は --am-secondary-bar-h 分だけ下にズラします。 */
    top:calc(var(--am-header-h) + var(--am-secondary-bar-h)) !important;
    left:0; right:0; bottom:auto; height:auto; max-height:80vh;
    background:var(--am-surface); z-index:99;
    flex-direction:column; gap:0;
    padding:0;
    border-bottom:2px solid var(--am-primary);
    box-shadow:0 10px 20px rgba(0,0,0,0.08);
    animation:dropDown 0.25s ease;
    overflow-y:auto;
  }
  .am-mobile-dropdown .am-nav-mobile.is-open li a { display:block; padding:0.8rem var(--am-gap-xl); border-bottom:1px solid var(--am-border); }
  .am-mobile-dropdown .am-nav-mobile.is-open li:last-child a { border-bottom:none; }
  @keyframes dropDown { from { opacity:0; transform:translateY(-10px); } to { opacity:1; transform:translateY(0); } }
}



/* =============================================================================
   デザインバリエーション（装飾スタイル）
   ヘッダー10種 / フッター10種 / モバイルメニュー10種
   レイアウト（配置）とは独立して動作し、色はCSS変数でスキンに追従する
   ============================================================================= */

/* ━━━━ ヘッダーデザイン ━━━━ */

/* hd-clean: デフォルト — 特にCSSなし（ベースのヘッダーCSS適用） */

/* hd-bordered: 下線のみ・影なし */
.am-hd-bordered .am-header { box-shadow:none; backdrop-filter:none; border-bottom:2px solid var(--am-border); }

/* hd-gradient: プライマリ→アクセントのグラデーション背景 */
.am-hd-gradient .am-header { background:linear-gradient(135deg, var(--am-primary), var(--am-accent)) !important; border-bottom:none; }
.am-hd-gradient .am-header__logo { -webkit-text-fill-color:#fff !important; background:none !important; }
.am-hd-gradient .am-nav li a { color:rgba(255,255,255,0.85) !important; }
.am-hd-gradient .am-nav li a:hover { color:#fff !important; }
.am-hd-gradient .am-hamburger span { background:#fff; }

/* hd-glass: 半透明ぼかし */
.am-hd-glass .am-header { background:rgba(255,255,255,0.4) !important; backdrop-filter:blur(24px); -webkit-backdrop-filter:blur(24px); border-bottom:1px solid rgba(255,255,255,0.3); box-shadow:0 4px 30px rgba(0,0,0,0.05); }

/* hd-shadow: 深い影で浮遊感 */
.am-hd-shadow .am-header { border-bottom:none; box-shadow:0 8px 40px rgba(0,0,0,0.12); }

/* hd-pill: 丸角フローティング */
.am-hd-pill .am-header { margin:0.75rem 1.5rem 0; border-radius:999px; border-bottom:none; box-shadow:0 6px 25px rgba(0,0,0,0.08); height:auto; padding:0.4rem 0.5rem; }

/* hd-underline: 太いプライマリカラーの下線 */
.am-hd-underline .am-header { border-bottom:4px solid var(--am-primary); box-shadow:none; backdrop-filter:none; }

/* hd-two-tone: 上部にカラーバー */
.am-hd-two-tone .am-header { border-bottom:1px solid var(--am-border); box-shadow:none; }
.am-hd-two-tone .am-header::before { content:''; position:absolute; top:0; left:0; right:0; height:4px; background:linear-gradient(90deg, var(--am-primary), var(--am-accent)); }

/* hd-flat: 背景色のみ・一切の装飾なし */
.am-hd-flat .am-header { box-shadow:none; border-bottom:none; backdrop-filter:none; }

/* hd-neon: プライマリカラーのネオングロー */
.am-hd-neon .am-header { border-bottom:2px solid var(--am-primary); box-shadow:0 4px 20px color-mix(in srgb, var(--am-primary) 30%, transparent); }
.am-hd-neon .am-header__logo { text-shadow:0 0 12px color-mix(in srgb, var(--am-primary) 50%, transparent); }

/* ━━━━ フッターデザイン ━━━━ */

/* fd-clean: デフォルト — 特にCSSなし */

/* fd-dark: テキスト色反転の濃い背景 */
.am-fd-dark .am-footer { background:var(--am-text-primary) !important; color:rgba(255,255,255,0.7); border-top:none; }
.am-fd-dark .am-footer__logo { color:#fff !important; }
.am-fd-dark .am-footer__desc,.am-fd-dark .am-footer-menu a,.am-fd-dark .am-footer__copy,.am-fd-dark .am-footer__copy p { color:rgba(255,255,255,0.6) !important; }
.am-fd-dark .am-footer-menu a:hover { color:#fff !important; }
.am-fd-dark .am-footer__copy { border-top-color:rgba(255,255,255,0.1); }

/* fd-gradient: 上から下へグラデーション */
.am-fd-gradient .am-footer { background:linear-gradient(180deg, var(--am-bg-alt), var(--am-footer-bg)) !important; border-top:none; }

/* fd-bordered: 太い上線 */
.am-fd-bordered .am-footer { border-top:5px solid var(--am-primary); }

/* fd-glass: 半透明ぼかし */
.am-fd-glass .am-footer { background:rgba(255,255,255,0.5) !important; backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); border-top:1px solid rgba(255,255,255,0.3); }

/* fd-wave: 上部に波形装飾 */
.am-fd-wave .am-footer { border-top:none; padding-top:5rem; position:relative; }
.am-fd-wave .am-footer::before { content:''; position:absolute; top:-2px; left:0; right:0; height:60px; background:var(--am-bg); clip-path:ellipse(55% 100% at 50% 0%); }

/* fd-stripe: 背景にストライプパターン */
.am-fd-stripe .am-footer { background:repeating-linear-gradient(135deg, var(--am-footer-bg), var(--am-footer-bg) 10px, var(--am-bg-alt) 10px, var(--am-bg-alt) 20px) !important; }

/* fd-rounded: 上部丸角 */
.am-fd-rounded .am-footer { border-top:none; border-radius:40px 40px 0 0; margin-top:2rem; padding-top:3rem; }

/* fd-accent: プライマリカラー背景 */
.am-fd-accent .am-footer { background:var(--am-primary) !important; border-top:none; }
.am-fd-accent .am-footer__logo,.am-fd-accent .am-footer__desc,.am-fd-accent .am-footer-menu a,.am-fd-accent .am-footer__copy,.am-fd-accent .am-footer__copy p { color:rgba(255,255,255,0.9) !important; }
.am-fd-accent .am-footer__copy { border-top-color:rgba(255,255,255,0.2); }

/* fd-minimal-line: 極細の上線のみ */
.am-fd-minimal-line .am-footer { border-top:1px solid var(--am-border); background:transparent !important; padding:var(--am-gap-lg) 0; }

/* ━━━━ モバイルメニューデザイン ━━━━ */
/* モバイルメニューのデザインは .am-nav.is-open に適用される */

/* md-clean: デフォルト — 特にCSSなし */

/* md-dark: 濃い背景・白テキスト */
@media (max-width:768px) {
  .am-md-dark .am-nav.is-open { background:var(--am-text-primary) !important; }
  .am-md-dark .am-nav.is-open li a { color:rgba(255,255,255,0.85) !important; }
  .am-md-dark .am-nav.is-open li a:hover { color:#fff !important; }
}

/* md-glass: 半透明ぼかし */
@media (max-width:768px) {
  .am-md-glass .am-nav.is-open { background:rgba(255,255,255,0.6) !important; backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); }
}

/* md-card: 各リンクがカード型 */
@media (max-width:768px) {
  .am-md-card .am-nav.is-open li a { display:block; background:var(--am-surface); border:1px solid var(--am-border); border-radius:12px; padding:0.8rem 1rem; margin-bottom:0.5rem; font-weight:600; transition:all 0.2s; }
  .am-md-card .am-nav.is-open li a:hover { background:var(--am-bg-alt); border-color:var(--am-primary); }
}

/* md-bordered: 枠線付き */
@media (max-width:768px) {
  .am-md-bordered .am-nav.is-open { border:2px solid var(--am-primary); border-radius:16px; margin:0.5rem; }
  .am-md-bordered .am-nav.is-open li a { border-bottom:1px solid var(--am-border); padding:0.8rem 1rem; }
  .am-md-bordered .am-nav.is-open li:last-child a { border-bottom:none; }
}

/* md-gradient: グラデーション背景 */
@media (max-width:768px) {
  .am-md-gradient .am-nav.is-open { background:linear-gradient(180deg, var(--am-bg), var(--am-bg-alt)) !important; }
}

/* md-accent: プライマリ色背景 */
@media (max-width:768px) {
  .am-md-accent .am-nav.is-open { background:var(--am-primary) !important; }
  .am-md-accent .am-nav.is-open li a { color:rgba(255,255,255,0.9) !important; }
  .am-md-accent .am-nav.is-open li a:hover { color:#fff !important; }
}

/* md-rounded: 各リンクが丸角ボタン型 */
@media (max-width:768px) {
  .am-md-rounded .am-nav.is-open li a { display:inline-block; background:var(--am-bg-alt); border-radius:999px; padding:0.5rem 1.2rem; font-weight:600; font-size:0.9rem; }
  .am-md-rounded .am-nav.is-open li a:hover { background:var(--am-primary); color:#fff; }
  .am-md-rounded .am-nav.is-open { flex-wrap:wrap; justify-content:center; }
}

/* md-divider: 太い区切り線付き */
@media (max-width:768px) {
  .am-md-divider .am-nav.is-open li { border-bottom:2px solid var(--am-border); }
  .am-md-divider .am-nav.is-open li:last-child { border-bottom:none; }
  .am-md-divider .am-nav.is-open li a { display:block; padding:1rem 0; font-size:1rem; font-weight:600; }
}

/* md-large: 大きなリンク */
@media (max-width:768px) {
  .am-md-large .am-nav.is-open { justify-content:center; text-align:center; }
  .am-md-large .am-nav.is-open li a { font-size:1.4rem; font-weight:700; letter-spacing:0.02em; padding:0.6rem 0; }
}

/* =============================================================================
   AffiliMax Modern UI - 検索ウィジェット・ブロックの改善
   Why: 標準の検索ウィジェットおよびGutenberg検索ブロック内の入力欄やボタンの高さが引き伸ばされて巨大化するのを防ぎ、
   高さを42pxに統一してスマートに横並び配置することでプレミアムな質感にするため。
   ============================================================================= */
/* ── アクセシビリティ・スクリーンリーダー専用テキストの非表示化 ── */
/* Why: WordPress標準が出力するスクリーンリーダー用のテキストを画面上で非表示にしつつ、読み上げソフトには認識させるため */
.screen-reader-text {
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
  word-wrap: normal !important;
}

/* 検索全体およびコンテナ */
.search-form,
.widget_search .search-form,
.widget.widget_search .search-form {
  display: flex !important;
  align-items: center !important;
  gap: var(--am-gap-xs) !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-bottom: 0 !important;
  height: 42px !important;
  box-sizing: border-box !important;
}

/* Gutenberg検索ブロックのアウターコンテナ */
/* Why: アウター自体をflexにするとラベルと入力欄が横並びになり、入力欄がつぶれる原因になるため通常のブロック要素にする */
.wp-block-search {
  width: 100% !important;
  max-width: 100% !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
}

/* Gutenberg検索ブロックのラベル */
/* Why: 検索ウィジェット・ブロック上のラベルテキスト「検索」を不要とするユーザー要望に基づき非表示化するため */
.wp-block-search .wp-block-search__label,
.wp-block-search__label {
  display: none !important;
}

/* ラッパー (Gutenbergブロック内) */
.wp-block-search .wp-block-search__inside-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: var(--am-gap-xs) !important;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
  height: 42px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* HTML5検索フォーム用のlabel調整 */
/* Why: label要素が親のflexコンテナ内で正しく横幅いっぱいに引き伸ばされるようにするため */
.search-form label {
  flex: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
  box-sizing: border-box !important;
}

/* 入力フィールド */
.search-form .search-field,
.widget_search .search-field,
.widget.widget_search .search-field,
.wp-block-search .wp-block-search__input,
.wp-block-search__input {
  flex: 1 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 42px !important;
  padding: 0 0.8rem !important;
  border: 1px solid var(--am-border) !important;
  border-radius: 8px !important;
  background: var(--am-bg-alt) !important;
  color: var(--am-text-primary) !important;
  font-size: var(--am-text-sm) !important;
  outline: none !important;
  box-sizing: border-box !important;
  transition: all var(--am-transition-fast) !important;
  margin: 0 !important;
  display: block !important;
}

.search-form .search-field:focus,
.widget_search .search-field:focus,
.widget.widget_search .search-field:focus,
.wp-block-search .wp-block-search__input:focus,
.wp-block-search__input:focus {
  border-color: var(--am-primary) !important;
  background: var(--am-surface) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--am-primary) 15%, transparent) !important;
}

/* 検索ボタン */
.search-form .search-submit,
.widget_search .search-submit,
.widget.widget_search .search-submit,
.wp-block-search .wp-block-search__button,
.wp-block-search__button {
  height: 42px !important;
  padding: 0 1.2rem !important;
  background: var(--am-primary) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  font-size: var(--am-text-sm) !important;
  cursor: pointer;
  box-sizing: border-box !important;
  transition: all var(--am-transition-fast) !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

.search-form .search-submit:hover,
.widget_search .search-submit:hover,
.widget.widget_search .search-submit:hover,
.wp-block-search .wp-block-search__button:hover,
.wp-block-search__button:hover {
  background: var(--am-primary-hover) !important;
  transform: translateY(-1px) !important;
}

/* =============================================================================
   レスポンシブデザインの改善 (モバイル対応の強化)
   Why: PC等では最適な2/3カラムを表示しつつ、スマホサイズではサイドバーを綺麗に
   メインコンテンツの下へ落とし、画面幅いっぱいに広がらないよう制御するため。
   ============================================================================= */
@media (max-width: 1024px) {
  .am-single-container,
  .am-container.am-single-container {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--am-gap-xl) !important;
    align-items: center !important;
  }
  
  .am-single-container > main#primary {
    width: 100% !important;
    max-width: 100% !important;
    order: 1 !important; /* メインコンテンツを最上部に */
  }

  .am-single-container > aside.am-sidebar,
  .am-single-container > .am-sidebar-left {
    width: 100% !important;
    max-width: 480px !important; /* モバイル時の最大幅をスマホサイズに制限 */
    margin: 0 auto !important;
    order: 2 !important; /* サイドバーは下に落とす */
  }

  /* ウィジェットの余白をモバイル向けに微調整 */
  .am-widget, .widget {
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
  }
}

/* =============================================================================
   アイキャッチ画像位置の変更オプション対応
   Why: ユーザーが設定画面で選んだ「デフォルト」「タイトル下」「抜粋横」「オーバーレイ」の
   各レイアウトを、HTML構造を変更せずにCSSの並び替え・回り込み・絶対配置を用いて実現するため。
   ============================================================================= */

/* --- A. デフォルト (タイトルの上にアイキャッチ) --- */
.am-eyecatch-default .am-single-article {
  display: flex !important;
  flex-direction: column !important;
}
.am-eyecatch-default .am-post-thumbnail {
  order: 1 !important; /* アイキャッチが上 */
}
.am-eyecatch-default .am-entry-header {
  order: 2 !important; /* タイトルが下 */
  margin-top: 1.5rem !important;
}
.am-eyecatch-default .am-entry-content {
  order: 3 !important;
}

/* --- B. タイトル下 (タイトルの下にアイキャッチ - 従来の標準表示) --- */
.am-eyecatch-title-below .am-single-article {
  display: flex !important;
  flex-direction: column !important;
}
.am-eyecatch-title-below .am-entry-header {
  order: 1 !important;
}
.am-eyecatch-title-below .am-post-thumbnail {
  order: 2 !important;
}
.am-eyecatch-title-below .am-entry-content {
  order: 3 !important;
}

/* --- C. タイル埋め込み型 ── */
/* 個別記事 (single.php) : 本文横にアイキャッチを配置する代わりに縦積みにして大きく表示 */
/* Why: 個別記事ページにおいては、タイル埋め込みレイアウトは適用せず、通常通り縦積みの見やすいレイアウトにします */
.am-eyecatch-tile-embedded .am-single-article {
  display: flex !important;
  flex-direction: column !important;
}
.am-eyecatch-tile-embedded .am-entry-header {
  order: 1 !important;
}
.am-eyecatch-tile-embedded .am-post-thumbnail {
  order: 2 !important;
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-right: 0 !important;
  margin-bottom: 2rem !important;
}
.am-eyecatch-tile-embedded .am-entry-content {
  order: 3 !important;
}

/* am-card-footer 通常フォールバック: HTMLをam-card-link直下に移動したため、
   タイル埋め込み以外のレイアウトで位置がずれないよう position: static を明示 */
/* Why: am-card-footerをam-card-link直下に移動したことで、
        他のアイキャッチモードでは「am-card-linkの外」のフロー要素として
        正常にカードの最下部に表示される。position: staticを明示して意図を示す。 */
.am-post-grid .am-card-footer,
.am-grid-1 .am-card-footer {
  position: static;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--am-gap-sm);
  margin-top: var(--am-gap-sm);
  border-top: 1px solid var(--am-border);
  font-size: var(--am-text-sm);
  color: var(--am-text-secondary);
}

/* アーカイブ一覧 (index.php等) : 投稿カードをタイル埋め込み型にする */
/* Why: アイキャッチ画像を右側に配置し、左側スラッシュカットで斜めに切り取る。
        タイトルを左エリア上部中央に大きく、抜粋をその下に最大4行、
        カテゴリバッジ・続きを読むボタンはアイキャッチ画像の上の右下に絶対配置する。
        タグは視覚的ノイズを減らすため非表示とする。 */

/* カード記事コンテナ: paddingを除去して絶対配置の基準にする */
/* Why: Safari/Chrome等のブラウザで、角丸（border-radius）＋ overflow: hidden が
        絶対配置や clip-path を適用した子要素に対して効かなくなる描画バグを防止するため、
        親コンテナ（.am-card-article）に overflow: hidden と translate3d を強制します。 */
.am-eyecatch-tile-embedded .am-post-grid .am-card-article,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-article {
  padding: 0 !important;
  position: relative !important;
  overflow: hidden !important;
  border-radius: var(--am-radius-md) !important;
  transform: translate3d(0, 0, 0) !important;
}

/* カードリンク: 固定高さで横幅いっぱいに広げ、内部要素の絶対配置の起点にする */
/* Why: リンク要素自体にも角丸と clip 処理、およびレイヤーグループ化（translate3d）を施すことで、
        内部の絶対配置されたサムネイル画像が親の角丸からはみ出るのを二重に防止します。 */
.am-eyecatch-tile-embedded .am-post-grid .am-card-link,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-link {
  display: block !important;
  position: relative !important;
  padding: 0 !important;
  height: 180px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  border-radius: var(--am-radius-md) !important;
  transform: translate3d(0, 0, 0) !important;
}

/* アイキャッチ画像: 右側に45%幅で配置し、左端をスラッシュカット */
/* Why: サムネイルコンテナにもレイヤーの強制化（translate3d）を付与し、
        親要素のクリップ領域に確実におさまるようにします。 */
.am-eyecatch-tile-embedded .am-post-grid .am-card-thumbnail,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-thumbnail {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;       /* 右寄せに変更 */
  left: auto !important;
  bottom: 0 !important;
  width: 45% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  z-index: 1 !important;
  opacity: 0.8 !important;   /* ガラスの奥に画像を見せるため、不透明度を80%に向上 */
  overflow: hidden !important;
  /* 左端を斜めにスラッシュカット（右寄せなので左側をカット） */
  clip-path: polygon(25% 0, 100% 0, 100% 100%, 0 100%) !important;
  filter: drop-shadow(-2px 2px 4px rgba(0,0,0,0.15)) !important; /* ガラス自体のわずかな影 */
  transform: translate3d(0, 0, 0) !important;
  transition: opacity 0.3s ease, filter 0.3s ease !important;
}

/* ぷっくりガラス効果レイヤー（ベベル & エンボス） - クリアガラス版 */
.am-eyecatch-tile-embedded .am-post-grid .am-card-thumbnail::after,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-thumbnail::after {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  /* ぼかし（磨りガラス）を完全に廃止し、透明感を最大化 */
  /* linear-gradientで斜めカットの左上から光が差し込んでいるような、より透明でシャープなハイライトを演出 */
  background: linear-gradient(115deg, 
    rgba(255, 255, 255, 0.6) 0%, 
    rgba(255, 255, 255, 0.08) 20%, 
    rgba(255, 255, 255, 0.02) 50%, 
    rgba(0, 0, 0, 0) 80%, 
    rgba(0, 0, 0, 0.15) 100%) !important;
  /* 内側の白い光と黒い影で、透明なアクリル/ガラスのぷっくりとしたエッジをシャープに表現 */
  box-shadow: 
    inset 0 2px 4px rgba(255, 255, 255, 0.8),
    inset 2px 0 4px rgba(255, 255, 255, 0.6),
    inset -2px -2px 4px rgba(0, 0, 0, 0.2) !important;
  pointer-events: none !important;
  transition: all 0.3s ease !important;
}

/* ホバー時のマイクロインタラクション */
.am-eyecatch-tile-embedded .am-post-grid .am-card-article:hover .am-card-thumbnail,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-article:hover .am-card-thumbnail {
  opacity: 0.95 !important;
  filter: drop-shadow(-4px 4px 8px rgba(0,0,0,0.25)) !important;
}

/* Why: ホバー時のセレクタ記述の不備（2つ目のセレクタに :hover 指定が欠落していたバグ）を修正します。 */
.am-eyecatch-tile-embedded .am-post-grid .am-card-article:hover .am-card-thumbnail::after,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-article:hover .am-card-thumbnail::after {
  /* ホバー時もぼかしを入れず、光の反射（グラデーション）のきらめきだけを強める */
  background: linear-gradient(115deg, 
    rgba(255, 255, 255, 0.8) 0%, 
    rgba(255, 255, 255, 0.15) 25%, 
    rgba(255, 255, 255, 0.04) 50%, 
    rgba(0, 0, 0, 0) 75%, 
    rgba(0, 0, 0, 0.1) 100%) !important;
}

/* アイキャッチ内の画像: コンテナいっぱいに広げてトリミング */
/* Why: 非ホバー時でも 3D レイヤー（translate3d）に配置して、親要素でのクリッピング描画を同期させ、角がはみ出るのを防ぎます。 */
.am-eyecatch-tile-embedded .am-post-grid .am-card-thumbnail img,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-thumbnail img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
  transform: translate3d(0, 0, 0) !important;
  transition: transform 0.5s ease !important;
}

/* Why: ホバー時に拡大アニメーションを行いながら、はみ出しバグを防ぐため 3D 変形を維持します。 */
.am-eyecatch-tile-embedded .am-post-grid .am-card-article:hover .am-card-thumbnail img,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-article:hover .am-card-thumbnail img {
  transform: scale(1.03) translate3d(0, 0, 0) !important;
}

/* プレースホルダー: アイキャッチがない場合のグラデーション背景 */
.am-eyecatch-tile-embedded .am-post-grid .am-placeholder-img,
.am-eyecatch-tile-embedded .am-grid-1 .am-placeholder-img {
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9) !important;
}

/* コンテンツエリア: 左55%に収め、Flexで縦積みにする */
/* Why: アイキャッチが右45%を占めるので、左60%をコンテンツエリアとして使う。
        スラッシュカット分の食い込みを考慮してright paddingを設ける。 */
.am-eyecatch-tile-embedded .am-post-grid .am-card-content,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-content {
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  width: 60% !important;        /* 左側60%をコンテンツエリアとして確保 */
  height: 100% !important;
  padding: 14px 16px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* タグ: タイル埋め込み型ではタグを非表示にする */
/* Why: 限られた高さの中でタグは視覚的ノイズになるため、カテゴリバッジのみに絞る */
.am-eyecatch-tile-embedded .am-post-grid .am-card-tags-row,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-tags-row {
  display: none !important;
}

/* タイトル: 上部に配置し、テキストを中央揃えで大きく表示 */
/* Why: アイキャッチのアクセント的な役割に合わせ、タイトルを主役として上部中央に配置 */
.am-eyecatch-tile-embedded .am-post-grid .am-card-title,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-title {
  order: 1 !important;
  font-size: clamp(1rem, 2.5vw, 1.25rem) !important; /* 30文字がコンテンツ幅いっぱいになる目安 */
  line-height: 1.35 !important;
  margin: 0 0 8px 0 !important;
  text-align: center !important;  /* 中央揃え */
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  font-weight: 700 !important;
}

/* カテゴリバッジ行: タイトルの直下に小さく表示（通常のメタ行は非表示） */
/* Why: メタ行はアイキャッチ上の右下に再配置するため、通常位置では非表示にする */
.am-eyecatch-tile-embedded .am-post-grid .am-card-meta-row,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-meta-row {
  display: none !important; /* カテゴリバッジはam-card-footerの横に絶対配置で表示するため非表示 */
}

/* 抜粋: 左エリアの残りスペースに4行まで表示 */
/* Why: 高さ固定カード内でタイトル下の余白を有効活用する */
.am-eyecatch-tile-embedded .am-post-grid .am-card-excerpt,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-excerpt {
  order: 2 !important;
  font-size: 0.74rem !important; /* 抜粋のフォントサイズを1px（0.06rem）縮小 */
  line-height: 1.55 !important;
  margin: 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 4 !important; /* 最大4行 */
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  flex-grow: 1 !important;
  color: var(--am-text-secondary) !important;
}

/* フッター: 日付と続きを読むをアイキャッチ上の右下に絶対配置 */
/* Why: アクションボタンとカテゴリをアイキャッチ画像の領域に重ねることで、
        限られたスペースを効率よく使う */
.am-eyecatch-tile-embedded .am-post-grid .am-card-footer,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-footer {
  position: absolute !important;
  bottom: 10px !important;
  right: 10px !important;
  z-index: 3 !important;       /* アイキャッチ（z-index:1）より上に表示 */
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 4px !important;
  border-top: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 日付テキスト: タイル埋め込みでは非表示（スペース節約） */
.am-eyecatch-tile-embedded .am-post-grid .am-card-date,
.am-eyecatch-tile-embedded .am-grid-1 .am-card-date {
  display: none !important;
}

/* 続きを読むボタン: アイキャッチ画像の上の右下に配置 */
.am-eyecatch-tile-embedded .am-post-grid .am-btn-text,
.am-eyecatch-tile-embedded .am-grid-1 .am-btn-text {
  display: inline-block !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em !important;
  background: rgba(255, 255, 255, 0.85) !important;
  color: var(--am-text-primary) !important;
  padding: 3px 8px !important;
  border-radius: 20px !important;
  backdrop-filter: blur(4px) !important;
  line-height: 1.4 !important;
}

/* カテゴリバッジ: フッターの上部に絶対配置で追加表示するため */
/* Why: am-card-meta-rowを非表示にした代わりに、フッターの兄弟として
        カテゴリのみを画像上の右下エリアに表示するため、
        am-card-footerに擬似的なカテゴリ表示をCSSのみで制御する手法を取る。
        ただし現状のHTMLでは am-card-meta-row と am-card-footer は独立しているため、
        am-card-footer を基準に上に積み上げるよう gap と flex-direction を使う。 */

/* ===============================================
   モバイル対応: PCと同じレイアウトを縮小して維持
   スマホでも同一デザインを採用（shrinkして対応）
   =============================================== */
@media (max-width: 768px) {
  .am-eyecatch-tile-embedded .am-post-grid .am-card-link,
  .am-eyecatch-tile-embedded .am-grid-1 .am-card-link {
    height: 120px !important; /* スマホ：カード高さを縮小 */
  }
  .am-eyecatch-tile-embedded .am-post-grid .am-card-thumbnail,
  .am-eyecatch-tile-embedded .am-grid-1 .am-card-thumbnail {
    width: 42% !important;
    clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%) !important; /* スラッシュ角度をスマホ向けに微調整 */
  }
  .am-eyecatch-tile-embedded .am-post-grid .am-card-content,
  .am-eyecatch-tile-embedded .am-grid-1 .am-card-content {
    width: 62% !important;
    padding: 8px 10px !important; /* スマホ：パディングを縮小 */
  }
  .am-eyecatch-tile-embedded .am-post-grid .am-card-title,
  .am-eyecatch-tile-embedded .am-grid-1 .am-card-title {
    font-size: clamp(0.75rem, 3vw, 0.95rem) !important; /* スマホ：タイトルを縮小 */
    margin: 0 0 4px 0 !important;
    -webkit-line-clamp: 2 !important;
  }
  .am-eyecatch-tile-embedded .am-post-grid .am-card-excerpt,
  .am-eyecatch-tile-embedded .am-grid-1 .am-card-excerpt {
    font-size: 0.62rem !important; /* スマホ抜粋のフォントサイズを1px（0.06rem）縮小 */
    line-height: 1.4 !important;
    -webkit-line-clamp: 3 !important; /* スマホでは3行まで */
  }
  .am-eyecatch-tile-embedded .am-post-grid .am-card-footer,
  .am-eyecatch-tile-embedded .am-grid-1 .am-card-footer {
    bottom: 6px !important;
    right: 6px !important;
  }
  .am-eyecatch-tile-embedded .am-post-grid .am-btn-text,
  .am-eyecatch-tile-embedded .am-grid-1 .am-btn-text {
    font-size: 0.62rem !important;
    padding: 2px 6px !important;
  }
}

/* am-footer-cat: 通常レイアウトでは非表示（タイル埋め込み型のみで使用） */
/* Why: フッター内に複製したカテゴリバッジは、タイル埋め込み型レイアウト専用の要素。
        通常レイアウトではam-card-meta-rowの方が表示されるため、重複を防ぐために非表示にする。 */
.am-card-footer .am-footer-cat {
  display: none;
}
/* タイル埋め込み型のみ: フッター内のカテゴリバッジは非表示（左上にタスキがけするため） */
.am-eyecatch-tile-embedded .am-card-footer .am-footer-cat {
  display: none !important;
}

/* グリッドコンテナ全体の左右のパディングをゼロにし、プロフィールブロック等の親コンテナ幅に完璧に一致させます */
.am-eyecatch-tile-embedded .am-post-grid {
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}
@media (max-width: 768px) {
  .am-eyecatch-tile-embedded .am-post-grid {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}



/* --- D. アイキャッチにタイトルをオーバーレイ ── */
/* 個別記事 (single.php) : タイトルと画像をCSS Gridで同一エリアに配置して重ね合わせる */
/* Why: スキンのpadding値に影響されず、常にアイキャッチ画像とヘッダータイトルを同サイズ・同位置に綺麗に重ね合わせるため */
.am-eyecatch-overlay .am-single-article {
  position: relative !important;
  display: grid !important;
  grid-template-columns: 100% !important;
}
.am-eyecatch-overlay .am-entry-header,
.am-eyecatch-overlay .am-post-thumbnail {
  grid-area: 1 / 1 / 2 / 2 !important;
}

.am-eyecatch-overlay .am-entry-header {
  position: relative !important;
  z-index: 2 !important;
  aspect-ratio: 1200 / 675 !important; /* 固定高さを廃止し比率固定 */
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 2rem !important;
  margin-top: 0 !important;
  margin-bottom: 2.5rem !important;
  background: transparent !important;
  border-radius: var(--am-radius-md) !important;
  overflow: hidden !important;
}
/* 暗い半透明マスクを追加 */
.am-eyecatch-overlay .am-entry-header::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.45) !important;
  z-index: 1 !important;
  border-radius: var(--am-radius-md) !important;
}
/* ヘッダー内の要素がオーバーレイより手前に表示されるように制御 */
.am-eyecatch-overlay .am-entry-header > * {
  position: relative !important;
  z-index: 2 !important;
}
.am-eyecatch-overlay .am-entry-title {
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
  text-align: center;
  font-size: 2rem !important;
}
@media (max-width: 768px) {
  .am-eyecatch-overlay .am-entry-title {
    font-size: 1.25rem !important;
  }
  .am-eyecatch-overlay .am-entry-header {
    padding: 1rem !important; /* スマホではパディングを詰める */
  }
}
.am-eyecatch-overlay .am-entry-meta,
.am-eyecatch-overlay .am-entry-meta .am-date,
.am-eyecatch-overlay .am-cat-badge a {
  color: rgba(255, 255, 255, 0.9) !important;
}
.am-eyecatch-overlay .am-cat-badge {
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* アイキャッチ画像のスタイル調整 */
.am-eyecatch-overlay .am-post-thumbnail {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  aspect-ratio: 1200 / 675 !important; /* 固定高さを廃止し比率固定 */
  height: auto !important;
  margin: 0 !important;
  margin-bottom: 2.5rem !important;
  border-radius: var(--am-radius-md) !important;
  overflow: hidden !important;
  box-shadow: none !important;
}
.am-eyecatch-overlay .am-post-thumbnail img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* --- アイキャッチ画像オーバーレイのCSS (v16.9.36修正) --- */
/* Why: 通常表示のアイキャッチ画像と完璧に表示領域（位置・幅・高さ・縮尺）を同期させるため、全幅はみ出し指定を廃止し、高さ通常520px / スマホ240pxに同期します。 */
.am-hero-thumbnail--overlay {
  position: relative !important;
  width: 100% !important;
  height: 520px !important;
  max-height: 520px !important;
  overflow: hidden !important;
}
.am-hero-thumbnail--overlay img {
  width: 100% !important;
  height: 100% !important;
  max-height: 520px !important;
  object-fit: cover !important;
  object-position: center !important;
}
.am-hero-overlay-content {
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.6) 100%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  z-index: 2 !important;
}
.am-hero-overlay-content .am-container {
  width: 100% !important;
  max-width: var(--am-container, 1240px) !important;
  margin: 0 auto !important;
  padding: 0 var(--am-gap-lg, 1.5rem) !important;
}
.am-hero-overlay-content .am-entry-header {
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  height: auto !important;
}
.am-hero-overlay-content .am-entry-title {
  color: #ffffff !important;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
  font-size: 3rem !important;
  font-weight: 800 !important;
  margin-top: 1rem !important;
  margin-bottom: 1.5rem !important;
  line-height: 1.2 !important;
}
@media (max-width: 768px) {
  .am-hero-thumbnail--overlay {
    height: 240px !important;
    max-height: 240px !important;
  }
  .am-hero-thumbnail--overlay img {
    height: 240px !important;
    max-height: 240px !important;
  }
  .am-hero-overlay-content .am-entry-title {
    font-size: 2rem !important;
  }
}
.am-hero-overlay-content .am-entry-meta {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1rem !important;
  color: rgba(255, 255, 255, 0.9) !important;
  font-size: 0.95rem !important;
  margin-bottom: 0.5rem !important;
}
.am-hero-overlay-content .am-date {
  color: rgba(255, 255, 255, 0.8) !important;
}
.am-hero-overlay-content .am-cat-badge {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: var(--am-radius-full, 9999px) !important;
  font-weight: 600 !important;
  font-size: 0.85rem !important;
}
.am-hero-overlay-content .am-cat-badge a {
  color: #ffffff !important;
}
.am-hero-overlay-content .am-post-tag {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  padding: 0.25rem 0.75rem !important;
  border-radius: var(--am-radius-sm, 6px) !important;
  font-size: 0.75rem !important;
  text-decoration: none !important;
}

/* アーカイブ一覧 (index.php等) : 投稿カード全体を背景画像とグラデーションマスクで覆いタイトルを重ねる */
/* Why: カード表示時でもタイトルと抜粋がアイキャッチの上に美しくオーバーレイされるLinear風のデザインにするため */
.am-eyecatch-overlay .am-post-grid .am-card-article,
.am-eyecatch-overlay .am-grid-1 .am-card-article {
  position: relative !important;
  overflow: hidden !important;
  aspect-ratio: 1200 / 500 !important; /* Why: 表示されるアイキャッチ画像とオーバーレイを少し小さくし高さを抑えてコンパクトにするため、アスペクト比を低く変更 */
  height: auto !important;
  padding: 0 !important;
  /* Why: タッチスワイプ時の横揺れバグを根本的に防止する */
  touch-action: pan-y !important;
  isolation: isolate !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}
/* カード全体のリンクを全面に広げる */
.am-eyecatch-overlay .am-post-grid .am-card-link,
.am-eyecatch-overlay .am-grid-1 .am-card-link {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}
/* アイキャッチ画像を最背面に絶対配置 */
.am-eyecatch-overlay .am-post-grid .am-card-thumbnail,
.am-eyecatch-overlay .am-grid-1 .am-card-thumbnail {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding-top: 0 !important; /* padding-top: 60% をリセット */
  margin: 0 !important;
  z-index: 1 !important;
}
.am-eyecatch-overlay .am-post-grid .am-card-thumbnail img,
.am-eyecatch-overlay .am-grid-1 .am-card-thumbnail img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  /* Why: iOS/Safariなどのブラウザが画像を誤ってドラッグ移動の対象として認識し、横揺れを引き起こすのを完全に防止する */
  user-drag: none !important;
  -webkit-user-drag: none !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}
/* 暗い半透明マスク（グラデーション）を画像の上に重ねる */
.am-eyecatch-overlay .am-post-grid .am-card-link::before,
.am-eyecatch-overlay .am-grid-1 .am-card-link::before {
  content: '' !important;
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0.1) 100%) !important;
  z-index: 2 !important;
}
/* コンテンツを最前面に配置し、下寄せにする */
.am-eyecatch-overlay .am-post-grid .am-card-content,
.am-eyecatch-overlay .am-grid-1 .am-card-content {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 3 !important;
  padding: var(--am-gap-lg) !important;
  background: transparent !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
}
/* テキストカラーを白系に統一 */
.am-eyecatch-overlay .am-post-grid .am-card-content *,
.am-eyecatch-overlay .am-grid-1 .am-card-content * {
  color: rgba(255, 255, 255, 0.9) !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
}
.am-eyecatch-overlay .am-post-grid .am-card-title,
.am-eyecatch-overlay .am-grid-1 .am-card-title {
  color: #ffffff !important;
  font-size: 1.25rem !important;
  margin-bottom: 0.5rem !important;
}
.am-eyecatch-overlay .am-post-grid .am-card-excerpt,
.am-eyecatch-overlay .am-grid-1 .am-card-excerpt {
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 0.875rem !important;
  margin-bottom: 0.5rem !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
.am-eyecatch-overlay .am-post-grid .am-card-footer,
.am-eyecatch-overlay .am-grid-1 .am-card-footer {
  border-top: none !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}
@media (max-width: 768px) {
  /* スマホでのオーバーレイカード内の余白をさらにタイトに調整 */
  .am-eyecatch-overlay .am-post-grid .am-card-content,
  .am-eyecatch-overlay .am-grid-1 .am-card-content {
    padding: var(--am-gap-md) !important;
  }
  .am-eyecatch-overlay .am-post-grid .am-card-title,
  .am-eyecatch-overlay .am-grid-1 .am-card-title {
    font-size: 1rem !important;
    margin-bottom: 0.25rem !important;
  }
}

/* =============================================================================
   ヘッダー画像、画像下ナビ、およびモバイルインラインメニューの拡張スタイル
   Why: アスペクト比2:1で画面幅いっぱいのヘッダー画像と、その下部に配置可能なPCメニュー、
        さらにモバイルでの横スクロール可能なインラインメニューを実現するため。
   ============================================================================= */

/* 1. ヘッダー画像 */
.am-header-image-container {
    width: 100%;
    overflow: hidden;
    display: block;
    line-height: 0;
}
.am-header-image {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;
    object-fit: cover;
    display: block;
}

/* 2. 画像の下に配置されるPCナビゲーションバー */
.am-nav-container-pc-below {
    background: var(--am-surface);
    border-bottom: 1px solid var(--am-border);
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}
.am-nav-pc-below {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0.8rem 0;
    gap: var(--am-gap-xl, 1.5rem);
}
.am-nav-pc-below li {
    display: inline-block;
}
.am-nav-pc-below li a {
    color: var(--am-text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
}
.am-nav-pc-below li a:hover {
    color: var(--am-primary);
}
@media (max-width: 768px) {
    .am-nav-container-pc-below {
        display: none;
    }
}

/* 3. モバイルインライン横スクロールメニュー */
.am-nav-container-mobile-inline {
    width: 100%;
    background: var(--am-surface);
    border-bottom: 1px solid var(--am-border);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    display: none;
}
@media (max-width: 768px) {
    .am-nav-container-mobile-inline {
        display: block;
    }
}
.am-mobile-inline-inner {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 0.6rem var(--am-gap-md, 1rem);
    scrollbar-width: none;
}
.am-mobile-inline-inner::-webkit-scrollbar {
    display: none;
}
.am-nav-mobile-inline {
    display: inline-flex;
    gap: var(--am-gap-md, 1rem);
    list-style: none;
    margin: 0;
    padding: 0;
}
.am-nav-mobile-inline li {
    display: inline-block;
}
.am-nav-mobile-inline li a {
    display: block;
    color: var(--am-text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: var(--am-bg-alt, #f1f5f9);
    transition: all 0.2s ease;
}
.am-nav-mobile-inline li a:hover {
    background: var(--am-primary);
    color: #fff;
}

/* モバイルインラインメニューのデザインオプション対応 */
.am-md-dark .am-nav-container-mobile-inline {
    background: var(--am-text-primary) !important;
}
.am-md-dark .am-nav-mobile-inline li a {
    color: rgba(255, 255, 255, 0.85) !important;
    background: rgba(255, 255, 255, 0.1) !important;
}
.am-md-dark .am-nav-mobile-inline li a:hover {
    color: #fff !important;
    background: var(--am-primary) !important;
}

.am-md-accent .am-nav-container-mobile-inline {
    background: var(--am-primary) !important;
}
.am-md-accent .am-nav-mobile-inline li a {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.15) !important;
}
.am-md-accent .am-nav-mobile-inline li a:hover {
    color: #fff !important;
    background: var(--am-accent) !important;
}

.am-md-glass .am-nav-container-mobile-inline {
    background: rgba(255, 255, 255, 0.6) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* =============================================================================
   ヘッダーショップリンク＆伸縮検索ボタンのアニメーションスタイル
   Why: ロゴのすぐ右隣にアクションボタンを配置し、虫眼鏡のクリックに応じて
        入力欄を滑らかに左へ伸張させつつ、周りの要素との重なりを防ぐため。
   ============================================================================= */

/* アクションエリア */
.am-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-left: 12px;
  vertical-align: middle;
}

/* ショップアイコンボタン */
.am-header-shop-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--am-surface, #ffffff);
  color: var(--am-text-primary, #0f172a);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}
.am-header-shop-link:hover {
  background: var(--am-primary, #64748b);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.am-header-shop-link .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* 検索エリア */
.am-header-search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.am-header-search-form {
  display: inline-flex;
  align-items: center;
  position: relative;
  margin: 0;
}
.am-header-search-input {
  width: 0;
  padding: 0;
  border: none;
  background: var(--am-surface, #ffffff);
  border-radius: 99px;
  font-size: 0.85rem;
  color: var(--am-text-primary, #0f172a);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), border 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  pointer-events: none;
  box-sizing: border-box;
  height: 32px;
}
.am-header-search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--am-surface, #ffffff);
  color: var(--am-text-primary, #0f172a);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
  padding: 0;
}
.am-header-search-trigger:hover {
  background: var(--am-primary, #64748b);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.am-header-search-trigger .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

/* 検索窓アクティブ時（展開） */
.am-header-search-wrap.is-active {
  position: absolute;
  right: var(--am-gap-md, 1rem);
  left: var(--am-gap-md, 1rem);
  z-index: 10;
  margin: 0;
}
.am-header-search-wrap.is-active .am-header-search-form {
  width: 100%;
}
.am-header-search-wrap.is-active .am-header-search-input {
  width: 100% !important;
  padding: 6px 42px 6px 16px;
  border: 1px solid var(--am-border, #e2e8f0);
  opacity: 1;
  pointer-events: auto;
}
.am-header-search-wrap.is-active .am-header-search-trigger {
  position: absolute;
  right: 0;
  box-shadow: none;
  background: transparent;
  color: var(--am-text-secondary, #475569);
}
.am-header-search-wrap.is-active .am-header-search-trigger:hover {
  color: var(--am-primary, #64748b);
  transform: none;
}

/* ヘッダー全体に対する検索アクティブ時のオーバーフロー制御 */
.am-search-active .am-header__inner {
  overflow: hidden;
}

/* 他のヘッダー要素の押し出しトランジション */
.am-header__logo,
.am-header-shop-link,
.am-nav-container-pc,
.am-header__inner .am-btn,
.am-hamburger {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 検索アクティブ時、左にスライドアウトして消す */
.am-search-active .am-header__logo {
  transform: translateX(-150%);
  opacity: 0;
  pointer-events: none;
}
.am-search-active .am-header-shop-link {
  transform: translateX(-150%);
  opacity: 0;
  pointer-events: none;
}
.am-search-active .am-nav-container-pc {
  transform: translateX(-150%);
  opacity: 0;
  pointer-events: none;
}
.am-search-active .am-header__inner .am-btn {
  transform: translateX(-150%);
  opacity: 0;
  pointer-events: none;
}
.am-search-active .am-hamburger {
  transform: translateX(-150%);
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   他プラグイン等による自動生成コピーボタンの競合防止
   Why: ユーザーが「見出し・カスタムボタンを無効化」トグルを有効にしている場合、
        WordPress標準や他プラグイン（WP Code, Highlighting Code Block, Copy the Code 等）が
        フロントエンドで自動挿入するコピーボタン（グレーのボタン等）と、
        ユーザーが手動で記述した独自コピーボタン（.copy-btn）が重なって表示されるのを防ぐため、
        自動生成される不要なボタンやそのラッパーを強制非表示にします。
   ========================================================================== */
.am-disable-heading-fonts pre button:not(.copy-btn):not(.copy-button),
.am-disable-heading-fonts code button:not(.copy-btn):not(.copy-button),
.am-disable-heading-fonts .wpcode-copy-code-button,
.am-disable-heading-fonts .wpcode-copy-button,
.am-disable-heading-fonts .hcb-copy-btn,
.am-disable-heading-fonts .hcb-copy-button,
.am-disable-heading-fonts .code-copy-button,
.am-disable-heading-fonts .copy-code-button,
.am-disable-heading-fonts .copy-the-code-button,
.am-disable-heading-fonts .copy-the-code-wrap .copy-the-code-button,
.am-disable-heading-fonts .wp-block-code__copy,
.am-disable-heading-fonts .wp-block-code__copy-button {
  display: none !important;
}

/* ==========================================================================
   無効化トグル有効時の見出しフォントサイズおよびフォントカラーのみのデフォルト化
   Why: ユーザーの見出しフォントサイズとフォントカラー（文字色）のみをブラウザデフォルトに戻す要望に対応しつつ、
        フォントの種類（フォントファミリー）や基本マージン等の
        テーマ共通ベースデザインは崩れないように維持するため。
   ========================================================================== */

/* ==========================================================================
   トップページ専用ヘッダー画像 テキストアニメーション
   Why: トップページ専用ヘッダー画像の上に、滑らかに浮かび上がるモダンな
        文字アニメーション（縦書き・横書き・位置調整対応）を表示するため。
   ========================================================================== */
.am-header-image-container {
    position: relative;
}

/* Why: グラデーションフェードはトップページのヘッダー画像のみに適用する。
        通常ページのヘッダー画像には不要なため、PHPで $is_top_page 時のみ
        付与される am-header-image-container--top クラスに限定する。 */
.am-header-image-container--top::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    /* Why: 背景色（var(--am-bg)）へ向かって完全に透過するグラデーションにすることで、
            管理画面から背景色が変更された場合でも色が浮くことなく、自然に背景に溶け込むようにします。 */
    background: linear-gradient(to bottom, transparent 0%, var(--am-bg) 100%);
    pointer-events: none;
    z-index: 5;
}
.am-top-anim-text-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    z-index: 10;
    box-sizing: border-box;
    padding: 15px 12% 6% 12%; /* Why: 左右アライメント（右上・左上）で端に寄りすぎるのを防ぐため、左右余白を12%に広げました */
}
.am-top-anim-text-inner {
    box-sizing: border-box;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    font-weight: 800;
    max-width: 100%;
    max-height: 100%;
    width: fit-content;
    height: fit-content;
    align-self: flex-start;
}
.am-top-anim-pos-center .am-top-anim-text-inner {
    align-self: center;
}

/* 位置合わせ（横書き・縦書き共通） */
.am-top-anim-pos-top-left {
    justify-content: flex-start;
    align-items: flex-start;
}
.am-top-anim-pos-top-right {
    justify-content: flex-end;
    align-items: flex-start;
}
.am-top-anim-pos-center {
    justify-content: center;
    align-items: center;
}

/* 横書き方向 */
.am-top-anim-dir-horizontal .am-top-anim-text-inner {
    writing-mode: horizontal-tb;
    word-break: break-all;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}
.am-top-anim-pos-top-left .am-top-anim-text-inner {
    text-align: left;
}
.am-top-anim-pos-top-right .am-top-anim-text-inner {
    text-align: right;
}
.am-top-anim-pos-center .am-top-anim-text-inner {
    text-align: center;
}

/*
 * Why: 横書き時は display: block で上から下へ行を積む。
 *      縦書き時は 親コンテナの flex 定義によって列として並ぶので、
 *      ここでは共通の display: block のみを定義する。
 */
.am-anim-line {
    display: block;
    margin: 0;
    padding: 0;
}

/*
 * Why: 縦書き時のアーキテクチャ詳細。
 *
 * 問題の根本: 親コンテナ（.am-top-anim-text-inner）に writing-mode: vertical-rl を設定すると、
 *   Flexboxの軸方向が入れ替わり、align-items: flex-start が上周辺でなく
 *   左周辺に効くなり、開始位置が下にずれるおよび列順が正常に制御できなくなる。
 *
 * 解決策: 親コンテナは水平フレックス（horizontal-tb）のままとし、
 *   flex-direction: row-reverse で「右から左へ列を並べる」前段処理を行う。
 *   各行コンテナ（.am-anim-line）に個別に writing-mode: vertical-rl を適用し、
 *   その中の文字が上から下へ縦に流れる構造にする。
 */

/* 縦書き: 親コンテナを水平flexのまま列並びに利用する */
.am-top-anim-dir-vertical .am-top-anim-text-inner {
    /*
     * Why: writing-modeを親に設定せず、Flexboxをそのまま活用する。
     *      row-reverse で「DOM順最初の行 = 一番右の列」となり、
     *      次の行がその左側に並ぶ日本語縦書きの自然な順序になる。
     */
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-start; /* 各列を上端基準で整列 */
    gap: 0.4em; /* Why: 文字サイズに比例した列間余白。emは親のfont-sizeに連動する */
    white-space: normal; /* 初期化：子要素の書字方向に影響しない */
}

/* 縦書き: 各行コンテナに縦書きを適用 */
.am-top-anim-dir-vertical .am-anim-line {
    writing-mode: vertical-rl;
    white-space: nowrap; /* 列内で折り返さない */
    flex-shrink: 0;      /* 列幅を保持する */
    /*
     * Why: writing-mode: vertical-rl が適用された flex アイテムは、
     *      ブラウザによって物理幅の自動計算が不安定になることがある。
     *      特に大きいフォントサイズの場合、列幅が確保されずに重なることがあるため、
     *      1em（= 現在のfont-size = 文孧1個分の幅）を明示的に指定する。
     */
    width: 1em;
}

/* 縦書き: 文字単位は縦方向へ自然に流れる */
.am-top-anim-dir-vertical .am-anim-char {
    display: inline-block;
    vertical-align: top;
}

@keyframes amFloatIn {
    0% {
        opacity: 0;
        filter: blur(12px);
        transform: translateY(-10px) scale(0.85);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}
.am-anim-char {
    display: inline-block;
    vertical-align: top; /* Why: インラインブロック文字がベースライン寄せで下がるのを防ぎ、確実に上端基準で整列させるため */
    opacity: 0;
    animation: amFloatIn var(--anim-duration, 1.5s) cubic-bezier(0.25, 1, 0.5, 1) forwards;
}


/* モバイル用レスポンシブスタイル */
@media (max-width: 768px) {
    .am-top-anim-text-overlay {
        padding: 8px 8% 4% 8%; /* Why: スマホ時も左右に寄りすぎるのを防ぐため、左右パディングを8%に広げました */
    }
    .am-top-anim-text-inner {
        /* 設定されたフォントサイズを基準にして、モバイル表示では自動で30%縮小（0.7倍）して表示する */
        font-size: calc(var(--anim-font-size-mobile, 32px) * 0.7) !important;
    }
}






/* ==========================================================================
   記事一覧グリッドの1カラム（列数1）表示対応
   Why: 独自ブロック「投稿記事一覧」でグリッド列数を 1 に設定した際、テーマの CSS に
        .am-grid-1 の定義がないことで、フォールバックの minmax(320px, 1fr) が適用され、
        2カラムに分割（タイル幅が310px付近に制限）されてしまう問題を解消します。
        列数1の時は強制的に 1カラム（100%幅）で表示させ、タイルの最大幅スライダーが
        正しく機能するようにします。
   ========================================================================== */
.am-grid-1 {
    display: grid !important;
    grid-template-columns: 1fr !important;
}

/* スキン nordic / minimal における記事一覧タイルの幅適正化 */
.am-skin-nordic .am-post-grid,
.am-skin-minimal .am-post-grid {
    grid-template-columns: 1fr !important;
}


/* ==========================================================================
   タイル埋め込み型レイアウト選択時のグリッドカラム調整 (Hotfix)
   Why: アイキャッチ位置に「タイル埋め込み型」が指定されている場合、
        グリッドが複数列で並ぶとカード幅が狭くなり、横長デザインのテキスト領域が潰れてしまいます。
        そのため、タイル埋め込み型が有効な場合は、コンテナ幅やスキンに関わらず、
        強制的にグリッドを1列（100%幅）にし、美しい横長カードレイアウトとして
        他のプロフィールブロック等の横幅と完璧に調和させます。
   ========================================================================== */
.am-eyecatch-tile-embedded .am-post-grid {
    grid-template-columns: 1fr !important;
}
