/*
Theme Name: うそバナー帳
Theme URI: https://example.com/
Author: your name
Description: AIで生成した架空バナーとプロンプトをジャンル別にまとめる「うそバナー帳」用テーマ。banner カスタム投稿タイプ + genre タクソノミーで構成。
Version: 1.0.0
Requires PHP: 7.4
Text Domain: usobanner
*/

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ---------- Tokens ---------- */
:root {
  --color-navy: #0c3281;
  --color-navy-dark: #142645;
  --color-navy-mist: #8891a8;
  --color-accent: #ee5a2b;
  --color-text: #16171b;
  --color-text-sub: #5b7695;
  --color-border: #cfe6fb;
  --color-bg: #d8eeff;
  --color-surface: #ffffff;
  --color-surface-tint: #dcf0ff;
  --color-blue-light: #d9edff;
  --color-blue-lighter: #eef8ff;
  --radius-sm: 14px;
  --radius-md: 24px;
  --radius-lg: 40px;
  --radius-pill: 999px;
  --font-base: "Zen Maru Gothic", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  --container: 1160px;
}

body {
  font-family: var(--font-base);
  color: var(--color-navy);
  background-color:var(--color-surface-tint);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h2,h3 {
  margin: 2em 0 1em 0;
}
h1 {
  font-size: 2em;
  font-weight: 800;

  margin-bottom: 2em;
}

.container {
  /* max-width: var(--container); */
  /* margin: 0 auto; */
  /* margin: 1em 2em; */
  padding: 2em;
  /* padding: 0; */
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 1em 1.5em;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-logo-mark {
  width: 28px;
  height: 28px;
  margin-top: 5px;
}

.site-logo .mark {
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-accent);
}

.site-tagline {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-sub);
  letter-spacing: 0.02em;
}

.main-nav {
  margin-left: auto;
}

.main-nav ul {
  display: flex;
  gap: 40px;
}

.main-nav a {
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--color-text);
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
}

.main-nav a.is-active,
.main-nav a:hover {
  border-bottom-color: var(--color-accent);
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  position: relative;
  z-index: 101;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--color-navy);
  margin-left: auto;
}

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: var(--radius-pill);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */
.hero-countArea {
  /* max-width: var(--container);
  margin-left: auto;
  margin-right: auto; */
  /* background-image:
    radial-gradient(circle at 1px 1px, rgba(24, 42, 82, 0.12) 1px, transparent 0),
    radial-gradient(circle at 12% 15%, rgba(238, 90, 43, 0.08), transparent 45%),
    radial-gradient(circle at 88% 85%, rgba(24, 42, 82, 0.06), transparent 45%); */
  /* overflow: hidden; */

    /* background-image: linear-gradient(0deg, transparent calc(100% - 1px), #dedede calc(100% - 1px)),
                    linear-gradient(90deg, transparent calc(100% - 1px), #dedede calc(100% - 1px));
  background-size: 3em 3em;
  background-repeat: repeat;
  background-position: center center; */


      /* background-image: radial-gradient(#dedede 20%, transparent 20%), radial-gradient(#dedede 20%, transparent 20%);
    background-size: 10px 10px;
    background-position: 0 0, 20px 20px; */

  }
.hero {
  position: relative;
  justify-content: space-between;
  align-items: center;
  /* overflow: hidden; */

  background-color: var(--color-surface-tint);
  background-color:#ffffff94;
  /* background-image:
    radial-gradient(rgba(22, 44, 90, 0.14) 1px, transparent 1px),
    radial-gradient(circle at 12% 20%, rgba(238, 90, 43, 0.08), transparent 45%),
    radial-gradient(circle at 88% 80%, rgba(22, 44, 90, 0.1), transparent 50%); */
  background-size: 20px 20px, auto, auto;
  margin-bottom: 1.5em;
  border-radius: var(--radius-lg);

}

/* 栄和会館サイトを参考に、斜めに流れる淡い水色の曲線装飾を追加 */
/* .hero::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -15%;
  width: 60%;
  height: 220%;
  background: linear-gradient(135deg, var(--color-blue-light), var(--color-blue-lighter));
  border-radius: 50%;
  opacity: 0.7;
  z-index: 0;
  pointer-events: none;
} */

.hero-quote-bg {
  position: absolute;
  top: -0.2em;
  left: 0;
  font-size: 300px;
  font-weight: 900;
  color: var(--color-navy);
  opacity: 0.06;
  line-height: 1;
  font-family: Georgia, serif;
  pointer-events: none;
}

