/* =========================================================
   mpworks 共通スタイル
   1. 基本  2. ヘッダー・フッター  3. レイアウト・一覧  4. サイドバー
   5. 記事ページ  6. 記事の本文  7. 旧記事の本文（WordPress のブロック）  8. そのほかのページ
   9. 上へ戻るボタン  10. スマホ向けの調整
   ========================================================= */

/* ---------- 1. 基本 ---------- */
:root {
  --navy: #14213d;
  --navy-2: #1f3363;
  --gold: #f4b400;
  --red: #e63946;
  --blue: #2563eb;
  --ink: #1d2433;
  --muted: #5d6679;
  --line: #e2e6ee;
  --bg: #f4f6fa;
  --surface: #fff;
  --soft: #eef2f9;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(20 33 61 / 6%), 0 4px 14px rgb(20 33 61 / 6%);
  --font-body: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', Meiryo, system-ui, sans-serif;
  --font-head: 'Zen Kaku Gothic New', var(--font-body);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 16px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

img,
video,
iframe {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--blue);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--red);
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.container {
  width: min(100% - 32px, 1160px);
  margin-inline: auto;
}

/* 見出しは文節の切れ目で改行する（対応していないブラウザでは通常どおり折り返す） */
h1,
h2,
h3,
.post-card-title,
.link-card-title,
.post-pager a {
  word-break: auto-phrase;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  border-radius: 6px;
}

.skip-link:focus {
  top: 8px;
}

.count {
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1.6;
}

