/*
Theme Name: 마인드가든 안전정보 플랫폼
Theme URI: https://mindgardenhub.com
Description: 재난 안전 수식 정보 공유 커뮤니티
Version: 2.0.127
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
Text Domain: mgh-theme
*/

:root {
    --mgh-bg-main: #f0fdf4;
    --mgh-bg-white: #ffffff;
    --mgh-bg-dark: #14532d;
    --mgh-bg-darker: #052e16;
    --mgh-bg-card: #ffffff;
    --mgh-bg-accent: rgba(34, 197, 94, 0.1);
    --mgh-text-dark: #14532d;
    --mgh-text-body: #365314;
    --mgh-text-muted: #4d7c0f;
    --mgh-text-light: #65a30d;
    --mgh-primary: #22c55e;
    --mgh-primary-dark: #16a34a;
    --mgh-primary-light: #86efac;
    --mgh-border: #bbf7d0;
    --mgh-border-light: #dcfce7;
    --mgh-shadow: 0 4px 20px rgba(20,83,45,0.1);
    --mgh-shadow-lg: 0 12px 40px rgba(20,83,45,0.15);
    --mgh-radius-md: 12px;
    --mgh-radius-lg: 16px;
    --mgh-radius-xl: 24px;
    --mgh-radius-full: 100px;
    --mgh-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --mgh-font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: var(--mgh-font-main); background: var(--mgh-bg-main); color: var(--mgh-text-body); line-height: 1.7; }
a { color: inherit; text-decoration: none; transition: var(--mgh-transition); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--mgh-text-dark); letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.125rem, 2vw, 1.375rem); }

.mgh-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 헤더 */
.mgh-header { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(255,255,255,0.98); backdrop-filter: blur(20px); border-bottom: 1px solid var(--mgh-border-light); }
.mgh-header-inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }
.mgh-logo { display: flex; align-items: center; gap: 10px; font-size: 1.125rem; font-weight: 800; color: var(--mgh-text-dark); }
.mgh-logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg, var(--mgh-primary), var(--mgh-primary-dark)); border-radius: var(--mgh-radius-md); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mgh-logo-icon svg { width: 22px; height: 22px; color: white; }
.mgh-nav-list { display: flex; align-items: center; gap: 32px; }
.mgh-nav-item a { font-size: 0.9375rem; font-weight: 500; color: var(--mgh-text-body); }
.mgh-nav-item a:hover, .mgh-nav-item.active a { color: var(--mgh-primary); }
.mgh-menu-toggle { display: none; width: 40px; height: 40px; background: var(--mgh-bg-white); border: 1px solid var(--mgh-border); border-radius: var(--mgh-radius-md); cursor: pointer; position: relative; }
.mgh-menu-toggle span { position: absolute; left: 50%; transform: translateX(-50%); width: 18px; height: 2px; background: var(--mgh-text-dark); border-radius: 2px; transition: var(--mgh-transition); }
.mgh-menu-toggle span:nth-child(1) { top: 12px; }
.mgh-menu-toggle span:nth-child(2) { top: 19px; }
.mgh-menu-toggle span:nth-child(3) { top: 26px; }
.mgh-menu-toggle.active span:nth-child(1) { top: 19px; transform: translateX(-50%) rotate(45deg); }
.mgh-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mgh-menu-toggle.active span:nth-child(3) { top: 19px; transform: translateX(-50%) rotate(-45deg); }

/* 버튼 */
.mgh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; font-size: 0.9375rem; font-weight: 600; border-radius: var(--mgh-radius-full); transition: var(--mgh-transition); border: none; cursor: pointer; }
.mgh-btn-primary { background: var(--mgh-primary); color: white; }
.mgh-btn-primary:hover { background: var(--mgh-primary-dark); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(34,197,94,0.35); }
.mgh-btn-outline { background: transparent; color: var(--mgh-text-dark); border: 2px solid var(--mgh-border); }
.mgh-btn-outline:hover { border-color: var(--mgh-primary); color: var(--mgh-primary); }

