/* Studio Innate — Font Browser
   Everything is scoped to .sif so it can't leak into Elementor or si-core styles. */

.sif {
  --sif-bg: #FFFFFF;
  --sif-surface: #FFFFFF;
  --sif-fg: #0D0E11;
  --sif-fg-soft: #4A4E57;
  --sif-muted: #6B6F78;
  --sif-line: #E6E7EB;
  --sif-chip: #F1F2F4;
  --sif-accent: #0F2BED; /* brand blue, same in both themes */
  --sif-ui: "Helvetica Now", "Helvetica Neue", Helvetica, Arial, sans-serif; /* the site's own font, loaded by the theme */
  --sif-spec: clamp(44px, 8vw, 100px);
  --sif-gutter: 0px; /* content lines up with the page's own edges */
  --sif-bar-h: 60px;

  background: var(--sif-bg);
  color: var(--sif-fg);
  font-family: var(--sif-ui);
  font-size: 14px;
  line-height: 1.5;
  padding-inline: var(--sif-gutter);
  padding-block: 0 32px;
  transition: background-color .25s, color .25s;
}
.sif[data-theme="dark"] {
  --sif-bg: #161618;
  --sif-surface: #1E1E21;
  --sif-fg: #ECEDEF;
  --sif-fg-soft: #9EA2AA;
  --sif-muted: #8B8F98;
  --sif-line: #2A2A2E;
  --sif-chip: #232327;
  --sif-accent: #0F2BED;
  color-scheme: dark;
}
.sif *, .sif *::before, .sif *::after { box-sizing: border-box; }
.sif button, .sif input { font: inherit; font-family: var(--sif-ui); color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: normal; }
.sif ul { list-style: none; margin: 0; padding: 0; }
.sif p { margin: 0; }
.sif a { color: inherit; text-decoration: none; }
.sif :focus-visible { outline: 2px solid var(--sif-fg-soft); outline-offset: 3px; }

