/*
Theme Name: tinywag
Theme URI: https://tinywag.com
Description: Custom WordPress theme for tinywag - Dory's adventures
Version: 3.5.0
Author: tinywag
Author URI: https://tinywag.com
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tinywag
*/

/* ==========================================================================
   1. Variables & Reset
   ========================================================================== */

:root {
  /* Color System - WCAG AA Compliant (4.5:1 contrast ratio) */
  --bg-body: #f8f9fa;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-tertiary: #6b7280;
  --text-muted: #9ca3af;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #dbeafe;
  --accent-dark: #1e40af;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --border-focus: #3b82f6;
  --error: #dc2626;
  --success: #16a34a;
  --warning: #f59e0b;
  --info: #0ea5e9;
  --hamburger-color: #111827;

  /* Typography System */
  --font-main:
    "LINE Seed JP", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo,
    sans-serif;
  --font-heading: var(--font-main);
  --font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono",
    monospace;

  /* Type Scale - Minor Third (1.200 ratio) - Readable editorial scale */
  --text-xs: 0.75rem;   /* 12px - minimum legible size */
  --text-sm: 0.875rem;  /* 14px */
  --text-base: 1rem;    /* 16px - WCAG recommended minimum for body */
  --text-lg: 1.0625rem; /* 17px */
  --text-xl: 1.1875rem; /* 19px */
  --text-2xl: 1.375rem; /* 22px */
  --text-3xl: 1.625rem; /* 26px */
  --text-4xl: 1.875rem; /* 30px */
  --text-5xl: 2.125rem; /* 34px */

  /* Line Heights - Optimized for Japanese and English mix */
  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.55;
  --line-height-relaxed: 1.7;
  --line-height-loose: 1.8;
  --line-height-base: 1.65;
  --line-height-heading: 1.3;
  --line-height-body: 1.75; /* relaxed for Japanese/mixed body text */

  /* Spacing Scale (Fluid spacing with 4px/8px grid base) */
  --container-width: 1400px;
  --fixed-page-shell-width: 1680px;
  --content-reading-width: 860px; /* Wider but still readable long-form width */
  --content-max-ch: 78ch; /* Character-based max for text elements */
  --space-0: 0;
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem; /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem; /* 24px */
  --space-8: 2rem; /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem; /* 48px */
  --space-16: 4rem; /* 64px */
  --space-20: 5rem; /* 80px */
  --space-24: 6rem; /* 96px */
  --space-32: 8rem; /* 128px */

  /* Legacy spacing (backwards compatibility) */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 8rem;

  /* Component-Specific Spacing - Balanced for visual harmony */
  --space-card-gap: clamp(0.75rem, 2vw, 1.25rem);
  --space-card-padding: clamp(1rem, 3vw, 1.5rem);
  --space-content-gap: clamp(1.5rem, 4vw, 2.5rem);
  --space-section-gap: clamp(2rem, 6vw, 4rem);
  --space-article-padding: clamp(1.25rem, 4vw, 2rem);
  --mobile-content-gutter: clamp(0.875rem, 4vw, 1rem);
  --layout-inline-padding: var(--mobile-content-gutter);
  --content-inline-inset: clamp(0.5rem, 1.25vw, 1rem);
  --mobile-card-padding: clamp(0.8rem, 2.6vw, 0.95rem);

  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 0.25rem; /* 4px */
  --radius-md: 0.5rem; /* 8px */
  --radius-lg: 0.75rem; /* 12px */
  --radius-xl: 1rem; /* 16px */
  --radius-2xl: 1.5rem; /* 24px */
  --radius-full: 9999px;

  /* Shadows - Modern elevation system */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm:
    0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: var(--transition-base);

  /* Easing Functions */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-Index Scale - Centralized management */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 500;
  --z-header: 1000;
  --z-overlay: 5000;
  --z-menu-backdrop: 9999;
  --z-menu-panel: 10000;
  --z-menu-button: 10002;
  --z-modal: 15000;
  --z-notification: 20000;
  --z-tooltip: 25000;

  /* ========================================================================
     TELEMETRY SYSTEM - Engineering Console Colors
     These variables are intentionally separate (dark-mode dashboard),
     referencing the main accent/success/warning/error colors where applicable.
     ======================================================================== */

  /* Engineering Console Colors */
  --telemetry-bg-primary: #1e293b; /* Slate 800 - Better readability */
  --telemetry-bg-secondary: #334155; /* Slate 700 - Card background */
  --telemetry-bg-tertiary: #475569; /* Slate 600 - Elevated elements */
  --telemetry-text-primary: #f8fafc; /* Slate 50 - High contrast white */
  --telemetry-text-secondary: #cbd5e1; /* Slate 300 - Readable muted text */
  --telemetry-text-tertiary: #94a3b8; /* Slate 400 - Subtle text with better contrast */
  --telemetry-accent-blue: #60a5fa; /* Blue 400 - Brighter, more visible */
  --telemetry-accent-cyan: #22d3ee; /* Cyan 400 - More vibrant */
  --telemetry-accent-green: #34d399; /* Emerald 400 - Success indicator */
  --telemetry-accent-yellow: #fbbf24; /* Amber 400 - Warning with better visibility */
  --telemetry-accent-red: #f87171; /* Red 400 - Error with softer appearance */
  --telemetry-border: #475569; /* Slate 600 - More visible borders */
  --telemetry-border-bright: #64748b; /* Slate 500 - Emphasis borders */

  /* Telemetry Typography */
  --font-mono-telemetry:
    "SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace;

  /* Telemetry Spacing */
  --telemetry-grid-gap: 1.5rem;
  --telemetry-card-padding: 1.5rem;

  /* Telemetry Shadows (Subtle for dark mode) */
  --telemetry-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --telemetry-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.6);
  --telemetry-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.7);
  --telemetry-shadow-glow: 0 0 15px rgba(59, 130, 246, 0.3);
}

@media (min-width: 768px) {
  :root {
    --layout-inline-padding: var(--space-6);
  }
}

@media (min-width: 1024px) {
  :root {
    --layout-inline-padding: var(--space-8);
  }
}

/* Screen Reader Only - Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    /* --hamburger-color: #ffffff; Removed to ensure visibility on white header */
  }
}

/* Accessibility: Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

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

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: var(--text-base);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: var(--line-height-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
}

/* Lock page scroll when mobile menu is open without forcing scroll restoration */
html.menu-open,
body.menu-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.menu-open {
  position: fixed;
  left: 0;
  right: 0;
  height: 100vh;
  width: 100%;
}

/* Prevent horizontal overflow globally */
html {
  overflow-x: hidden;
  width: 100%;
  scroll-behavior: smooth;
}

/* Ensure all images are responsive by default - CLS Prevention */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Prevent CLS (Cumulative Layout Shift) for images */
img[width][height] {
  height: auto;
  aspect-ratio: attr(width) / attr(height);
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16 / 9) {
  img[width][height] {
    height: auto;
  }
}

/* Ensure all figures and media are responsive */
figure,
.wp-block-image,
.wp-block-media-text,
.wp-block-gallery {
  max-width: 100%;
}

figure img,
.wp-block-image img {
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* ==========================================================================
   2. Typography & Readability
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--line-height-heading);
  margin-top: 1.75em; /* Em-based for proportional scaling */
  margin-bottom: 0.6em;
  color: var(--text-primary);
  letter-spacing: -0.01em; /* Less aggressive for Japanese */
}

h1:first-child,
h2:first-child,
h3:first-child {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.25rem, 3.5vw, 1.75rem); /* 20-28px */
}
h2 {
  font-size: clamp(1.125rem, 3vw, 1.4rem); /* editorial scale */
}
h3 {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}
h4 {
  font-size: clamp(0.9375rem, 2vw, 1.0625rem); /* 15-17px */
}
h5 {
  font-size: 1rem; /* 16px */
}
h6 {
  font-size: 0.8125rem; /* 13px */
  text-transform: uppercase;
  letter-spacing: 0.1em; /* Increased tracking for caps */
  color: var(--text-tertiary);
}

p {
  margin-top: 0;
  margin-bottom: 1.4em; /* tighter vertical rhythm */
  max-width: none;
  line-height: var(--line-height-body);
}

.page-content p {
  max-width: var(--content-max-ch);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

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

/* ========================================================================
   ENHANCED ACCESSIBILITY - Focus Indicators
   ======================================================================== */

/* Universal focus indicator */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Stronger focus for interactive elements */
button:focus-visible,
.button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline-width: 3px;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.fixed-json-page a:focus-visible,
.dashboard-page a:focus-visible {
  text-decoration: none;
}

.article-body a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.article-body
  a:not(.button):not(.amazon-button):not(.tag-link):not(
    .related-post-card-link
  ):not(.related-post-link):focus-visible {
  background: color-mix(in srgb, var(--accent) 10%, white);
  border-radius: 0.16em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

.ai-card:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  box-shadow: var(--shadow-lg);
}

.desktop-nav .nav-menu a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  color: var(--accent);
}

a.card-link:focus-visible {
  outline-width: 3px;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 0.75rem 1.5rem;
  z-index: var(--z-modal);
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: top var(--transition-base);
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --border: #000000;
    --text-secondary: #1f2937;
  }

  .ai-card,
  .telemetry-metric-card,
  .comparison-card {
    border: 2px solid var(--border);
  }

  .button,
  .btn {
    border: 2px solid currentColor;
  }
}

/* End Enhanced Accessibility */

/* ==========================================================================
   Theme Fixes
   ========================================================================== */

/* Ensure content images are responsive */
.article-body img,
.page-content img {
  max-width: 100%;
  height: auto;
}

/* Ensure hamburger menu is always on top */
/* Removed: z-index is now properly managed via --z-menu-panel variable */

/* Article body typography */
.article-body {
  font-size: 1rem; /* Accessibility standard (16px) for better readability */
  letter-spacing: 0.02em; /* Improved readability */
  line-height: var(
    --line-height-body
  ); /* Using the optimized body line height */
  color: var(--text-primary);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.article-body pre {
  max-width: 100%;
  overflow-x: auto;
}

.article-body code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Safeguard: Any h1 in article body should be styled as h2 (prevents duplicate h1 issues) */
.article-body h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  margin-top: 2em;
  margin-bottom: 0.8em;
  font-weight: 700;
}

.article-body h1[data-heading-level="1"],
.article-body h2[data-heading-level="1"] {
  margin-top: 0;
}

.article-body h2:first-of-type {
  margin-top: 0;
}

.article-body p {
  margin-top: 0;
  margin-bottom: 1.5rem; /* balanced paragraph spacing */
  max-width: var(--content-max-ch);
  line-height: var(--line-height-body);
}

/* Consistent reading width for all content elements */
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body .ai-summary {
  max-width: var(--content-max-ch);
}

.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  scroll-margin-top: 112px;
}

.article-body :is(h2, h3, h4, h5, h6):target,
.fixed-json-page :is(h2, h3, h4, h5, h6):target,
.dashboard-page :is(section, .dashboard-card, .dashboard-section):target {
  background: color-mix(in srgb, var(--accent) 9%, white);
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--accent) 72%, transparent);
  border-radius: var(--radius-sm);
}

/* Lists need proper indentation */
.article-body ul,
.article-body ol {
  padding-left: 2rem; /* Ensure bullets/numbers have space */
}

/* Nested lists should not have additional max-width */
.article-body ul ul,
.article-body ul ol,
.article-body ol ul,
.article-body ol ol {
  max-width: none;
}

/* Wide media elements should use full content width */
.article-body img,
.article-body figure,
.article-body table,
.article-body iframe,
.article-body video,
.article-body .wp-block-image,
.article-body .wp-block-video,
.article-body .wp-block-embed {
  max-width: 100%; /* Allow full content area width, not limited to 65ch */
}

/* Navigation and related content should be full width */
.article-body .related-posts,
.article-body .post-navigation,
.article-category-property {
  max-width: none;
}

/* Blockquote - Enhanced readability */
blockquote {
  margin: 2rem 0; /* comfortable breathing room */
  padding: 1.5rem 2rem;
  border-left: 4px solid var(--accent);
  background: linear-gradient(
    90deg,
    rgba(37, 99, 235, 0.06) 0%,
    rgba(37, 99, 235, 0.01) 100%
  );
  font-style: italic;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  position: relative;
  box-shadow: var(--shadow-sm);
}

blockquote::before {
  content: '"';
  font-size: 3.5rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.1;
  position: absolute;
  top: 0.25rem;
  left: 0.5rem;
  font-family: Georgia, serif;
}

blockquote p {
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

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

blockquote cite {
  display: block;
  margin-top: 1rem;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--text-tertiary);
  font-weight: 600;
}

blockquote cite::before {
  content: "— ";
}

/* Image Captions */
figure figcaption,
.wp-caption-text,
.wp-element-caption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--text-tertiary);
  text-align: center;
  line-height: 1.5;
  padding: 0 1rem;
}

figure figcaption::before {
  content: "▴ ";
  color: var(--accent);
  font-style: normal;
}

