/* =========================================
   Sodpion - Summer Breeze Advanced Theme
   ダークモード対応 / 多機能ブログ構成
   ========================================= */

   @import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Noto+Sans+JP:wght@300;400;500;700&family=Space+Grotesk:wght@400;500;600&display=swap');

   :root {
       /* Light Theme */
       --bg: #f8f9fc;
       --bg-alt: #f0f9ff;
       --surface: #ffffff;
       --surface-hover: #f1f5f9;
       --text: #2c3e50;
       --text-light: #54687a;
       --text-muted: #94a3b8;
       --accent: #5ec8e0;
       --accent-hover: #4ab9d8;
       --accent-soft: #e0f7ff;
       --border: rgba(94, 200, 224, 0.2);
       --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
       --shadow: 0 10px 30px rgba(94, 200, 224, 0.15);
       --shadow-lg: 0 20px 40px rgba(94, 200, 224, 0.2);
       --nav-bg: rgba(255, 255, 255, 0.85);
   }
   
   [data-theme="dark"] {
       /* Dark Theme - "Night Breeze" */
       --bg: #0f172a;
       --bg-alt: #1e293b;
       --surface: #1e293b;
       --surface-hover: #334155;
       --text: #f1f5f9;
       --text-light: #cbd5e1;
       --text-muted: #64748b;
       --accent: #38bdf8;
       --accent-hover: #7dd3fc;
       --accent-soft: rgba(56, 189, 248, 0.15);
       --border: rgba(255, 255, 255, 0.1);
       --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.3);
       --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
       --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
       --nav-bg: rgba(15, 23, 42, 0.85);
   }
   
   * {
       margin: 0;
       padding: 0;
       box-sizing: border-box;
   }
   
   html {
       scroll-behavior: smooth;
       scroll-padding-top: 100px;
   }
   
   body {
       font-family: 'Noto Sans JP', system-ui, sans-serif;
       background: var(--bg);
       color: var(--text);
       line-height: 1.8;
       transition: background-color 0.4s ease, color 0.4s ease;
       overflow-x: hidden;
   }
   
   a {
       color: var(--accent);
       text-decoration: none;
       transition: color 0.3s ease;
   }
   a:hover { color: var(--accent-hover); }
   
   /* =========================================
      Layout & Layout Containers
      ========================================= */
   .container {
       max-width: 1200px;
       margin: 0 auto;
       padding: 0 2rem;
   }
   
   .layout-2col {
       display: grid;
       grid-template-columns: 1fr 320px;
       gap: 3rem;
       align-items: start;
       padding-top: 120px;
       padding-bottom: 80px;
   }
   
   @media (max-width: 992px) {
       .layout-2col {
           grid-template-columns: 1fr;
       }
   }
   
   /* =========================================
      Header & Navigation
      ========================================= */
   .site-header {
       position: fixed;
       top: 0;
       width: 100%;
       background: var(--nav-bg);
       backdrop-filter: blur(12px);
       -webkit-backdrop-filter: blur(12px);
       border-bottom: 1px solid var(--border);
       z-index: 1000;
       transition: all 0.3s ease;
   }
   
   .site-header.scrolled {
       box-shadow: var(--shadow-sm);
       padding: 0.5rem 0;
   }
   
   .header-container {
       display: flex;
       justify-content: space-between;
       align-items: center;
       height: 70px;
   }
   
   .logo {
       font-family: 'Space Grotesk', sans-serif;
       font-size: 1.75rem;
       font-weight: 600;
       color: var(--text);
       display: flex;
       align-items: center;
       gap: 0.5rem;
   }
   
   .math-symbol { color: var(--accent); }
   
   .nav-menu {
       display: flex;
       align-items: center;
       gap: 2rem;
   }
   
   .nav-link {
       color: var(--text-light);
       font-weight: 500;
       font-size: 0.95rem;
   }
   .nav-link:hover, .nav-link.active { color: var(--accent); }
   
   .theme-toggle {
       background: none;
       border: none;
       color: var(--text-light);
       font-size: 1.2rem;
       cursor: pointer;
       padding: 0.5rem;
       transition: color 0.3s ease;
   }
   .theme-toggle:hover { color: var(--accent); }
   
   /* Mobile Menu */
   .hamburger {
       display: none;
       background: none;
       border: none;
       font-size: 1.5rem;
       color: var(--text);
       cursor: pointer;
   }
   
   @media (max-width: 768px) {
       .hamburger { display: block; }
       .nav-menu {
           position: absolute;
           top: 100%;
           left: 0;
           width: 100%;
           background: var(--surface);
           flex-direction: column;
           gap: 0;
           border-bottom: 1px solid var(--border);
           clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
           transition: clip-path 0.4s ease-in-out;
       }
       .nav-menu.open {
           clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
           box-shadow: var(--shadow);
       }
       .nav-link {
           padding: 1.2rem 2rem;
           width: 100%;
           border-bottom: 1px solid var(--border);
       }
   }
   
   /* =========================================
      Hero Section (Canvas Behind)
      ========================================= */
   #wind-canvas {
       position: fixed;
       top: 0;
       left: 0;
       width: 100%;
       height: 100%;
       pointer-events: none;
       z-index: -1;
       opacity: 0.7;
   }
   
   .hero {
       height: 100vh;
       min-height: 600px;
       display: flex;
       align-items: center;
       justify-content: center;
       position: relative;
       text-align: center;
   }
   
   .hero-bg {
       position: absolute;
       inset: 0;
       background: url('https://images.unsplash.com/photo-1507525428034-b723cf961d3e?q=80&w=2070') center/cover;
       opacity: 0.15;
       z-index: -2;
   }
   [data-theme="dark"] .hero-bg { opacity: 0.05; }
   
   .hero-title {
       font-family: 'Cinzel', serif;
       font-size: clamp(3rem, 8vw, 6rem);
       letter-spacing: 0.1em;
       color: var(--text);
       margin-bottom: 1rem;
   }
   
   .hero-subtitle {
       font-size: 1.2rem;
       color: var(--text-light);
       margin-bottom: 2.5rem;
       font-weight: 300;
   }
   
   .hero-btn {
       display: inline-block;
       padding: 1rem 2.5rem;
       border-radius: 50px;
       font-weight: 500;
       background: var(--surface);
       color: var(--text);
       border: 1px solid var(--border);
       box-shadow: var(--shadow-sm);
       transition: all 0.3s ease;
   }
   .hero-btn.primary {
       background: var(--accent);
       color: #fff;
       border-color: var(--accent);
   }
   .hero-btn:hover {
       transform: translateY(-3px);
       box-shadow: var(--shadow);
   }
   
   /* =========================================
      Cards & Grids
      ========================================= */
   .section-title {
       font-family: 'Cinzel', serif;
       font-size: 2rem;
       margin-bottom: 2rem;
       color: var(--text);
       display: flex;
       align-items: center;
       gap: 1rem;
   }
   .section-title::after {
       content: '';
       flex: 1;
       height: 1px;
       background: var(--border);
   }
   
   .articles-grid {
       display: grid;
       grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
       gap: 2rem;
   }
   
   .article-card {
       background: var(--surface);
       border-radius: 16px;
       overflow: hidden;
       box-shadow: var(--shadow-sm);
       border: 1px solid var(--border);
       transition: all 0.3s ease;
       display: flex;
       flex-direction: column;
       height: 100%;
   }
   .article-card:hover {
       transform: translateY(-8px);
       box-shadow: var(--shadow);
   }
   
   .card-img-wrapper {
       position: relative;
       padding-top: 56.25%; /* 16:9 */
       overflow: hidden;
   }
   .card-img-wrapper img {
       position: absolute;
       top: 0;
       left: 0;
       width: 100%;
       height: 100%;
       object-fit: cover;
       transition: transform 0.5s ease;
   }
   .article-card:hover .card-img-wrapper img { transform: scale(1.05); }
   
   .card-category {
       position: absolute;
       top: 1rem;
       left: 1rem;
       background: rgba(0,0,0,0.6);
       color: #fff;
       padding: 0.3rem 0.8rem;
       border-radius: 50px;
       font-size: 0.8rem;
       font-weight: 500;
       backdrop-filter: blur(4px);
   }
   
   .card-content {
       padding: 1.5rem;
       flex: 1;
       display: flex;
       flex-direction: column;
   }
   
   .card-meta {
       display: flex;
       justify-content: space-between;
       font-size: 0.85rem;
       color: var(--text-muted);
       margin-bottom: 0.8rem;
   }
   
   .card-title {
       font-size: 1.2rem;
       font-weight: 600;
       color: var(--text);
       margin-bottom: 1rem;
       line-height: 1.5;
   }
   
   .card-tags {
       display: flex;
       flex-wrap: wrap;
       gap: 0.5rem;
       margin-top: auto;
   }
   .tag-chip {
       font-size: 0.75rem;
       padding: 0.2rem 0.8rem;
       background: var(--bg-alt);
       color: var(--text-light);
       border-radius: 50px;
       border: 1px solid var(--border);
   }
   
   /* =========================================
      Sidebar Components
      ========================================= */
   .sidebar-widget {
       background: var(--surface);
       border-radius: 16px;
       padding: 1.5rem;
       margin-bottom: 2rem;
       border: 1px solid var(--border);
       box-shadow: var(--shadow-sm);
   }
   
   .widget-title {
       font-size: 1.1rem;
       font-weight: 600;
       margin-bottom: 1.5rem;
       padding-bottom: 0.5rem;
       border-bottom: 2px solid var(--accent-soft);
   }
   
   .ranking-list {
       list-style: none;
       counter-reset: rank;
   }
   .ranking-item {
       display: flex;
       align-items: flex-start;
       gap: 1rem;
       margin-bottom: 1.2rem;
       position: relative;
   }
   .ranking-item::before {
       counter-increment: rank;
       content: counter(rank);
       font-family: 'Cinzel', serif;
       font-size: 1.5rem;
       font-weight: 600;
       color: var(--accent);
       line-height: 1;
       min-width: 20px;
   }
   .ranking-title {
       font-size: 0.95rem;
       font-weight: 500;
       color: var(--text);
       line-height: 1.4;
   }
   .ranking-title:hover { color: var(--accent); }
   .ranking-meta {
       font-size: 0.8rem;
       color: var(--text-muted);
       margin-top: 0.2rem;
   }
   
   .tag-cloud {
       display: flex;
       flex-wrap: wrap;
       gap: 0.5rem;
   }
   .tag-cloud a {
       background: var(--bg-alt);
       padding: 0.4rem 1rem;
       border-radius: 50px;
       font-size: 0.85rem;
       color: var(--text-light);
       border: 1px solid var(--border);
   }
   .tag-cloud a:hover {
       background: var(--accent);
       color: #fff;
       border-color: var(--accent);
   }
   
   /* =========================================
      Article Detail Page
      ========================================= */
   .breadcrumb {
       font-size: 0.85rem;
       color: var(--text-muted);
       margin-bottom: 2rem;
       display: flex;
       flex-wrap: wrap;
       gap: 0.5rem;
   }
   .breadcrumb a { color: var(--text-light); }
   .breadcrumb a:hover { color: var(--accent); }
   
   .article-header {
       margin-bottom: 3rem;
   }
   .article-meta-row {
       display: flex;
       gap: 1.5rem;
       font-size: 0.9rem;
       color: var(--text-muted);
       margin-bottom: 1rem;
       align-items: center;
       flex-wrap: wrap;
   }
   .category-badge {
       background: var(--accent-soft);
       color: var(--accent);
       padding: 0.3rem 1rem;
       border-radius: 50px;
       font-weight: 600;
   }
   
   .article-title {
       font-size: clamp(2rem, 4vw, 2.8rem);
       line-height: 1.4;
       margin-bottom: 2rem;
       font-weight: 700;
   }
   
   .eyecatch-container img {
       width: 100%;
       border-radius: 16px;
       box-shadow: var(--shadow-sm);
   }
   
   .article-body {
       font-size: 1.1rem;
       line-height: 2;
       color: var(--text);
   }
   .article-body h2 {
       font-size: 1.8rem;
       margin: 4rem 0 1.5rem;
       padding-bottom: 0.5rem;
       border-bottom: 2px solid var(--accent-soft);
   }
   .article-body h3 {
       font-size: 1.4rem;
       margin: 2.5rem 0 1rem;
       border-left: 4px solid var(--accent);
       padding-left: 1rem;
   }
   .article-body p { margin-bottom: 1.5rem; }
   .article-body img {
       max-width: 100%;
       border-radius: 8px;
       margin: 2rem 0;
   }
   .article-body pre {
       background: var(--bg-alt);
       padding: 1.5rem;
       border-radius: 8px;
       overflow-x: auto;
       margin: 2rem 0;
       border: 1px solid var(--border);
       font-size: 0.95rem;
       position: relative;
   }
   .article-body blockquote {
       border-left: 4px solid var(--text-muted);
       padding: 1rem 1.5rem;
       background: var(--surface-hover);
       margin: 2rem 0;
       font-style: italic;
       border-radius: 0 8px 8px 0;
   }
   
   /* TOC (Table of Contents) */
   .toc-container {
       position: sticky;
       top: 100px;
   }
   .toc-list {
       list-style: none;
       padding-left: 0;
   }
   .toc-list li { margin-bottom: 0.5rem; }
   .toc-list a {
       color: var(--text-light);
       font-size: 0.9rem;
       display: block;
       padding: 0.3rem 0;
       border-left: 2px solid transparent;
       padding-left: 1rem;
       transition: all 0.2s ease;
   }
   .toc-list a:hover, .toc-list a.active {
       color: var(--accent);
       border-left-color: var(--accent);
       background: var(--accent-soft);
   }
   .toc-h3 { padding-left: 2rem !important; font-size: 0.85rem !important; }
   
   /* Share Buttons */
   .share-buttons {
       display: flex;
       gap: 1rem;
       margin: 3rem 0;
       padding: 2rem 0;
       border-top: 1px solid var(--border);
       border-bottom: 1px solid var(--border);
   }
   .share-btn {
       width: 40px;
       height: 40px;
       border-radius: 50%;
       display: flex;
       align-items: center;
       justify-content: center;
       background: var(--surface-hover);
       color: var(--text);
       border: 1px solid var(--border);
       cursor: pointer;
       transition: all 0.3s;
   }
   .share-btn:hover {
       background: var(--accent);
       color: #fff;
       border-color: var(--accent);
   }
   
   /* Progress Bar */
   .reading-progress-container {
       position: fixed;
       top: 70px;
       left: 0;
       width: 100%;
       height: 3px;
       background: transparent;
       z-index: 999;
   }
   .reading-progress-bar {
       height: 100%;
       background: var(--accent);
       width: 0%;
       transition: width 0.1s;
   }
   
   /* =========================================
      Archive Controls (Tabs, Search)
      ========================================= */
   .archive-header {
       text-align: center;
       margin-bottom: 4rem;
   }
   
   .category-tabs {
       display: flex;
       flex-wrap: wrap;
       justify-content: center;
       gap: 1rem;
       margin-bottom: 2rem;
   }
   .tab-btn {
       background: var(--surface);
       border: 1px solid var(--border);
       padding: 0.6rem 1.5rem;
       border-radius: 50px;
       color: var(--text-light);
       cursor: pointer;
       font-weight: 500;
       transition: all 0.3s;
   }
   .tab-btn:hover, .tab-btn.active {
       background: var(--accent);
       color: #fff;
       border-color: var(--accent);
       box-shadow: var(--shadow-sm);
   }
   
   .controls-bar {
       display: flex;
       justify-content: space-between;
       align-items: center;
       background: var(--surface);
       padding: 1rem 1.5rem;
       border-radius: 12px;
       border: 1px solid var(--border);
       margin-bottom: 2rem;
       flex-wrap: wrap;
       gap: 1rem;
   }
   .search-box {
       display: flex;
       align-items: center;
       gap: 0.5rem;
       background: var(--bg-alt);
       padding: 0.5rem 1rem;
       border-radius: 8px;
       flex: 1;
       max-width: 400px;
   }
   .search-box input {
       border: none;
       background: transparent;
       outline: none;
       color: var(--text);
       width: 100%;
   }
   
   /* Pagination */
   .pagination {
       display: flex;
       justify-content: center;
       gap: 0.5rem;
       margin-top: 4rem;
   }
   .page-btn {
       width: 40px;
       height: 40px;
       display: flex;
       align-items: center;
       justify-content: center;
       background: var(--surface);
       border: 1px solid var(--border);
       border-radius: 8px;
       color: var(--text);
       cursor: pointer;
       transition: all 0.2s;
   }
   .page-btn:hover, .page-btn.active {
       background: var(--accent);
       color: #fff;
       border-color: var(--accent);
   }
   
   /* =========================================
      Utils & Footer
      ========================================= */
   .fade-in {
       opacity: 0;
       transform: translateY(20px);
       transition: opacity 0.8s ease, transform 0.8s ease;
   }
   .fade-in.visible {
       opacity: 1;
       transform: translateY(0);
   }
   
   #back-to-top {
       position: fixed;
       bottom: 30px;
       right: 30px;
       width: 50px;
       height: 50px;
       border-radius: 50%;
       background: var(--accent);
       color: #fff;
       border: none;
       cursor: pointer;
       box-shadow: var(--shadow);
       opacity: 0;
       visibility: hidden;
       transition: all 0.3s;
       z-index: 99;
       display: flex;
       align-items: center;
       justify-content: center;
       font-size: 1.2rem;
   }
   #back-to-top.visible {
       opacity: 1;
       visibility: visible;
   }
   
   .site-footer {
       background: var(--bg-alt);
       padding: 4rem 0 2rem;
       border-top: 1px solid var(--border);
       margin-top: 5rem;
   }
   .footer-grid {
       display: grid;
       grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
       gap: 3rem;
       margin-bottom: 3rem;
   }
   .footer-col h4 {
       font-size: 1.1rem;
       margin-bottom: 1.5rem;
       color: var(--text);
   }
   .footer-links {
       list-style: none;
   }
   .footer-links li { margin-bottom: 0.8rem; }
   .footer-links a { color: var(--text-light); }
   .footer-links a:hover { color: var(--accent); }
   
   .footer-bottom {
       text-align: center;
       padding-top: 2rem;
       border-top: 1px solid var(--border);
       color: var(--text-muted);
       font-size: 0.9rem;
   }
   
   /* Toast */
   #toast {
       position: fixed;
       bottom: 20px;
       left: 50%;
       transform: translateX(-50%) translateY(100px);
       background: var(--text);
       color: var(--bg);
       padding: 1rem 2rem;
       border-radius: 50px;
       font-size: 0.9rem;
       opacity: 0;
       transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
       z-index: 10000;
   }
   #toast.show {
       transform: translateX(-50%) translateY(0);
       opacity: 1;
   }