/*
Theme Name: Wanwan Parade
Theme URI: https://wanwanparade.com
Author: Team beta version
Description: Modern dog breed encyclopedia theme — clean, semantic, SEO-first.
Version: 2.0.0
Text Domain: wanwanparade
*/

/* ================================================================
   CSS Custom Properties
   ================================================================ */
:root {
  --bg: #f8fafc;
  --bg-white: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --line: #e5e7eb;
  --radius: 12px;
  --max: 1120px;
  --pad: 20px;
  --font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
}

/* ================================================================
   Reset & Base
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3, h4 {
  line-height: 1.4;
  font-weight: 700;
}

/* ================================================================
   Layout
   ================================================================ */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

.layout-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

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

/* ================================================================
   Skip Link
   ================================================================ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  font-size: .875rem;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid var(--accent-hover);
}

/* ================================================================
   Header
   ================================================================ */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 24px;
}

.site-header .brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .02em;
  white-space: nowrap;
}
.site-header .brand:hover { text-decoration: none; color: var(--accent); }

.site-nav {
  display: flex;
  gap: 20px;
  align-items: center;
}
.site-nav a {
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  transition: color .15s;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* ================================================================
   Breadcrumb
   ================================================================ */
.breadcrumb {
  padding: 12px 0;
  font-size: .8125rem;
  color: var(--muted);
}
.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.breadcrumb li::after {
  content: "/";
  margin-left: 6px;
  color: var(--line);
}
.breadcrumb li:last-child::after { content: none; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb [aria-current="page"] { color: var(--ink); font-weight: 500; }

/* ================================================================
   Hero (Front Page)
   ================================================================ */
.hero {
  padding: 48px 0 32px;
  text-align: center;
}
.hero h1 {
  font-size: 2.25rem;
  margin: 0 0 8px;
  letter-spacing: .03em;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.125rem;
}

/* ================================================================
   Section
   ================================================================ */
.section {
  margin: 36px 0;
}
.section-heading {
  font-size: 1.375rem;
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ================================================================
   Grid
   ================================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

/* ================================================================
   Card
   ================================================================ */
.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card a { color: inherit; display: block; }
.card a:hover { text-decoration: none; }
.card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}
.card-body {
  padding: 14px 16px 16px;
}
.card-body h3 {
  font-size: 1rem;
  margin: 0 0 6px;
  line-height: 1.5;
}
.card .meta {
  color: var(--muted);
  font-size: .8125rem;
}

/* ================================================================
   Tag List
   ================================================================ */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}
.tag-list a,
.tag-list span {
  display: inline-block;
  padding: 2px 10px;
  background: var(--bg);
  color: var(--muted);
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 500;
  border: 1px solid var(--line);
  transition: background .15s, color .15s;
}
.tag-list a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}

/* ================================================================
   Highlight Box (TL;DR)
   ================================================================ */
.highlight-box {
  background: #eff6ff;
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: .9375rem;
  line-height: 1.75;
}
.highlight-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 1rem;
}

/* ================================================================
   Breed Data (dl/dt/dd)
   ================================================================ */
.breed-data {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.breed-data-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  border-bottom: 1px solid var(--line);
}
.breed-data-row:last-child { border-bottom: none; }
.breed-data dt {
  padding: 10px 14px;
  background: var(--bg);
  font-weight: 500;
  font-size: .875rem;
  color: var(--muted);
  margin: 0;
}
.breed-data dd {
  padding: 10px 14px;
  margin: 0;
  font-size: .9375rem;
}

/* ================================================================
   FAQ Accordion
   ================================================================ */