.hero-text {
  position: relative;
  z-index: 1;
  padding: 1.75em 2.5em;
}
@media (max-width: 900px) {
.hero-text {
  padding: 1.25em 1.5em;
  }
}
@media (max-width: 700px) {
  .hero-text {
    text-align: center;
    gap: 16px;
  }

  .hero-headline,
  .hero-description {
    width: 100%;
  }

  .hero-stats,
  .hero-cta {
    justify-content: center;
  }

  .hero-lead {
    text-align: left;
  }
}

.hero-headline {
  flex: 1;
  min-width: 240px;
}

.hero-description {
  flex: 1;
  min-width: 240px;
}

.hero-head-en {
  padding-left: 0.5em;
  font-weight: bold;
}

.hero-heading {
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.5em;
  color: var(--color-navy);
}
.hero-heading .setuzoku {
  font-size: 60%;
}
.hero-sub {
  color: var(--color-accent);
  font-weight: bold;
}

.hero-heading .accent {
  color: var(--color-accent);
}

.hero-lead {
  font-size: 13px;
  color: var(--color-text-sub);
  max-width: 32em;
}

.hero-cta {
  margin-top: 16px;
}

section.featured {
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 32px;
  background: var(--color-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: var(--radius-pill);
}

.btn:hover { background: var(--color-navy-dark); }

.hero-stats {
  padding: 0.5em 0 0 0;
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

.hero-stats strong { font-weight: 800; margin-right: 4px; }
.hero-stats .sep { color: var(--color-border); }

/* ---------- Section heading ---------- */
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 28px;
  padding-top: 0;
  margin-top: 0;
  /* border-top: 3px solid var(--color-accent); */
}

.section-heading .sub {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-sub);
}

/* ---------- Filter bar (ジャンル絞り込み + 列数切り替え) ---------- */
/* ジャンルを広く(flex:1)、列切り替えはコンパクトに右へ。
   スクロールしても常に見えるよう画面上部に固定する */
.filter-bar {
  position: sticky;
  top: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  /* background: var(--color-surface); */
  background-color: #ffffff94;
  padding: 14px 20px;
  margin-bottom: 32px;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(24, 42, 82, 0.08);
}

.col-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.col-switcher-label {
  font-size: 12px;
  color: var(--color-text-sub);
  margin-right: 4px;
}

.col-switcher button {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-surface-tint);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-sub);
}

.col-switcher button.is-active {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: #fff;
}

/* ---------- Genre filter (dropdown / 複数選択) ---------- */
.genre-filter {
  position: relative;
  flex-shrink: 0;
}

.genre-filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-surface-tint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-sub);
}

.genre-filter-toggle .chevron {
  font-size: 10px;
  transition: transform 0.15s ease;
}

.genre-filter-toggle.is-open,
.genre-filter-toggle.has-selection {
  background: var(--color-navy);
  color: #fff;
}

.genre-filter-toggle.is-open .chevron {
  transform: rotate(180deg);
}

.genre-filter-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 10em;
  max-height: 320px;
  overflow-y: auto;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 28px rgba(24, 42, 82, 0.14);
  padding: 8px;
  z-index: 30;
}

.genre-filter-clear {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 8px;
  margin-bottom: 4px;
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-navy);
}

.genre-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 8px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
}

.genre-filter-option:hover {
  background: var(--color-surface-tint);
  border-radius: var(--radius-sm);
}

.genre-filter-option.is-active {
  font-weight: 700;
  color: var(--color-navy);
}

.genre-filter-option input {
  flex-shrink: 0;
}

.genre-filter-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.genre-filter-option-count {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-sub);
}

/* ---------- Color filter (dropdown) ---------- */
.color-filter {
  position: relative;
  flex-shrink: 0;
}

.color-filter-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-surface-tint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-sub);
}

.color-filter-toggle .chevron {
  font-size: 10px;
  transition: transform 0.15s ease;
}

.color-filter-toggle.is-open,
.color-filter-toggle.has-selection {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: #fff;
}

.color-filter-toggle.is-open .chevron {
  transform: rotate(180deg);
}

.color-filter-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--color-surface);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 28px rgba(24, 42, 82, 0.14);
  padding: 8px;
  z-index: 30;
}

.color-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 8px;
  background: none;
  border: none;
  font-size: 13px;
  color: var(--color-text);
  text-align: left;
}

.color-filter-option:hover {
  background: var(--color-surface-tint);
  border-radius: var(--radius-sm);
}

.color-filter-option.is-active {
  font-weight: 700;
  color: var(--color-navy);
}

.color-filter-option .swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.color-filter-option .swatch-all {
  background: #fff;
}

