/**
 * DietLab メインスタイルシート
 * 全ページ共通のスタイリング
 */

/* リセット & 基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Noto Sans JP', sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #f8f9fa;
}

/* カラーパレット */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --background-light: #f9fafb;
    --white: #ffffff;
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

/* レイアウト */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section {
    padding: 4rem 0;
}

/* ヘッダー */
header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

nav a:hover {
    color: var(--primary-color);
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 50%;
    background: var(--gradient-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 100%;
}

/* パンくずリスト */
.breadcrumb {
    background: var(--background-light);
    padding: 1rem 0;
    font-size: 0.9rem;
}

.breadcrumb-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 記事コンテンツ */
.article-header {
    text-align: center;
    padding: 4rem 0;
    background: var(--gradient-primary);
    color: var(--white);
    margin-bottom: 3rem;
}

.article-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.article-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    font-size: 0.9rem;
    opacity: 0.8;
}

.content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    margin-bottom: 3rem;
}

.content h2 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 3rem 0 1.5rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

.content h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 2rem 0 1rem 0;
}

.content h4 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin: 1.5rem 0 0.5rem 0;
}

.content p {
    margin-bottom: 1.5rem;
}

.content ul, .content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.content li {
    margin-bottom: 0.5rem;
}

.content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 2rem;
    margin: 2rem 0;
    background: var(--background-light);
    border-radius: 0 10px 10px 0;
    font-style: italic;
}

/* 画像 */
.content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 2rem auto;
    display: block;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* テーブル */
.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.content th,
.content td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.content th {
    background: var(--gradient-primary);
    color: var(--white);
    font-weight: 600;
}

/* ボックス要素 */
.summary-box {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 2rem;
    border-radius: 15px;
    margin: 3rem 0;
}

.summary-box h3 {
    margin-bottom: 1rem;
}

.info-box {
    background: var(--background-light);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.info-box.warning {
    border-color: var(--warning-color);
    background: #fef3c7;
}

.info-box.success {
    border-color: var(--success-color);
    background: #d1fae5;
}

/* 目次 */
.toc {
    background: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    margin: 3rem 0;
}

.toc h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.toc ul {
    list-style: none;
    padding: 0;
}

.toc li {
    margin: 0.5rem 0;
}

.toc a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.toc a:hover {
    color: var(--primary-color);
}

/* FAQ */
.faq-section {
    margin: 3rem 0;
}

.faq-item {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.faq-question {
    background: var(--background-light);
    padding: 1.5rem;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.faq-question:hover {
    background: #e5e7eb;
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-answer.active {
    padding: 1.5rem;
    max-height: 300px;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: var(--background-light);
    color: var(--text-color);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* CTA セクション */
.cta-section {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    margin: 3rem 0;
}

.cta-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.cta-button {
    background: var(--white);
    color: var(--primary-color);
    padding: 1rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255,255,255,0.3);
}

/* 関連記事 */
.related-articles {
    margin: 3rem 0;
}

.related-articles h3 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.related-card {
    background: var(--white);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    border: 2px solid transparent;
}

.related-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.related-image {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.related-title {
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
}

/* アフィリエイト */
.affiliate-section {
    background: var(--background-light);
    border: 2px dashed var(--border-color);
    border-radius: 15px;
    padding: 2rem;
    margin: 3rem 0;
    text-align: center;
}

.affiliate-note {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* フッター */
footer {
    background: var(--text-color);
    color: var(--white);
    padding: 4rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bdc3c7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--white);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .content {
        padding: 2rem 1.5rem;
        margin: 0 1rem 2rem 1rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 1rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 1.8rem;
    }
    
    .content {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem 2rem 0.5rem;
    }
    
    .summary-box,
    .info-box,
    .toc {
        padding: 1.5rem;
        margin: 2rem 0.5rem;
    }
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 印刷スタイル */
@media print {
    .cta-section,
    .related-articles,
    .affiliate-section,
    header,
    footer {
        display: none;
    }
    
    .content {
        box-shadow: none;
        padding: 0;
    }
}

/* ユーティリティクラス */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.hidden { display: none; }
.visible { display: block; }