/*
Theme Name: CQT
Description: Core Quantum Technologies block theme
Version: 0.2.0
Requires at least: 6.6
Text Domain: cqt
*/

/* ---------- self-hosted Inter (no external font requests). Registered as the "sans" family in theme.json ---------- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/Inter-Variable.woff2") format("woff2");
}

/* ---------- small utilities used by patterns (no block setting covers these) ---------- */
.cqt-eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; }
.cqt-tag { display: inline-block; vertical-align: middle; margin-left: .4rem; padding: .15rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; background: var(--wp--preset--color--mist); color: var(--wp--preset--color--slate); border: 1px solid var(--wp--preset--color--line); }

.wp-block-image figcaption { font-size: var(--wp--preset--font-size--x-small); color: var(--wp--preset--color--slate); }

/* ---------- shop-by cards ---------- */
.cqt-cards .cqt-card { background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--line); border-radius: 12px; padding: var(--wp--preset--spacing--40); display: flex; flex-direction: column; gap: var(--wp--preset--spacing--20); }
.cqt-cards .cqt-card .wp-block-buttons { margin-top: auto; }
.cqt-badge { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 1.15rem; margin: 0 0 .25rem; background: var(--cqt-accent, var(--wp--preset--color--navy)); }
.cqt-card--blue   { --cqt-accent: var(--wp--preset--color--blue); }
.cqt-card--green  { --cqt-accent: var(--wp--preset--color--green); }
.cqt-card--orange { --cqt-accent: var(--wp--preset--color--orange); }
.cqt-card--purple { --cqt-accent: var(--wp--preset--color--purple); }
.cqt-card h3 { color: var(--cqt-accent); }

/* ---------- catalog: Product Collection rendered as a table ---------- */
.cqt-catalog { --cqt-cols: 72px 90px minmax(56px, .8fr) minmax(56px, .8fr) 78px 82px 84px 84px 96px 96px 64px; }
.cqt-catalog .wp-block-woocommerce-product-collection { display: grid; grid-template-columns: 250px minmax(0, 1fr); column-gap: var(--wp--preset--spacing--50); row-gap: var(--wp--preset--spacing--30); align-items: start; }
.cqt-catalog .wp-block-woocommerce-product-collection > .wp-block-woocommerce-product-filters { grid-column: 1; grid-row: span 10; position: sticky; top: var(--wp--preset--spacing--30); }
.cqt-catalog .wp-block-woocommerce-product-collection > :not(.wp-block-woocommerce-product-filters) { grid-column: 2; }
.cqt-catalog .wc-block-components-notices { grid-column: 1 / -1; }
/* heading + live result count span both columns; the count is core Query Total, so it follows the active filters */
.cqt-catalog .wp-block-woocommerce-product-collection > .cqt-catalog-title { grid-column: 1 / -1; margin: 0; gap: .75rem; }
.cqt-catalog .cqt-catalog-title h2, .cqt-catalog .cqt-catalog-count { margin: 0; }
.cqt-catalog .cqt-catalog-count { padding-bottom: .15rem; }

