/* コンポーネント - ボックス、テーブル、コード、その他 */

/* 小さいテキスト */
.small {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 1rem;
}

.small,
ol {
    margin-left: 0;
    margin-bottom: 1.2rem;
    padding-left: 0;
    list-style: none;
    /* 箇条書き記号禁止 */
}

li {
    margin-bottom: 0.5rem;
    text-indent: 1em;
    /* 段落字下げ1文字 */
}

/* 導入文 */
/* 概要（Abstract） */
.lead {
    background-color: transparent;
    padding: 1rem 2rem;
    margin-bottom: 3rem;
    border: none;
    font-size: 0.95rem;
    font-style: italic;
    text-align: justify;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.lead::before {
    content: "Abstract: ";
    font-weight: bold;
    font-style: normal;
}

/* ノートボックス */
/* ノートボックス (Remark/Note) -> Plain text */
.note {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 1.5rem 0;
    text-indent: 1em;
}

.note::before {
    content: "[Note] ";
    font-weight: bold;
}

.note::after {
    content: none;
}

/* タイムラインボックス */
/* タイムラインボックス -> Plain text */
.timeline-box {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 1.5rem 0;
    text-indent: 1em;
}

/* 実践的なボックス */
/* 実践的なボックス -> Case Study風 Plain text */
.practical-box {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 1.5rem 0;
    text-indent: 1em;
}

/* テーブル */
/* テーブル (Academic Style) */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    border-top: 2px solid #000;
    border-bottom: 2px solid #000;
}

th,
td {
    border: none;
    padding: 0.5rem 1rem;
    text-align: left;
    vertical-align: top;
}

th {
    background-color: transparent;
    font-weight: bold;
    border-bottom: 1px solid #000;
}

td {
    border-bottom: 1px solid #ccc;
}

tr:last-child td {
    border-bottom: none;
}

/* コードブロック */
pre {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
    font-family: 'Courier New', Courier, monospace;
}

code {
    font-family: 'Courier New', Courier, monospace;
    background-color: #f5f5f5;
    padding: 0.1rem 0.3rem;
    font-size: 0.9em;
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* 参考・免責文 */
/* 参考・免責文 */
.refs {
    background-color: transparent;
    border-top: 1px solid #000;
    padding: 1rem 0;
    margin-top: 4rem;
    font-size: 0.9rem;
}

/* 検索ボックス */
.search-box {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #ddd;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    border: 1px solid #ccc;
    background: #fff;
}

.search-input {
    flex: 1;
    border: none;
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
    outline: none;
    min-width: 0;
}

.search-input::placeholder {
    color: #999;
}

.search-clear {
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    font-size: 1rem;
    line-height: 1;
}

.search-clear:hover {
    color: #333;
}

.search-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 0.4rem;
    gap: 0.3rem;
}

.search-counter {
    font-size: 0.75rem;
    color: #666;
    margin-right: auto;
}

.search-prev,
.search-next {
    border: 1px solid #ccc;
    background: #fff;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1;
}

.search-prev:hover,
.search-next:hover {
    background: #f0f0f0;
}

/* 検索ハイライト */
.search-highlight {
    background-color: #ffeb3b;
    color: #000;
    padding: 0 1px;
}

.search-highlight-current {
    background-color: #ff9800;
    color: #000;
}

/* 全章検索結果ドロップダウン */
.search-box {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: none;
}

.search-result-item {
    display: block;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
    background-color: #f5f5f5;
}

.search-result-chapter {
    display: inline-block;
    background: #3776ab;
    color: #fff;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    border-radius: 2px;
    margin-right: 0.5rem;
}

.search-result-title {
    color: #333;
}

.search-keyword {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.2rem;
    padding-left: 3.5rem;
}

.search-keyword::before {
    content: '→ ';
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
}

.search-snippet {
    display: block;
    font-size: 0.75rem;
    color: #666;
    margin-top: 0.3rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-snippet mark {
    background-color: #ffeb3b;
    color: #000;
    padding: 0 2px;
}
