/* 小林メンタルクリニック 共通上部メニュー */

#kmc-common-menu {
  width: min(920px, calc(100% - 24px));
  margin: 0 auto 22px;
}

.kmc-nav {
  position: relative;
  z-index: 20;
  border-top: 1px solid #b98c45;
  border-bottom: 1px solid #6f4825;
  background:
    linear-gradient(
      to bottom,
      #8a6237 0%,
      #74502d 48%,
      #5a381f 52%,
      #6c4828 100%
    );
  box-shadow:
    0 3px 8px rgba(58, 36, 18, 0.28),
    inset 0 1px 0 rgba(255, 239, 194, 0.32);
}

.kmc-nav-list {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kmc-nav-list li {
  min-width: 0;
  flex: 1 1 auto;
  border-right: 1px solid rgba(255, 236, 190, 0.22);
}

.kmc-nav-list li:last-child {
  border-right: 0;
}

.kmc-nav-list a {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: #fff8e8;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(46, 27, 12, 0.75);
  transition:
    background-color 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.kmc-nav-list a:hover,
.kmc-nav-list a:focus-visible {
  color: #3d2717;
  background: linear-gradient(to bottom, #f4d998, #c99b4a);
  text-shadow: none;
}

.kmc-nav-list a:focus-visible,
.kmc-nav-toggle:focus-visible {
  position: relative;
  z-index: 2;
  outline: 3px solid #fff1b9;
  outline-offset: -3px;
}

.kmc-nav-list a[aria-current="page"] {
  color: #3a2414;
  background: linear-gradient(to bottom, #f6dfaa, #c99a43);
  box-shadow:
    inset 0 3px 0 #fff0ba,
    inset 0 -3px 0 #795022;
  text-shadow: none;
}

.kmc-nav-toggle {
  display: none;
}

/* 読み込み失敗時 */
.kmc-menu-error {
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #b69465;
  background: #fff4db;
  color: #5a381f;
  font-size: 0.85rem;
  text-align: center;
}

/* タブレット：3列×2段 */
@media (max-width: 820px) {
  .kmc-nav-list {
    flex-wrap: wrap;
  }

  .kmc-nav-list li {
    flex: 0 0 33.333%;
    border-bottom: 1px solid rgba(255, 236, 190, 0.2);
  }

  .kmc-nav-list li:nth-child(3n) {
    border-right: 0;
  }

  .kmc-nav-list li:nth-last-child(-n + 3) {
    border-bottom: 0;
  }
}

/* スマートフォン：開閉式 */
@media (max-width: 560px) {
  #kmc-common-menu {
    width: calc(100% - 16px);
    margin-bottom: 16px;
  }

  .kmc-nav-toggle {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 8px 14px;
    border: 0;
    color: #fff8e8;
    background:
      linear-gradient(
        to bottom,
        #8a6237 0%,
        #74502d 48%,
        #5a381f 52%,
        #6c4828 100%
      );
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(46, 27, 12, 0.75);
  }

  .kmc-nav-toggle-icon {
    font-size: 1.25rem;
    line-height: 1;
  }

  .kmc-nav-list {
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    border-top: 1px solid rgba(255, 236, 190, 0.3);
  }

  .kmc-nav.is-open .kmc-nav-list {
    display: flex;
  }

  .kmc-nav-list li,
  .kmc-nav-list li:nth-child(3n),
  .kmc-nav-list li:nth-last-child(-n + 3) {
    flex: 0 0 auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 236, 190, 0.22);
  }

  .kmc-nav-list li:last-child {
    border-bottom: 0;
  }

  .kmc-nav-list a {
    min-height: 45px;
    justify-content: flex-start;
    padding: 10px 18px;
    font-size: 0.95rem;
    text-align: left;
  }
}
