/*
Theme Name: WiredSky
Theme URI: https://wired-sky.net
Description: Stylish dark theme for affiliate sites
Version: 1.0.0
Author: Wired Sky Studio
Text Domain: wiredsky
*/

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #161616;
  --bg-hover: #1e1e1e;
  --border: #2a2a2a;
  --border-light: #333333;
  --accent: #e8ff00;
  --accent-dim: rgba(232, 255, 0, 0.1);
  --accent-hover: #f5ff4d;
  --text-primary: #f0f0f0;
  --text-secondary: #999999;
  --text-muted: #555555;
  --header-height: 64px;
  --sidebar-width: 300px;
  --content-max: 1200px;
  --radius: 4px;
  --radius-lg: 8px;
  --font-sans: 'DM Sans', 'Noto Sans JP', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Noto+Sans+JP:wght@300;400;500;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Header ── */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

#site-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

#site-title a {
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

#site-title a::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

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

/* ── Navigation ── */
#site-nav {
  display: flex;
  align-items: center;
}

#site-nav ul {
  display: flex;
  list-style: none;
  gap: 4px;
}

#site-nav ul li a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all 0.2s;
  letter-spacing: 0.03em;
}

#site-nav ul li a:hover,
#site-nav ul li.current-menu-item a {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ── Hamburger ── */
#nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius);
  flex-direction: column;
  gap: 5px;
}

#nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: currentColor;
  transition: all 0.25s;
}

/* ── Layout ── */
#wrapper {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 40px;
  align-items: start;
}

/* ── Breadcrumb ── */
#breadcrumb {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 16px 24px 0;
}

#breadcrumb ol {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

#breadcrumb ol li + li::before {
  content: '/';
  margin-right: 4px;
  color: var(--text-muted);
}

#breadcrumb ol li a {
  color: var(--text-muted);
  transition: color 0.2s;
}

#breadcrumb ol li a:hover {
  color: var(--accent);
}

#breadcrumb ol li:last-child {
  color: var(--text-secondary);
}

/* ── Main Content ── */
#main {
  min-width: 0;
}

/* ── Archive / Post List ── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-card {
  background: var(--bg-card);
  transition: background 0.2s;
}

.post-card:hover {
  background: var(--bg-hover);
}

.post-card a {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  padding: 20px;
  color: inherit;
}

.post-card-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-secondary);
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .post-card-thumb img {
  transform: scale(1.04);
}

.post-card-thumb .no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.post-card-cat {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.post-card-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-excerpt {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}

/* ── Single Post ── */
.single-header {
  margin-bottom: 32px;
}

.single-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.single-cat {
  background: var(--accent-dim);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.single-title {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-bottom: 24px;
}

.single-thumbnail {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  aspect-ratio: 16/9;
}

.single-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Article Content ── */
.entry-content {
  font-size: 0.975rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.entry-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.5em 0 1em;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  letter-spacing: -0.01em;
}

.entry-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2em 0 0.75em;
  color: var(--text-primary);
}

.entry-content p {
  margin-bottom: 1.5em;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.5em;
}

.entry-content li {
  margin-bottom: 0.4em;
}

.entry-content a {
  color: var(--accent);
  border-bottom: 1px solid rgba(232, 255, 0, 0.3);
}

.entry-content a:hover {
  border-bottom-color: var(--accent);
}

.entry-content blockquote {
  border-left: 3px solid var(--border-light);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-secondary);
}

.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--accent);
}

.entry-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.entry-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
}

.entry-content img {
  border-radius: var(--radius-lg);
  margin: 1.5em 0;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

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

.entry-content th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── アフィリエイト商品ブロック ── */
.rakuten-affiliate-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 2em 0;
}

.rakuten-affiliate-block h4 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.rakuten-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.rakuten-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.rakuten-item a {
  display: contents;
  color: inherit;
}

.rakuten-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: var(--radius);
  background: var(--bg-card);
}

.rakuten-item-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.rakuten-item-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rakuten-item-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--font-mono);
}

.rakuten-item-shop {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Sidebar ── */
#sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.widget-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.widget ul {
  list-style: none;
  padding: 8px 0;
}

.widget ul li {
  border-bottom: 1px solid var(--border);
}

.widget ul li:last-child {
  border-bottom: none;
}

.widget ul li a {
  display: block;
  padding: 10px 18px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.widget ul li a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  padding-left: 24px;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.pagination .page-numbers:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

/* ── Footer ── */
#site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

#site-footer a {
  color: var(--text-muted);
}

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

/* ── Responsive ── */
@media (max-width: 960px) {
  #wrapper {
    grid-template-columns: 1fr;
  }

  #sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  #nav-toggle {
    display: flex;
  }

  #site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    transform: translateY(-110%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 99;
  }

  #site-nav.open {
    transform: translateY(0);
  }

  #site-nav ul {
    flex-direction: column;
    gap: 2px;
  }

  #site-nav ul li a {
    padding: 10px 14px;
    display: block;
  }

  .post-card a {
    grid-template-columns: 120px 1fr;
    gap: 14px;
    padding: 14px;
  }

  .single-title {
    font-size: 1.4rem;
  }
}

@media (max-width: 480px) {
  #wrapper {
    padding: 24px 16px;
  }

  .post-card a {
    grid-template-columns: 1fr;
  }

  .post-card-thumb {
    aspect-ratio: 16/7;
  }
}
