/*
Theme Name: Mystery Blog
Theme URI: https://yoursite.com
Author: Your Name
Author URI: https://yoursite.com
Description: マーダーミステリーツール連動のモダンなブログテーマ。ダークモード対応、グラスモーフィズムデザイン、完全レスポンシブ対応。
Version: 1.2
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mystery-blog
Tags: blog, dark-mode, responsive, modern, custom-colors
*/

:root {
  --bg-primary: #0a0a15;
  --bg-secondary: #2d2d44;
  --bg-tertiary: #3d3d5c;
  --accent: #9d4edd;
  --accent-hover: #7b2cbf;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-muted: #888888;
  --border: #4d4d6c;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
}

[data-theme="light"] {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e5e5e5;
  --text-primary: #1a1a2e;
  --text-secondary: #333333;
  --text-muted: #666666;
  --border: #dddddd;
}

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

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.admin-bar {
  margin-top: 32px !important;
}

@media screen and (max-width: 782px) {
  body.admin-bar {
    margin-top: 46px !important;
  }
}

/* 背景パターン */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(135deg, rgba(157, 78, 221, 0.05) 25%, transparent 25%),
    linear-gradient(225deg, rgba(157, 78, 221, 0.05) 25%, transparent 25%),
    linear-gradient(45deg, rgba(157, 78, 221, 0.05) 25%, transparent 25%),
    linear-gradient(315deg, rgba(157, 78, 221, 0.05) 25%, transparent 25%);
  background-size: 80px 80px;
  background-position: 0 0, 40px 0, 40px 40px, 0 40px;
  opacity: 0.3;
  z-index: -1;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(157, 78, 221, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(102, 126, 234, 0.15) 0%, transparent 50%);
  z-index: -1;
  pointer-events: none;
}

/* コンテナのデフォルト設定 */
.container {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  width: 100%;
}

main {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
}

/* Header - 完全修正版 */
.site-header {
  background: rgba(45, 45, 68, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(157, 78, 221, 0.2);
  width: 100%;
  margin: 0;
  padding: 0;
}

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

.site-header > .container {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  width: 100%;
}

.header-content {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 20px 0;
  gap: 40px;
  max-width: 100%;
}

.site-logo a {
  font-size: 24px;
  font-weight: bold;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  text-shadow: 0 0 20px rgba(157, 78, 221, 0.5);
  white-space: nowrap;
}

.site-logo a:hover {
  transform: scale(1.05);
  text-shadow: 0 0 30px rgba(157, 78, 221, 0.8);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

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

.main-nav a:hover::after {
  width: 100%;
}

.theme-toggle {
  background: var(--bg-tertiary);
  border: none;
  color: var(--text-primary);
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  margin-left: auto;
}

.theme-toggle:hover {
  background: var(--accent);
  transform: rotate(15deg) scale(1.1);
  box-shadow: 0 0 20px rgba(157, 78, 221, 0.5);
}

.mobile-menu-toggle {
  display: none;
  background: var(--accent);
  border: none;
  color: white;
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(157, 78, 221, 0.3);
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, rgba(157, 78, 221, 0.2), rgba(123, 44, 191, 0.2));
  padding: 100px 0;
  text-align: center;
  border-bottom: 2px solid var(--accent);
  position: relative;
  overflow: hidden;
  min-height: 500px;
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(157, 78, 221, 0.15) 0%, transparent 70%);
  animation: pulse 20s ease-in-out infinite;
}

.hero-section::after {
  content: '🎭';
  position: absolute;
  font-size: 300px;
  opacity: 0.03;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  pointer-events: none;
}

@keyframes pulse {
  0%, 100% { 
    transform: scale(1) rotate(0deg); 
    opacity: 0.5; 
  }
  50% { 
    transform: scale(1.2) rotate(10deg); 
    opacity: 0.8; 
  }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
}

