/* ============================================================================
   help.css — the Help Center shell and its content components (HC-2, D-HC-06)

   Replaces the 330-line <style> block that lived inside templates/help/base.html.
   Loaded from that template AFTER style.css, so it wins on ties; theme.css is
   already in scope via includes/head_meta.html.

   COLOUR RULE: every value here resolves to a theme.css token. The help pages
   introduced eight ad-hoc hexes (#fafafa, #eee, #f9f9f9, #f39c12, #d73502,
   #2c5a3e, #e5e5e5, #666) and used the light brand green #71c55d as *text* on
   white, which fails AA — that green is a FILL colour. If a page needs a colour
   that is not a token, that is a finding for HC_PLAN, not a licence to add a hex.
   The only literals below are rgba() of tokens already in the palette (the brand
   green / blue / amber at alpha, exactly as base_landing.html uses them), named
   once as --help-* variables so they are not re-typed per rule.

   THE COMPONENT SET — HC-4/5/6 write markup against THESE names. Do not invent
   parallel classes; extend these:

     Shell      .help-container  .help-sidebar  .help-content
                .help-breadcrumb .help-header   .help-footer
     Content    .hc-eyebrow      small-caps dark-green label above a heading
                .hc-card         white card, thin line, one soft shadow
                .hc-grid         auto card grid (+ .hc-grid--2 / --3)
                .hc-callout      aside (+ .hc-callout--info / --warn / --tip)
                .hc-steps        ordered list, green numerals
                .hc-figure       captioned block (figure.hc-shot = screenshot,
                                 D-HC-03 — keep that name)
                .hc-video        16:9 responsive embed wrapper
                .hc-table        data table
                .hc-cta          green pill button

   LEGACY ALIASES (bottom of file): the pre-HC-2 pages use .help-card (260
   occurrences), .help-card.info/.success/.warning, .help-article, .contact-info,
   .contact-item and .role-badge. They are aliased onto the components above so
   those pages inherit the brand today. HC-4/5/6 rewrite them page by page; the
   alias block is deleted with the last one.
   ============================================================================ */

:root {
    /* navigation.html fixes its bar and reserves the space with
       `body { padding-top: 80px !important }` — this mirrors that number so the
       sticky sidebar clears the bar. Do not set body padding here; the nav's
       !important rule loads later in the document and wins anyway. */
    --help-nav-h: 80px;
    --help-sidebar-w: 276px;

    /* Brand hues at alpha. Same rgb as --eu-green-light / --eu-blue /
       --eu-warning; no new colour is introduced. */
    --help-green-wash: rgba(113, 197, 93, 0.10);
    --help-green-fill: rgba(113, 197, 93, 0.18);
    --help-blue-wash:  rgba(79, 142, 225, 0.07);
    --help-amber-wash: rgba(255, 152, 0, 0.09);
    --help-card-lift:  0 14px 28px rgba(44, 90, 62, 0.08);
}

/* ---- Page ground ------------------------------------------------------- */

body {
    font-family: "DM Sans", sans-serif;
    color: var(--ink-soft);
    background-color: var(--bg);
}

/* ---- Shell ------------------------------------------------------------- */

.help-container {
    display: flex;
    align-items: flex-start;
    gap: 26px;
    max-width: 1240px;
    margin: 0 auto;
    padding: 26px 22px 72px;
}

/* Sticky, not a fixed-height scroll box. The old rule was
   `height: calc(100vh - 80px); overflow-y: auto`, which drew a SECOND scrollbar
   next to the page's on every viewport. `max-height` only engages when the six
   sections genuinely do not fit, and the list below is sized so 6 headers + 20
   items clear a 900px window. */
