/* ==========================================================================
   Casadeer Help Center (/help, /help/{slug}) — resources/views/frontend/pages/help-center.blade.php
   Breadcrumb, a sticky side tree of sections, and the content column (label, h1, dates, intro, index, articles).
   Every class starts with cd-help- so nothing else on the site is affected.
   ========================================================================== */
.cd-help {
    --cd-help-green: #00502D;
    --cd-help-text: #4A4F4C;
    --cd-help-heading: #1F2A24;
    --cd-help-line: #E1EBE5;
    --cd-help-index: #4A5A6A;
    --cd-help-muted: #6B7570;
    --cd-help-offset: 96px;            /* room above an article title when jumping to it (#slug) */
    padding: 32px 0 80px;
    font-family: 'Inter', Helvetica, sans-serif;
    color: var(--cd-help-text);
}

/* ---------- breadcrumb (site's .inner-menu look) ---------- */
.cd-help-breadcrumb {
    margin-bottom: 40px;
}

.cd-help-breadcrumb .inner-menu {
    margin: 0;
}

.cd-help .cd-help-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.cd-help .cd-help-breadcrumb a:hover {
    color: var(--cd-help-green);
    text-decoration: underline;
}

/* "…" before the last two items: mobile only. On wider screens it is hidden, and "Home" stays the first item (no divider before it) */
.cd-help-breadcrumb .cd-help-breadcrumb-more {
    display: none;
}

.cd-help-breadcrumb .cd-help-breadcrumb-more + .list {
    padding-left: 0;
}

.cd-help-breadcrumb .cd-help-breadcrumb-more + .list::before {
    display: none;
}

/* ---------- layout ---------- */
.cd-help-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 64px;
    align-items: start;
}

.cd-help-main {
    max-width: 760px;
}

/* ---------- side tree ---------- */
.cd-help-nav {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);   /* a long tree scrolls inside itself */
    overflow-y: auto;
}

.cd-help-browse {
    display: none;   /* mobile only */
}

.cd-help-tree,
.cd-help-tree-children {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cd-help-tree > li + li {
    margin-top: 4px;
}

.cd-help-tree-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cd-help .cd-help-tree-link {
    display: block;
    padding: 8px 0;
    color: var(--cd-help-heading);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
}

.cd-help .cd-help-tree-link:hover {
    color: var(--cd-help-green);
}

.cd-help .cd-help-tree-link.is-current {
    color: var(--cd-help-green);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.cd-help-tree-toggle {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--cd-help-heading);
    cursor: pointer;
}

.cd-help-tree-toggle:hover {
    background: #F2F7F4;
    color: var(--cd-help-green);
}

.cd-help-chevron {
    transition: transform .15s;
}

.cd-help-tree-toggle[aria-expanded="true"] .cd-help-chevron,
.cd-help-browse[aria-expanded="true"] .cd-help-chevron {
    transform: rotate(180deg);
}

.cd-help-tree-children {
    margin: 2px 0 8px;
    padding-left: 16px;
    border-left: 1px solid var(--cd-help-line);
}

.cd-help-tree-children[hidden] {
    display: none;
}

.cd-help .cd-help-tree-children .cd-help-tree-link {
    padding: 6px 0;
    font-size: 14px;
}

/* the open path down to the current page (its section and parents) */
.cd-help .cd-help-tree-link.is-path {
    color: var(--cd-help-green);
    font-weight: 600;
}

/* articles: the last level, lighter than the section names */
.cd-help .cd-help-tree-children .cd-help-tree-article {
    font-weight: 400;
    line-height: 1.45;
}

.cd-help .cd-help-tree-children .cd-help-tree-article.is-current {
    font-weight: 500;
}

/* ---------- article page: side list of the section's articles only ---------- */
.cd-help .cd-help-back {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--cd-help-green);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
}

.cd-help .cd-help-back:hover {
    text-decoration: underline;
}

.cd-help .cd-help-nav-title {
    margin: 0 0 8px;
    padding: 0 12px;
    color: var(--cd-help-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cd-help .cd-help-article-link {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--cd-help-heading);
    font-size: 14px;
    line-height: 1.45;
    text-decoration: none;
}

.cd-help .cd-help-article-link:hover {
    background: #F2F7F4;
    color: var(--cd-help-green);
}

.cd-help .cd-help-article-link.is-current {
    background: var(--cd-help-green);
    color: #FFFFFF;
    font-weight: 600;
}

/* ---------- article page: section name above the h1, body, previous / next ---------- */
.cd-help .cd-help-label a {
    color: inherit;
    text-decoration: none;
}

.cd-help .cd-help-label a:hover {
    text-decoration: underline;
}

.cd-help-body {
    margin-top: 24px;
}

.cd-help-pager {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--cd-help-line);
}

.cd-help .cd-help-pager-link {
    max-width: 48%;
    color: var(--cd-help-green);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    text-decoration: none;
}

.cd-help .cd-help-pager-link:hover {
    text-decoration: underline;
}

