:root {
    --color-primary: #D68910;
    --color-secondary: #FAD7A0;
    --color-background: #FDFEFE;
    --color-text: #333;
    --color-dark: #964B00;
}

body {
    font-family: 'メイリオ', serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-background);
    color: var(--color-text);
}

header {
    background-color: var(--color-primary);
    color: var(--color-background);
    padding: 20px 8px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    letter-spacing: 2px;
}

header h1 {
    margin: 0 0 5px 0;
    font-size: 2.5em;
    display: inline-block;
    padding-bottom: 5px;
}

nav ul {
    list-style: none;
    padding: 0 20px;
    margin: 10px 0 0 0;
    display: flex;
    justify-content: center;
}

nav ul li {
    padding: 0 8px;
}

nav ul li a {
    color: var(--color-background);
    text-decoration: none;
    padding: 10px;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--color-secondary);
}

.highlight {
    background-color: yellow;
    /* 背景色を黄色にする */
    font-weight: bold;
    /* 文字を太字にする */
    padding: 2px 0;
}

.menu-view {
    font-size: 1.5em;
    padding-bottom: 5px;
    border-bottom: 2px solid #333;
    margin-bottom: 20px;
    width: 100%;
}

.hr-orange {
    border: none;
    height: 0;
    border-top: 1px solid #d68910 !important;
    margin: 20px 0 !important;
}

.icon-toc {
    list-style: none;
    padding: 0;
    margin: 0;
}

.icon-toc li {
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.icon-toc li:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.icon-toc a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 1.5em;
    padding: 5px;
    transition: background-color 0.2s;
}

.icon-toc a:hover {
    background-color: #fff7cc;
}

.toc-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-right: 15px;
    display: block;
}

.content-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

.sidebar {
    height: unset;
    min-height: unset;
    overflow: unset;
    background-color: var(--color-secondary);
    padding: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.main-content-area {
    width: 55%;
    margin-right: 0;
    padding: 20px 30px;
    box-sizing: border-box;
}

.sidebar h2 {
    color: #333;
    border-bottom: 3px double var(--color-primary);
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    margin-top: 0;
    font-size: 1.2em;
    text-transform: uppercase;
}

.sidebar h2::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background-color: #d68910;
    margin-left: 10px;
    margin-top: 2px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    display: block !important;
}

.sidebar ul li a {
    display: block;
    padding: 10px 0;
    text-decoration: none;
    color: var(--color-text);
    border-bottom: 1px dotted var(--color-primary);
    transition: background-color 0.3s;
}

.sidebar ul li a:hover {
    background-color: rgba(255, 255, 255, 0.5);
    color: var(--color-dark);
}

.main-content h2 {
    color: var(--color-primary);
    border-left: 5px solid var(--color-primary);
    padding-left: 10px;
    margin-top: 30px;
}

.article-header {
    border-radius: 16px;
}

.copy-word {
    cursor: pointer;
    border-bottom: 1px dotted #00008b;
    color: #00008b;
}

.wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    font-family: Arial, sans-serif;
}

.wp-block-table th,
.wp-block-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

.wp-block-table thead th {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.wp-block-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.wp-block-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.wp-block-table tbody tr:hover {
    background-color: #f0f8ff;
}

.wp-block-table .has-text-align-center {
    text-align: center !important;
}

.recipe-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 20px;
    margin-bottom: 20px;
}

.crafting-recipe {
    display: flex;
    align-items: center;
    gap: 15px;
    width: calc(33% - 10px);

    padding: 10px;
    background-color: #e0e0e0;
    border: 3px solid #555;
    border-radius: 8px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2px;
}

.slot {
    width: 40px;
    height: 40px;
    background-color: #555;
    border: 2px solid #222;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
}

.output-slot .slot {
    width: 50px;
    height: 50px;
    border-color: #222;
}

.arrow {
    font-size: 30px;
    font-weight: bold;
    color: #222;
    margin: 0 5px;
}

