/* ==========================================================================
   SGS Electrical — the CSS theme.json cannot express.
   Everything here is either a registered block style variation, the header /
   footer chrome, or a motion/print rule. No layout or token duplication.
   ========================================================================== */

:root {
  --sgs-circuit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='none' stroke='%23ffcc00' stroke-width='1.25'%3E%3Cpath d='M0 34h44l12 12h34M140 34h-30M62 0v22l12 12M0 104h34l12-12h58M140 104H92l-12 12v24M110 34v34M46 92V58'/%3E%3C/g%3E%3Cg fill='%23ffcc00'%3E%3Ccircle cx='44' cy='34' r='3'/%3E%3Ccircle cx='90' cy='46' r='3'/%3E%3Ccircle cx='34' cy='104' r='3'/%3E%3Ccircle cx='80' cy='116' r='3'/%3E%3Ccircle cx='110' cy='68' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

/* --- Signature motif: gold circuit trace, black grounds only -------------- */

.is-style-sgs-circuit {
  position: relative;
  isolation: isolate;
}
.is-style-sgs-circuit::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--sgs-circuit);
  opacity: 0.07;
  z-index: -1;
  pointer-events: none;
}

/* --- Eyebrow + lede ------------------------------------------------------- */

.is-style-sgs-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--wp--preset--spacing--20);
  font-family: var(--wp--preset--font-family--display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wp--preset--color--primary-soft);
}
.is-style-sgs-eyebrow::before {
  content: "";
  flex: none;
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--wp--preset--color--gold);
}
.has-primary-background-color .is-style-sgs-eyebrow,
.is-style-sgs-circuit .is-style-sgs-eyebrow {
  color: var(--wp--preset--color--gold);
}

.is-style-sgs-lede {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--wp--preset--color--primary-soft);
}
.has-primary-background-color .is-style-sgs-lede {
  color: var(--wp--preset--color--on-dark-soft);
}

/* Small-caps labels and tags. The letter-spaced micro-type sizes have no
   font-size preset slot (they would pollute the editor's size picker), so the
   whole treatment lives here as a block style. */
.is-style-sgs-label,
.is-style-sgs-tag {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700;
  text-transform: uppercase;
}
.is-style-sgs-label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--wp--preset--color--meta);
}
.is-style-sgs-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 3px 10px;
  border: 1px solid rgb(29 29 27 / 0.2);
  border-radius: var(--wp--custom--radius--pill);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--wp--preset--color--primary-soft);
}

.is-style-sgs-score {
  font-family: var(--wp--preset--font-family--display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--wp--preset--color--primary);
}

.sgs-footer .wp-block-separator {
  background-color: rgb(255 255 255 / 0.12);
  border: 0;
  height: 1px;
}

.is-style-sgs-measure > * {
  max-width: var(--wp--custom--measure--prose);
}

/* --- Cards, tiles, callouts ---------------------------------------------- */

.is-style-sgs-card {
  background: var(--wp--preset--color--white);
  border-radius: var(--wp--custom--radius--md);
  padding: var(--wp--preset--spacing--50);
  box-shadow: var(--wp--preset--shadow--hairline);
}

.is-style-sgs-tile {
  display: flex;
  flex-direction: column;
  gap: var(--wp--preset--spacing--30);
  padding: var(--wp--preset--spacing--50);
  border-radius: var(--wp--custom--radius--md);
  height: 100%;
  box-shadow: var(--wp--preset--shadow--hairline);
  transition: transform var(--wp--custom--transition--base),
    box-shadow var(--wp--custom--transition--base);
}
.is-style-sgs-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--wp--preset--shadow--mid);
}
.is-style-sgs-tile.has-gold-background-color {
  box-shadow: none;
}
.is-style-sgs-tile .wp-block-image {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--wp--custom--radius--md);
  background: var(--wp--preset--color--primary);
  margin: 0;
}
.is-style-sgs-tile .wp-block-image img {
  width: 26px;
  height: 26px;
}
.is-style-sgs-tile p {
  color: var(--wp--preset--color--meta);
}
.is-style-sgs-tile.has-gold-background-color p {
  color: #4a3f00;
}

.is-style-sgs-callout {
  padding: var(--wp--preset--spacing--50);
  border-radius: var(--wp--custom--radius--md);
  background: var(--wp--preset--color--wash);
  border-left: 4px solid var(--wp--preset--color--gold);
}

.is-style-sgs-banner,
.is-style-sgs-banner-finance {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
  padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
  border-radius: var(--wp--custom--radius--md);
  font-size: 0.95rem;
}
.is-style-sgs-banner {
  background: #fdf4e3;
  border-left: 4px solid var(--wp--preset--color--warning);
}
.is-style-sgs-banner-finance {
  background: #eef6ee;
  border-left: 4px solid var(--wp--preset--color--solar);
}
.is-style-sgs-banner p,
.is-style-sgs-banner-finance p {
  flex: 1;
  min-width: 220px;
  margin: 0;
}

