/* The website of Totem. The look is the one of the Spanish Total.js websites (css/corp.css, the CDN styles): this file only adds what a documentation site needs. */

body.toto-site { background: var(--t-paper); }
html { scroll-behavior: smooth; scroll-padding-top: 110px; }

/* Home */
.tm-install { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 24px; }
.tm-cmd { position: relative; display: flex; align-items: center; gap: 12px; background: var(--t-ink, #202b34); color: #f6f1ea; border-radius: 10px; padding: 12px 14px 12px 16px; font: 500 14px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; max-width: 100%; overflow-x: auto; }
.tm-cmd code { background: transparent; color: inherit; padding: 0; white-space: pre; font: inherit; }
.tm-cmd .tm-copy { flex: none; margin-left: auto; border: 1px solid rgba(255,255,255,.28); background: transparent; color: inherit; border-radius: 6px; width: 30px; height: 30px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tm-cmd .tm-copy:hover { background: rgba(255,255,255,.12); }
.tm-note { font-size: 13px; color: var(--t-muted); margin: 0; }

.tm-shots { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; margin-top: 36px; }
.tm-shot { margin: 0; }
.tm-shot picture, .tm-shot img { display: block; width: 100%; height: auto; }
.tm-shot img { border-radius: 12px; border: 1px solid var(--t-border); box-shadow: 0 18px 40px -22px rgba(32,43,52,.45); background: var(--t-card); }
.tm-shot figcaption { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--t-muted); }
.tm-shot figcaption b { color: var(--t-text); }
.tm-shot.wide { grid-column: 1 / -1; }
.tm-honest { margin-top: 26px; font-size: 13px; color: var(--t-muted); max-width: 760px; }

.tm-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 34px; }
.tm-card { min-width: 0; background: var(--t-card); border: 1px solid var(--t-border); border-radius: 14px; padding: 24px; }
.tm-card h3 { font-size: 19px; margin: 0 0 10px; }
.tm-card p { margin: 0 0 12px; color: var(--t-muted); font-size: 15px; line-height: 1.65; }
.tm-card p:last-child { margin-bottom: 0; }
.tm-card .tm-cmd { margin-top: 14px; font-size: 13px; }
.tm-card .tm-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--t-brand); margin-bottom: 10px; }

.tm-chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 30px 0 0; padding: 0; list-style: none; }
.tm-chips li { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--t-border); background: var(--t-card); border-radius: 999px; padding: 8px 16px 8px 12px; font-size: 14px; font-weight: 600; }
.tm-chips li i { flex: none; width: 18px; height: 18px; background: currentColor; -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; opacity: .85; }
.tm-chips li.local { border-color: var(--t-brand); color: var(--t-brand); }

.tm-list { margin: 24px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 40px; }
.tm-list li { position: relative; padding-left: 28px; color: var(--t-muted); font-size: 15px; line-height: 1.6; }
.tm-list li b { color: var(--t-text); }
.tm-list li::before { content: ''; position: absolute; left: 0; top: .5em; width: 12px; height: 12px; border-radius: 50%; background: var(--t-orange, #ff751f); }

.tm-cta { text-align: center; padding: 70px 0 30px; }
.tm-cta h2 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -.04em; margin: 0 0 14px; }
.tm-cta p { color: var(--t-muted); max-width: 560px; margin: 0 auto 26px; }
.tm-cta .t-actions { justify-content: center; }

/* Documentation */
.doc-wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 44px; padding: 44px 0 80px; align-items: start; }
.doc-menu { position: sticky; top: 118px; max-height: calc(100vh - 140px); overflow: auto; font-size: 14px; }
.doc-menu .group { margin-bottom: 22px; }
.doc-menu h2 { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t-muted); margin: 0 0 8px; }
.doc-menu ul { list-style: none; margin: 0; padding: 0; }
.doc-menu a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 7px; text-decoration: none; color: var(--t-text); line-height: 1.4; }
.doc-menu a:hover { background: var(--t-cream); }
.doc-menu a[aria-current="page"] { background: var(--t-cream); color: var(--t-brand); font-weight: 700; }

