/* ============================================
   Harmonic Society Records — Mobile UX 最適化
   ============================================ */

/* ---- グローバル: タッチターゲットの拡大 ---- */
@media (max-width: 76.25em) {
  /* サイドバーのナビゲーションリンクを大きく */
  .md-nav__link {
    padding: 0.7rem 0.6rem;
    font-size: 0.82rem;
    line-height: 1.5;
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
  }

  /* サイドバーの見出しラベル */
  .md-nav__item--nested > .md-nav__link {
    font-weight: 700;
  }
}

/* ---- モバイル (< 600px) ---- */
@media (max-width: 600px) {
  /* 本文の余白を最適化 — 狭すぎず広すぎず */
  .md-content__inner {
    padding: 0 1rem 2rem;
  }

  /* h1 の文字サイズをモバイルに最適化 */
  .md-content h1 {
    font-size: 1.4rem;
    line-height: 1.4;
    letter-spacing: -0.01em;
    word-break: auto-phrase;
    overflow-wrap: anywhere;
  }

  /* h2 */
  .md-content h2 {
    font-size: 1.15rem;
    line-height: 1.45;
    margin-top: 2rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--md-accent-fg-color);
  }

  /* h3 */
  .md-content h3 {
    font-size: 1.02rem;
    line-height: 1.45;
  }

  /* 本文テキスト — 読みやすい行間 */
  .md-content p,
  .md-content li {
    font-size: 0.88rem;
    line-height: 1.85;
    letter-spacing: 0.01em;
  }

  /* テーブルの横スクロール対応 */
  .md-typeset__scrollwrap {
    margin: 0 -1rem;
    padding: 0 1rem;
  }

  .md-typeset table:not([class]) {
    font-size: 0.78rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .md-typeset table:not([class]) th,
  .md-typeset table:not([class]) td {
    padding: 0.5rem 0.6rem;
    white-space: nowrap;
  }

  /* リストの余白調整 */
  .md-typeset ul,
  .md-typeset ol {
    padding-left: 1.2rem;
  }

  /* コードブロック */
  .md-typeset pre {
    font-size: 0.75rem;
    border-radius: 0.4rem;
  }

  /* 検索ダイアログのモバイル最適化 */
  .md-search__form {
    border-radius: 0.5rem;
  }

  .md-search__input {
    font-size: 1rem;
    padding: 0.8rem 2.8rem 0.8rem 3.2rem;
  }

  /* フッターのナビゲーション — タップしやすく */
  .md-footer__link {
    padding: 1rem 0.5rem;
  }

  .md-footer-meta {
    padding: 1rem;
  }

  /* admonition (注意書き) の余白 */
  .md-typeset .admonition,
  .md-typeset details {
    margin: 1rem -0.5rem;
    padding: 0 0.8rem;
    border-radius: 0.3rem;
  }

  /* グリッドカードのモバイル調整 */
  .grid.cards > ul > li {
    padding: 0.8rem;
  }
}

/* ---- スムーズスクロール ---- */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

/* ---- ヘッダー (モバイル) — コンパクト化 ---- */
@media (max-width: 76.25em) {
  .md-header__title {
    font-size: 0.85rem;
    font-weight: 700;
  }

  /* ハンバーガーメニューを右上に配置 */
  label[for="__drawer"].md-header__button {
    order: 99;
    margin-left: auto;
    margin-right: 0;
  }

  /* ロゴを左端に */
  .md-header__button.md-logo {
    order: -1;
  }

  /* タイトルをロゴの右に */
  .md-header__title {
    order: 0;
    flex-grow: 1;
  }
}