/* 히어로 */
.mgh-hero { min-height: 100vh; display: flex; align-items: center; padding-top: 70px; background: linear-gradient(135deg, var(--mgh-bg-dark), var(--mgh-bg-darker)); position: relative; overflow: hidden; }
.mgh-hero::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2322c55e' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.mgh-hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; position: relative; z-index: 1; }
.mgh-hero-content { max-width: 520px; }
.mgh-hero-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; background: rgba(34,197,94,0.2); border: 1px solid rgba(34,197,94,0.3); border-radius: var(--mgh-radius-full); font-size: 0.8125rem; font-weight: 600; color: var(--mgh-primary-light); margin-bottom: 20px; }
.mgh-hero-badge svg { width: 14px; height: 14px; }
.mgh-hero-title { color: white; margin-bottom: 16px; }
.mgh-hero-title span { color: var(--mgh-primary); }
.mgh-hero-desc { font-size: 1rem; color: rgba(255,255,255,0.7); margin-bottom: 28px; line-height: 1.8; }
.mgh-hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.mgh-hero-stats { display: flex; gap: 32px; margin-top: 40px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); }
.mgh-hero-stat-value { font-size: 2rem; font-weight: 800; color: var(--mgh-primary); }
.mgh-hero-stat-label { font-size: 0.8125rem; color: rgba(255,255,255,0.6); margin-top: 2px; }

/* 히어로 이미지 */
.mgh-hero-image-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mgh-hero-img-card { background: rgba(255,255,255,0.08); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.1); border-radius: var(--mgh-radius-lg); overflow: hidden; transition: var(--mgh-transition); }
.mgh-hero-img-card:hover { transform: translateY(-4px); border-color: var(--mgh-primary); }
.mgh-hero-img-card.large { grid-column: span 2; }
.mgh-hero-img-card img { width: 100%; height: 140px; object-fit: cover; }
.mgh-hero-img-card.large img { height: 180px; }
.mgh-hero-img-info { padding: 14px; }
.mgh-hero-img-info h4 { font-size: 0.875rem; color: white; margin-bottom: 2px; }
.mgh-hero-img-info p { font-size: 0.75rem; color: rgba(255,255,255,0.6); margin: 0; }

