/* ==========================================================================
   Grapphen Atelier: company, compare, legal and developer pages
   Builds only on the tokens and components in atelier.css. Every selector is
   prefixed c- so nothing here can reach the product pages.

   1  Contents list (c-toc)        5  About
   2  Legal documents (c-legal)    6  Careers and job board
   3  Compare pages (c-vs)         7  Developer guide (c-dev)
   4  Questions page (c-faq)       8  Responsive
   ========================================================================== */

/* 1 Contents list --------------------------------------------------------- */
.c-toc { font-size: .875rem; line-height: 1.45; }
.c-toc__summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 0;
	border-top: 1px solid var(--ink);
	border-bottom: 1px solid var(--rule);
	font-weight: 500;
	color: var(--ink);
	list-style: none;
	cursor: pointer;
}
.c-toc__summary::-webkit-details-marker { display: none; }
.c-toc__summary::after {
	content: "";
	width: 7px; height: 7px;
	margin-right: 4px;
	border-right: 1.5px solid var(--slate);
	border-bottom: 1.5px solid var(--slate);
	transform: translateY(-2px) rotate(45deg);
	transition: transform .2s var(--ease);
}
.c-toc__details[open] .c-toc__summary::after { transform: translateY(2px) rotate(-135deg); }
.c-toc__title { display: none; margin-bottom: 12px; font-weight: 500; color: var(--ink); }
.c-toc__list { counter-reset: none; }
.c-toc__list a {
	display: block;
	padding: 7px 0;
	border-bottom: 1px solid var(--rule-soft);
	color: var(--slate);
	text-decoration: none;
	transition: color .15s;
}
.c-toc__list a:hover { color: var(--cobalt); }
.c-toc__aside { margin-top: 24px; color: var(--slate); }
.c-toc__aside a { color: var(--cobalt); }

@media (min-width: 1080px) {
	.c-toc {
		position: sticky;
		top: calc(var(--header) + 32px);
		max-height: calc(100vh - var(--header) - 64px);
		overflow-y: auto;
		padding-right: 8px;
		scrollbar-width: thin;
	}
	.admin-bar .c-toc { top: calc(var(--header) + 64px); }
	.c-toc__summary { display: none; }
	.c-toc__title { display: block; }
	.c-toc__list { border-top: 1px solid var(--ink); }
}

/* 2 Legal documents -------------------------------------------------------- */
.c-legal { padding-bottom: var(--band); }
.c-legal__grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--gutter);
	align-items: start;
}
.c-legal__grid > .c-toc { grid-column: 1 / span 3; }
.c-legal__body { grid-column: 5 / span 8; min-width: 0; }
.at-hero + .c-legal .c-legal__grid {
	padding-top: clamp(40px, 4vw, 64px);
	background: linear-gradient(var(--rule), var(--rule)) no-repeat center top / calc(100% - 2 * var(--pad)) 1px;
}
/* Hero note sits under the lede when a page has no actions (legal pages). */
.at-hero__text > .at-lede + .at-note { margin-top: 20px; }

.c-legal__section { scroll-margin-top: calc(var(--header) + 24px); }
.c-legal__section + .c-legal__section { margin-top: 3.25em; padding-top: 2.75em; border-top: 1px solid var(--rule); }
.at-prose .c-legal__section > h2 { margin-top: 0; }
.at-prose .c-legal__section > * + * { margin-top: 1.1em; }
.at-prose .c-legal__section h3 + * { margin-top: .6em; }
.c-legal__section h2 + * { margin-top: .9em !important; }
.c-legal__section ul { padding-left: 1.25em; }
.c-legal__section li + li { margin-top: .5em; }

.c-legal__callout {
	padding: 16px 20px;
	background: var(--mist);
	border-left: 2px solid var(--ink);
	font-size: .9375rem;
	line-height: 1.6;
}
.c-legal__callout p + p { margin-top: .35em; }
.c-legal__callout ul { margin: .6em 0; }

.c-legal__table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.c-legal__table table { min-width: 34rem; }
.at-prose .c-legal__table td strong { font-weight: 500; }
.at-prose .c-legal__table td:first-child { color: var(--ink); }
.at-prose .c-legal__table td + td { color: var(--slate); }

.c-legal__rights { border-top: 1px solid var(--ink); }
.c-legal__rights > div {
	display: grid;
	grid-template-columns: minmax(9rem, 34%) 1fr;
	gap: 6px 24px;
	padding: 14px 0;
	border-bottom: 1px solid var(--rule);
	font-size: .9375rem;
	line-height: 1.55;
}
.c-legal__rights dt { font-weight: 500; }
.c-legal__rights dd { color: var(--slate); }

.c-legal__contacts {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: var(--gutter);
	border-top: 1px solid var(--ink);
}
.c-legal__contact {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 0 16px;
	border-bottom: 1px solid var(--rule);
	font-size: .9375rem;
	line-height: 1.55;
}
.c-legal__contact strong { font-weight: 500; }
.c-legal__contact span { color: var(--slate); }
.c-legal__closing { color: var(--slate); font-size: .9375rem; }

