/*
 * Kimoota code block
 * Highlight.js を使わず、pre 単体を読みやすく表示する。
 */
.entry-content pre {
    position: relative;
    box-sizing: border-box;
    margin: 1.8em 0;
    padding: 2.8rem 1.35rem 1.35rem;
    border: 1px solid #333;
    border-radius: 4px;
    background: #111;
    color: #ddd;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    overflow-x: hidden;
    tab-size: 4;
}

/* 小さなコードラベル。本文とは別のUIだと分かる程度に控えめに。 */
.entry-content pre::before {
    content: "CODE";
    position: absolute;
    top: 0.75rem;
    left: 1.35rem;
    color: #777;
    font-family: inherit;
    font-size: 0.68rem;
    line-height: 1;
    letter-spacing: 0.12em;
}

.entry-content pre .copy-code-button {
    position: absolute;
    top: 0.48rem;
    right: 0.6rem;
    z-index: 1;
    appearance: none;
    margin: 0;
    padding: 0.35rem 0.65rem;
    border: 1px solid #444;
    border-radius: 3px;
    background: #181818;
    color: #aaa;
    font: inherit;
    font-size: 0.68rem;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.entry-content pre .copy-code-button:hover,
.entry-content pre .copy-code-button:focus-visible {
    border-color: #777;
    background: #202020;
    color: #eee;
}

.entry-content pre .copy-code-button.is-copied {
    color: #eee;
}

/* 必要なブロックだけ横スクロールへ戻せる逃げ道。 */
.entry-content pre.no-wrap {
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
    overflow-x: auto;
}

@media (max-width: 640px) {
    .entry-content pre {
        margin: 1.5em 0;
        padding: 2.7rem 1rem 1.1rem;
        font-size: 0.84rem;
        line-height: 1.65;
    }

    .entry-content pre::before {
        left: 1rem;
    }
}