.sif-preview-note { padding: 10px 16px; background: #FFF4D6; color: #5C4400; font-size: 13px; }
.sif-head { padding-block: 28px 8px; }
.sif-title { margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; color: var(--sif-fg); }

/* Sticky toolbar */
.sif-bar { position: sticky; top: var(--sif-sticky-top, 0px); z-index: 20; margin-inline: calc(var(--sif-gutter) * -1); padding-inline: var(--sif-gutter); background: var(--sif-bg); border-bottom: 1px solid var(--sif-line); transition: background-color .25s; }
.sif-bar__inner { display: flex; align-items: center; gap: 12px; padding-block: 12px; }
.sif-chips { display: flex; align-items: center; gap: 10px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; padding-right: 24px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.sif-chips::-webkit-scrollbar { display: none; }
/* Filter chips match the store's own Elementor filters (Scene Editor page). */
.sif { --sif-tag-bg: #F1F2F4; --sif-tag-fg: #6B6F78; --sif-tag-on-fg: #0D0E11; }
.sif[data-theme="dark"] { --sif-tag-bg: #202127; --sif-tag-fg: #888888; --sif-tag-on-fg: #FFFFFF; }
.sif .sif-chip { flex: none; padding: 2px 8px 2px 10px; border: 1px solid var(--sif-tag-bg); border-radius: 4px; background: var(--sif-tag-bg); font-size: 12px; font-weight: 400; line-height: normal; color: var(--sif-tag-fg); transition: background-color .15s, color .15s, border-color .15s; }
.sif .sif-chip[aria-pressed="true"] { background: rgba(22, 42, 228, .44); border-color: #162AE4; color: var(--sif-tag-on-fg); }
.sif-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.sif-seg { display: flex; background: var(--sif-chip); border-radius: 999px; padding: 3px; }
.sif .sif-seg button { width: 36px; height: 30px; border-radius: 999px; display: grid; place-items: center; color: var(--sif-muted); font-weight: 600; font-size: 13px; }
.sif .sif-seg button[aria-pressed="true"] { background: var(--sif-surface); color: var(--sif-fg); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.sif .sif-icon-btn { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; color: var(--sif-fg); }
.sif .sif-icon-btn:hover { background: var(--sif-chip); }
.sif svg { width: 16px; height: 16px; display: block; }

.sif-subbar { display: flex; justify-content: space-between; gap: 12px; padding-block: 14px 0; font-family: var(--sif-ui); font-size: 12px; color: var(--sif-muted); }

/* The site theme colours every button blue on hover, focus and tap. These
   restate each control's own look for those states so the theme can't win. */
html body .sif button:is(:hover, :focus, :active) { border: 0; box-shadow: none; text-decoration: none; }
html body .sif .sif-chip:is(:hover, :focus, :active) { background: var(--sif-tag-bg); border: 1px solid var(--sif-tag-bg); color: var(--sif-fg); }
html body .sif .sif-chip[aria-pressed="true"]:is(:hover, :focus, :active) { background: rgba(22, 42, 228, .44); border: 1px solid #162AE4; color: var(--sif-tag-on-fg); }
html body .sif .sif-seg button:is(:hover, :focus, :active) { background: transparent; color: var(--sif-fg); }
html body .sif .sif-seg button[aria-pressed="true"]:is(:hover, :focus, :active) { background: var(--sif-surface); color: var(--sif-fg); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
html body .sif .sif-icon-btn:is(:hover, :focus, :active),
html body .sif .sif-reset:is(:hover, :focus, :active) { background: var(--sif-chip); color: var(--sif-fg); }
html body .sif button:focus:not(:focus-visible) { outline: none; }

/* When the store's own grid is the cover view, the font filters don't apply to it */
.sif.is-original-grid .sif-chips,
.sif.is-original-grid .sif-subbar { visibility: hidden; }
.sif.is-original-grid .sif-subbar { display: none; }

/* Specimen list */
.sif-row { content-visibility: auto; contain-intrinsic-size: auto 190px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "meta actions" "spec spec"; align-items: start; gap: 14px 16px; padding-block: 24px 30px; border-bottom: 1px solid var(--sif-line); }
.sif-row[hidden], .sif-tile[hidden] { display: none !important; }
.sif-meta { grid-area: meta; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 14px; min-width: 0; }
.sif .sif-meta__name { font-weight: 500; font-size: 15px; line-height: 22px; letter-spacing: -0.01em; color: var(--sif-fg); }
.sif .sif-meta__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.sif-meta__sub { font-family: var(--sif-ui); font-size: 12px; color: var(--sif-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.sif-actions { grid-area: actions; align-self: start; display: flex; align-items: center; gap: 10px; justify-content: flex-end; height: 22px; }
.sif-price { font-family: var(--sif-ui); font-size: 13px; line-height: 22px; font-variant-numeric: tabular-nums; color: var(--sif-fg); white-space: nowrap; }
.sif-price del { opacity: .5; margin-right: 4px; }
.sif-price ins { text-decoration: none; }

/* si-core's Add to Downloads button, restyled for this list */
html body .sif .si-quick-add-container { margin: 0; display: inline-flex; }
html body .sif a.si-custom-add-btn,
html body .sif a.si-custom-add-btn:visited { font-family: var(--sif-ui) !important; color: var(--sif-fg) !important; font-size: 13px !important; font-weight: 500 !important; text-transform: none; letter-spacing: 0; line-height: 1.3 !important; padding: 7px 8px !important; margin-block: -7px; border-radius: 3px; gap: 4px; transition: background-color .15s, color .15s; }
html body .sif a.si-custom-add-btn:hover { background: var(--sif-chip) !important; }
html body .sif a.si-custom-add-btn:hover .si-add-text { text-decoration: none; }
html body .sif a.si-custom-add-btn .si-btn-icon { font-size: 15px; }
html body .sif a.si-custom-add-btn.added { color: var(--sif-muted) !important; } /* matches the store's own grey "In Cart" */
html body .sif a.si-custom-add-btn.added:hover { background: transparent !important; }
html body .sif a.si-custom-add-btn.added .si-added-text { font-size: 13px; font-weight: 500; }
html body .sif a.si-custom-add-btn.loading { opacity: .6; }
html body .sif a.added_to_cart { display: none !important; }

/* Specimen */
.sif-spec { grid-area: spec; position: relative; min-width: 0; min-height: 1.15em; display: flex; align-items: center; cursor: text; font-size: calc(var(--sif-spec) * var(--k, 1)); line-height: 1; color: var(--sif-fg); transition: color .25s; border-radius: 6px; }
.sif-row.is-edited .sif-spec { padding-right: 40px; }
.sif-glyphs { display: block; flex: 0 1 auto; min-width: 0; height: auto; width: calc(1.15em * var(--ar, 4)); max-width: calc(100% - .2em); aspect-ratio: var(--ar, 4); background: currentColor;
  -webkit-mask: var(--src) left center / contain no-repeat; mask: var(--src) left center / contain no-repeat; transition: opacity .15s; }
.sif-glyphs.is-loading { background: var(--sif-chip); -webkit-mask: none; mask: none; border-radius: 4px; width: calc(1.15em * 3); animation: sif-pulse 1.4s ease-in-out infinite; }
.sif-glyphs.is-pending { opacity: .55; }
.sif-glyphs.is-error { background: none; -webkit-mask: none; mask: none; width: auto; aspect-ratio: auto; font-size: .3em; color: var(--sif-muted); }
@keyframes sif-pulse { 50% { opacity: .5; } }

.sif-caret { flex: none; display: block; width: max(3px, .055em); height: .92em; margin-left: .08em; background: var(--sif-accent); opacity: 0; transition: opacity .12s; }
.sif-row.is-hover .sif-caret,
.sif-row.is-centred .sif-caret,
.sif-row.is-editing .sif-caret { opacity: 1; animation: sif-blink 1.05s steps(1, end) infinite; }
.sif.has-editing .sif-row.is-hover:not(.is-editing) .sif-caret { opacity: .3; }
.sif.has-editing .sif-row.is-centred:not(.is-editing) .sif-caret { opacity: 0; }
.sif-row.is-editing:not(.is-edited) .sif-glyphs { opacity: .32; }
@keyframes sif-blink { 50% { visibility: hidden; } }

.sif-spec--missing { cursor: default; font-size: 14px; min-height: 0; }
.sif-missing { font-family: var(--sif-ui); font-size: 12px; color: var(--sif-muted); padding: 10px 12px; border: 1px dashed var(--sif-line); border-radius: 4px; }

.sif [hidden] { display: none !important; }
.sif .sif-reset { grid-area: spec; align-self: center; justify-self: end; position: relative; z-index: 2; width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; color: var(--sif-muted); }
.sif .sif-reset:hover { background: var(--sif-chip); color: var(--sif-fg); }
.sif .sif-reset svg { width: 15px; height: 15px; }

.sif .sif-ghost { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; border: 0; padding: 0; margin: 0; caret-color: transparent; background: transparent; color: transparent; cursor: text; box-shadow: none; outline: none; }

/* Touch: the row in the middle of the screen is brightest */
.sif.is-touch .sif-row .sif-spec { color: var(--sif-fg-soft); }
.sif.is-touch .sif-row.is-centred .sif-spec,
.sif.is-touch .sif-row.is-editing .sif-spec { color: var(--sif-fg); }
html.sif-snap { scroll-snap-type: y proximity; scroll-padding-top: calc(var(--sif-sticky-top, 0px) + var(--sif-bar-h)); }
html.sif-snap .sif-row { scroll-snap-align: center; }

/* Cover grid */
.sif-grid { padding-block: 24px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 16px; }
.sif-grid[hidden], .sif-list[hidden], .sif-empty[hidden] { display: none !important; }
.sif-tile { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sif .sif-cover { display: block; aspect-ratio: 4 / 5; max-width: 100%; background: var(--sif-surface); border: 1px solid var(--sif-line); border-radius: 6px; overflow: hidden; }
.sif .sif-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sif-cover__fallback { display: grid; place-items: center; height: 100%; color: var(--sif-muted); }
.sif-tile__meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sif-tile__row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
html body .sif .sif-tile a.si-custom-add-btn { font-size: 12px !important; padding: 5px 6px !important; margin: -5px -6px -5px 0; }

.sif-empty { padding-block: 48px; color: var(--sif-muted); }

@media (max-width: 760px) {
  .sif-row { gap: 12px 10px; padding-block: 20px 26px; }
  .sif-meta { flex-direction: column; gap: 1px; }
  .sif-actions { gap: 4px; }
  .sif-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sif, .sif-spec, .sif-bar { transition: none; }
  .sif-glyphs.is-loading { animation: none; }
}

/* ── Whole-page light mode ─────────────────────────────────────────────
   Light mode applies to the page content around the specimen list only.
   The sidebar, banner and the store's own product grid are never changed,
   and the cover-image view always shows the page in its original dark design.
   Page text and dark panels are tagged by font-browser.js and swapped here
   only while html has the sif-light class. */
html.sif-light, html.sif-light body { background-color: #FFFFFF !important; }
html.sif-light .sif-l-ink { color: #0D0E11 !important; }
html.sif-light .sif-l-paper { background-color: #FFFFFF !important; }
html.sif-light .sif-l-paper2 { background-color: #F1F2F4 !important; }

/* The theme toggle only belongs to the specimen list */
.sif.is-grid-view .sif-theme-toggle { display: none; }
