/* The site map (Figma 14573-12). The page's header is the catalogue's (page.css); this is the tree
   -- the homepage at its root, a column per branch joined by lines, the branch's pages under it --
   the card of every main category, and the languages row. Pointing at (or keyboarding into) a branch lights it and dims the rest
   (frame "Branch hover"). On a phone the tree is an indented outline (frames b, d). */

.cil-sitemap__body { display: flex; flex-direction: column; gap: 32px; padding-block: 24px 96px; }
.cil-sitemap__lead { margin: 0; color: var(--cil-black-regular-7); font-size: 16px; line-height: 1.2; }

.cil-sitemap__tree {
    display: flex; flex-direction: column; align-items: center;
    padding: 48px; border: 1px solid var(--cil-black-light-3); border-radius: 24px; background: var(--cil-white);
}
.cil-sitemap ul { margin: 0; padding: 0; list-style: none; }
.cil-sitemap svg { display: block; flex: none; }

/* The root: the homepage, and the line down from it. */
.cil-sitemap .cil-sitemap__root {
    position: relative; display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: 24px; background: var(--cil-blue-dark-1);
    color: var(--cil-white); font-size: 16px; font-weight: 700; line-height: 1.2; text-decoration: none;
    transition: background-color .2s ease;
}
.cil-sitemap .cil-sitemap__root:is(:hover, :focus-visible) { background: var(--cil-blue-dark-3); color: var(--cil-white); text-decoration: none; }
.cil-sitemap .cil-sitemap__root:focus-visible { outline: 2px solid var(--cil-blue-dark-1); outline-offset: 3px; }
.cil-sitemap__rootMark { width: 20px; height: 20px; }

/* The branches: as many equal columns as there are, the line across them reaching from the first
   one's middle to the last one's (--branches is set by the page). The design's 20px between them is
   each column's own padding, not a gap: the pointer moving from one to the next never crosses empty
   ground, so the light passes straight across instead of the whole tree flashing back (Oren 2026-10-07). */
.cil-sitemap .cil-sitemap__branches {
    --gap: 20px;
    --ease: .45s cubic-bezier(.4, 0, .2, 1);
    position: relative; display: grid; grid-template-columns: repeat(var(--branches, 6), minmax(0, 1fr)); gap: 0;
    width: 100%; margin-top: 28px;
}
.cil-sitemap__branches::before {
    content: ''; position: absolute; top: -28px; left: 50%; width: 2px; height: 28px; background: var(--cil-black-light-4); translate: -50% 0;
}
.cil-sitemap__branches::after {
    content: ''; position: absolute; top: 0; height: 2px; background: var(--cil-black-light-4);
    inset-inline: calc(100% / var(--branches, 6) / 2);
}
.cil-sitemap__branch { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 20px calc(var(--gap) / 2) 0; transition: opacity var(--ease); }
.cil-sitemap__branch::before { content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 20px; background: var(--cil-black-light-4); translate: -50% 0; }

.cil-sitemap .cil-sitemap__node {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    margin: 0; padding: 14px 12px; border-radius: 12px; background: var(--cil-blue-light-1);
    color: var(--cil-black); font-size: 16px; font-weight: 700; line-height: 1.2; text-align: center;
    transition: background-color var(--ease), color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.cil-sitemap__nodeMark { width: 22px; height: 22px; color: var(--cil-blue-dark-1); transition: color var(--ease); }

.cil-sitemap .cil-sitemap__leaves { position: relative; display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.cil-sitemap__leaves::before { content: ''; position: absolute; top: -16px; left: 50%; width: 2px; height: 16px; background: var(--cil-black-light-4); translate: -50% 0; }
.cil-sitemap .cil-sitemap__leaf {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 7px 12px; border: 1px solid var(--cil-black-light-3); border-radius: 20px; background: var(--cil-white);
    color: var(--cil-black); font-size: 14px; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
    transition: background-color var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
}
.cil-sitemap .cil-sitemap__leaf:is(:hover, :focus-visible) { color: var(--cil-blue-dark-1); text-decoration: underline; text-underline-offset: 3px; }
.cil-sitemap .cil-sitemap__leaf:focus-visible { outline: 2px solid var(--cil-blue-dark-1); outline-offset: 2px; }
.cil-sitemap__away { width: 14px; height: 14px; color: var(--cil-black-regular-6); }

/* A branch pointed at or keyboarded into lights up with its pages; the others dim ("Branch hover").
   The light has to be seen travelling (Oren 2026-10-07: a colour swap alone read as no animation):
   an even curve instead of one that spends itself in the first frames, the title lifting off the
   line, and the pages taking the light one after another. The delays sit on the lit state only, so
   leaving a branch lets go of all its pages at once and the next one can take over without a lag. */
.cil-sitemap__branches:has(.cil-sitemap__branch:is(:hover, :focus-within)) .cil-sitemap__branch:not(:hover, :focus-within) { opacity: .4; }
.cil-sitemap__branch:is(:hover, :focus-within) .cil-sitemap__node {
    background: var(--cil-blue-dark-1); color: var(--cil-white);
    transform: translateY(-4px); box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--cil-blue-dark-1) 70%, transparent);
}
.cil-sitemap__branch:is(:hover, :focus-within) .cil-sitemap__nodeMark { color: var(--cil-white); }
.cil-sitemap .cil-sitemap__branch:is(:hover, :focus-within) .cil-sitemap__leaf {
    border-color: var(--cil-blue-dark-1); background: var(--cil-blue-light-1); color: var(--cil-blue-dark-1);
    transform: translateY(-2px);
}
.cil-sitemap__branch:is(:hover, :focus-within) .cil-sitemap__leaves > li:nth-child(2) .cil-sitemap__leaf { transition-delay: 50ms; }
.cil-sitemap__branch:is(:hover, :focus-within) .cil-sitemap__leaves > li:nth-child(3) .cil-sitemap__leaf { transition-delay: 100ms; }
.cil-sitemap__branch:is(:hover, :focus-within) .cil-sitemap__leaves > li:nth-child(4) .cil-sitemap__leaf { transition-delay: 150ms; }
.cil-sitemap__branch:is(:hover, :focus-within) .cil-sitemap__leaves > li:nth-child(n+5) .cil-sitemap__leaf { transition-delay: 200ms; }