/* Enhanced image figure */
figure {
  margin: 1.5rem 0;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   3. Layout & Structure
   ========================================================================== */

/* Article Header Styles */
.article-header {
  padding: clamp(2rem, 5vw, 3rem) 0 clamp(1rem, 3vw, 1.5rem);
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(1.25rem, 4vw, 2rem);
  text-align: center;
}

.article-title {
  font-size: clamp(1.375rem, 4vw, 2rem);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
  font-weight: 700;
  margin-top: 0;
  color: var(--text-primary);
  text-align: left;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  align-items: center;
  justify-content: flex-start;
  font-weight: 500;
}

.article-meta .meta-separator {
  color: var(--text-muted);
}

body.single .article-header {
  padding-bottom: clamp(0.625rem, 1.8vw, 0.875rem);
  margin-bottom: clamp(0.75rem, 2vw, 1rem);
}

.category-badge {
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.process-badge {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}

/* End Article Header Styles */

/* ==========================================================================
   統合コンテナシステム - モバイルファースト最適化
   ========================================================================== */

/**
 * .layout-container
 * 目的: ページ全体のラッパー (max-width制約 + 横パディング)
 * 使用: すべてのページコンテンツをラップ
 */
.layout-container {
  max-width: var(--container-width); /* 1280px */
  margin: 0 auto;
  width: 100%;

  /* モバイル: 16px 横パディング - テキストが端に近づきすぎないよう確保 */
  padding-left: var(--layout-inline-padding);
  padding-right: var(--layout-inline-padding);
  padding-top: 0;
  padding-bottom: 0;
}

/**
 * .layout-container--with-vertical
 * 目的: 縦パディングを追加するモディファイア + サイドバー対応の2カラムレイアウト
 */
.layout-container--with-vertical {
  padding-top: var(--space-6); /* 24px */
  padding-bottom: var(--space-10); /* 40px - カードUI廃止でフッターとの間隔を確保 */

  /* デスクトップ: サイドバーとの2カラムレイアウト */
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .layout-container--with-vertical {
    padding-top: var(--space-8); /* 32px */
    padding-bottom: var(--space-12); /* 48px */
  }
}

@media (min-width: 1025px) {
  .layout-container--with-vertical {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
  }

  /* メインコンテンツエリア: 柔軟に伸縮 */
  .layout-container--with-vertical > main {
    flex: 1;
    min-width: 0; /* Flexboxオーバーフロー防止 */
  }
}

/**
 * Fixed Page Shell
 * 目的: 固定ページの本文幅を統一
 */
.layout-container.layout-container--with-vertical.fixed-page-shell {
  max-width: var(--fixed-page-shell-width);
  margin-left: auto;
  margin-right: auto;
}

.fixed-page-shell .page-wrapper {
  width: 100%;
  max-width: min(100%, 1200px);
}

.fixed-page-shell .fixed-page-last-updated {
  width: fit-content;
  max-width: calc(100% - (2 * clamp(0.75rem, 2vw, 1.25rem)));
  margin: 1rem clamp(0.75rem, 2vw, 1.25rem) 0 auto;
  padding: 0.55rem 0.85rem;
  display: block;
  text-align: right;
  font-size: 0.8125rem;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--text-secondary, #4b5563) 86%, #0f172a);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 4%, #ffffff) 0%, #ffffff 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
  border-radius: 0.95rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.fixed-page-shell .container {
  padding-left: 0;
  padding-right: 0;
}

.fixed-page-shell .page-hero {
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

.fixed-page-shell .page-hero .page-hero__title {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.fixed-page-shell .page-hero .page-hero__subtitle {
  max-width: 64ch;
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.8;
  color: var(--text-secondary);
}

.fixed-page-shell .page-content--editorial {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3rem);
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.fixed-page-shell .page-content--editorial > * {
  width: 100%;
}

.fixed-page-shell .page-content--editorial > p,
.fixed-page-shell .page-content--editorial > ul,
.fixed-page-shell .page-content--editorial > ol,
.fixed-page-shell .page-content--editorial > blockquote,
.fixed-page-shell .page-content--editorial > h2,
.fixed-page-shell .page-content--editorial > h3,
.fixed-page-shell .page-content--editorial > h4,
.fixed-page-shell .page-content--editorial > details,
.fixed-page-shell .page-content--editorial > .wp-block-heading,
.fixed-page-shell .page-content--editorial > .wp-block-list,
.fixed-page-shell .page-content--editorial > .wp-block-quote,
.fixed-page-shell .page-content--editorial > .wp-block-table,
.fixed-page-shell .page-content--editorial > .wp-block-columns,
.fixed-page-shell .page-content--editorial > .wp-block-group,
.fixed-page-shell .page-content--editorial > .wp-block-media-text {
  max-width: min(100%, 920px);
}

.fixed-page-shell .page-content--editorial > h2,
.fixed-page-shell .page-content--editorial > .wp-block-heading {
  margin-top: 0;
  padding-top: 1.25rem;
  border-top: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
}

.fixed-page-shell .page-content--editorial > h2:first-of-type,
.fixed-page-shell .page-content--editorial > .fixed-page-overview + h2,
.fixed-page-shell .page-content--editorial > .fixed-page-overview + .wp-block-heading {
  border-top: none;
  padding-top: 0;
}

.fixed-page-shell .page-content--editorial > p,
.fixed-page-shell .page-content--editorial > li,
.fixed-page-shell .page-content--editorial .wp-block-paragraph {
  font-size: clamp(1rem, 0.92vw, 1.08rem);
  line-height: 1.82;
}

.fixed-page-shell .page-content--editorial > .wp-block-image,
.fixed-page-shell .page-content--editorial > figure,
.fixed-page-shell .page-content--editorial > .wp-block-gallery,
.fixed-page-shell .page-content--editorial > .wp-block-cover,
.fixed-page-shell .page-content--editorial > .wp-block-embed {
  max-width: min(100%, 980px);
}

@media (max-width: 768px) {
  .fixed-page-shell .page-hero .page-hero__subtitle {
    font-size: 1rem;
    line-height: 1.72;
  }

  .fixed-page-shell .page-content--editorial > p,
  .fixed-page-shell .page-content--editorial > li,
  .fixed-page-shell .page-content--editorial .wp-block-paragraph {
    font-size: 1rem;
    line-height: 1.76;
  }
}

.fixed-page-shell .page-content--editorial a,
.fixed-page-shell .page-content--editorial code {
  overflow-wrap: anywhere;
  word-break: normal;
}

.fixed-page-shell .page-content--editorial pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
}

.fixed-page-shell .page-content--editorial .wp-block-table,
.fixed-page-shell .page-content--editorial table {
  max-width: 100%;
}

.fixed-page-shell .page-content--editorial .wp-block-table {
  overflow-x: auto;
}

.fixed-page-overview {
  padding: clamp(1.4rem, 2.8vw, 2rem);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 11%, transparent), transparent 38%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.05);
}

.fixed-page-overview__header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "eyebrow meta"
    "content meta";
  column-gap: 1rem;
  row-gap: 0.35rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.fixed-page-overview__eyebrow,
.fixed-page-next-read__eyebrow {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 78%, #1e293b);
}

.fixed-page-overview__eyebrow {
  grid-area: eyebrow;
}

.fixed-page-overview__header > div {
  grid-area: content;
  min-width: 0;
}

.fixed-page-overview__title,
.fixed-page-next-read__title {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.9rem);
}

.fixed-page-overview__description,
.fixed-page-next-read__description {
  margin: 0.5rem 0 0;
  max-width: 64ch;
  color: var(--text-secondary);
}

.fixed-page-overview__meta {
  grid-area: meta;
  justify-self: end;
  align-self: end;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  color: color-mix(in srgb, var(--accent) 70%, #334155);
  font-size: 0.82rem;
  font-weight: 700;
}

.fixed-page-overview__grid,
.fixed-page-next-read__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.fixed-page-overview__card,
.fixed-page-next-read__card {
  min-width: 0;
  padding: 1.05rem 1.1rem;
  border-radius: 1.1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
  background: rgba(255, 255, 255, 0.92);
}

.fixed-page-overview__card--link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
  color: inherit;
  text-decoration: none;
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.fixed-page-overview__card--link:hover,
.fixed-page-overview__card--link:focus {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
  text-decoration: none;
}

.fixed-page-overview__card-body {
  min-width: 0;
}

.fixed-page-overview__card-title,
.fixed-page-next-read__card-title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.fixed-page-overview__card-description,
.fixed-page-next-read__card-description {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.75;
}

.fixed-page-overview__card-arrow {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  color: color-mix(in srgb, var(--accent) 72%, #334155);
  font-size: 1rem;
  font-weight: 700;
}

.fixed-page-next-read {
  padding: clamp(1.5rem, 3vw, 2.2rem);
  border-radius: 1.6rem;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, #ffffff) 0%, #ffffff 45%, color-mix(in srgb, var(--accent) 12%, #f8fafc) 100%);
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
}

.fixed-page-next-read__intro {
  margin-bottom: 1.25rem;
}

.fixed-page-next-read__featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, #123) 0%, color-mix(in srgb, var(--accent) 58%, #0f172a) 100%);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 20px 44px rgba(37, 99, 235, 0.22);
}

.fixed-page-next-read__featured:hover,
.fixed-page-next-read__card:hover {
  transform: translateY(-2px);
}

.fixed-page-next-read__featured-label,
.fixed-page-next-read__more-label {
  margin: 0 0 0.6rem;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fixed-page-next-read__featured-main {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.fixed-page-next-read__featured-icon,
.fixed-page-next-read__card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.fixed-page-next-read__featured-title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.1rem, 1.8vw, 1.45rem);
}

.fixed-page-next-read__featured-description {
  margin: 0.45rem 0 0;
  max-width: 52ch;
  color: rgba(255, 255, 255, 0.9);
}

.fixed-page-next-read__featured-cta {
  align-self: end;
  justify-self: end;
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
}

.fixed-page-next-read__more {
  margin-top: 1rem;
}

.fixed-page-next-read__card {
  text-decoration: none;
  color: inherit;
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.fixed-page-next-read__card:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
}

/* Fixed Page Sidebar */
.fixed-page-sidebar {
  display: none;
  width: 260px;
  max-width: 260px;
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
  order: 2;
  align-self: flex-start;
  overflow: visible;
}

.fixed-page-sidebar__inner {
  height: auto;
  min-height: 0;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-group + .sidebar-group {
  margin-top: 1rem;
}

.sidebar-group__title {
  margin: 0 0 0.55rem 0.25rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #64748b;
}

.sidebar-group__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  transition: all 0.2s ease;
}

.sidebar-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

.sidebar-item--active {
  background: #eff6ff;
  color: #2563eb;
  font-weight: 700;
}

.sidebar-item__icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
  width: 1.25em;
  text-align: center;
}

.sidebar-item__label {
  flex: 1;
}

@media (min-width: 1025px) {
  .layout-container.layout-container--with-vertical.fixed-page-shell {
    align-items: flex-start;
    overflow: visible;
  }

  .layout-container.layout-container--with-vertical.fixed-page-shell > .page-wrapper {
    flex: 1 1 auto;
    min-width: 0;
  }

  .layout-container.layout-container--with-vertical.fixed-page-shell > .fixed-page-sidebar {
    display: block;
    flex: 0 0 260px;
    align-self: flex-start;
    overflow: visible;
  }

  .layout-container.layout-container--with-vertical.fixed-page-shell
    > .fixed-page-sidebar
    .fixed-page-sidebar__inner {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 2rem;
    max-height: calc(100vh - 4rem) !important;
    overflow: auto !important;
  }
}

@media (max-width: 1024px) {
  .fixed-page-shell .page-wrapper {
    max-width: 100%;
  }

  .fixed-page-overview__header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "eyebrow"
      "content"
      "meta";
    align-items: start;
  }

  .fixed-page-overview__meta {
    justify-self: start;
  }

  .fixed-page-next-read__featured {
    grid-template-columns: 1fr;
  }

  .fixed-page-overview__grid,
  .fixed-page-next-read__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 767px) {
  .fixed-page-overview {
    padding: 1.1rem 1rem;
  }

  .fixed-page-overview__description {
    display: none;
  }

  .fixed-page-overview__meta {
    display: block;
    font-size: 0.78rem;
    line-height: 1.45;
  }

  .fixed-page-overview__grid {
    gap: 0.7rem;
  }

  .fixed-page-overview__card,
  .fixed-page-overview__card--link {
    align-items: center;
    padding: 0.9rem 1rem;
  }

  .fixed-page-overview__card-title {
    margin: 0;
    font-size: 0.97rem;
    line-height: 1.45;
  }

  .fixed-page-overview__card-description {
    display: -webkit-box;
    margin-top: 0.35rem;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .fixed-page-overview__card-arrow {
    width: 1.8rem;
    height: 1.8rem;
    font-size: 0.95rem;
  }
}

/* Fixed Page Clarity Navigation */
.fixed-page-clarity-nav {
  margin: 0;
  padding: clamp(1rem, 2.2vw, 1.5rem);
  border-radius: 1.25rem;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border));
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 12%, transparent), transparent 36%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

@media (min-width: 1025px) {
  .fixed-page-clarity-nav {
    position: sticky;
    top: 1.25rem;
    z-index: 3;
  }
}

.fixed-page-clarity-nav__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 0.9rem;
}

