/*
 * 顧客名簿づくりの記録（/crm-log/）。
 * 売るためのページではないので、装飾は最小にして本文の読みやすさに寄せる。
 * 章番号は時系列そのものなので、番号を意味のある要素として扱う。
 */

.crmlog {
    --crmlog-rule: rgba(255, 255, 255, 0.1);
    --crmlog-measure: 34em;
}

/*
 * .panel は display:grid で列を指定していない（style.css）。
 * grid item は既定で min-width:auto = 内容の min-content が幅の下限になるため、
 * 下にある .crmlog-table の min-width:480px がこの下限まで伝播し、
 * ページ全体（.content.narrow）を480px基準まで押し広げてモバイルではみ出していた。
 * ここで下限を外し、表の横スクロールだけで吸収させる（.panel 自体は他ページ共通なので触らない）。
 */
.crmlog > .content.narrow {
    min-width: 0;
}

/* ---------- 見出し ---------- */

.crmlog-head h1 {
    line-height: 1.45;
}

.crmlog-br {
    display: none;
}

.crmlog-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    margin-top: 20px;
    font-family: var(--font-en);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}

.crmlog-meta span + span {
    position: relative;
    padding-left: 20px;
}

.crmlog-meta span + span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 12px;
    transform: translateY(-50%);
    background: var(--crmlog-rule);
}

/* ---------- 本文 ---------- */

.crmlog-body {
    max-width: var(--crmlog-measure);
    margin: 72px auto 0;
}

.crmlog-ch + .crmlog-ch {
    margin-top: 64px;
    padding-top: 64px;
    border-top: 1px solid var(--crmlog-rule);
}

.crmlog-no {
    margin: 0 0 10px;
    font-family: var(--font-en);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    color: var(--brand);
}

.crmlog-ch h2 {
    margin: 0 0 20px;
    font-family: var(--font-ja-display);
    font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.65rem);
    line-height: 1.55;
    letter-spacing: 0.01em;
}

.crmlog-ch p {
    margin: 0 0 18px;
    line-height: 2.05;
    color: var(--muted);
}

.crmlog-ch p:last-child {
    margin-bottom: 0;
}

.crmlog-ch strong {
    color: var(--text);
    font-weight: 600;
}

.crmlog-ch a {
    color: var(--brand);
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}

.crmlog-ch a:hover,
.crmlog-ch a:focus-visible {
    color: var(--brand-hover);
}

.crmlog-note {
    font-size: 0.9rem;
    line-height: 1.95;
}

/* ---------- 送った文面（このページの中心） ---------- */

.crmlog-msgs {
    display: grid;
    gap: 22px;
    margin: 28px 0;
}

.crmlog-msg {
    margin: 0;
    padding: 20px 22px;
    background: var(--bg);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-left: 3px solid var(--brand);
    border-radius: 3px;
}

.crmlog-msg figcaption {
    margin-bottom: 12px;
}

.crmlog-msg-when {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    color: var(--brand);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--crmlog-rule);
}

.crmlog-msg blockquote {
    margin: 0;
    padding: 0;
    border: 0;
}

.crmlog-msg blockquote p {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.95;
}

.crmlog-msg blockquote p:last-child {
    margin-bottom: 0;
}

/* ---------- 続きのある章 ---------- */

.crmlog-ch--open h2::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 10px;
    border-radius: 50%;
    background: var(--brand);
    vertical-align: middle;
    animation: crmlog-pulse 2.4s var(--ease) infinite;
}

@keyframes crmlog-pulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .crmlog-ch--open h2::after {
        animation: none;
        opacity: 0.7;
    }
}

/* ---------- 数字の表 ---------- */

.crmlog-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.crmlog-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.crmlog-table th,
.crmlog-table td {
    padding: 14px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--crmlog-rule);
    line-height: 1.7;
}

.crmlog-table th {
    font-family: var(--font-en);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--muted);
    white-space: nowrap;
}

.crmlog-table td {
    color: var(--muted);
}

.crmlog-table td:first-child {
    color: var(--text);
}

.crmlog-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
    border: 1px solid var(--crmlog-rule);
}

.crmlog-tag.is-done {
    color: var(--brand);
    border-color: rgba(219, 178, 120, 0.4);
}

.crmlog-tag.is-wip {
    color: var(--text);
}

.crmlog-tag.is-todo {
    color: var(--muted);
    border-style: dashed;
}

/* ---------- 型のリスト ---------- */

.crmlog-rules {
    margin: 0 0 18px;
    padding-left: 0;
    list-style: none;
    counter-reset: crmlog-rule;
}

.crmlog-rules li {
    position: relative;
    counter-increment: crmlog-rule;
    padding: 0 0 0 38px;
    margin-bottom: 16px;
    color: var(--muted);
    line-height: 1.95;
}

.crmlog-rules li::before {
    content: counter(crmlog-rule);
    position: absolute;
    left: 0;
    top: 0;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid var(--crmlog-rule);
    border-radius: 50%;
    font-family: var(--font-en);
    font-size: 0.72rem;
    color: var(--brand);
}

/* ---------- 道具のリンク ---------- */

.crmlog-ch--tool {
    background: var(--bg);
    border: 1px solid var(--crmlog-rule);
    border-radius: 4px;
    padding: 32px 28px;
}

.crmlog-ch--tool + .crmlog-ch,
.crmlog-ch--tool {
    border-top: 1px solid var(--crmlog-rule);
}

.crmlog-tool-link a {
    font-size: 0.95rem;
}

@media (min-width: 768px) {
    .crmlog-br {
        display: block;
    }

    .crmlog-body {
        margin-top: 88px;
    }

    .crmlog-msg {
        padding: 24px 28px;
    }

    .crmlog-ch--tool {
        padding: 36px 40px;
    }
}
