/*
Theme Name: Gadget Deals Ultra Fast
Theme URI: https://example.com
Description: 超高速ガジェット特価情報テーマ - Core Web Vitals最適化済み
Version: 1.0
Author: Your Name
Text Domain: gadget-deals
*/

/* ===== CSS Variables ===== */
:root {
  --primary: #e8380d;
  --primary-dark: #c02d09;
  --accent: #ff6b35;
  --bg: #0d0d0d;
  --bg-card: #1a1a1a;
  --bg-card-hover: #222222;
  --text: #f0f0f0;
  --text-muted: #888;
  --border: #2a2a2a;
  --sale-badge: #e8380d;
  --new-badge: #0d6ef8;
  --hot-badge: #f5a623;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.4);
  --font: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: #fff; }

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ===== Header ===== */
#site-header {
  background: #111;
  border-bottom: 2px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 12px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-logo {
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.site-logo span { color: var(--primary); }
.header-tagline {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: none;
}
.header-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.header-nav a {
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: 4px;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.header-nav a:hover { background: var(--bg-card); color: #fff; }

/* ===== Hero / Ticker ===== */
.ticker-bar {
  background: var(--primary);
  padding: 6px 0;
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 700;
}
.ticker-inner {
  display: flex;
  gap: 40px;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
}
.ticker-inner span::before { content: '🔥 '; }
@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ===== Section Headers ===== */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}
.section-title .icon { font-size: 1.2em; }
.section-badge {
  font-size: 0.7rem;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
}

/* ===== Deal Card ===== */
.deal-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
}
.deal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.deal-card-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  padding: 12px;
}
.deal-card-body { padding: 12px; }
.deal-card-badges {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-sale { background: var(--sale-badge); color: #fff; }
.badge-new { background: var(--new-badge); color: #fff; }
.badge-hot { background: var(--hot-badge); color: #000; }
.badge-limited { background: #6b21a8; color: #fff; }

.deal-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.deal-card-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.price-current {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--primary);
}
.price-original {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: line-through;
}
.price-discount {
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}
.deal-card-cta {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  text-align: center;
  border-radius: 5px;
  transition: background 0.15s;
  border: none;
  cursor: pointer;
}
.deal-card-cta:hover { background: var(--primary-dark); color: #fff; }
.deal-card-cta::after { content: ' →'; }

/* ===== Single Post / Article ===== */
.post-header { margin: 28px 0 20px; }
.post-cats { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.post-cat {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.post-title {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.3;
  color: #fff;
  margin-bottom: 12px;
}
.post-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* ===== Affiliate Product Box ===== */
.product-box {
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
  background: var(--bg-card);
}
.product-box-inner {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}
.product-box-img {
  width: 140px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 6px;
  padding: 10px;
  object-fit: contain;
}
.product-box-info { flex: 1; }
.product-box-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.4;
}
.product-box-price-area { margin: 12px 0; }
.product-box-price {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary);
}
.product-box-original {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 8px;
}
.product-box-discount {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
}
.product-box-note {
  font-size: 0.75rem;
  color: var(--hot-badge);
  font-weight: 700;
  margin-bottom: 12px;
}
.product-box-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 6px;
  transition: background 0.15s, transform 0.1s;
}
.product-box-cta:hover {
  background: var(--primary-dark);
  transform: scale(1.02);
  color: #fff;
}

/* ===== Article Body ===== */
.entry-content {
  font-size: 0.95rem;
  line-height: 1.85;
  color: #ddd;
}
.entry-content h2 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  margin: 28px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
}
.entry-content h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #eee;
  margin: 20px 0 8px;
}
.entry-content p { margin-bottom: 16px; }
.entry-content ul, .entry-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
}
.entry-content li { margin-bottom: 6px; }
.entry-content strong { color: #fff; font-weight: 700; }
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.85rem;
}
.entry-content th {
  background: var(--bg-card);
  padding: 10px 12px;
  text-align: left;
  border: 1px solid var(--border);
  font-weight: 700;
  color: #fff;
}
.entry-content td {
  padding: 10px 12px;
  border: 1px solid var(--border);
}

/* ===== Sidebar ===== */
.layout-main {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
.sidebar { position: sticky; top: 70px; }
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.widget-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.15s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== Footer ===== */
#site-footer {
  background: #111;
  border-top: 1px solid var(--border);
  padding: 32px 0 16px;
  margin-top: 48px;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}
.footer-widget-title {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 6px; }
.footer-links a { font-size: 0.8rem; color: var(--text-muted); }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-copy { font-size: 0.75rem; color: var(--text-muted); }
.footer-disclaimer {
  font-size: 0.7rem;
  color: #555;
  max-width: 600px;
  line-height: 1.5;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .layout-main { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-inner { grid-template-columns: 1fr; gap: 16px; }
  .product-box-inner { flex-direction: column; }
  .product-box-img { width: 100%; max-width: 200px; margin: 0 auto; }
  .post-title { font-size: 1.2rem; }
  .header-nav { display: none; }
  .header-tagline { display: block; }
}
@media (max-width: 480px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .price-current { font-size: 1.1rem; }
}


/* ハンバーガーメニュー */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
}

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

  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 12px 0;
    border-top: 1px solid var(--border);
    z-index: 100;
  }

  .header-nav.open {
    display: flex;
    flex-direction: column;
  }

  .header-nav a {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
  }

  #site-header {
    position: relative;
  }
}

/* 固定ページのコンテンツ */
.page-content p {
  margin-bottom: 1.5em;
  line-height: 1.8;
}

.page-content h2,
.page-content h3 {
  margin-top: 2em;
  margin-bottom: 0.5em;
}


/* ナビゲーション階層メニュー */
.nav-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.nav-menu li { position: relative; }
.nav-menu li a { display: block; padding: 5px 10px; color: var(--text-muted); text-decoration: none; white-space: nowrap; font-size: 0.8rem; border-radius: 4px; transition: background 0.15s, color 0.15s; }
.nav-menu li a:hover { background: var(--bg-card); color: #fff; }
.nav-menu li ul { display: none; position: absolute; top: 100%; left: 0; background: #111; border: 1px solid var(--border); min-width: 200px; z-index: 999; border-radius: 4px; }
.nav-menu li:hover ul { display: block; }
.nav-menu li ul li a { padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 0.8rem; }

@media (max-width: 768px) {
  .nav-menu { flex-direction: column; }
  .nav-menu li ul { position: static; border: none; }
  .nav-menu li ul li a { padding-left: 32px; }
}