/* 変数定義 */
:root {
    --color-primary: #005511;   /* クリスマスグリーン */
    --color-secondary: #a8d4b0;    /* 落ち着いたセージグリーン */
    --color-accent: #ffd700;       /* ゴールド */
    --color-text: #000000;         /* 黒 */
    --color-heading: #D4AF37;      /* ダークグリーン */
    --color-background: #b90130;   /* ハニーデュー(薄緑) */
    --spacing-unit: 1rem;
    --border-radius: 12px;
}

/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基本スタイル */
body {
    font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'ヒラギノ丸ゴ ProN W4', 'メイリオ', sans-serif;
    line-height: 1.8;
    color: var(--color-text);
    background-color: var(--color-background);
}

/* 見出し */
h1, h2, h3 {
    color: var(--color-heading);
    line-height: 1.4;
}

h1 {
    font-size: 3rem;
    margin-bottom: var(--spacing-unit);
}

h2 {
    font-size: 1.8rem;
    border-bottom: 3px solid #8b0000;
    padding-bottom: 0.5rem;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

/* ヘッダー */
header {
    position: relative;
    width: 980px;
    height: auto;
    margin: 0 auto;
}

#header1 {
    width: 980px;
    height: auto;
}

#header1 img {
    width: auto;
    height: 70px;
    object-fit: contain;
}

#headbox {
    background-color: #f8f5ee;
    width: 100%;
    padding: 5px 0;
}

/* ヘッダーメニューリンク */
#hd_menu a,
#hd_menu a:link {
    color: #ffffff;
    text-decoration: none;
}

#hd_menu a:visited {
    color: #ffffff;
}

#hd_menu a:hover,
#hd_menu a:active {
    color: #33ff33;
}

/* レイアウト */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 2);
}

/* ヒーローセクション */
.hero {
    background-color: #005511;
    padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 8%),
        radial-gradient(circle at 25% 25%, rgba(255,255,255,0.08) 0%, transparent 4%);
    background-size: 100px 100px, 80px 80px;
    animation: snowfall 20s linear infinite;
    opacity: 0.6;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        url('images/snow-pattern.png'),
        url('images/sparkle.png');
    background-size: 300px 300px, 200px 200px;
    opacity: 0.15;
    animation: twinkle 10s ease-in-out infinite;
}

.hero-content {
    margin-bottom: calc(var(--spacing-unit) * 2);
    position: relative;
    background: rgba(0, 0, 0, 0.4);
    padding: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    display: inline-block;
}

.hero-content h1 {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 700;
    color: white;
    text-shadow: 
        2px 2px 0 rgba(0,0,0,0.5),
        -2px 2px 0 rgba(0,0,0,0.5),
        2px -2px 0 rgba(0,0,0,0.5),
        -2px -2px 0 rgba(0,0,0,0.5);
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}

.hero-content h1 span {
    color: #FFD700;
}

.hero-subtitle {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    font-weight: 400;
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.hero-image {
    width: 100%;
    height: 400px;
    object-fit: contain;
    border-radius: var(--border-radius);
    margin: 0 auto;
    display: block;
}

/* アニメーション */
@keyframes snowfall {
    from { background-position: 0 0; }
    to { background-position: 100% 100%; }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.15;
        transform: scale(1);
    }
    50% {
        opacity: 0.2;
        transform: scale(1.05);
    }
}

/* コンポーネント */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: calc(var(--spacing-unit) * 1.5);
    margin: calc(var(--spacing-unit) * 2) 0;
}

.stat-card {
    background: white;
    padding: calc(var(--spacing-unit) * 1.5);
    border-radius: var(--border-radius);
    text-align: center;
    border: 2px solid var(--color-primary);
}

.stat-number {
    font-size: 2.5rem;
    color: var(--color-heading);
    font-weight: bold;
}

.content-section {
    background: white;
    padding: calc(var(--spacing-unit) * 2.5);
    margin-bottom: calc(var(--spacing-unit) * 2);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.highlight-box {
    background-color: var(--color-secondary);
    padding: calc(var(--spacing-unit) * 1.5);
    border-radius: var(--border-radius);
    margin: var(--spacing-unit) 0;
}

/* 寄付方法 */
.donation-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: calc(var(--spacing-unit) * 1.5);
    margin: calc(var(--spacing-unit) * 2) 0;
}

.donation-method-card {
    background: white;
    padding: calc(var(--spacing-unit) * 1.5);
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.method-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-unit);
    display: block;
}

.method-icon i {
    font-size: 2.5rem;
    color: var(--color-primary);
}

/* 施設グリッド */
.facility-grid {
    display: flex;
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 4);
    margin: calc(var(--spacing-unit) * 2) 0;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.facility-card {
    display: flex;
    align-items: center;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.2s ease;
    gap: calc(var(--spacing-unit) * 3);
    padding: calc(var(--spacing-unit) * 2);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.facility-card:nth-child(even) {
    flex-direction: row-reverse;
}

.facility-card a {
    flex: 0 0 320px;
}

.facility-card img {
    width: 320px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--border-radius);
    transition: transform 0.3s ease;
}

.facility-card:hover img {
    transform: scale(1.03);
}

.facility-card .content {
    flex: 1;
}

.facility-card h3 {
    color: var(--color-heading);
    font-size: 1.5rem;
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .facility-card,
    .facility-card:nth-child(even) {
        flex-direction: column;
        padding: var(--spacing-unit);
        align-items: center;
        text-align: center;
    }

    .facility-card a {
        flex: none;
        width: 280px;
    }

    .facility-card img {
        width: 280px;
        height: 35px;
    }

    .facility-card .content {
        padding-top: var(--spacing-unit);
    }
}

