* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Montserrat", sans-serif;
}

a {
    color: #5bc0de;
}

a:hover {
    color: #31b0d5;
}

/* ヘッダースタイル */
header {
    padding: 20px;
    background-color: #fff;
    transition: all 0.3s ease;
    width: 100%;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo-nav-group {
    display: flex;
    align-items: center;
    gap: 40px;
}

header .logo {
    max-width: 125px;
    height: auto;
}

/* ナビゲーション */
.header-nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.header-nav ul li a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    letter-spacing: 4px;
    transition: opacity 0.3s;
}

.header-nav ul li a:hover {
    opacity: 0.6;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-icons {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-icons .icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* モバイル用アイコン（初期は非表示） */
.nav-icons-sp {
    display: none;
}

/* ハンバーガーメニュー */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    position: relative;
    width: 44px;
    height: 44px;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #333;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

.hamburger span:last-child {
    margin-bottom: 0;
}

/* ハンバーガーのアニメーション */
.hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

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

.hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (min-width: 992px) {
    header.pc-fixed {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
    }
}

@media (max-width: 991px) {
    header {
        padding: 15px 20px;
    }

    .logo-nav-group {
        gap: 20px;
    }

    .header-icons {
        display: none;
        /* SPではヘッダーのアイコンを隠す */
    }

    .nav-icons-sp {
        display: flex;
        gap: 20px;
        margin-bottom: 40px;
    }

    .nav-icons-sp .icon {
        width: 28px;
        height: 28px;
    }

    .hamburger {
        display: block;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 300px;
        /* 固定値にすることで高さを統一 */
        background-color: #fff;
        transition: right 0.3s ease;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 65px;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
        opacity: 70%;
    }

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

    .header-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }

    .header-nav ul li a {
        font-size: 14px;
    }
}

/* メインコンテンツ */
main {
    padding: 20px;
    min-height: calc(100vh - 200px);
    width: 100%;
    max-width: none;
}

@media (min-width: 992px) {
    main {
        padding-top: 120px;
        /* 固定ヘッダー分の余白 */
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* 画像グリッドレイアウト */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    align-items: center;
    gap: 20px;
    width: 100%;
}

@media (max-width: 768px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.image-container {
    margin-bottom: 0;
}

.image-wrapper {
    position: relative;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* キャプションスタイル - SP: 画像の下に表示 */
.caption {
    text-align: center;
    padding: 10px 0;
    color: #333;
    font-size: 14px;
}

/* PC: ホバー時に白い透明レイヤーで中央表示 */
@media (min-width: 992px) {
    .caption {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(255, 255, 255, 0);
        color: #333;
        font-size: 16px;
        opacity: 0;
        transition: all 0.3s ease;
        padding: 20px;
        letter-spacing: 1.5px;
        font-size: 12px;
    }

    .image-wrapper:hover .caption {
        background-color: rgba(255, 255, 255, 0.9);
        opacity: 1;
    }
}

/* SP: 画像の下に通常表示 */
@media (max-width: 991px) {
    .caption {
        position: static;
        display: block;
        opacity: 1;
        letter-spacing: 1.5px;
        font-size: 12px;
    }
}

/* フッタースタイル */
footer {
    padding: 20px;
    background-color: #ffffff;
    text-align: center;
    color: #6c757d;
    transition: all 0.3s ease;
}

footer span {
    letter-spacing: 1.5px;
    font-size: 12px;
}

@media (min-width: 992px) {
    footer.pc-fixed {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        z-index: 1000;
    }
}

/* PC: 左詰め、SP: 中央 */
@media (min-width: 992px) {
    footer {
        text-align: left;
    }
}

@media (max-width: 991px) {
    footer {
        text-align: center;
    }
}

/* 固定要素のための余白調整 */
@media (min-width: 992px) {
    body {
        padding-bottom: 80px;
        /* 固定フッター分の余白 */
    }
}

/* メニューオープン時のスクロール禁止 */
body.menu-open {
    overflow: hidden;
}
