/**
 * MyBlog Main Stylesheet
 * 
 * 全デザイン・CSS変数・レスポンシブ
 */

/* ==========================================================================
   CSS Variables & Design System
   ========================================================================== */
:root {
  --mytheme-primary: #1f2937;
  --mytheme-accent: #2563eb;
  --mytheme-accent-hover: #1d4ed8;
  --mytheme-bg: #f9fafb;
  --mytheme-surface: #ffffff;
  --mytheme-text: #111827;
  --mytheme-text-muted: #6b7280;
  --mytheme-border: #e5e7eb;
  --mytheme-radius: 8px;
  --mytheme-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --mytheme-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --mytheme-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--mytheme-font-sans);
  background-color: var(--mytheme-bg);
  color: var(--mytheme-text);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--mytheme-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.mytheme-site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mytheme-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.mytheme-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  margin: 32px auto;
}

.mytheme-main-content {
  min-width: 0;
  container: myblog-content / inline-size;
}

@media (min-width: 992px) {
	.mytheme-layout--with-sidebar {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

/* ==========================================================================
   Front page introduction
   ========================================================================== */
.mytheme-home-feature {
  margin-bottom: 28px;
}

.mytheme-home-feature-intro {
  padding: 4px 4px 18px;
}

.mytheme-home-feature-eyebrow {
  color: var(--mytheme-text-muted);
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.mytheme-home-feature-title {
  color: var(--mytheme-primary);
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  line-height: 1.35;
  margin-bottom: 8px;
}

.mytheme-home-feature-text {
  color: var(--mytheme-text-muted);
  line-height: 1.75;
}

.mytheme-home-feature-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  background: var(--mytheme-surface);
  border: 1px solid var(--mytheme-border);
  border-radius: var(--mytheme-radius);
  box-shadow: var(--mytheme-shadow);
}

.mytheme-home-feature-media {
  position: relative;
  min-width: 0;
  aspect-ratio: 16 / 9;
  background: #e5e7eb;
  overflow: hidden;
}

.mytheme-home-feature-media img,
.mytheme-home-feature-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mytheme-home-feature-media video {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.mytheme-home-feature-media video[hidden] {
  display: none;
}

.mytheme-home-feature-card-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  padding: clamp(18px, 3vw, 28px);
}

.mytheme-home-feature-card-content h3 {
  color: var(--mytheme-primary);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  line-height: 1.45;
}

.mytheme-home-feature-card-content p {
  color: var(--mytheme-text-muted);
  line-height: 1.7;
}

.mytheme-home-feature-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 5px;
  background: var(--mytheme-accent);
  color: #fff;
  font-weight: 700;
}

.mytheme-home-feature-button:hover,
.mytheme-home-feature-button:focus-visible {
  background: var(--mytheme-accent-hover);
  color: #fff;
  text-decoration: none;
}

@media (min-width: 640px) {
  .mytheme-home-feature-card--with-media {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mytheme-home-feature-media video {
    display: none;
  }
}

/* ==========================================================================
   Top Notice Bar (サイト上部お知らせバー)
   ========================================================================== */
.mytheme-top-notice {
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  padding: 8px 16px;
  position: relative;
  z-index: 101;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mytheme-top-notice-inner {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mytheme-top-notice-text {
  opacity: 0.95;
}

.mytheme-top-notice-link {
  color: #f8fafc;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.mytheme-top-notice-link:hover {
  opacity: 0.85;
  color: #f8fafc;
  text-decoration: none;
}

.mytheme-top-notice-arrow {
  display: inline-block;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.mytheme-top-notice-link:hover .mytheme-top-notice-arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   Header
   ========================================================================== */
.mytheme-header {
  background-color: var(--mytheme-surface);
  border-bottom: 1px solid var(--mytheme-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--mytheme-shadow);
}

.mytheme-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

/* --- Logo Group --- */
.mytheme-logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  min-width: 0;
}

.mytheme-logo {
  flex-shrink: 0;
}

/* ロゴ画像ラッパー: 嵌り込み画像を制御 */
.mytheme-logo-image-wrap {
  display: flex;
  align-items: center;
  line-height: 1;
}

.mytheme-logo-image-wrap img,
.mytheme-logo-image-wrap a img {
  display: block;
  max-height: 50px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.mytheme-logo h1,
.mytheme-logo .mytheme-logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.mytheme-logo a {
  color: var(--mytheme-text);
  text-decoration: none;
}

/* キャッチフレーズ */
.mytheme-tagline {
  font-size: 0.78rem;
  color: var(--mytheme-text-muted);
  font-weight: 400;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  line-height: 1.3;
  border-left: 1px solid var(--mytheme-border);
  padding-left: 14px;
  flex-shrink: 1;
}

.mytheme-nav-desktop {
  display: none;
}

@media (min-width: 768px) {
  .mytheme-nav-desktop {
    display: block;
  }
}

.mytheme-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 28px;
  margin: 0;
  padding: 0;
}

.mytheme-menu > li {
  position: relative;
}

.mytheme-menu li a {
  color: var(--mytheme-text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.15s ease;
}

.mytheme-menu li a:hover {
  color: var(--mytheme-accent);
  text-decoration: none;
}

/* 子メニューを持つ親項目のインジケーター */
.mytheme-menu .menu-item-has-children > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mytheme-menu .menu-item-has-children > a::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform 0.2s ease;
}

.mytheme-menu .menu-item-has-children:hover > a::after {
  transform: rotate(-135deg);
  margin-top: 2px;
}

/* デスクトップ：ドロップダウンサブメニュー */
.mytheme-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  padding: 6px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 1000;
}

/* 2階層以降の孫メニュー */
.mytheme-menu .sub-menu .sub-menu {
  top: 0;
  left: 100%;
}

.mytheme-menu .menu-item-has-children:hover > .sub-menu,
.mytheme-menu .menu-item-has-children:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.mytheme-menu .sub-menu li {
  position: relative;
}

.mytheme-menu .sub-menu li a {
  display: block;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.mytheme-menu .sub-menu li a:hover {
  background: #f1f5f9;
  color: var(--mytheme-accent);
  text-decoration: none;
}

/* ==========================================================================
   Hamburger Button (モダンアニメーション対応)
   ========================================================================== */
.mytheme-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 110;
  position: relative;
}

@media (min-width: 768px) {
  .mytheme-hamburger {
    display: none;
  }
}

.mytheme-hamburger span {
  width: 100%;
  height: 2px;
  background-color: var(--mytheme-text);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.mytheme-hamburger.is-active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mytheme-hamburger.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.mytheme-hamburger.is-active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ==========================================================================
   Mobile Drawer Menu (モダン・洗練されたデザイン)
   ========================================================================== */
.mytheme-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  max-width: 86vw;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: -4px 0 25px rgba(0, 0, 0, 0.1);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 120;
  overflow-y: auto;
}

.mytheme-drawer.is-active {
  right: 0;
}

.mytheme-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 115;
  transition: opacity 0.3s ease;
}

.mytheme-drawer-overlay.is-active {
  display: block;
}

.mytheme-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--mytheme-border);
}

