/*
Theme Name:   Hogwarts Deck Theme
Theme URI:    https://example.com/hp-deck-theme
Author:       (you)
Description:  Harry Potter デッキビルダー用カスタムテーマ。HP Deck Builder プラグインと連携してデッキ一覧を含むトップページを表示します。ダーク＆ゴールドのハリポタ風デザイン。
Version:      0.1.0
Requires at least: 6.0
Requires PHP: 7.4
License:      GPL-2.0-or-later
Text Domain:  hp-deck-theme
*/

/* ===== ベース変数 ===== */
:root{
  --bg: #0d1224;
  --bg-2: #131a3a;
  --panel: #ffffff;
  --panel-soft: #f4f5f9;
  --line: #e1e4ed;
  --line-strong: #c8cdd9;
  --text: #1a1d2e;
  --text-2: #3d4358;
  --text-light: #f5f1e3;
  --muted: #6b7280;
  --muted-light: #a8a8b8;
  --accent: #c5a063;        /* ハリポタゴールド */
  --accent-deep: #7a1f1c;   /* ダーク赤 */
  --accent-hover: #d6b577;
  --gryffindor: #ae0001;
  --slytherin: #1a472a;
  --hufflepuff: #ecb939;
  --ravenclaw: #0e1a40;
  --no-house: #555770;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--panel-soft);
}
body { min-height: 100vh; display: flex; flex-direction: column; }

a { color: var(--accent-deep); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }

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

h1, h2, h3, h4 {
  font-family: "Cinzel", "Noto Serif JP", "Yu Mincho", "游明朝", serif;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.3;
  color: var(--text);
}