/* Outline buttons. The 0.4 / 0.35 alpha whites and the amber label colour are
   one-off UI values with no palette slot, so they live here rather than as raw
   hex in block markup. */
.wp-block-button.is-style-sgs-btn-on-dark .wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--white);
  border: 2px solid rgb(255 255 255 / 0.4);
  box-shadow: none;
}
.wp-block-button.is-style-sgs-btn-on-dark .wp-block-button__link:hover {
  background: var(--wp--preset--color--white);
  color: var(--wp--preset--color--primary);
  border-color: var(--wp--preset--color--white);
}
.sgs-callbar .wp-block-button.is-style-sgs-btn-on-dark .wp-block-button__link {
  border-color: rgb(255 255 255 / 0.35);
}

.wp-block-button.is-style-sgs-btn-ghost .wp-block-button__link {
  background: transparent;
  color: var(--wp--preset--color--primary);
  border: 2px solid var(--wp--preset--color--primary);
  box-shadow: none;
}
.wp-block-button.is-style-sgs-btn-ghost .wp-block-button__link:hover {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--white);
}

.is-style-sgs-needs-check .sgs-check-label {
  color: #8a6414;
}

.is-style-sgs-needs-check {
  padding: var(--wp--preset--spacing--40);
  border: 2px dashed var(--wp--preset--color--warning);
  border-radius: var(--wp--custom--radius--md);
  background: #fffdf7;
  font-size: 0.92rem;
}

/* --- Review cards --------------------------------------------------------- */

.is-style-sgs-review {
  background: var(--wp--preset--color--white);
  border-radius: var(--wp--custom--radius--md);
  padding: var(--wp--preset--spacing--50);
  box-shadow: var(--wp--preset--shadow--low);
  break-inside: avoid;
  height: 100%;
}
.is-style-sgs-review p {
  font-size: 0.95rem;
  color: var(--wp--preset--color--primary-soft);
}
.is-style-sgs-review .sgs-stars {
  color: var(--wp--preset--color--star);
  letter-spacing: 2px;
  font-size: 0.95rem;
}

/* --- Lists: ticks, steps, chips, licences -------------------------------- */

.is-style-sgs-ticks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--wp--preset--spacing--20);
}
.is-style-sgs-ticks li {
  display: flex;
  gap: var(--wp--preset--spacing--30);
  align-items: flex-start;
}
.is-style-sgs-ticks li::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--wp--preset--color--gold)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d1d1b' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E")
    center / 13px no-repeat;
}

.is-style-sgs-steps {
  list-style: none;
  counter-reset: sgsstep;
  padding: 0;
  display: grid;
  gap: var(--wp--preset--spacing--40);
}
@media (min-width: 800px) {
  .is-style-sgs-steps.sgs-steps-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.is-style-sgs-steps li {
  counter-increment: sgsstep;
  padding-top: var(--wp--preset--spacing--40);
  border-top: 3px solid var(--wp--preset--color--gold);
}
.is-style-sgs-steps li::before {
  content: counter(sgsstep, decimal-leading-zero);
  display: block;
  font-family: var(--wp--preset--font-family--display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--wp--preset--color--meta);
  margin-bottom: var(--wp--preset--spacing--20);
}

.is-style-sgs-chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--20);
}
.is-style-sgs-chips li {
  padding: 8px 16px;
  border-radius: var(--wp--custom--radius--pill);
  background: var(--wp--preset--color--white);
  border: 1px solid var(--wp--preset--color--line);
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
  font-size: 0.92rem;
}
.has-primary-background-color .is-style-sgs-chips li {
  background: rgb(255 255 255 / 0.06);
  border-color: rgb(255 255 255 / 0.14);
  color: var(--wp--preset--color--white);
}

.is-style-sgs-licences {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
  font-size: 0.85rem;
  color: var(--wp--preset--color--on-dark-muted);
}
.is-style-sgs-licences li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.is-style-sgs-licences li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wp--preset--color--gold);
}

/* --- Images: figures and accreditation badges ---------------------------- */

.is-style-sgs-figure img {
  border-radius: var(--wp--custom--radius--md);
  box-shadow: var(--wp--preset--shadow--mid);
}
.is-style-sgs-figure figcaption {
  padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
  font-size: 0.85rem;
  color: var(--wp--preset--color--meta);
}

.is-style-sgs-badge img {
  height: 44px;
  width: auto;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.72;
  transition: filter var(--wp--custom--transition--base), opacity var(--wp--custom--transition--base);
}
.is-style-sgs-badge img:hover {
  filter: none;
  opacity: 1;
}
.wp-block-template-part footer .is-style-sgs-badge img,
.sgs-footer .is-style-sgs-badge img {
  filter: grayscale(1) invert(1) brightness(1.7);
  opacity: 0.65;
  height: 38px;
}

/* --- Data table ----------------------------------------------------------- */