.mytheme-drawer-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mytheme-text);
  letter-spacing: -0.01em;
}

.mytheme-drawer-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f1f5f9;
  border: 1px solid var(--mytheme-border);
  border-radius: 50%;
  cursor: pointer;
  color: var(--mytheme-text);
  font-size: 1.4rem;
  line-height: 1;
  transition: all 0.2s ease;
}

.mytheme-drawer-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}

.mytheme-drawer-search {
  margin-bottom: 24px;
}

.mytheme-drawer-search .mytheme-search-form {
  display: flex;
  gap: 8px;
}

.mytheme-drawer-search input[type="search"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--mytheme-border);
  border-radius: 8px;
  font-size: 0.875rem;
  background: #f8fafc;
}

.mytheme-drawer-body {
  flex: 1;
}

.mytheme-drawer-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.mytheme-drawer-nav > li {
  list-style: none;
}

/* リンクとアコーディオントグルボタンの並び */
.mytheme-drawer-link-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.mytheme-drawer-link-wrapper:hover {
  background: #f1f5f9;
}

.mytheme-drawer-nav li a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--mytheme-text);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  flex: 1;
  transition: color 0.15s ease;
}

.mytheme-drawer-link-wrapper:hover > a {
  color: var(--mytheme-accent);
}

/* 子メニュートグルボタン（アコーディオン） */
.mytheme-sub-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: var(--mytheme-text-muted);
  font-size: 1rem;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mytheme-sub-menu-toggle:hover {
  color: var(--mytheme-text);
  background: rgba(0, 0, 0, 0.05);
}