.fixed-page-clarity-nav__title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 74%, #1e293b);
}

.fixed-page-clarity-nav__meta {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-tertiary);
}

.fixed-page-clarity-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.fixed-page-clarity-nav.is-dense .fixed-page-clarity-nav__list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.fixed-page-clarity-nav__link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  text-decoration: none;
  color: var(--text-primary);
  padding: 0.55rem 0.6rem;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 8%, var(--border));
  background: rgba(255, 255, 255, 0.9);
  transition:
    transform var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base);
}

.fixed-page-clarity-nav__link:hover,
.fixed-page-clarity-nav__link:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--border));
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  text-decoration: none;
}

.fixed-page-clarity-nav__link.is-active {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border));
  background: color-mix(in srgb, var(--accent) 9%, #fff);
}

.fixed-page-clarity-nav__index {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  color: color-mix(in srgb, var(--accent) 78%, #0f172a);
  background: color-mix(in srgb, var(--accent) 14%, #fff);
}

.fixed-page-clarity-nav__text {
  font-size: 0.9rem;
  line-height: 1.35;
}

@media (max-width: 767px) {
  .fixed-page-clarity-nav {
    padding: 0.9rem;
    border-radius: 1rem;
  }

  .fixed-page-clarity-nav__list {
    grid-template-columns: 1fr;
  }

  .fixed-page-clarity-nav__text {
    font-size: 0.86rem;
  }
}

@media (max-width: 1024px) {
  .fixed-page-clarity-nav.is-dense .fixed-page-clarity-nav__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/**
 * .content-wrapper
 * 目的: 投稿コンテンツのラッパー (フルブリード設計 - カードUI廃止)
 * カード背景・ボーダー・シャドウを削除し、body背景と統一
 */
.content-wrapper {
  width: 100%;
}

/**
 * .header-layout
 * 目的: ヘッダー専用コンテナ (ナビゲーション用に広めのmax-width)
 */
.header-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding-left: var(--layout-inline-padding);
  padding-right: var(--layout-inline-padding);
}

/**
 * .footer-layout
 * 目的: フッター専用コンテナ
 */
.footer-layout {
  max-width: var(--container-width);
  margin: 0 auto;
  padding-left: var(--layout-inline-padding);
  padding-right: var(--layout-inline-padding);
}

/* ==========================================================================
   4. COMPONENTS
   ========================================================================== */

/* 4.1 CARD SYSTEM - Unified base for all card types */

.card-base {
  background: var(--bg-surface);
  border-radius: var(--radius-xl); /* Softer corners */
  box-shadow: var(--shadow-sm);
  padding: var(--space-card-padding);
  transition: all var(--transition-slow);
  border: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Ensure content follows radius */
}

.card-base:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--accent-light);
}

/* 4.2 BUTTONS & LINKS */

/* Article content links get underline animation */
.article-body
  a:not(.button):not(.amazon-button):not(.tag-link):not(
    .related-post-card-link
  ):not(.related-post-link) {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(37, 99, 235, 0.3);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
  transition: text-decoration-color var(--transition-base);
}

.article-body
  a:not(.button):not(.amazon-button):not(.tag-link):not(
    .related-post-card-link
  ):not(.related-post-link):hover {
  text-decoration-color: var(--accent);
}

/* Button base styles */
.button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-base);
  border: none;
  cursor: pointer;
  gap: 0.5rem;
}

.button:hover,
.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   TELEMETRY WIDGETS
   ========================================================================== */

.chart-title {
  color: var(--telemetry-text-primary);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--telemetry-border);
  padding-bottom: 0.75rem;
}

.chart-section {
  margin-bottom: 1.5rem;
}

.chart-subtitle {
  color: var(--telemetry-text-tertiary);
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-container.weight-chart,
.chart-container.stress-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 150px;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: var(--radius-md);
  min-height: auto; /* Override default chart-container min-height */
}

.chart-bar-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  min-width: 4px;
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: height 0.3s ease;
  min-height: 4px;
}

.weight-bar {
  background: var(--telemetry-accent-blue);
  opacity: 0.8;
}

.stress-bar {
  background: var(--telemetry-accent-green);
  opacity: 0.8;
}

.stress-bar.stress-medium {
  background: var(--telemetry-accent-yellow);
}
.stress-bar.stress-high {
  background: var(--telemetry-accent-red);
}

.bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--telemetry-text-tertiary);
  font-family: var(--font-mono-telemetry);
  white-space: nowrap;
}

.chart-label {
  font-size: 0.7rem;
  color: var(--telemetry-text-tertiary);
  font-family: var(--font-mono-telemetry);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  height: 40px;
}

.chart-footer,
.widget-footer {
  text-align: right;
  margin-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 0.75rem;
}

.view-full-stats,
.btn-view-charts {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--telemetry-accent-blue);
  text-decoration: none;
  font-weight: 500;
}

.view-full-stats:hover,
.btn-view-charts:hover {
  text-decoration: underline;
}

/* ====================
 * WIDGET STYLING (Telemetry & Sidebar Widgets)
 * ==================== */

.widget-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 2px solid var(--accent-light);
}

.widget-icon {
  font-size: var(--text-3xl);
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.widget-title {
  color: var(--text-primary);
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 0;
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .widget-title {
    font-size: var(--text-2xl);
  }
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.comparison-card {
  background: var(--telemetry-bg-tertiary);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.card-header {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--telemetry-text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.day-label {
  font-size: 0.75rem;
  color: var(--telemetry-text-tertiary);
  font-weight: 400;
}

.metric-comparison {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--telemetry-text-secondary);
}

.metric-label {
  color: var(--telemetry-text-secondary);
}

.metric-value {
  color: var(--telemetry-text-primary);
  font-weight: 600;
  font-family: var(--font-mono-telemetry);
}

.metric-diff {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

.metric-diff.up {
  color: var(--telemetry-accent-red);
  background: rgba(248, 113, 113, 0.1);
}
.metric-diff.down {
  color: var(--telemetry-accent-green);
  background: rgba(52, 211, 153, 0.1);
}

/* Stress specific directions */
.metric-diff.better {
  color: var(--telemetry-accent-green);
  background: rgba(52, 211, 153, 0.1);
}
.metric-diff.worse {
  color: var(--telemetry-accent-red);
  background: rgba(248, 113, 113, 0.1);
}

@media (max-width: 600px) {
  .chart-label {
    display: none; /* Hide labels on very small screens if crowded */
  }
}

/* Telemetry No-Data Fallback UI */
.telemetry-no-data {
  background: var(--telemetry-bg-secondary);
  border: 1px dashed var(--telemetry-border);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
}

.telemetry-no-data .no-data-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.telemetry-no-data .no-data-message .icon {
  font-size: 3rem;
  opacity: 0.5;
  display: block;
  margin-bottom: 1rem;
}

.telemetry-no-data .no-data-message h3 {
  color: var(--telemetry-text-primary);
  font-size: var(--text-lg);
  margin: 0 0 0.5rem 0;
  font-weight: 600;
}

.telemetry-no-data .no-data-message p {
  color: var(--telemetry-text-secondary);
  font-size: var(--text-sm);
  margin: 0;
  max-width: 500px;
  line-height: 1.6;
}

/* ==========================================================================
   SOCIAL SHARE BUTTONS
   ========================================================================== */

.social-share-buttons {
  margin-top: 2rem;
  margin-bottom: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--telemetry-border);
  text-align: center;
}

.share-label {
  font-size: 0.875rem;
  color: var(--telemetry-text-secondary);
  margin-bottom: 1rem;
  font-weight: 500;
}

.share-buttons-container {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  border: none;
  cursor: pointer;
  padding: 0;
}

.share-button:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.share-twitter {
  background-color: #000;
} /* X (formerly Twitter) is black */
.share-facebook {
  background-color: #1877f2;
}
.share-line {
  background-color: #06c755;
}
.share-copy {
  background-color: var(--telemetry-bg-tertiary);
  color: var(--telemetry-text-primary);
}

.copy-confirmation {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--telemetry-accent-green);
  font-weight: 500;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes homeEnter {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.985);
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.home-enter {
  --enter-delay: 0s;
  opacity: 0;
  animation: homeEnter 560ms cubic-bezier(0.2, 0.65, 0.25, 1) forwards;
  animation-delay: var(--enter-delay);
  will-change: transform, opacity, filter;
}

@media (prefers-reduced-motion: reduce) {
  .home-enter {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }

  .dory-image-placeholder::after {
    animation: none;
  }
}

/* ==========================================================================
   Dory Stats & Telemetry Custom Styles
   ========================================================================== */
.stats-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.btn-view-raw-data {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: #667eea;
  color: #fff !important;
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.2s;
}

.btn-view-raw-data:hover {
  background-color: #5a67d8;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.chart-container {
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  height: 400px;
  position: relative;
}

.chart-container canvas {
  max-height: 350px !important;
  height: 350px !important;
}

.chart-container.full-width {
  grid-column: 1 / -1;
}

.heatmap-placeholder {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7fafc;
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
  color: #718096;
}

/* ==========================================================================
   DORY STATS PAGE - Data Visualization & Analytics
   ========================================================================== */

/* Stats Page Layout */
.dory-stats-page {
  background: var(--bg-body);
  min-height: 100vh;
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.data-insights-page {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  order: 1;
  overflow-x: clip;
}

.data-insights-page,
.dory-stats-page,
.training-guide-page .page-main {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.data-insights-page a,
.data-insights-page code,
.training-guide-page .page-main a,
.training-guide-page .page-main code {
  overflow-wrap: anywhere;
  word-break: normal;
}

.data-insights-page pre,
.training-guide-page .page-main pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
}

.record-count-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0.6rem 1.25rem;
  background: var(--accent-light);
  border-radius: 50px;
  margin: 1.25rem auto 0;
  max-width: fit-content;
  border: 1px solid var(--border-light);
}

.record-count {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
}

.record-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.record-duration {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  padding-left: 0;
  border-left: 0;
}

@media (min-width: 560px) {
  .record-count-banner {
    flex-wrap: nowrap;
  }

  .record-duration {
    padding-left: 1rem;
    border-left: 1px solid var(--border-light);
  }
}

@media (max-width: 480px) {
  .record-count-banner {
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    border-radius: 1rem;
    padding: 0.6rem 0.85rem;
    gap: 0.55rem;
  }

  .record-count {
    font-size: 1.25rem;
  }

  .record-label {
    font-size: 0.75rem;
  }

  .record-duration {
    font-size: 0.8125rem;
  }
}

.chart-description {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1rem;
}

.insights-hero-info {
  margin: 2rem 0;
}

.dory-about-title {
  margin: 0 0 1rem 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
}

.dory-info-cell {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.dory-info-cell--right-border {
  border-right: 1px solid #e2e8f0;
}

.dory-info-term {
  font-size: 0.75rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.dory-info-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  overflow-wrap: anywhere;
  word-break: normal;
}

.dory-info-value--lg {
  font-size: 1.1rem;
}

.dory-about-text {
  margin: 0 0 1rem 0;
  line-height: 1.6;
  color: #475569;
  font-size: 0.9375rem;
}

.dory-about-link-card {
  padding: 0.75rem 0 0.75rem 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.dory-about-link-card--info {
  border-left: 3px solid #0284c7;
  margin-bottom: 0.75rem;
}

.dory-about-link-card--cost {
  border-left: 3px solid #f59e0b;
}

.dory-about-link-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: normal;
}

.dory-about-link-text--info {
  color: #0c4a6e;
}

.dory-about-link-text--cost {
  color: #78350f;
}

.dory-about-link {
  text-decoration: underline;
}

.dory-about-link--info {
  color: #0284c7;
}

.dory-about-link--cost {
  color: #b45309;
}

.insights-chart-canvas-wrap {
  position: relative;
  height: 300px;
  max-height: 300px;
}

.age-info--subtle {
  font-size: 0.8rem;
  color: #64748b;
}

.month-key-logic--banner {
  grid-column: 1 / -1;
  background: #fdfaf6;
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #d29922;
  text-align: center;
}

.stat-item-mini--accent {
  text-align: center;
  padding: 8px 4px;
  background: transparent;
  border-bottom: 2px solid var(--stat-accent-color, #64748b);
}

.stat-item-mini__label {
  font-size: 0.75rem;
  display: block;
  color: #94a3b8;
  text-transform: uppercase;
}

.stat-item-mini__value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--stat-accent-color, #64748b);
}

.stat-item-mini--success {
  --stat-accent-color: #10b981;
}

.stat-item-mini--warning {
  --stat-accent-color: #f59e0b;
}

.stat-item-mini--info {
  --stat-accent-color: #3b82f6;
}

.stat-item-mini--neutral {
  --stat-accent-color: #64748b;
}

.week-milestones--compact {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #475569;
  padding: 8px 0;
  border-top: 1px solid #e2e8f0;
}

.metric-descriptions--panel {
  background: #f8fafc;
  padding: 1rem 0.75rem;
  border-radius: 0;
  margin-bottom: 1.5rem;
  border-left: 4px solid #3b82f6;
}

.metric-descriptions__title {
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.metric-descriptions__list {
  margin: 0;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.metric-descriptions__item {
  font-size: 0.875rem;
  color: #475569;
  line-height: 1.6;
}

.compact-mobile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.chart-evidence-list {
  margin: 0 0 0.75rem;
  padding: 0.625rem 0.75rem;
  list-style: none;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  gap: 0.3rem;
}

.chart-evidence-list li {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #475569;
  overflow-wrap: anywhere;
  word-break: normal;
}

.metric-evidence-inline {
  grid-column: 1 / -1;
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #64748b;
}

.stats-public-insights {
  padding: 3rem 0;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.public-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 1.5rem;
}

.public-kpi-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: #f8fafc;
}

.public-kpi-label {
  margin: 0;
  color: #64748b;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.public-kpi-value {
  margin: 0.4rem 0;
  color: #0f172a;
  font-size: 1.5rem;
  line-height: 1.2;
  font-weight: 800;
}

.public-kpi-note {
  margin: 0;
  color: #475569;
  font-size: 0.78rem;
  line-height: 1.45;
}

.public-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.public-findings {
  margin-top: 1.25rem;
}

.public-findings h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: #0f172a;
}

.public-finding-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.public-finding-item {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  background: #ffffff;
}

.public-finding-category {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #0284c7;
}

.public-finding-item h4 {
  margin: 0 0 0.4rem;
  font-size: 0.95rem;
  line-height: 1.4;
  color: #0f172a;
}

.public-finding-item p {
  margin: 0;
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.5;
}

.public-report-footnote {
  margin: 0.95rem 0 0;
  font-size: 0.78rem;
  color: #64748b;
}

@media (min-width: 600px) {
  .compact-mobile-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
  }
}

.dory-stats-container {
  display: flex;
  gap: clamp(1.25rem, 3vw, 2rem);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0;
  flex-direction: column;
}

@media (min-width: 1025px) {
  .dory-stats-container {
    flex-direction: row;
    padding: 0 1rem;
  }
}

@media (max-width: 1024px) {
  .data-insights-container {
    flex-direction: column;
    padding: 0;
  }
}

.dory-about-block {
  margin: 1.5rem 0 0 0;
  border-left: 4px solid #667eea;
  padding-left: 1rem;
}

@media (max-width: 599px) {
  .dory-about-block {
    border-left: none;
    padding-left: 0;
    border-top: 4px solid #667eea;
    padding-top: 0.75rem;
  }
}

.dory-info-dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

@media (max-width: 599px) {
  .dory-info-dl {
    grid-template-columns: 1fr;
  }

  .dory-info-dl > div {
    border-right: none !important;
  }
}

/* Summary Section */
.stats-summary {
  padding: var(--space-section-gap) 0;
  background: var(--bg-body);
}

.stats-summary .footer-layout {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.stats-header-actions h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: var(--line-height-tight);
}

/* Summary Grid */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-card-gap);
  margin-bottom: var(--space-8);
}

/* Summary Cards */
.summary-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-card-padding);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  transition: all var(--transition-slow);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.summary-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.summary-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.summary-card:hover::before {
  opacity: 1;
}