.cd-help .cd-help-pager-link--next {
    margin-left: auto;
    text-align: right;
}

/* ---------- content: label, h1, dates / scope ---------- */
.cd-help .cd-help-label {
    margin: 0 0 10px;
    padding: 0;
    color: var(--cd-help-green);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cd-help .cd-help-title {
    margin: 0;
    color: var(--cd-help-heading);
    font-size: 40px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

/* a main section's summary, right under its h1 */
.cd-help .cd-help-summary {
    margin: 12px 0 0;
    padding: 0;
    color: #5A605C;
    font-size: 17px;
    font-style: italic;
    line-height: 1.6;
}

.cd-help .cd-help-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 14px 0 0;
    padding: 0;
    color: var(--cd-help-muted);
    font-size: 14px;
    line-height: 1.5;
}

.cd-help-meta-sep {
    color: var(--cd-help-line);
}

.cd-help-intro {
    margin-top: 24px;
}

/* ---------- index: sub-section pages or #article links (and the main sections on /help) ---------- */
.cd-help-index {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.cd-help-index li {
    border-bottom: 1px solid var(--cd-help-line);
}

.cd-help .cd-help-index-link {
    display: block;
    padding: 28px 0;
    color: var(--cd-help-index);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: .06em;
    text-transform: uppercase;   /* look only; the HTML keeps the text as it is in the database */
    text-decoration: none;
    transition: color .15s;
}

.cd-help .cd-help-index-link:hover,
.cd-help .cd-help-index-link:focus {
    color: var(--cd-help-green);
}

.cd-help-index-label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    opacity: .75;
}

/* "what it covers" line under a section name: normal case, smaller, grey */
.cd-help-index-summary {
    display: block;
    margin-top: 6px;
    color: #5A605C;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: normal;
    text-transform: none;
}

.cd-help-empty {
    margin: 24px 0 0;
    font-size: 16px;
}

/* ---------- articles, one after the other ---------- */
.cd-help-article {
    padding: 36px 0 4px;
}

.cd-help-index + .cd-help-article {
    padding-top: 40px;
}

.cd-help-article + .cd-help-article {
    margin-top: 32px;
    border-top: 1px solid var(--cd-help-line);
}

.cd-help .cd-help-article-title {
    margin: 0 0 12px;
    color: var(--cd-help-heading);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    scroll-margin-top: var(--cd-help-offset);
}

/* ---------- HTML from the admin editor (intro + article body) ---------- */
.cd-help-html {
    color: var(--cd-help-text);
    font-size: 16px;
    line-height: 1.7;
    overflow-wrap: break-word;
}

.cd-help-intro.cd-help-html {
    font-size: 17px;
}

.cd-help .cd-help-html p,
.cd-help .cd-help-html li {
    padding: 0;
    color: var(--cd-help-text);
    font-size: inherit;
    line-height: 1.7;
}

.cd-help .cd-help-html p {
    margin: 0 0 12px;
}

.cd-help .cd-help-html ul,
.cd-help .cd-help-html ol {
    margin: 0 0 12px;
    padding-left: 22px;
}

.cd-help .cd-help-html ul {
    list-style: disc;
}

.cd-help .cd-help-html ol {
    list-style: decimal;
}

/* the theme (style.css) hides every list marker and draws its own "ol li:before" counter: undo that here,
   so lists show their normal markers (1. 2. / a. b. / •) */
.cd-help .cd-help-html li {
    margin-bottom: 0;
    list-style: inherit;
}

.cd-help .cd-help-html ol li::before {
    content: none;
    counter-increment: none;
    margin: 0;
}

/* headings written inside an intro or an article body */
.cd-help .cd-help-html h1,
.cd-help .cd-help-html h2,
.cd-help .cd-help-html h3,
.cd-help .cd-help-html h4,
.cd-help .cd-help-html h5,
.cd-help .cd-help-html h6 {
    margin: 32px 0 12px;
    padding: 0;
    color: var(--cd-help-heading);
    font-weight: 700;
    line-height: 1.3;
    scroll-margin-top: var(--cd-help-offset);
}

.cd-help .cd-help-html h1 {
    font-size: 26px;
}

.cd-help .cd-help-html h5 {
    margin-top: 20px;
    font-size: 16px;
}

.cd-help .cd-help-html h6 {
    margin-top: 20px;
    font-size: 14px;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.cd-help .cd-help-html h2 {
    font-size: 22px;
}

.cd-help .cd-help-html h3 {
    margin-top: 24px;
    font-size: 19px;
}

.cd-help .cd-help-html h4 {
    margin-top: 20px;
    font-size: 17px;
}

.cd-help .cd-help-html > :first-child {
    margin-top: 0;
}

.cd-help .cd-help-html > :last-child {
    margin-bottom: 0;
}

.cd-help .cd-help-html a {
    color: var(--cd-help-green);
    text-decoration: underline;
}

.cd-help .cd-help-html img {
    max-width: 100%;
    height: auto;
}

/* lists inside lists, and a little room between items */
.cd-help .cd-help-html li + li {
    margin-top: 6px;
}

.cd-help .cd-help-html li > ul,
.cd-help .cd-help-html li > ol {
    margin: 6px 0 0;
}

.cd-help .cd-help-html ol ol {
    list-style: lower-alpha;
}

.cd-help .cd-help-html ol ol ol {
    list-style: lower-roman;
}

.cd-help .cd-help-html strong,
.cd-help .cd-help-html b {
    color: var(--cd-help-heading);
    font-weight: 600;
}

.cd-help .cd-help-html blockquote {
    margin: 0 0 16px;
    padding: 14px 18px;
    border-left: 3px solid var(--cd-help-green);
    border-radius: 0 8px 8px 0;
    background: #F4F8F5;
}

.cd-help .cd-help-html blockquote > :last-child {
    margin-bottom: 0;
}

/* paragraphs inside a quote stay close (e.g. a postal address written in two paragraphs) */
.cd-help .cd-help-html blockquote p {
    margin-bottom: 4px;
}

.cd-help .cd-help-html hr {
    margin: 28px 0;
    border: 0;
    border-top: 1px solid var(--cd-help-line);
}

.cd-help .cd-help-html code {
    padding: 1px 5px;
    border-radius: 4px;
    background: #F4F8F5;
    color: var(--cd-help-heading);
    font-family: SFMono-Regular, Consolas, Menlo, monospace;
    font-size: .9em;
}

.cd-help .cd-help-html pre {
    margin: 0 0 16px;
    padding: 14px 16px;
    overflow-x: auto;
    border-radius: 8px;
    background: #F4F8F5;
}

.cd-help .cd-help-html pre code {
    padding: 0;
    background: none;
}

.cd-help .cd-help-html dl {
    margin: 0 0 12px;
}

.cd-help .cd-help-html dt {
    color: var(--cd-help-heading);
    font-weight: 600;
}

.cd-help .cd-help-html dd {
    margin: 0 0 10px;
}

.cd-help .cd-help-html figure {
    margin: 0 0 16px;
}

.cd-help .cd-help-html figcaption {
    margin-top: 6px;
    color: var(--cd-help-muted);
    font-size: 14px;
}

.cd-help .cd-help-html small {
    font-size: 14px;
}

.cd-help .cd-help-html mark {
    padding: 0 3px;
    background: #FFF3BF;
}

/* tables: light borders, padding, light header; a wide table scrolls inside its own box */
.cd-help-table-wrap {
    max-width: 100%;
    margin: 0 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.cd-help .cd-help-html table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 15px;
}

.cd-help .cd-help-html th,
.cd-help .cd-help-html td {
    padding: 10px 14px;
    border: 1px solid var(--cd-help-line);
    color: var(--cd-help-text);
    text-align: left;
    vertical-align: top;
}

.cd-help .cd-help-html th {
    background: #F4F8F5;
    color: var(--cd-help-heading);
    font-weight: 600;
}

/* ---------- mobile: the tree sits above the content, closed inside "Browse sections" ---------- */
@media (max-width: 991.98px) {
    .cd-help {
        padding: 20px 0 56px;
    }

    .cd-help-breadcrumb {
        margin-bottom: 20px;
    }

    .cd-help-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }

    .cd-help-nav {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .cd-help .cd-help-back {
        margin-bottom: 12px;
    }

    .cd-help .cd-help-nav-title {
        display: none;   /* the "Articles in this section" button says it */
    }

    .cd-help-browse {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 12px 16px;
        border: 1px solid var(--cd-help-line);
        border-radius: 8px;
        background: #FFFFFF;
        color: var(--cd-help-heading);
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
    }

    .cd-help-browse[aria-expanded="false"] + .cd-help-tree {
        display: none;
    }

    .cd-help-tree {
        margin-top: 8px;
        padding: 8px 16px;
        border: 1px solid var(--cd-help-line);
        border-radius: 8px;
    }

    .cd-help .cd-help-title {
        font-size: 30px;
    }

    .cd-help .cd-help-index-link {
        padding: 22px 0;
        font-size: 14px;
    }

    .cd-help .cd-help-article-title {
        font-size: 21px;
    }
}

/* ---------- small phones (under 768px) ---------- */
@media (max-width: 767.98px) {
    /* breadcrumb: "…" then the last two items only (the JSON-LD in the page keeps the full path) */
    .cd-help-breadcrumb .cd-help-breadcrumb-more {
        display: block;
        flex: 0 0 auto;
    }

    .cd-help-breadcrumb .list:not(.cd-help-breadcrumb-more):not(:nth-last-child(-n+2)) {
        display: none;
    }

    /* one line, so no line starts with a divider; a long name is cut with "…" (the full title is the h1 right below) */
    .cd-help-breadcrumb .inner-menu {
        flex-wrap: nowrap;
    }

    .cd-help-breadcrumb .list {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* dates / scope line: one part per line, no "|" */
    .cd-help .cd-help-meta {
        flex-direction: column;
        gap: 2px;
    }

    .cd-help-meta-sep {
        display: none;
    }
}