.mytheme-sub-toggle-icon {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mytheme-drawer-nav .menu-item-has-children.is-open > .mytheme-drawer-link-wrapper .mytheme-sub-toggle-icon {
  transform: rotate(180deg);
}

/* ドロワー内のサブメニュー（デフォルト非表示・アコーディオン展開） */
.mytheme-drawer-nav .sub-menu {
  display: none;
  list-style: none;
  padding: 4px 0 4px 12px;
  margin: 2px 0 6px 12px;
  border-left: 2px solid #e2e8f0;
}

.mytheme-drawer-nav .menu-item-has-children.is-open > .sub-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mytheme-drawer-nav .sub-menu li a {
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mytheme-text-muted);
}

.mytheme-drawer-nav .sub-menu li a:hover {
  color: var(--mytheme-accent);
  background: #f8fafc;
}

.mytheme-drawer-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--mytheme-border);
  font-size: 0.75rem;
  color: var(--mytheme-text-muted);
  text-align: center;
}

/* ==========================================================================
   Ranking Ticker / Marquee (ヘッダー下ランキング - 背景#f6f5ea & 画面中央開始)
   ========================================================================== */
.mytheme-ticker-area {
  background: #f6f5ea;
  border-bottom: 1px solid #e8e6d9;
  overflow: hidden;
  height: 52px;
  display: flex;
  align-items: center;
}

.mytheme-ticker-container {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.mytheme-ticker-badge {
  display: inline-flex;
  align-items: center;
  background: #0f172a;
  color: #f8fafc;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.mytheme-ticker-viewport {
  overflow: hidden;
  position: relative;
  width: 100%;
  display: flex;
  mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
}

.mytheme-ticker-track {
  display: flex;
  gap: 16px;
  width: max-content;
  will-change: transform;
  /* 画面中央付近から1位が始まるように初期インデントを設定 */
  padding-left: calc(45vw - 50px);
  animation: mytheme-marquee 35s linear infinite;
}

.mytheme-ticker-track:hover,
.mytheme-ticker-track:focus-within {
  animation-play-state: paused;
}

@keyframes mytheme-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

.mytheme-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 12px 3px 5px;
  background: #ffffff;
  border: 1px solid #e5e3d7;
  border-radius: 8px;
  text-decoration: none;
  color: #334155;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.mytheme-ticker-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
  text-decoration: none;
}

.mytheme-ticker-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: #ffffff;
  background: #94a3b8;
  flex-shrink: 0;
}

.mytheme-ticker-rank.rank-1 {
  background: #d97706;
}

.mytheme-ticker-rank.rank-2 {
  background: #475569;
}

.mytheme-ticker-rank.rank-3 {
  background: #9a3412;
}

.mytheme-ticker-thumb {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  overflow: hidden;
  background: #f1f5f9;
  flex-shrink: 0;
}

.mytheme-ticker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mytheme-ticker-no-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 0.6rem;
  color: #94a3b8;
}

.mytheme-ticker-title {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .mytheme-ticker-title {
    max-width: 240px;
  }
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.mytheme-breadcrumb {
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--mytheme-text-muted);
}

.mytheme-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  gap: 8px;
}

.mytheme-breadcrumb li+li::before {
  content: ">";
  padding-right: 8px;
  color: var(--mytheme-text-muted);
}

/* ==========================================================================
   Article Cards (Index / Archive)
   ========================================================================== */
.mytheme-posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* 記事エリアの実際の幅で切り替える。サイドバーの有無に依存しない。 */
@container myblog-content (min-width: 600px) {
  .mytheme-posts-grid[data-grid-tablet="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mytheme-posts-grid[data-grid-tablet="1"] .mytheme-card {
    flex-direction: row;
  }

  .mytheme-posts-grid[data-grid-tablet="1"] .mytheme-card-thumb {
    width: 240px;
    height: auto;
    aspect-ratio: auto;
  }
}

