/* ColoTycoon public website (resources/views/site): the hubs, the articles, the FAQ and the glossary.
   Everything else (tokens, type, buttons, the ground, the header and the footer) comes from the landing
   page's design system, linked before this file by site.partials.styles; this file only lays out the
   content pages' own parts with its tokens. The kit's one-section-per-screen rhythm is for the landing
   page only, so main here holds no <section> children. */

/* the page under the fixed header */
.ct-site {
    padding-top: var(--nav);
}

/* breadcrumbs */
.ct-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
    padding-top: var(--s-6);
    font-size: var(--t-small);
    color: var(--muted);
}
.ct-crumbs li + li::before {
    content: '/';
    margin-right: var(--s-2);
    color: var(--line-strong);
}
.ct-crumbs a:hover {
    color: var(--ink);
}

/* a page's head: the h1 at the landing hero's size, the lead under it */
.ct-head {
    display: grid;
    gap: var(--s-5);
    padding: var(--s-7) 0 var(--s-8);
}
.ct-head h1 {
    max-width: 18ch;
}
.ct-lead {
    font-size: var(--t-lead);
    line-height: 1.5;
    max-width: 52ch;
}
.ct-meta {
    font-size: var(--t-small);
    color: var(--muted);
}
.ct-kicker {
    display: flex;
    align-items: center;
    gap: var(--s-4);
    font-size: var(--t-small);
    font-weight: 500;
    color: var(--muted);
}

/* the topic icon: a Lucide line icon (App\Site\Icon) on a small square tile */
.ct-tile {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    background: var(--bg);
    color: var(--ink);
    transition:
        background-color var(--dur) var(--ease),
        color var(--dur) var(--ease),
        border-color var(--dur) var(--ease);
}
.ct-icon {
    width: 24px;
    height: 24px;
}

/* a hub: the section's pages as cards, three across at 1440 */
.ct-hub {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
    gap: 0 var(--s-7);
    padding-bottom: var(--s-8);
}
.ct-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--s-5);
    align-items: start;
    padding: var(--s-6) 0;
    border-top: 1px solid var(--line);
}
.ct-card:hover .ct-tile,
.ct-card:focus-visible .ct-tile {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}
.ct-card__text {
    display: grid;
    gap: var(--s-2);
}
.ct-card__step {
    font-size: var(--t-label);
    font-weight: 500;
    color: var(--muted);
}
.ct-card__title {
    font: var(--display-weight) 22px/1.2 var(--font-display);
    letter-spacing: -0.02em;
    color: var(--ink);
}
.ct-card:hover .ct-card__title {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}
.ct-card__desc {
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted);
}

/* the screenshots page: two large shots per row from 900, one below */
.ct-shots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr));
    gap: var(--s-8) var(--s-7);
    padding-bottom: var(--s-8);
}
.ct-shot {
    display: grid;
    align-content: start;
    gap: var(--s-4);
    margin: 0;
}
.ct-shot a {
    display: block;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--bg);
    box-shadow: 0 12px 32px -18px rgb(0 0 0 / 0.35);
}
.ct-shot img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
}
.ct-shot a:hover img,
.ct-shot a:focus-visible img {
    transform: scale(1.02);
}
.ct-shot figcaption {
    display: grid;
    gap: var(--s-2);
}
.ct-shot__title {
    font: var(--display-weight) 20px/1.2 var(--font-display);
    letter-spacing: -0.02em;
    color: var(--ink);
}
.ct-shot__caption {
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
    .ct-shot img {
        transition: none;
    }
}

/* an article: the contents list beside the text from 1024 */
.article-body {
    display: grid;
    grid-template-columns: 240px minmax(0, 720px);
    gap: var(--s-8);
    padding-bottom: var(--s-8);
}
.article-body > .prose:only-child {
    grid-column: 2;
}
.toc {
    position: sticky;
    top: calc(var(--nav) + var(--s-6));
    align-self: start;
    font-size: var(--t-small);
}
.toc h2 {
    font: 500 var(--t-label) / 1.4 var(--font-text);
    letter-spacing: 0;
    color: var(--muted);
    margin-bottom: var(--s-3);
}
.toc ol {
    display: grid;
    gap: var(--s-2);
    border-left: 1px solid var(--line);
}
.toc a {
    display: block;
    padding-left: var(--s-4);
    line-height: 1.4;
    color: var(--muted);
}
.toc a:hover {
    color: var(--ink);
}
@media (max-width: 1023px) {
    .article-body {
        grid-template-columns: 1fr;
        gap: var(--s-6);
    }
    .article-body > .prose:only-child {
        grid-column: auto;
    }
    .toc {
        position: static;
    }
}

