/* =========================================================
   全ツール共通「使い方」欄のスタイル
   対応する blade：resources/views/components/tool-usage.blade.php

   ・HTML標準の <details> / <summary> を使っているため、開閉のJSはありません
   ・.back-btn / .btn-primary は style.css で定義済みのため、ここでは再定義しません
   ========================================================= */

.tool-usage {
    max-width: 1000px;
    margin: 32px auto 0;
    background-color: #ffffff;
    border: 1px solid #e1e5ea;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* ---------- 見出し（クリックで開閉） ---------- */

.tool-usage-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: bold;
    color: #1e3c72;
    background-color: #f4f7fb;
    user-select: none;
}

/* ブラウザ既定の三角マークを消す（自前の矢印を使うため） */
.tool-usage-summary {
    list-style: none;
}

.tool-usage-summary::-webkit-details-marker {
    display: none;
}

.tool-usage-summary:hover {
    background-color: #e9eff8;
}

/* キーボード操作でも位置が分かるようにする */
.tool-usage-summary:focus-visible {
    outline: 2px solid #2a5298;
    outline-offset: -2px;
}

.tool-usage-summary-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 開いているあいだは矢印を上向きにする */
.tool-usage-arrow {
    flex: none;
    font-size: 0.9rem;
    color: #6b7c93;
    transition: transform 0.2s ease;
}

.tool-usage[open] .tool-usage-arrow {
    transform: rotate(180deg);
}

/* ---------- 中身 ---------- */

.tool-usage-body {
    padding: 4px 20px 20px;
}

.tool-usage-section + .tool-usage-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed #e1e5ea;
}

.tool-usage-heading {
    font-size: 1rem;
    color: #2a5298;
    margin: 16px 0 8px;
}

/* ---------- 説明文（箇条書きではない段落） ---------- */

.tool-usage-text p {
    margin: 0 0 8px;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #333333;
}

.tool-usage-text p:last-child {
    margin-bottom: 0;
}

.tool-usage-text strong {
    color: #1e3c72;
}

/* ---------- 箇条書き（中黒） ---------- */

.tool-usage-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tool-usage-list li {
    position: relative;
    padding-left: 1.3em;
    margin-bottom: 6px;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #333333;
}

/* 中黒を疑似要素で付ける（コピーしたときに記号が混ざらないようにするため） */
.tool-usage-list li::before {
    content: "・";
    position: absolute;
    left: 0;
    color: #2a5298;
}

.tool-usage-list li:last-child {
    margin-bottom: 0;
}

/* 計算式は等幅寄りにして桁を読みやすくする */
.tool-usage-list-formula li {
    font-family: 'Courier New', Consolas, monospace, 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    letter-spacing: 0.02em;
}

/* 本文中の強調（数値など） */
.tool-usage-list strong {
    color: #1e3c72;
}

/* ---------- スマートフォン・タブレット対応 ---------- */

@media screen and (max-width: 768px) {
    .tool-usage {
        margin-top: 24px;
        border-radius: 8px;
    }

    .tool-usage-summary {
        padding: 14px 16px;
        font-size: 1rem;
    }

    .tool-usage-body {
        padding: 4px 16px 16px;
    }

    .tool-usage-list li,
    .tool-usage-text p {
        font-size: 0.92rem;
    }
}

@media screen and (max-width: 480px) {
    .tool-usage-summary {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .tool-usage-body {
        padding: 4px 14px 14px;
    }

    .tool-usage-heading {
        font-size: 0.95rem;
    }

    /* 画面が狭いときは計算式が横にはみ出さないよう折り返す */
    .tool-usage-list-formula li {
        word-break: break-word;
    }
}