@container myblog-content (min-width: 760px) {
  .mytheme-posts-grid[data-grid-pc="1"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .mytheme-posts-grid[data-grid-pc="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mytheme-posts-grid[data-grid-pc="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mytheme-posts-grid[data-grid-pc="1"] .mytheme-card {
    flex-direction: row;
  }

  .mytheme-posts-grid[data-grid-pc="1"] .mytheme-card-thumb {
    width: 240px;
    height: auto;
    aspect-ratio: auto;
  }

  .mytheme-posts-grid[data-grid-pc="2"] .mytheme-card,
  .mytheme-posts-grid[data-grid-pc="3"] .mytheme-card {
    flex-direction: column;
  }

  .mytheme-posts-grid[data-grid-pc="2"] .mytheme-card-thumb,
  .mytheme-posts-grid[data-grid-pc="3"] .mytheme-card-thumb {
    width: 100%;
    height: 180px;
    aspect-ratio: 16 / 9;
  }
}

.mytheme-card {
  background-color: var(--mytheme-surface);
  border-radius: var(--mytheme-radius);
  border: 1px solid var(--mytheme-border);
  overflow: hidden;
  box-shadow: var(--mytheme-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mytheme-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--mytheme-shadow-lg);
}

.mytheme-card-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #f3f4f6;
  flex-shrink: 0;
}

.mytheme-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.mytheme-card:hover .mytheme-card-thumb img {
  transform: scale(1.04);
}

.mytheme-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.mytheme-card-meta {
  font-size: 0.8125rem;
  color: var(--mytheme-text-muted);
  display: flex;
  gap: 12px;
  margin-bottom: 8px;
}

.mytheme-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}

.mytheme-card-title a {
  color: var(--mytheme-text);
}

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

.mytheme-card-excerpt {
  font-size: 0.9rem;
  color: var(--mytheme-text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Single Post
   ========================================================================== */
.mytheme-article {
  background-color: var(--mytheme-surface);
  border-radius: var(--mytheme-radius);
  border: 1px solid var(--mytheme-border);
  box-shadow: var(--mytheme-shadow);
  padding: 28px;
}

@media (min-width: 768px) {
  .mytheme-article {
    padding: 40px;
  }
}

.mytheme-article-header {
  margin-bottom: 28px;
}

.mytheme-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--mytheme-text-muted);
  margin-bottom: 12px;
}

.mytheme-article-title {
  font-size: 1.75rem;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
}

@media (min-width: 768px) {
  .mytheme-article-title {
    font-size: 2.25rem;
  }
}

.mytheme-article-thumb {
  margin-bottom: 32px;
  border-radius: var(--mytheme-radius);
  overflow: hidden;
}

.mytheme-article-content {
  font-size: 1.05rem;
  line-height: 1.85;
}

.mytheme-article-content h2 {
  font-size: 1.5rem;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mytheme-accent);
}

.mytheme-article-content h3 {
  font-size: 1.25rem;
  margin: 32px 0 12px;
  border-left: 4px solid var(--mytheme-accent);
  padding-left: 12px;
}

.mytheme-article-content p {
  margin-bottom: 20px;
}

.mytheme-article-content ul,
.mytheme-article-content ol {
  margin: 0 0 24px 24px;
}

.mytheme-article-content li {
  margin-bottom: 6px;
}

/* ==========================================================================
   Pagination (モダン・ページネーション)
   ========================================================================== */
.mytheme-pagination {
  margin: 48px 0 24px;
  display: flex;
  justify-content: center;
}

.mytheme-pagination .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mytheme-pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mytheme-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 8px;
  background-color: var(--mytheme-surface);
  border: 1px solid var(--mytheme-border);
  color: var(--mytheme-text);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.mytheme-pagination .page-numbers:hover:not(.current):not(.dots) {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: var(--mytheme-accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  text-decoration: none;
}

.mytheme-pagination .page-numbers.current {
  background-color: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.15);
}

.mytheme-pagination .page-numbers.dots {
  border: none;
  background: transparent;
  box-shadow: none;
  min-width: 24px;
  color: var(--mytheme-text-muted);
  cursor: default;
}

.mytheme-pagination .page-numbers.prev,
.mytheme-pagination .page-numbers.next {
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 0 16px;
  background-color: #ffffff;
}

.mytheme-pagination .page-numbers.prev:hover,
.mytheme-pagination .page-numbers.next:hover {
  background-color: #f1f5f9;
  border-color: var(--mytheme-accent);
  color: var(--mytheme-accent);
}

/* ==========================================================================
   Sidebar & Widgets
   ========================================================================== */
