/* blog.css - Notion Design System */
/* hermes-agent Blog - Notion-inspired layout */

/* ========================================
   Google Fonts - Inter
   ======================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

/* ========================================
   デザイントークン (Notion レイヤー)
   ======================================== */
:root {
  --notion-white: #ffffff;
  --notion-warm-white: #f7f6f3;
  --notion-text: rgba(0, 0, 0, 0.85);
  --notion-text-light: rgba(0, 0, 0, 0.6);
  --notion-text-muted: rgba(0, 0, 0, 0.4);
  --notion-border: rgba(0, 0, 0, 0.1);
  --notion-border-strong: rgba(0, 0, 0, 0.16);
  --notion-blue: #0075de;

  --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.03), 0 2px 4px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.03), 0 2px 4px rgba(0, 0, 0, 0.03), 0 4px 8px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.03), 0 6px 12px rgba(0, 0, 0, 0.05), 0 12px 24px rgba(0, 0, 0, 0.06);

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

/* ========================================
   ベース上書き
   ======================================== */
body {
  font-family: var(--font-inter);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: rgba(0, 117, 222, 0.18);
}

/* スキップリンク */
.skip-link {
  position: absolute;
  top: -48px;
  left: 0;
  padding: var(--space-2) var(--space-4);
  background: var(--notion-blue);
  color: #fff;
  font-weight: 600;
  z-index: 1100;
  transition: top var(--transition-fast);
  border-radius: 0 0 var(--radius-md) 0;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ========================================
   メインレイアウト (2カラム + 300px サイドバー)
   ======================================== */
.blog-main {
  padding: 4rem 0 6rem;
  margin-top: var(--header-height, 72px);
  min-height: calc(100vh - var(--header-height, 72px));
  background: var(--bg-color, var(--notion-white));
}

.blog-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

.main-content { min-width: 0; }

/* サイドバー */
.blog-sidebar {
  position: sticky;
  top: calc(var(--header-height, 72px) + 1rem);
}

.sidebar-widget {
  background: var(--notion-white);
  border: 1px solid var(--notion-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.sidebar-widget h3 {
  font-family: var(--font-inter);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--notion-text-muted);
  margin: 0 0 var(--space-3);
}

/* 広告プレースホルダー */
.ad-placeholder {
  background: var(--notion-warm-white);
  border: 1px dashed var(--notion-border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  text-align: center;
  color: var(--notion-text-muted);
  font-size: 0.8rem;
}

/* ========================================
   ブログ一覧
   ======================================== */
.article-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--notion-border);
}

.article-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  color: var(--text-primary, var(--primary-color, var(--notion-text)));
}

.article-meta {
  font-size: 1rem;
  color: var(--text-secondary, var(--text-light));
  line-height: 1.6;
  margin: 0;
}

/* 記事グリッド */
.blog-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.blog-card {
  background: var(--notion-white);
  border: 1px solid var(--notion-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
  box-shadow: var(--shadow-sm);
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #38bdf8;
}

.blog-card > a {
  display: grid;
  grid-template-columns: 240px 1fr;
  color: inherit;
  text-decoration: none;
}

.blog-card-thumb {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

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

.blog-card-content time {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #38bdf8;
  margin-bottom: var(--space-2);
}

.blog-card-content h2 {
  font-family: var(--font-inter);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--primary-color, var(--notion-text));
  margin: 0 0 var(--space-3);
}
.blog-card-content h2 a { color: inherit; }
.blog-card-content h2 a:hover { color: #38bdf8; }

.blog-card-content p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-dark, var(--notion-text-light));
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================================
   記事詳細ページ
   ======================================== */
.article-hero-image {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--notion-border);
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
}

.article-content {
  color: var(--text-dark, var(--notion-text));
  font-size: 1.0625rem;
  line-height: 1.8;
}

.article-content h2 {
  font-family: var(--font-inter);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--primary-color, var(--notion-blue));
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color, var(--notion-blue));
}

.article-content h3 {
  font-family: var(--font-inter);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--primary-color, var(--notion-blue));
  margin: 2rem 0 0.75rem;
}

.article-content p { margin: 0 0 1rem; }

.article-content ul,
.article-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.article-content li { margin-bottom: 0.5rem; }

.article-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--notion-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin: 1.5rem auto;
}

.article-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--notion-warm-white);
  border-left: 3px solid var(--notion-blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--notion-text-light);
  font-style: italic;
}

.article-content a {
  color: var(--secondary-color, var(--notion-blue));
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ========================================
   フッターリンク調整
   ======================================== */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}
.footer-links a {
  font-size: 0.875rem;
  color: var(--text-light, var(--notion-text-muted));
  text-decoration: none;
}
.footer-links a:hover { color: #38bdf8; }

/* ========================================
   レスポンシブ (768px以下: 1カラム)
   ======================================== */
@media (max-width: 768px) {
  .blog-container {
    grid-template-columns: 1fr;
  }
  .blog-sidebar {
    position: static;
  }
  .blog-card > a {
    grid-template-columns: 1fr;
  }
  .blog-card-thumb {
    height: 180px;
  }
  .article-title {
    font-size: 1.75rem;
  }
  .blog-main {
    padding: 2rem 0 4rem;
  }
  .sidebar-widget img {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  .blog-container {
    padding: 0 4%;
  }
  .blog-card-content {
    padding: var(--space-4);
  }
  .article-content h2 {
    font-size: 1.35rem;
  }
  .article-content h3 {
    font-size: 1.15rem;
  }
  .article-content {
    font-size: 1rem;
    line-height: 1.75;
  }
}
