﻿/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'M PLUS Rounded 1c', sans-serif; /* 基本フォントを M PLUS Rounded 1c に */
    line-height: 1.7;
    color: #333;
    background-color: #f0f0f0; /* Light gray background */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 25px;
}

/* --- Header --- */
/* ヘッダーの背景色を透明に維持しつつ、スクロールで文字色が変わるようにします */
.site-header {
    background-color: transparent;
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: background-color 0.5s ease; /* 背景色の変化をスムーズに */
}

/* スクロール時にヘッダーの背景色を白っぽくし、文字色を黒くする */
.site-header.scrolled {
    background-color: rgba(255, 255, 255, 0.9); /* 少し濃いめの半透明の白 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* ハンバーガーメニューのz-index調整のため */
}

.logo {
    display: flex; /* 画像の垂直方向の位置を中央に調整 */
    align-items: center; /* 画像の垂直方向の位置を中央に調整 */
    height: 30px; /* ナビゲーションバーの高さに合わせて調整 */
    position: relative; /* Z-indexのために */
    z-index: 1001; /* ハンバーガーメニューより手前に */
}

.logo img {
    height: 100%; /* 親要素の高さに合わせる */
    width: auto; /* アスペクト比を維持 */
    display: block; /* 画像の下の余白をなくす */
}

.site-header nav ul {
    display: flex;
}

.site-header nav ul li {
    margin-left: 40px;
}

.site-header nav ul li a {
    font-family: 'Montserrat', sans-serif; /* ナビゲーションリンクも Montserrat を維持 */
    font-size: 0.95em;
    font-weight: 500;
    color: white; /* デフォルトは白 */
    transition: color 0.8s ease;
    position: relative;
    padding-bottom: 5px;
}

/* スクロール時にナビゲーションリンクの色を黒に */
.site-header.scrolled nav ul li a {
    color: #333; /* スクロール時に黒に */
}

/* ロゴの色の変化も同様に (もしロゴがSVGなどで色変更可能であれば) */
.site-header.scrolled .logo img {
    /* 必要であればロゴ画像のパスを変更するか、CSSで色を変更するプロパティを設定 */
    /* filter: invert(100%); */ /* 例: ロゴが白の場合、黒く反転させる */
}

.site-header nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #5cb85c;
    transition: width 0.8s ease;
}

.site-header nav ul li a:hover::after {
    width: 100%;
}

.site-header nav ul li a:hover {
    color: #5cb85c;
}


/* --- ハンバーガーメニューのスタイル --- */
.menu-toggle {
    display: none; /* デスクトップでは非表示 */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
    z-index: 1001; /* ナビゲーションメニューより手前に */
}

.hamburger {
    display: block;
    width: 100%;
    height: 2px;
    background-color: white; /* デフォルトは白 */
    transition: all 0.3s ease;
}

/* スクロール時にハンバーガーメニューの色を黒に */
.site-header.scrolled .hamburger {
    background-color: #333;
}

/* ハンバーガーメニューがアクティブになった時のスタイル */
.menu-toggle.active .hamburger:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}
.menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active .hamburger:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}


/* --- Hero Section (Slideshow) --- */
.hero-section {
    position: relative;
    height: 100vh; /* ビューポートの高さ全体に表示 */
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    overflow: hidden;
    /* hero-image の代わりに slideshow-container が背景になる */
}

/* hero-image のスタイルは削除またはコメントアウト */
.hero-image {
    display: none; /* スライドショーを使用するため非表示に */
}

.slideshow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2; /* オーバーレイより後ろに */
}

.slideshow-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* コンテナを覆うように拡大縮小 */
    opacity: 0; /* 初期は非表示 */
    transition: opacity 1.5s ease-in-out; /* フェードアニメーション */
}

.slideshow-image.active {
    opacity: 1; /* active クラスが付与された画像を表示 */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.45); /* 暗いオーバーレイでテキストの視認性を高める */
    z-index: -1;
}

.hero-content {
    position: relative; /* スクロールで一緒に動くように相対位置に */
    z-index: 1; /* オーバーレイより手前 */
    max-width: 800px;
    padding: 20px;
}

.hero-content h2 {
    font-family: 'Montserrat', sans-serif; /* Montserrat を維持 */
    font-size: 3.8em; /* サイズを少し小さく */
    font-weight: 500; /* 太さを少し細くしてシンプルに */
    margin-bottom: 15px; /* 段落との間隔を調整 */
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.6);
}