/* 3 Compare pages --------------------------------------------------------- */
.c-vs-fit > .at-shell { padding-top: 0 !important; }
.c-vs-fit__grid {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--gutter);
	row-gap: 40px;
}
.c-vs-fit__col { grid-column: span 5; padding-top: 24px; border-top: 1px solid var(--ink); }
.c-vs-fit__col--us { grid-column: 7 / span 5; position: relative; }
.c-vs-fit__col--us::before {
	content: "";
	position: absolute; left: 0; right: 0; top: -1px;
	height: 2px;
	background: var(--cobalt);
}
.c-vs-fit__col p { margin-top: 12px; color: var(--slate); max-width: 46ch; text-wrap: pretty; }

/* 7 Developer guide ------------------------------------------------------- */
.c-dev__facts {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	column-gap: var(--gutter);
	margin-bottom: clamp(48px, 5vw, 80px);
	border-top: 1px solid var(--ink);
}
.c-dev__facts > div { padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.c-dev__facts dt { font-size: .8125rem; color: var(--slate); }
.c-dev__facts dd { margin-top: 4px; font-size: .9375rem; font-weight: 500; }
.c-dev__facts code { font-family: var(--font-mono); font-size: .875rem; font-weight: 400; overflow-wrap: anywhere; }
.at-hero + .c-dev .c-legal__grid { padding-top: 0; background: none; }

.c-dev__body { max-width: 72ch; }
.at-prose .c-legal__table code,
.at-prose .c-endpoint code { background: none; padding: 0; }
.at-prose .c-legal__table td code { color: var(--ink); white-space: nowrap; }

.c-endpoint { padding: 20px 0 22px; border-top: 1px solid var(--rule); }
.at-prose .c-endpoint { margin-top: 1.4em; }
.at-prose .c-endpoint + .c-endpoint { margin-top: 0; }

.c-endpoint__line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.c-endpoint__line code { font-family: var(--font-mono); font-size: .9375rem; color: var(--ink); overflow-wrap: anywhere; }
.c-endpoint__method {
	display: inline-block;
	min-width: 3.25rem;
	padding: 2px 0;
	border: 1px solid var(--rule-strong);
	border-radius: var(--r-field);
	font-family: var(--font-mono);
	font-size: .75rem;
	font-weight: 500;
	text-align: center;
	color: var(--ink);
}
.c-endpoint__method--post { border-color: var(--cobalt); color: var(--cobalt); }
.at-prose .c-endpoint__name { margin-top: 8px; font-weight: 500; }
.at-prose .c-endpoint__desc { margin-top: 2px; color: var(--slate); font-size: .9375rem; line-height: 1.6; }
.at-prose .c-endpoint .c-code { margin-top: 16px; }

.c-code { border: 1px solid var(--rule); border-radius: var(--r-btn); background: var(--mist); overflow: hidden; }
.c-code__bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding: 8px 8px 8px 16px;
	border-bottom: 1px solid var(--rule);
	background: var(--paper);
	font-size: .8125rem;
	color: var(--slate);
}
.c-code__copy {
	min-height: 32px;
	padding: 0 12px;
	border: 1px solid var(--rule-strong);
	border-radius: var(--r-btn);
	background: var(--paper);
	font-size: .8125rem;
	font-weight: 500;
	color: var(--ink);
	cursor: pointer;
	transition: border-color .15s;
}
.c-code__copy:hover { border-color: var(--ink); }
.at-prose .c-code__pre {
	margin: 0;
	padding: 16px 18px;
	background: none;
	border-radius: 0;
	font-family: var(--font-mono);
	font-size: .8125rem;
	line-height: 1.6;
	color: var(--ink);
	overflow-x: auto;
	tab-size: 4;
}

.c-tabs__list { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 12px; background: var(--mist); border: 1px solid var(--rule); border-radius: 8px; }
.c-tabs__tab {
	padding: 7px 14px;
	border: 0;
	border-radius: var(--r-btn);
	background: none;
	font-size: .875rem;
	font-weight: 500;
	color: var(--slate);
	cursor: pointer;
	transition: color .15s, background-color .15s;
}
.c-tabs__tab:hover { color: var(--ink); }
.c-tabs__tab[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--rule), 0 1px 2px rgba(11, 27, 51, .06); }
.at-prose .c-tabs__panel { margin-top: 0; }

/* 8 Responsive ------------------------------------------------------------ */
@media (max-width: 1079px) {
	.c-legal__grid > .c-toc,
	.c-legal__body { grid-column: 1 / -1; }
	.c-legal__grid > .c-toc { margin-bottom: 40px; }
	.c-vs-fit__col, .c-vs-fit__col--us { grid-column: 1 / -1; }
	.c-dev__facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
	.c-legal__rights > div { grid-template-columns: 1fr; }
	.c-legal__contacts { grid-template-columns: 1fr; }
	.c-dev__facts { grid-template-columns: 1fr; }
	.at-prose .c-dev__body .c-legal__table td code { white-space: normal; overflow-wrap: anywhere; }
	.c-dev__body .c-legal__table table { min-width: 0; }
	.c-tabs__list { display: flex; }
	.c-tabs__tab { flex: 1; padding-inline: 6px; }
}

