/* --- 変数定義 --- */
:root {
    --c-bg: #fffbf0;      /* 生成り色 */
    --c-text: #5d4037;    /* 焦げ茶 */
    --c-main: #ff9f43;    /* オレンジ */
    --c-green: #1dd1a1;   /* 緑 */
    --c-accent: #ff6b6b;  /* 赤 */
    --c-white: #ffffff;
    --header-height: 80px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Zen Maru Gothic', sans-serif;
    background-color: var(--c-bg);
    color: var(--c-text);
    margin: 0; padding: 0; line-height: 1.8;
    background-image: radial-gradient(#ddd 1px, transparent 1px);
    background-size: 30px 30px;
    overflow-x: hidden; position: relative;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; padding: 0; }
img:not(.header-logo-img) { max-width: 100%; height: auto; border-radius: 10px; }

.container {
    max-width: 900px; margin: 0 auto; padding: 0 20px;
    position: relative; z-index: 10;
}

/* --- ふわふわイラスト --- */
.doodle-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: hidden; }
.doodle { position: absolute; width: 60px; height: 60px; background-size: contain; background-repeat: no-repeat; background-position: center; opacity: 0.4; animation: floatUp linear infinite; }
@keyframes floatUp { 
    0% { transform: translateY(105vh) rotate(0deg) scale(0.8); opacity: 0; } 
    15% { opacity: 0.4; } 
    85% { opacity: 0.4; } 
    100% { transform: translateY(-15vh) rotate(360deg) scale(1); opacity: 0; } 
}

/* --- 左右固定イラスト --- */
.side-deco { position: fixed; width: 120px; z-index: 5; opacity: 0.9; filter: drop-shadow(3px 3px 0px rgba(0,0,0,0.1)); pointer-events: none; }
.deco-left-top { top: 100px; left: -20px; transform: rotate(10deg); }
.deco-left-bottom { bottom: 50px; left: 10px; transform: rotate(-10deg) scale(0.8); }
.deco-right-top { top: 150px; right: -10px; transform: rotate(-15deg); }
.deco-right-bottom { bottom: 100px; right: 0px; transform: rotate(5deg) scale(0.9); }
@media (max-width: 1100px) { .side-deco { display: none; } }

