/* Notion Design System - Casting Pattern Production Blog */
   Casting Pattern Production Blog — Notion Design System v2.0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Notion Color Palette */
  --bg-primary: #f6f5f4;
  --bg-surface: #ffffff;
  --text-primary: rgba(0, 0, 0, 0.95);
  --text-secondary: rgba(0, 0, 0, 0.65);
  --text-tertiary: rgba(0, 0, 0, 0.45);
  --accent: #0075de;
  --accent-hover: #005fb8;
  --border: rgba(0, 0, 0, 0.1);
  --border-hover: rgba(0, 0, 0, 0.2);

  /* Shadows - 4-5 layer low opacity stack */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.04), 0 8px 16px rgba(0, 0, 0, 0.04), 0 16px 32px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.04);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', Helvetica, Arial, sans-serif;
  --base-size: 16px;
  --line-height: 1.6;

  /* Spacing - 8px base system */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --space-2xl: 64px;
  --space-3xl: 80px;
  --space-4xl: 96px;

  /* Layout */
  --max-width: 1200px;
  --sidebar-width: 320px;
  --header-height: 72px;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;

  /* Transitions */
  --transition: 0.2s ease;

  /* Legacy fallback */
  --notion-bg: var(--bg-primary);
  --notion-white: var(--bg-surface);
  --notion-text: var(--text-primary);
  --notion-text-muted: var(--text-secondary);
  --notion-text-light: var(--text-tertiary);
  --notion-blue: var(--accent);
  --notion-blue-hover: var(--accent-hover);
  --notion-border: var(--border);
  --notion-border-hover: var(--border-hover);
  --notion-shadow-sm: var(--shadow-sm);
  --notion-shadow-md: var(--shadow-md);
  --notion-shadow-lg: var(--shadow-lg);
  --notion-shadow-card: var(--shadow-card);
  --font-inter: var(--font-sans);
  --font-noto: var(--font-sans);
  --space-1: var(--space-xs);
  --space-2: var(--space-sm);
  --space-3: var(--space-md);
  --space-4: var(--space-lg);
  --space-5: var(--space-xl);
  --space-6: var(--space-2xl);
  --space-7: var(--space-3xl);
  --space-8: var(--space-4xl);
  --space-9: 120px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;
}

/* ========================================
   Base Styles
   ======================================== */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-noto);
  color: var(--notion-text);
  background: var(--notion-bg);
  line-height: 1.7;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--notion-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

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

/* ========================================
   Header (same as main site)
   ======================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--notion-white);
  border-bottom: 1px solid var(--notion-border);
  height: var(--header-height);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.site-logo a {
  font-family: var(--font-inter);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--notion-text);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-logo .logo-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--notion-text-muted);
  margin-top: 2px;
}

.nav-main ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: var(--space-1);
}

.nav-main a {
  display: block;
  padding: var(--space-1) var(--space-2);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--notion-text-muted);
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.nav-main a:hover,
.nav-main a.active {
  color: var(--notion-text);
  background: var(--notion-bg);
  text-decoration: none;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-1);
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--notion-text);
  margin: 5px 0;
  transition: 0.3s;
}

/* Mobile overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--notion-white);
  z-index: 99;
  padding: var(--space-3);
}

.mobile-overlay nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-overlay a {
  padding: var(--space-2);
  font-size: 1rem;
  color: var(--notion-text);
  border-bottom: 1px solid var(--notion-border);
}

/* ========================================
   Page Hero
   ======================================== */
.page-hero {
  position: relative;
  height: 25vh;
  min-height: 180px;
  max-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--notion-white);
}

.page-hero .hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.page-hero .hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
}

.page-hero h1 {
  position: relative;
  z-index: 1;
  font-family: var(--font-inter);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--notion-text);
  text-align: center;
  padding: 0 var(--space-3);
  margin: 0;
}

/* ========================================
   Breadcrumb
   ======================================== */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  color: var(--notion-text-muted);
}

.breadcrumb a {
  color: var(--notion-text-muted);
}

.breadcrumb a:hover {
  color: var(--notion-blue);
}

.breadcrumb span {
  margin: 0 var(--space-1);
  opacity: 0.5;
}

/* ========================================
   Main Layout - 2 Column
   ======================================== */
.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--space-6) var(--space-3) var(--space-9);
}

.blog-main {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-5);
  align-items: start;
}