.mytheme-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.mytheme-widget {
  background-color: var(--mytheme-surface);
  border-radius: var(--mytheme-radius);
  border: 1px solid var(--mytheme-border);
  box-shadow: var(--mytheme-shadow);
  padding: 24px;
}

.mytheme-widget-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--mytheme-accent);
}

.mytheme-widget ul {
  list-style: none;
}

.mytheme-widget ul li {
  padding: 8px 0;
  border-bottom: 1px solid var(--mytheme-border);
}

.mytheme-widget ul li:last-child {
  border-bottom: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.mytheme-footer {
  margin-top: auto;
  background-color: var(--mytheme-primary);
  color: #9ca3af;
  padding: 40px 0 24px;
  font-size: 0.875rem;
}

.mytheme-footer-copy {
  text-align: center;
  border-top: 1px solid #374151;
  padding-top: 24px;
  margin-top: 24px;
}
/* Keyboard navigation and clear list/article context. */
.mytheme-skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  transform: translateY(-160%);
  padding: 10px 16px;
  background: #fff;
  color: #111;
  border: 2px solid currentColor;
}

.mytheme-skip-link:focus {
  transform: translateY(0);
}

.mytheme-list-title {
  margin: 24px 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.mytheme-article-author {
  margin: 10px 0 0;
}

:where(a, button, input):focus-visible {
  outline: 3px solid var(--mytheme-accent);
  outline-offset: 3px;
}

.mytheme-article-summary {
  margin: 0 0 24px;
  padding: 16px 20px;
  background: var(--mytheme-bg);
  border-left: 4px solid var(--mytheme-accent);
  font-size: 1.0625rem;
  line-height: 1.8;
}

.mytheme-related-posts {
  margin: 40px 0;
}

.mytheme-related-posts > h2 {
  margin-bottom: 20px;
  font-size: 1.5rem;
}

.mytheme-author-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 24px 0;
  padding: 20px;
  background: var(--mytheme-surface);
  border: 1px solid var(--mytheme-border);
  border-radius: var(--mytheme-radius);
}

.mytheme-author-avatar {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
}

.mytheme-author-box h2 {
  font-size: 1.125rem;
  margin-bottom: 6px;
}

.mytheme-author-box p {
  line-height: 1.7;
}

.post-navigation {
  margin: 24px 0;
}

.post-navigation .nav-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}

.post-navigation a {
  display: block;
  height: 100%;
  padding: 16px;
  background: var(--mytheme-surface);
  border: 1px solid var(--mytheme-border);
  border-radius: var(--mytheme-radius);
}

.mytheme-post-nav-label,
.mytheme-post-nav-title {
  display: block;
}

.mytheme-post-nav-label {
  color: var(--mytheme-text-muted);
  font-size: 0.8125rem;
}

.mytheme-post-nav-title {
  margin-top: 4px;
  font-weight: 700;
}

