/*
Theme Name: AI百万チャレンジ
Theme URI: https://example.com
Author: Botamochi Games / Yoshigi
Description: AIと1万円を100万円にする挑戦ブログ専用テーマ。広告収益・進捗トラッカー対応。
Version: 1.0.0
License: GNU General Public License v2 or later
Tags: blog, money, challenge, dark, gold, ads-ready
Text Domain: ai-hyakuman
*/

/* ===========================
   CSS VARIABLES
=========================== */
:root {
  --bg-primary:    #08090c;
  --bg-secondary:  #0f1117;
  --bg-card:       #13161f;
  --bg-card-hover: #191d29;
  --gold-bright:   #f0c040;
  --gold-mid:      #c9952a;
  --gold-deep:     #7a5a18;
  --gold-glow:     rgba(240, 192, 64, 0.18);
  --text-primary:  #e8e8e0;
  --text-secondary:#9a9a90;
  --text-muted:    #555560;
  --accent-red:    #e05555;
  --accent-green:  #4ecb7a;
  --border:        #1e2230;
  --border-gold:   rgba(240, 192, 64, 0.35);
  --font-display:  'Josefin Sans', 'Noto Sans JP', sans-serif;
  --font-body:     'Noto Sans JP', 'Source Han Sans JP', sans-serif;
  --font-mono:     'JetBrains Mono', 'Courier New', monospace;
  --radius:        6px;
  --shadow-gold:   0 0 24px rgba(240, 192, 64, 0.12);
  --transition:    0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   RESET & BASE
=========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-bright); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

p { margin-bottom: 1.4em; }

ul, ol { padding-left: 1.5em; margin-bottom: 1.2em; }
li { margin-bottom: 0.4em; }

blockquote {
  border-left: 3px solid var(--gold-mid);
  padding: 1em 1.5em;
  margin: 1.5em 0;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-style: italic;
  border-radius: 0 var(--radius) var(--radius) 0;
}

code {
  font-family: var(--font-mono);
  background: var(--bg-card);
  color: var(--gold-bright);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.88em;
}

pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2em;
  overflow-x: auto;
  margin-bottom: 1.5em;
}

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

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

table { width: 100%; border-collapse: collapse; margin-bottom: 1.5em; }
th, td { padding: 0.7em 1em; border: 1px solid var(--border); text-align: left; }
th { background: var(--bg-card); color: var(--gold-bright); font-weight: 600; }
tr:nth-child(even) { background: rgba(255,255,255,0.02); }

/* ===========================
   LAYOUT
=========================== */
.site-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

.content-area {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  padding: 40px 0 60px;
}

.main-content { min-width: 0; }

@media (max-width: 900px) {
  .content-area { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ===========================
   SITE HEADER
=========================== */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-mid));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: #08090c;
  font-family: var(--font-display);
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.site-title span {
  display: block;
  font-size: 0.62rem;
  color: var(--gold-bright);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Mini progress bar in header */
.header-progress {
  flex: 1;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-progress-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.header-progress-label .current {
  color: var(--gold-bright);
  font-weight: 700;
}

.progress-bar-track {
  height: 4px;
  background: var(--bg-card);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-mid), var(--gold-bright));
  border-radius: 2px;
  transition: width 1s ease;
  box-shadow: 0 0 8px var(--gold-bright);
}

/* Navigation */
.site-nav { display: flex; align-items: center; gap: 4px; }

.site-nav a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: all var(--transition);
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.site-nav .nav-cta {
  background: linear-gradient(135deg, var(--gold-mid), var(--gold-bright));
  color: #08090c;
  font-weight: 700;
  padding: 6px 14px;
}

.site-nav .nav-cta:hover {
  background: var(--gold-bright);
  color: #08090c;
}

/* ===========================
   HERO / BANNER
=========================== */
.hero-banner {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 48px 0 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(240,192,64,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-bright);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 30%, var(--gold-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 520px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

/* Challenge progress tracker */
.challenge-tracker {
  display: inline-flex;
  align-items: center;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 20px 32px;
  box-shadow: var(--shadow-gold);
}

.tracker-item { text-align: center; }

.tracker-amount {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-bright);
  display: block;
}

.tracker-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.tracker-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.tracker-arrow {
  color: var(--gold-mid);
  font-size: 1.2rem;
}

.tracker-progress-pct {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-green);
}

/* ===========================
   AD ZONES
=========================== */
.ad-zone {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  overflow: hidden;
}

.ad-zone-header {
  width: 100%;
  height: 90px;
  margin-bottom: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}

.ad-zone-content {
  width: 100%;
  height: 250px;
  margin: 24px 0;
}

.ad-zone-sidebar {
  width: 300px;
  height: 250px;
  margin-bottom: 24px;
}

.ad-zone-sidebar-tall {
  width: 300px;
  height: 600px;
  margin-bottom: 24px;
}

