/* manual.css - 利用案内ページ固有スタイル */
/* 共通スタイルは styles.css で定義 */

/*
   ページ全体のラッパー
   .background-washi だと flex 指定が入っている可能性があるため、
   利用案内専用のラッパーを用意して縦並び（block layout）を保証する。
*/
p {
    margin-inline: 16px;
}

.about-page-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
    display: block;
    /* 縦並びを強制 */
}

.about-page-wrapper .index-list {
    padding-bottom: 1.5rem;
    /* add space so last item is visible */
}

.about-page-wrapper .index-list>ol {
    margin-bottom: 0;
}

.about-page-wrapper .index-list {
    max-height: none;
    overflow-y: visible;
}

/* タイトルロゴ */
.to-top {
    display: block;
    text-align: center;
    margin-bottom: 20px;
}

.to-top img.title-logo {
    width: 180px;
    max-width: 50%;
    height: auto;
    transition: transform 0.3s ease;
}

.to-top img.title-logo:hover {
    transform: scale(1.05);
}

/* 利用案内タイトル */
.riyou-annai {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 0.4em;
    color: #3e2723;
    /* 濃い茶色 */
    margin: 20px auto 40px;
    padding-bottom: 15px;
    border-bottom: 3px double #8E3535;
    /* 和風な赤色 */
    display: block;
    width: fit-content;
    min-width: 200px;
}

/* 目次リスト */
.index-list {
    margin: 0 auto 50px;
    max-width: 700px;
    width: 90%;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    /* 少し不透明度を上げる */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid rgba(196, 194, 172, 0.5);
    /* 薄い和風境界線 */
}

.index-list>div {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 15px;
    background-color: #566C5D;
    /* 和風緑 */
    color: #fdfdfd;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
}

/* アイコン（CSSで描画していた部分） */
.index-list>div::before {
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 10px;
    /* SVGアイコンはそのまま利用 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 4H21V6H8V4ZM3 3.5H6V6.5H3V3.5ZM3 10.5H6V13.5H3V10.5ZM3 17.5H6V20.5H3V17.5ZM8 11H21V13H8V11ZM8 18H21V20H8V18Z' fill='%23fff'%3E%3C/path%3E%3C/svg%3E");
    content: '';
    background-size: contain;
    background-repeat: no-repeat;
}

.index-list label {
    cursor: pointer;
    margin-left: 10px;
    display: flex;
    align-items: center;
}

.index-list label::after {
    font-weight: 500;
    font-size: 0.85em;
    color: #fff;
    content: "[開く]";
    margin-left: 5px;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.index-list label:hover::after {
    opacity: 1;
    text-decoration: underline;
}

.index-list:has(:checked) label::after {
    content: "[閉じる]";
}

.index-list input {
    display: none;
}

.index-list ol {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

/* 目次本体の開閉アニメーション */
.index-list>ol {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.4s ease, padding 0.4s ease;
}

.index-list:has(:checked)>ol {
    max-height: 1000px;
    /* 十分な高さを確保 */
    opacity: 1;
    padding: 20px 30px;
}

/* 目次の階層構造 */
.index-list ol ol {
    margin-top: 8px;
    padding-left: 20px;
    border-left: 1px dashed #C4C2AC;
}

.index-list li {
    padding: 6px 0;
    font-weight: 500;
    font-size: 1rem;
    line-height: 1.55;
    color: #4a4a4a;
}

.index-list ol ol li {
    font-size: 0.95rem;
}

.index-list a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: inline-block;
}

.index-list a:hover {
    color: #8E3535;
    padding-left: 4px;
    /* ホバー時に少し右へ動く和風な演出 */
}

/* ========================================
   メインコンテンツエリア
   ======================================== */
.contents {
    max-width: 900px;
    width: 90% !important;
    margin: 0 auto 60px;
    padding: 0;
    box-sizing: border-box;
}

/* セクション間隔 */
section {
    margin-bottom: 50px;
    /* セクションの区切りを和風にする場合、ここに装飾を入れることも可能 */
}