.card-icon {
  font-size: 2.5rem;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 15%, transparent),
    color-mix(in srgb, var(--accent) 5%, transparent)
  );
  border-radius: var(--radius-lg);
  flex-shrink: 0;
}

.card-content {
  flex: 1;
  min-width: 0;
}

.card-value {
  font-size: var(--text-4xl);
  font-weight: 600;
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  margin: 0 0 var(--space-1) 0;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.card-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

/* Charts Section */
.stats-charts {
  padding: var(--space-section-gap) 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.stats-charts .footer-layout {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.stats-charts h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-8) 0;
  line-height: var(--line-height-tight);
}

.stats-charts h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-4) 0;
}

/* Insights Section */
.stats-insights {
  padding: var(--space-section-gap) 0;
  background: var(--bg-body);
  border-top: 1px solid var(--border);
}

.stats-insights .footer-layout {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.stats-insights h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-8) 0;
  line-height: var(--line-height-tight);
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-card-gap);
}

.insight-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-card-padding);
  transition: all var(--transition-slow);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.insight-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  opacity: 0;
  transition: opacity var(--transition-base);
}

.insight-card:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.insight-card:hover::before {
  opacity: 1;
}

.insight-card h4 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-4) 0;
  line-height: var(--line-height-snug);
}

.insight-card p {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin: 0;
}

/* FAQ Section */
.stats-faq {
  padding: var(--space-section-gap) 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}

.stats-faq .footer-layout {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.stats-faq h2 {
  font-size: var(--text-3xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-8) 0;
  line-height: var(--line-height-tight);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 900px;
}

.faq-item {
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-card-padding);
  transition: all var(--transition-base);
}

.faq-item:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-md);
}

.faq-question {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-4) 0;
  line-height: var(--line-height-snug);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.faq-question::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  flex-shrink: 0;
  margin-top: -2px;
}

.faq-answer {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  padding-left: calc(32px + var(--space-3));
  margin: 0;
}

.faq-answer p {
  margin: 0 0 var(--space-4) 0;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

/* Loading & Error States */
.stats-loading {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--text-tertiary);
  font-size: var(--text-lg);
  font-style: italic;
}

.stats-error {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  color: var(--error);
  font-size: var(--text-lg);
  background: color-mix(in srgb, var(--error) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 20%, transparent);
  border-radius: var(--radius-lg);
  font-weight: 600;
}

/* ====================
 * TELEMETRY GUIDE PAGE
 * ==================== */

/* Overall layout & typography for the guide page */
.telemetry-guide-page {
  padding: var(--space-8) 0 var(--space-12);
}

.telemetry-guide-page .guide-header h1 {
  letter-spacing: -0.03em;
}

.telemetry-guide-page .guide-header .lead {
  max-width: 32em;
}

.telemetry-guide-page .guide-content {
  font-size: var(--text-base);
}

.telemetry-guide-page p,
.telemetry-guide-page li {
  max-width: 75ch;
  line-height: var(--line-height-body);
}

/* Section headers inside cards */
.telemetry-guide-page .dashboard-card__header {
  gap: 0.75rem;
  flex-wrap: wrap;
}

.telemetry-guide-page .dashboard-card__header span {
  font-size: 0.9rem;
}

/* Local TOC styling */
.telemetry-guide-page .telemetry-guide-toc {
  margin: 0 0 2rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

.telemetry-guide-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.telemetry-guide-toc-list li {
  margin: 0;
}

.telemetry-guide-toc-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.9rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-base);
}

.telemetry-guide-toc-list a:hover,
.telemetry-guide-toc-list a:focus {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* Highlight key colored cards for better visual hierarchy */
.telemetry-guide-page [style*="background: #f0f9ff"],
.telemetry-guide-page [style*="background: #fef3c7"],
.telemetry-guide-page [style*="background: #fee2e2"],
.telemetry-guide-page [style*="background: #e0e7ff"],
.telemetry-guide-page [style*="background: #dcfce7"],
.telemetry-guide-page [style*="background: #f3e8ff"],
.telemetry-guide-page [style*="background: #fce7f3"],
.telemetry-guide-page [style*="background: #dbeafe"] {
  background-color: #ffffff !important; /* 背景色は統一して読みやすく */
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-sm);
  border-width: 1px;
  border-style: solid;
  border-color: rgba(148, 163, 184, 0.35);
}

/* セクション間の縦方向スペースを少し広く（インライン margin を上書き） */
.telemetry-guide-page [style*="margin-bottom: 1rem"] {
  margin-bottom: 1.8rem !important;
}

@media (max-width: 768px) {
  .telemetry-guide-page {
    padding: var(--space-6) 0 var(--space-10);
  }

  .telemetry-guide-page .guide-header {
    padding: 1.25rem 0 !important;
    margin-bottom: 1.5rem !important;
  }

  .telemetry-guide-page .guide-header h1 {
    font-size: clamp(1.5rem, 5vw, 1.75rem);
  }

  .telemetry-guide-page .guide-header .lead {
    font-size: 0.95rem !important;
  }

  .telemetry-guide-page .guide-header > div,
  .telemetry-guide-page .guide-content {
    padding: 0 1.25rem;
  }

  .telemetry-guide-page .telemetry-guide-toc {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-lg);
  }

  .telemetry-guide-toc-list a {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
  }

  .telemetry-guide-page table {
    font-size: 0.85rem;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .telemetry-guide-page table th,
  .telemetry-guide-page table td {
    padding: 0.5rem;
  }

  /* Slightlyコンパクトなカード余白（インラインstyleを上書き） */
  .telemetry-guide-page [style*="padding: 1.25rem"] {
    padding: 0.9rem 0.9rem !important;
  }

  /* 見出しとサブコピーを縦並びにして読みやすく */
  .telemetry-guide-page .dashboard-card__header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .summary-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .summary-card {
    padding: var(--space-5);
  }

  .card-icon {
    width: 56px;
    height: 56px;
    font-size: 2rem;
  }

  .card-value {
    font-size: var(--text-3xl);
  }

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

  .stats-header-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-view-raw-data {
    width: 100%;
    justify-content: center;
  }

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

@media (max-width: 480px) {
  .card-value {
    font-size: var(--text-2xl);
  }

  .summary-card {
    flex-direction: column;
    text-align: center;
  }

  .card-content {
    width: 100%;
  }

  .faq-answer {
    padding-left: 0;
    margin-top: var(--space-3);
  }
}

/* ==========================================================================
   New Layout Utilities (Phase 3)
   ========================================================================== */

/* Gradient Text Utility */
.gradient-text {
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    #7c3aed 50%,
    #06b6d4 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Homepage Grid */
.ai-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-card-gap);
  padding: var(--space-content-gap) 0;
}

@media (min-width: 640px) {
  .ai-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }
}

@media (min-width: 1024px) {
  .ai-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
  }
}


/* Enhanced AI Card for Homepage */
.ai-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-slow);
  border: 1px solid var(--border);
  border-top: 4px solid transparent;
  height: 100%;
}

.ai-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
  border-top-color: var(--accent);
}

.ai-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* AI Card Image Container */
.ai-card-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-elevated);
}

.ai-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-base);
}

.ai-card-image img.tinywag-list-thumbnail {
  object-position: center 32%;
  transform: scale(1.08);
}

.ai-card:hover .ai-card-image img.tinywag-list-thumbnail {
  transform: scale(1.12);
}

/* Default thumbnail image styling */
.default-thumbnail-image {
  object-fit: contain !important;
  padding: 2rem;
  background: #f3f4f6;
}

/* Shared Dory placeholder for missing media */
.dory-image-placeholder {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--space-2);
  box-sizing: border-box;
  text-align: center;
  color: var(--text-tertiary);
  background:
    radial-gradient(
      160% 80% at 0% 0%,
      rgba(37, 99, 235, 0.13),
      transparent 50%
    ),
    radial-gradient(
      140% 80% at 100% 100%,
      rgba(124, 58, 237, 0.12),
      transparent 48%
    ),
    var(--bg-elevated);
  border: 1px dashed rgba(148, 163, 184, 0.45);
  padding: var(--space-5);
  text-wrap: balance;
  position: relative;
  overflow: hidden;
}

.dory-image-placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      120deg,
      rgba(255, 255, 255, 0) 40%,
      rgba(255, 255, 255, 0.5) 55%,
      rgba(255, 255, 255, 0) 70%
  );
  transform: translateX(-110%);
  pointer-events: none;
  animation: placeholderShine 4.4s ease-in-out infinite;
}

.dory-image-placeholder__image {
  width: min(78px, 32%);
  aspect-ratio: 1;
  object-fit: contain;
  opacity: 0.88;
  filter: saturate(0.85);
  transition: transform var(--transition-base);
}

.dory-image-placeholder:hover .dory-image-placeholder__image,
.dory-image-placeholder:hover .dory-image-placeholder__note,
.dory-image-placeholder:hover .dory-image-placeholder__label {
  transform: translateY(-1px);
}

.dory-image-placeholder__note {
  margin: 0;
  font-size: var(--text-xs);
  line-height: 1.55;
  letter-spacing: 0.02em;
  color: color-mix(in srgb, var(--text-secondary) 75%, #111827);
  max-width: min(28ch, 100%);
  font-weight: 600;
}

.dory-image-placeholder__label {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-primary);
}


@keyframes placeholderShine {
  0% {
    transform: translateX(-110%);
  }
  45% {
    transform: translateX(110%);
  }
  100% {
    transform: translateX(110%);
  }
}

.dory-image-placeholder--hero {
  min-height: 100%;
}

.dory-image-placeholder--hero .dory-image-placeholder__image {
  width: min(120px, 44%);
}

.dory-image-placeholder--photo {
  padding: 0;
  border-style: solid;
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  background: #f8fafc;
}

.dory-image-placeholder--photo::after {
  display: none;
}

.dory-image-placeholder--photo .dory-image-placeholder__image {
  width: 100%;
  height: clamp(220px, 35vw, 380px);
  aspect-ratio: auto;
  object-fit: cover;
  opacity: 1;
  filter: none;
}

.dory-image-placeholder--card .dory-image-placeholder__label {
  max-width: 10rem;
  font-size: 0.75rem;
}

.dory-image-placeholder--page {
  min-height: clamp(220px, 42vw, 420px);
}