/* --- タイトル装飾 --- */
.title-logo-wrapper { position: relative; display: inline-block; margin-bottom: 20px; padding: 10px 40px; }
.title-kana { display: block; font-size: 1.2rem; color: var(--c-text); font-weight: bold; margin: 0 0 -5px 0; text-align: center; transform: rotate(-3deg); text-shadow: 1px 1px 0 #fff; }
h1.main-title { font-size: 3.5rem; color: var(--c-main); margin: 0; font-weight: 900; line-height: 1.2; transform: rotate(-3deg); text-shadow: 3px 3px 0 #fff, 6px 6px 0 rgba(0,0,0,0.1); z-index: 2; position: relative; }
.title-logo-wrapper::before { content: '☀️'; position: absolute; top: -20px; left: -10px; font-size: 2.5rem; transform: rotate(-15deg); z-index: 1; text-shadow: 2px 2px 0 #fff; }
.title-logo-wrapper::after { content: '🏠'; position: absolute; bottom: 0; right: -10px; font-size: 2.5rem; transform: rotate(15deg); z-index: 1; text-shadow: 2px 2px 0 #fff; }
.title-underline { width: 100%; height: 10px; background: var(--c-green); opacity: 0.5; border-radius: 50%; margin-top: -15px; transform: rotate(-2deg); position: absolute; bottom: 15px; left: 0; z-index: 0; }
ruby { font-weight: bold; } rt { font-size: 0.6em; color: var(--c-main); font-weight: normal; }
@media (max-width: 600px) { h1.main-title { font-size: 2.2rem; } .title-kana { font-size: 0.9rem; } .title-logo-wrapper { padding: 10px 20px; } .title-logo-wrapper::before { font-size: 1.8rem; top: -15px; left: -5px; } .title-logo-wrapper::after { font-size: 1.8rem; bottom: -5px; right: -5px; } }

/* --- 共通パーツ --- */
section { padding: 60px 0; border-bottom: none; background: rgba(255, 251, 240, 0.6); scroll-margin-top: var(--header-height); }
section:last-child { border-bottom: none; }
h2 { text-align: center; font-size: 1.8rem; color: var(--c-main); margin-bottom: 40px; display: flex; align-items: center; justify-content: center; gap: 15px; }
h2::before, h2::after { content: ''; display: inline-block; width: 10px; height: 10px; background: var(--c-green); border-radius: 50%; }
.title-marker { background: linear-gradient(transparent 60%, rgba(255, 235, 59, 0.6) 60%); padding: 0 10px; border-radius: 8px; }
.logo-marker { background: linear-gradient(transparent 50%, rgba(255, 235, 59, 0.8) 50%); padding: 0 5px; border-radius: 4px; }
.crayon-box { background: var(--c-white); border: 3px solid var(--c-text); border-radius: 2% 3% 2% 4% / 95% 90% 95% 95%; padding: 30px; box-shadow: 4px 4px 0 rgba(0,0,0,0.1); position: relative; margin-bottom: 30px; }
.btn { display: inline-block; padding: 12px 30px; font-weight: bold; border-radius: 30px; text-align: center; box-shadow: 0 4px 0 rgba(0,0,0,0.15); transform: rotate(-1deg); }
.btn:hover { transform: translateY(2px) rotate(0deg); box-shadow: 0 2px 0 rgba(0,0,0,0.15); }
.btn-main { background: var(--c-main); color: #fff; }
.btn-green { background: var(--c-green); color: #fff; }
.btn-insta { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); color: #fff; }
.marker { background: linear-gradient(transparent 60%, #fff200 60%); font-weight: bold; padding: 0 5px; }

/* --- ヘッダー & ナビ --- */
header { background: rgba(255, 255, 255, 0.95); padding: 15px 0; position: sticky; top: 0; z-index: 100; border-bottom: 3px dashed var(--c-main); transition: all 0.3s ease; }
header.header-shrink { padding: 5px 0; background: rgba(255, 255, 255, 0.98); box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.nav-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-weight: 900; color: var(--c-text); letter-spacing: 0.05em; transition: all 0.3s ease; white-space: nowrap; }
.header-logo-img { height: 45px; width: auto; transition: all 0.3s ease; }
header.header-shrink .logo { font-size: 1.1rem; }
header.header-shrink .header-logo-img { height: 35px; }
.global-nav ul { display: flex; gap: 20px; }
.global-nav a { font-weight: bold; font-size: 0.95rem; padding: 5px 10px; border-radius: 5px; transition: 0.3s; cursor: pointer; white-space: nowrap; }
.global-nav a:hover { background: linear-gradient(transparent 60%, rgba(255, 235, 59, 0.6) 60%); color: var(--c-text); text-decoration: none; }
@media (max-width: 768px) { .global-nav { display: none; } }

/* --- 各セクション特有 --- */
.hero { text-align: center; padding: 20px 0 20px; background: transparent; }
.hero-msg { font-size: 1.1rem; margin-bottom: 20px; font-weight: bold; color: var(--c-text); }
.next-event-card { border: 4px dashed var(--c-main); background: #fff; max-width: 800px; margin: 0 auto; position: relative; }
.next-event-card::before { content: 'Next !'; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); background: var(--c-accent); color: #fff; padding: 5px 20px; font-weight: bold; border-radius: 20px; transform: translateX(-50%) rotate(-3deg); }
.event-detail dl { display: grid; grid-template-columns: 80px 1fr; gap: 10px; text-align: left; margin: 0; }
.event-detail dt { color: var(--c-main); font-weight: bold; text-align: right; }
.price-area { background: #ffeaa7; padding: 10px; border-radius: 10px; margin-top: 15px; font-weight: bold; }
.price-free { font-size: 1.4rem; color: var(--c-accent); margin-right: 10px; }
.rep-img { width: 150px; height: 150px; background: #ccc; border-radius: 50%; margin: 0 auto; border: 5px solid #fff; box-shadow: 0 0 0 3px var(--c-green); overflow: hidden; }
.step-flow { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-top: 20px; }
.step-item { flex: 1; min-width: 200px; text-align: center; background: #fff; padding: 20px; border-radius: 15px; position: relative; border: 2px solid var(--c-bg); box-shadow: 3px 3px 10px rgba(0,0,0,0.05); }
.step-num { display: inline-block; background: var(--c-green); color: #fff; width: 30px; height: 30px; line-height: 30px; border-radius: 50%; font-weight: bold; margin-bottom: 10px; }

/* ==========================================
   自動＆手動スクロールギャラリー（#report 内のみに限定！）
   ========================================== */
#report .gallery-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0 30px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#report .gallery-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

#report .gallery-scroll-track {
    display: inline-flex;
    align-items: center; /* 枠が縦に伸びるのを防ぐ */
    gap: 20px;
    padding: 15px 10px;
}

#report .gallery-item {
    width: 280px; 
    flex-shrink: 0;
    white-space: normal;
    background: #fff;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transform: rotate(2deg);
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: grab;
}

#report .gallery-item:nth-child(even) { transform: rotate(-1deg); }
#report .gallery-item:hover {
    transform: scale(1.05) rotate(0deg);
    z-index: 10;
    position: relative;
}

/* 写真自体を歪ませない設定（ここも#report内に限定） */
#report .gallery-item img {
    width: 100%;
    height: 180px; 
    object-fit: cover; 
    display: block; 
    border-radius: 4px; 
}


/* --- その他のセクション --- */
.contact-box { text-align: center; }
.phone-btn { display: block; background: #fff; border: 3px solid var(--c-text); border-radius: 10px; padding: 15px; font-size: 1.5rem; font-weight: bold; margin: 20px auto; max-width: 300px; }
.support-section { background-color: rgba(255, 248, 225, 0.8); border-top: 3px solid var(--c-main); border-bottom: 3px solid var(--c-main); }
.support-grid { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-top: 20px; }
.support-card { flex: 1; min-width: 140px; padding: 15px; background: #fff; border-radius: 15px 5px 15px 5px; border: 2px dashed; text-align: center; position: relative; transition: 0.3s; box-shadow: 3px 3px 0 rgba(0,0,0,0.1); }
.support-card:hover { transform: translateY(-3px); box-shadow: 3px 5px 0 rgba(0,0,0,0.1); }
.support-img {
    display: block;
    margin: 0 auto 10px; 
    height: 80px;       
    width: auto;        
}
.support-card h3 { margin: 0 0 5px 0; font-size: 1rem; }
.support-card p { font-size: 0.85rem; margin-bottom: 0; line-height: 1.4; }
.sub-text { font-size: 0.75rem; opacity: 0.8; display: block; margin-top: 3px; }
.card-food { border-color: #7bed9f; background-color: #f0fff4; } .card-food h3 { color: #27ae60; }
.card-volunteer { border-color: #ffa502; background-color: #fffaf0; } .card-volunteer h3 { color: #e67e22; }
.card-money { border-color: #ff6b81; background-color: #fff0f3; } .card-money h3 { color: #ff4757; }

/* --- Special Thanks! (協賛者様) --- */
.sponsor-section {
    background: #fffdf5;
    margin-top: 50px;
    border-color: var(--c-main);
}
.sponsor-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}
.sponsor-item {
    background: #fff;
    border: 2px dashed var(--c-main);
    border-radius: 30px;
    padding: 8px 20px;
    font-weight: bold;
    color: var(--c-text);
    box-shadow: 2px 2px 0 rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
}
.sponsor-item a {
    display: block;
    color: inherit;
}
.sponsor-item:hover {
    transform: translateY(-3px) rotate(-2deg);
    box-shadow: 2px 5px 0 rgba(0,0,0,0.1);
    background: #fffbe6;
    border-style: solid;
}
.sponsor-honorific {
    font-size: 0.8em;
    font-weight: normal;
    color: #888;
    margin-left: 2px;
}

/* --- フッター関連 --- */
footer { text-align: center; padding: 30px; font-size: 0.8rem; background: #5d4037; color: #fff; position: relative; z-index: 10; }
footer p { margin: 5px 0; line-height: 1.4; }
footer a { color: #ffcc80; text-decoration: underline; }
footer a:hover { color: #fff; text-decoration: none; }
.bold { font-weight: bold; }

/* --- 次回イベントカードのレイアウト調整 --- */
.next-event-flex {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: space-between;
}

.next-event-info {
    flex: 1;
}

.next-event-image-box {
    width: 250px;
    flex-shrink: 0;
}

.next-event-image-box img {
    width: 100%;
    height: auto;
    border: 1px solid #ddd;
    box-shadow: 3px 3px 5px rgba(0,0,0,0.1);
    transform: rotate(2deg);
    background: #fff;
    padding: 5px;
}

@media (max-width: 700px) {
    .next-event-flex {
        flex-direction: column-reverse; 
        align-items: center;
    }
    .next-event-image-box {
        width: 100%;
        max-width: 300px;
        margin: 0 auto 20px auto; 
    }
}

/* 印刷・PDF化の設定 */
@media print {
    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .title-marker {
        background-color: transparent !important;
    }
}

/* ==========================================
   ローディング画面用スタイル
   ========================================== */
body.is-loading {
    overflow: hidden;
    height: 100vh;
}

#loading {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: var(--c-bg);
    background-image: radial-gradient(#ddd 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loading.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-parts {
    position: absolute;
    width: 150px;
    height: 150px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lp {
    position: absolute;
    width: 70px;
    height: 70px;
    opacity: 0;
    transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(2px 2px 0px rgba(0,0,0,0.1));
}

.lp-1 { transform: translate(-100vw, -100vh) rotate(-180deg) scale(0.5); }
.lp-2 { transform: translate(100vw, -100vh) rotate(180deg) scale(0.5); }
.lp-3 { transform: translate(-100vw, 100vh) rotate(-180deg) scale(0.5); }
.lp-4 { transform: translate(100vw, 100vh) rotate(180deg) scale(0.5); }

#loading.is-gathering .lp-1 { opacity: 1; transform: translate(-35px, -35px) rotate(-15deg) scale(1); }
#loading.is-gathering .lp-2 { opacity: 1; transform: translate(35px, -35px) rotate(15deg) scale(1); }
#loading.is-gathering .lp-3 { opacity: 1; transform: translate(-35px, 35px) rotate(-15deg) scale(1); }
#loading.is-gathering .lp-4 { opacity: 1; transform: translate(35px, 35px) rotate(15deg) scale(1); }

#loading.is-popping .lp {
    opacity: 0;
    transform: scale(2);
    transition: all 0.5s ease;
}

.loading-main-logo {
    position: absolute;
    width: 90%;
    max-width: 450px;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#loading.is-showing-logo .loading-main-logo {
    opacity: 1;
    transform: scale(1);
}

/* ==========================================
   管理画面のスマホ対応（レスポンシブ）
   ========================================== */
@media (max-width: 768px) {
    /* テーブル（一覧表）を横スクロールさせる */
    .crayon-box table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        width: 100%;
        -webkit-overflow-scrolling: touch; /* iPhoneで滑らかにスクロール */
    }

    /* 入力フォームが画面端（margin）を突き破らないように幅を100%にする */
    .crayon-box input[type="text"],
    .crayon-box input[type="password"],
    .crayon-box input[type="url"],
    .crayon-box input[type="number"],
    .crayon-box input[type="date"],
    .crayon-box textarea,
    .crayon-box select {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* 横並びのフォーム（新規追加など）を、スマホでは縦並びにする */
    .crayon-box form[style*="display:flex"] {
        flex-direction: column;
        align-items: stretch !important;
    }
    .crayon-box form[style*="display:flex"] > div {
        width: 100% !important;
    }

    /* 左右のボタンがはみ出さないように折り返す */
    .crayon-box form > div[style*="display:flex"] {
        flex-wrap: wrap;
    }
}