/* ---- ヒーローセクション ---- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 0.6rem;
  margin: -0.5rem 0 1.5rem;
}

.hero__image {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.hero__image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  border-radius: 0.6rem;
}

.hero__content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 2.5rem 2rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.6) 50%,
    transparent 100%
  );
  border-radius: 0 0 0.6rem 0.6rem;
}

.hero__content h1 {
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin: 0 0 0.8rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hero__content h1 .headerlink {
  display: none;
}

.hero__content p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.92rem;
  line-height: 1.7;
  margin: 0 0 1.2rem;
  max-width: 600px;
}

.hero__content .md-button {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}

.hero__content .md-button--primary {
  background-color: var(--md-accent-fg-color);
  border-color: var(--md-accent-fg-color);
  color: #000;
}

.hero__content .md-button--primary:hover {
  background-color: var(--md-accent-fg-color--light, #ffd54f);
}

.hero__content .md-button:not(.md-button--primary) {
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

.hero__content .md-button:not(.md-button--primary):hover {
  border-color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

/* ヒーロー: モバイル */
@media (max-width: 600px) {
  .hero {
    margin: -0.5rem -1rem 1.5rem;
    border-radius: 0;
  }

  .hero__image img {
    height: 260px;
    border-radius: 0;
  }

  .hero__content {
    padding: 1.2rem 1.2rem 1.2rem;
    border-radius: 0;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.85) 0%,
      rgba(0, 0, 0, 0.5) 60%,
      transparent 100%
    );
  }

  .hero__content h1 {
    font-size: 1.2rem;
    line-height: 1.5;
    margin: 0 0 0.6rem;
  }

  /* モバイルではサブコピーを非表示（ボタン行は残す） */
  .hero__content > p:first-of-type {
    display: none;
  }

  .hero__content .md-button {
    font-size: 0.78rem;
    padding: 0.45rem 0.9rem;
  }
}

/* ヒーロー: タブレット */
@media (min-width: 601px) and (max-width: 960px) {
  .hero__image img {
    height: 340px;
  }

  .hero__content h1 {
    font-size: 1.5rem;
  }
}

/* ---- パンくずリスト ---- */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--md-default-fg-color--light);
  margin-bottom: 0.8rem;
  padding: 0.4rem 0;
  line-height: 1.6;
}

.breadcrumb a {
  color: var(--md-accent-fg-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb__sep {
  margin: 0 0.3rem;
  color: var(--md-default-fg-color--lighter);
}

.breadcrumb__current {
  color: var(--md-default-fg-color--light);
}

/* ---- 関連記事 ---- */
.related-articles {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
}

.related-articles__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--md-default-fg-color);
}

.related-articles__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.related-articles__item a {
  display: block;
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--md-accent-fg-color);
  text-decoration: none;
  border-radius: 0.3rem;
  transition: background-color 0.15s;
}

.related-articles__item a:hover {
  background-color: var(--md-accent-fg-color--transparent);
  text-decoration: none;
}

@media (min-width: 600px) {
  .related-articles__list {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- 画像のレスポンシブ ---- */
.md-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.4rem;
}

/* ---- タブレット (601px - 960px) ---- */
@media (min-width: 601px) and (max-width: 960px) {
  .md-content__inner {
    padding: 0 1.5rem 2rem;
  }

  .md-content h1 {
    font-size: 1.6rem;
  }
}

/* ---- カスタムフッターナビゲーション ---- */
.hs-footer-nav {
  background-color: var(--md-footer-bg-color);
  color: var(--md-footer-fg-color);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hs-footer-nav__inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
  padding: 2.5rem 0.8rem 2rem;
}

.hs-footer-nav__brand {
  padding-right: 1rem;
}

.hs-footer-nav__logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--md-footer-fg-color);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
}

.hs-footer-nav__logo img {
  border-radius: 4px;
}

.hs-footer-nav__logo:hover {
  color: var(--md-accent-fg-color);
}

.hs-footer-nav__desc {
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--md-footer-fg-color--light);
  margin: 0;
}

.hs-footer-nav__heading {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--md-footer-fg-color);
  margin: 0 0 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--md-accent-fg-color);
}

.hs-footer-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hs-footer-nav__list li {
  margin-bottom: 0.35rem;
}

.hs-footer-nav__list a {
  color: var(--md-footer-fg-color--light);
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 0.15rem 0;
  display: inline-block;
  transition: color 0.15s;
}

.hs-footer-nav__list a:hover {
  color: var(--md-accent-fg-color);
}

/* フッターナビ: タブレット */
@media (min-width: 601px) and (max-width: 960px) {
  .hs-footer-nav__inner {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .hs-footer-nav__brand {
    grid-column: 1 / -1;
    padding-right: 0;
  }
}

/* フッターナビ: モバイル */
@media (max-width: 600px) {
  .hs-footer-nav__inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem 1rem;
  }

  .hs-footer-nav__brand {
    padding-right: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .hs-footer-nav__list a {
    padding: 0.3rem 0;
    font-size: 0.85rem;
  }
}