/* ボタン */
.cta-button {
    display: inline-block;
    padding: var(--spacing-unit) calc(var(--spacing-unit) * 2.5);
    background-color: var(--color-heading);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    margin-top: var(--spacing-unit);
    transition: all 0.3s ease;
    font-weight: bold;
}

.cta-button:hover {
    background-color: #2c6154;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* リスト */
.location-list,
.usage-list {
    list-style-position: inside;
    margin: var(--spacing-unit) 0;
}

.location-list li,
.usage-list li {
    margin-bottom: calc(var(--spacing-unit) * 0.5);
}

/* 目的ボックス */
.purpose-box {
    margin: calc(var(--spacing-unit) * 4) 0;
    background-color: white;
    padding: calc(var(--spacing-unit) * 3);
    border-radius: calc(var(--border-radius) * 2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 2px solid var(--color-primary);
}

.purpose-box .content-section {
    margin-bottom: 0;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
}

.purpose-header {
    text-align: center;
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.purpose-header h2 {
    font-size: 2.4rem;
    color: var(--color-primary);
    border-bottom: none;
    position: relative;
    display: inline-block;
}

.purpose-header h2::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
}

.purpose-text {
    font-size: 1.2rem;
    line-height: 2;
    padding: var(--spacing-unit);
}

/* ユーティリティ */
.note {
    font-size: 0.9rem;
    color: #666;
    margin-top: var(--spacing-unit);
}

/* レスポンシブ */
@media (max-width: 768px) {
    h1 { 
        font-size: 2rem; 
        margin-bottom: calc(var(--spacing-unit) * 0.75);
    }
    
    h2 { font-size: 1.5rem; }
    
    .container {
        padding: var(--spacing-unit);
        margin: 0 15px;
    }

    header {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
    }

    #header1 {
        width: 100%;
        height: auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    #header1 h1 {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    /* 中央画像と清泉寮ロゴを非表示に */
    .middle-image {
        display: none;
    }

    /* KEEP協会のロゴのみ表示 */
    .keep-logo img {
        width: auto;
        height: 70px;
        display: block;
    }

    .hero-content {
        padding: var(--spacing-unit);
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .donation-methods {
        grid-template-columns: 1fr;
        gap: var(--spacing-unit);
    }

    .facility-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-unit);
    }

    .facility-card img {
        max-height: 250px;
    }

    .stat-card {
        padding: var(--spacing-unit);
    }

    .stat-number {
        font-size: 2rem;
    }

    .cta-button {
        padding: calc(var(--spacing-unit) * 0.75) calc(var(--spacing-unit) * 1.5);
        width: 100%;
        text-align: center;
    }

    .purpose-box .image-wrapper img {
        max-height: 300px;
    }

    #headbox {
        padding: 5px 0;
    }

    .hero-image {
        height: 300px;
    }
}

/* さらに小さい画面用の調整 */
@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    
    .hero-content h1 { font-size: 1.6rem; }
    
    .purpose-header h2 { font-size: 1.5rem; }
    
    .purpose-text { font-size: 0.9rem; }
    
    .content-section {
        padding: var(--spacing-unit);
        margin-bottom: var(--spacing-unit);
    }

    .hero-image {
        height: 200px;
    }
}

/* スマホ用のヘッダー画像を非表示 */
.header-logo-mobile {
    display: none;
}

/* 目的ボックス */
.purpose-box .image-wrapper {
    text-align: center;
    margin: 0 auto;
    max-width: 600px;
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.purpose-box .image-wrapper img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* 共通の画像スタイル */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .hero-image {
        max-height: 300px;
    }

    .purpose-box .image-wrapper {
        max-width: 100%;
    }

    .facility-card img {
        max-height: 250px;
    }
}

/* さらに小さい画面用の調整 */
@media (max-width: 480px) {
    .hero-image {
        max-height: 200px;
    }

    .purpose-box .image-wrapper img {
        max-height: 200px;
    }

    .facility-card img {
        max-height: 180px;
    }
}

/* フッター */
.site-footer {
    background-color: #005511;
    padding: calc(var(--spacing-unit) * 3) 0;
    margin-top: calc(var(--spacing-unit) * 4);
}

.footer-content {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
    text-align: center;
}

.footer-info {
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.footer-title {
    font-size: 1.4rem;
    color: #fff;
    border: none;
    margin-bottom: calc(var(--spacing-unit) * 0.5);
    padding: 0;
}

.footer-subtitle {
    font-size: 0.9rem;
    color: #fff;
    letter-spacing: 0.05em;
}

.social-links {
    margin: calc(var(--spacing-unit) * 2) 0;
    display: flex;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 1.5);
}

.social-links a {
    font-size: 24px;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 50%;
    background: #fff;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.social-links a .fa-x-twitter {
    color: #000;
}

.social-links a .fa-facebook-f {
    color: #1877f2;
}

.social-links a .fa-instagram {
    color: #e4405f;
}

.social-links a .fa-youtube {
    color: #ff0000;
}

/* ホバーエフェクト */
.social-links a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.social-links img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.footer-address {
    font-style: normal;
    margin-bottom: calc(var(--spacing-unit) * 2);
    font-size: 0.9rem;
    color: #fff;
}

.copyright {
    font-size: 0.8rem;
    color: #ffffff;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .site-footer {
        padding: calc(var(--spacing-unit) * 2) 0;
    }

    .footer-content {
        padding: 0 calc(var(--spacing-unit) * 1.5);
    }

    .footer-title {
        font-size: 1.2rem;
    }

    .social-links {
        gap: var(--spacing-unit);
    }

    .social-links img {
        width: 35px;
        height: 35px;
    }
}