/* 섹션 */
.mgh-section { padding: 80px 0; }
.mgh-section-header { text-align: center; max-width: 600px; margin: 0 auto 48px; }
.mgh-section-badge { display: inline-flex; padding: 6px 14px; background: var(--mgh-bg-accent); border-radius: var(--mgh-radius-full); font-size: 0.75rem; font-weight: 600; color: var(--mgh-primary-dark); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.mgh-section-header h2 { margin-bottom: 12px; }
.mgh-section-header p { color: var(--mgh-text-muted); margin: 0; font-size: 0.9375rem; }

/* 통계 */
.mgh-stats-section { background: linear-gradient(135deg, var(--mgh-bg-dark), var(--mgh-bg-darker)); padding: 60px 0; }
.mgh-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.mgh-stat-item { text-align: center; }
.mgh-stat-icon { width: 56px; height: 56px; background: rgba(34,197,94,0.15); border-radius: var(--mgh-radius-lg); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.mgh-stat-icon svg { width: 28px; height: 28px; color: var(--mgh-primary); }
.mgh-stat-value { font-size: 2rem; font-weight: 800; color: white; margin-bottom: 2px; }
.mgh-stat-label { font-size: 0.875rem; color: rgba(255,255,255,0.6); }

/* 특징 */
.mgh-features { background: var(--mgh-bg-white); }
.mgh-features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.mgh-feature-card { background: var(--mgh-bg-main); border: 1px solid var(--mgh-border-light); border-radius: var(--mgh-radius-xl); overflow: hidden; transition: var(--mgh-transition); }
.mgh-feature-card:hover { transform: translateY(-6px); box-shadow: var(--mgh-shadow-lg); border-color: var(--mgh-primary); }
.mgh-feature-img { height: 160px; background: linear-gradient(135deg, var(--mgh-bg-dark), var(--mgh-bg-darker)); display: flex; align-items: center; justify-content: center; }
.mgh-feature-img svg { width: 56px; height: 56px; color: var(--mgh-primary); }
.mgh-feature-body { padding: 24px; }
.mgh-feature-card h4 { font-size: 1.0625rem; margin-bottom: 10px; }
.mgh-feature-card p { font-size: 0.875rem; color: var(--mgh-text-muted); margin: 0; line-height: 1.7; }

/* 필터 */
.mgh-filter { display: flex; justify-content: center; gap: 10px; margin-bottom: 40px; flex-wrap: wrap; }
.mgh-filter-btn { padding: 10px 20px; font-size: 0.8125rem; font-weight: 600; color: var(--mgh-text-body); background: var(--mgh-bg-white); border: 2px solid var(--mgh-border); border-radius: var(--mgh-radius-full); cursor: pointer; transition: var(--mgh-transition); }
.mgh-filter-btn:hover { border-color: var(--mgh-primary); color: var(--mgh-primary); }
.mgh-filter-btn.active { background: var(--mgh-primary); color: white; border-color: var(--mgh-primary); }

/* 포스트 카드 */
.mgh-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.mgh-card { background: var(--mgh-bg-white); border: 1px solid var(--mgh-border); border-radius: var(--mgh-radius-xl); overflow: hidden; transition: var(--mgh-transition); display: flex; flex-direction: column; }
.mgh-card:hover { transform: translateY(-6px); box-shadow: var(--mgh-shadow-lg); }
.mgh-card-image { display: block; position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--mgh-bg-main); }
.mgh-card-image img { width: 100%; height: 100%; object-fit: cover; transition: var(--mgh-transition); }
.mgh-card:hover .mgh-card-image img { transform: scale(1.05); }
.mgh-card-category { position: absolute; top: 12px; left: 12px; padding: 6px 12px; background: var(--mgh-primary); color: white; border-radius: var(--mgh-radius-full); font-size: 0.6875rem; font-weight: 600; }
.mgh-card-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.mgh-card-meta { font-size: 0.75rem; color: var(--mgh-text-light); margin-bottom: 8px; }
.mgh-card-title { font-size: 1rem; margin-bottom: 8px; line-height: 1.5; color: var(--mgh-text-dark); }
.mgh-card-title a:hover { color: var(--mgh-primary); }
.mgh-card-excerpt { font-size: 0.875rem; color: var(--mgh-text-muted); margin-bottom: 16px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.mgh-card-link { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--mgh-primary); margin-top: auto; }
.mgh-card-link svg { width: 14px; height: 14px; transition: var(--mgh-transition); }
.mgh-card-link:hover svg { transform: translateX(4px); }
.mgh-placeholder { width: 100%; height: 100%; background: linear-gradient(135deg, var(--mgh-bg-main), var(--mgh-border-light)); display: flex; align-items: center; justify-content: center; position: absolute; top: 0; left: 0; }
.mgh-placeholder svg { width: 40px; height: 40px; color: var(--mgh-border); }

/* 싱글 */
.mgh-single { padding-top: 120px; padding-bottom: 80px; }
.mgh-single-header { max-width: 800px; margin: 0 auto 40px; text-align: center; }
.mgh-single-category { display: inline-flex; padding: 6px 14px; background: var(--mgh-primary); color: white; border-radius: var(--mgh-radius-full); font-size: 0.75rem; font-weight: 600; margin-bottom: 20px; }
.mgh-single-title { margin-bottom: 16px; }
.mgh-single-meta { display: flex; align-items: center; justify-content: center; gap: 20px; font-size: 0.875rem; color: var(--mgh-text-muted); }
.mgh-single-featured { max-width: 900px; margin: 0 auto 48px; aspect-ratio: 16/9; border-radius: var(--mgh-radius-xl); overflow: hidden; background: var(--mgh-bg-main); box-shadow: var(--mgh-shadow-lg); }
.mgh-single-featured img { width: 100%; height: 100%; object-fit: cover; }
.mgh-single-content { max-width: 720px; margin: 0 auto; }
.mgh-single-content p { font-size: 1rem; line-height: 1.9; margin-bottom: 1.5rem; }
.mgh-single-content h2 { font-size: 1.375rem; margin: 48px 0 20px; }
.mgh-single-content h3 { font-size: 1.125rem; margin: 40px 0 16px; }
.mgh-single-content blockquote { margin: 40px 0; padding: 24px 32px; background: var(--mgh-bg-accent); border-left: 4px solid var(--mgh-primary); border-radius: 0 var(--mgh-radius-lg) var(--mgh-radius-lg) 0; }
.mgh-single-content blockquote p { font-size: 1.0625rem; color: var(--mgh-text-dark); margin: 0; font-style: italic; }
.mgh-single-content ul, .mgh-single-content ol { margin: 24px 0; padding-left: 24px; }
.mgh-single-content li { margin-bottom: 10px; list-style: disc; }
.mgh-single-content a { color: var(--mgh-primary); text-decoration: underline; }

/* CTA */
.mgh-cta { padding: 80px 0; background: linear-gradient(135deg, var(--mgh-primary), var(--mgh-primary-dark)); text-align: center; position: relative; overflow: hidden; }
.mgh-cta::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(ellipse at center, rgba(255,255,255,0.15) 0%, transparent 60%); }
.mgh-cta-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.mgh-cta h2 { color: white; margin-bottom: 16px; }
.mgh-cta p { font-size: 1rem; color: rgba(255,255,255,0.9); margin-bottom: 28px; }
.mgh-cta .mgh-btn { background: white; color: var(--mgh-primary-dark); }
.mgh-cta .mgh-btn:hover { background: var(--mgh-bg-main); }