.hero-content p {
    font-family: 'M PLUS Rounded 1c', sans-serif; /* M PLUS Rounded 1c に変更 */
    font-size: 1.6em; /* サイズを少し大きくして見やすく */
    margin-bottom: 40px; /* ボタンがなくなるので、必要に応じて調整 */
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
    font-weight: 400; /* 通常の太さに */
}

/* Buttons */
.button {
    display: inline-block;
    background-color: #ff9800; /* Accent color */
    color: white;
    padding: 16px 35px;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif; /* ボタンは Montserrat を維持 */
    font-weight: 600;
    font-size: 1.1em;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 15px rgba(0,0,0,0.3);
}

.button:hover {
    background-color: #e68a00;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

/* --- Sections --- */
.section {
    padding: 100px 0;
    text-align: center;
    background-color: #babbc2; /* 基本のセクションの背景色 (ABOUT以外に適用) */
    overflow: hidden;
    position: relative;
    z-index: 2;
}

/* ABOUTセクションの背景色 (画像ではなく単色に戻すか、既存の .section に任せる) */
#about { /* ABOUTセクションの背景色 */
    background-image: url('karihaikei3.png'); /* 画像を背景に設定 */
    background-size: cover; /* 背景画像がセクション全体を覆うように拡大・縮小 */
    background-position: center; /* 背景画像を中央に配置 */
    background-repeat: no-repeat; /* 背景画像を繰り返さない */
    /* 必要に応じて、画像の上のテキストが見やすいようにオーバーレイを追加することもできます */
    /* position: relative; */ /* オーバーレイを使う場合、親要素にrelativeが必要 */
    /* z-index: 0; */ /* オーバーレイを使う場合、セクションのz-indexを設定 */
}

/* 新しく追加するABOUTセクションの画像スタイル */
.about-image {
    display: block; /* 画像をブロック要素にする */
    max-width: 800px; /* 画像の最大幅を設定（適宜調整してください） */
    width: 90%; /* 親要素に対する幅（レスポンシブ対応） */
    height: auto; /* アスペクト比を維持 */
    margin: 100px auto 0 auto; /* ✅ これが正しい記述です */
    border-radius: 8px; /* 角を丸くする（任意） */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); /* 影を追加（任意） */
}


.section:nth-of-type(even) {
    background-color: #f9f9f9;
}

.section-title {
    font-family: 'Montserrat', sans-serif; /* セクションタイトルも Montserrat を維持 */
    font-size: 3em;
    font-weight: 600;
    color: #444;
    margin-bottom: 60px;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    letter-spacing: 1px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: #5cb85c;
    border-radius: 2px;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    text-align: left;
    margin-top: 50px;
}

.about-item {
    background-color: #fff; /* 各アイテムの背景色は白色を維持 */
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.about-item h3 {
    font-family: 'Montserrat', sans-serif; /* Aboutセクションのタイトルも Montserrat を維持 */
    font-size: 1.8em;
    font-weight: 600;
    color: #0d0c0c; /* 緑色のまま */
    margin-bottom: 15px;
}

.about-item p {
    font-family: 'M PLUS Rounded 1c', sans-serif; /* Aboutセクションのパラグラフも M PLUS Rounded 1c に */
    font-size: 1.05em;
    line-height: 1.8;
    color: #666;
}

/* Gallery Section */
.gallery-section {
    background-image: url('kuro.png'); /* kuro.png を背景に設定 */
    background-size: cover; /* 背景画像をセクション全体に広げる */
    background-position: center; /* 背景画像を中央に配置 */
    background-repeat: no-repeat; /* 背景画像を繰り返さない */
    position: relative; /* 疑似要素の基準にする */
    padding-bottom: 150px; /* 波の形状分だけパディングを増やす */
    color: #fff; /* 文字色を白に変更して見やすくする */
}

/* 上部の波状の境目 */
.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px; /* 波の高さ */
    /* ABOUTセクションの背景色に合わせて fill の色を調整してください */
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1200 120" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0,0 S300,120 600,0 S900,120 1200,0 L1200,120 L0,120 Z" fill="%23f0f0f0"></path></svg>') no-repeat center / cover;
    transform: translateY(-99%); /* 上部に配置し、少し重なるように調整 */
    z-index: 3; /* 他の要素より手前に配置 */
}

/* 下部の波状の境目 */
.gallery-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px; /* 波の高さ */
    /* SCHEDULEセクションの背景色に合わせて fill の色を調整してください */
    background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1200 120" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><path d="M0,120 S300,0 600,120 S900,0 1200,120 L1200,0 L0,0 Z" fill="%23babbc2"></path></svg>') no-repeat center / cover;
    transform: translateY(99%); /* 下部に配置し、少し重なるように調整 */
    z-index: 3; /* 他の要素より手前に配置 */
}

