/* ===========================================================
   変数定義（ライト/ダーク共通）
   =========================================================== */
:root {
    --bg-color: #f8f9fa;
    --tile-bg: #ffffff;
    --text-color: #22262a;
    --text-muted: #6a737d;
    --border-color: #e1e4e8;
    --accent-orange: #e65100;
    --accent-orange-bg: #fff3e0;
    --pdf-link-bg: #f1f4f9;
    --pdf-link-hover: #e8ecf3;
    --pdf-link-border: #3b82f6;
    --shadow: rgba(0, 0, 0, 0.08);
}

/* ダークモード設定 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --tile-bg: #1e1e1e;
        --text-color: #e1e4e8;
        --text-muted: #959da5;
        --border-color: #30363d;
        --accent-orange: #ffb74d;
        --accent-orange-bg: #33261a;
        --pdf-link-bg: #252a33;
        --pdf-link-hover: #2d333b;
        --pdf-link-border: #3b82f6;
        --shadow: rgba(0, 0, 0, 0.4);
    }
}

/* 全体設定 */
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

.container {
    max-width: 840px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ===========================================================
   タイルデザイン
   =========================================================== */
.tile {
    background: var(--tile-bg);
    padding: 32px 40px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px var(--shadow);
    border: 1px solid var(--border-color);
}

/* 画像タイル */
.image-tile {
    padding: 0;
    overflow: hidden;
}

.main-image {
    width: 100%;
    display: block;
    max-height: 500px;
    object-fit: cover;
}

.caption {
    padding: 12px 20px;
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    background: rgba(0, 0, 0, 0.03);
}

/* タイトルエリア */
.title {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.3;
}

.meta { margin-top: 16px; }

.event-date {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 700;
    background: var(--accent-orange-bg);
    color: var(--accent-orange);
}

/* ===========================================================
   Markdown Viewer (Toast UI風タイポグラフィ)
   =========================================================== */
.toastui-editor-contents {
    font-size: 16px;
}

/* 見出しのデザイン */
.toastui-editor-contents h1,
.toastui-editor-contents h2 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-top: 32px;
    margin-bottom: 16px;
}

.toastui-editor-contents h1 { font-size: 28px; }
.toastui-editor-contents h2 { font-size: 24px; }
.toastui-editor-contents h3 { font-size: 20px; margin-top: 24px; }

/* 引用 */
.toastui-editor-contents blockquote {
    margin: 20px 0;
    padding: 0 16px;
    color: var(--text-muted);
    border-left: 4px solid var(--border-color);
}

/* リスト */
.toastui-editor-contents ul, 
.toastui-editor-contents ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.toastui-editor-contents li { margin-bottom: 4px; }

/* 強調・コード */
.toastui-editor-contents code {
    padding: 2px 4px;
    background-color: var(--pdf-link-bg);
    border-radius: 4px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

/* 画像 */
.toastui-editor-contents img {
    max-width: 100%;
    border-radius: 8px;
    margin: 16px 0;
}

/* ===========================================================
   PDFエリア
   =========================================================== */
.section-title {
    margin: 0 0 20px 0;
    font-size: 20px;
}

.pdf-link {
    display: block;
    padding: 16px 20px;
    margin-bottom: 12px;
    background: var(--pdf-link-bg);
    border-left: 4px solid var(--pdf-link-border);
    border-radius: 8px;
    color: var(--text-color);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.pdf-link:hover {
    background: var(--pdf-link-hover);
    transform: translateX(4px);
}

/* ===========================================================
   戻るボタン
   =========================================================== */
.back {
    margin: 40px 0 80px 0;
    text-align: center;
}

.back a {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    padding: 12px 24px;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    transition: all 0.2s;
    background: var(--tile-bg);
}

.back a:hover {
    background: var(--text-color);
    color: var(--tile-bg);
    border-color: var(--text-color);
}

/* スマホ対応 */
@media (max-width: 600px) {
    .container { padding: 0 12px; }
    .tile { padding: 24px 20px; }
    .title { font-size: 24px; }
    .main-image { max-height: 300px; }
}