/*
Theme Name: Mer-Hack
Theme URI: https://mercari-hack.com/
Description: mercari-hack.com の子テーマ。ヘッダー・フッター・関連記事をElementorに依存せず、gitで管理するために用意した。親テーマ hello-elementor の最小構成を土台にする。
Author: Mer-Hack
Template: hello-elementor
Version: 1.0.0
Text Domain: mercari-hack
*/

:root {
  --mh-ink: #20201f;
  --mh-muted: #68645f;
  --mh-line: #ddd6ca;
  --mh-paper: #fff;
  --mh-soft: #f7f3eb;
  --mh-accent: #ea4f47;
  --mh-wrap: 1080px;
  --mh-font: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", sans-serif;
}

body {
  margin: 0;
  background: var(--mh-paper);
  color: var(--mh-ink);
  font-family: var(--mh-font);
  line-height: 1.9;
}

/* 読み上げ・キーボード操作用。視覚的には隠すがフォーカス時に出す */
.mh-skip {
  position: absolute;
  left: -9999px;
}
.mh-skip:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--mh-ink);
  color: #fff;
}

/* ---------- ヘッダー ----------
   移行前のElementorヘッダーの実測値に合わせている。
   コンテナ最小高74px・背景#FFF、ロゴは左寄せ。高さは移行前の34pxから一段下げて28pxにしている。 */
.mh-site-header {
  background: #fff;
}
/* 移行前は中央寄せの固定幅ではなく、全幅に左右3%のパディングだった。
   幅を絞ると本文よりロゴが内側へずれるので、同じ方式に合わせる。 */
.mh-site-header__inner {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 3%;
  gap: 20px;
}
.mh-site-logo {
  flex: 0 0 auto;
  text-align: start;
}
.mh-site-logo a,
.mh-site-logo img {
  display: block;
}
.mh-site-logo img {
  width: auto;
  height: 28px;
  object-fit: contain;
  object-position: center center;
}
.mh-site-logo--text {
  color: var(--mh-ink);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.mh-nav-toggle {
  display: none;
  padding: 8px 12px;
  border: 1px solid var(--mh-line);
  background: none;
  color: var(--mh-ink);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.mh-nav ul {
  display: flex;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 4px 22px;
  list-style: none;
}
.mh-nav a {
  display: inline-block;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  color: var(--mh-ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}
.mh-nav a:hover,
.mh-nav .current-menu-item > a,
.mh-nav .current-menu-parent > a {
  border-bottom-color: var(--mh-accent);
}

/* パディングと最小高は移行前と同じ3段階。ロゴ高さのみ一段下げてある。区切り幅はElementorの1024/767。 */
@media (max-width: 1024px) {
  .mh-site-header__inner {
    min-height: 85px;
    padding: 0 5%;
  }
  .mh-site-logo img {
    height: 24px;
  }
}

@media (max-width: 767px) {
  .mh-site-header__inner {
    min-height: 39px;
    flex-wrap: wrap;
    padding: 8px 2%;
  }
  .mh-site-logo img {
    height: 18px;
  }
  .mh-nav-toggle {
    display: block;
  }
  .mh-nav {
    display: none;
    width: 100%;
    flex-basis: 100%;
  }
  .mh-nav.is-open {
    display: block;
  }
  .mh-nav ul {
    flex-direction: column;
    gap: 0;
  }
  .mh-nav li + li {
    border-top: 1px solid var(--mh-line);
  }
  .mh-nav a {
    padding: 12px 0;
  }
}

/* ---------- フッター ----------
   移行前のElementorフッターを再現する。上段はナビを左右に振り分け、
   点線（1px dotted #9b9b9b）で区切り、下段にシェアボタンとコピーライト。 */
.mh-site-footer {
  margin-top: 64px;
  background: #f2f2f2;
}
.mh-site-footer__inner {
  padding: 48px 3% 40px;
}

/* 上段：メニュー項目を両端へ寄せる。
   区切りの点線は下段側のborder-topに置いた。メニュー未設定でも線が残り、
   フッターが「アイコンと著作権だけ」の見た目にならないようにするため。 */
.mh-site-footer__nav ul {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  list-style: none;
}
.mh-site-footer__nav a {
  color: #000;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}
.mh-site-footer__nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
/* 2項目のときは左右に振り分き、3項目以上でも均等に散る */
.mh-site-footer__nav li:last-child a {
  color: #54595f;
  font-size: 13px;
  font-weight: 300;
  line-height: 19px;
}

/* 下段：シェアボタンとコピーライト。上辺の点線が上段との区切りになる */
.mh-site-footer__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px dotted #9b9b9b;
  gap: 20px;
}
.mh-site-footer .mh-share-x {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  background: #000;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.18s ease;
}
.mh-site-footer .mh-share-x:hover,
.mh-site-footer .mh-share-x:focus,
.mh-site-footer .mh-share-x:visited {
  color: #fff;
}
.mh-site-footer .mh-share-x:hover {
  opacity: 0.78;
}
.mh-site-footer .mh-share-x svg {
  width: 20px;
  height: 20px;
}
/* currentColorに頼るとリンク既定色（青）を拾う環境があるため、白を直接指定する */
.mh-site-footer .mh-share-x svg path {
  fill: #fff;
}
.mh-site-footer__note {
  margin: 0;
  color: #54595f;
  font-size: 13px;
  font-weight: 300;
  line-height: 19px;
  text-align: right;
}

/* ---------- 記事下の関連記事 ---------- */
.mh-related-posts {
  max-width: 820px;
  /* 記事本文と違ってこのブロックはテーマ側が出すため、左右の余白を自分で持つ */
  margin: 64px auto 0;
  padding: 32px 24px 0;
  border-top: 1px solid var(--mh-line);
}
.mh-related-posts__title {
  margin: 0 0 20px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--mh-muted);
}
.mh-related-posts__list {
  display: grid;
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
}
.mh-related-posts__list a {
  display: flex;
  height: 100%;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--mh-line);
  color: var(--mh-ink);
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.mh-related-posts__list a:hover {
  border-color: var(--mh-accent);
  transform: translateY(-2px);
}
.mh-related-posts__cat {
  color: var(--mh-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.mh-related-posts__name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .mh-related-posts__list {
    grid-template-columns: 1fr;
  }
  .mh-related-posts {
    margin-top: 48px;
  }
}
