@charset "UTF-8";

/* 共通リセット260629 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.site-header ul { list-style: none; }
.site-header a { text-decoration: none; color: inherit; }

.site-header {
    width: 100%;
    background-color: #fff;
    position: relative;
    z-index: 100;
}
.header-top {
    display: table;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}
.logo-area {
    display: flex;
    vertical-align: middle;
}
.footer-bar .address {
    font-size:.875rem;
    line-height:1.4;
    margin:0 30px 0 20px;
}
.logo-icon-placeholder {
    display: inline-block;
    width: auto;
    height: 50px;
    vertical-align: middle;
    margin-right: 10px;
}
.logo-icon-placeholder img {
    max-height:50px;
}
.logo-text {
    padding-top:3px;
    display: inline-block;
    vertical-align: middle;
    line-height:1.6;
    margin:0;
}
.logo-text .corp-name { display: block; font-size: 11px; color: #666; }
.logo-text .facility-name { display: block; font-size: 16px; font-weight: bold; color: #222; }

.sub-nav { display: table-cell; vertical-align: middle; text-align: right; }
.sub-nav ul { display: inline-block; }
.sub-nav li { display: inline-block; margin-left: 20px; font-size: 14px; }
.sub-nav a:hover { text-decoration: underline; }

.sub-nav a {
  display: inline-block;
  position: relative;
  text-decoration: none !important;
}
.sub-nav a::after {
  background-color: #74a79a;
  bottom: -2px; /* 要素の下端からの距離 */
  content: "";
  height: 3px; /* 下線の高さ */
  left: 0;
  position: absolute;
  transform: scale(0, 1);
  transform-origin: right top;
  transition: transform .3s;
  width: 100%;
}
/* リンクにホバーした際の下線の表示 */
.sub-nav a:hover::after {
  transform-origin: left top; /* 変形の原点を左上に指定 */
  transform: scale(1, 1); /* 下線を横方向に1倍、縦方向に1倍に変形（表示） */
}

.main-nav {
    border-top: 1px solid #dbdbdb;
    border-bottom: 1px solid #dbdbdb;
    background-color: #fff;
}
.nav-links {
    display: table;
    width: 100%;
    table-layout: fixed;
}
.nav-item {
    display: table-cell;
    text-align: center;
    border-right: 1px solid #dbdbdb;
    position: relative; /* メガメニューの基準点になります */
}
.nav-item:first-child { border-left: 1px solid #dbdbdb; }
.nav-item a span.unl {
  display: inline-block;
  position: relative;
}
.nav-item a span.unl::after {
  background-color: #8fc5b8;
  bottom: -2px; /* 要素の下端からの距離 */
  content: "";
  height: 2px; /* 下線の高さ */
  left: 0;
  position: absolute;
  width: 100%;
}
.category-mid a, .category-small a {
        text-decoration: underline;
        text-decoration-color: #8fc5b8;
    }

.nav-link {
    display: block;
    padding: 15px 5px;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s;
}
.nav-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 8px auto;
}
.nav-icon img {
    width: auto;
    max-height: 32px;
    margin: 0 auto;
}

/* ホバーされた項目の背景変化（すべてのメニュー共通） */
.nav-item:hover .nav-link {
    background-color: #c9eedf;
}

/* メガメニューの基本設定 */
.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;           /* ホバーしたメニューの左端に合わせる */
    display: none;     /* 初期非表示 */
    width: 510px;      /* メガメニューの横幅 */
    text-align: left;
    z-index: 200;
    padding-top: 5px;
}
.mega-menu.no-small {
    width: 230px;
}
.mega-menu.no-small.long {
    width: 280px !important;
}

/* ホバーしたメニュー内のメガメニューを表示 */
.nav-item:hover .mega-menu {
    display: block;
}

.mega-menu-inner {
    /*background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);*/
    display: flex;
    align-items: flex-start;
    width: 100%;
    overflow: hidden;
}