.dory-image-placeholder--page .dory-image-placeholder__image {
  width: clamp(84px, 18vw, 160px);
}


}

/* AI Card Content */
.ai-card-content {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

@media (min-width: 1024px) {
  .ai-card-content {
    padding: 1.25rem;
    gap: 0.625rem;
  }
}

.ai-card .category {
  background: var(--accent-light);
  color: var(--accent-dark);
  padding: 0.25rem 0.625rem;
  font-weight: 600;
  font-size: var(--text-xs);
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-block;
  align-self: flex-start;
  margin-top: 0.5rem;
}

.ai-card .read-more {
  color: var(--accent);
  font-weight: 600;
  font-size: var(--text-xs);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: auto;
  transition: gap var(--transition-base);
}

.ai-card .read-more svg {
  transition: transform var(--transition-base);
  width: 14px;
  height: 14px;
}

.ai-card:hover .read-more {
  gap: 0.5rem;
}

.ai-card:hover .read-more svg {
  transform: translateX(3px);
}

/* Override global h2 styles for ai-card titles */
.ai-card h2,
.ai-card-content h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.4;
  color: var(--text-primary);
}

@media (min-width: 768px) {
  .ai-card h2,
  .ai-card-content h2 {
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  .ai-card h2,
  .ai-card-content h2 {
    font-size: 1.05rem;
  }
}

/* Prevent global margin inheritance in card content */
.ai-card-content > * {
  margin-top: 0;
}

.ai-card-content p {
  margin-bottom: 0;
  font-size: var(--text-sm);
  line-height: var(--line-height-normal);
  color: var(--text-secondary);
}

@media (min-width: 1024px) {
  .ai-card-content p {
    font-size: 0.85rem;
  }
}

.ai-card .meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.75rem;
}

.ai-card .meta .date {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.ai-card-content .date {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  display: block;
  margin-bottom: 0.25rem;
}

/* Ensure category badge doesn't get h2 margin */
.ai-card .category + h2 {
  margin-top: 0;
}

/* ====================
 * RELATED POSTS SECTION
 * ==================== */
.related-posts {
  margin: var(--space-16) 0;
  padding: var(--space-12) 0;
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
  background: linear-gradient(180deg, #f8fafc 0%, var(--bg-surface) 100%);
  border-radius: var(--radius-xl);
}

.related-posts-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-8) 0;
  text-align: center;
  position: relative;
  padding-bottom: var(--space-4);
}

.related-posts-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: var(--radius-full);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  padding: 0 var(--space-4);
}

.related-posts-grid--scroll {
  position: relative;
}

.related-posts-grid--scroll::before,
.related-posts-grid--scroll::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 24px;
  pointer-events: none;
  z-index: 2;
}

.related-posts-grid--scroll::before {
  left: 0;
  background: linear-gradient(
    90deg,
    rgba(248, 249, 250, 0.9),
    rgba(248, 249, 250, 0)
  );
}

.related-posts-grid--scroll::after {
  right: 0;
  background: linear-gradient(
    270deg,
    rgba(248, 249, 250, 0.9),
    rgba(248, 249, 250, 0)
  );
}

@media (min-width: 640px) {
  .related-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .related-posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .related-posts-grid {
    display: flex;
    overflow-x: auto;
    gap: var(--space-4);
    padding-bottom: var(--space-2);
    scroll-snap-type: x mandatory;
    padding-right: var(--space-10);
  }

  .related-post-card {
    min-width: 220px;
    scroll-snap-align: start;
  }

}

.related-post-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.related-post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
}

.related-post-link,
.related-post-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.related-post-thumbnail {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-elevated);
}

.related-post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-base);
  border-radius: var(--radius-lg);
}

.related-post-card:hover .related-post-thumbnail img {
  transform: scale(1.05);
}

.related-post-content {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-grow: 1;
}

.related-post-entry-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: var(--line-height-snug);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-post-date {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin-top: auto;
}

/* ====================
 * RELATED POSTS: TAG + REASON (Feature 3)
 * ==================== */
.related-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 6px 0 4px;
  padding: 0;
}

.related-post-tag {
  font-size: var(--text-xs, 0.75rem);
  color: var(--accent, #4f6ef7);
  background: color-mix(in srgb, var(--accent, #4f6ef7) 8%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.related-post-reason {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-tertiary);
  margin: 4px 0 0;
}

.related-post-reason-icon {
  font-size: 0.75rem;
  line-height: 1;
}

/* ====================
 * TIMELINE BRIDGE (Feature 2)
 * ==================== */
.timeline-bridge {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 var(--space-6, 1.5rem);
}

.timeline-bridge-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--bg-surface, #f8f9fa);
  border: 1px solid var(--border-subtle, #e9ecef);
  transition: background 0.15s ease;
}

.timeline-bridge-item:hover {
  background: color-mix(in srgb, var(--accent, #4f6ef7) 5%, var(--bg-surface, #f8f9fa));
}

.timeline-bridge-item--before {
  border-left: 3px solid var(--text-tertiary, #adb5bd);
}

.timeline-bridge-item--after {
  border-left: 3px solid var(--accent, #4f6ef7);
}

.timeline-bridge-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
}

.timeline-bridge-arrow {
  font-size: 1rem;
  color: var(--text-secondary, #6c757d);
  line-height: 1;
}

.timeline-bridge-date {
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-tertiary, #adb5bd);
  white-space: nowrap;
  text-align: center;
}

.timeline-bridge-link {
  text-decoration: none;
  color: inherit;
}

.timeline-bridge-link:hover .timeline-bridge-title {
  color: var(--accent, #4f6ef7);
  text-decoration: underline;
}

.timeline-bridge-title {
  display: block;
  font-size: var(--text-sm, 0.875rem);
  font-weight: 600;
  color: var(--text-primary, #212529);
  margin-bottom: 4px;
  line-height: 1.4;
  transition: color 0.15s ease;
}

.timeline-bridge-events {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-bridge-event {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: var(--text-xs, 0.75rem);
  color: var(--text-secondary, #6c757d);
}

.timeline-bridge-event-icon {
  font-size: 0.7rem;
  line-height: 1;
  flex-shrink: 0;
}

/* ====================
 * METACOGNITION SECTION (Feature 1)
 * データからわかること
 * ==================== */
.article-body h2:has(+ p):where(
  [id*="データからわかること"],
  [id*="what-the-data-reveals"],
  [id*="was-die-daten-zeigen"],
  [id*="ce-que-revelent"]
) {
  /* Targeted via data-section attribute set by JS if needed */
}

/* Style all h2 + following paragraph within a known "metacognition" context.
   We use a data attribute added by JS to the section wrapper. */
.metacognition-section {
  position: relative;
  padding: var(--space-4, 1rem) var(--space-5, 1.25rem);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #4f6ef7) 6%, transparent);
  border-left: 3px solid var(--accent, #4f6ef7);
  margin: var(--space-8, 2rem) 0;
}

.metacognition-section .metacognition-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs, 0.75rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent, #4f6ef7);
  margin-bottom: 8px;
}

/* Hide legacy CRP default output if any instance remains */
.crp_related {
  display: none !important;
}

/* ====================
 * AMAZON PRODUCTS SECTION
 * ==================== */
.amazon-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
  margin: var(--space-10) 0;
}

.amazon-product-card-modern {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-slow);
  border: 1px solid var(--border);
  height: 100%;
  cursor: pointer;
}

.amazon-product-card-modern:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-light);
}

.amazon-card-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.amazon-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-light);
}

@media (min-width: 640px) {
  .amazon-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
  }
}

.amazon-card-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: normal;
  transition: transform var(--transition-base);
  border-radius: var(--radius-lg);
  display: block;
}

.amazon-product-card-modern:hover .amazon-card-image img {
  transform: scale(1.05);
}

.amazon-card-content {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-grow: 1;
  min-width: 0;
}

.amazon-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.amazon-card-badge {
  display: none;
}

.amazon-card-rating {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
}

.amazon-card-rating .stars {
  color: #fbbf24;
  font-size: var(--text-base);
  letter-spacing: 2px;
}

.amazon-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.amazon-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-base);
}

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

.amazon-card-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.amazon-card-footer {
  margin-top: auto;
  padding-top: var(--space-2);
  display: flex;
}

.amazon-card-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--accent);
  color: white !important;
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  min-height: 44px;
}

.amazon-card-button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.amazon-card-button svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 640px) {
  .amazon-products-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-4);
  }
  .amazon-card-container {
    gap: var(--space-3);
  }
  .amazon-card-image {
    width: 96px;
    padding: var(--space-3);
  }
  .amazon-card-title {
    font-size: 14px;
  }
  .amazon-card-description {
    font-size: 12px;
  }
  .amazon-card-button {
    font-size: 14px;
    padding: 0.6rem 0.8rem;
  }
}

.amazon-product-warning {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--warning);
  color: white;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-align: center;
}

/* TOC Toggle Button */
.toc-header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.toc-toggle {
  background: none;
  border: none;
  padding: 0.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toc-toggle:hover {
  color: var(--accent);
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-sm);
}

#toc-content {
  transition:
    max-height 0.3s ease-in-out,
    opacity 0.3s ease-in-out;
  overflow: hidden;
}

#toc-content.is-collapsed {
  max-height: 0;
  opacity: 0;
}

.toc-toggle-icon {
  transition: transform 0.3s ease;
}

.toc-toggle[aria-expanded="true"] .toc-toggle-icon {
  transform: rotate(180deg);
}

/* ====================
 * HAMBURGER MENU STYLES
 * ==================== */

.hamburger-content {
  --hamburger-content-pad: var(--space-5);
  width: 100%;
  max-width: 600px;
  padding: var(--space-5);
  padding-top: calc(var(--hamburger-content-pad) + env(safe-area-inset-top));
  padding-bottom: calc(var(--space-8) + env(safe-area-inset-bottom));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Header with logo, Instagram, language switcher on left, close button on right */
.hamburger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.hamburger-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

.hamburger-logo {
  font-size: var(--text-base);
  font-weight: 700;
}

.hamburger-logo a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

.hamburger-logo a:hover {
  color: var(--accent);
}

.hamburger-logo a:focus {
  outline: none;
}

.hamburger-logo a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
  box-shadow: none;
}

.mobile-instagram-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px; /* WCAG minimum touch target */
  min-height: 44px;
  width: 44px;
  height: 44px;
  color: var(--text-primary);
  transition:
    color var(--transition-base),
    background-color var(--transition-base),
    transform var(--transition-base);
  padding: 0;
  border-radius: 12px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}

.mobile-instagram-link:hover {
  color: var(--accent);
  background: rgba(0, 0, 0, 0.04);
}

.mobile-instagram-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mobile-instagram-link:active {
  transform: scale(0.96);
}

.mobile-instagram-link svg {
  width: 20px;
  height: 20px;
  display: block;
}

.mobile-lang-toggle {
  display: flex;
  align-items: center;
  margin-left: auto;
  flex-shrink: 0;
  background: transparent;
  padding: 0;
  gap: 0;
}

.mobile-lang-dropdown {
  position: relative;
}

.mobile-lang-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  list-style: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-lang-summary::-webkit-details-marker {
  display: none;
}

.mobile-lang-summary:hover {
  background: rgba(0, 0, 0, 0.08);
}

.mobile-lang-summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.mobile-lang-summary-icon {
  display: block;
  transition: transform var(--transition-base);
}

.mobile-lang-dropdown[open] .mobile-lang-summary-icon {
  transform: rotate(180deg);
}

.mobile-lang-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(40px, 1fr));
  gap: 6px;
  min-width: 220px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.14);
}

.mobile-lang-list .lang-switch-btn {
  min-height: 36px;
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.02);
}

.mobile-lang-list .lang-switch-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.mobile-lang-list .lang-switch-current {
  background: #ffffff !important;
}

@media (max-width: 420px) {
  .mobile-lang-list {
    min-width: 190px;
    grid-template-columns: repeat(3, minmax(40px, 1fr));
  }
}

.close-btn {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--text-secondary);
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
  border: none;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.close-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

.close-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.close-btn:active {
  transform: scale(0.96);
  background: rgba(0, 0, 0, 0.06);
}

.close-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  flex-shrink: 0;
}

.hamburger-nav-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.hamburger-menu-title,
.hamburger-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  margin: 0;
}

.hamburger-main-nav ul,
.hamburger-special-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hamburger-main-nav li,
.hamburger-special-nav li {
  margin: 0;
}

.hamburger-main-nav a {
  display: flex;
  align-items: center;
  min-height: 44px; /* Larger hit area without feeling bulky */
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: all var(--transition-base);
  border-radius: var(--radius-sm);
}

.hamburger-main-nav a:hover,
.hamburger-main-nav a:focus-visible {
  color: var(--accent);
  background: var(--accent-light);
}

/* Special section */
.hamburger-special-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.hamburger-fixed-pages-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.hamburger-fixed-pages-groups {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.hamburger-fixed-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.hamburger-fixed-group-title {
  margin: 0;
  padding-left: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hamburger-fixed-link-icon {
  width: 1.4rem;
  min-width: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.2;
}

.hamburger-fixed-link {
  gap: var(--space-2);
  align-items: flex-start;
}

.hamburger-fixed-link-label {
  min-width: 0;
  line-height: var(--line-height-snug);
  text-wrap: pretty;
}

.hamburger-fixed-link-label--nowrap {
  white-space: nowrap;
}

.hamburger-special-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-base);
  border-radius: var(--radius-sm);
}