/* header row + product rows share one column template */
.cqt-catalog .cqt-table-head,
.cqt-catalog ul.wc-block-product-template { display: grid; grid-template-columns: var(--cqt-cols); column-gap: 10px; list-style: none; margin: 0; padding: 0; min-width: 0; }
.cqt-catalog .cqt-table-head { border-bottom: 2px solid var(--wp--preset--color--navy); padding: 0 0 6px; }
/* rows are subgrids with 8px side padding: only their first and last cells shift, so mirror that on the header */
.cqt-catalog .cqt-table-head > :first-child { padding-left: 8px; }
.cqt-catalog .cqt-table-head > :last-child { padding-right: 8px; }
.cqt-catalog .cqt-table-head p { margin: 0; font-size: var(--wp--preset--font-size--x-small); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--wp--preset--color--slate); }
.cqt-catalog ul.wc-block-product-template > li.wc-block-product { display: grid; grid-template-columns: subgrid; grid-column: 1 / -1; column-gap: 10px; align-items: center; padding: 7px 8px; border-bottom: 1px solid var(--wp--preset--color--line); font-size: var(--wp--preset--font-size--small); margin: 0; }
.cqt-catalog ul.wc-block-product-template > li.wc-block-product:nth-child(even) { background: var(--wp--preset--color--mist); }
.cqt-catalog ul.wc-block-product-template > li.wc-block-product:hover { background: #eef1fa; }
.cqt-catalog .wc-block-product > * { margin: 0; min-width: 0; overflow-wrap: anywhere; }
/* pin every cell to its column so a product with no value (e.g. no target) leaves the cell empty instead of shifting the row */
.cqt-col-target { grid-column: 3; }
.cqt-col-clone { grid-column: 4; }
.cqt-col-emission { grid-column: 5; }
.cqt-col-family { grid-column: 1; }
.cqt-col-conjugate { grid-column: 2; }
.cqt-col-reactivity { grid-column: 6; }
.cqt-col-sku { grid-column: 8; }
.cqt-col-size { grid-column: 7; }
.cqt-col-price { grid-column: 9; }
.cqt-col-availability { grid-column: 10; }
.cqt-col-view { grid-column: 11; }
.cqt-catalog .wp-block-post-terms a { color: inherit; text-decoration: none; pointer-events: none; }
.cqt-catalog .cqt-col-family { font-weight: 600; }
.cqt-catalog .cqt-col-sku { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--wp--preset--font-size--x-small); }
.cqt-catalog .cqt-col-price .wc-block-components-product-price { font-size: inherit; }
.cqt-catalog .cqt-col-price .wc-block-components-product-price__value { font-weight: 600; }
/* availability: the stock indicator block prints out-of-stock / backorder text itself and is empty when in stock (WooCommerce behaviour); the li carries the real stock-status post class */
.cqt-catalog .cqt-col-availability { font-size: var(--wp--preset--font-size--x-small); font-weight: 600; }
.cqt-catalog li.instock .cqt-col-availability::before { content: "In stock"; color: var(--wp--preset--color--green); }
.cqt-catalog li.instock .cqt-col-availability::before,
.cqt-catalog .wc-block-components-product-stock-indicator { display: inline-flex; align-items: center; gap: .35rem; }
.cqt-catalog li.instock .cqt-col-availability::before { background: none; }
.cqt-catalog .wc-block-components-product-stock-indicator { font-size: inherit; margin: 0; }
.cqt-catalog .cqt-col-view.wp-block-read-more { display: inline-block; border: 1px solid var(--wp--preset--color--blue); border-radius: 6px; padding: .3rem .6rem; font-size: var(--wp--preset--font-size--x-small); font-weight: 600; text-align: center; }
.cqt-catalog .cqt-col-view.wp-block-read-more:hover { background: var(--wp--preset--color--blue); color: #fff; text-decoration: none; }
.cqt-catalog .wp-block-query-pagination { margin-top: var(--wp--preset--spacing--30); }

/* filters sidebar */
.cqt-catalog .wp-block-woocommerce-product-filters { background: var(--wp--preset--color--white); border: 1px solid var(--wp--preset--color--line); border-radius: 12px; padding: var(--wp--preset--spacing--30); }
.cqt-catalog .wp-block-woocommerce-product-filters h3 { font-size: var(--wp--preset--font-size--x-small); text-transform: uppercase; letter-spacing: .08em; color: var(--wp--preset--color--slate); margin: 0 0 .4rem; }
.cqt-catalog .wp-block-woocommerce-product-filter-attribute { padding-bottom: var(--wp--preset--spacing--20); border-bottom: 1px solid var(--wp--preset--color--line); }
.cqt-catalog .wp-block-woocommerce-product-filter-attribute:last-child { border-bottom: 0; padding-bottom: 0; }
.cqt-catalog .wc-block-product-filter-checkbox-list { font-size: var(--wp--preset--font-size--small); }

/* narrow screens: rows become stacked cards, header hidden */
@media (max-width: 1100px) {
  .cqt-catalog .wp-block-woocommerce-product-collection { grid-template-columns: 1fr; }
  .cqt-catalog .wp-block-woocommerce-product-collection > .wp-block-woocommerce-product-filters { grid-column: 1; grid-row: auto; position: static; }
  .cqt-catalog .wp-block-woocommerce-product-collection > :not(.wp-block-woocommerce-product-filters) { grid-column: 1; }
  .cqt-catalog .cqt-table-head { display: none; }
  .cqt-catalog ul.wc-block-product-template { display: block; }
  .cqt-catalog ul.wc-block-product-template > li.wc-block-product { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); grid-column: auto; row-gap: 6px; }
  .cqt-catalog .wc-block-product > * { grid-column: auto !important; }
}