/* the article's text */
.prose {
    max-width: 720px;
    min-width: 0;
    font-size: 17px;
    line-height: 1.65;
}
.prose > :first-child {
    margin-top: 0;
}
.prose h2 {
    font-size: var(--t-h3);
    line-height: 1.2;
    margin: var(--s-8) 0 var(--s-4);
    scroll-margin-top: calc(var(--nav) + var(--s-5));
}
.prose h3 {
    font: 600 19px/1.3 var(--font-text);
    letter-spacing: -0.01em;
    margin: var(--s-6) 0 var(--s-3);
}
.prose p,
.prose ul,
.prose ol {
    margin: 0 0 var(--s-4);
}
.prose ul {
    padding-left: 22px;
    list-style: disc;
}
.prose ol {
    padding-left: 22px;
    list-style: decimal;
}
.prose li + li {
    margin-top: var(--s-2);
}
.prose strong {
    color: var(--ink);
    font-weight: 600;
}
.ct-site .prose a:not([class]),
.ct-also a {
    background: none;
    padding: 0;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
    text-underline-offset: 3px;
    transition: text-decoration-color var(--dur) var(--ease);
}
.ct-site .prose a:not([class]):hover,
.ct-also a:hover {
    text-decoration-color: currentColor;
}
.prose table {
    display: block;
    overflow-x: auto;
    width: 100%;
    border-collapse: collapse;
    margin: var(--s-2) 0 var(--s-5);
    font-size: 15px;
}
.prose th,
.prose td {
    text-align: left;
    padding: 10px 14px 10px 0;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.prose th {
    font-weight: 500;
    color: var(--ink);
    border-bottom-color: var(--line-strong);
}
.prose code {
    font: 0.9em var(--font-mono);
    background: var(--surface);
    padding: 1px 5px;
    border-radius: var(--r-sm);
}

/* the FAQ and the glossary */
.faq__item,
.glossary__item {
    border-top: 1px solid var(--line);
    padding: var(--s-5) 0 var(--s-2);
    scroll-margin-top: calc(var(--nav) + var(--s-5));
}
.prose .faq__item h2 {
    font-size: 22px;
    margin: 0 0 var(--s-3);
}
.glossary-index {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2) var(--s-4);
    font-size: 15px;
    margin: var(--s-2) 0 var(--s-6);
}
.glossary dt {
    font: var(--display-weight) 22px/1.2 var(--font-display);
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: var(--s-2);
}
.glossary dd {
    margin: 0;
}

/* previous and next, related pages, the hubs' other sections */
.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--s-5);
    padding-bottom: var(--s-7);
}
.pager a {
    display: grid;
    gap: var(--s-1);
    padding-top: var(--s-4);
    border-top: 1px solid var(--line-strong);
    font: var(--display-weight) 20px/1.3 var(--font-display);
    letter-spacing: -0.02em;
    color: var(--ink);
}
.pager a span {
    font: 400 var(--t-small) / 1.4 var(--font-text);
    letter-spacing: 0;
    color: var(--muted);
}
.pager__next {
    grid-column: 2;
    text-align: right;
}
.pager a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}
.related,
.ct-also {
    padding-bottom: var(--s-7);
}
.related h2,
.ct-also h2 {
    font-size: var(--t-h3);
    margin-bottom: var(--s-4);
}
.related__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 0 var(--s-6);
}
.related__item {
    display: grid;
    gap: var(--s-1);
    padding: var(--s-4) 0;
    border-top: 1px solid var(--line);
}
.related__title {
    font: var(--display-weight) 19px/1.3 var(--font-display);
    letter-spacing: -0.02em;
    color: var(--ink);
}
.related__item:hover .related__title {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}
.related__desc {
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted);
}
.ct-also ul {
    display: grid;
    gap: var(--s-2);
    padding-left: 20px;
    list-style: disc;
}