.hamburger-special-nav a:hover,
.hamburger-special-nav a:focus-visible {
  color: var(--accent);
  background: var(--accent-light);
}

/* Training Articles Section (Mobile) */
.hamburger-training-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.hamburger-training-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-base);
  border-radius: var(--radius-sm);
}

.hamburger-training-nav a:hover,
.hamburger-training-nav a:focus-visible {
  color: var(--accent);
  background: var(--accent-light);
}

/* Social section */
.hamburger-social-section {
  padding-top: var(--space-2);
}

.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  transition: all var(--transition-base);
}

.instagram-link:hover {
  color: var(--accent);
}

.instagram-link svg {
  width: 20px;
  height: 20px;
}

.hamburger-categories-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.hamburger-categories {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}

.hamburger-categories li {
  margin: 0;
}

.hamburger-categories a {
  display: block;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  text-align: center;
  text-decoration: none;
}

.hamburger-categories a:hover,
.hamburger-categories a:focus {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Show menu when checkbox is checked */
.menu-toggle:checked ~ .hamburger-menu {
  opacity: 1;
  visibility: visible;
}

.hamburger-wrapper.is-menu-open .hamburger-menu {
  opacity: 1;
  visibility: visible;
}

/* Hide hamburger on desktop */
@media (min-width: 769px) {
  .hamburger-wrapper {
    display: none;
  }
}

/* Adjust hamburger categories grid on small mobile */
@media (max-width: 480px) {
  .hamburger-categories {
    padding-right: var(--space-8);
  }

  .hamburger-content {
    --hamburger-content-pad: var(--space-4);
    padding: var(--space-4);
    padding-top: calc(var(--hamburger-content-pad) + env(safe-area-inset-top));
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  }
}

@media (max-width: 600px) {
  .hamburger-categories {
    display: flex;
    overflow-x: auto;
    gap: var(--space-3);
    padding-bottom: var(--space-2);
    scroll-snap-type: x mandatory;
    padding-right: var(--space-10);
  }

  .hamburger-categories li {
    flex: 0 0 auto;
  }

  .hamburger-categories a {
    min-width: 140px;
    min-height: 44px;
    scroll-snap-align: start;
  }
}

/* ====================
 * ARTICLE LAYOUT STYLES
 * ==================== */

/* 旧 .page-container と .article-wrapper は削除済み */
/* 新しい .layout-container と .content-wrapper を使用してください */

.article-featured-image {
  margin: var(--space-8) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--bg-elevated);
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: min(62vh, 560px);
}

.article-featured-image img {
  width: auto;
  max-width: 100%;
  max-height: min(62vh, 560px);
  height: auto;
  display: block;
  object-fit: contain;
}

.article-content-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  align-items: start;
  margin-bottom: var(--space-12);
}

.article-flow {
  display: flex;
  flex-direction: column;
  gap: clamp(1.75rem, 3vw, 2.5rem);
}

.article-flow > * {
  margin: 0;
}

.tw-flow--tight {
  display: flex;
  flex-direction: column;
  gap: clamp(0.75rem, 1.6vw, 1rem);
}

.tw-flow-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tw-meta-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.tw-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: color-mix(in srgb, var(--accent) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  color: color-mix(in srgb, var(--accent-dark) 80%, #334155);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.tw-surface-panel {
  padding: clamp(1rem, 2vw, 1.35rem);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.tw-surface-panel--soft {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 3%, #fff) 0%, #fff 100%);
}

.tw-section-title {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.tw-section-label {
  font-weight: 800;
  color: var(--text-primary);
}

.tw-reading-note {
  margin: 0;
  max-width: 66ch;
  color: var(--text-secondary);
  line-height: 1.8;
}

.tw-figure {
  margin: 0;
}

.tw-figure img {
  max-width: 100%;
  height: auto;
}

.tw-figure-caption {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.tw-glossary {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.tw-glossary dt {
  margin: 0;
  font-weight: 700;
  color: var(--text-primary);
}

.tw-glossary dd {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.75;
}

.tw-section-link-list {
  display: grid;
  gap: 1rem;
}

.tw-product-recommendations__group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tw-product-recommendations__group + .tw-product-recommendations__group {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.tw-product-recommendations__eyebrow {
  margin: 0;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.tw-product-recommendations__note {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}

.tw-section-link-list--products {
  gap: 1rem;
}

.tw-linked-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.45rem;
  line-height: 1.75;
}

.tw-archive-intro {
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.tw-tag-nav {
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.tw-card-meta {
  margin: 0 0 0.4rem;
}

.tw-card-summary {
  margin: 0.65rem 0 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
}

.tw-pagination-wrap {
  margin-top: clamp(1.5rem, 3vw, 2rem);
}

.tw-flow-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
}

.tw-flow-strong {
  font-size: 0.9rem;
  color: #0f172a;
}

.tw-flow-separator {
  color: #94a3b8;
}

.tw-flow-note {
  color: #64748b;
}

.tw-info-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.75;
  display: grid;
  gap: 0.45rem;
}

.tw-filter-bar {
  margin: 0 0 2rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
}

.tw-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.tw-filter-field {
  display: block;
  font-size: 0.875rem;
}

.tw-filter-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: #475569;
}

.tw-filter-select {
  padding: 0.5rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--text-primary);
}

.tw-filter-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

.tw-filter-action--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.tw-filter-action--ghost {
  background: #fff;
  color: #475569;
  border-color: #e2e8f0;
}

.tw-report-shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}

.tw-report-shell--single {
  max-width: 860px;
}

.tw-report-header {
  margin-bottom: clamp(1.75rem, 3vw, 2rem);
}

.tw-report-header--single {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.tw-report-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.tw-report-month-group {
  margin-bottom: clamp(2rem, 4vw, 2.5rem);
}

.tw-report-month-title {
  margin: 0 0 1rem;
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
}

.tw-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.tw-report-card {
  padding: 1.25rem;
}

.tw-report-kicker {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: #64748b;
}

.tw-report-card-title {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  line-height: 1.4;
}

.tw-report-card-title a {
  color: #0f172a;
  text-decoration: none;
}

.tw-report-badges {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

@media (min-width: 1024px) {
  .article-content-wrapper {
    grid-template-columns: 1fr 320px;
    gap: var(--space-12);
    margin-bottom: var(--space-20);
  }
}

.article-content {
  min-width: 0;
  max-width: var(--content-reading-width); /* サイドバーあり時は720px制限を維持 */
  margin-left: 0;
}

/* サイドバーなし時（モバイル〜タブレット）はコンテナ幅いっぱいまで広げる */
@media (max-width: 1023px) {
  .article-content {
    max-width: 100%;
  }
}

.article-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0 var(--space-8);
}

.article-photo-grid .article-photo-item {
  margin: 0;
  max-width: none;
}

.article-photo-grid .article-photo-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

.article-photo-grid .article-photo-item > a,
.article-photo-slider__slide > p > a {
  display: block;
  position: relative;
}

.tw-video-thumb-link::after {
  content: "▶";
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  line-height: 1;
  pointer-events: none;
}

@media (max-width: 768px) {
  .article-photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.article-photo-grid .article-photo-item--solo {
  grid-column: 1 / -1;
  max-width: 320px;
  margin: auto;
}

.article-photo-grid .article-photo-item--solo > a,
.article-photo-grid .article-photo-item--solo > img,
.article-photo-grid .article-photo-item--solo > video {
  width: 100%;
  margin: auto;
}

.article-photo-slider {
  position: relative;
  margin: var(--space-6) 0 var(--space-8);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  padding: var(--space-3);
}

.article-photo-slider__viewport {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  border-radius: var(--radius-md);
}

.article-photo-slider__track {
  display: flex;
}

.article-photo-slider__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.article-photo-slider__slide > p {
  margin: 0;
}

.article-photo-slider__slide img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-md);
}

.article-photo-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text-primary);
  font-size: 1.4rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
}

.article-photo-slider__nav:disabled {
  opacity: 0.45;
  cursor: default;
}

.article-photo-slider__nav--prev {
  left: var(--space-4);
}

.article-photo-slider__nav--next {
  right: var(--space-4);
}

.article-photo-slider__dots {
  margin-top: var(--space-3);
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.article-photo-slider__dot {
  width: 0.52rem;
  height: 0.52rem;
  border: 0;
  border-radius: 9999px;
  background: var(--border);
  cursor: pointer;
  padding: 0;
}

.article-photo-slider__dot[aria-current="true"] {
  background: var(--accent);
}

@media (max-width: 768px) {
  .article-photo-slider__nav {
    width: 2rem;
    height: 2rem;
    font-size: 1.2rem;
  }
}

.tw-media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.86);
  padding: 2.5rem 1rem;
}

.tw-media-lightbox.is-open {
  display: flex;
}

.tw-media-lightbox__content {
  width: min(94vw, 1200px);
  max-height: 84vh;
  display: grid;
  place-items: center;
}

.tw-media-lightbox__content img,
.tw-media-lightbox__content video {
  max-width: 100%;
  max-height: 84vh;
  border-radius: var(--radius-md);
  background: #000;
}

.tw-media-lightbox__close,
.tw-media-lightbox__nav {
  position: fixed;
  border: 0;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
}

.tw-media-lightbox__close {
  top: 1rem;
  right: 1rem;
}

.tw-media-lightbox__nav--prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.tw-media-lightbox__nav--next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.tw-media-lightbox__counter {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  font-size: 0.85rem;
}

body.tw-media-lightbox-open {
  overflow: hidden;
}

.article-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .article-sidebar {
    display: block;
  }
}

.sidebar-sticky {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

/* Mobile: Disable sticky positioning */
@media (max-width: 1023px) {
  .sidebar-sticky {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

/* Desktop: Enable sticky with conservative max-height */
@media (min-width: 1024px) {
  .sidebar-sticky {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    align-self: flex-start;
  }
}

/* Scrollbar styles for sidebar */
.sidebar-sticky::-webkit-scrollbar {
  width: 6px;
}

.sidebar-sticky::-webkit-scrollbar-track {
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
}

.sidebar-sticky::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-sm);
}

.sidebar-sticky::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* AI Summary Box */
.ai-summary {
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.05) 0%,
    rgba(37, 99, 235, 0.01) 100%
  );
  border: 1px solid var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
  .ai-summary {
    padding: var(--space-8);
  }
}

.ai-summary-header {
  margin-bottom: var(--space-6);
}

.ai-summary-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--accent-dark);
  margin: 0;
}

@media (min-width: 768px) {
  .ai-summary-title {
    font-size: var(--text-2xl);
  }
}

.ai-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.ai-summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.ai-summary-list li {
  position: relative;
  padding-left: var(--space-8);
  font-size: var(--text-base);
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

.ai-summary-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: var(--text-lg);
}

/* Table of Contents Navigation */
.toc-nav {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.toc-nav::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.toc-header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.toc-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.toc li {
  margin: 0;
}

.toc a {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  border-left: 3px solid transparent;
  font-weight: 500;
}

.toc a:hover,
.toc a:focus {
  color: var(--accent);
  background: var(--accent-light);
  border-left-color: var(--accent);
}

.toc a.active {
  color: var(--accent);
  background: var(--accent-light);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* Nested TOC items */
.toc ul {
  list-style: none;
  margin: var(--space-1) 0 0 var(--space-3);
  padding: 0;
}

.toc ul a {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-2);
}

/* TOC mobile toggle */
.toc-nav .mobile-only {
  display: block;
}

@media (min-width: 1024px) {
  .toc-nav .mobile-only {
    display: none;
  }
}

/* ====================
 * PAGINATION
 * ==================== */

.pagination-wrapper {
  margin-top: var(--space-20);
  padding-top: var(--space-12);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 48px;
  padding: 0 1rem;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all var(--transition-slow);
}

.pagination .page-numbers:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pagination .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

.pagination .prev,
.pagination .next {
  font-weight: 600;
  color: var(--accent);
}

.pagination-wrapper {
  margin-top: var(--space-20);
  padding-top: var(--space-12);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
}

/* ====================
 * CATEGORY & TAG LISTS
 * ==================== */

.categories-grid,
.tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-card-gap);
  margin-top: var(--space-12);
}

.category-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  transition: all var(--transition-slow);
  position: relative;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent-light);
}

.category-card-link {
  display: flex;
  align-items: center;
  padding: var(--space-6);
  gap: var(--space-5);
  text-decoration: none;
  color: inherit;
}

.category-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.category-name {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--text-primary);
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: normal;
}

.category-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  font-weight: 600;
}

.category-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.category-description {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--space-3) 0;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.category-count svg {
  flex-shrink: 0;
}

.category-arrow {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform var(--transition-base),
    color var(--transition-base);
}

.category-card:hover .category-arrow {
  color: var(--accent);
  transform: translateX(2px);
}

.category-card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-xl);
}

/* ====================
 * PAGE HERO (Index/Categories/Archives/Tags)
 * ==================== */