/* ---------- Banner grid / cards ---------- */
.banner-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 24px;
  margin-bottom: 48px;
}

.banner-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.banner-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.banner-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.banner-card {
  display: block;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(22, 44, 90, 0.1);
}

.banner-card .thumb {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-surface-tint);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.banner-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.banner-card .card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.banner-card .genre {
  font-size: 12px;
  color: var(--color-text-sub);
  width: 6em;
  text-align: center;
  background-color: var(--color-surface-tint);
  padding: 0.25em 1em;
  border-radius: 2em;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-card .title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.banner-card .prompt-link {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-navy);
  background: var(--color-surface-tint);
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px;
}

.banner-card .prompt-link:hover,
.banner-card .prompt-link.is-open {
  background: var(--color-navy);
  color: #fff;
}

.banner-card .prompt-panel {
  margin-top: 10px;
  max-height: 170px;
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--color-surface-tint);
  border: none;
  border-radius: var(--radius-sm);
}

.banner-card .prompt-panel[hidden] {
  display: none;
}

.banner-card .prompt-panel pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-base);
  font-size: 10px;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0 0 8px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.banner-card .prompt-panel .ai-tool {
  font-size: 10px;
  color: var(--color-text-sub);
  margin: 0 0 8px;
  flex-shrink: 0;
}

.banner-card .prompt-panel .copy-btn {
  flex-shrink: 0;
  align-self: flex-start;
}

.banner-card.is-hidden { display: none; }

.featured-cta {
  text-align: center;
  margin-bottom: 2em;
}

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

.pagination a,
.pagination span {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-surface-tint);
  color: var(--color-text-sub);
  font-size: 13px;
}

.pagination .current {
  background: var(--color-navy);
  color: #fff;
}

/* ---------- Single banner ---------- */
.single-banner {
  padding: 48px 0 80px;
}

.single-banner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

.single-banner .thumb {
  background: var(--color-surface-tint);
  border-radius: var(--radius-md);
  overflow: hidden;
}

@media (min-width: 900px) {
  .single-banner-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.single-banner .genre {
  font-size: 13px;
  color: var(--color-text-sub);
  margin-bottom: 8px;
}

/* .single-banner h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 32px;
} */

.prompt-box {
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-surface-tint);
  padding: 28px;
}

.prompt-box h2 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.prompt-box pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-base);
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text);
}

.prompt-box .ai-tool {
  margin-top: 16px;
  padding-top: 16px;
  font-size: 12px;
  color: var(--color-text-sub);
}

.copy-btn {
  border: none;
  border-radius: var(--radius-pill);
  color: var(--color-navy);
  background: var(--color-surface);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
}

.copy-btn.is-copied {
  background: var(--color-navy);
  color: #fff;
}

.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--color-text-sub);
}

/* ---------- Page ---------- */
.page-content {
  padding: 56px 0 96px;
  max-width: 760px;
}

.page-content h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 24px;
}

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  background: #ffffff94;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 1em 1.5em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  color: var(--color-text-sub);
}

/* ヒーローの水色曲線と対になるよう、フッターにも下端の装飾を入れる */
.site-footer::before {
  content: "";
  position: absolute;
  bottom: -90%;
  right: -15%;
  width: 55%;
  height: 220%;
  background: linear-gradient(315deg, #d9edff, #eef8ff);
  border-radius: 50%;
  opacity: 0.6;
  z-index: 0;
  pointer-events: none;
}

.footer-nav,
.site-footer > p {
  position: relative;
  z-index: 1;
}

.footer-nav {
  display: flex;
  gap: 24px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  /* スマホでは列数切り替えUIを出さず、常に2列に固定する。
     .cols-3/.cols-4はJS側でつくクラスでbanner-gridより詳細度が高いため、
     同じ詳細度で明示的に上書きする */
  .col-switcher { display: none; }

  .banner-grid,
  .banner-grid.cols-2,
  .banner-grid.cols-3,
  .banner-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-quote-bg { font-size: 180px; top: 0; }
}

@media (max-width: 560px) {
  .site-header { flex-wrap: wrap; }

  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    width: auto;
    margin-left: 0;
    background: var(--color-navy);
    align-items: center;
    justify-content: center;
  }

  .main-nav.is-open { display: flex; }

  body.nav-open { overflow: hidden; }

  .main-nav ul { flex-direction: column; align-items: center; gap: 32px; }

  .main-nav a { color: #fff; font-size: 20px; }

  .hero { align-items: flex-start; }
  .hero-stats { flex-wrap: wrap; }
  .hero-quote-bg { font-size: 120px; top: 0; }
}