.doc { min-width: 0; font-size: 16px; line-height: 1.75; }
.doc > :first-child { margin-top: 0; }
.doc h1 { font-size: clamp(34px, 4vw, 48px); line-height: 1.1; letter-spacing: -.045em; margin: 0 0 22px; }
.doc h2 { font-size: 28px; letter-spacing: -.03em; margin: 52px 0 14px; padding-top: 6px; }
.doc h3 { font-size: 20px; margin: 34px 0 10px; }
.doc h4 { font-size: 16px; margin: 24px 0 8px; }
.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { margin: 0 0 18px; padding-left: 24px; }
.doc li { margin: 4px 0; }
.doc li > p { margin: 0 0 8px; }
.doc a { color: var(--t-brand); text-underline-offset: 3px; }
.doc a:hover { text-decoration-thickness: 2px; }
.doc .anchor { margin-left: 8px; font-weight: 400; text-decoration: none; opacity: 0; color: var(--t-muted); }
.doc h2:hover .anchor, .doc h3:hover .anchor, .doc .anchor:focus { opacity: 1; }
.doc code { font: 500 .88em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--t-cream); padding: 2px 6px; border-radius: 5px; }
.doc .code { margin: 0 0 20px; position: relative; }
.doc .code pre { margin: 0; background: var(--t-ink, #202b34); color: #f1ece4; border-radius: 12px; padding: 18px 20px; overflow-x: auto; font-size: 14px; line-height: 1.6; }
.doc .code pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.doc .code .tm-copy { position: absolute; top: 10px; right: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(32,43,52,.8); color: #f1ece4; border-radius: 6px; width: 30px; height: 30px; cursor: pointer; opacity: 0; transition: opacity .15s; display: inline-flex; align-items: center; justify-content: center; }
.doc .code:hover .tm-copy, .doc .code .tm-copy:focus-visible { opacity: 1; }
.hl-c { color: #98a6b3; font-style: italic; }
.hl-s { color: #f2c28f; }
.hl-n { color: #8fd1c4; }
.hl-k { color: #ff9a5c; }
.doc .table { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--t-border); border-radius: 12px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.55; }
.doc th, .doc td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--t-line); }
.doc th { background: var(--t-bar); font-size: 13px; letter-spacing: .02em; }
.doc tr:last-child td { border-bottom: 0; }
.doc blockquote { margin: 0 0 18px; padding: 4px 20px; border-left: 4px solid var(--t-orange, #ff751f); background: var(--t-cream); border-radius: 0 10px 10px 0; color: var(--t-text); }
.doc img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--t-border); }
.doc hr { border: 0; border-top: 1px solid var(--t-line); margin: 36px 0; }

.doc-toc { position: sticky; top: 118px; font-size: 13px; }
.doc-toc h2 { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--t-muted); margin: 0 0 8px; }
.doc-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--t-line); }
.doc-toc a { display: block; padding: 4px 0 4px 14px; text-decoration: none; color: var(--t-muted); line-height: 1.4; }
.doc-toc a:hover { color: var(--t-brand); }

.doc-neighbours { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; }
.doc-neighbours a { flex: 1; max-width: 48%; border: 1px solid var(--t-border); background: var(--t-card); border-radius: 12px; padding: 14px 18px; text-decoration: none; color: var(--t-text); font-weight: 700; line-height: 1.35; }
.doc-neighbours a span { display: block; font-size: 12px; font-weight: 600; color: var(--t-muted); margin-bottom: 4px; }
.doc-neighbours a.next { text-align: right; margin-left: auto; }
.doc-neighbours a:hover { border-color: var(--t-brand); }
.doc-edit { margin-top: 30px; font-size: 13px; color: var(--t-muted); }

@media (max-width: 1100px) {
	.doc-wrap { grid-template-columns: 230px minmax(0, 1fr); }
	.doc-toc { display: none; }
}

@media (max-width: 820px) {
	.doc-wrap { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
	.doc-menu { position: static; max-height: none; border: 1px solid var(--t-border); border-radius: 12px; padding: 16px; background: var(--t-card); }
	.tm-shots, .tm-three, .tm-list { grid-template-columns: 1fr; }
	.toto-site .t-wrap, .toto-site .container { width: calc(100% - 40px); }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .doc .code .tm-copy { transition: none; } }
@media (prefers-color-scheme: dark) { .doc .code pre, .tm-cmd { background: #0d1318; } }

/* The commands in a card wrap instead of hiding the copy button; the notes under a group of boxes breathe */
.tm-card .tm-cmd { overflow-x: visible; align-items: flex-start; }
.tm-card .tm-cmd code { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; }
.tm-chips + .tm-honest, .tm-three + p { margin-top: 22px; }