.gallery-section .section-title {
    color: #fff; /* タイトルの色を白にして背景になじませる */
}

.image-grid {
    display: grid;
    /* 4列表示に変更。写真が多い場合は列数を増やすか、minmaxで調整 */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 最小250pxで自動調整、4列以上も可能 */
    gap: 20px; /* 余白を少し調整 */
    grid-auto-rows: 250px; /* 行の高さを調整（写真が多い場合は少し小さく） */
    margin-top: 50px;
}

.grid-item {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    position: relative; /* オーバーレイを配置するために必要 */
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* シャッターオーバーレイのスタイル */
.shutter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0); /* 初期は透明 */
    transition: background-color 0.2s ease-out; /* オーバーレイの色変化 */
    z-index: 1; /* 画像より手前に表示 */
    pointer-events: none; /* オーバーレイの下の要素をクリックできるようにする */
}

/* ホバー時のモーション */
.grid-item:hover .shutter-overlay {
    background-color: rgba(0, 0, 0, 0.7); /* 一時的に暗くする */
    transition: background-color 0.15s ease-in, opacity 0.15s ease-in 0.15s; /* 早く暗くなり、遅れて透明に戻る */
    opacity: 0; /* 暗くなった後、すぐに透明に戻る */
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* コンテナを覆うようにトリミングされます */
    display: block;
    transition: transform 0.3s ease; /* 画像の拡大アニメーション */
}


.grid-item:hover img {
    transform: scale(1.08); /* ホバーで画像を拡大 */
}

/* ホバーが外れたらすぐに戻す (任意) */
.grid-item .shutter-overlay:not(:hover) {
    background-color: rgba(0, 0, 0, 0);
    opacity: 1;
    transition: background-color 0.3s ease-out, opacity 0.3s ease-out;
}