.help-sidebar {
    flex: 0 0 var(--help-sidebar-w);
    width: var(--help-sidebar-w);
    position: sticky;
    top: calc(var(--help-nav-h) + 16px);
    max-height: calc(100vh - var(--help-nav-h) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding: 2px 4px 6px 0;
}

.help-sidebar > .hc-eyebrow {
    display: block;
    margin: 0 12px 8px;
}

/* Section title: ink, sentence case, tight. The uppercase letter-spaced labels
   and the green underline were the "wiki" tell called out in HC_PLAN §1f. */
.help-sidebar h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 12px 3px;
    padding: 0;
    border: 0;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.help-sidebar h3 i {
    color: var(--eu-green-dark);
    font-size: 12px;
    width: 14px;
    text-align: center;
}

.help-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-nav li { margin: 0; }

.help-nav a {
    display: block;
    padding: 4px 10px 4px 13px;
    border-left: 3px solid transparent;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.35;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.help-nav a:hover,
.help-nav a:focus-visible {
    background-color: var(--help-green-wash);
    color: var(--ink);
}

/* Active = a green FILL indicator, not green text. */
.help-nav a.active {
    background-color: var(--help-green-fill);
    border-left-color: var(--eu-green-light);
    color: var(--ink);
    font-weight: 600;
}

.help-nav i {
    margin-right: 7px;
    width: 13px;
    text-align: center;
    font-size: 12px;
    color: var(--ink-muted);
}

.help-nav a:hover i,
.help-nav a.active i { color: var(--eu-green-dark); }

/* The content column is the page's one card. */
.help-content {
    flex: 1 1 auto;
    min-width: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--eu-shadow);
    padding: 34px 40px 30px;
}

.help-breadcrumb {
    margin-bottom: 18px;
    font-size: 13px;
    color: var(--ink-muted);
}

.help-breadcrumb a {
    color: var(--eu-green-dark);
    text-decoration: none;
    font-weight: 600;
}

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

.help-header {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.help-header h1 {
    margin: 0 0 10px;
    color: var(--ink);
    font-size: clamp(27px, 3vw, 34px);
    font-weight: 700;
    letter-spacing: -0.6px;
    line-height: 1.15;
}

.help-header h1 i { color: var(--eu-green-dark); }

.help-header .subtitle {
    margin: 0;
    color: var(--ink-muted);
    font-size: 16px;
    line-height: 1.6;
    max-width: 68ch;
}

.help-footer {
    margin-top: 44px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    text-align: center;
    color: var(--ink-muted);
    font-size: 13.5px;
}

.help-footer a {
    color: var(--eu-green-dark);
    font-weight: 600;
    text-decoration: none;
}

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

/* ---- Prose ------------------------------------------------------------- */

.help-article {
    font-size: 15.5px;
    line-height: 1.7;
    color: var(--ink-soft);
}

.help-article h2 {
    margin: 36px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.help-article h3 {
    margin: 26px 0 10px;
    color: var(--ink);
    font-size: 18.5px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.help-article h4 {
    margin: 20px 0 8px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
}

.help-article p { margin: 14px 0; }

.help-article ul,
.help-article ol {
    margin: 14px 0;
    padding-left: 24px;
}

.help-article li { margin: 7px 0; }

.help-article a {
    color: var(--eu-green-dark);
    font-weight: 600;
}

.help-article code {
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    background: var(--line-soft);
    border: 1px solid var(--line);
    font-family: "Courier New", monospace;
    font-size: 13.5px;
    color: var(--ink);
}

.help-article pre {
    margin: 20px 0;
    padding: 15px 18px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--eu-green-light);
    background: var(--line-soft);
    overflow-x: auto;
}

.help-article pre code { border: 0; background: none; padding: 0; }

.help-article blockquote {
    margin: 20px 0;
    padding: 14px 20px;
    border-left: 3px solid var(--eu-green-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--help-green-wash);
}

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

/* ---- Components -------------------------------------------------------- */

.hc-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--eu-green-dark);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.hc-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin: 20px 0;
    box-shadow: var(--eu-shadow);
}

.hc-card > :first-child { margin-top: 0; }
.hc-card > :last-child { margin-bottom: 0; }

.hc-card h3,
.hc-card h4 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.hc-card h3 i,
.hc-card h4 i { color: var(--eu-green-dark); margin-right: 9px; }

.hc-card ul,
.hc-card ol { margin: 12px 0 0; padding-left: 22px; }

/* A card whose heading IS the link (the index's Popular Articles). */
.hc-card h4 a {
    color: var(--ink);
    text-decoration: none;
}

.hc-card h4 a:hover { color: var(--eu-green-dark); }

.hc-card p { margin: 8px 0 0; }

/* Secondary line under a heading, or a footnote under a block. */
.hc-note {
    color: var(--ink-muted);
    font-size: 13.5px;
    line-height: 1.55;
}

.hc-note i { color: var(--eu-green-dark); margin-right: 6px; }

.hc-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin: 22px 0 34px;
}