button, .btn {
  font: inherit;
  cursor: pointer;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 8px 16px;
  transition: background .12s, border-color .12s;
}
button:hover, .btn:hover { background: var(--panel-soft); border-color: var(--accent); color: var(--accent-deep); }
.btn-primary {
  background: var(--accent-deep);
  color: #fff;
  border-color: var(--accent-deep);
}
.btn-primary:hover { background: #93262a; color: #fff; border-color: #93262a; }
/* 主要CTA: 濃紺背景 + 白文字 + ゴールド枠 */
.btn-gold {
  background: var(--bg);
  color: #fff;
  border: 1px solid var(--accent);
  font-weight: bold;
  position: relative;
}
.btn-gold:hover {
  background: var(--bg-2);
  color: var(--accent);
  border-color: var(--accent-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border-color: rgba(255,255,255,.4);
}
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; border-color: #fff; }
.btn-big {
  padding: 12px 28px;
  font-size: 15px;
  font-weight: bold;
}

/* ===== ヘッダー ===== */
.site-header {
  background: var(--bg);
  color: var(--text-light);
  padding: 16px 0;
  border-bottom: 2px solid var(--accent);
  position: relative;
  z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  color: var(--text-light);
}
.brand:hover { color: var(--accent); }
.brand-mark {
  color: var(--accent);
  font-size: 28px;
  text-shadow: 0 0 12px rgba(197,160,99,.5);
}
.brand-name {
  font-family: "Cinzel", serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .04em;
}
.site-nav {
  display: flex; gap: 24px;
  align-items: center;
}
.site-nav a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.site-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.site-nav a.btn-gold { color: #1a1d2e; }

/* ===== ヒーロー ===== */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(197,160,99,.18) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(122,31,28,.25) 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text-light);
  padding: 100px 24px 80px;
  text-align: center;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: '';
  position: absolute;
  pointer-events: none;
  background-image: radial-gradient(white 1px, transparent 1.5px);
  background-size: 40px 40px;
  opacity: 0.06;
}
.hero::before { top: 0; left: 0; right: 0; height: 50%; }
.hero::after  { bottom: 0; left: 0; right: 0; height: 50%; }

.hero-inner { position: relative; z-index: 2; max-width: 800px; margin: 0 auto; }
.hero-tag {
  display: inline-block;
  font-family: "Cinzel", serif;
  letter-spacing: .25em;
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 14px;
  text-transform: uppercase;
  border: 1px solid rgba(197,160,99,.4);
  padding: 4px 14px;
  border-radius: 999px;
}
.hero h1 {
  color: var(--text-light);
  font-size: clamp(28px, 5vw, 46px);
  margin: 0 0 20px;
  text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.hero h1 .accent { color: var(--accent); font-style: italic; }
.hero p.lead {
  font-size: 16px;
  color: var(--muted-light);
  margin: 0 auto 32px;
  max-width: 600px;
  line-height: 1.8;
}
.hero-actions {
  display: flex; gap: 14px; flex-wrap: wrap;
  justify-content: center;
}

/* ===== セクション共通 ===== */
.section { padding: 70px 24px; }
.section .container {
  max-width: 1200px;
  margin: 0 auto;
}
.section-head {
  text-align: center;
  margin-bottom: 36px;
}
.section-head h2 {
  font-size: 28px;
  margin: 0 0 8px;
  position: relative;
  display: inline-block;
}
.section-head h2::before, .section-head h2::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40px;
  height: 1px;
  background: var(--accent);
}
.section-head h2::before { right: calc(100% + 16px); }
.section-head h2::after  { left:  calc(100% + 16px); }
.section-head p {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}

/* ===== 統計バー ===== */
.stats-bar {
  background: var(--bg);
  color: var(--text-light);
  border-top: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  padding: 24px;
}
.stats-bar .container {
  max-width: 900px;
  margin: 0 auto;
  display: flex; gap: 30px;
  justify-content: space-around;
  flex-wrap: wrap;
}
.stat-item {
  text-align: center;
}
.stat-num {
  font-family: "Cinzel", serif;
  font-size: 28px;
  color: var(--accent);
  font-weight: 600;
  display: block;
  line-height: 1.2;
}
.stat-label {
  font-size: 11px;
  letter-spacing: .15em;
  color: var(--muted-light);
  text-transform: uppercase;
}

/* ===== 寮ナビ ===== */
.house-nav {
  background: var(--panel-soft);
  padding: 50px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.house-nav .container { max-width: 1200px; margin: 0 auto; }
.house-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 30px;
}
.house-card {
  position: relative;
  display: block;
  text-align: center;
  padding: 30px 18px;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  font-family: "Cinzel", serif;
  font-weight: 600;
}
.house-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,.2);
  color: #fff;
}
.house-card.gryffindor { background: linear-gradient(135deg, #2a0708, #6e0001); }
.house-card.slytherin  { background: linear-gradient(135deg, #06180e, #133b21); }
.house-card.hufflepuff { background: linear-gradient(135deg, #4a3a07, #c79b1f); }
.house-card.ravenclaw  { background: linear-gradient(135deg, #04081a, #0e1a40); }
.house-card .h-name { font-size: 18px; display: block; }
.house-card .h-sub  {
  font-family: "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  font-size: 11px;
  font-weight: normal;
  opacity: .8;
  letter-spacing: .1em;
  margin-top: 4px;
}

/* ===== デッキカードグリッド（共通） ===== */
.deck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.deck-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.deck-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(20,30,60,.15);
  border-color: var(--accent);
}
.deck-card-link {
  display: flex; flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.deck-card .thumb {
  position: relative;
  padding: 8px;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 6px;
  min-height: 168px;
  overflow: hidden;
}
.deck-card .thumb-gryffindor { background: linear-gradient(135deg, #2a0708 0%, #6e0001 100%); }
.deck-card .thumb-slytherin  { background: linear-gradient(135deg, #06180e 0%, #133b21 100%); }
.deck-card .thumb-hufflepuff { background: linear-gradient(135deg, #4a3a07 0%, #c79b1f 100%); }
.deck-card .thumb-ravenclaw  { background: linear-gradient(135deg, #04081a 0%, #0e1a40 100%); }
.deck-card .thumb-none       { background: linear-gradient(135deg, #1a1d2e 0%, #2c2d3d 100%); }

.deck-card .thumb-partner {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 5 / 7;
  background: rgba(255,255,255,.08);
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.18);
}
.deck-card .thumb-partner img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.deck-card .thumb-partner-name {
  position: absolute;
  left: 4px; right: 4px; bottom: 4px;
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: 9px;
  text-align: center;
  padding: 2px 3px;
  border-radius: 2px;
  line-height: 1.2;
  z-index: 2;
}
.deck-card .thumb-card-gryffindor { background-color: #ae0001; }
.deck-card .thumb-card-slytherin  { background-color: #1a472a; }
.deck-card .thumb-card-hufflepuff { background-color: #ecb939; }
.deck-card .thumb-card-ravenclaw  { background-color: #0e1a40; }
.deck-card .thumb-card-none       { background-color: #555770; }

.deck-card .thumb-main {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 1px;
  align-content: start;
}
.deck-card .thumb-mini {
  aspect-ratio: 5 / 7;
  border-radius: 1px;
  position: relative;
  overflow: hidden;
}
.deck-card .thumb-mini img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}

.deck-card .body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.deck-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-family: "Cinzel", "Noto Serif JP", serif;
  font-weight: 600;
}
.deck-card .author { font-size: 11px; color: var(--muted); margin: 0 0 10px; }
.deck-card .stats {
  margin-top: auto;
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.deck-card .stats .likes { color: var(--accent-deep); font-weight: bold; }

.section-cta {
  text-align: center;
  margin-top: 30px;
}

/* ===== 大CTA ===== */
.big-cta {
  background:
    radial-gradient(ellipse at center, rgba(197,160,99,.18) 0%, transparent 60%),
    var(--bg);
  color: var(--text-light);
  padding: 80px 24px;
  text-align: center;
}
.big-cta h2 {
  color: var(--text-light);
  font-size: 32px;
  margin: 0 0 14px;
}
.big-cta p { color: var(--muted-light); margin: 0 0 28px; font-size: 15px; }

/* ===== フッター ===== */
.site-footer {
  background: var(--bg);
  color: var(--muted-light);
  padding: 40px 24px 20px;
  border-top: 1px solid var(--accent);
  margin-top: auto;
}
.site-footer .container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand {
  font-family: "Cinzel", serif;
  color: var(--accent);
  font-size: 16px;
}
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-nav a { color: var(--muted-light); font-size: 13px; }
.footer-nav a:hover { color: var(--accent); }
.footer-copy { font-size: 11px; opacity: .6; width: 100%; text-align: center; margin-top: 16px; }

/* ===== コンテンツページ（page.php） ===== */
.page-content {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 24px;
}
.page-content article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 40px;
}
.page-content h1 {
  font-size: 28px;
  margin: 0 0 20px;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 12px;
}
.page-content p { line-height: 1.8; }

/* ===== ブログ・アーカイブ ===== */
.archive-content {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 24px;
}
.archive-content article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 16px;
}
.archive-content h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
  .site-header .container { flex-direction: row; gap: 12px; }
  .brand-name { font-size: 14px; }
  .site-nav { gap: 14px; flex-wrap: wrap; }
  .site-nav a { font-size: 13px; }
  .hero { padding: 60px 20px 50px; }
  .hero h1 { font-size: 28px; }
  .section { padding: 50px 20px; }
  .section-head h2 { font-size: 22px; }
  .section-head h2::before, .section-head h2::after { display: none; }
  .stats-bar .container { gap: 16px; }
  .stat-num { font-size: 22px; }
  .deck-grid { grid-template-columns: 1fr; gap: 12px; }
  .big-cta h2 { font-size: 24px; }
  .site-footer .container { flex-direction: column; text-align: center; }
}