.slot img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
}

.interface {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #C6C6C6;
    border: 2px solid;
    border-color: #FFF #555 #555 #FFF;
    outline: 2px solid #000;
    padding: 8px;
    margin-block: 20px;
    image-rendering: pixelated;
    position: relative;
    background-repeat: no-repeat;
    box-sizing: border-box;
}

#copy-feedback-message {
    position: fixed;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-size: 0.9em;
    z-index: 1000;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease-in-out;
}

article {
    background-color: #fff;
    padding: 25px;
    border: 2px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

footer {
    background-color: var(--color-dark);
    color: var(--color-secondary);
    text-align: center;
    padding: 15px;
    width: 100%;
}

.promo-box {
    width: 15%;
    padding: 20px 10px;
    box-sizing: border-box;
    background-color: #f0f0f0;
    border-left: 1px dashed #ccc;
    display: block;
}

amazon-banner {
    display: flex;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    padding: 10px;
    max-width: 600px;
    margin: 15px auto;
}

.amazon-banner a {
    text-decoration: none;
    color: #333;
}

.banner-image {
    object-fit: contain;
    margin-right: 15px;
}

.product-title {
    font-weight: bold;
    margin: 0 0 5px 0;
}

.action-button {
    background-color: #FF9900;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    text-align: center;
    margin-top: 10px;
    font-size: 0.9em;
}

.action-button:hover {
    background-color: #f7b243;
}

.amazon-banner-vertical {/* バナーの幅を狭く設定し、縦長にする */ 
    width: 250px;/* 例: 幅を250pxに設定 */ 
    border: 1px solid #ccc;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 20px auto;/* ページ中央に配置 */ 
    border-radius: 5px;
    overflow: hidden;/* 角丸に合わせて内容を切り取る */
}

.amazon-banner-vertical a {
    text-decoration: none;
    color: #333;
    display: block;/* リンク全体がブロック要素になる */ 
    padding-bottom: 10px;/* 下部に少し余白 */
}

.banner-image-vertical {/* 画像をバナー幅いっぱいに表示 */ 
    width: 100%;
    height: auto;
    display: block;/* 上部だけ角丸に合わせて画像も角丸にする */ 
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
    object-fit: cover;/* 画像をボックスに合わせる */
}

.banner-info-vertical {
    padding: 10px 15px;/* 左右と上下にパディング */ 
    text-align: center;
}

.product-title-vertical {
    font-weight: bold;
    font-size: 1.1em;
    height: 3.3em;/* 3行分の高さを確保 */ 
    overflow: hidden;/* 溢れるテキストは非表示 */ 
    margin-bottom: 10px;
    line-height: 1.1;
}

.price-text {
    color: #555;
    font-size: 0.9em;
}

.action-button-vertical {
    background-color: #FF9900;
    /* Amazonのキーカラー */
    color: white;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s;
    cursor: pointer;
}

/* マウスオーバー時のエフェクト */ 
.amazon-banner-vertical a:hover .action-button-vertical {
    background-color: #f7b243;/* 少し明るい色に変化 */
}

#sticky-footer-amazon-pr {
    /* 固定と基本設定 */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #232f3e;
    /* Amazon風の暗めの背景色 */
    color: #fff;
    padding: 10px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    box-sizing: border-box;
    /* paddingを含めてwidthを100%にする */
}

/* コンテンツのラッパー: Flexboxで左右レイアウトを実現 */
.amazon-pr-content-wrapper {
    display: flex;
    /* Flexboxを有効化 */
    align-items: center;
    /* 垂直方向の中央揃え */
    max-width: 900px;
    /* バナーの最大幅を制限（任意） */
    margin: 0 auto;
}

/* 左側: 商品画像エリア */
.amazon-pr-image-area {
    flex-shrink: 0;
    margin-right: 15px;
}

