/* ========================================
   資料ダウンロード型の個別ページ（市場調査レポート・お役立ち資料で共通）
   マークアップ：template-parts/download-single.php
   見出し → [左] 表紙・概要 / [右] ダウンロードフォーム → そのほかの資料
   カードは assets/css/shared/shared-report-card.css を共用
======================================== */
.rep-single {
    background: var(--color-base-gray, #f8fafc);
    padding: 48px 0 88px;
}

.rep-single-container {
    max-width: 1200px;
}

/* ---------- 見出し ---------- */
.rep-hero {
    max-width: 880px;
    margin: 0 auto 36px;
    text-align: center;
}

.rep-hero-cat {
    display: inline-block;
    margin-bottom: 14px;
    padding: 4px 14px;
    border-radius: 0;
    background: var(--color-primary, #1e40af);
    color: #fff;
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.rep-hero-cat:hover {
    opacity: 0.85;
    color: #fff;
}

.rep-hero-title {
    position: relative;
    margin: 0;
    color: var(--color-text, #0f172a);
    font-size: 2.8rem;
    font-weight: 700;
    line-height: 1.55;
    text-wrap: balance;
    word-break: auto-phrase;
}

.rep-hero-lead {
    margin: 18px 0 0;
    color: var(--color-text-light, #64748b);
    font-size: 1.5rem;
    line-height: 1.8;
}

/* スマホ・タブレットだけ表示（PCはフォームが横に見えている） */
.rep-hero-cta {
    display: none;
}

/* ---------- 2カラム ---------- */
.rep-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 32px;
    align-items: start;
}

.rep-layout.is-no-form {
    grid-template-columns: minmax(0, 1fr);
    max-width: 880px;
    margin: 0 auto;
}

.rep-main,
.rep-form {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
}

.rep-main {
    padding: 32px;
}

/* ---------- 表紙 ---------- */
.rep-cover {
    margin: 0 0 32px;
    overflow: hidden;
    border-radius: 0;
    background: var(--color-base-dark, #f1f5f9);
}

.rep-cover img {
    display: block;
    width: 100%;
    height: auto;
}

/* ---------- 本文 ---------- */
.rep-content {
    color: var(--color-text, #0f172a);
    font-size: 1.6rem;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.rep-content > :first-child,
.rep-content section > :first-child {
    margin-top: 0;
}

.rep-content p {
    margin: 0 0 1.4em;
}

.rep-content h2 {
    margin: 0 0 20px;
    padding-left: 16px;
    border-left: 4px solid var(--color-primary, #1e40af);
    color: var(--color-text, #0f172a);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.6;
    text-wrap: balance;
    word-break: auto-phrase;
}

.rep-content h3 {
    margin: 36px 0 0;
    padding: 14px 20px;
    border-radius: 0;
    background: var(--color-primary, #1e40af);
    color: #fff;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.6;
}

.rep-content strong {
    font-weight: 700;
    background: linear-gradient(transparent 62%, rgba(249, 115, 22, 0.22) 62%);
}

/* 「本調査レポートでわかること」の箇条書き */
.rep-content ul {
    margin: 0 0 1.6em;
    padding: 0;
    list-style: none;
}

.rep-content h3 + ul {
    margin-bottom: 32px;
    padding: 20px 22px;
    border: 1px solid rgba(30, 64, 175, 0.15);
    border-top: 0;
    border-radius: 0;
    background: rgba(30, 64, 175, 0.03);
}

.rep-content li {
    position: relative;
    margin: 0;
    padding: 6px 0 6px 32px;
    font-weight: 600;
    line-height: 1.7;
}

.rep-content li + li {
    border-top: 1px dashed rgba(30, 64, 175, 0.15);
}

.rep-content li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary, #1e40af) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L19 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.rep-content ol {
    margin: 0 0 1.6em;
    padding: 0;
    list-style: none;
}

.rep-content h2 + ol,
.rep-content h3 + ol {
    margin-bottom: 32px;
    padding: 8px 22px;
    border: 1px solid var(--color-border, #e2e8f0);
    background: #fff;
}

.rep-content h3 + ol {
    border-top: 0;
}

.rep-content ol li {
    padding-left: 0;
    font-weight: 500;
}

.rep-content ol li::before {
    content: none;
}

/* 見出しの直後でない箇条書き */
.rep-content p + ul,
.rep-content h2 + ul {
    padding: 4px 0;
}

.rep-content h2:not(:first-child) {
    margin-top: 40px;
}

/* ---------- ダウンロードフォーム ---------- */
.rep-form {
    position: relative;
    overflow: hidden;
    padding: 32px 28px 28px;
}

.rep-form-label {
    display: inline-block;
    margin: 0 0 8px;
    padding: 2px 10px;
    border-radius: 0;
    background: rgba(249, 115, 22, 0.12);
    color: var(--color-secondary-dark, #ea580c);
    font-size: 1.2rem;
    font-weight: 700;
}

.rep-form-title {
    margin: 0;
    color: var(--color-text, #0f172a);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.5;
}

.rep-form-desc {
    margin: 6px 0 20px;
    color: var(--color-text-light, #64748b);
    font-size: 1.4rem;
    line-height: 1.7;
}

/* Contact Form 7 の中身 */
.rep-form .hidden-fields-container {
    display: none;
}

.rep-form .screen-reader-response {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.rep-form .wpcf7-form p {
    margin: 0;
}

.rep-form .wpcf7-form br {
    display: none;
}

.rep-form .cf7-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0 12px;
}

/* 姓・名だけ横並び */
.rep-form .cf7-form-grid:has([data-name="last-name"]) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rep-form .cf7-form-group,
.rep-form .cf7-full-width {
    margin-bottom: 18px;
}

.rep-form label.required,
.rep-form .cf7-form-group > p > label,
.rep-form .cf7-full-width > p > label {
    display: block;
    margin-bottom: 6px;
    color: var(--color-text, #0f172a);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.5;
}

.rep-form label.required::after {
    content: '必須';
    display: inline-block;
    margin-left: 8px;
    padding: 0 6px;
    border-radius: 0;
    background: var(--color-secondary, #f97316);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.7;
    vertical-align: 1px;
}

.rep-form .wpcf7-form-control-wrap {
    display: block;
}

.rep-form input[type="text"],
.rep-form input[type="email"],
.rep-form input[type="tel"],
.rep-form select,
.rep-form textarea {
    display: block;
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 0;
    background: #fff;
    color: var(--color-text, #0f172a);
    font-size: 1.6rem;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rep-form input::placeholder,
.rep-form textarea::placeholder {
    color: #94a3b8;
}

.rep-form input[type="text"]:focus,
.rep-form input[type="email"]:focus,
.rep-form input[type="tel"]:focus,
.rep-form select:focus,
.rep-form textarea:focus {
    outline: none;
    border-color: var(--color-primary, #1e40af);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.15);
}

.rep-form .form-note {
    display: block;
    margin: 6px 0 0;
    color: var(--color-text-light, #64748b);
    font-size: 1.2rem;
    line-height: 1.6;
}

/* チェックボックス */
.rep-form .wpcf7-checkbox {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.rep-form [data-name="store-platform"] .wpcf7-checkbox {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rep-form [data-name="store-platform"] .wpcf7-list-item {
    gap: 6px;
    padding: 8px 10px;
    font-size: 1.3rem;
}

.rep-form .wpcf7-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 0;
    background: #fff;
    font-size: 1.4rem;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.rep-form .wpcf7-list-item > label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
}

.rep-form .wpcf7-list-item:hover {
    border-color: rgba(30, 64, 175, 0.4);
}

.rep-form .wpcf7-list-item:has(input:checked) {
    border-color: var(--color-primary, #1e40af);
    background: rgba(30, 64, 175, 0.05);
}

.rep-form .wpcf7-list-item input[type="checkbox"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--color-primary, #1e40af);
    cursor: pointer;
}

.rep-form .cf7-full-width a {
    display: inline-block;
    margin-top: 8px;
    color: var(--color-primary, #1e40af);
    font-size: 1.3rem;
    text-decoration: underline;
}

/* 送信ボタン（サイトの .btn-primary と同じ見た目） */
.rep-form .wpcf7-submit {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 16px 24px;
    border: 0;
    border-radius: 0;
    background: var(--color-secondary, #f97316);
    color: #fff;
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.rep-form .wpcf7-submit:hover:not(:disabled) {
    background: var(--color-secondary-dark, #ea580c);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(249, 115, 22, 0.35);
}

.rep-form .wpcf7-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.rep-form .wpcf7-spinner {
    display: block;
    margin: 10px auto 0;
}

/* 入力エラー・送信結果 */
.rep-form .wpcf7-not-valid {
    border-color: #dc2626 !important;
}

.rep-form .wpcf7-not-valid-tip {
    display: block;
    margin-top: 4px;
    color: #dc2626;
    font-size: 1.2rem;
}

.rep-form .wpcf7 form .wpcf7-response-output {
    margin: 16px 0 0;
    padding: 12px 14px;
    border-radius: 0;
    font-size: 1.4rem;
    line-height: 1.6;
}

/* ---------- そのほかのレポート ---------- */
.rep-related {
    margin-top: 72px;
}

.rep-related-title {
    position: relative;
    margin: 0 0 32px;
    color: var(--color-text, #0f172a);
    font-size: 2.4rem;
    font-weight: 700;
    text-align: center;
}

.rep-related-action {
    margin-top: 40px;
    text-align: center;
}

/* PC：フォームを画面に追従させる
   ヘッダーの下（top は main.js で計算）に固定し、画面に収まらない分はフォーム内でスクロールする */
@media (min-width: 993px) {
    .rep-form {
        position: sticky;
        top: var(--ecs-sidebar-top, 157px);
        max-height: calc(100vh - var(--ecs-sidebar-top, 157px) - 16px);
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(30, 64, 175, 0.3) transparent;
        padding: 26px 24px 20px;
    }

    .rep-form::-webkit-scrollbar {
        width: 6px;
    }

    .rep-form::-webkit-scrollbar-thumb {
        border-radius: 0;
        background: rgba(30, 64, 175, 0.3);
    }

    /* 高さを抑えて、できるだけ画面内に収める */
    .rep-form-title {
        font-size: 2rem;
    }

    .rep-form-desc {
        margin-bottom: 14px;
    }

    .rep-form .cf7-form-group,
    .rep-form .cf7-full-width {
        margin-bottom: 14px;
    }

    .rep-form label.required,
    .rep-form .cf7-form-group > p > label,
    .rep-form .cf7-full-width > p > label {
        margin-bottom: 4px;
        font-size: 1.3rem;
    }

    .rep-form input[type="text"],
    .rep-form input[type="email"],
    .rep-form input[type="tel"],
    .rep-form select,
    .rep-form textarea {
        padding: 8px 12px;
        font-size: 1.5rem;
    }

    .rep-form .wpcf7-checkbox {
        gap: 6px;
    }

    .rep-form .wpcf7-list-item,
    .rep-form [data-name="store-platform"] .wpcf7-list-item {
        padding: 6px 10px;
    }

    .rep-form .cf7-full-width a {
        margin-top: 4px;
    }

    .rep-form .wpcf7-submit {
        padding: 13px 24px;
    }
}

/* ---------- レスポンシブ ---------- */
@media (max-width: 1100px) {
    .rep-layout {
        grid-template-columns: minmax(0, 1fr) 380px;
        gap: 24px;
    }
}

@media (max-width: 992px) {
    .rep-layout {
        grid-template-columns: minmax(0, 1fr);
        max-width: 760px;
        margin: 0 auto;
    }

    .rep-hero-cta {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-top: 20px;
    }

    .rep-form {
        scroll-margin-top: 120px;
    }
}

@media (max-width: 767px) {
    .rep-single {
        padding: 28px 0 64px;
    }

    .rep-hero {
        margin-bottom: 24px;
    }

    .rep-hero-title {
        font-size: 2.1rem;
        padding-bottom: 14px;
    }

    .rep-hero-lead {
        margin-top: 14px;
        font-size: 1.4rem;
    }

    .rep-main {
        padding: 18px;
        border-radius: 0;
    }

    .rep-cover {
        margin-bottom: 22px;
        border-radius: 0;
    }

    .rep-content {
        font-size: 1.5rem;
    }

    .rep-content h2 {
        font-size: 1.8rem;
        padding-left: 12px;
    }

    .rep-content h3 {
        font-size: 1.5rem;
        padding: 12px 16px;
    }

    .rep-content h3 + ul {
        padding: 14px 16px;
    }

    .rep-form {
        padding: 26px 18px 20px;
        border-radius: 0;
    }

    .rep-form-title {
        font-size: 1.9rem;
    }

    .rep-related {
        margin-top: 56px;
    }

    .rep-related-title {
        font-size: 2rem;
        margin-bottom: 22px;
    }

    .rep-related-action {
        margin-top: 28px;
    }
}

@media (max-width: 400px) {
    .rep-form [data-name="store-platform"] .wpcf7-checkbox {
        grid-template-columns: minmax(0, 1fr);
    }
}
