/* Case detail page */
.case-detail {
    margin: 0 0 40px;
    font-size: 16px;
    line-height: 1.6;
    color: #222;
}

.case-detail__lead {
    margin: 0 0 24px;
    font-size: 18px;
    line-height: 28px;
    color: #181D27;
}

.case-detail__lead p:last-child {
    margin-bottom: 0;
}

.case-detail__rich {
    margin: 24px 0 0;
    font-size: 16px;
    line-height: 1.6;
    color: #222;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Rich Content: reset conflicts with the site's global base styles */
.case-detail__rich h1,
.case-detail__rich h2,
.case-detail__rich h3,
.case-detail__rich h4,
.case-detail__rich h5,
.case-detail__rich h6 {
    padding: 0;
    margin: 32px 0 16px;
    color: #181D27;
    font-weight: 600;
    line-height: 1.3;
}

.case-detail__rich h1:first-child,
.case-detail__rich h2:first-child,
.case-detail__rich h3:first-child,
.case-detail__rich h4:first-child,
.case-detail__rich h5:first-child,
.case-detail__rich h6:first-child {
    margin-top: 0;
}

.case-detail__rich h1 { font-size: 32px; }

/* DETAIL_TEXT may contain self-styled layouts (.cs-case) with their own color
   context (e.g. white text on a dark hero) — do not force heading colors there */
.case-detail__rich .cs-case h1,
.case-detail__rich .cs-case h2,
.case-detail__rich .cs-case h3,
.case-detail__rich .cs-case h4,
.case-detail__rich .cs-case h5,
.case-detail__rich .cs-case h6 {
    color: inherit;
}

.case-detail__rich h2 { font-size: 28px; }
.case-detail__rich h3 { font-size: 24px; }
.case-detail__rich h4 { font-size: 20px; }
.case-detail__rich h5 { font-size: 18px; }
.case-detail__rich h6 { font-size: 16px; }

.case-detail__rich p {
    margin: 0 0 20px;
}

.case-detail__rich ul,
.case-detail__rich ol {
    margin: 0 0 20px;
    padding-left: 24px;
    counter-reset: none;
}

.case-detail__rich ul li,
.case-detail__rich ol li {
    position: static;
    padding-left: 0;
    margin: 0 0 8px;
    line-height: 1.6;
}

.case-detail__rich ul li {
    list-style-type: disc;
}

.case-detail__rich ol li {
    list-style-type: decimal;
}

/* the site's global styles add custom markers and remove native ones */
.case-detail__rich ul li:before,
.case-detail__rich ol li:before {
    content: none !important;
    display: none !important;
}

/* self-styled layouts (.cs-case) bring their own markers — restore them */
.case-detail__rich .cs-case .steps li {
    list-style-type: none;
}

.case-detail__rich .cs-case .steps li:before {
    content: counter(steps, decimal-leading-zero) !important;
    display: block !important;
}

.case-detail__rich a {
    color: #ff8800;
    text-decoration: underline;
}

.case-detail__rich a:hover {
    color: #e67a00;
}

.case-detail__rich img {
    max-width: 100%;
    height: auto;
}

.case-detail__rich figure {
    margin: 24px 0;
}

.case-detail__rich figcaption {
    margin-top: 8px;
    font-size: 14px;
    line-height: 22px;
    color: #666;
}

.case-detail__rich blockquote {
    position: static;
    min-height: 0;
    margin: 24px 0;
    padding: 16px 20px;
    color: #181D27;
    background: #F5F6F8;
    border-left: 4px solid #FF8800;
}

.case-detail__rich blockquote:before {
    content: none;
    display: none;
}

.case-detail__rich table {
    width: 100%;
    margin: 0 0 20px;
    border-collapse: collapse;
}

.case-detail__rich table th,
.case-detail__rich table td {
    padding: 10px 12px;
    border: 1px solid #E5E5E5;
    text-align: left;
    vertical-align: top;
}

.case-detail__rich table th {
    background: #F5F6F8;
    font-weight: 600;
}

.case-detail__rich hr {
    margin: 32px 0;
}

.case-detail__rich > :first-child {
    margin-top: 0;
}

.case-detail__rich > :last-child {
    margin-bottom: 0;
}

/* back and share actions */
.case-detail__actions {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #E5E5E5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.case-detail__actions .col-md-6 {
    float: none;
    width: auto;
    padding: 0;
}

.case-detail__actions .back-url {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.case-detail__actions .share_wrapp .text.btn {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 24px;
    border: 1px solid #C5C7C9;
    border-radius: 8px;
    color: #181D27;
    background: transparent;
    cursor: pointer;
}

.case-detail__actions .share_wrapp .text.btn:hover {
    border-color: #FF8800;
    color: #FF8800;
}

@media screen and (max-width: 768px) {
    .case-detail__actions {
        align-items: flex-start;
        flex-direction: column-reverse;
    }
}