.faq { margin: 24px 0; }
.faq details {
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  font-size: .9375rem;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.faq summary::before {
  content: "Q";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq .faq-answer {
  padding: 12px 16px 12px 48px;
  font-size: .9375rem;
  line-height: 1.75;
}

/* ================================================================
   Ad Slot
   ================================================================ */
.ad-slot {
  margin: 24px 0;
  text-align: center;
}

/* ================================================================
   Button
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.btn:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

/* ================================================================
   Pagination
   ================================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 40px 0;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  background: var(--bg-white);
  transition: background .15s, color .15s;
}
.pagination .page-numbers:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}
.pagination .page-numbers.current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ================================================================
   Related Posts
   ================================================================ */
.related-posts {
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.related-posts h2 {
  font-size: 1.25rem;
  margin: 0 0 16px;
}

/* ================================================================
   Article Styles
   ================================================================ */
.article-header {
  margin-bottom: 24px;
}
.article-header h1 {
  font-size: 1.75rem;
  margin: 0 0 12px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: .8125rem;
}
.article-meta time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.article-thumbnail {
  margin: 0 0 24px;
  border-radius: var(--radius);
  overflow: hidden;
}
.article-thumbnail img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}
.image-credit {
  margin: 6px 0 0;
  font-size: .75rem;
  color: var(--muted);
  text-align: right;
  line-height: 1.5;
}
.image-credit a {
  color: var(--muted);
  text-decoration: underline;
}
.image-credit a:hover {
  color: var(--accent);
}

.article-content {
  font-size: 1rem;
  line-height: 1.9;
}
.article-content h2 {
  font-size: 1.375rem;
  margin: 2em 0 .5em;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
}
.article-content h3 {
  font-size: 1.125rem;
  margin: 1.5em 0 .4em;
}
.article-content p { margin: 0 0 1.2em; }
.article-content ul, .article-content ol {
  padding-left: 1.5em;
  margin: 0 0 1.2em;
}

/* ================================================================
   Sidebar
   ================================================================ */
.sidebar .widget {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
  margin-bottom: 20px;
}
.sidebar .widget-title {
  font-size: .9375rem;
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

/* ================================================================
   Footer
   ================================================================ */
.site-footer {
  background: var(--bg-white);
  border-top: 1px solid var(--line);
  padding: 24px 0 32px;
  margin-top: 48px;
  color: var(--muted);
  font-size: .8125rem;
}
.site-footer .footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.footer-nav {
  display: flex;
  gap: 16px;
}
.footer-nav a {
  color: var(--muted);
  font-size: .8125rem;
}
.footer-nav a:hover { color: var(--accent); }
.site-footer .copyright { margin: 0; }

/* ================================================================
   Filter Chips (Feature 1)
   ================================================================ */
.filter-chips {
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.filter-group-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  min-width: 70px;
}
.filter-chip {
  display: inline-block;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  font-size: .8125rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  transition: background .15s, color .15s, border-color .15s;
}
.filter-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
}
.filter-chip.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ================================================================
   Breed Finder / 逆引き (Feature 2)
   ================================================================ */
.finder-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.finder-nav a {
  display: inline-block;
  padding: 10px 20px;
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  color: var(--ink);
  transition: box-shadow .15s, border-color .15s;
}
.finder-nav a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--accent);
}
.finder-section {
  margin-bottom: 40px;
}
.finder-section h2 {
  font-size: 1.375rem;
  margin: 0 0 4px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.finder-desc {
  color: var(--muted);
  font-size: .9375rem;
  margin: 0 0 16px;
}

/* ================================================================
   Breed Quiz / 犬種診断 (Feature 3)
   ================================================================ */
.quiz-container {
  max-width: 640px;
  margin: 0 auto;
}
.quiz-progress {
  background: var(--line);
  border-radius: 9999px;
  height: 8px;
  margin-bottom: 24px;
  overflow: hidden;
}
.quiz-progress-bar {
  background: var(--accent);
  height: 100%;
  border-radius: 9999px;
  transition: width .3s ease;
}
.quiz-step-label {
  text-align: center;
  font-size: .875rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.quiz-question {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 24px;
  line-height: 1.5;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quiz-option {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--bg-white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  font-family: inherit;
}
.quiz-option:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.quiz-results {
  margin-top: 32px;
}
.quiz-results-heading {
  font-size: 1.375rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 8px;
}
.quiz-results-sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 24px;
}
.quiz-reset {
  display: block;
  margin: 24px auto 0;
}

/* ================================================================
   Breed Compare / 犬種比較 (Feature 4)
   ================================================================ */
.compare-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  margin-top: 8px;
  font-family: inherit;
}
.compare-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.compare-add-btn.is-added {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.compare-badge {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: background .15s;
  text-decoration: none;
}
.compare-badge:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}
.compare-badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #fff;
  color: var(--accent);
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 700;
}
.compare-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}
.compare-empty p {
  margin: 0 0 16px;
  font-size: 1.125rem;
}
.compare-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.compare-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 24px;
}
.compare-table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.compare-table th,
.compare-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: .875rem;
  text-align: left;
  vertical-align: top;
}
.compare-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  width: 120px;
}
.compare-table td {
  min-width: 140px;
}
.compare-table .compare-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 8px;
}
.compare-table .compare-name {
  font-weight: 700;
}
.compare-table .compare-remove {
  display: inline-block;
  margin-top: 6px;
  font-size: .75rem;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
}
.compare-table .compare-remove:hover {
  color: #ef4444;
}

/* Compare selector */
.compare-selector {
  max-width: 600px;
  margin: 0 auto 24px;
}
.compare-selector label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}
.compare-selector-row {
  position: relative;
}
.compare-breed-input {
  width: 100%;
  padding: 10px 14px;
  font-size: 1rem;
  border: 2px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  font-family: inherit;
  box-sizing: border-box;
}
.compare-breed-input:focus {
  outline: none;
  border-color: var(--accent, #2563eb);
}
.compare-breed-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
}
.compare-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
}
.compare-dropdown-item:hover {
  background: var(--gray-50, #f9fafb);
  color: var(--accent, #2563eb);
}
.compare-selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.compare-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent, #2563eb);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .875rem;
}
.compare-tag-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0 0 2px;
  opacity: .8;
}
.compare-tag-remove:hover {
  opacity: 1;
}

/* ================================================================
   Explore Section (front-page)
   ================================================================ */
.explore-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.explore-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--bg-white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--ink);
  transition: box-shadow .15s, border-color .15s;
}
.explore-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--accent);
}
.explore-card-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ================================================================
   Responsive
   ================================================================ */
@media (min-width: 640px) {
  .breed-data-row {
    grid-template-columns: 180px 1fr;
  }
}

@media (min-width: 768px) {
  .hero h1 { font-size: 2.5rem; }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (min-width: 1024px) {
  .layout-2col {
    grid-template-columns: 1fr 300px;
  }
}

@media (max-width: 639px) {
  .hero h1 { font-size: 1.5rem; }
  .hero p { font-size: .9375rem; }
  .article-header h1 { font-size: 1.375rem; }
  .site-header .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .site-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    flex-wrap: nowrap;
  }
  .site-nav a { white-space: nowrap; }
  .breed-data-row {
    grid-template-columns: 1fr;
  }
  .breed-data dt {
    border-bottom: none;
    padding-bottom: 0;
  }
  .breed-data dd {
    padding-top: 0;
  }
  .site-footer .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .filter-chips {
    padding: 12px 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .filter-group {
    flex-wrap: nowrap;
  }
  .compare-badge {
    bottom: 12px;
    right: 12px;
    padding: 10px 16px;
    font-size: .8125rem;
  }
}
