/* ==========================================================================
   common.css
   各ページ共通スタイル
   (旧: 各 HTML ファイル内の <style> ブロックに記述されていた CSS を集約)
   ========================================================================== */

/* ---------- アンカーリンク ---------- */
h2 {
  position: relative;
  cursor: pointer;
}

.anchor-link {
  display: none;
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  text-decoration: none;
  font-size: 0.8em;
  opacity: 0.7;
}

h2:hover .anchor-link {
  display: inline;
}

/* ---------- モーダル ---------- */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 50%;
  text-align: center;
  border-radius: 10px;
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

/* ---------- スニペット ---------- */
.snippet-container {
  display: none;
}

.head_title:hover .snippet-container {
  display: inline;
}

/* ==========================================================================
   スマホ専用メニュー（ロゴ＋6メニュー）
   ========================================================================== */

:root {
  --navbar-height: 30px;
}

@media screen and (max-width: 768px) {
  body {
    padding-top: 50px !important;
  }

  .mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: white;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .mobile-header img {
    height: 40px;
  }

  .mobile-nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background-color: skyblue;
    display: flex;
    z-index: 9999;
  }

  .mobile-nav a {
    flex: 1 0 16.66%;
    max-width: 16.66%;
    text-align: center;
    padding: 10px 4px;
    font-size: 10px;
    color: white;
    text-decoration: none;
    border-right: 1px solid white;
    white-space: normal;
    word-break: break-word;
    box-sizing: border-box;
  }

  .mobile-nav a:last-child {
    border-right: none;
  }

  .mobile-nav a.active {
    background-color: yellow !important;
    color: black !important;
  }

  /* PC ナビを非表示 */
  .navbar,
  .navbar-collapse {
    display: none !important;
  }
}

.mobile-nav a.active {
  background-color: #fddc57 !important;
  color: black !important;
}

/* PC ではスマホメニューを非表示 */
@media screen and (min-width: 769px) {
  .mobile-header,
  .mobile-nav {
    display: none !important;
  }
}