.hero-section h1 {
  font-size: 56px;
  margin-bottom: 25px;
  background: linear-gradient(135deg, #9d4edd, #c77dff, #e0aaff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 0 40px rgba(157, 78, 221, 0.3);
  animation: fadeInUp 0.8s ease-out;
  letter-spacing: -1px;
}

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

.hero-section p {
  font-size: 22px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.6;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.cta-button {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  padding: 18px 50px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  font-size: 18px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px rgba(157, 78, 221, 0.4);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.cta-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s;
}

.cta-button:hover::before {
  left: 100%;
}

.cta-button:hover {
  background: linear-gradient(135deg, var(--accent-hover), #5a189a);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 35px rgba(157, 78, 221, 0.6);
}

.cta-button:active {
  transform: translateY(-1px) scale(1.02);
}

/* Blog Section */
.blog-section {
  padding: 80px 0;
  position: relative;
  width: 100%;
}

.section-title {
  font-size: 42px;
  margin-bottom: 50px;
  color: var(--accent);
  text-align: center;
  font-weight: 800;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 2px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 35px;
  margin-bottom: 60px;
}

.blog-card {
  background: rgba(45, 45, 68, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  position: relative;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.blog-card:hover::before {
  transform: scaleX(1);
}

.blog-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(157, 78, 221, 0.4);
  border-color: var(--accent);
}

.blog-card-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.blog-card:hover .blog-card-image {
  transform: scale(1.1);
}

.blog-card-content {
  padding: 30px;
}

.blog-card-meta {
  display: flex;
  gap: 15px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-muted);
  flex-wrap: wrap;
  align-items: center;
}

.blog-card-category {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(157, 78, 221, 0.3);
}

.blog-card-title {
  font-size: 24px;
  margin-bottom: 15px;
  line-height: 1.4;
  font-weight: 700;
}

.blog-card-title a {
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
  background: linear-gradient(to right, var(--accent), var(--accent));
  background-size: 0 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
}

.blog-card-title a:hover {
  color: var(--accent);
  background-size: 100% 2px;
}

.blog-card-excerpt {
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.7;
  font-size: 15px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  font-size: 15px;
}

.read-more:hover {
  gap: 14px;
  text-shadow: 0 0 10px rgba(157, 78, 221, 0.5);
}

/* Single Post - 完全修正版 */
.single-post {
  max-width: 1100px;
  margin: 80px auto;
  background: rgba(45, 45, 68, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 60px 80px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(157, 78, 221, 0.3);
}

.post-header {
  margin-bottom: 40px;
  text-align: center;
}

.post-title {
  font-size: 52px;
  margin-bottom: 25px;
  line-height: 1.3;
  font-weight: 800;
  background: linear-gradient(135deg, #9d4edd, #c77dff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-meta {
  display: flex;
  justify-content: center;
  gap: 25px;
  color: var(--text-muted);
  flex-wrap: wrap;
  font-size: 15px;
  margin-bottom: 25px;
}

.post-featured-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.post-content {
  font-size: 18px;
  line-height: 1.9;
}

.post-content h2 {
  font-size: 36px;
  margin-top: 50px;
  margin-bottom: 25px;
  color: var(--accent);
  font-weight: 700;
}

.post-content h3 {
  font-size: 28px;
  margin-top: 40px;
  margin-bottom: 20px;
  font-weight: 600;
}

.post-content p {
  margin-bottom: 25px;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 40px 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.post-content blockquote {
  border-left: 5px solid var(--accent);
  padding-left: 25px;
  margin: 35px 0;
  font-style: italic;
  color: var(--text-secondary);
  background: rgba(157, 78, 221, 0.1);
  padding: 20px 25px;
  border-radius: 8px;
}

.post-content ul, .post-content ol {
  margin: 25px 0 25px 35px;
}

.post-content li {
  margin-bottom: 12px;
}

.post-content code {
  background: var(--bg-tertiary);
  padding: 3px 8px;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

.post-content pre {
  background: var(--bg-tertiary);
  padding: 25px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 30px 0;
  border: 1px solid var(--border);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.post-content pre code {
  background: none;
  padding: 0;
  border: none;
}

.post-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  transition: all 0.3s ease;
}

.post-content a:hover {
  opacity: 0.8;
  border-bottom-color: transparent;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 35px 0;
}

.post-content th,
.post-content td {
  padding: 15px;
  border: 1px solid var(--border);
  text-align: left;
}

.post-content th {
  background: var(--bg-tertiary);
  font-weight: bold;
  color: var(--accent);
}

/* Footer - 完全修正版 */
.site-footer {
  background: rgba(45, 45, 68, 0.95);
  backdrop-filter: blur(10px);
  border-top: 2px solid var(--accent);
  padding: 50px 0 30px;
  margin-top: 100px;
  text-align: center;
  box-shadow: 0 -4px 20px rgba(157, 78, 221, 0.2);
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

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

.site-footer > .container {
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 20px !important;
  width: 100%;
}

.footer-content {
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 25px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.footer-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

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

.footer-links a:hover::after {
  width: 100%;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  list-style: none;
  margin-top: 50px;
}

.pagination .page-numbers {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 12px 18px;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  font-weight: 600;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(157, 78, 221, 0.4);
}

/* Status Messages */
.status {
  background: rgba(45, 45, 68, 0.95);
  backdrop-filter: blur(10px);
  padding: 50px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: var(--bg-tertiary);
}

.btn-secondary:hover {
  background: var(--accent);
  box-shadow: 0 4px 15px rgba(157, 78, 221, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(45, 45, 68, 0.98);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--accent);
    padding: 25px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  }
  
  .main-nav.active {
    display: block;
  }
  
  .main-nav ul {
    flex-direction: column;
    gap: 20px;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .hero-section {
    padding: 70px 0;
    min-height: 400px;
  }
  
  .hero-section h1 {
    font-size: 36px;
  }
  
  .hero-section p {
    font-size: 18px;
  }
  
  .cta-button {
    padding: 15px 40px;
    font-size: 16px;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  
  .single-post {
    padding: 40px 30px;
    margin: 40px 20px;
  }
  
  .post-title {
    font-size: 36px;
  }
  
  .post-content {
    font-size: 17px;
  }
  
  .section-title {
    font-size: 32px;
  }
  
  .blog-card-content {
    padding: 25px;
  }
}

@media (max-width: 480px) {
  .header-content {
    padding: 15px 0;
  }
  
  .site-logo a {
    font-size: 20px;
  }
  
  .hero-section {
    padding: 50px 0;
  }
  
  .hero-section h1 {
    font-size: 28px;
  }
  
  .hero-section p {
    font-size: 16px;
  }
  
  .cta-button {
    padding: 12px 30px;
    font-size: 15px;
  }
  
  .blog-card-content {
    padding: 20px;
  }
  
  .blog-card-title {
    font-size: 20px;
  }
  
  .single-post {
    padding: 30px 20px;
  }
  
  .post-title {
    font-size: 28px;
  }
  
  .post-content {
    font-size: 16px;
  }
  
  .section-title {
    font-size: 28px;
  }
}