/* the close: the landing page's closing words and its one button */
.ct-site-close {
    padding: var(--s-8) 0 var(--s-9);
}
.ct-site-close .ct-copy h2 {
    max-width: 20ch;
}

/* the wiki: a sticky page list on the left, the article with its infobox on the right */
.wiki {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: var(--s-8);
    align-items: start;
    padding: var(--s-6) 0 var(--s-8);
}
.wiki-nav {
    position: sticky;
    top: calc(var(--nav) + var(--s-5));
    max-height: calc(100vh - var(--nav) - var(--s-7));
    overflow-y: auto;
    display: grid;
    gap: var(--s-5);
    font-size: 14px;
}
.wiki-nav__search input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    border-radius: var(--r-sm);
}
.wiki-nav__group + .wiki-nav__group {
    margin-top: var(--s-5);
}
.wiki-nav__title {
    font-size: var(--t-label);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: var(--s-2);
}
.wiki-nav ul {
    display: grid;
    gap: 2px;
}
.wiki-nav a {
    display: block;
    padding: 4px 8px;
    margin-left: -8px;
    color: var(--ink);
    border-left: 2px solid transparent;
}
.wiki-nav a:hover {
    background: var(--surface);
}
.wiki-nav a[aria-current='page'] {
    border-left-color: #10b981;
    background: var(--surface);
    font-weight: 600;
}
.wiki-nav__list {
    display: grid;
    gap: var(--s-5);
}
.wiki-nav__list > summary {
    display: none;
}
.wiki-nav__list[open] {
    display: grid;
}
@media (max-width: 899px) {
    .wiki-nav__list > summary {
        display: block;
        cursor: pointer;
        padding: 8px 10px;
        border: 1px solid var(--line);
        font-weight: 500;
    }
    .wiki-nav__list[open] > summary {
        margin-bottom: var(--s-3);
    }
}
.wiki-nav__empty {
    color: var(--muted);
}
.wiki-main {
    min-width: 0;
}
.wiki-head {
    display: grid;
    gap: var(--s-4);
    padding-bottom: var(--s-6);
    border-bottom: 1px solid var(--line);
    margin-bottom: var(--s-6);
}
.wiki-head h1 {
    font-size: clamp(36px, 5vw, 56px);
    line-height: 1.05;
}
.wiki-head .ct-lead {
    font-size: 18px;
    max-width: 60ch;
}
.wiki-head .ct-lead a {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.wiki-cat {
    padding-bottom: var(--s-7);
}
.wiki-cat h2 {
    font: var(--display-weight) 24px/1.2 var(--font-display);
    letter-spacing: -0.02em;
    margin-bottom: var(--s-5);
}
.wiki-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: var(--s-5);
}
.wiki-card {
    display: grid;
    align-content: start;
    gap: var(--s-2);
    padding: var(--s-4);
    border: 1px solid var(--line);
    background: var(--bg);
    transition: border-color 0.2s ease;
}
.wiki-card:hover {
    border-color: var(--ink);
}
.wiki-card img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top left;
    border: 1px solid var(--line);
    margin-bottom: var(--s-2);
}
.wiki-card__title {
    font-weight: 600;
    color: var(--ink);
}
.wiki-card__desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--muted);
}
.infobox {
    float: right;
    width: min(320px, 40%);
    margin: 0 0 var(--s-5) var(--s-6);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    font-size: 14px;
}
.infobox__title {
    padding: var(--s-3) var(--s-4);
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid var(--line);
}
.infobox img {
    cursor: zoom-in;
    display: block;
    width: 100%;
    height: auto;
    border-bottom: 1px solid var(--line);
}
.infobox dl {
    display: grid;
}
.infobox dl div {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-top: 1px solid var(--line);
}
.infobox dl div:first-child {
    border-top: 0;
}
.infobox dt {
    font-weight: 600;
    color: var(--ink);
}
.infobox dd {
    color: var(--muted);
    line-height: 1.45;
}
.wiki-body {
    max-width: none;
}
.wiki-body h2 {
    clear: none;
    scroll-margin-top: calc(var(--nav) + var(--s-5));
}
.wiki-figure {
    /* a figure beside the infobox narrows to the room left instead of jumping below it */
    display: flow-root;
    margin: var(--s-5) 0 var(--s-6);
}
.wiki-figure {
    max-width: 560px;
}
.wiki-figure img {
    display: block;
    width: 100%;
    height: auto;
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--line);
    box-shadow: 0 12px 32px -20px rgb(0 0 0 / 0.35);
}
.wiki-figure img:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px -20px rgb(0 0 0 / 0.45);
}
.wiki-figure figcaption {
    margin-top: var(--s-3);
    font-size: 14px;
    color: var(--muted);
}
.wiki-deeper,
.wiki-see-also {
    clear: both;
    margin-top: var(--s-7);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
}
.wiki-see-also h2 {
    font: var(--display-weight) 20px/1.2 var(--font-display);
    margin-bottom: var(--s-4);
}
.wiki-see-also ul {
    display: grid;
    gap: var(--s-3);
    color: var(--muted);
}
.wiki-deeper a,
.wiki-see-also a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.wiki-article .pager {
    clear: both;
    margin-top: var(--s-7);
}
@media (max-width: 899px) {
    .wiki {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--s-5);
    }
    .wiki-nav {
        position: static;
        max-height: none;
    }
    .infobox {
        float: none;
        width: 100%;
        margin: 0 0 var(--s-6);
    }
}
/* the picture viewer: a click on a wiki picture opens it large in a dialog */
.wiki-lightbox {
    max-width: min(1280px, 94vw);
    max-height: 92vh;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
}
.wiki-lightbox::backdrop {
    background: rgb(10 10 10 / 0.72);
    backdrop-filter: blur(3px);
}
.wiki-lightbox[open] {
    animation: wiki-zoom 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.wiki-lightbox[open]::backdrop {
    animation: wiki-fade 0.22s ease;
}
.wiki-lightbox.is-closing {
    animation: wiki-zoom-out 0.16s ease forwards;
}
.wiki-lightbox.is-closing::backdrop {
    animation: wiki-fade-out 0.16s ease forwards;
}
.wiki-lightbox img {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 48px);
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 6px;
    box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.6);
    cursor: zoom-out;
}
.wiki-lightbox p {
    margin-top: 12px;
    text-align: center;
    color: #f5f5f4;
    font-size: 14px;
}
.wiki-lightbox button {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 0;
    background: #fafaf9;
    color: #0a0a0a;
    font-size: 18px;
    line-height: 32px;
    cursor: pointer;
}
@keyframes wiki-zoom {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
}
@keyframes wiki-zoom-out {
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}
@keyframes wiki-fade {
    from {
        opacity: 0;
    }
}
@keyframes wiki-fade-out {
    to {
        opacity: 0;
    }
}
@media (prefers-reduced-motion: reduce) {
    .wiki-card,
    .wiki-figure img {
        transition: none;
    }
    .wiki-lightbox[open],
    .wiki-lightbox[open]::backdrop,
    .wiki-lightbox.is-closing,
    .wiki-lightbox.is-closing::backdrop {
        animation: none;
    }
}

/* a tip or warning in a wiki page (a Markdown blockquote) */
.wiki-body blockquote {
    margin: var(--s-5) 0;
    padding: var(--s-4) var(--s-5);
    border-left: 3px solid #10b981;
    background: color-mix(in oklab, #10b981 8%, transparent);
}
.wiki-body blockquote p {
    margin: 0;
}
.wiki-body h3 {
    margin-top: var(--s-6);
}

/* a non-English visitor on an English-only article */
.ct-english-only {
    margin-top: var(--s-5);
    padding: var(--s-3) var(--s-4);
    border-left: 3px solid #10b981;
    background: color-mix(in oklab, #10b981 8%, transparent);
    font-size: 14px;
    color: var(--muted);
}