.amazon-pr-image-area img {
    width: 60px !important;
    height: 60px !important;
    object-fit: contain;
    border: 1px solid #ccc;
    background-color: #fff;
}

/* 右側: 商品名とボタンエリア */
.amazon-pr-text-area {
    flex-grow: 1;
    /* 残りのスペースを埋める */
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 商品名とボタンを離す */
}

.product-name {
    font-size: 15px;
    font-weight: bold;
    margin: 0;
    line-height: 1.4;
    max-width: 60%;
    /* 名前が長すぎる場合の対策 */
}

/* Amazonボタンのスタイル */
.amazon-button {
    background-color: #ff9900;
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    /* ボタン内のテキストの折り返しを防ぐ */
}

.amazon-button:hover {
    background-color: #f7b243;
        /* 少し明るい色に変化 */
}

/* 閉じるボタン (位置は画像の通りバナー右上隅の外側) */
#close-amazon-pr-button {
    position: absolute;
    top: -15px;
    right: 10px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    line-height: 25px;
    text-align: center;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

#menu-toggle {
    display: none;
    position: fixed;
    top: 5px;
    left: 0px;
    z-index: 100;
    padding: 10px 15px;
    background-color: var(--color-primary);
    color: var(--color-background);
    border: none;
    cursor: pointer;
    font-size: 1em;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

@media (min-width: 769px) {
    .promo-box {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        margin-top: 10px;
    }

    #menu-toggle {
        display: block; 
    }

    .sidebar {
        width: 80%;
        height: 100%;
        position: fixed;
        top: 0;
        left: -80%;
        overflow-y: auto;
        box-shadow: 5px 0 10px rgba(0, 0, 0, 0.5);
        transition: left 0.3s ease;
        margin-top: 0;
        margin-bottom: 0;
        border-radius: 0;
        padding-top: 50px;
        z-index: 99;
    }

    .sidebar.is-open {
        left: 0; /* 画面内にスライドイン */
    }

    .main-content-area {
        width: 100%;
        padding: 10px;
        padding-right: 10px;
    }

    .promo-box {
        width: 100%;
        display: block !important;
        padding: 15px 10px; 
        box-sizing: border-box;
        order: 3;
        background-color: #fff8e1;
        border-left: none;
        margin-bottom: 20px;
    }

    #menu-toggle[aria-expanded="true"] span::before {
        content: '✕ '; 
    }
    #menu-toggle[aria-expanded="false"] span::before {
        content: '☰ ';
    }
    
    /* ボタンのテキスト変更 */
    #menu-toggle[aria-expanded="true"] span {
        content: "メニューを閉じる";
        font-size: 0; /* テキスト自体を非表示に */
    }
    #menu-toggle[aria-expanded="true"] {
        background-color: #CC3333; /* 閉じるボタンの色を変える */
    }
    
    /* ボタンのテキストを非表示にする修正 */
    #menu-toggle span {
        visibility: hidden;
        width: 0;
        height: 0;
    }
    
    /* 擬似要素でテキストとアイコンを再挿入 */
    #menu-toggle::after {
        content: 'メニューを開く';
        visibility: visible;
        font-size: 1em;
        line-height: 1;
    }
    #menu-toggle[aria-expanded="true"]::after {
        content: '✕ 閉じる';
    }
}

@media (max-width: 1000px) {
    .crafting-recipe {
        width: calc(50% - 10px);
    }
}

@media (max-width: 600px) {
    .crafting-recipe {
        width: 100%;
        margin-left: auto;
        margin-right: auto;
        justify-content: center;
    }
    
}

img {
    /* 1. 画像の最大幅を親要素（画面幅など）の100%に制限 */
    max-width: 100%;

    /* 2. 高さを自動調整し、縦横比を維持 */
    height: auto;

    /* 3. 画像がブロック要素として振る舞うように設定（一部ブラウザのインライン要素による隙間を防ぐ） */
    display: block;
}

