/*
Theme Name: Rakuquiz
Theme URI: https://rakuquiz.net
Author: Rakuquiz
Description: Japanese quiz site theme for Rakuquiz.
Version: 1.2.0
Text Domain: rakumon
*/

:root {
  --ink: #1b2433;
  --muted: #5c6574;
  --paper: #f6efe4;
  --card: #fffdf8;
  --line: #d7cbb8;
  --persimmon: #d45a2a;
  --indigo: #2c4c6e;
  --gold: #e8c37a;
  --shadow: 6px 8px 0 #1b243314;
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, p { margin: 0; }

.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, white);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 20px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--indigo); color: #fff; padding: 8px 12px; z-index: 50; }
.skip-link:focus { left: 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.logo { display: flex; align-items: center; gap: 10px; font-family: "Shippori Mincho", serif; }
.logo-mark-img { width: 48px; height: 48px; border-radius: 12px; display: block; }
.logo-footer .logo-mark-img { width: 44px; height: 44px; }
.logo-word { font-size: 26px; letter-spacing: 0.02em; font-weight: 700; }
.logo-word span { color: var(--persimmon); }
.logo-kana { display: block; font-family: "Zen Kaku Gothic New", sans-serif; font-size: 11px; letter-spacing: 0.16em; color: var(--muted); margin-top: 2px; }
.header-search { display: flex; align-items: center; gap: 6px; flex: 1; max-width: 280px; margin-left: auto; }
.header-search input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: #fff; }
.header-search button { background: var(--indigo); color: #fff; border-radius: 999px; padding: 8px 12px; font-size: 12px; }
.menu-button { display: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; }
.site-nav { display: flex; gap: 22px; font-size: 14px; }
.site-nav a:hover, .site-nav a.is-current { color: var(--persimmon); }
.crumb { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 18px; }
.crumb a:hover { color: var(--persimmon); }
.primary.inline-cta { display: inline-flex; width: auto; padding: 12px 20px; text-decoration: none; }

.hero { padding: 56px 0 28px; display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: end; }
.kicker { font-size: 12px; letter-spacing: 0.22em; color: var(--persimmon); font-weight: 700; }
.hero h1 { font-family: "Shippori Mincho", serif; font-size: clamp(32px, 5vw, 52px); line-height: 1.35; margin-top: 12px; font-weight: 600; }
.hero p { margin-top: 16px; color: var(--muted); line-height: 1.9; max-width: 36em; }
.hero-panel {
  background: var(--indigo); color: #f4ebe0; border-radius: 24px; padding: 28px;
  min-height: 180px; box-shadow: var(--shadow);
}
.hero-panel strong { display: block; font-size: 42px; font-family: "Shippori Mincho", serif; }
.hero-panel span { display: block; margin-top: 8px; opacity: 0.85; }

.topics { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 28px; }
.topics a, .topics span {
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; background: var(--card); font-size: 13px;
}
.topics a.is-active, .topics a:hover { background: var(--indigo); color: #fff; border-color: var(--indigo); }

.quiz-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; padding-bottom: 64px; }
.quiz-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 1px 0 #fff inset; transition: transform .2s, box-shadow .2s;
}
.quiz-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.quiz-card img { aspect-ratio: 16/9; object-fit: cover; width: 100%; background: #efe4d3; }
.card-body { padding: 16px 16px 18px; }
.card-cat { font-size: 11px; color: var(--persimmon); letter-spacing: 0.08em; }
.card-body h2, .card-body h3 { font-size: 17px; line-height: 1.55; margin-top: 8px; font-weight: 700; }
.card-meta { margin-top: 12px; font-size: 12px; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); padding: 36px 0; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer a { text-decoration: underline; text-underline-offset: 3px; }

.quiz-page { padding: 36px 0 72px; max-width: 760px; }
.quiz-page h1 { font-family: "Shippori Mincho", serif; font-size: clamp(28px, 4vw, 40px); line-height: 1.4; margin: 10px 0 14px; }
.lede { color: var(--muted); line-height: 1.95; }
.disclosure { margin: 18px 0; padding: 12px 14px; background: #efe6d6; border-radius: 12px; font-size: 13px; line-height: 1.8; }
.hero-art { border-radius: 18px; overflow: hidden; margin: 22px 0; border: 1px solid var(--line); }
.hero-art img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.player { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.player h2 { font-size: 22px; line-height: 1.6; }
.progress { height: 6px; background: #eadfcb; border-radius: 99px; margin: 18px 0 24px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--persimmon); }
.options { display: grid; gap: 10px; margin-top: 20px; }
.options button {
  text-align: left; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  display: flex; gap: 12px; align-items: flex-start;
}
.options button:hover, .options button.is-on { border-color: var(--indigo); background: #eef3f8; }
.options .mark { width: 26px; height: 26px; border-radius: 8px; background: #efe6d6; display: grid; place-items: center; font-size: 12px; flex-shrink: 0; }
.primary {
  margin-top: 22px; width: 100%; padding: 14px; border-radius: 12px;
  background: var(--persimmon); color: #fff; font-weight: 700;
}
.primary:disabled { opacity: .45; }
.result { text-align: center; }
.result .score { font-family: "Shippori Mincho", serif; font-size: 56px; color: var(--indigo); }
.review { text-align: left; margin-top: 24px; }
.review div { border-top: 1px solid var(--line); padding: 12px 0; font-size: 14px; line-height: 1.7; }
.ok { color: #2a7a45; font-weight: 700; }
.ng { color: var(--persimmon); font-weight: 700; }

.page-body { padding: 40px 0 80px; max-width: 760px; }
.page-body h1 { font-family: "Shippori Mincho", serif; font-size: 36px; margin-bottom: 16px; }
.page-body p, .page-body li { line-height: 2; margin: 12px 0; color: var(--muted); }
.page-body h2 { font-size: 20px; margin: 32px 0 10px; }
.page-body a { color: var(--indigo); text-decoration: underline; text-underline-offset: 3px; }
.publisher-section { margin: 28px 0; }
.policy-links { padding-left: 1.2em; }
.publisher-related { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; }
.contact-form { display: grid; gap: 16px; margin: 28px 0; padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.contact-form label { display: grid; gap: 8px; font-size: 13px; font-weight: 600; }
.contact-form input, .contact-form textarea, .contact-form select { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; font-weight: 400; }
.contact-agreement { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.contact-trap { position: absolute; left: -10000px; }
.form-error { padding: 12px 14px; background: #fdece6; border-radius: 10px; color: #9a3b22; }
.contact-success { padding: 24px; background: #eef4e8; border-radius: 14px; }
.credit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.credit-grid h2 { font-size: 15px; margin: 0 0 4px; }
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 0; color: var(--muted); font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; padding-bottom: 28px; }
.footer-brand { font-family: "Shippori Mincho", serif; font-size: 22px; color: var(--ink); margin-bottom: 8px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links h2 { font-size: 13px; color: var(--ink); margin: 0 0 6px; }
.footer-links a { text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 16px 0 22px; font-size: 12px; }
@media (max-width: 800px) { .footer-grid, .credit-grid { grid-template-columns: 1fr; } }

@media (max-width: 900px) {
  .hero, .quiz-grid { grid-template-columns: 1fr; }
  .quiz-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .header-search { display: none; }
}
@media (max-width: 640px) {
  .menu-button { display: inline-flex; }
  .site-nav { display: none; }
  .site-nav.is-open {
    display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 76px;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 12px 20px 18px; gap: 0;
  }
  .site-nav.is-open a { padding: 12px 4px; }
  .quiz-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
}
