/* YT Cartell Studio — guide pages, the changelog and the «Що нового» cards. Uses the tokens of site.css. */

/* ---------- small pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); color: var(--text-2);
  font-size: .875rem; font-weight: 500; line-height: 1; white-space: nowrap;
}
.pill .i { width: 15px; height: 15px; }
.pill-new { background: var(--action-soft); color: var(--action-text); }

/* hero badge on the landing page: a quiet link to the new release */
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  margin-bottom: 22px; padding: 6px 14px 6px 6px; border-radius: 999px;
  background: var(--card); box-shadow: var(--sh-control);
  outline: 1px solid color-mix(in srgb, var(--border) 70%, transparent); outline-offset: -1px;
  color: var(--text); text-decoration: none; font-size: .9375rem; font-weight: 500; line-height: 1.3;
  transition: box-shadow .12s var(--ease-std), transform .2s var(--ease-out);
}
.hero-badge:hover { box-shadow: var(--sh-hover); }
.hero-badge:active { transform: scale(.98); }
.hero-badge .pill { height: 26px; flex: none; }
.hero-badge .i { width: 16px; height: 16px; color: var(--action-text); flex: none; transition: transform .12s var(--ease-std); }
.hero-badge:hover .i { transform: translateX(2px); }
.hero-badge span.t { min-width: 0; }

