/* ハングルマッチ 記事サイト共通（サブドメイン + 本ドメインの /column /dictionary /grammar /legal） */
:root {
  --hm-accent: #329eff;
  --hm-accent-soft: rgba(50, 158, 255, 0.12);
  --hm-ink: #1b2430;
  --hm-muted: #6b7280;
  --hm-bg: #f6f9fc;
  --hm-line: #e5e9ef;
  --hm-radius: 14px;
  --hm-font: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, -apple-system, sans-serif;
}

/* ---------- サブドメインのページ全体 ---------- */
body.hm-site {
  margin: 0;
  font-family: var(--hm-font);
  color: var(--hm-ink);
  background: #fff;
  line-height: 1.8;
  -webkit-text-size-adjust: 100%;
}
.hm-site a { color: var(--hm-accent); }
.hm-site img { max-width: 100%; height: auto; }
.hm-site-wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.hm-site-header { background: #fff; border-bottom: 1px solid var(--hm-line); position: sticky; top: 0; z-index: 20; }
.hm-site-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.hm-site-brand { display: flex; flex-direction: column; text-decoration: none; color: var(--hm-ink); line-height: 1.2; }
.hm-site-brand-name { font-weight: 800; font-size: 18px; }
.hm-site-brand-tag { font-size: 11px; color: var(--hm-muted); margin-top: 2px; }
.hm-site-nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hm-site-nav a { font-size: 13px; font-weight: 600; text-decoration: none; color: var(--hm-ink); padding: 6px 10px; border-radius: 999px; background: var(--hm-bg); white-space: nowrap; }
.hm-site-nav a:hover { background: var(--hm-accent-soft); color: var(--hm-accent); }

.hm-site-main { min-height: 60vh; padding-bottom: 48px; }

.hm-site-footer { background: var(--hm-bg); border-top: 1px solid var(--hm-line); padding: 36px 0 24px; margin-top: 48px; font-size: 14px; }
.hm-site-footer h3 { font-size: 14px; margin: 0 0 8px; }
.hm-site-footer p { margin: 0; color: var(--hm-muted); font-size: 13px; }
.hm-site-footer ul { list-style: none; margin: 0; padding: 0; }
.hm-site-footer li { margin: 4px 0; }
.hm-site-footer a { color: var(--hm-ink); text-decoration: none; }
.hm-site-footer a:hover { color: var(--hm-accent); }
.hm-site-footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.hm-site-copy { margin-top: 24px !important; text-align: center; font-size: 12px; }
@media (max-width: 720px) { .hm-site-footer-cols { grid-template-columns: 1fr; } }

/* ---------- ヒーロー・一覧 ---------- */
.hm-hero { background: linear-gradient(180deg, var(--hm-accent-soft), #fff); padding: 32px 0 20px; }
.hm-hero-title { font-size: 26px; margin: 0 0 8px; font-weight: 800; line-height: 1.4; }
.hm-hero-lead { margin: 0; color: var(--hm-muted); font-size: 14px; max-width: 760px; }
.hm-hero-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hm-hero-cats a { font-size: 13px; font-weight: 600; text-decoration: none; color: var(--hm-ink); background: #fff; border: 1px solid var(--hm-line); border-radius: 999px; padding: 6px 12px; }
.hm-hero-cats a span { color: var(--hm-muted); font-weight: 500; margin-left: 4px; font-size: 12px; }
.hm-hero-cats a:hover { border-color: var(--hm-accent); color: var(--hm-accent); }

.hm-section { margin-top: 32px; }
.hm-section-title { font-size: 18px; font-weight: 800; margin: 0 0 14px; padding-left: 12px; border-left: 4px solid var(--hm-accent); line-height: 1.4; }
.hm-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .hm-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .hm-cards { grid-template-columns: 1fr; } }

.hm-card { display: flex; flex-direction: column; text-decoration: none; color: var(--hm-ink); background: #fff; border: 1px solid var(--hm-line); border-radius: var(--hm-radius); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.hm-card:hover { box-shadow: 0 8px 24px rgba(27, 36, 48, 0.08); transform: translateY(-2px); }
.hm-card-thumb { aspect-ratio: 16 / 9; background: var(--hm-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hm-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hm-card-thumb-empty { font-size: 32px; font-weight: 800; color: var(--hm-accent); opacity: .5; }
.hm-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.hm-card-cat { font-size: 11px; font-weight: 700; color: var(--hm-accent); }
.hm-card-title { font-size: 15px; font-weight: 700; line-height: 1.5; }
.hm-card-date { font-size: 12px; color: var(--hm-muted); }
.hm-empty { text-align: center; color: var(--hm-muted); padding: 48px 0; }

/* ---------- 記事 ---------- */
.hm-article-wrap { max-width: 800px; padding-top: 20px; }
.hm-crumb { font-size: 12px; color: var(--hm-muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.hm-crumb a { color: var(--hm-muted); text-decoration: none; }
.hm-crumb a:hover { color: var(--hm-accent); }
.hm-article-head { margin-bottom: 20px; }
.hm-article-cat { display: inline-block; font-size: 12px; font-weight: 700; color: var(--hm-accent); background: var(--hm-accent-soft); padding: 2px 10px; border-radius: 999px; margin-bottom: 8px; }
.hm-article-h1 { font-size: 26px; line-height: 1.45; margin: 0 0 10px; font-weight: 800; }
.hm-article-meta { font-size: 13px; color: var(--hm-muted); display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.hm-article-eyecatch { margin: 0 0 24px; }
.hm-article-eyecatch img { width: 100%; border-radius: var(--hm-radius); }

.hm-toc { background: var(--hm-bg); border-radius: var(--hm-radius); padding: 16px 20px; margin: 0 0 28px; font-size: 14px; }
.hm-toc-title { font-weight: 800; margin: 0 0 8px; }
.hm-toc ol { margin: 0; padding-left: 20px; }
.hm-toc li { margin: 4px 0; }
.hm-toc li.hm-toc-l3 { margin-left: 16px; font-size: 13px; }
.hm-toc a { color: var(--hm-ink); text-decoration: none; }
.hm-toc a:hover { color: var(--hm-accent); }

/* WordPress から来た本文HTMLの見た目を整える */
.hm-article-body { font-size: 16px; line-height: 1.95; word-break: break-word; }
.hm-article-body > *:first-child { margin-top: 0; }
.hm-article-body p { margin: 0 0 1.4em; }
.hm-article-body h2 { font-size: 21px; line-height: 1.5; margin: 2.2em 0 1em; padding: 10px 14px; border-left: 5px solid var(--hm-accent); background: var(--hm-bg); border-radius: 0 8px 8px 0; font-weight: 800; }
.hm-article-body h3 { font-size: 18px; line-height: 1.5; margin: 1.8em 0 .8em; padding-bottom: 6px; border-bottom: 2px solid var(--hm-accent-soft); font-weight: 800; }
.hm-article-body h4 { font-size: 16px; margin: 1.5em 0 .6em; font-weight: 800; }
.hm-article-body img { display: block; max-width: 100%; height: auto; margin: 12px auto; border-radius: 10px; }
.hm-article-body figure { margin: 16px 0; }
.hm-article-body figcaption { font-size: 12px; color: var(--hm-muted); text-align: center; }
.hm-article-body ul, .hm-article-body ol { padding-left: 1.6em; margin: 0 0 1.4em; }
.hm-article-body li { margin: .3em 0; }
.hm-article-body blockquote { margin: 1.4em 0; padding: 12px 18px; border-left: 4px solid var(--hm-line); background: var(--hm-bg); color: #333; border-radius: 0 8px 8px 0; }
.hm-article-body table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 14px; display: block; overflow-x: auto; }
.hm-article-body th, .hm-article-body td { border: 1px solid var(--hm-line); padding: 8px 10px; vertical-align: top; }
.hm-article-body th { background: var(--hm-bg); font-weight: 700; white-space: nowrap; }
.hm-article-body a { text-decoration: underline; text-underline-offset: 2px; }
.hm-article-body iframe { max-width: 100%; }
.hm-article-body hr { border: 0; border-top: 1px solid var(--hm-line); margin: 2em 0; }
.hm-article-body strong { font-weight: 800; }
.hm-article-body .wp-block-image { margin: 16px 0; }
.hm-article-body .wp-block-table table { display: table; }
.hm-article-body .wp-block-buttons, .hm-article-body .swell-block-button { margin: 1.2em 0; text-align: center; }
.hm-article-body .wp-block-button__link, .hm-article-body .swell-block-button__link {
  display: inline-block; background: var(--hm-accent); color: #fff !important; text-decoration: none !important;
  font-weight: 800; padding: 12px 28px; border-radius: 999px; box-shadow: 0 6px 16px rgba(50, 158, 255, .25);
}
.hm-article-body .p-blogCard, .hm-article-body .swell-block-postLink { margin: 1.4em 0; }
.hm-article-body .p-blogCard a { display: block; border: 1px solid var(--hm-line); border-radius: 10px; padding: 12px 14px; text-decoration: none; color: var(--hm-ink); }
.hm-article-body .cap_box, .hm-article-body .swell-block-capbox { border: 2px solid var(--hm-accent); border-radius: 10px; margin: 1.4em 0; overflow: hidden; }
.hm-article-body .cap_box_ttl, .hm-article-body .cap_box_ttl span { background: var(--hm-accent); color: #fff; font-weight: 800; padding: 6px 12px; display: block; }
.hm-article-body .cap_box_content { padding: 12px 14px; }
.hm-article-body .swell-block-step { counter-reset: hmstep; }
.hm-article-body .c-balloon { display: flex; gap: 12px; align-items: flex-start; margin: 1.2em 0; }
.hm-article-body .c-balloon__icon img { width: 56px; height: 56px; border-radius: 50%; margin: 0; }
.hm-article-body .c-balloon__text { background: var(--hm-bg); border-radius: 12px; padding: 10px 14px; }
.hm-article-body .is-style-big_icon_good, .hm-article-body .is-style-big_icon_bad, .hm-article-body .is-style-big_icon_info, .hm-article-body .is-style-big_icon_point,
.hm-article-body .is-style-note_box, .hm-article-body .is-style-alert_box, .hm-article-body .is-style-stitch, .hm-article-body .is-style-dent_box, .hm-article-body .is-style-border_dashed, .hm-article-body .is-style-border_solid {
  border: 1px solid var(--hm-line); background: var(--hm-bg); border-radius: 10px; padding: 14px 16px; margin: 1.4em 0;
}
.hm-article-body .is-style-alert_box, .hm-article-body .is-style-big_icon_bad { border-color: #f3b4b4; background: #fff5f5; }
.hm-article-body .is-style-big_icon_good { border-color: #b7e0c8; background: #f2fbf5; }

.hm-author { display: flex; gap: 14px; align-items: flex-start; background: var(--hm-bg); border-radius: var(--hm-radius); padding: 16px 18px; margin: 40px 0 0; }
.hm-author-avatar { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; background: var(--hm-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 22px; }
.hm-author-body p { margin: 0; }
.hm-author-label { font-size: 11px; color: var(--hm-muted); }
.hm-author-name { font-weight: 800; font-size: 15px; }
.hm-author-bio { font-size: 13px; color: #333; margin-top: 4px !important; }
.hm-author-links { margin-top: 8px !important; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.hm-author-links a { font-weight: 700; text-decoration: none; }

.hm-related { margin-top: 40px; }
.hm-related-title { font-size: 18px; font-weight: 800; margin: 0 0 14px; padding-left: 12px; border-left: 4px solid var(--hm-accent); }

/* 本ドメイン（layouts.app）内で使うときの余白調整 */
.hm-site-main-section { font-family: var(--hm-font); }
.hm-site-main-section .hm-hero { margin-top: 0; }
.hm-site-main-section .hm-article-wrap { padding-bottom: 40px; }

/* ---- WordPress（SWELL）から移転した本文のブログカード・引用カード ---- */
.hm-article-body .p-blogCard { margin: 2em 0 1.6em; cursor: pointer; }
.hm-article-body .p-blogCard__inner { position: relative; display: flex; align-items: center; gap: 14px; border: 1px solid var(--hm-line); border-radius: 10px; padding: 18px 14px 12px; background: #fff; }
.hm-article-body .p-blogCard__caption { position: absolute; top: -11px; left: 12px; font-size: 11px; font-weight: 700; line-height: 1; color: #fff; background: var(--hm-accent); padding: 5px 10px; border-radius: 4px; }
.hm-article-body .p-blogCard__thumb { flex: 0 0 120px; width: 120px; }
.hm-article-body .p-blogCard__thumb figure { margin: 0; }
.hm-article-body .p-blogCard__thumb img { width: 120px; height: 80px; object-fit: cover; margin: 0; border-radius: 6px; display: block; }
.hm-article-body .p-blogCard__body { min-width: 0; flex: 1 1 auto; }
.hm-article-body .p-blogCard a, .hm-article-body .p-blogCard__title { display: block; font-weight: 800; font-size: 15px; line-height: 1.5; color: var(--hm-ink); text-decoration: none; border: 0; padding: 0; border-radius: 0; background: none; }
.hm-article-body .p-blogCard__excerpt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; line-height: 1.6; color: var(--hm-muted); margin-top: 4px; }
.hm-article-body .p-blogCard__meta { display: none; }
.hm-article-body blockquote.wp-embedded-content { margin: 1.4em 0; }
@media (max-width: 560px) {
  .hm-article-body .p-blogCard__thumb { flex-basis: 88px; width: 88px; }
  .hm-article-body .p-blogCard__thumb img { width: 88px; height: 60px; }
  .hm-article-body .p-blogCard__excerpt { display: none; }
}

/* ---- 固定フッターバナー（config/sites.php の footer_banner） ---- */
.hm-footer-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: center; align-items: center; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--hm-line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); padding: 6px 44px 6px 10px; }
.hm-footer-banner a { display: block; line-height: 0; }
.hm-footer-banner img { max-width: 100%; max-height: 70px; width: auto; height: auto; }
.hm-footer-banner-close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--hm-line); background: #fff; color: var(--hm-muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
.hm-has-footer-banner { padding-bottom: 88px; }
.hm-site-pr { margin: 18px 0 0; font-size: 12px; color: var(--hm-muted); }
