/* ヘッダースタイル */
header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.3rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 65px;
    width: 100%;
}

.logo-link {
    display: inline-block;
    max-width: 320px;
    transition: transform 0.3s ease;
    margin-right: auto;
    padding-left: 0.3rem;
}

.logo {
    width: auto;
    height: 55px;
    object-fit: contain;
}

/* ナビゲーション */
nav {
    display: flex;
    align-items: center;
    margin-left: auto;
    padding-top: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    transition: all 0.3s ease-in-out;
}

.nav-links {
    display: flex;
    gap: clamp(1rem, 2vw, 2rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-size: clamp(0.9rem, 1vw + 0.5rem, 1.1rem);
    font-weight: 500;
    padding: clamp(0.3rem, 1vw, 0.5rem) clamp(0.5rem, 2vw, 1rem);
    transition: all 0.3s ease-in-out;
    position: relative;
    white-space: nowrap;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #2ecc71;
    transition: all 0.3s ease-in-out;
    transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 80%;
}

.nav-links a.active {
    font-weight: 600;
    background-color: rgba(76, 175, 80, 0.15);
}

/* ドロップダウンメニュー */
.dropdown {
    position: relative;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 220px;
    background-color: var(--background-light);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 0.8rem 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.dropdown-content li {
    margin: 0;
    padding: 0;
}

.dropdown-content a {
    padding: 0.6rem 1.2rem;
    display: block;
    color: var(--text-dark);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-content a:hover {
    background-color: rgba(76, 175, 80, 0.1);
    color: var(--primary-color);
}

.dropdown-content li:last-child a {
    border-bottom: none;
}

.dropdown-content li:first-child a {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.dropdown-content li:last-child a {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* 通常のドロップダウン動作 - ホバー効果を無効化 */
@media screen and (min-width: 1801px) {
    .dropdown:hover .dropdown-content {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

/* モバイル表示のドロップダウン位置修正 */
@media screen and (max-width: 1800px) {
    .dropdown-content {
        position: static;
        background-color: transparent;
        box-shadow: none;
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        border-left: none;
        display: none;
        text-align: center;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .dropdown-content.show {
        display: block;
        animation: slideDown 0.3s ease forwards;
    }

    .dropdown-content a {
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
        display: block;
        color: #000000;
        transition: background-color 0.3s ease;
        text-align: center;
        margin: 0 auto 0.5rem auto;
        width: 95%;
        background-color: rgba(255, 255, 255, 0.9);
        border: 1px solid var(--primary-color);
        border-radius: 8px;
    }
    
    .dropdown-content a:hover,
    .dropdown-content a:active {
        background-color: var(--primary-color);
        color: #006400;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(46, 204, 113, 0.2);
    }

    .dropdown-content a:last-child {
        margin-bottom: 0;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

/* ハンバーガーメニュー */
.hamburger {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    background: white;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-right: 0.5rem;
}

.hamburger:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: #000;
    transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    position: absolute;
    left: 8px;
    border-radius: 4px;
}

.hamburger span:nth-child(1) {
    top: 10px;
}

.hamburger span:nth-child(2) {
    top: 19px;
    width: 24px;
}

.hamburger span:nth-child(3) {
    top: 28px;
}

.hamburger.active {
    background-color: var(--primary-light);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

.hamburger:hover span {
    background-color: var(--primary-dark);
}

/* メディアクエリ */
@media screen and (max-width: 768px) {
    .hamburger {
        display: flex !important;
        z-index: 1001;
    }
}

@media screen and (max-width: 1800px) {
    .hamburger {
        display: flex;
        z-index: 1001;
        background-color: #fff;
    }

    .nav-menu {
        position: fixed;
        top: 65px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 65px);
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 2rem 1.5rem;
        transition: all 0.3s ease-in-out;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-links {
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        max-width: 500px;
        margin: 0 auto;
    }

    .nav-links > li {
        width: 100%;
        text-align: center;
        opacity: 1;
        transform: translateY(0);
    }

    .nav-links a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem 1.2rem;
        font-size: 1rem;
        color: #000000;
        background-color: rgba(255, 255, 255, 0.9);
        border: 1px solid var(--primary-color);
        border-radius: 8px;
        transition: all 0.2s ease;
    }

    .nav-links a:hover,
    .nav-links a:active,
    .nav-links a.active {
        background-color: var(--primary-color);
        color: #006400;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(46, 204, 113, 0.2);
    }

    .nav-links a::after {
        display: none;
    }
}

/* アクセシビリティ対応（フォーカス表示） */
a:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* メニューが開いているときのスタイル */
body.menu-open {
    overflow: hidden;
}

/* スクロールバーのスタイル */
.nav-menu::-webkit-scrollbar {
    width: 5px;
}

.nav-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

.nav-menu::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

/* スクロール時のヘッダースタイル */
header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* タブレット向けスタイル */
@media screen and (max-width: 1024px) {
    .nav-links {
        gap: clamp(0.8rem, 1.5vw, 1.5rem);
    }
}