/* ---------- «Нове в 2.0.1» on the landing page */
.new-head .lead + .lead { margin-top: 12px; }
@media (min-width: 1024px) { .section-head.split.new-head { align-items: start; } .new-head .h2 { margin-top: 4px; } }
.new-links { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.new-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .new-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) {
  .new-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; }
  .new-grid > * { grid-column: span 4; }
  .new-grid > .new-card-lg { grid-column: span 6; }
}
/* two columns and an odd number of cards: the last one lies across both, picture beside the text */
@media (min-width: 700px) and (max-width: 1099px) {
  .new-grid > .new-card:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
  .new-grid > .new-card:last-child:nth-child(odd) .new-media { flex: 0 0 50%; border-bottom: 0; border-right: 1px solid var(--border); }
}
@media (min-width: 700px) {
  .gi-grid > .new-card:last-child:nth-child(odd) { grid-column: 1 / -1; flex-direction: row; }
  .gi-grid > .new-card:last-child:nth-child(odd) .new-media { flex: 0 0 50%; border-bottom: 0; border-right: 1px solid var(--border); }
}
.new-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--card); border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--sh-card); outline: 1px solid color-mix(in srgb, var(--border) 75%, transparent); outline-offset: -1px;
  color: var(--text); text-decoration: none;
  transition: box-shadow .14s var(--ease-std), transform .2s var(--ease-out);
}
.new-card:hover { box-shadow: var(--sh-hover); transform: translateY(-2px); }
.new-card:active { transform: translateY(0) scale(.99); }
.new-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.new-media { position: relative; aspect-ratio: 16 / 10; background: var(--surface); overflow: hidden; border-bottom: 1px solid var(--border); }
.new-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .6s var(--ease-out); }
.new-media.contain img { object-fit: contain; object-position: center; padding: 14px; }
.new-card:hover .new-media img { transform: scale(1.025); }
.new-body { display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 22px; flex: 1; }
.new-body h3 { font-size: 1.1875rem; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
.new-card-lg .new-body h3 { font-size: 1.375rem; }
.new-body p { color: var(--text-2); font-size: .9688rem; line-height: 1.5; }
.new-body .link { margin-top: auto; padding-top: 6px; }
.new-card:hover .link .i { transform: translateX(2px); }
.new-emoji { font-size: 1.05em; margin-right: 2px; }

.also { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.also > b { font-weight: 600; margin-right: 6px; }
.also .pill { background: var(--card); outline: 1px solid var(--border); outline-offset: -1px; color: var(--text); height: 34px; padding: 0 14px; }

/* «Що нового»: the earlier versions under the newest one, and the changelog page */
.also + .rel-prev, .new-grid + .rel-prev { margin-top: clamp(36px, 1.75rem + 1.5vw, 56px); }
.rel-prev-title { margin: 0; font-size: .8125rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 14px; }
.rel-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .rel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rel-item { background: var(--card); border-radius: var(--r-inner); box-shadow: var(--sh-control); outline: 1px solid color-mix(in srgb, var(--border) 75%, transparent); outline-offset: -1px; padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.rel-item h3, .rel-item h4 { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 1.125rem; line-height: 1.3; font-weight: 600; }
.rel-item time { color: var(--text-3); font-size: .875rem; font-weight: 400; }
.rel-item p { color: var(--text-2); font-size: .9688rem; line-height: 1.5; }
.rel-item .link { margin-top: auto; padding-top: 4px; }
.rel-foot { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.mac-note { margin-top: 14px; color: var(--text-2); font-size: .9375rem; line-height: 1.5; max-width: 58ch; }
.mac-note[hidden] { display: none; }

/* ---------- guide pages */
.g-hero { padding-top: clamp(28px, 1.25rem + 2vw, 56px); padding-bottom: clamp(20px, 1rem + 1vw, 36px); }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .9375rem; color: var(--text-2); }
.crumbs a { color: var(--action-text); text-decoration: none; font-weight: 500; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs .i { width: 14px; height: 14px; color: var(--text-3); }
.g-hero h1 { margin-top: 16px; font-size: clamp(2.125rem, 1.35rem + 2.6vw, 3.5rem); line-height: 1.06; font-weight: 600; letter-spacing: -.022em; text-wrap: balance; max-width: 22ch; }
.g-hero .lead { margin-top: 18px; max-width: 64ch; }
.g-meta { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; }

.g-layout { display: grid; gap: 28px; padding-bottom: clamp(48px, 2rem + 3vw, 96px); }
@media (min-width: 1100px) { .g-layout { grid-template-columns: 240px minmax(0, 1fr); gap: 64px; align-items: start; } }

.g-toc { display: none; }
@media (min-width: 1100px) {
  .g-toc { display: block; position: sticky; top: calc(var(--header-h) + 28px); max-height: calc(100vh - var(--header-h) - 56px); overflow: auto; scrollbar-width: thin; }
}
.g-toc h2 { font-size: .8125rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.g-toc ol, .g-toc-m ol { list-style: none; margin: 0; }
.g-toc ol { display: grid; gap: 2px; padding: 0; }
.g-toc a { display: block; padding: 7px 12px; border-radius: 10px; color: var(--text-2); text-decoration: none; font-size: .9375rem; line-height: 1.35; transition: background-color .12s, color .12s; }
.g-toc a:hover { background: var(--surface); color: var(--text); }
.g-toc a.is-current { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: inset 3px 0 0 var(--action); }
.g-toc .g-toc-more { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }

.g-toc-m { border-radius: var(--r-inner); background: var(--surface); margin-bottom: 32px; }
.g-toc-m summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; font-weight: 600; border-radius: var(--r-inner); }
.g-toc-m summary::-webkit-details-marker { display: none; }
.g-toc-m summary .i { color: var(--text-2); transition: transform .2s var(--ease-std); }
.g-toc-m[open] summary .i { transform: rotate(180deg); }
.g-toc-m ol { padding: 0 10px 12px; display: grid; gap: 2px; }
.g-toc-m a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--text-2); text-decoration: none; }
.g-toc-m a:hover { background: var(--surface-hover); color: var(--text); }
@media (min-width: 1100px) { .g-toc-m { display: none; } }

.g-article { min-width: 0; max-width: 780px; font-size: 1.0625rem; line-height: 1.62; }
.g-article > section + section { margin-top: clamp(44px, 2rem + 2vw, 64px); }
.g-article h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.15; font-weight: 600; letter-spacing: -.016em; text-wrap: balance; scroll-margin-top: calc(var(--header-h) + 24px); }
.g-article h3 { margin-top: 30px; font-size: 1.1875rem; line-height: 1.3; font-weight: 600; scroll-margin-top: calc(var(--header-h) + 24px); }
.g-article p { margin-top: 14px; color: var(--text); max-width: 70ch; text-wrap: pretty; }
.g-article h2 + p, .g-article h3 + p { margin-top: 12px; }
.g-article p.muted { color: var(--text-2); }
.g-article a:not(.btn) { color: var(--action-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.g-article .g-next a, .g-article a.new-card { color: var(--text); text-decoration: none; }
.g-article a.new-card .link { color: var(--action-text); }
.g-article b, .g-article strong { font-weight: 600; }
.g-article code { white-space: normal; overflow-wrap: anywhere; }
.g-list { margin-top: 12px; padding-left: 1.25em; display: grid; gap: 8px; list-style: disc; }
.g-list li { padding-left: 4px; }
.g-list li::marker { color: var(--action-text); }
.g-list ul { margin-top: 6px; padding-left: 1.1em; display: grid; gap: 4px; list-style: disc; }

.g-steps { margin-top: 18px; display: grid; gap: 14px; counter-reset: g; list-style: none; padding: 0; }
.g-steps > li { counter-increment: g; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; align-items: start; }
.g-steps > li::before {
  content: counter(g); width: 32px; height: 32px; border-radius: 99px; display: grid; place-items: center;
  background: var(--action-soft); color: var(--action-text); font-weight: 600; font-size: .875rem; margin-top: -2px;
}
.g-steps > li > div > b:first-child { font-weight: 600; }

.g-fig { margin-top: 24px; }
.g-fig picture, .g-fig img { display: block; }
.g-shot img { width: 100%; max-width: var(--w, 100%); border-radius: 14px; box-shadow: var(--sh-card); outline: 1px solid color-mix(in srgb, var(--border) 75%, transparent); outline-offset: -1px; background: var(--card); }
.g-shot.natural img { width: auto; max-width: min(100%, var(--w, 100%)); }
.g-fig figcaption { margin-top: 12px; font-size: .875rem; line-height: 1.45; color: var(--text-3); max-width: 70ch; }
.g-duo { margin-top: 24px; display: grid; gap: 22px; align-items: start; }
.g-duo .g-fig { margin-top: 0; }
@media (min-width: 720px) { .g-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.callout { margin-top: 20px; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; padding: 16px 18px; border-radius: var(--r-inner); background: var(--surface); font-size: .9844rem; line-height: 1.55; }
.callout .i { width: 20px; height: 20px; margin-top: 2px; color: var(--text-2); }
.callout p { margin: 0; color: var(--text); }
.callout p + p { margin-top: 8px; }
.callout.tip { background: var(--action-soft); }
.callout.tip .i { color: var(--action-text); }
.callout.warn { background: var(--surface); box-shadow: inset 3px 0 0 var(--action); }

.g-table-wrap { margin-top: 18px; overflow-x: auto; border-radius: var(--r-inner); outline: 1px solid var(--border); outline-offset: -1px; background: var(--card); }
.g-table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.45; }
.g-table th, .g-table td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.g-table tr:last-child td { border-bottom: 0; }
.g-table th { font-weight: 600; background: var(--surface); white-space: nowrap; }
.g-table td:first-child { font-weight: 500; }
.g-table code { white-space: nowrap; }
@media (max-width: 640px) { .g-table { font-size: .875rem; } .g-table th, .g-table td { padding: 9px 10px; } .g-table code { white-space: normal; } }

pre.g-code {
  margin-top: 16px; padding: 16px 18px; border-radius: var(--r-inner); background: var(--surface);
  overflow: auto; font: 500 .8125rem/1.6 ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  color: var(--text); tab-size: 2; scrollbar-width: thin;
}
pre.g-code code { background: none; padding: 0; font: inherit; white-space: pre; }

.g-faq { margin-top: 10px; }
.g-faq .qa summary { font-size: 1.0625rem; }

.g-next { margin-top: clamp(48px, 2rem + 2vw, 72px); padding-top: 28px; border-top: 1px solid var(--border); display: grid; gap: 14px; }
@media (min-width: 640px) { .g-next { grid-template-columns: 1fr 1fr; } }
.g-next a {
  display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--r-inner); background: var(--card);
  box-shadow: var(--sh-control); outline: 1px solid color-mix(in srgb, var(--border) 75%, transparent); outline-offset: -1px;
  color: var(--text); text-decoration: none; transition: box-shadow .12s var(--ease-std), transform .2s var(--ease-out);
}
.g-next a:hover { box-shadow: var(--sh-hover); }
.g-next a:active { transform: scale(.99); }
.g-next small { color: var(--text-3); font-size: .8125rem; font-weight: 500; }
.g-next b { font-weight: 600; }
.g-next .next { text-align: right; }
@media (max-width: 639px) { .g-next .next { text-align: left; } }

/* guide index: the list of guides */
.gi-grid { margin-top: 22px; display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .gi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gi-grid .new-body h3 { font-size: 1.125rem; }

/* footer with four columns (the landing page and the guides) */
@media (min-width: 900px) { .footer-grid.cols-4 { grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); } }

@media (prefers-reduced-motion: reduce) {
  .new-card:hover, .new-card:hover .new-media img { transform: none; }
}
