/* 月ちゃんのロゴバナー。既存の3枚の表情素材をCSSで切り替える。 */
.site-header { padding-top: 16px; }
.header-inner {
  position: relative; padding: 16px 24px; gap: 24px; margin-bottom: 16px;
  min-height: 206px; border: 2px solid #d4b17b; border-bottom: 5px solid #ab774a;
  border-radius: 18px; background: #fff7e6 url('assets/autumn-leaves.svg') center / cover no-repeat;
  box-shadow: 0 4px 0 #efe0c5;
}
.brand.brand-banner {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 18px;
  flex: 1; min-width: 0; min-height: 154px; padding: 0;
  color: #654329; text-decoration: none;
}
.brand-banner .brand-banner-copy { min-width: 0; }
.brand-banner small { display: block; font-size: 16px; color: #6d573c; margin-bottom: 7px; line-height: 1.6; }
.brand-banner strong { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; font-family: 'UD デジタル 教科書体 NP-B', 'BIZ UDPGothic', 'Meiryo', sans-serif; font-weight: 800; line-height: 1.5; }
.brand-banner .banner-name { font-size: clamp(28px, 3vw, 38px); color: #596a40; white-space: nowrap; letter-spacing: .02em; }
.brand-banner .banner-title { font-size: clamp(34px, 4vw, 52px); color: #704829; white-space: nowrap; letter-spacing: .025em; }
.brand-banner .banner-status { font-size: 16px; letter-spacing: 0; font-weight: 500; }
.tsuki-stage { position: relative; display: block; flex: 0 0 144px; height: 154px; overflow: hidden; border-radius: 48% 48% 14px 14px; }
.tsuki-motion { display: block; position: absolute; inset: 0; transform-origin: 50% 100%; animation: tsuki-sway 4.8s ease-in-out infinite; }
.tsuki-motion img { position: absolute; display: block; width: 176px; max-width: none; height: auto; left: -16px; top: -2px; }
.tsuki-half, .tsuki-closed { opacity: 0; }
.tsuki-open { animation: tsuki-open 6s linear infinite; }
.tsuki-half { animation: tsuki-half 6s linear infinite; }
.tsuki-closed { animation: tsuki-closed 6s linear infinite; }
@keyframes tsuki-sway { 0%,100% { transform: rotate(-1.7deg) translateY(0); } 50% { transform: rotate(1.7deg) translateY(-3px); } }
@keyframes tsuki-open { 0%,69.99%,74.01%,100% { opacity: 1; } 70%,74% { opacity: 0; } }
@keyframes tsuki-half { 0%,69.99%,71.01%,72.99%,74.01%,100% { opacity: 0; } 70%,71%,73%,74% { opacity: 1; } }
@keyframes tsuki-closed { 0%,70.99%,73.01%,100% { opacity: 0; } 71%,73% { opacity: 1; } }
.header-actions { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; flex-shrink: 0; }
.header-actions .channel-link { margin: 0; }
.header-actions .youtube-qr-link { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: none; border-radius: 0; font-size: 18px; line-height: 1.5; }
.youtube-qr-link img { display: block; width: 128px; height: 128px; padding: 3px; background: #fff; border: 1px solid #d4c09d; border-radius: 4px; }
.youtube-qr-link:hover span { text-decoration: underline; }
.banner-motion-button { border: 1px solid #c9b38e; border-radius: 24px; background: #fffdf5; padding: 6px 16px; color: #665037; font: inherit; font-size: 16px; line-height: 1.8; cursor: pointer; }
.banner-motion-button:hover { background: #f7edd8; }
.banner-motion-button:focus-visible { outline: 3px solid #247387; outline-offset: 3px; }
.brand-banner.motion-paused .tsuki-motion, .brand-banner.motion-paused .tsuki-motion img { animation: none; }
.brand-banner.motion-paused .tsuki-open { opacity: 1; }
.brand-banner.motion-paused .tsuki-half, .brand-banner.motion-paused .tsuki-closed { opacity: 0; }
.top-print-help { margin-block: 12px; text-align: right; font-size: 18px; line-height: 1.8; }
.top-print-help a { display: inline-block; padding: 6px 0; }
@media (max-width: 1000px) {
  .brand.brand-banner { width: auto; flex: 1; }
  .brand-banner .banner-name { font-size: 28px; }
  .brand-banner .banner-title { font-size: 34px; }
  .brand-banner strong { column-gap: 5px; }
  .tsuki-stage { flex-basis: 118px; height: 132px; }
  .tsuki-motion img { width: 146px; left: -14px; }
}
@media (max-width: 680px) {
  .site-header { padding-top: 12px; }
  .header-inner { display: flex; flex-wrap: wrap; gap: 12px; padding: 12px; }
  .brand.brand-banner { flex: 1 1 100%; width: 100%; gap: 10px; min-height: 110px; padding: 0; }
  .brand-banner small { display: none; }
  .brand-banner .banner-name { display: block; font-size: 25px; }
  .brand-banner .banner-title { font-size: 30px; letter-spacing: 0; }
  .brand-banner .banner-status { position: absolute; right: 0; top: 0; font-size: 14px; line-height: 1.2; }
  .tsuki-stage { flex-basis: 88px; height: 106px; }
  .tsuki-motion img { width: 118px; left: -15px; top: 0; }
  .header-actions { flex-direction: row; width: 100%; justify-content: space-between; gap: 12px; border-top: 1px solid #decca8; padding-top: 12px; }
  .header-actions .channel-link { font-size: 18px; padding: 6px 16px; }
  .header-actions .youtube-qr-link { padding: 0; font-size: 16px; }
  .youtube-qr-link img { width: 104px; height: 104px; }
  .banner-motion-button { font-size: 16px; padding-inline: 8px; }
  .top-print-help { text-align: left; margin-block: 8px; font-size: 18px; }
}
@media (max-width: 370px) {
  .brand-banner .banner-name { font-size: 23px; }
  .brand-banner .banner-title { font-size: 26px; }
  .brand-banner .banner-status { font-size: 12px; }
  .tsuki-stage { flex-basis: 68px; }
}
@media (prefers-reduced-motion: reduce) {
  .tsuki-motion, .tsuki-motion img { animation: none !important; }
  .tsuki-open { opacity: 1 !important; }
  .tsuki-half, .tsuki-closed { opacity: 0 !important; }
  .banner-motion-button { display: none; }
}
@media print { .top-print-help, .header-actions { display: none; } }

/* 施設・ご家庭での用途を一目で伝える共通バナー。 */
.header-inner { min-height: 280px; }
.brand.brand-banner { gap: 16px; }
.brand-banner .brand-banner-copy { display: flex; flex-direction: column; gap: 9px; }
.brand-banner .banner-appeal { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-weight: 800; line-height: 1.3; }
.banner-appeal > span { color: #596a40; font-size: clamp(23px, 2.2vw, 29px); letter-spacing: .04em; }
.banner-appeal > b { color: #a44924; font-size: clamp(36px, 3.5vw, 48px); letter-spacing: .035em; text-shadow: 2px 2px 0 #fff; background: linear-gradient(transparent 70%, #f4d991 70%); }
.brand-banner strong { line-height: 1.35; column-gap: 6px; }
.brand-banner .banner-name { font-size: 27px; }
.brand-banner .banner-title { font-size: clamp(32px, 3.1vw, 43px); }
.brand-banner .banner-recreation { display: block; color: #6d573c; font-size: 22px; font-weight: 700; line-height: 1.6; }
.banner-recreation > span { display: inline-block; }
.tsuki-stage { flex-basis: 170px; height: 225px; }
.tsuki-motion img { width: 218px; left: -24px; }
.header-qr-group { display: flex; justify-content: center; align-items: flex-start; gap: 18px; }
.header-actions .youtube-qr-link, .header-actions .site-qr-link { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: 0; background: none; border-radius: 0; font-size: 18px; font-weight: 700; line-height: 1.5; text-decoration: none; color: #654329; }
.site-qr-link img { display: block; width: 128px; height: 128px; padding: 3px; background: #fff; border: 1px solid #d4c09d; border-radius: 4px; }
.site-qr-link small { display: block; color: #6d573c; font-size: 14px; line-height: 1.4; font-weight: 400; }
.site-qr-link:hover span { text-decoration: underline; }
@media (max-width: 1100px) and (min-width: 681px) {
  .header-inner { flex-wrap: wrap; }
  .brand.brand-banner { flex: 1 1 100%; }
  .header-actions { flex: 1 1 100%; flex-direction: row; gap: 28px; border-top: 1px solid #decca8; padding-top: 16px; }
  .youtube-qr-link img, .site-qr-link img { width: 104px; height: 104px; }
}
@media (max-width: 680px) {
  .header-inner { gap: 14px; }
  .brand.brand-banner { align-items: center; gap: 9px; }
  .brand-banner .brand-banner-copy { gap: 9px; }
  .banner-appeal > span { font-size: 18px; letter-spacing: 0; }
  .banner-appeal > b { font-size: 29px; letter-spacing: 0; }
  .brand-banner strong { flex-direction: column; gap: 2px; }
  .brand-banner .banner-name { font-size: 23px; }
  .brand-banner .banner-title { font-size: 30px; letter-spacing: 0; }
  .brand-banner .banner-recreation { font-size: 17px; }
  .tsuki-stage { flex-basis: 79px; height: 164px; border-radius: 0 0 14px 14px; }
  .tsuki-motion img { width: 140px; left: -30px; top: 0; }
  .header-actions { flex-direction: column; gap: 12px; }
  .header-qr-group { width: 100%; gap: 24px; }
  .header-actions .youtube-qr-link, .header-actions .site-qr-link { font-size: 16px; }
  .youtube-qr-link img, .site-qr-link img { width: 104px; height: 104px; }
  .banner-motion-button { padding: 3px 16px; }
}
@media (max-width: 370px) {
  .tsuki-stage { flex-basis: 64px; }
  .tsuki-motion img { width: 112px; left: -24px; }
  .brand-banner .banner-title { font-size: 26px; }
  .banner-appeal > b { font-size: 26px; }
  .banner-appeal > span { font-size: 17px; }
  .brand-banner .banner-name { font-size: 21px; }
  .header-qr-group { gap: 20px; }
}

/* サイトQRは左、YouTube QRは右。間にロゴを置いて読み違いを減らす。 */
.header-inner {
  display: grid; grid-template-columns: 136px minmax(0,1fr) 136px;
  grid-template-areas: 'site brand youtube'; align-items: center; column-gap: 28px;
}
.header-inner > .site-qr-link { grid-area: site; justify-self: start; }
.brand.brand-banner { grid-area: brand; width: 100%; }
.header-actions { grid-area: youtube; width: auto; padding: 0; border: 0; }
.header-inner .site-qr-link, .header-inner .youtube-qr-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; margin: 0; padding: 0; border: 0; background: none; border-radius: 0;
  font-size: 18px; font-weight: 700; line-height: 1.5; text-decoration: none;
}
.header-inner .site-qr-link { color: #234d38; }
.header-inner .youtube-qr-link { color: #173f73; }
.site-qr-link img { border: 2px solid #234d38; }
.youtube-qr-link img { border: 2px solid #173f73; }
.site-qr-link small { font-size: 14px; }
.video-section { scroll-margin-top: 24px; }
.quiz-detail > .article-header + .video-section { margin-top: 24px; margin-bottom: 36px; }
.trademark-note { font-size: 16px; color: #6d573c; margin-top: 32px; }
@media (max-width: 1100px) {
  .header-inner { grid-template-columns: minmax(0,1fr) minmax(0,1fr); grid-template-areas: 'brand brand' 'site youtube'; row-gap: 24px; }
  .header-actions { justify-self: end; flex-direction: column; gap: 12px; }
  .header-inner > .site-qr-link { align-self: start; }
}
@media (max-width: 680px) {
  .header-inner { column-gap: 24px; row-gap: 22px; }
  .header-inner .site-qr-link, .header-inner .youtube-qr-link { font-size: 16px; }
  .header-actions { width: auto; padding: 0; }
  .header-actions .banner-motion-button { font-size: 14px; padding-inline: 6px; }
}
@media (max-width: 370px) {
  .header-inner { column-gap: 20px; }
  .header-actions { margin-top: 48px; }
}
@media print { .header-inner > .site-qr-link { display: none; } }

/* 地域担当の月ちゃん。地域クイズの中で大きく、案内する場面も増やす。 */
.quiz-detail > .article-header { display: flow-root; }
.quiz-detail > .article-header .page-chara { height: 180px; max-width: 34%; object-fit: contain; margin-top: 0; }
.quiz-detail .download-section .yubisashi { height: 156px; }
.quiz-detail .download-grid { clear: both; }
.tsuki-region-guide { display: flex; align-items: center; gap: 24px; margin: 0 0 32px; padding: 20px 28px; border: 2px solid #d8c89c; border-radius: 18px; background: #fff4df; }
.tsuki-region-guide img { flex: 0 0 auto; width: 76px; height: 172px; object-fit: contain; }
.tsuki-region-guide > div { min-width: 0; }
.tsuki-region-guide .tsuki-guide-title { margin: 0 0 8px; color: #596a40; font-size: 24px; font-weight: 700; }
.tsuki-region-guide p { margin: 0 0 10px; }
.tsuki-region-guide a { display: inline-block; padding-block: 8px; font-weight: 700; }
@media (max-width: 760px) {
  .quiz-detail > .article-header .page-chara { height: 124px; }
  .quiz-detail .download-section .yubisashi { height: 116px; }
  .tsuki-region-guide { padding: 16px; gap: 14px; }
  .tsuki-region-guide img { width: 56px; height: 128px; }
  .tsuki-region-guide .tsuki-guide-title { font-size: 21px; }
}
@media print { .tsuki-region-guide { display: none !important; } }
