/* ===== リセットとベース設定 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans CJK JP', 'Yu Gothic UI', 'Meiryo', sans-serif;
    line-height: 1.6;
    color: #323232;
    background-color: #eeede3;
}

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

/* ===== ヘッダー ===== */
header {
    background: linear-gradient(135deg, #f4f3f0 0%, #e8e5dc 50%, #d4cfc2 100%);
    color: #2d2d2d;
    padding: 15px 0 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-bottom: 2px solid #bc7528;
}

.header-nav {
    text-align: right;
    margin-bottom: 10px;
}

.company-link {
    color: #625036;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.company-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.company-logo {
    height: 35px;
    filter: none;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.company-link:hover .company-logo {
    opacity: 1;
}

header h1 {
    font-family: 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', 'HG明朝E', 'MS PMincho', 'MS Mincho', serif;
    font-size: 2.2rem;
    font-weight: 500;
    margin-bottom: 0px;
    color: #32323B;
    text-shadow: 0 1px 2px rgba(188, 117, 40, 0.3);
    letter-spacing: 0.05em;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 400;
    color: #625036;
    opacity: 0.9;
}

/* ===== メインコンテンツ ===== */
main {
    padding-top: 80px;
    padding-bottom: 60px;
}

.support-section {
    background: #ffffff;
    margin-bottom: 20px;
    margin-top: 40px;
    padding: 20px 35px 35px 35px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e4e4e4;
}

/* セクションヘッダー（タイトルと最終更新日） */
.section-header {
    position: relative;
    margin-bottom: 25px;
}

.section-header .section-title {
    color: #32323B;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 0;
    padding-bottom: 5px;
    border-bottom: 3px solid #897c68;
    position: relative;
}

.section-header .section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: #bc7528;
}

/* 最終更新日をタイトルベースラインに合わせて絶対配置 */
.section-header .last-updated {
    position: absolute;
    bottom: 12px;
    right: 0;
    color: #625036;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

/* 通常のセクションタイトル（演習用データ用） */
.section-title {
    color: #32323B;
    font-size: 1.8rem;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 3px solid #897c68;
    position: relative;
    margin-bottom: 30px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: #bc7528;
}

.section-description {
    color: #323232;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    background: #eeede3;
    padding: 10px 18px;
    border-radius: 6px;
    border-left: 4px solid #897c68;
}

/* 実習用コードファイル説明文だけ特別に上マージンを付与 */
.section-description.code-desc {
    margin-top: 20px; /* アイテムとの間隔を確保 */
}


/* ===== コンテンツリスト（縦並び） ===== */
.content-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

.download-item {
    background: #ffffff;
    border: 1px solid #dddbc6;
    border-radius: 8px;
    padding: 15px 20px 18px 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.download-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: #897c68;
}

.download-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #5A427F, #bc7528);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.download-item:hover::before {
    transform: scaleX(1);
}

/* クリック可能なアイテム用のスタイル */
.clickable-item {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.clickable-item:hover {
    text-decoration: none;
    color: inherit;
}

.clickable-item > .icon {
    font-size: 1.8rem;
    color: #bc7528;
    transition: all 0.3s ease;
}

.clickable-item:hover > .icon {
    color: #8b270e;
    transform: scale(1.1);
}

.item-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.item-header h3 {
    color: #625036;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.file-type {
    background: #5A427F;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.description {
    color: #323232;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

/* 演習用データセクション用のダウンロードリンク（表示のみ、クリック不可） */
.clickable-item .download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #bc7528, #8b270e);
    color: #ffffff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(188, 117, 40, 0.3);
    white-space: nowrap;
    pointer-events: none; /* クリック無効化 */
}

/* 通常のダウンロードリンク（正誤表・演習問題解答用、使用しないが互換性のため残す） */
.download-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #bc7528, #8b270e);
    color: #ffffff;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(188, 117, 40, 0.3);
    white-space: nowrap;
}

.download-link:hover {
    background: linear-gradient(135deg, #8b270e, #9e1e07);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(188, 117, 40, 0.4);
}

.download-link .icon {
    font-size: 1.1rem;
}

/* ===== 更新履歴 ===== */
.update-history {
    background: #dddbc6;
    padding: 10px 20px 20px 20px;
    border-radius: 8px;
    margin-top: 40px;
    border-left: 4px solid #897c68;
}

.update-history h2 {
    color: #32323B;
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.history-content {
    background: #ffffff;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #c8c8c8;
}

.history-content p {
    color: #323232;
    margin-bottom: 3px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.history-content p:last-child {
    margin-bottom: 0;
}

/* ===== フッター ===== */
footer {
    background: #32323B;
    color: #cccccc;
    text-align: center;
    padding: 30px 0;
    margin-top: 30px;
}

footer p {
    font-size: 0.9rem;
}

/* ===== レスポンシブデザイン ===== */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header {
        padding: 15px 0 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    main {
        padding-top: 60px;
        padding-bottom: 40px;
    }
    
    .support-section {
        padding: 20px 20px 25px 20px;
        margin-bottom: 15px;
        margin-top: 15px;
    }
    
    .section-header {
        position: static;
        margin-bottom: 20px;
    }
    
    .section-header .last-updated {
        position: static;
        text-align: left;
        margin-top: 10px;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .content-list {
        gap: 15px;
    }
    
    .download-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 20px;
    }
    
    .clickable-item {
        align-items: center;
    }
    
    .item-content {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .item-header {
        justify-content: space-between;
    }
    
    .download-link,
    .clickable-item .download-link {
        align-self: center;
    }
    
    .update-history {
        padding: 25px 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.7rem;
    }
    
    .page-title {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .download-item {
        padding: 15px;
    }
    
    .download-link,
    .clickable-item .download-link {
        width: 100%;
        justify-content: center;
    }
    
    .section-description {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
}

/* 箇条書きのインデント調整 */
.support-section ol,
.support-section ul {
    margin-left: 1em;
    padding-left: 1.2em;
}

/* ===== アクセシビリティ ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== 印刷用スタイル ===== */
@media print {
    header {
        background: none !important;
        color: #323232 !important;
        box-shadow: none !important;
    }
    
    .download-link,
    .clickable-item .download-link {
        background: none !important;
        color: #323232 !important;
        border: 1px solid #323232 !important;
    }
    
    .download-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* ===============================
   h1リンクの色を変えない
   =============================== */
h1.page-h1 > a.h1-link,
h1.page-h1 > a.h1-link:any-link,
h1.page-h1 > a.h1-link:link,
h1.page-h1 > a.h1-link:visited,
h1.page-h1 > a.h1-link:hover,
h1.page-h1 > a.h1-link:active,
h1.page-h1 > a.h1-link:focus,
h1.page-h1 > a.h1-link * {
  color: currentColor !important;
  text-decoration: none;
}

/* ホバー/フォーカス時は色は変えず下線のみ */
h1.page-h1 > a.h1-link:hover,
h1.page-h1 > a.h1-link:focus {
  text-decoration: underline;
  text-underline-offset: 2px;
}