/* 푸터 */
.mgh-footer { background: var(--mgh-bg-darker); padding: 60px 0 32px; color: rgba(255,255,255,0.7); }
.mgh-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.mgh-footer-brand .mgh-logo { color: white; margin-bottom: 16px; }
.mgh-footer-brand .mgh-logo-icon { background: var(--mgh-primary); }
.mgh-footer-brand p { font-size: 0.875rem; color: rgba(255,255,255,0.6); max-width: 280px; line-height: 1.7; }
.mgh-footer-title { font-size: 0.8125rem; font-weight: 700; margin-bottom: 20px; color: white; text-transform: uppercase; letter-spacing: 0.05em; }
.mgh-footer-links li { margin-bottom: 12px; }
.mgh-footer-links a { font-size: 0.875rem; color: rgba(255,255,255,0.6); }
.mgh-footer-links a:hover { color: var(--mgh-primary); }
.mgh-footer-bottom { display: flex; align-items: center; justify-content: space-between; padding-top: 32px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.8125rem; color: rgba(255,255,255,0.5); }
.mgh-footer-social { display: flex; gap: 10px; }
.mgh-footer-social a { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.1); border-radius: var(--mgh-radius-md); color: rgba(255,255,255,0.7); transition: var(--mgh-transition); }
.mgh-footer-social a:hover { background: var(--mgh-primary); color: white; }

/* 페이지네이션 */
.mgh-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 48px; }
.mgh-pagination a, .mgh-pagination span { display: flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; font-size: 0.875rem; font-weight: 600; color: var(--mgh-text-body); background: var(--mgh-bg-white); border: 2px solid var(--mgh-border); border-radius: var(--mgh-radius-full); transition: var(--mgh-transition); }
.mgh-pagination a:hover { border-color: var(--mgh-primary); color: var(--mgh-primary); }
.mgh-pagination .current { background: var(--mgh-primary); color: white; border-color: var(--mgh-primary); }

/* 반응형 */
@media (max-width: 1024px) {
    .mgh-hero-inner { grid-template-columns: 1fr; gap: 48px; }
    .mgh-hero-content { max-width: 100%; text-align: center; }
    .mgh-hero-actions { justify-content: center; }
    .mgh-hero-stats { justify-content: center; }
    .mgh-hero-image-grid { max-width: 480px; margin: 0 auto; }
    .mgh-features-grid { grid-template-columns: repeat(2, 1fr); }
    .mgh-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .mgh-posts-grid { grid-template-columns: repeat(2, 1fr); }
    .mgh-footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .mgh-header-inner { height: 60px; }
    .mgh-logo { font-size: 1rem; }
    .mgh-logo-icon { width: 36px; height: 36px; }
    .mgh-logo-icon svg { width: 20px; height: 20px; }
    .mgh-nav { position: fixed; top: 60px; left: 0; right: 0; bottom: 0; background: var(--mgh-bg-white); padding: 24px 20px; transform: translateX(100%); transition: var(--mgh-transition); z-index: 999; }
    .mgh-nav.active { transform: translateX(0); }
    .mgh-nav-list { flex-direction: column; gap: 20px; }
    .mgh-menu-toggle { display: flex; align-items: center; justify-content: center; }
    .mgh-hero { min-height: auto; padding: 100px 0 60px; }
    .mgh-hero-image-grid { grid-template-columns: 1fr; }
    .mgh-hero-img-card.large { grid-column: span 1; }
    .mgh-hero-stats { flex-direction: column; gap: 20px; align-items: center; }
    .mgh-hero-actions { flex-direction: column; }
    .mgh-btn { width: 100%; justify-content: center; }
    .mgh-features-grid, .mgh-posts-grid { grid-template-columns: 1fr; }
    .mgh-stats-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .mgh-footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .mgh-footer-bottom { flex-direction: column; gap: 16px; text-align: center; }
    .mgh-section { padding: 60px 0; }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.375rem; }
}