/* 中区分 */
.category-mid {
    flex: 0 0 45%;
    width: 45%;
    background-color: #fff;
    /*padding: 10px 0;*/
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
.category-mid.long {
    flex: 0 0 60%;
    width: 60%;
}
.mid-item { position: relative; }
.mid-item a {
    display: block;
    padding: 12px 20px;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    border-right: 1px solid #ccc;
}
.mid-item:last-child a { border-bottom: none; }
.mid-item:hover a,
.mid-item.active a {
    background-color: #eaf8f2;
}
.mid-item::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 6px solid #aaa;
    display: none;
}

/* 小区分 */
.category-small-container {
    flex: 0 4 55%;
    width: 55%;
    background-color: #fff;
    /*padding: 10px 0;*/
}
.category-small {
    display: none;
    padding: 0 15px;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}
.category-small.active {
    display: block;
}
.category-small li a {
    display: block;
    padding: 10px 5px;
    font-size: 12.5px;
    border-bottom: 1px solid #eee;
}
.category-small li:last-child a { border-bottom: none; }
.category-small li a:hover {
    color: #008653;
    text-decoration: underline;
}
@media screen and (min-width: 769px) {
    .mid-item.sponly, .category-small-container .sponly { display:none; }
    .mid-item[data-target]:hover::after,
    .mid-item[data-target].active::after {
        display: block;
        border-left-color: #555;
    }
    .sp-sub-nav {
        display:none;
    }
}

/* 小区分（右側）がない場合の特別スタイル */
.mega-menu-inner.no-small .category-mid {
    flex: 1;
    width: 100%;
    border-right: none;
}

/* PC：右展開なし時は右パネルを非表示（幅を変えないことでレイアウトシフトを防ぐ） */
/* display:none で幅を変えると hover 復帰時にリフローが起きメニューが点滅するため
   visibility:hidden に変更し、レイアウトを維持したまま非表示にする */
@media screen and (min-width: 769px) {
    .nav-item.hide-right .category-small-container {
        visibility: hidden;
        pointer-events: none;
    }
}

/* 小区分がない時は、ホバーしたときに出てくる右向きの矢印（▶）も非表示にする */
.mega-menu-inner.no-small .mid-item::after {
    display: none !important;
}

/* ==========================================
   スマホ・タブレット用スタイル (768px以下)
   ========================================== */
