:root {
  --mh-bg-main: #0B1220;
  --mh-bg-secondary: #111827;
  --mh-text-main: #FFFFFF;
  --mh-text-secondary: #CBD5E1;
  --mh-accent: #38BDF8;
  --mh-official: #0EA5E9;
  --mh-rumor: #F59E0B;
  --mh-warning: #EF4444;
  --mh-radius: 12px;
  --mh-container: 720px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  background: var(--mh-bg-main);
  color: var(--mh-text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.8;
  margin: 0;
  font-size: 16px;
}

a { color: var(--mh-accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--mh-accent); outline-offset: 2px; }

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

.mh-container { max-width: var(--mh-container); margin: 0 auto; padding: 0 16px; }
.mh-container--article { max-width: 720px; }

/* Header (position:relative so the reading-progress bar can dock to its bottom edge) */
/* position: sticky already establishes a positioning context for absolutely-positioned children (the progress bar below), so no extra position:relative is needed */
.mh-header { background: var(--mh-bg-secondary); position: sticky; top: 0; z-index: 10; box-shadow: 0 1px 0 rgba(255,255,255,0.05); transition: box-shadow 150ms ease; }
.mh-header--scrolled { box-shadow: 0 4px 12px rgba(0,0,0,0.35); }

/* Reading progress bar: docked to the bottom edge of the sticky header, single post only */
.mh-reading-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: transparent; pointer-events: none; }
.mh-reading-progress__bar { height: 100%; width: 0%; background: var(--mh-accent); transition: width 100ms linear; }
.mh-header__inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.mh-header__logo { color: var(--mh-text-main); font-weight: 700; font-size: 1.1rem; }
.mh-header__nav ul { list-style: none; display: flex; gap: 16px; margin: 0; padding: 0; }
.mh-header__menu-toggle { display: none; background: none; border: 1px solid var(--mh-text-secondary); color: var(--mh-text-main); padding: 8px 12px; border-radius: var(--mh-radius); min-height: 44px; }

@media (max-width: 768px) {
  .mh-header__nav { display: none; }
  .mh-header__nav.is-open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: var(--mh-bg-secondary); padding: 16px; }
  .mh-header__nav.is-open ul { flex-direction: column; }
  .mh-header__menu-toggle { display: inline-block; }
}

/* Footer */
.mh-footer { background: var(--mh-bg-secondary); margin-top: 48px; padding: 24px 16px; color: var(--mh-text-secondary); }
.mh-footer__inner { max-width: 1080px; margin: 0 auto; }

/* Breadcrumb */
.mh-breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 16px 0 8px; font-size: 0.85rem; color: var(--mh-text-secondary); }
.mh-breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 4px; }

/* Card UI (Archive grid) */
.mh-archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding: 24px 0; }
.mh-card { background: var(--mh-bg-secondary); border-radius: var(--mh-radius); overflow: hidden; transition: transform 150ms ease, box-shadow 150ms ease; }
.mh-card:hover, .mh-card:focus-within { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.35); }
.mh-card__link { color: var(--mh-text-main); display: block; }
.mh-card__link:hover { text-decoration: none; }
.mh-card__thumb img { aspect-ratio: 16/9; object-fit: cover; opacity: 0; transition: opacity 200ms ease; }
.mh-card__thumb img.mh-is-loaded, .mh-card__thumb img[data-mh-skip-fade] { opacity: 1; }
.mh-card__body { padding: 16px; }
.mh-card__title { font-size: 1.05rem; margin: 8px 0; }
.mh-card__date { color: var(--mh-text-secondary); font-size: 0.8rem; }

.mh-category-badge {
  display: inline-block; background: var(--mh-accent); color: #0B1220; font-weight: 700;
  font-size: 0.75rem; padding: 4px 10px; border-radius: 999px; margin-bottom: 8px;
}

/* Article */
.mh-article__title { font-size: 1.75rem; line-height: 1.4; margin: 8px 0; }
.mh-article__lead { color: var(--mh-text-secondary); font-size: 1.05rem; }
.mh-article__meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--mh-text-secondary); font-size: 0.85rem; margin: 8px 0 16px; }
.mh-article__eyecatch { border-radius: var(--mh-radius); overflow: hidden; margin-bottom: 16px; }
.mh-article__body { font-size: 1.05rem; }
.mh-article__body h2 { font-size: 1.4rem; margin-top: 2.2em; border-left: 4px solid var(--mh-accent); padding-left: 12px; scroll-margin-top: 88px; }
.mh-article__body h3 { font-size: 1.15rem; margin-top: 1.8em; scroll-margin-top: 88px; }
.mh-article__body table { width: 100%; border-collapse: collapse; }