.page-hero {
  padding: var(--space-12) 0 var(--space-10);
  border-bottom: 1px solid var(--border-light);
  background:
    radial-gradient(
      1200px 600px at 50% -10%,
      color-mix(in srgb, var(--accent-light) 55%, transparent) 0%,
      transparent 60%
    ),
    var(--bg-body);
}

.page-hero--centered {
  text-align: center;
}

.page-hero--centered .hero-content {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
  color: #0f172a;
  line-height: 1.2;
}

.page-hero__subtitle {
  font-size: 1.125rem;
  color: #475569;
  margin-top: 0.75rem;
  max-width: 800px;
  line-height: 1.6;
}

.page-hero--centered .page-hero__subtitle {
  margin-left: auto;
  margin-right: auto;
}

.page-hero__meta {
  font-size: var(--text-sm);
  color: #94a3b8;
  margin-top: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-hero--unified .hero-content {
  max-width: min(1100px, 100%);
}

.page-hero--unified .page-hero__media {
  margin-top: clamp(1rem, 2.5vw, 1.5rem);
  display: flex;
  justify-content: center;
}

.page-hero--unified .dory-image-placeholder {
  width: min(100%, 760px);
  min-height: clamp(180px, 26vw, 260px);
  border-style: solid;
  border-width: 1px;
  border-color: color-mix(in srgb, var(--accent) 20%, rgba(148, 163, 184, 0.34));
  border-radius: clamp(1rem, 2vw, 1.5rem);
  background:
    radial-gradient(circle at 15% 0%, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(148, 163, 184, 0.18) 0%, transparent 55%),
    #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.page-featured-image {
  margin-bottom: var(--space-8);
}

.page-featured-image img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  display: block;
}

.page-featured-image .dory-image-placeholder {
  border-radius: var(--radius-xl);
}

.page-title {
  margin: 0 0 var(--space-4) 0;
  font-size: clamp(2rem, 6vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.page-description {
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ====================
 * CATEGORIES / ARCHIVES / TAGS SECTIONS
 * ==================== */

.categories-section,
.archives-section,
.tags-section {
  padding: var(--space-12) 0;
}

/* Shared summary blocks */
.categories-summary,
.archives-summary,
.tags-summary {
  margin-top: var(--space-12);
  display: flex;
  justify-content: center;
}

.summary-stats {
  display: flex;
  align-items: stretch;
  gap: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-8);
  box-shadow: var(--shadow-sm);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 90px;
}

.stat-number {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-divider {
  width: 1px;
  background: var(--border-light);
}

/* Empty state blocks */
.categories-page .empty-state,
.archives-page .empty-state,
.tags-page .empty-state {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  text-align: center;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

.categories-page .empty-state svg,
.archives-page .empty-state svg,
.tags-page .empty-state svg {
  color: var(--text-tertiary);
  margin-bottom: var(--space-4);
}

/* ====================
 * ARCHIVES PAGE
 * ==================== */

.archives-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
  margin-top: var(--space-10);
}

.archive-year-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.archive-year-section.current-year {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
  box-shadow: var(--shadow-md);
}

.year-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

.year-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding-top: 0.35rem;
}

.year-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent);
}

.year-line {
  width: 2px;
  flex: 1;
  min-height: 28px;
  background: var(--border-light);
}

.year-title {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  letter-spacing: -0.02em;
}

.year-count {
  margin: 0.5rem 0 0 0;
  color: var(--text-secondary);
  font-weight: 600;
}

.months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.month-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  transition: all var(--transition-base);
}

.month-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.month-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  text-decoration: none;
  color: inherit;
}

.month-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-lg);
}

.month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.month-name {
  font-weight: 800;
  color: var(--text-primary);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.month-badge {
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: var(--radius-full);
  padding: 0.25rem 0.6rem;
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.month-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: var(--text-sm);
}

.month-count svg {
  flex-shrink: 0;
  color: var(--text-tertiary);
}

.month-count span {
  overflow-wrap: anywhere;
  word-break: normal;
}

.month-arrow {
  margin-left: auto;
  color: var(--text-tertiary);
  align-self: flex-end;
  transition:
    transform var(--transition-base),
    color var(--transition-base);
}

.month-card:hover .month-arrow {
  transform: translateX(2px);
  color: var(--accent);
}

/* ====================
 * TAGS PAGE
 * ==================== */

.tags-page .tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  margin-top: var(--space-10);
}

.tags-page .tag-item {
  display: inline-flex;
}

.tags-page .tags-cloud .tag-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 700;
  transition: all var(--transition-base);
}

.tags-page .tags-cloud .tag-link:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.tags-page .tag-name {
  line-height: 1.1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
}

.tags-page .tag-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  font-weight: 800;
}

/* Tag size scaling */
.tags-page .tag-item.tag-sm .tag-link {
  font-size: var(--text-xs);
}

.tags-page .tag-item.tag-md .tag-link {
  font-size: var(--text-sm);
}

.tags-page .tag-item.tag-lg .tag-link {
  font-size: var(--text-base);
  padding: 0.65rem 1rem;
}

.tags-page .tag-item.tag-xl .tag-link {
  font-size: var(--text-lg);
  padding: 0.75rem 1.1rem;
}

.top-tags-section {
  margin-top: var(--space-12);
}

.tags-page .section-title {
  margin: 0 0 var(--space-6) 0;
  font-size: clamp(1.25rem, 4.5vw, 1.75rem);
  letter-spacing: -0.02em;
}

.top-tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-card-gap);
}

.top-tag-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  position: relative;
}

.top-tag-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.top-tag-link {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  text-decoration: none;
  color: inherit;
}

.top-tag-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-xl);
}

.tag-rank {
  width: fit-content;
  font-size: var(--text-xs);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-dark);
  background: var(--accent-light);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: var(--radius-full);
  padding: 0.25rem 0.6rem;
}

.tag-title {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  word-break: normal;
}

.tag-stat {
  margin: 0.25rem 0 0 0;
  color: var(--text-secondary);
  font-weight: 700;
}

.tag-preview {
  display: grid;
  gap: 0.25rem;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.preview-label {
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preview-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
  word-break: normal;
}

.tag-arrow {
  margin-left: auto;
  color: var(--text-tertiary);
  transition:
    transform var(--transition-base),
    color var(--transition-base);
}

.top-tag-card:hover .tag-arrow {
  transform: translateX(2px);
  color: var(--accent);
}

/* ====================
 * DYNAMIC INLINE STYLES CONVERTED TO CSS CUSTOM PROPERTIES
 * ==================== */

/* Category Page - Dynamic Category Colors */
.category-icon {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--category-color, #666) 13%, transparent) 0%,
    color-mix(in srgb, var(--category-color, #666) 7%, transparent) 100%
  );
}

.category-emoji {
  color: var(--category-color, #666);
}

/* Telemetry Chart - Dynamic Bar Heights */
.chart-bar {
  height: var(--bar-height, 10%);
}

/* Utility class for JavaScript-controlled visibility */
.is-hidden {
  display: none !important;
}

/* ====================
 * POST NAVIGATION
 * ==================== */
.post-navigation {
  margin: var(--space-12) 0;
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.post-nav-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .post-nav-links {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  padding: var(--space-6);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  text-decoration: none;
}

.post-nav-link:hover {
  border-color: var(--accent);
  background: var(--bg-body);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.post-nav-link.prev {
  text-align: left;
}

.post-nav-link.next {
  text-align: right;
}

.post-nav-link .nav-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
  display: block;
}

.post-nav-link .nav-title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-nav-link.prev .nav-label::before {
  content: "← ";
}

.post-nav-link.next .nav-label::after {
  content: " →";
}

.post-nav-placeholder {
  display: none;
}

@media (min-width: 640px) {
  .post-nav-placeholder {
    display: block;
  }
}

/* Article Tags - Header (under title) */
.article-tags-header {
  margin-top: var(--space-4);
  margin-bottom: var(--space-6);
}

.article-tags-header .tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.article-tags-header .tag-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.8rem;
  background: var(--accent-light);
  border: 2px solid var(--accent);
  border-radius: var(--radius-full);
  font-size: 0.875rem; /* 14px */
  letter-spacing: 0.03em;
  font-weight: 700;
  color: var(--accent-dark);
  text-decoration: none;
  transition: all var(--transition-base);
  line-height: 1.2;
}

.article-tags-header .tag-link:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

@media (max-width: 480px) {
  .article-tags-header .tag-link {
    font-size: var(--text-sm);
    padding: 0.4rem 0.85rem;
  }
}

/* Article Category Property (before related posts) */
.article-category-property {
  margin-top: var(--space-6);
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
}

.article-category-property .property-label {
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.article-category-property .property-value {
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
  transition: color var(--transition-base);
}

.article-category-property a.property-value:hover {
  color: var(--accent);
  text-decoration: underline;
}

@media (max-width: 480px) {
  .article-category-property {
    font-size: var(--text-sm);
    padding: var(--space-3);
  }
}

/* Article Tags - Legacy (kept for backward compatibility) */
.article-tags {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px dashed var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.tags-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag-link {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-base);
}

.tag-link:hover {
  background: var(--accent-light);
  color: var(--accent-dark);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* ==========================================================================
   STATISTICS & MILESTONE MATRIX (Integration)
   ========================================================================== */

.dory-stats-page .chart-container,
.data-insights-page .chart-container {
  height: 400px;
  position: relative;
  overflow: hidden;
}

@media (max-width: 768px) {
  .dory-stats-page .chart-container,
  .data-insights-page .chart-container {
    height: 320px;
  }
}

@media (max-width: 600px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    background: var(--bg-elevated);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }

  .summary-card {
    min-height: 120px;
    padding: var(--space-4);
  }

  .card-icon {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
  }

  .card-label {
    font-size: var(--text-xs);
  }

  .categories-grid,
  .tags-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
    background: var(--bg-elevated);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
  }

  .category-card-link {
    min-height: 44px;
    gap: var(--space-3);
    padding: var(--space-4);
  }

  .category-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
  }

  .category-description {
    display: none;
  }

  .category-name {
    font-size: var(--text-base);
  }

  .category-count {
    font-size: var(--text-xs);
  }

  .summary-stats {
    padding: var(--space-5);
    gap: var(--space-4);
    width: 100%;
    justify-content: center;
  }

  .categories-summary .summary-stats,
  .archives-summary .summary-stats,
  .tags-summary .summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: var(--space-3);
    width: min(100%, 420px);
    padding: var(--space-4);
  }

  .categories-summary .stat-divider,
  .archives-summary .stat-divider,
  .tags-summary .stat-divider {
    display: none;
  }

  .categories-summary .stat-item,
  .archives-summary .stat-item,
  .tags-summary .stat-item {
    min-width: 0;
  }

  .categories-summary .stat-label,
  .archives-summary .stat-label,
  .tags-summary .stat-label {
    letter-spacing: 0.04em;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
  }

  .stat-item {
    min-width: 72px;
  }
}

@media (min-width: 480px) and (max-width: 600px) {
  .categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dory-stats-page .chart-container canvas,
.data-insights-page .chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

.milestone-matrix {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin: 3rem 0;
}

@media (max-width: 600px) {
  .milestone-matrix {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}

.matrix-item {
  background: #f3f4f6;
  padding: 1.25rem 0.5rem;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  color: #4b5563;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.matrix-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  background: #fff;
  border-color: var(--accent-light);
}

.matrix-item.status-success {
  background: #def7ec;
  color: #03543f;
}
.matrix-item.status-pending {
  background: #fef3c7;
  color: #92400e;
}
.matrix-month {
  font-size: 0.75rem;
  font-weight: 800;
  display: block;
  margin-bottom: 5px;
}
.matrix-icon {
  font-size: 1.5rem;
}

/* Header Adjustments (Integration) - overrides handled in main lang-switcher block above */

/* Telemetry Sidebar Widget */
.telemetry-sidebar-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0;
  border-top: 4px solid var(--accent);
}

.telemetry-sidebar-widget .widget-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.telemetry-grid-mini {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.telemetry-item-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-light);
}

.telemetry-item-mini:last-child {
  border-bottom: none;
}

.telemetry-item-mini .label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
}

.telemetry-item-mini .value {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono-telemetry);
}

.telemetry-sidebar-widget .widget-link {
  display: block;
  text-align: right;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-base);
}

.telemetry-sidebar-widget .widget-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.telemetry-sidebar-widget.dory-growth-banner {
  display: grid;
  gap: var(--space-4);
}