/* Schedule Section */
.schedule-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    margin-top: 50px;
    text-align: left;
}
.schedule-section {
    background-image: url('karihaikei3.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.schedule-item {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
    border-left: 5px solid #fff;
}

.schedule-item h3 {
    font-family: 'Montserrat', sans-serif; /* Scheduleセクションのタイトルも Montserrat を維持 */
    font-size: 1.6em;
    font-weight: 600;
    color: #444;
    margin-bottom: 15px;
}

.schedule-item p {
    font-family: 'M PLUS Rounded 1c', sans-serif; /* Scheduleセクションのパラグラフも M PLUS Rounded 1c に */
    font-size: 1.05em;
    line-height: 1.7;
    color: #444;
}

/* Contact Section */
.contact-section {
    background-image: url('karihaikei3.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.contact-section p {
    font-family: 'M PLUS Rounded 1c', sans-serif; /* Contactセクションのパラグラフも M PLUS Rounded 1c に */
    font-size: 1.2em;
    color: #555;
    margin-bottom: 40px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.contact-button {
    display: inline-block; /* ボタンのように振る舞わせる */
    background-color: #5cb85c;
    color: white;
    padding: 16px 35px;
    border-radius: 5px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.1em;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.contact-button:hover {
    background-color: #4CAF50;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

/* style.css の末尾など、適切な場所に追加してください */

.image-button {
    display: inline-block; /* ボタンのように振る舞わせる */
    border-radius: 0px; /* 角を丸くする (任意) */
    overflow: hidden; /* 画像がはみ出さないように */
    box-shadow: 0 6px 15px rgba(0,0,0,0.3); /* 影を追加 */
    transition: transform 0.2s ease, box-shadow 0.3s ease; /* ホバー時のアニメーション */
}

.image-button img {
    display: block; /* 画像の下の余白をなくす */
    width: 100%; /* 親要素 (aタグ) の幅いっぱいに */
    max-width: 200px; /* 画像の最大幅を調整 (必要に応じて変更) */
    height: auto; /* アスペクト比を維持 */
}

.image-button:hover {
    transform: translateY(-3px); /* ホバーで少し浮き上がる */
    box-shadow: 0 8px 20px rgba(0,0,0,0.0); /* 影を濃くする */
}

/* 既存の .contact-section p のマージン調整 */
.contact-section p:last-of-type { /* 最後のpタグ（TELの行）の下のマージンを調整 */
    margin-bottom: 25px; /* ボタンとの間隔を調整 */
}

/* Footer */
.site-footer {
    background-color: #222;
    color: #bbb;
    text-align: center;
    padding: 50px 0;
    font-size: 0.9em;
    font-family: 'M PLUS Rounded 1c', sans-serif; /* フッターも M PLUS Rounded 1c に */
}

/* Animation Utilities */
.animate-fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInSlideUp 1s ease-out forwards;
}

.animate-fade-in.delay-200 { animation-delay: 0.2s; }
.animate-fade-in.delay-400 { animation-delay: 0.4s; }

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll-based Fade-in (JavaScript controlled) */
.js-scroll-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.js-scroll-fade.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-content h2 {
        font-size: 3.2em; /* レスポンシブでも調整 */
    }
    .hero-content p {
        font-size: 1.3em; /* レスポンシブでも調整 */
        margin-bottom: 25px;
    }
    .section-title {
        font-size: 2.5em;
    }
    .site-header nav ul li {
        margin-left: 25px;
    }
    .about-grid, .schedule-items {
        gap: 30px;
    }
    .about-image { /* レスポンシブ調整 */
        max-width: 600px;
        margin-top: 40px;
    }
    .image-grid {
        grid-template-columns: repeat(3, 1fr); /* 中画面でも3列を維持 */
        grid-auto-rows: 240px; /* 高さを調整 */
        gap: 20px; /* 余白を調整 */
    }
}

@media (max-width: 768px) {
    /* ハンバーガーメニューの表示 */
    .menu-toggle {
        display: flex; /* スマホでは表示 */
    }

    /* ナビゲーションメニューを非表示にし、絶対配置にする */
    .site-header nav {
        position: absolute;
        top: 100%; /* ヘッダーのすぐ下に配置 */
        left: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.9); /* オーバーレイのように暗く */
        max-height: 0; /* 初期は高さを0にして隠す */
        overflow: hidden; /* はみ出たコンテンツを非表示 */
        transition: max-height 0.5s ease-out, background-color 0.5s ease; /* スムーズな開閉 */
        z-index: 999; /* 他の要素より手前に */
    }

    /* ナビゲーションメニューが開いた時のスタイル */
    .site-header nav.active {
        max-height: 300px; /* メニューの高さに合わせて調整 */
        background-color: rgba(0, 0, 0, 0.9);
    }

    .site-header nav ul {
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        width: 100%;
    }

    .site-header nav ul li {
        margin: 15px 0; /* 縦方向の間隔を調整 */
    }

    .site-header nav ul li a {
        color: white; /* スマホメニュー内のリンクは常に白 */
        font-size: 1.1em;
    }

    /* スクロール時のヘッダー色変更に対するナビゲーションリンクの色調整 */
    .site-header.scrolled nav ul li a {
        color: white; /* スクロールしても白を維持 */
    }

    .site-header .header-content {
        flex-direction: row; /* ハンバーガーメニューがあるためrowを維持 */
        justify-content: space-between; /* ロゴとハンバーガーを左右に配置 */
        align-items: center;
    }
    .site-header .logo {
        margin-bottom: 0; /* 調整済み */
    }
    
    .hero-section {
        height: 80vh;
    }
    .hero-content h2 {
        font-size: 2.5em; /* レスポンシブでも調整 */
    }
    .hero-content p {
        font-size: 1.0em; /* レスポンシブでも調整 */
        margin-bottom: 20px;
    }
    .section {
        padding: 70px 0;
    }
    .section-title {
        font-size: 2em;
    }
    .about-item, .schedule-item {
        padding: 25px;
    }
    .image-grid {
        grid-template-columns: repeat(2, 1fr); /* 小画面では2列 */
        grid-auto-rows: 220px; /* 高さを調整 */
        gap: 15px; /* 余白を調整 */
    }
    .image-grid .grid-item:nth-child(2),
    .image-grid .grid-item:nth-child(5) {
        grid-row: span 1; /* スマホではmasonry効果を無効にする */
    }
    .about-image { /* レスポンシブ調整 */
        max-width: 90%;
        margin-top: 30px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 60vh;
    }
    .hero-content h2 {
        font-size: 1.8em; /* レスポンシブでも調整 */
    }
    .hero-content p {
        font-size: 0.8em; /* レスポンシブでも調整 */
        margin-bottom: 15px;
    }
    .button {
        padding: 12px 25px;
        font-size: 1em;
    }
    .section-title {
        font-size: 1.8em;
    }
    .about-item h3, .schedule-item h3 {
        font-size: 1.5em;
    }
    .about-item p, .schedule-item p {
        font-size: 0.95em;
    }
    .about-image { /* レスポンシブ調整 */
        margin-top: 25px;
    }
    .image-grid {
        grid-template-columns: 1fr; /* スマホでは1列 */
        grid-auto-rows: 300px; /* 高さを調整 */
        gap: 10px;
    }
}