/* align-wide/full breakout: 記事本文コンテナが中央寄せであることを前提にした標準的な手法 */
.mh-article__body .alignwide { width: min(1040px, 100vw); position: relative; left: 50%; margin-left: min(-520px, -50vw); }
.mh-article__body .alignfull { width: 100vw; position: relative; left: 50%; margin-left: -50vw; max-width: 100vw; }
.mh-article__body .alignfull img { border-radius: 0; }
.mh-article__body th, .mh-article__body td { border: 1px solid var(--mh-bg-secondary); padding: 8px 12px; text-align: left; }

/* Info boxes: Official / Rumor / Warning / Conclusion / Points */
.mh-box { border-radius: var(--mh-radius); padding: 16px 20px; margin: 24px 0; background: var(--mh-bg-secondary); border-left: 4px solid var(--mh-accent); }
.mh-box__label { font-weight: 700; margin: 0 0 8px; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em; }
.mh-box--conclusion { border-left-color: var(--mh-accent); }
.mh-box--points { border-left-color: var(--mh-accent); }
.mh-box--official { border-left-color: var(--mh-official); }
.mh-box--official .mh-box__label { color: var(--mh-official); }
.mh-box--official .mh-box__label::before { content: "\2713  "; }
.mh-box--rumor { border-left-color: var(--mh-rumor); }
.mh-box--rumor .mh-box__label { color: var(--mh-rumor); }
.mh-box--rumor .mh-box__label::before { content: "?  "; }
.mh-box--warning { border-left-color: var(--mh-warning); }
.mh-box--warning .mh-box__label { color: var(--mh-warning); }
.mh-box--warning .mh-box__label::before { content: "\26A0  "; }
.mh-box--merit { border-left-color: var(--mh-official); }
.mh-box--demerit { border-left-color: var(--mh-warning); }
.mh-box--recommend { border-left-color: var(--mh-official); }
.mh-box--not-recommend { border-left-color: var(--mh-text-secondary); }

/* TOC */
.mh-toc { background: var(--mh-bg-secondary); border-radius: var(--mh-radius); padding: 16px 20px; margin: 24px 0; }
.mh-toc__title { font-weight: 700; margin: 0 0 8px; }
.mh-toc ol { margin: 0; padding-left: 1.2em; }
.mh-toc__item--h3 { list-style: none; margin-left: 1em; }

/* FAQ */
.mh-faq { margin: 16px 0; border-bottom: 1px solid var(--mh-bg-secondary); padding-bottom: 12px; }
.mh-faq__question { font-weight: 700; }

/* CTA */
.mh-cta .wp-block-button__link { background: var(--mh-accent); color: #0B1220; font-weight: 700; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 24px; transition: transform 150ms ease, box-shadow 150ms ease; }
.mh-cta .wp-block-button__link:hover, .mh-cta .wp-block-button__link:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(56,189,248,0.35); }

/* Author box / related / revision history */
.mh-author-box { display: flex; gap: 12px; align-items: center; background: var(--mh-bg-secondary); border-radius: var(--mh-radius); padding: 16px; margin: 24px 0; }
.mh-author-box img { border-radius: 50%; }
.mh-related-posts { margin: 24px 0; }
.mh-related-posts ul { list-style: none; padding: 0; }
.mh-related-posts li { padding: 10px 0; border-bottom: 1px solid var(--mh-bg-secondary); }
.mh-revision-history { color: var(--mh-text-secondary); font-size: 0.85rem; margin: 16px 0; }

.mh-button { display: inline-block; background: var(--mh-accent); color: #0B1220; padding: 12px 24px; border-radius: 999px; font-weight: 700; min-height: 44px; transition: transform 150ms ease, box-shadow 150ms ease; }
.mh-button:hover, .mh-button:focus-visible { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(56,189,248,0.35); }

@media (max-width: 480px) {
  .mh-article__title { font-size: 1.4rem; }
}