/* 見出しデザイン刷新 */
.contents h1 {
    text-align: left;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 100%);
    padding: 12px 20px;
    margin: 0 0 25px;
    border-left: 6px solid #8E3535;
    font-family: 'Shippori Mincho', serif;
    font-size: 1.5rem;
    color: #3e2723;
    border-bottom: 1px solid rgba(142, 53, 53, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.contents h3 {
    text-align: left;
    padding: 8px 15px;
    margin: 30px 0 15px 10px;
    border-left: 4px solid #566C5D;
    font-family: 'Shippori Mincho', serif;
    font-size: 1.25rem;
    color: #2F4F4F;
    background-color: rgba(86, 108, 93, 0.05);
    border-radius: 0 4px 4px 0;
}

.contents h4 {
    text-align: left;
    margin: 25px 0 15px 20px;
    padding-left: 10px;
    border-left: 3px solid #C4C2AC;
    font-family: 'Shippori Mincho', serif;
    font-size: 1.1rem;
    color: #5d4037;
}

/* 段落テキスト */
.contents p {
    font-size: 1rem;
    line-height: 1.9;
    /* 読みやすさのために行間を広げる */
    color: #333;
    margin: 15px 0;
    text-align: justify;
    letter-spacing: 0.02em;
}

/* セクションコンテンツ */
.section-content {
    margin: 0 auto;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
}

/* 強調表示 */
span.attention {
    background: linear-gradient(transparent 60%, rgba(255, 235, 59, 0.6) 60%);
    font-weight: bold;
    padding: 0 4px;
}

span.refine-info {
    font-family: 'Courier New', monospace;
    /* コードっぽさを出す */
    background-color: #f1f3f1;
    color: #566C5D;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #dce2dd;
    font-size: 0.95em;
    margin: 0 3px;
}

/* 画像スタイル */
.image-container {
    text-align: center;
    margin: 40px auto !important;
    width: 100% !important;
}

.clickable-image {
    max-width: 100%;
    width: auto !important;
    height: auto;
    max-height: 500px;
    border: 4px solid #fff;
    border-radius: 2px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    /* 浮き出るような影 */
    cursor: zoom-in;
    transition: all 0.3s ease;
}

.clickable-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #fcfcfc;
}

/* 順序付きリスト（免責事項など） */
.contents>section>ol,
.contents .section-content>ol {
    padding-left: 1.5em;
    margin: 20px 0;
}

.contents li {
    margin-bottom: 12px;
    line-height: 1.8;
}

/* 辞書順ルールのリスト */
.contents ol ol {
    margin: 15px 0;
    padding-left: 20px;
    border-left: 2px solid #eee;
}

.contents ol ol li p {
    margin: 5px 0 0;
    font-size: 0.9rem;
    color: #666;
    background-color: rgba(0, 0, 0, 0.02);
    padding: 5px 10px;
    border-radius: 4px;
}


/* ========================================
   モーダル
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    /* 最前面 */
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    /* 濃いめの背景 */
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    /* 背景ぼかし */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.show .modal-content {
    transform: scale(1);
}

.close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    line-height: 1;
    z-index: 10000;
}

.close:hover {
    color: #8E3535;
    transform: rotate(90deg);
}

/* ========================================
   レスポンシブ対応
   ======================================== */

/* タブレット (768px以下) */
@media (max-width: 768px) {
    .about-page-wrapper {
        padding: 15px;
    }

    .riyou-annai {
        font-size: 1.6rem;
        margin-bottom: 30px;
    }

    .contents h1 {
        font-size: 1.3rem;
        padding: 10px 15px;
    }

    .contents h3 {
        font-size: 1.15rem;
    }

    .modal-content {
        max-width: 95%;
    }
}

/* スマートフォン (480px以下) */
@media (max-width: 480px) {
    .about-page-wrapper {
        padding: 10px 5px;
    }

    .to-top img.title-logo {
        width: 140px;
    }

    .riyou-annai {
        font-size: 1.4rem;
        letter-spacing: 0.2em;
        width: 100%;
    }

    .index-list>div {
        font-size: 1rem;
        padding: 12px;
    }

    .index-list:has(:checked)>ol {
        padding: 15px;
    }

    .contents {
        width: 96% !important;
    }

    .contents p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .close {
        top: 20px;
        right: 20px;
        font-size: 32px;
    }
}