.btn {
  display: inline-block;
  padding: 10px 22px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.btn:hover {
  background: var(--navy-2);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.4;
}

.section-title::before {
  content: '';
  width: 6px;
  height: 1.1em;
  border-radius: 3px;
  background: linear-gradient(var(--red) 50%, var(--gold) 50%);
}

/* ---------- 2. ヘッダー・フッター ---------- */
.site-header {
  background: var(--navy);
  color: #fff;
}

.header-inner {
  padding: 18px 0 14px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.logo:hover {
  color: inherit;
}

.logo-text {
  display: grid;
  line-height: 1.3;
}

.logo-name {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.logo-tagline {
  color: #c7cfdf;
  font-size: 0.78rem;
}

.global-nav {
  border-top: 1px solid rgb(255 255 255 / 10%);
  background: var(--navy-2);
}

.global-nav ul {
  display: flex;
  gap: 4px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.global-nav a {
  display: block;
  padding: 11px 14px;
  color: #e7ecf5;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
}

.global-nav a:hover {
  color: #fff;
  background: rgb(255 255 255 / 6%);
}

.global-nav a[aria-current] {
  color: #fff;
  border-bottom-color: var(--gold);
}

.site-footer {
  margin-top: 56px;
  background: var(--navy);
  color: #c7cfdf;
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 32px;
  padding: 40px 0 28px;
}

.footer-brand p {
  margin: 10px 0 0;
}

.footer-brand .logo-name {
  color: #fff;
  font-size: 1.3rem;
}

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

.footer-group-title {
  margin: 0 0 6px;
  color: var(--gold);
  font-weight: 700;
}

.footer-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-group a {
  color: #e7ecf5;
  text-decoration: none;
}

.footer-group a:hover {
  color: #fff;
  text-decoration: underline;
}

.copyright {
  margin: 0;
  padding: 14px 16px;
  border-top: 1px solid rgb(255 255 255 / 10%);
  text-align: center;
  font-size: 0.8rem;
}

/* ---------- 3. レイアウト・一覧 ---------- */
.layout {
  display: grid;
  gap: 32px;
  margin-top: 24px;
}

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

@media (min-width: 1000px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

.hero {
  padding: 28px 0 30px;
  background:
    radial-gradient(circle at 90% -40%, rgb(244 180 0 / 22%), transparent 55%),
    linear-gradient(180deg, var(--navy-2), var(--navy));
  color: #fff;
}

.hero-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 900;
  line-height: 1.4;
}

.hero-text {
  margin: 6px 0 16px;
  color: #c7cfdf;
}

.hero-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-categories a,
.subcategories a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgb(255 255 255 / 10%);
  border: 1px solid rgb(255 255 255 / 18%);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.hero-categories a:hover {
  background: rgb(255 255 255 / 18%);
}

.hero-categories .count {
  background: var(--gold);
  color: var(--navy);
}

.list-header {
  margin-bottom: 20px;
}

.list-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 900;
  line-height: 1.35;
}

.list-page {
  margin-left: 12px;
  color: var(--muted);
  font-size: 0.55em;
  font-weight: 700;
}

.list-lead {
  margin: 8px 0 0;
  color: var(--muted);
}

.subcategories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.subcategories a {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.subcategories a:hover {
  border-color: var(--navy);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.post-card {
  min-width: 0;
}

.post-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.post-card-link:hover {
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgb(20 33 61 / 8%), 0 10px 24px rgb(20 33 61 / 12%);
}

.post-card-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--soft);
}

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

.post-card-noimage {
  display: grid;
  place-items: center;
  height: 100%;
  background: linear-gradient(135deg, var(--navy-2), var(--navy));
  color: var(--gold);
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 1.2rem;
}

.post-card-body {
  display: grid;
  gap: 6px;
  padding: 12px 14px 16px;
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.post-card-category {
  padding: 0 8px;
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}

.post-card-title {
  font-weight: 700;
  line-height: 1.55;
}

.post-card-link:hover .post-card-title {
  color: var(--blue);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.pagination ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pagination a,
.pagination span[aria-current] {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.pagination a:hover {
  border-color: var(--navy);
}

.pagination span[aria-current] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.pagination-gap {
  align-self: center;
  color: var(--muted);
}

.breadcrumbs {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.8rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  content: '›';
  margin: 0 8px;
}

.breadcrumbs a {
  color: var(--muted);
}

/* ---------- 4. サイドバー・広告 ---------- */
.sidebar {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.widget {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.widget p {
  margin: 0 0 8px;
}

.widget-title {
  margin: -18px -20px 14px;
  padding: 10px 20px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 900;
}

/* WordPress 時代と同じく、幅の半分の丸い画像を中央に置く */
.widget-profile-image {
  display: block;
  width: 50%;
  margin: 4px auto 14px;
  border: 4px double #999;
  border-radius: 50%;
}

.widget-profile-list {
  margin-top: 1.6em;
}

.widget-categories,
.widget-categories ul,
.widget-recent {
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget-categories a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 4px;
  border-bottom: 1px dashed var(--line);
  color: var(--ink);
  text-decoration: none;
}

.widget-categories a:hover {
  color: var(--blue);
}

.widget-categories > li > a {
  font-weight: 700;
}

.widget-categories ul a {
  padding-left: 18px;
}

.widget-categories ul a::before {
  content: '└';
  margin-right: 6px;
  color: var(--muted);
}

.widget-categories ul a {
  justify-content: flex-start;
}

.widget-categories ul .count {
  margin-left: auto;
}

.widget-recent li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}

.widget-recent a {
  display: block;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}

.widget-recent a:hover {
  color: var(--blue);
}

.widget-recent time {
  color: var(--muted);
  font-size: 0.78rem;
}

.ad {
  min-width: 0;
  margin: 28px 0;
  text-align: center;
}

.sidebar .ad {
  margin: 0;
}

.ad-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.ad-placeholder {
  display: grid;
  place-items: center;
  min-height: 250px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.85rem;
}

/* ---------- 5. 記事ページ ---------- */
.post {
  padding: 24px clamp(16px, 4vw, 40px) 32px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.post-header {
  margin-bottom: 20px;
}

.post-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.post-categories a {
  display: inline-block;
  padding: 1px 10px;
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.post-categories a:hover {
  background: var(--red);
}

.post-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: clamp(1.45rem, 4.5vw, 2rem);
  font-weight: 900;
  line-height: 1.45;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.toc {
  margin: 0 0 32px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfd;
  font-size: 0.92rem;
}

.toc-title {
  cursor: pointer;
  font-family: var(--font-head);
  font-weight: 900;
}

.toc ol {
  margin: 8px 0 0;
  padding-left: 1.5em;
}

.toc ol ol {
  margin: 2px 0 6px;
  font-size: 0.95em;
  list-style: disc;
}

.toc a {
  color: var(--ink);
  text-decoration: none;
}

.toc a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.post-footer {
  display: grid;
  gap: 28px;
  margin-top: 8px;
}

.share-title,
.author-box-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.share ul {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.share a {
  display: block;
  padding: 9px 4px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .share a {
    font-size: 0.75rem;
  }
}

.share a:hover {
  color: #fff;
  opacity: 0.85;
}

.share-x { background: #111; }
.share-facebook { background: #1877f2; }
.share-hatena { background: #00a4de; }
.share-line { background: #06c755; }

.author-box {
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--soft);
  font-size: 0.92rem;
}

.author-box-inner {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.author-box-image {
  flex: none;
  width: 96px;
}

.author-box-image img {
  display: block;
  width: 100%;
  border: 4px double #999;
  border-radius: 50%;
}

.author-box-text p {
  margin: 0 0 6px;
}

.author-box-more {
  margin: 4px 0 0 !important;
  font-size: 0.85rem;
  text-align: right;
}

@media (max-width: 480px) {
  .author-box-inner {
    flex-direction: column;
    align-items: center;
  }
}

.post-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.post-pager a {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}

.post-pager a:hover {
  border-color: var(--navy);
  color: var(--blue);
}

.post-pager-next {
  text-align: right;
}

.post-pager-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.post-pager-prev .post-pager-label::before { content: '← '; }
.post-pager-next .post-pager-label::after { content: ' →'; }

.related .post-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.lightbox {
  max-width: min(96vw, 1200px);
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgb(10 15 30 / 86%);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  margin: auto;
  border-radius: 6px;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--navy);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.zoomable {
  cursor: zoom-in;
}

/* ---------- 6. 記事の本文 ---------- */
.post-body {
  line-height: 1.9;
}

.post-body > :first-child {
  margin-top: 0;
}

.post-body p {
  margin: 0 0 1.4em;
}

.post-body h2 {
  margin: 2.6em 0 1em;
  padding: 12px 16px;
  border-left: 6px solid var(--red);
  border-radius: 4px;
  background: var(--navy);
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1.5;
}

.post-body h3 {
  margin: 2.2em 0 0.9em;
  padding: 0 0 6px 12px;
  border-left: 4px solid var(--gold);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.5;
}

.post-body h4 {
  margin: 1.8em 0 0.6em;
  font-size: 1.05rem;
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.4em;
  padding-left: 1.6em;
}

.post-body li {
  margin: 0.25em 0;
}

.post-body figure {
  margin: 0 0 1.6em;
}

.post-body img {
  border-radius: 4px;
}

.post-body figcaption,
.post-body .wp-element-caption {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85em;
  text-align: center;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.6;
}

.post-body th,
.post-body td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.post-body th,
.post-body thead td {
  background: var(--soft);
  font-weight: 700;
}

.post-body tbody tr:nth-child(even) td {
  background: #fafbfd;
}

.post-body .wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.post-body blockquote {
  margin: 0 0 1.4em;
  padding: 12px 18px;
  border-left: 4px solid var(--line);
  background: #fafbfd;
  color: var(--muted);
}

.post-body hr {
  margin: 2.4em auto;
  border: 0;
  border-top: 1px solid var(--line);
}

.post-body iframe {
  border: 0;
}

.post-note {
  color: var(--muted);
  font-size: 0.85rem;
  text-align: right;
}

/* サイト内の記事へのリンクカード（旧記事のブログカードと LinkCard 部品） */
.link-card {
  display: flex;
  gap: 14px;
  align-items: center;
  margin: 0 0 1.4em;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s;
}

.link-card:hover {
  border-color: var(--navy);
  color: var(--ink);
}

.link-card img,
.link-card-noimage {
  flex: none;
  width: 160px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: var(--soft);
}

.link-card-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.link-card-title {
  font-weight: 700;
  line-height: 1.5;
}

.link-card:hover .link-card-title {
  color: var(--blue);
}

.link-card-desc {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 0.82em;
  line-height: 1.6;
}

.link-card-plain {
  display: block;
}

@media (max-width: 560px) {
  .link-card img,
  .link-card-noimage {
    width: 104px;
  }

  .link-card-desc {
    display: none;
  }
}

/* ---------- 7. 旧記事の本文（WordPress のブロックと旧テーマの部品） ---------- */
.post-body .has-text-align-center { text-align: center; }
.post-body .has-text-align-right { text-align: right; }
.post-body .has-text-align-left { text-align: left; }
.post-body .aligncenter { margin-inline: auto; text-align: center; }
.post-body .aligncenter > img,
.post-body .aligncenter > a > img { margin-inline: auto; }
.post-body .wp-block-image img { display: inline-block; }
.post-body .wp-block-image.is-resized img { width: auto; }
.post-body .has-10-px-font-size { font-size: 10px; }
.post-body .has-12-px-font-size { font-size: 12px; }
.post-body .has-14-px-font-size { font-size: 14px; }
.post-body .has-small-font-size { font-size: 13px; }
.post-body .has-black-color { color: #000; }
.post-body .has-red-color { color: #e60012; }
.post-body .has-white-background-color { background-color: #fff; }

.post-body h2.has-background {
  border-left-color: var(--red);
  background: var(--navy) !important;
  color: #fff !important;
}

.post-body table.has-fixed-layout {
  table-layout: fixed;
}

.post-body .wp-block-separator {
  width: 100%;
}

.post-body .wp-block-columns {
  display: flex;
  gap: 16px;
  margin-bottom: 1.4em;
}

.post-body .wp-block-column {
  flex: 1;
  min-width: 0;
}

@media (max-width: 600px) {
  .post-body .wp-block-columns:not(.is-not-stacked-on-mobile) {
    flex-direction: column;
  }
}

.post-body .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 1.4em;
}

.post-body .wp-block-button__link {
  display: inline-block;
  padding: 10px 24px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.post-body .wp-block-button__link:hover {
  background: #c62f3b;
  color: #fff;
}

.post-body .wp-block-embed__wrapper {
  position: relative;
  aspect-ratio: 16 / 9;
}

.post-body .wp-block-embed__wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* 吹き出し（Luxeritas Blocks の balloon） */
.post-body .wp-block-luxe-blocks-balloon {
  align-items: flex-start;
  gap: 0;
}

.post-body .wp-block-luxe-blocks-balloon > figure {
  flex: none;
  margin: 0;
}

.post-body .wp-block-luxe-blocks-balloon > figure img {
  display: block;
  width: 100%;
  border: 2px solid var(--line);
}

.post-body .luxe-bl-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  margin: 6px 0 0 18px;
}

.post-body [style*='row-reverse'] > .luxe-bl-wrap {
  margin: 6px 18px 0 0;
}

.post-body .luxe-bl-lmain,
.post-body .luxe-bl-rmain {
  position: relative;
  background: #fff;
}

.post-body .luxe-bl-lmain p,
.post-body .luxe-bl-rmain p {
  margin: 0.7em 0;
}

.post-body .luxe-bl-lbf,
.post-body .luxe-bl-rbf,
.post-body .luxe-bl-laf,
.post-body .luxe-bl-raf {
  position: absolute;
  z-index: 1;
  width: 0;
  height: 0;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}

.post-body .luxe-bl-lbf,
.post-body .luxe-bl-rbf {
  top: 16px;
  border-top-width: 10px;
  border-bottom-width: 10px;
}

.post-body .luxe-bl-lbf { left: -15px; }
.post-body .luxe-bl-rbf { right: -15px; }
.post-body .luxe-bl-laf { top: 16px; transform: translateX(2px); }
.post-body .luxe-bl-raf { top: 16px; transform: translateX(-2px); }

/* 囲み枠（Luxeritas Blocks の topic） */
.post-body .wp-block-luxe-blocks-topic-title {
  border-radius: 6px 6px 0 0;
  font-weight: 700;
  gap: 6px;
}

.post-body .wp-block-luxe-blocks-topic-icon {
  display: inline-flex;
}

.post-body .wp-block-luxe-blocks-topic-icon svg {
  fill: currentColor;
}

.post-body .wp-block-luxe-blocks-topic-content {
  border-radius: 0 6px 6px 6px;
}

.post-body .wp-block-luxe-blocks-topic-content > :last-child {
  margin-bottom: 1em;
}

.post-body .wp-block-luxe-blocks-topic-content > :first-child {
  margin-top: 1em;
}

/* スマスロSAO の実戦履歴の表（WordPress の追加 CSS から移したもの） */
.post-body .slotHistoryTable {
  display: block;
  padding: 0 20px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #eee;
  font-size: 12px;
}

.post-body .slotHistoryTable tr,
.post-body .slotHistoryTable tfoot,
.post-body .slotHistoryTable tbody,
.post-body .slotHistoryTable thead {
  display: block;
}

.post-body .slotHistoryTable thead {
  display: none;
}

.post-body .slotHistoryTable tbody tr {
  display: block;
  position: relative;
  padding: 4px 0;
}

.post-body .slotHistoryTable tbody tr td {
  background: transparent;
}

.post-body .slotHistoryTable tbody tr::after {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 58px;
  width: 1px;
  height: 100%;
  background: #000;
}

.post-body .saoChance,
.post-body .saoBonus {
  --c: #e73b77;
  --x-gradient: linear-gradient(90deg, var(--c) 0 25px, transparent 0 calc(100% - 25px), var(--c) calc(100% - 25px));
  --y-gradient: linear-gradient(var(--c) 0 25px, transparent 0 calc(100% - 25px), var(--c) calc(100% - 25px));
  margin: 0.5rem;
  padding: 1rem 0 !important;
  outline: 1px solid var(--c);
  outline-offset: -5px;
  background: rgb(231 59 119 / 15%);
  background-image: var(--x-gradient), var(--y-gradient), var(--x-gradient), var(--y-gradient);
  background-repeat: no-repeat;
  background-size: 100% 3px, 3px 100%, 100% 3px, 3px 100%;
  background-position: top, right, bottom, left;
}

.post-body .saoBonus {
  --c: #2a83c2;
  background-color: rgb(42 131 194 / 15%);
}

.post-body .slotHistoryTable tbody tr.saoChance::before,
.post-body .slotHistoryTable tbody tr.saoBonus::before {
  content: '';
  display: block;
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: calc(100% - 24px);
  height: 0;
  border-top: 4px solid var(--c);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  background: transparent;
  transform: translateX(-50%);
}

.post-body .slotHistoryTable tbody tr.saoChance::after,
.post-body .slotHistoryTable tbody tr.saoBonus::after {
  top: 2px;
  left: 50%;
  width: calc(100% - 24px);
  height: 0;
  border-bottom: 4px solid var(--c);
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  background: transparent;
  transform: translateX(-50%);
}

.post-body .slotHistoryTable tbody th,
.post-body .slotHistoryTable tbody td {
  display: block;
  padding: 0;
  border: none;
  line-height: 1.6;
}

.post-body .slotHistoryTable tbody td > img {
  display: block;
  max-width: calc(100% - 8px);
  height: auto;
  margin: 8px 4px;
}

.post-body .slotHistoryTable tbody td > br:not([class]) {
  display: none;
}

.post-body .slotHistoryTable tbody td:nth-child(1) {
  display: inline-block;
  width: 58px;
  margin: 0 4px 0 0;
  padding: 0 4px;
  font-size: 14px;
  font-weight: bold;
  text-align: right;
}

.post-body .slotHistoryTable tbody td:nth-child(2) {
  display: inline-block;
  padding: 0 4px;
  border-radius: 4px;
  background: #333;
  color: #fff;
}

.post-body .slotHistoryTable tbody td:nth-child(3) {
  margin: 0 0 0 66px;
  padding: 0 16px 0 0;
}

.post-body .slotHistoryTable tbody td:nth-child(4) {
  display: none;
}

.post-body .slotHistoryTable tbody td:nth-child(3):empty {
  display: none;
}

/* ---------- 8. そのほかのページ ---------- */
.notice {
  padding: 14px 18px;
  border-radius: var(--radius);
  background: #fff8e1;
  border: 1px solid #f5d77a;
}

.form-embed iframe {
  display: block;
  width: 100%;
  height: 1200px;
  border: 0;
}

.sitemap-list {
  padding-left: 1.4em;
}

.sitemap-list time {
  color: var(--muted);
  font-size: 0.8em;
}

.post-body h2 a {
  color: inherit;
}

.notfound {
  padding: 48px 0 0;
}

.notfound-code {
  margin: 0;
  color: var(--red);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
}

.notfound .btn {
  margin: 4px 8px 4px 0;
}

.notfound .section-title {
  margin-top: 40px;
}

/* ---------- 9. 上へ戻るボタン ---------- */
.to-top {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 50;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 4px 14px rgb(20 33 61 / 30%);
  color: var(--gold);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  background: var(--navy-2);
}

/* ---------- 10. スマホ向けの調整（幅 640px 以下） ----------
   - 押せる部分は高さ 44px 前後を確保する（Apple HIG の 44pt、Material Design の 48dp を目安）
   - 最初の画面に記事が見えるよう、ヘッダーとトップページの紹介を詰める
   - 記事の一覧は「左に小さな画像、右にタイトル」のリストにして、1 画面に並ぶ件数を増やす
   - 記事ページは枠と二重の余白をなくして本文の幅を広げる（16px で 1 行 21 字前後）
*/
@media (max-width: 640px) {
  .header-inner {
    padding: 10px 0 8px;
  }

  .logo-name {
    font-size: 1.35rem;
  }

  .logo-tagline {
    font-size: 0.7rem;
  }

  /* メニューが横にスクロールできることを、右端のぼかしで示す */
  .global-nav {
    position: relative;
  }

  .global-nav::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(to right, rgb(31 51 99 / 0%), var(--navy-2));
    pointer-events: none;
  }

  .global-nav a {
    padding: 11px 12px;
  }

  .hero {
    padding: 16px 0 14px;
  }

  .hero-title {
    font-size: 1.2rem;
  }

  .hero-text {
    margin: 2px 0 12px;
    font-size: 0.85rem;
    line-height: 1.6;
  }

  /* カテゴリは折り返さず 1 行にして、横にスクロールさせる */
  .hero-categories {
    flex-wrap: nowrap;
    margin-inline: -16px;
    padding-inline: 16px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .hero-categories a,
  .subcategories a {
    min-height: 40px;
    white-space: nowrap;
  }

  .layout {
    gap: 28px;
    margin-top: 16px;
  }

  .section-title {
    font-size: 1.1rem;
  }

  .list-title {
    font-size: 1.4rem;
  }

  .list-lead {
    font-size: 0.9rem;
  }

  /* 記事の一覧：画像を左に小さく置くリスト */
  .post-grid,
  .related .post-grid {
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  .post-card + .post-card {
    border-top: 1px solid var(--line);
  }

  .post-card-link,
  .post-card-link:hover {
    flex-direction: row;
    gap: 12px;
    padding: 12px;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }

  .post-card-link:active {
    background: var(--soft);
  }

  .post-card-thumb {
    flex: none;
    align-self: flex-start;
    width: 120px;
    overflow: hidden;
    border-radius: 6px;
  }

  .post-card-noimage {
    font-size: 0.75rem;
  }

  .post-card-body {
    align-content: start;
    gap: 6px;
    min-width: 0;
    padding: 0;
  }

  /* タイトルを先に読ませ、カテゴリと日付はその下に小さく置く */
  .post-card-title {
    order: -1;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: 0.95rem;
    line-height: 1.5;
  }

  .post-card-meta {
    font-size: 0.72rem;
  }

  .pagination {
    gap: 6px;
  }

  .pagination a,
  .pagination span[aria-current] {
    min-width: 44px;
    height: 44px;
  }

  /* パンくずリストは折り返さず 1 行にする（長い記事タイトルで 2〜3 行に広がるのを防ぐ） */
  .breadcrumbs ol {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  /* 記事ページ：外側の枠をなくして、本文を画面の幅いっぱいに使う */
  .post {
    margin-inline: -16px;
    padding: 18px 16px 28px;
    border-radius: 0;
    box-shadow: none;
  }

  .post-title {
    font-size: 1.35rem;
    line-height: 1.5;
  }

  .post-categories a {
    padding: 5px 12px;
    font-size: 0.8rem;
  }

  .toc {
    margin-bottom: 28px;
    padding: 6px 14px 10px;
  }

  .toc-title {
    padding: 8px 0;
  }

  .toc ol {
    margin-top: 0;
    padding-left: 1.3em;
  }

  .toc a {
    display: block;
    padding: 6px 0;
    line-height: 1.5;
  }

  .post-body {
    line-height: 1.85;
  }

  .post-body p {
    margin-bottom: 1.3em;
  }

  .post-body h2 {
    margin-top: 2.2em;
    padding: 10px 12px;
    font-size: 1.15rem;
  }

  .post-body h3 {
    font-size: 1.05rem;
  }

  .post-body table {
    font-size: 0.85em;
  }

  .post-body th,
  .post-body td {
    padding: 6px 8px;
  }

  .share a {
    padding: 12px 4px;
  }

  /* 前後の記事はタイトルが長いので、縦に並べる */
  .post-pager {
    grid-template-columns: 1fr;
  }

  .post-pager-next {
    text-align: left;
  }

  .widget {
    padding: 16px;
  }

  .widget-title {
    margin: -16px -16px 12px;
    padding: 10px 16px;
  }

  .widget-profile-image {
    width: 120px;
  }

  .widget-categories a {
    padding: 10px 4px;
  }

  .widget-recent li {
    padding: 10px 0;
  }

  .footer-inner {
    gap: 24px;
    padding-top: 32px;
  }

  .footer-group a {
    display: inline-block;
    padding: 6px 0;
  }
}