.wp-block-table.is-style-sgs-data table {
  border-collapse: collapse;
}
.wp-block-table.is-style-sgs-data th,
.wp-block-table.is-style-sgs-data td {
  text-align: left;
  padding: var(--wp--preset--spacing--30) var(--wp--preset--spacing--20);
  border: 0;
  border-bottom: 1px solid var(--wp--preset--color--line);
}
.wp-block-table.is-style-sgs-data th {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 600;
  color: var(--wp--preset--color--primary);
}
.wp-block-table.is-style-sgs-data td:last-child {
  text-align: right;
  color: var(--wp--preset--color--meta);
}
.has-primary-background-color .wp-block-table.is-style-sgs-data th {
  color: var(--wp--preset--color--on-dark-soft);
}
.has-primary-background-color .wp-block-table.is-style-sgs-data td {
  color: var(--wp--preset--color--on-dark-muted);
}
.has-primary-background-color .wp-block-table.is-style-sgs-data th,
.has-primary-background-color .wp-block-table.is-style-sgs-data td {
  border-bottom-color: rgb(255 255 255 / 0.12);
}

/* --- Header chrome -------------------------------------------------------- */

.sgs-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--wp--preset--color--white);
  border-bottom: 1px solid var(--wp--preset--color--line);
}
.sgs-header .wp-block-site-logo img {
  width: 190px;
  height: auto;
}
@media (max-width: 420px) {
  .sgs-header .wp-block-site-logo img {
    width: 150px;
  }
}

/* Circular phone button (design.md §6) */
.wp-block-buttons.is-style-sgs-phone-circle .wp-block-button__link {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--white);
  display: grid;
  place-items: center;
  box-shadow: none;
  font-size: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.24 11.4 11.4 0 0 0 3.6.58 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1 11.4 11.4 0 0 0 .58 3.6 1 1 0 0 1-.25 1l-2.23 2.2z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 21px;
}
.wp-block-buttons.is-style-sgs-phone-circle .wp-block-button__link:hover {
  background-color: var(--wp--preset--color--gold);
  transform: scale(1.05);
}

/* Navigation: dropdown and responsive overlay styled to match the old drawer */
.sgs-header .wp-block-navigation .wp-block-navigation__submenu-container {
  min-width: 268px;
  border: 1px solid var(--wp--preset--color--line);
  border-radius: var(--wp--custom--radius--md);
  box-shadow: var(--wp--preset--shadow--high);
  padding: var(--wp--preset--spacing--20);
}
.sgs-header .wp-block-navigation .wp-block-navigation-item__content {
  border-radius: var(--wp--custom--radius--sm);
  padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
  text-decoration: none;
}
.sgs-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--white);
}
.sgs-header .wp-block-navigation__responsive-container.is-menu-open {
  background: var(--wp--preset--color--white);
  padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30);
}
.sgs-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
  min-height: 52px;
  display: flex;
  align-items: center;
  font-size: 1rem;
}
.sgs-header .wp-block-navigation__responsive-container-open,
.sgs-header .wp-block-navigation__responsive-container-close {
  min-width: 48px;
  min-height: 48px;
}

/* --- Footer --------------------------------------------------------------- */

.sgs-footer {
  font-size: 0.95rem;
}
.sgs-footer h2 {
  color: var(--wp--preset--color--white);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sgs-footer a {
  color: var(--wp--preset--color--on-dark-soft);
  text-decoration: none;
}
.sgs-footer a:hover {
  color: var(--wp--preset--color--gold);
  text-decoration: underline;
}
.sgs-footer .wp-block-social-links .wp-social-link {
  background: rgb(255 255 255 / 0.08);
  width: 44px;
  height: 44px;
}
.sgs-footer .wp-block-social-links .wp-social-link:hover {
  background: var(--wp--preset--color--gold);
}

/* --- Sticky mobile call bar ---------------------------------------------- */

.sgs-callbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  box-shadow: 0 -4px 20px rgb(0 0 0 / 0.22);
  padding-bottom: max(var(--wp--preset--spacing--20), env(safe-area-inset-bottom));
}
.sgs-callbar .wp-block-button__link {
  width: 100%;
  min-height: 50px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
}
@media (min-width: 700px) {
  /* Compound selector (0,2,0) so this beats core's
     `body .is-layout-grid { display: grid }` (0,1,1). */
  .wp-block-group.sgs-callbar,
  .sgs-callbar {
    display: none;
  }
}
@media (max-width: 699px) {
  body {
    padding-bottom: 74px;
  }
}

/* --- Motion (honours reduced motion; content visible without JS) --------- */

.sgs-has-js .sgs-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 500ms ease-out, transform 500ms ease-out;
}
.sgs-reveal.is-in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .sgs-reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* --- Print ---------------------------------------------------------------- */

@media print {
  .sgs-header,
  .sgs-callbar {
    display: none !important;
  }
  body {
    padding-bottom: 0;
    font-size: 12pt;
    color: #000;
  }
  .has-primary-background-color,
  .sgs-footer,
  .wp-block-cover {
    background: #fff !important;
    color: #000 !important;
  }
  .wp-block-cover .wp-block-cover__image-background,
  .wp-block-cover .wp-block-cover__background {
    display: none !important;
  }
}