/* Every main category, a card under the tree (frame "Category index"): its title with the grid mark,
   a line, the categories as the tree's pages are drawn, in rows that wrap. */
.cil-sitemap__categories {
    display: flex; flex-direction: column; gap: 16px;
    padding: 48px; border: 1px solid var(--cil-black-light-3); border-radius: 24px; background: var(--cil-white);
}
.cil-sitemap .cil-sitemap__categoriesTitle { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--cil-black); font-size: 16px; font-weight: 700; line-height: 1.2; }
.cil-sitemap__categoriesMark { width: 22px; height: 22px; color: var(--cil-blue-dark-1); }
.cil-sitemap__categoriesLead { margin: 0; color: var(--cil-black-regular-7); font-size: 16px; line-height: 1.2; }
.cil-sitemap .cil-sitemap__categoryList { display: flex; flex-wrap: wrap; gap: 8px; }
.cil-sitemap .cil-sitemap__categoryList .cil-sitemap__leaf { --ease: .2s ease; }
.cil-sitemap .cil-sitemap__categoryList .cil-sitemap__leaf:is(:hover, :focus-visible) { border-color: var(--cil-blue-dark-1); background: var(--cil-blue-light-1); }

/* The languages the site is also in. */
.cil-sitemap__langs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--cil-black-regular-7); font-size: 14px; }
.cil-sitemap__langs ul { display: flex; flex-wrap: wrap; gap: 8px; }
.cil-sitemap__langsMark { width: 18px; height: 18px; }
.cil-sitemap .cil-sitemap__lang {
    display: inline-flex; align-items: center; padding: 7px 18px;
    border: 1px solid var(--cil-black-light-3); border-radius: 20px; background: var(--cil-white);
    color: var(--cil-black); font-size: 14px; font-weight: 600; line-height: 1.2; text-decoration: none;
    transition: border-color .2s ease, color .2s ease;
}
.cil-sitemap .cil-sitemap__lang:is(:hover, :focus-visible) { border-color: var(--cil-blue-dark-1); color: var(--cil-blue-dark-1); text-decoration: none; }
.cil-sitemap .cil-sitemap__lang:focus-visible { outline: 2px solid var(--cil-blue-dark-1); outline-offset: 2px; }

/* Narrower than the columns can hold: the tree as an indented outline -- the root, then each branch
   as a row with its pages under it, a line down their start side (frames b, d). */
@media (max-width: 1079px) {
    .cil-sitemap__body { gap: 24px; padding-block: 0 64px; }
    .cil-sitemap__lead { font-size: 14px; }
    .cil-sitemap__tree { align-items: flex-start; padding: 20px 16px; }
    .cil-sitemap .cil-sitemap__root { font-size: 14px; }
    .cil-sitemap .cil-sitemap__branches { display: flex; flex-direction: column; gap: 0; margin-top: 0; }
    .cil-sitemap__branches::before, .cil-sitemap__branches::after,
    .cil-sitemap__branch::before, .cil-sitemap__leaves::before { display: none; }
    .cil-sitemap__branch { gap: 8px; padding: 16px 0 0; }
    .cil-sitemap .cil-sitemap__node { flex-direction: row; gap: 10px; padding: 10px 14px; font-size: 14px; text-align: start; }
    .cil-sitemap__nodeMark { width: 20px; height: 20px; }
    .cil-sitemap .cil-sitemap__leaves { align-items: flex-start; gap: 6px; margin-top: 0; margin-inline-start: 18px; padding-inline-start: 12px; border-inline-start: 2px solid var(--cil-black-light-4); }
    .cil-sitemap .cil-sitemap__leaf { padding: 7px 12px; font-size: 12px; }
    .cil-sitemap__categories { gap: 12px; padding: 20px 16px; }
    .cil-sitemap .cil-sitemap__categoriesTitle { font-size: 14px; }
    .cil-sitemap__categoriesMark { width: 20px; height: 20px; }
    .cil-sitemap__categoriesLead { font-size: 14px; }
    .cil-sitemap__langs { font-size: 12px; }
    .cil-sitemap .cil-sitemap__lang { padding: 6px 14px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .cil-sitemap__branch, .cil-sitemap .cil-sitemap__node, .cil-sitemap__nodeMark, .cil-sitemap .cil-sitemap__leaf,
    .cil-sitemap .cil-sitemap__root, .cil-sitemap .cil-sitemap__lang { transition: none; }
    .cil-sitemap__branch:is(:hover, :focus-within) .cil-sitemap__node,
    .cil-sitemap .cil-sitemap__branch:is(:hover, :focus-within) .cil-sitemap__leaf { transform: none; }
}
