/* --- 基本設定 --- */
:root {
    --bg-color: #f2f2f7; /* 明るいグレー（グラデーションのフォールバック） */
    --text-color: #333333; /* 濃いグレー */
    --accent-color: #bf5b3b; /* 落ち着いたテラコッタ */
    --accent-light: #f4e9e4; /* 薄いアクセントカラー */
    --accent-hover: #a64d31;
    --secondary-bg: #ffffff;
    --border-radius: 16px; /* グラスモーフィズム用に角丸を大きく */
}

body {
    font-family: "Zen Maru Gothic", sans-serif;
    background-color: var(--bg-color); /* グラデーション非対応ブラウザ用 */
    background-image: linear-gradient(135deg, var(--grad-start, #f9e7d8) 0%, var(--grad-end, #e6e9f9) 100%);
    color: var(--text-color);
    line-height: 1.8;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: "Zen Maru Gothic", sans-serif;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

p {
    margin-bottom: 1.8rem;
}

ul {
    padding-left: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

/* --- 共通コンポーネント --- */
.section {
    padding: 60px 0;
}

.main-content {
    padding-top: 100px; /* 固定ヘッダー分の余白 */
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    position: relative;
    display: inline;
    background: linear-gradient(transparent 70%, var(--accent-light) 70%);
    padding: 0 10px;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.card {
    /* --- Glassmorphism Style --- */
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.18);
    margin-bottom: 24px;
}
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    text-decoration: none;
    color: var(--accent-color);
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}

/* --- カードグリッド（イベント紹介など） --- */
.event-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.event-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    margin-bottom: 20px;
    border-radius: var(--border-radius);
}

.btn-cta {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 20px auto;
    padding: 18px;
    background-color: var(--accent-color);
    color: white;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 100px;
    box-shadow: 0 4px 15px rgba(191, 91, 59, 0.25);
    transition: transform 0.2s, box-shadow 0.2s;
    letter-spacing: 0.05em;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(191, 91, 59, 0.4);
}

/* --- Header & Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    z-index: 1000;
    box-sizing: border-box;
}

.logo {
    font-family: "Zen Maru Gothic", sans-serif;
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
    z-index: 1001;
}

.main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background-color: rgba(252, 251, 249, 0.98);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: right 0.4s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}
.main-nav.is-active {
    right: 0;
}
.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}
.main-nav li {
    margin: 20px 0;
}
.main-nav a {
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    transition: color 0.2s;
}
.main-nav a:hover {
    color: var(--accent-color);
}

.hamburger {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1001;
    margin-right: -10px;
}
.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}
.hamburger.is-active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.is-active span:nth-child(2) { opacity: 0; }
.hamburger.is-active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* --- フッター --- */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 40px 20px;
    font-size: 0.8rem;
}
.footer-links {
    margin-bottom: 15px;
}
.footer-links a {
    color: #fff;
    text-decoration: none;
    margin: 0 10px;
    transition: text-decoration 0.2s;
}
.footer-links a:hover {
    text-decoration: underline;
}
.copyright {
    margin-bottom: 0;
    color: #aaa;
}

.sticky-cta {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 100;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    margin: 0;
}

/* --- ページトップへ戻るボタン --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    font-size: 1.5rem;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 999;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* --- アニメーション --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    /* https://cubic-bezier.com/#.215,.61,.355,1 - easeOutCubic */
    transition: opacity 0.7s cubic-bezier(0.215, 0.610, 0.355, 1.000), transform 0.7s cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transition-delay: calc(0.08s * var(--i, 0)); /* --i はHTML側で設定 */
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ヒーローセクションの個別アニメーション */
.hero .badge, .hero h1, .hero p, .hero .btn-cta {
    opacity: 0;
    animation: hero-fade-in-up 0.8s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}
/* アニメーションの遅延 */
.hero .badge { animation-delay: 0.2s; }
.hero h1 { animation-delay: 0.4s; }
.hero p { animation-delay: 0.6s; }
.hero .btn-cta { animation-delay: 0.8s; }

@keyframes hero-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- スクロール動物 --- */
#scroll-animal-container {
    position: fixed;
    bottom: 10px; /* フッターやボタンと被らない位置 */
    left: 0;
    z-index: 9999;
    will-change: transform; /* アニメーションのパフォーマンスを最適化 */
    pointer-events: none; /* コンテナはクリックを妨げない */
    display: flex;
    align-items: center;
    gap: 8px;
}

#scroll-animal-link {
    pointer-events: auto; /* リンクはクリック可能にする */
    display: block;
    line-height: 0; /* 画像下の余分なスペースを削除 */
}

#scroll-animal-img {
    height: 50px; /* GIFの高さに合わせて調整 */
    width: auto;
}

#scroll-animal-text {
    font-size: 12px;
    color: #333;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.6);
    padding: 3px 8px;
    border-radius: 4px;
}

/* --- レスポンシブ --- */
@media (min-width: 768px) {
    .logo {
        font-size: 1.2rem;
    }
    .main-nav {
        position: static;
        height: auto;
        width: auto;
        background-color: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        display: block;
        transition: none;
        z-index: auto;
    }
    .main-nav ul {
        display: flex;
        flex-direction: row;
    }
    .main-nav li {
        margin: 0 0 0 30px;
    }
    .main-nav a {
        font-size: 0.9rem;
    }
    .hamburger {
        display: none;
    }
    .sticky-cta {
        display: none;
    }
    /* PC表示でページトップへ戻るボタンとフッターが被るのを防ぐ */
    footer {
        /* ボタンの上端が bottom: 80px (30px + 高さ50px) のため、それ以上の余白を確保 */
        padding-bottom: 90px;
    }
}

@media (max-width: 767px) {
    /* 追従CTAボタンを持つページで、フッターとの被りを防ぐ */
    .has-sticky-cta footer {
        padding-bottom: 160px;
    }
    .back-to-top {
        display: none;
    }
}