.hc-grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.hc-grid--3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* Callouts: a 3px accent edge and a wash of the same hue. */
.hc-callout {
    margin: 22px 0;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--eu-green-light);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: var(--help-green-wash);
}

.hc-callout > :first-child { margin-top: 0; }
.hc-callout > :last-child { margin-bottom: 0; }

.hc-callout h4 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 15.5px;
    font-weight: 700;
}

.hc-callout h4 i { margin-right: 4px; }

.hc-callout--info {
    border-left-color: var(--eu-blue);
    background: var(--help-blue-wash);
}

.hc-callout--info h4 i { color: var(--eu-blue); }

.hc-callout--warn {
    border-left-color: var(--eu-warning);
    background: var(--help-amber-wash);
}

.hc-callout--warn h4 i { color: var(--eu-warning); }

.hc-callout--tip {
    border-left-color: var(--eu-green-light);
    background: var(--help-green-wash);
}

.hc-callout--tip h4 i { color: var(--eu-green-dark); }

/* Steps: numerals carry the green, the text stays ink. */
.hc-steps {
    counter-reset: hc-step;
    list-style: none;
    margin: 20px 0;
    padding: 0;
}

.hc-steps > li {
    counter-increment: hc-step;
    position: relative;
    margin: 0 0 14px;
    padding-left: 40px;
    min-height: 26px;
}

.hc-steps > li::before {
    content: counter(hc-step);
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-pill);
    background: var(--help-green-fill);
    color: var(--eu-green-deepest);
    font-size: 13px;
    font-weight: 700;
    display: grid;
    place-items: center;
}

.hc-steps > li > strong { color: var(--ink); }

/* Figures. figure.hc-shot is the screenshot convention (D-HC-03). */
.hc-figure,
figure.hc-shot {
    margin: 24px 0;
    padding: 0;
}

.hc-figure img,
figure.hc-shot img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--card);
}

.hc-figure figcaption,
figure.hc-shot figcaption {
    margin-top: 9px;
    color: var(--ink-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* 16:9 embed wrapper. The three tutorial-video pages keep their own
   .player-wrapper for now; HC-5 merges them onto this. */
.hc-video {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 24px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--line-soft);
}

.hc-video iframe,
.hc-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.hc-table {
    width: 100%;
    margin: 22px 0;
    border-collapse: collapse;
    font-size: 14.5px;
}

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

.hc-table thead th {
    background: var(--line-soft);
    color: var(--ink);
    font-weight: 700;
}

.hc-table tbody tr:nth-child(even) td { background: var(--bg); }

/* Wrap a wide table in this so it scrolls itself instead of the page. */
.hc-table-wrap {
    overflow-x: auto;
    margin: 22px 0;
}

.hc-table-wrap .hc-table { margin: 0; }

/* Green pill CTA. White on --eu-green-deepest is 7.95:1; white on the light
   green is 2.3:1 and fails AA — the same finding academy.css records at its
   line 165. Do not re-anchor this to --eu-green-light. */
.hc-cta {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 22px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--eu-green-deepest);
    color: var(--eu-white);
    font-size: 14.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: box-shadow 180ms cubic-bezier(0.23, 1, 0.32, 1),
                transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
}

.hc-cta:hover,
.hc-cta:focus-visible {
    color: var(--eu-white);
    text-decoration: none;
    box-shadow: var(--help-card-lift);
}