/* ---------- emission swatches ----------
   A dot per wavelength term, keyed on the term archive URL the Post Terms block prints.
   Colours are approximate visible-spectrum renderings of the peak wavelength: a scanning aid, not a spectral spec.
   A new wavelength term needs one line here; without it the dot falls back to grey. */
.cqt-col-emission a, .cqt-emission-swatch a { display: inline-flex; align-items: center; gap: .4rem; }
.cqt-col-emission a::before, .cqt-emission-swatch a::before { content: ""; flex: none; width: .72rem; height: .72rem; border-radius: 50%; background: var(--cqt-swatch, #9aa0b0); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
a[href$="/emission/420/"] { --cqt-swatch: #6a1bff; }
a[href$="/emission/450/"] { --cqt-swatch: #1f4bff; }
a[href$="/emission/470/"] { --cqt-swatch: #00a2ff; }
a[href$="/emission/520/"] { --cqt-swatch: #2fcf1a; }
a[href$="/emission/580/"] { --cqt-swatch: #ffd800; }
a[href$="/emission/610/"] { --cqt-swatch: #ff9500; }
a[href$="/emission/640/"] { --cqt-swatch: #ff4a1a; }
a[href$="/emission/655/"] { --cqt-swatch: #ee1111; }
a[href$="/emission/700/"] { --cqt-swatch: #9c0a0a; }

/* product search: keep the whole placeholder visible */
.wp-block-search .wp-block-search__input { font-size: inherit; min-width: 0; text-overflow: ellipsis; }

/* ---------- single product ---------- */
.cqt-product .wc-block-components-product-price { font-weight: 700; }
.cqt-specs h2 { margin: 0 0 .5rem; color: var(--wp--preset--color--slate); }
/* catalog # styled as the first row of the spec table */
.cqt-specs .cqt-spec-sku { display: flex; gap: 0; margin: 0; padding: .45rem 0; border-bottom: 1px solid var(--wp--preset--color--line); text-transform: none; font-size: var(--wp--preset--font-size--small); }
.cqt-specs .cqt-spec-sku > :first-child { flex: 0 0 42%; color: var(--wp--preset--color--slate); font-weight: 600; }
.cqt-specs .cqt-spec-sku .sku { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600; }
.cqt-specs .wp-block-woocommerce-product-specifications { margin: 0; }
.cqt-specs table { width: 100%; border-collapse: collapse; border: 0; }
.cqt-specs tr { background: none !important; }
.cqt-specs th, .cqt-specs td { border: 0; border-bottom: 1px solid var(--wp--preset--color--line); padding: .45rem 0; text-align: left; vertical-align: top; font-style: normal; }
.cqt-specs tr:last-child th, .cqt-specs tr:last-child td { border-bottom: 0; }
.cqt-specs th { width: 42%; color: var(--wp--preset--color--slate); font-weight: 600; }
.cqt-specs td p { margin: 0; }
.cqt-specs td a { color: inherit; text-decoration: none; pointer-events: none; }
.cqt-specs .wp-block-product-specifications-item-attribute_pa_emission a { display: inline-flex; align-items: center; gap: .4rem; }
.cqt-specs .wp-block-product-specifications-item-attribute_pa_emission a::before { content: ""; flex: none; width: .72rem; height: .72rem; border-radius: 50%; background: var(--cqt-swatch, #9aa0b0); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
/* add to cart: theme button colours; a visibly intentional disabled state while a size still has to be chosen */
.cqt-product .single_add_to_cart_button, .cqt-product .single_add_to_cart_button.alt { background: var(--wp--preset--color--navy); color: #fff; border-radius: 6px; font-weight: 600; padding: .75rem 1.4rem; }
.cqt-product .single_add_to_cart_button:hover { background: var(--wp--preset--color--blue); color: #fff; }
.cqt-product .single_add_to_cart_button.disabled, .cqt-product .single_add_to_cart_button:disabled { background: var(--wp--preset--color--navy); color: #fff; opacity: .45; cursor: not-allowed; }
.cqt-product table.variations { margin: 0 0 .5rem; border: 0; }
.cqt-product table.variations th, .cqt-product table.variations td { border: 0; padding: .25rem .75rem .25rem 0; text-align: left; vertical-align: middle; }
.cqt-product .woocommerce-variation-price { display: none; } /* single-size products: the price is already shown above */
.cqt-product .reset_variations { font-size: var(--wp--preset--font-size--x-small); margin-left: .5rem; }
.cqt-docs .cqt-card { min-height: 0; }

.cqt-product .wc-block-components-product-image img { box-sizing: border-box; width: 100%; height: auto; border: 1px solid var(--wp--preset--color--line); border-radius: 12px; padding: var(--wp--preset--spacing--30); background: #fff; }

/* ---------- home page ---------- */
.cqt-btn-caps .wp-block-button__link { text-transform: uppercase; letter-spacing: .05em; }
.cqt-hero-dark figcaption { color: #9aa3c0; text-align: center; }
.cqt-hero-dark .wp-block-button.is-style-outline .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--navy) !important; }
.cqt-callouts p { margin: 0; padding-left: .9rem; border-left: 2px solid rgba(255, 255, 255, .35); color: #c9cee0; }
.cqt-callouts strong { color: #fff; }

/* page rhythm: full-bleed sections butt against header/footer; ordinary content gets breathing room before the footer */
.wp-block-post-content > .alignfull:first-child { margin-top: 0; }
.wp-block-post-content > :last-child:not(.alignfull) { margin-bottom: var(--wp--preset--spacing--60); }
.wp-block-post-content > :first-child:not(.alignfull) { margin-top: var(--wp--preset--spacing--50); }
footer.wp-block-template-part { margin-top: 0; }

.cqt-app-cards .cqt-card { background: var(--wp--preset--color--mist); border-color: transparent; }
.cqt-app-cards .cqt-badge { width: 56px; height: 56px; font-size: 1.5rem; flex: none; margin: 0; }
.cqt-card .cqt-card-title { text-transform: uppercase; letter-spacing: .02em; margin: 0; line-height: 1.2; }
.cqt-card .cqt-card-title + p, .cqt-app-cards .cqt-card p { margin: 0; }
.cqt-card .cqt-card-note { border-top: 1px solid var(--wp--preset--color--line); padding-top: var(--wp--preset--spacing--20); margin-top: auto !important; }
.cqt-card .cqt-card-link a { color: var(--cqt-accent, var(--wp--preset--color--blue)); }

/* platform strip: payload types as plain circles, joined by a hairline */
.cqt-payloads { position: relative; gap: var(--wp--preset--spacing--30) !important; }
.cqt-payloads::before { content: ""; position: absolute; left: 12%; right: 12%; top: 36px; height: 1px; background: #b9c0d6; }
.cqt-payload { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.cqt-payload p { margin: 0; }
.cqt-payload-name { text-transform: uppercase; letter-spacing: .04em; }
.cqt-dot { position: relative; width: 72px; height: 72px; border-radius: 50%; background: var(--cqt-dot, var(--wp--preset--color--slate)); box-shadow: 0 0 0 8px var(--cqt-dot-ring, #e3e6f2); margin: 0 0 .8rem; }
.cqt-payload--metal       { --cqt-dot: var(--wp--preset--color--purple); --cqt-dot-ring: #e4dcfa; }
.cqt-payload--fluorescent { --cqt-dot: var(--wp--preset--color--blue);   --cqt-dot-ring: #d9e6fa; }
.cqt-payload--magnetic    { --cqt-dot: var(--wp--preset--color--green);  --cqt-dot-ring: #d7ecdf; }
.cqt-payload--dual .cqt-dot { background: linear-gradient(90deg, var(--wp--preset--color--green) 50%, var(--wp--preset--color--blue) 50%); --cqt-dot-ring: #fbeed2; }
.cqt-payload--dual .cqt-payload-name { color: var(--wp--preset--color--green); }
.cqt-checks { border-left: 1px solid var(--wp--preset--color--line); padding-left: var(--wp--preset--spacing--50); }
.cqt-check { position: relative; margin: 0 0 var(--wp--preset--spacing--20); padding-left: 2rem; }
.cqt-check::before { content: "✓"; position: absolute; left: 0; top: .1rem; width: 1.25rem; height: 1.25rem; border: 1.5px solid var(--wp--preset--color--navy); border-radius: 50%; font-size: .75rem; line-height: 1.25rem; text-align: center; color: var(--wp--preset--color--navy); }

.cqt-card .cqt-card-title { color: var(--cqt-accent, inherit); }

.cqt-blurbs p { margin: 0 0 .25rem; }
.cqt-blurb-title { text-transform: uppercase; letter-spacing: .05em; border-top: 2px solid var(--wp--preset--color--purple); padding-top: .5rem; }
.cqt-needs-figure { border: 2px dashed #b9c0d6; border-radius: 12px; min-height: 300px; padding: var(--wp--preset--spacing--50); display: flex; flex-direction: column; justify-content: center; gap: .5rem; }
.cqt-needs-figure p { margin: 0; }

.cqt-workflow-cards .cqt-badge { flex: none; margin: 0; }
.cqt-workflow-cards .cqt-card h3, .cqt-workflow-cards .cqt-card p { margin: 0; }
.cqt-workflow-cards .cqt-card h3 { color: var(--wp--preset--color--ink); }

/* testimonial: quote left, attribution right, as in the mockup */
.cqt-quote { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(220px, 28%); column-gap: var(--wp--preset--spacing--50); align-items: center; margin: 0 auto; padding: 0; border: 0; }
.cqt-quote::before { content: "\201C"; font-size: 7rem; line-height: .8; font-weight: 700; color: #b7a6ee; align-self: start; padding-top: .4rem; }
.cqt-quote p { margin: 0; font-size: var(--wp--preset--font-size--medium); font-weight: 500; line-height: 1.6; }
.cqt-quote cite { font-style: normal; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--ink); border-left: 1px solid #b7a6ee; padding-left: var(--wp--preset--spacing--40); }
@media (max-width: 780px) { .cqt-quote { grid-template-columns: 1fr; row-gap: 1rem; } .cqt-quote::before { display: none; } .cqt-quote cite { border-left: 0; padding-left: 0; } }

/* closing band sits flush against the testimonial above and the footer below */
.cqt-cta-band { border-bottom: 1px solid rgba(255, 255, 255, .12); }
.wp-block-post-content > .cqt-testimonial + .cqt-cta-band { margin-top: 0; }