/* ===========================
   POST CARDS
=========================== */
.posts-grid { display: flex; flex-direction: column; gap: 24px; }

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: all var(--transition);
  display: grid;
  grid-template-columns: 1fr;
}

.post-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-gold);
  transform: translateY(-2px);
}

.post-card-thumbnail {
  aspect-ratio: 16/7;
  background: var(--bg-secondary);
  overflow: hidden;
}

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

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

.post-card-body { padding: 24px; }

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.post-category {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #08090c;
  background: linear-gradient(135deg, var(--gold-mid), var(--gold-bright));
  padding: 3px 8px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.post-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.post-card-title {
  font-size: 1.15rem;
  margin-bottom: 10px;
  line-height: 1.4;
}

.post-card-title a { color: var(--text-primary); }
.post-card-title a:hover { color: var(--gold-bright); }

.post-card-excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.read-more {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.04em;
}

.read-more::after { content: '→'; transition: transform var(--transition); }
.post-card:hover .read-more::after { transform: translateX(4px); }

.post-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 3px;
}

/* ===========================
   SINGLE POST
=========================== */
.single-post-header {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.single-post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.single-post-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  line-height: 1.3;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 50%, var(--gold-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-author-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-mid), var(--gold-bright));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #08090c;
  font-weight: 700;
  flex-shrink: 0;
}

/* Post content */
.post-content {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.post-content h2 {
  font-size: 1.4rem;
  margin: 2em 0 0.8em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.post-content h2::before {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 3em;
  height: 2px;
  background: var(--gold-bright);
}

.post-content h3 {
  font-size: 1.15rem;
  margin: 1.5em 0 0.6em;
  color: var(--gold-bright);
}

.post-content img {
  border-radius: var(--radius);
  margin: 1.5em auto;
  border: 1px solid var(--border);
}

/* Result box - for reporting gains/losses */
.result-box {
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 2em 0;
  background: var(--bg-card);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

.result-box.loss { border-color: rgba(224,85,85,0.4); }
.result-box.gain { border-color: rgba(78,203,122,0.4); }

.result-item { text-align: center; }
.result-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
}
.result-value.positive { color: var(--accent-green); }
.result-value.negative { color: var(--accent-red); }
.result-value.neutral  { color: var(--gold-bright); }
.result-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

/* ===========================
   SIDEBAR
=========================== */
.sidebar { display: flex; flex-direction: column; gap: 0; }

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 24px;
}

.widget-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--gold-bright);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* Progress widget */
.progress-widget-amount {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-bright);
  display: block;
  margin-bottom: 4px;
}

.progress-widget-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.progress-track {
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-mid), var(--gold-bright));
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(240,192,64,0.5);
  transition: width 1s ease;
}

.progress-pct-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.progress-pct-label strong { color: var(--gold-bright); }

/* Recent posts widget */
.widget-posts { display: flex; flex-direction: column; gap: 14px; }

.widget-post {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
}

.widget-post-thumb {
  width: 64px;
  height: 44px;
  border-radius: 4px;
  background: var(--bg-secondary);
  overflow: hidden;
  flex-shrink: 0;
}

.widget-post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.widget-post-title {
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary);
  transition: color var(--transition);
}

.widget-post-title:hover { color: var(--gold-bright); }

/* ===========================
   PAGINATION
=========================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.pagination a:hover {
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}

.pagination .current {
  background: var(--gold-bright);
  border-color: var(--gold-bright);
  color: #08090c;
  font-weight: 700;
}

/* ===========================
   SITE FOOTER
=========================== */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-top {
  padding: 48px 0 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand .site-title { font-size: 1.1rem; margin-bottom: 12px; }
.footer-brand p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.7; }

.footer-links h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--gold-bright);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.footer-links ul { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 0.85rem; color: var(--text-muted); }
.footer-links a:hover { color: var(--gold-bright); }

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-disclaimer {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.7;
}

@media (max-width: 768px) {
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .header-progress { display: none; }
  .challenge-tracker { flex-direction: column; gap: 12px; }
  .tracker-divider { width: 40px; height: 1px; }
}

/* ===========================
   UTILITY
=========================== */
.text-gold { color: var(--gold-bright); }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-mono { font-family: var(--font-mono); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ===========================
   COMMENTS
=========================== */
.comments-section {
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.comments-title {
  font-size: 1.1rem;
  margin-bottom: 28px;
}

.comment {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.comment-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.comment-author {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.comment-text { font-size: 0.9rem; color: var(--text-secondary); }

/* Comment form */
.comment-form { margin-top: 32px; }
.comment-form h3 { font-size: 1rem; margin-bottom: 20px; }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; }

.form-field input,
.form-field textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color var(--transition);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--gold-mid);
}

.form-field textarea { min-height: 120px; resize: vertical; }

.btn-submit {
  background: linear-gradient(135deg, var(--gold-mid), var(--gold-bright));
  color: #08090c;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: opacity var(--transition);
}

.btn-submit:hover { opacity: 0.88; }