@media (hover: hover) and (pointer: fine) {
    .hc-cta:hover { transform: translateY(-1px); }
}

/* ---- Legacy aliases (deleted page by page in HC-4/5/6) ----------------- */

/* .help-card is the old do-everything class: 260 uses, sometimes a card,
   sometimes a callout. Base = card; the three modifiers = callouts. */
.help-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin: 20px 0;
    box-shadow: var(--eu-shadow);
}

.help-card > :first-child { margin-top: 0; }
.help-card > :last-child { margin-bottom: 0; }

.help-card h3,
.help-card h4 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.help-card h3 i,
.help-card h4 i { color: var(--eu-green-dark); }

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

.help-card.info,
.help-card.warning,
.help-card.success {
    border-left-width: 3px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    box-shadow: none;
}

.help-card.info {
    border-left-color: var(--eu-blue);
    background: var(--help-blue-wash);
}

.help-card.info h4 i { color: var(--eu-blue); }

.help-card.warning {
    border-left-color: var(--eu-warning);
    background: var(--help-amber-wash);
}

.help-card.warning h4 i { color: var(--eu-warning); }

.help-card.success {
    border-left-color: var(--eu-green-light);
    background: var(--help-green-wash);
}

/* The index and contact pages' support block. */
.contact-info {
    margin: 30px 0 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--help-green-wash);
}

.contact-info h3 {
    margin: 0 0 16px;
    color: var(--ink);
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.contact-info h3 i { color: var(--eu-green-dark); margin-right: 4px; }

.contact-info > p { margin: 0 0 18px; color: var(--ink-soft); }

.contact-info > .hc-note { margin: 16px 0 0; }

.contact-item {
    display: flex;
    align-items: center;
    margin: 10px 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--card);
}

.contact-item i {
    width: 20px;
    margin-right: 14px;
    text-align: center;
    color: var(--eu-green-dark);
    font-size: 16px;
}

.contact-item a {
    color: var(--eu-green-dark);
    font-weight: 600;
    text-decoration: none;
}

.contact-item a:hover { text-decoration: underline; }

/* Eight content pages still print this inside `{% if user_role == 'designer' %}`.
   HC-2 removed only the index page's unconditional REGULAR USER / DESIGNER
   ACCESS pair; the rest go with their page's rewrite. */
.role-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--help-green-fill);
    color: var(--eu-green-deepest);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.role-badge.designer {
    background: var(--help-blue-wash);
    color: var(--ink);
}

/* ---- Responsive -------------------------------------------------------- */

@media (max-width: 1024px) {
    .help-container {
        flex-direction: column;
        gap: 18px;
        padding: 18px 16px 56px;
    }

    .help-sidebar {
        flex: 1 1 auto;
        width: 100%;
        position: static;
        max-height: none;
        overflow: visible;
        padding: 14px 8px;
        border: 1px solid var(--line);
        border-radius: var(--radius-lg);
        background: var(--card);
    }

    .help-content {
        /* Stacked, the card is sized by its own content and spills past the
           viewport; pin it to the column the way the sidebar above is. */
        width: 100%;
        padding: 24px 22px 22px;
    }
}

@media (max-width: 640px) {
    .help-container { padding: 14px 12px 44px; }
    .help-content {
        padding: 20px 16px 18px;
        border-radius: var(--radius-md);
    }
    .help-article { font-size: 15px; }
    .help-header { margin-bottom: 22px; padding-bottom: 16px; }
    .help-article h2 { font-size: 21px; }
    .hc-grid,
    .hc-grid--2,
    .hc-grid--3 { grid-template-columns: 1fr; }

    /* Content pages still hardcode two-column grids in inline styles (HC-4/5/6
       migrate them to .hc-grid). Collapse them here so a phone gets no sideways
       scroll; !important is what it takes to beat a style attribute. */
    .help-content [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    .contact-item { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    /* Colour feedback stays — it is the affordance; only movement goes. */
    .hc-cta { transition: box-shadow 180ms ease; }
    .hc-cta:hover { transform: none; }
}