.dory-growth-banner .banner-copy {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.dory-growth-banner .banner-link {
  text-align: center;
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  transition:
    background var(--transition-base),
    transform var(--transition-fast);
}

.dory-growth-banner .banner-link:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

/* ==========================================================================
   Mobile Fixes (Layout & Font Size)
   ========================================================================== */

@media (max-width: 768px) {
  /* Reduce article body font size on mobile */
  .article-body {
    font-size: 1rem; /* Revert to 16px base size */
  }

  /* Ensure specific elements don't overflow */
  .article-body pre {
    white-space: pre-wrap; /* Wrap long code lines */
    word-wrap: break-word;
    overflow-x: auto; /* Allow horizontal scroll if needed */
    max-width: 100%;
    display: block; /* Force block layout */
  }

  .article-body code {
    white-space: normal;
    word-wrap: break-word;
  }

  .article-body table {
    display: block; /* Make table block element */
    overflow-x: auto; /* Allow horizontal scroll */
    width: 100%;
    max-width: 100%;
  }

  .article-body iframe,
  .article-body object,
  .article-body embed,
  .article-body video {
    max-width: 100%;
    height: auto; /* Maintain aspect ratio */
  }

  /* Ensure container constraints are respected */
  .article-content {
    overflow-x: hidden; /* Clip any remaining overflow */
    width: 100%;
    max-width: 100%;
  }

  /* モバイル最適化 - 新しい統合コンテナシステムに含まれているため削除 */

  /* Footer Mobile Optimization - 保持 */
  .footer-about {
    padding: var(--space-4); /* Reduced to 16px for better content width */
  }

  .site-footer .footer-layout {
    padding-left: var(--space-2); /* Reduced to 8px */
    padding-right: var(--space-2);
  }

  .footer-grid {
    padding-left: 0; /* Removed padding to maximize width */
    padding-right: 0;
  }
}

/* ==========================================================================
   Mobile Card Density
   Reduce card padding/radius/shadow to lower boxed feeling on small screens.
   ========================================================================== */
@media (max-width: 767px) {
  :root {
    --space-card-padding: var(--mobile-card-padding);
  }

  .card-base,
  .summary-card,
  .insight-card,
  .faq-item,
  .home-roadmap-card,
  .home-tile,
  .home-knowledge,
  .home-today-card-content,
  .amazon-card-content,
  .comparison-card,
  .fixed-page-overview,
  .fixed-page-next-read,
  .fixed-page-clarity-nav,
  .tw-surface-panel {
    padding: var(--mobile-card-padding);
  }

  .summary-card,
  .insight-card,
  .faq-item,
  .home-roadmap-card,
  .home-tile,
  .home-knowledge,
  .comparison-card,
  .fixed-page-overview,
  .fixed-page-next-read,
  .fixed-page-clarity-nav,
  .tw-surface-panel {
    border-radius: 0.95rem;
    box-shadow: var(--shadow-xs);
    border-color: color-mix(in srgb, var(--border) 72%, #ffffff);
  }
}


/* ==========================================================================
   Single Post Mobile Reading Mode
   Flatten dense card UI for better text readability on small screens.
   ========================================================================== */
@media (max-width: 767px) {
  body.single .layout-container {
    padding-left: var(--mobile-content-gutter);
    padding-right: var(--mobile-content-gutter);
  }

  body.single .layout-container--with-vertical {
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  body.single .article-header {
    padding-top: 1.25rem;
    padding-bottom: 0.625rem;
    margin-bottom: 0.75rem;
  }

  body.single blockquote {
    margin: 1.25rem 0;
    padding: 0.2rem 0 0.2rem 0.9rem;
    border-left-width: 3px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-style: normal;
  }

  body.single blockquote::before {
    content: none;
  }

  body.single .ai-summary {
    margin-bottom: 1.25rem;
    padding: 0.95rem 0 0.95rem 0.95rem;
    border: 0;
    border-left: 3px solid var(--accent);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  body.single .ai-summary-header {
    margin-bottom: 0.75rem;
  }

  body.single .ai-summary-title {
    font-size: 1rem;
  }

  body.single .ai-summary-list {
    gap: 0.55rem;
  }

  body.single .ai-summary-list li {
    padding-left: 1.4rem;
    font-size: 0.98rem;
    line-height: 1.8;
  }

  body.single .article-category-property {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0 0.25rem 0.9rem;
    border-radius: 0;
    border-left-width: 3px;
    background: transparent;
  }

  body.single .related-posts {
    margin: 2.25rem 0 1.5rem;
    padding: 1rem 0 0;
    border-top-width: 1px;
    border-bottom: 0;
    border-radius: 0;
    background: transparent;
  }

  body.single .related-posts-title {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    text-align: left;
    font-size: 1.25rem;
  }

  body.single .related-posts-title::after {
    left: 0;
    transform: none;
    width: 42px;
    height: 3px;
  }

  body.single .related-posts-grid {
    padding: 0;
    gap: 0.5rem;
  }

  body.single .related-posts-grid--scroll::before,
  body.single .related-posts-grid--scroll::after {
    content: none;
  }

  body.single .related-post-card {
    min-width: min(80vw, 280px);
    border: 0;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  body.single .post-navigation {
    margin: 1.5rem 0;
    padding-top: 1rem;
  }

  body.single .post-nav-links {
    gap: 0;
  }

  body.single .post-nav-link {
    padding: 0.95rem 0;
    border: 0;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    background: transparent;
  }

  body.single .post-nav-link:hover {
    transform: none;
    box-shadow: none;
    background: transparent;
  }

  body.single .post-nav-link.next {
    text-align: left;
  }

  body.single .article-info-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
  }
}

/* ==========================================================================
   RESPONSIVE ENHANCEMENT - WIDE SCREENS
   ========================================================================== */

/* Enhanced reading width on very wide screens */
@media (min-width: 1440px) {
  .article-content {
    max-width: 860px; /* Slightly wider on large screens */
  }

  :root {
    --content-max-ch: 70ch; /* Allow slightly longer lines */
  }
}

/* ==========================================================================
   Mobile Section Tone Layout (Data Insights / Dory Stats)
   Cards are flattened and sections are split by tone only.
   ========================================================================== */
@media (max-width: 768px) {
  .data-insights-page > section,
  .dory-stats-page > section {
    padding: clamp(2rem, 7vw, 2.75rem) 0;
  }

  .data-insights-page > section:not(.page-hero),
  .dory-stats-page > section:not(.page-hero) {
    background: #ffffff;
  }

  .data-insights-page > section:nth-of-type(even):not(.page-hero),
  .dory-stats-page > section:nth-of-type(even):not(.page-hero) {
    background: #f6f7f9;
  }

  .data-insights-page .container,
  .dory-stats-page .container {
    width: 100%;
    max-width: none;
    padding-left: clamp(0.875rem, 4vw, 1.125rem);
    padding-right: clamp(0.875rem, 4vw, 1.125rem);
  }

  .data-insights-page .key-insights-grid,
  .dory-stats-page .key-insights-grid,
  .data-insights-page .achievements-grid,
  .dory-stats-page .achievements-grid,
  .data-insights-page .charts-grid,
  .dory-stats-page .charts-grid,
  .data-insights-page .summary-grid,
  .dory-stats-page .summary-grid,
  .data-insights-page .insights-grid,
  .dory-stats-page .insights-grid {
    grid-template-columns: 1fr;
    gap: 0;
    background: transparent;
    padding: 0;
    border-radius: 0;
  }

  .data-insights-page .chart-container,
  .dory-stats-page .chart-container,
  .data-insights-page .insight-card,
  .dory-stats-page .insight-card,
  .data-insights-page .summary-card,
  .dory-stats-page .summary-card,
  .data-insights-page .faq-item,
  .dory-stats-page .faq-item,
  .data-insights-page .achievement-card,
  .dory-stats-page .achievement-card,
  .data-insights-page .history-item,
  .dory-stats-page .history-item {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 1rem 0;
    transform: none;
  }

  .data-insights-page .summary-card::before,
  .dory-stats-page .summary-card::before,
  .data-insights-page .insight-card::before,
  .dory-stats-page .insight-card::before {
    display: none;
  }

  .data-insights-page .key-insights-grid > *:not(:last-child),
  .dory-stats-page .key-insights-grid > *:not(:last-child),
  .data-insights-page .achievements-grid > *:not(:last-child),
  .dory-stats-page .achievements-grid > *:not(:last-child),
  .data-insights-page .charts-grid > *:not(:last-child),
  .dory-stats-page .charts-grid > *:not(:last-child),
  .data-insights-page .summary-grid > *:not(:last-child),
  .dory-stats-page .summary-grid > *:not(:last-child),
  .data-insights-page .insights-grid > *:not(:last-child),
  .dory-stats-page .insights-grid > *:not(:last-child),
  .data-insights-page .faq-list > *:not(:last-child),
  .dory-stats-page .faq-list > *:not(:last-child),
  .data-insights-page .history-list > *:not(:last-child),
  .dory-stats-page .history-list > *:not(:last-child) {
    border-bottom: 1px solid #dde3ea;
  }

  .data-insights-page .chart-container,
  .dory-stats-page .chart-container {
    height: auto;
    min-height: 0;
  }

  .data-insights-page .chart-container:hover,
  .dory-stats-page .chart-container:hover,
  .data-insights-page .insight-card:hover,
  .dory-stats-page .insight-card:hover,
  .data-insights-page .summary-card:hover,
  .dory-stats-page .summary-card:hover,
  .data-insights-page .achievement-card:hover,
  .dory-stats-page .achievement-card:hover,
  .data-insights-page .faq-item:hover,
  .dory-stats-page .faq-item:hover {
    box-shadow: none;
    transform: none;
  }
}

/* Archive hero variant (category / tag pages) */
.archive-page-hero {
  padding: var(--space-12) 0 var(--space-8);
}

.archive-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  margin: 0 0 var(--space-3) 0;
}

.archive-post-count {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin: var(--space-2) 0 0 0;
}

.archive-no-posts {
  padding: var(--space-16) var(--space-4);
  text-align: center;
  color: var(--text-tertiary);
  font-size: var(--text-lg);
}

/* ==========================================================================
   Search Page
   ========================================================================== */

.search-query-display {
  font-style: italic;
  color: var(--text-secondary);
}

.search-form-wrapper {
  padding: var(--space-6) 0 var(--space-4);
  max-width: 640px;
}

.search-form {
  display: flex;
  gap: var(--space-2);
  width: 100%;
}

.search-form label {
  flex: 1;
  min-width: 0;
}

.search-field {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  font-family: var(--font-main);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
  outline: none;
}

.search-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.search-field::placeholder {
  color: var(--text-muted);
}

.search-submit {
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-main);
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
  white-space: nowrap;
}

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

.search-no-results {
  padding: var(--space-12) var(--space-4);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  max-width: 56ch;
  margin: 0 auto;
  line-height: var(--line-height-relaxed);
}

/* ==========================================================================
   404 Error Page
   ========================================================================== */

.error-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  align-items: center;
  padding: var(--space-16) 0;
  max-width: 900px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .error-page {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-12);
  }
}

.error-page-visual img {
  width: 100%;
  max-width: 400px;
  height: auto;
  border-radius: var(--radius-2xl);
  display: block;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}

.error-page-body {
  padding: var(--space-4);
}

@media (min-width: 768px) {
  .error-page-body {
    padding: 0;
  }
}

.error-code {
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, var(--accent) 0%, #7c3aed 60%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 var(--space-4) 0;
}

.error-title {
  font-size: clamp(1.375rem, 4vw, 1.875rem);
  font-weight: 700;
  margin: 0 0 var(--space-4) 0;
  line-height: var(--line-height-heading);
}

.error-description {
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin: 0 0 var(--space-8) 0;
  max-width: 48ch;
}

.error-actions {
  margin-bottom: var(--space-8);
}

.error-btn-home {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: var(--text-base);
  text-decoration: none;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.error-btn-home:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.error-search {
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-6);
}

.error-search .search-form-wrapper {
  padding: var(--space-4) 0 0;
}

/* ==========================================================================
   Dory Docs Archive (post-card grid)
   ========================================================================== */

.dory-doc-breadcrumb {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.dory-doc-breadcrumb a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.dory-doc-breadcrumb a:hover {
  color: var(--accent);
}

.dory-doc-breadcrumb-sep {
  margin: 0 var(--space-1);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

@media (max-width: 600px) {
  .post-grid {
    grid-template-columns: 1fr;
  }
}

.post-card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.post-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.post-card-image {
  height: 200px;
  background: var(--border-light);
  overflow: hidden;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.post-card:hover .post-card-image img {
  transform: scale(1.03);
}

.post-card-content {
  padding: var(--space-5) var(--space-5) var(--space-5);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.post-card-category {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--warning);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: var(--space-1);
}

.post-card-title {
  font-size: var(--text-lg);
  margin: 0;
  line-height: var(--line-height-snug);
  color: var(--text-primary);
}

.post-card-excerpt {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--line-height-relaxed);
  margin: 0;
  flex-grow: 1;
}

.post-card-footer {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-light);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ==========================================================================
   Article Info Section
   ========================================================================== */

.article-info-section {
  margin-top: var(--space-12);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.article-info-heading {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--space-4);
}

.article-info-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--space-2) var(--space-6);
  margin: 0;
  font-size: var(--text-sm);
}

.article-info-row {
  display: contents;
}

.article-info-list dt {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  padding-top: 0.1em;
}

.article-info-list dd {
  margin: 0;
  color: var(--text-secondary);
}

.article-info-list dd a {
  color: var(--accent);
  text-decoration: none;
}

.article-info-list dd a:hover {
  text-decoration: underline;
}

.article-info-langs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.article-info-lang-link {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  transition: border-color 0.15s, color 0.15s;
}

.article-info-lang-link:hover {
  border-color: var(--accent);
  color: var(--accent) !important;
}