/* Long-form articles, including content written with earlier themes. */
.mytheme-article-content {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mytheme-article-content :is(h2, h3, h4) {
  scroll-margin-top: 96px;
}

.mytheme-article-content :is(h4, h5, h6) {
  margin: 28px 0 12px;
  line-height: 1.5;
}

.mytheme-article-content :is(figure, blockquote, pre, table, .wp-block-embed, .wp-block-table) {
  margin: 24px 0;
}

.mytheme-article-content :is(figcaption, .wp-caption-text) {
  margin-top: 8px;
  color: var(--mytheme-text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.mytheme-article-content blockquote {
  padding: 8px 0 8px 18px;
  border-left: 4px solid var(--mytheme-accent);
  color: var(--mytheme-primary);
}

.mytheme-article-content :is(pre, .wp-block-code) {
  max-width: 100%;
  overflow-x: auto;
  padding: 16px;
  background: #f1f5f9;
  border-radius: var(--mytheme-radius);
  font-size: 0.9rem;
  line-height: 1.6;
}

.mytheme-article-content :not(pre) > code {
  padding: 0.1em 0.3em;
  background: #f1f5f9;
  border-radius: 3px;
  font-size: 0.9em;
}

.mytheme-article-content :is(table, .wp-block-table) {
  max-width: 100%;
  overflow-x: auto;
}

.mytheme-article-content table {
  display: block;
  border-collapse: collapse;
  white-space: nowrap;
}

.mytheme-article-content :is(th, td) {
  padding: 10px 12px;
  border: 1px solid var(--mytheme-border);
  text-align: left;
}

.mytheme-article-content :is(iframe, video) {
  max-width: 100%;
}

.mytheme-article-content .wp-block-embed__wrapper {
  max-width: 100%;
}

.mytheme-article-toc {
  margin: 0 0 32px;
  padding: 20px;
  background: var(--mytheme-bg);
  border: 1px solid var(--mytheme-border);
  border-radius: var(--mytheme-radius);
}

.mytheme-article-toc h2 {
  margin-bottom: 12px;
  font-size: 1.125rem;
}

.mytheme-article-toc ol {
  margin-left: 1.5em;
}

.mytheme-article-toc li + li {
  margin-top: 6px;
}

.mytheme-toc-subitem {
  margin-left: 1.25em;
  font-size: 0.9375rem;
}

.mytheme-comments {
  margin: 40px 0;
  padding: 24px;
  background: var(--mytheme-surface);
  border: 1px solid var(--mytheme-border);
  border-radius: var(--mytheme-radius);
}

.mytheme-comments h2,
.mytheme-comments .comment-reply-title {
  margin-bottom: 16px;
  font-size: 1.35rem;
}

.mytheme-comment-list {
  list-style: none;
  margin-bottom: 32px;
}

.mytheme-comment-list .comment {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--mytheme-border);
  border-radius: var(--mytheme-radius);
}

.mytheme-comment-list .children {
  list-style: none;
  margin-left: min(24px, 5vw);
}

.mytheme-comment-list .comment-meta {
  margin-bottom: 8px;
  font-size: 0.875rem;
}

.mytheme-comments :is(input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], textarea) {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid var(--mytheme-border);
  border-radius: var(--mytheme-radius);
  font: inherit;
}

.mytheme-comments .comment-form > p {
  margin-bottom: 16px;
}

.mytheme-comments input[type="submit"] {
  padding: 10px 20px;
  background: var(--mytheme-accent);
  color: #fff;
  border: 0;
  border-radius: var(--mytheme-radius);
  cursor: pointer;
}

/* Article-end ad: one quiet, clearly labelled slot outside the prose. */
.mytheme-article-ad {
  margin: 48px 0 40px;
  padding: 20px 16px;
  min-height: 220px;
  border-block: 1px solid var(--mytheme-border);
  background: #f8fafc;
  text-align: center;
}

.mytheme-article-ad-label,
.mytheme-amazon-card-label {
  margin: 0 0 14px;
  color: var(--mytheme-text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.mytheme-article-ad-widget {
  max-width: 100%;
}

.mytheme-article-ad :is(ins, iframe) {
  max-width: 100%;
}

/* Affiliate cards belong beside relevant editorial context, not over it. */
.mytheme-article-content .mytheme-amazon-card {
  margin: 32px 0;
  padding: 18px;
  border: 1px solid var(--mytheme-border);
  border-radius: 12px;
  background: #f8fafc;
  box-shadow: 0 2px 10px rgb(15 23 42 / 4%);
  line-height: 1.55;
}

.mytheme-amazon-card-content {
  display: flex;
  align-items: center;
  gap: 20px;
}

.mytheme-amazon-card-media {
  flex: 0 0 112px;
  width: 112px;
  height: 112px;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.mytheme-amazon-card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.mytheme-amazon-card-copy {
  min-width: 0;
}

.mytheme-article-content .mytheme-amazon-card-title {
  margin: 0 0 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--mytheme-text);
}

.mytheme-article-content .mytheme-amazon-card-description {
  margin: 0 0 14px;
  color: var(--mytheme-text-muted);
  font-size: 0.9rem;
}

.mytheme-amazon-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 9px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: var(--mytheme-text);
  font-size: 0.88rem;
  font-weight: 700;
}

.mytheme-amazon-card-link:hover {
  border-color: var(--mytheme-accent);
  color: var(--mytheme-accent);
  text-decoration: none;
}

.mytheme-article-content .mytheme-amazon-card-disclosure {
  margin: 14px 0 0;
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.55;
}

@media (max-width: 480px) {
  .mytheme-amazon-card-content {
    align-items: flex-start;
    gap: 14px;
  }

  .mytheme-amazon-card-media {
    flex-basis: 76px;
    width: 76px;
    height: 76px;
  }
}