/* ========================================
   Blog List (Index Page)
   ======================================== */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.blog-card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-4);
  background: var(--notion-white);
  border: 1px solid var(--notion-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s ease;
  box-shadow: var(--notion-shadow-card);
}

.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--notion-shadow-md);
  border-color: var(--notion-border-hover);
}

.blog-card a {
  text-decoration: none;
  color: inherit;
}

.blog-card a:hover {
  text-decoration: none;
}

.blog-thumbnail {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  background: var(--notion-bg);
}

.blog-content {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.blog-content h2 {
  font-family: var(--font-inter);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--notion-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-content time {
  font-size: 0.875rem;
  color: var(--notion-text-light);
  font-weight: 500;
}

.blog-content .article-summary {
  font-size: 0.95rem;
  color: var(--notion-text-muted);
  line-height: 1.7;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--notion-blue);
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.read-more::after {
  content: '→';
  transition: transform 0.2s ease;
}

.blog-card:hover .read-more::after {
  transform: translateX(4px);
}

/* ========================================
   Article Detail Page
   ======================================== */
.article-detail {
  background: var(--notion-white);
  border: 1px solid var(--notion-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--notion-shadow-card);
}

.article-header {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--notion-border);
}

.article-title {
  font-family: var(--font-inter);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--notion-text);
  margin: 0 0 var(--space-2);
}

.article-meta {
  display: flex;
  gap: var(--space-3);
  font-size: 0.875rem;
  color: var(--notion-text-light);
}

.article-hero-image {
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  border-bottom: 1px solid var(--notion-border);
}

.article-body {
  padding: var(--space-5);
}

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

.article-content p {
  margin: 0 0 var(--space-3);
}

.article-content h2 {
  font-family: var(--font-inter);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--notion-text);
  margin: var(--space-6) 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--notion-border);
}

.article-content h3 {
  font-family: var(--font-inter);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--notion-text);
  margin: var(--space-5) 0 var(--space-2);
}

.article-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--notion-text);
  margin: var(--space-4) 0 var(--space-2);
}

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

.article-content a:hover {
  color: var(--notion-blue-hover);
}

.article-content ul,
.article-content ol {
  margin: var(--space-3) 0 var(--space-3) var(--space-4);
  padding: 0;
}

.article-content li {
  margin-bottom: var(--space-2);
  color: var(--notion-text-muted);
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--space-4) 0;
  border: 1px solid var(--notion-border);
}

.article-content blockquote {
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--notion-bg);
  border-left: 3px solid var(--notion-blue);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--notion-text-muted);
}

.article-content strong {
  font-weight: 600;
  color: var(--notion-text);
}

.article-content code {
  background: var(--notion-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.9em;
}

.article-content pre {
  background: var(--notion-bg);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--notion-border);
}

/* ========================================
   Sidebar
   ======================================== */
.sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar-widget {
  background: var(--notion-white);
  border: 1px solid var(--notion-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--notion-shadow-card);
}

.sidebar-widget h4 {
  font-family: var(--font-inter);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--notion-text);
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--notion-border);
}

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

.sidebar-widget li {
  margin-bottom: var(--space-2);
}

.sidebar-widget a {
  display: block;
  padding: var(--space-1) 0;
  font-size: 0.9rem;
  color: var(--notion-text-muted);
  transition: all 0.15s ease;
}

.sidebar-widget a:hover {
  color: var(--notion-blue);
  text-decoration: none;
  padding-left: var(--space-1);
}

.sidebar-ad {
  text-align: center;
  padding: var(--space-3);
  background: var(--notion-white);
  border: 1px solid var(--notion-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--notion-shadow-card);
}

.sidebar-ad img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s ease;
}

.sidebar-ad img:hover {
  opacity: 0.9;
}

.amazon-banner {
  display: block;
  background: linear-gradient(135deg, #232f3e 0%, #37475a 100%);
  color: white;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none !important;
}

.amazon-banner:hover {
  opacity: 0.95;
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
  max-width: var(--max-width);
  margin: var(--space-8) auto var(--space-6);
  padding: var(--space-6) var(--space-5);
  background: var(--notion-white);
  border: 1px solid var(--notion-border);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--notion-shadow-card);
}

.cta-section h2 {
  font-family: var(--font-inter);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--notion-text);
  margin: 0 0 var(--space-2);
}

.cta-section p {
  color: var(--notion-text-muted);
  margin: 0 0 var(--space-4);
}