@media screen and (max-width: 768px) {
    .header-top {
        padding: 15px;
    }
    .logo-text .facility-name { 
        font-size: 13px;
    }
    .logo-icon-placeholder {
        height: 38px;
        margin-right:8px;
    }
    .logo-icon-placeholder img {
        max-height:38px;
    }
    .footer-bar .address {
        margin:20px 0;
    }
    .sp-sub-nav {
        display:block;
        padding:15px 20px;
        border-bottom: 1px solid #eee;
    }
    .sp-sub-nav ul {
        display:flex;
        flex-wrap: wrap;
    }
    .sp-sub-nav ul li {
        position: relative;
        width: calc(100% / 2 - 5px);
        margin-bottom:6px;
        padding: 0px 0px 0px 1em;
    }
    .sp-sub-nav ul li::before {
        position: absolute;
        top: 50%;
        left: 0px;
        transform: translateY(-50%);
        width: 0px;
        height: 0px;
        border: 0.3em solid transparent;
        border-left: 0.4em solid #1b9b5b;
        content: "";
    }

    /* サブナビゲーションはスマホでは非表示（またはメニュー内に移動） */
    .sub-nav {
        display: none;
    }

    /* ハンバーガーボタンのスタイル */
    .menu-trigger {
        display: inline-block;
        position: absolute;
        right: 20px;
        top: 24px;
        width: 30px;
        height: 24px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 300;
    }
    .menu-trigger span {
        display: block;
        position: absolute;
        left: 0;
        width: 100%;
        height: 2px;
        background-color: #333;
        transition: all 0.3s;
    }
    .menu-trigger span:nth-child(1) { top: 0; }
    .menu-trigger span:nth-child(2) { top: 11px; }
    .menu-trigger span:nth-child(3) { top: 22px; }

    /* ボタンがアクティブ（×印）になったとき */
    .menu-trigger.active span:nth-child(1) { transform: translateY(11px) rotate(-45deg); }
    .menu-trigger.active span:nth-child(2) { opacity: 0; }
    .menu-trigger.active span:nth-child(3) { transform: translateY(-11px) rotate(45deg); }

    /* メインナビゲーションを画面外（右側）に隠す */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%; /* 初期状態は画面の右に隠す */
        width: 80%;  /* 画面の8割を覆うドロワー */
        height: 100vh;
        background-color: #fff;
        padding-top: 70px;
        transition: right 0.3s ease-in-out;
        overflow-y: auto; /* 縦スクロール可能に */
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        border: none;
        z-index: 250;
    }
    /* メニューが開いたとき */
    .main-nav.active {
        right: 0;
    }
    .mega-menu.no-small {
        width: 100%;
    }
    .mega-menu.no-small.long {
        width: 100% !important;
    }

    /* メニューリンクを縦並びにする */
    .nav-links {
        display: block;
    }
    .nav-item {
        display: block;
        text-align: left;
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    .nav-item:first-child { border-left: none; }
    
    .nav-link {
        padding: 12px 20px;
        display: flex;
        align-items: center;
    }
    .nav-icon {
        margin: 0 15px 0 0; /* アイコンを左、文字を右に並べる */
    }

    /* スマホ版メガメニュー（アコーディオン化） */
    .mega-menu {
        position: static; /* 浮かせずに通常の流し込みに */
        display: none;    /* JSのトグルで開閉 */
        width: 100%;
        padding-top: 0;
    }
    .mega-menu-inner {
        display: block; /* テーブルレイアウトを解除 */
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    /* 中区分（スマホでは縦に並ぶ親アコーディオン） */
    .category-mid {
        display: block;
        width: 100%;
        background-color: #f9f9f9;
        padding: 0;
        border-left: none;
        border-right: none;
        border-top: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
        box-shadow: none;
    }
    .category-mid.long {
        display: block;
        width: 100%;
    }
    .mid-item.sponly, .category-small-container .sponly { display:block; }
    .mid-item a {
        padding: 12px 30px; /* 少しインデントを下げる */
        background-color: #f5f5f5;
    }
    /* PC用の矢印（▶）をスマホでは下向き（▼）などに変えるための準備 */
    .mid-item::after {
        right: 20px;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 6px solid #aaa; /* 下向き矢印 */
        border-bottom: none;
    }
    .mid-item[data-target]:hover::after, .mid-item[data-target].active::after {
        display: block;
        border-left-color: none !important;
    }

    /* 小区分（スマホでは中区分の下に直接開く） */
    .category-small-container {
        display: block;
        width: 100%;
        padding: 0;
    }
    .category-small {
        display: none; /* JSのトグルで開閉 */
        background-color: #fff;
        padding: 0 0 0 20px; /* さらにインデントを下げて階層をわかりやすく */
        border-left: none;
        border-right: none;
        border-top: 1px solid #ccc;
        border-bottom: 1px solid #ccc;
        box-shadow: none;
    }
    .category-small.active {
        display: none; /* PC用のアクティブクラスの挙動を一度リセット */
    }
    /* JSで開いたとき用 */
    .category-small.open {
        display: block;
    }
    
    /* アコーディオンが開いているとき、親の矢印を反転（▲）させる */
    .mid-item.open::after {
        display: block;
        border-top: none;
        border-bottom: 6px solid #555;
    }
}

/* アンカーリンクのオフセット（固定ヘッダー分） */
@media screen and (min-width: 769px) {
    :target {
        scroll-margin-top: var(--header-height, 160px);
    }
}

/* 追従 */
@media screen and (min-width: 769px) {
    /* 通常時（何もなし） */
    .main-nav {
        width: 100%;
        position: relative;
    }

    /* スクロールして上部に固定される時（ヘッダー全体） */
    .site-header.is-fixed {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 999;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
}