/* stitch.gonglogic.com — the free cross-stitch patterns (StitchPageController).

   On the family's tokens (static/family/tokens.css) and components (.gl-btn): paper, ink and lines are
   theirs, and the site's own colour is its --accent, moss, set on body[data-site="stitch"] there. Every
   class is st- so nothing leaks; selectors that must beat the theme's bare-element rules (main.css: a,
   h1-h4, ul, table) carry two classes or the .st parent. */

.st { padding: var(--s-6, 1.5rem) 0 var(--s-12, 3rem); color: var(--ink); }
.st a { color: var(--accent-ink); }
.st a:hover { color: var(--ink); }
.st .gl-btn { text-decoration: none; }
.st .st-h2 { margin: var(--s-8, 2rem) 0 var(--s-2, .5rem); font-family: var(--font-text); font-size: var(--fs-4, 1.375rem); line-height: 1.25; color: var(--ink); }
.st .st-h2 a { color: var(--ink); text-decoration: none; }
.st .st-h2 a:hover { text-decoration: underline; }
.st-small { font-size: var(--fs-1, .875rem); color: var(--ink-2); }
.st-count { font: 400 var(--fs-1, .875rem) var(--font-ui); color: var(--muted); }

/* "Free": the one label on every card and on the pattern page. */
.st-free { display: inline-flex; align-items: center; min-height: 22px; padding: 0 .5rem; border-radius: var(--radius-pill, 999px); background: var(--accent-wash); color: var(--accent-ink); font: 600 .75rem/1.2 var(--font-ui); white-space: nowrap; }
.st-free.st-free--big { min-height: 30px; padding: 0 .75rem; font-size: var(--fs-2, 1rem); }

/* ── The filters: plain links in two short rows, the chosen one filled. */
.st-filters { display: grid; gap: var(--s-2, .5rem); margin: 0 0 var(--s-6, 1.5rem); }
.st .st-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0; font: var(--fs-1, .875rem)/1.3 var(--font-ui); }
.st-filter__label { min-width: 5.5rem; color: var(--muted); }
.st .st-filter__opt { display: inline-flex; align-items: center; min-height: 36px; padding: 0 .8rem; border: 1px solid var(--line); border-radius: var(--radius-pill, 999px); color: var(--ink); text-decoration: none; }
.st .st-filter__opt:hover { border-color: var(--accent); color: var(--ink); }
.st .st-filter__opt[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.st-none { padding: var(--s-6, 1.5rem) 0; }

/* ── The cards: the stitched preview, square, then the name and one line. */
.st .st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: var(--s-5, 1.25rem); margin: 0; padding: 0; list-style: none; }
.st .st-cards > li { margin: 0; }
.st .st-card { display: flex; flex-direction: column; gap: .35rem; height: 100%; color: var(--ink); text-decoration: none; }
.st-card__art { display: block; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-s, 8px); background: #fff; }
.st-card__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.st-card__name { font-weight: 600; line-height: 1.3; }
.st-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; }
.st-card__line { font-size: var(--fs-1, .875rem); color: var(--ink-2); }
.st .st-card:hover { color: var(--ink); }
.st .st-card:hover .st-card__name { text-decoration: underline; }
.st .st-card:hover .st-card__art { border-color: var(--accent); }
@media (max-width: 30rem) {
  .st .st-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
}

.st-learn { margin-top: var(--s-10, 2.5rem); padding: var(--s-5, 1.25rem); border: 1px solid var(--line); border-radius: var(--radius-m, 12px); background: var(--surface); }
.st-learn .st-h2 { margin-top: 0; }
.st-learn p { margin: 0; }
.st-group + .st-group { margin-top: var(--s-6, 1.5rem); }