.btn-primary {
  display: inline-block;
  background: var(--notion-blue);
  color: white !important;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary:hover {
  background: var(--notion-blue-hover);
  transform: translateY(-1px);
  box-shadow: var(--notion-shadow-sm);
  text-decoration: none;
}

/* ========================================
   Footer (same as main site)
   ======================================== */
.site-footer {
  background: var(--notion-white);
  border-top: 1px solid var(--notion-border);
  padding: var(--space-7) 0 var(--space-5);
  margin-top: var(--space-8);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.footer-about h3 {
  font-family: var(--font-inter);
  font-size: 1rem;
  font-weight: 700;
  color: var(--notion-text);
  margin: 0 0 var(--space-2);
}

.footer-about .logo-sub {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--notion-text-muted);
}

.footer-about p {
  font-size: 0.9rem;
  color: var(--notion-text-muted);
  line-height: 1.7;
  margin: 0;
}

.footer-col h4 {
  font-family: var(--font-inter);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--notion-text);
  margin: 0 0 var(--space-3);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-col li {
  margin-bottom: var(--space-2);
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--notion-text-muted);
  transition: color 0.15s ease;
}

.footer-col a:hover {
  color: var(--notion-blue);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--notion-border);
  flex-wrap: wrap;
  gap: var(--space-3);
}

.footer-bottom p {
  font-size: 0.875rem;
  color: var(--notion-text-light);
  margin: 0;
}

.footer-links {
  display: flex;
  gap: var(--space-3);
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--notion-text-light);
}

.footer-links a:hover {
  color: var(--notion-blue);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
  .blog-main {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }
  
  .nav-main {
    display: none;
  }
  
  .hamburger {
    display: block;
  }
  
  .mobile-overlay {
    display: block;
  }
  
  .page-content {
    padding: var(--space-4) var(--space-3) var(--space-6);
  }
  
  .blog-card {
    grid-template-columns: 1fr;
  }
  
  .blog-thumbnail {
    min-height: 200px;
  }
  
  .blog-content {
    padding: var(--space-3);
  }
  
  .article-header {
    padding: var(--space-4);
  }
  
  .article-body {
    padding: var(--space-4);
  }
  
  .article-content h2 {
    font-size: 1.25rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .sidebar {
    grid-template-columns: 1fr;
  }
  
  .cta-section {
    margin: var(--space-5) var(--space-2);
    padding: var(--space-4);
  }
}

@media (max-width: 480px) {
  .header-inner {
    padding: 0 var(--space-2);
  }
  
  .page-hero {
    height: 20vh;
    min-height: 140px;
  }
  
  .page-hero h1 {
    font-size: 1.5rem;
  }
  
  .blog-content h2 {
    font-size: 1.1rem;
  }
  
  .article-title {
    font-size: 1.25rem;
  }
  
  .article-meta {
    flex-direction: column;
    gap: var(--space-1);
  }
}

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

.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

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

/* ========================================
   New Notion Design System Classes v2.0
   ======================================== */

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: var(--space-xs) var(--space-sm);
  z-index: 1001;
  font-weight: 500;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* Container */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--space-md); }

/* Blog Hero - New Style */
.blog-hero {
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-primary) 100%);
  padding: var(--space-2xl) 0;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.blog-hero-title {
  font-family: var(--font-sans);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.blog-hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Blog Layout - Two Column */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-xl);
  padding: var(--space-xl) 0;
}

/* Blog Grid */
.blog-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Card Thumb & Body for New Structure */
.card-thumb {
  width: 100%;
  height: 100%;
  min-height: 180px;
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition);
}

.blog-card:hover .card-thumb img {
  transform: scale(1.02);
}

.card-body {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
}

.card-body time {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.card-body h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: var(--space-xs);
  color: var(--text-primary);
}

.card-body h3 a { 
  color: inherit; 
  text-decoration: none;
}

.card-body h3 a:hover { 
  color: var(--accent);
  text-decoration: none;
}

.card-body p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1e1e1e;
    --bg-surface: #2a2a2a;
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-tertiary: rgba(255, 255, 255, 0.45);
    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 255, 255, 0.2);
  }
  
  body {
    background: var(--bg-primary);
    color: var(--text-primary);
  }
  
  .site-header, .site-footer {
    background: var(--bg-surface);
  }
  
  .blog-hero {
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-primary) 100%);
  }
  
  .blog-card, .sidebar-widget, .sidebar-ad, .cta-section {
    background: var(--bg-surface);
    border-color: var(--border);
  }
}