/* ── A pattern: the preview beside the download and facts on a wide screen; stacked on a phone. */
.st-crumbs { margin: 0 0 var(--s-4, 1rem); font: var(--fs-1, .875rem)/1.4 var(--font-ui); color: var(--muted); }
.st-crumbs a { display: inline-flex; align-items: center; min-height: 32px; }
.st-pattern__top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6, 1.5rem); }
@media (min-width: 48rem) {
  .st-pattern__top { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
}
.st-pattern__cover { margin: 0; }
.st-pattern__cover img, .st-page img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-s, 8px); background: #fff; }
.st-pattern__cover figcaption, .st-page figcaption { margin-top: .4rem; font-size: var(--fs-1, .875rem); color: var(--ink-2); }
.st .st-pattern__name { margin: 0; font-family: var(--font-text); font-size: clamp(1.75rem, 3vw, 2.4rem); line-height: 1.15; color: var(--ink); }
.st-pattern__sub { margin: .35rem 0 0; color: var(--ink-2); }
.st-pattern__price { margin: .75rem 0 .5rem; }
/* The download: the long label on a wide screen; on a phone "Download free PDF" with the page count
   beside it (the long one ran past the button's edges at 390px). It may wrap either way, never overflow. */
.st .st-download-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.st .st-download { min-height: 52px; max-width: 100%; padding-top: .4rem; padding-bottom: .4rem; font-size: var(--fs-3, 1.125rem); white-space: normal; text-align: center; }
.st-download__short, .st-download__pages { display: none; }
@media (max-width: 30rem) {
  .st .st-download { flex: 1 1 auto; justify-content: center; }
  .st-download__long { display: none; }
  .st-download__short { display: inline; }
  .st-download__pages { display: inline; white-space: nowrap; }
}
.st-pattern__lede { margin-top: var(--s-4, 1rem); }
.st .st-facts { display: grid; gap: .4rem; margin: var(--s-4, 1rem) 0 0; }
.st-facts > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .75rem; align-items: baseline; }
.st-facts dt { font-size: var(--fs-1, .875rem); color: var(--muted); }
.st-facts dd { margin: 0; }
.st .st-sizes { margin: 0; padding: 0; list-style: none; font-variant-numeric: tabular-nums; }
.st .st-sizes li { margin: 0; }
.st-sizes__ct { display: inline-block; min-width: 5.5rem; color: var(--ink-2); }
.st-sizes__in { color: var(--muted); }
.st .st-sizes li + li { margin-top: .15rem; }
@media (max-width: 30rem) {
  .st-facts > div { grid-template-columns: 6.5rem minmax(0, 1fr); }
  /* Four sizes in cm and inches do not fit one line each at 390px: the inches go under, aligned. */
  .st-sizes__in { display: block; padding-left: 5.75rem; font-size: var(--fs-1, .875rem); }
}
.st-pattern__pages { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6, 1.5rem); margin-top: var(--s-8, 2rem); }
@media (min-width: 40rem) { .st-pattern__pages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.st-page { margin: 0; }

.st .st-table { width: 100%; max-width: 36rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.st .st-table th, .st .st-table td { padding: .35rem .5rem; border-bottom: 1px solid var(--line); text-align: left; }
.st .st-table th { font-size: var(--fs-1, .875rem); color: var(--muted); font-weight: 500; }

.st-credit { margin-top: var(--s-8, 2rem); padding-top: var(--s-4, 1rem); border-top: 1px solid var(--line); }
.st-credit p { margin: 0 0 .4rem; }
.st-credit .st-story { max-width: 44rem; margin-top: .75rem; }
.st-signup { margin-top: var(--s-8, 2rem); max-width: 40rem; }
.st-signup .st-h2 { margin-top: 0; }
.st-signup .email-signup { margin-top: .5rem; }
.st-more { margin-top: var(--s-8, 2rem); }

/* ── The guides: one readable column. */
.st-guide { max-width: 44rem; }
.st-guide__lede { font-size: var(--fs-3, 1.125rem); color: var(--ink-2); }
.st-guide ul { padding-left: 1.25rem; }
.st-guide li { margin-bottom: .5rem; }
.st-guide__next { margin-top: var(--s-8, 2rem); }
.st-videos { padding-left: 1.25rem; }
