/* Buckingham Electrical — design layer (injected by scripts/design.py).
   Scopes: .bex-service (sector-service pages), .bex-project (project pages),
   .bex-article (blog posts). Sitewide: click-to-zoom lightbox. */

/* ============ compact, left-aligned sector-service hero ============ */
.bex-service .hero-text {
  min-height: 0;
  justify-content: flex-start;
  padding-top: 70px;
  padding-bottom: 0;
}
.bex-service .title-wrap-centre-2 {
  width: 100%;
  max-width: 1340px;
  align-items: flex-start;
  text-align: left;
  grid-row-gap: 14px;
}
.bex-service .hero-copy {
  font-size: clamp(36px, 4.4vw, 54px);
  margin-bottom: 0;
}
.bex-eyebrow {
  margin: 0;
  font-family: Poppins, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #9a6a00;
}
.bex-hero-rule {
  width: 64px;
  height: 4px;
  border-radius: 2px;
  background: var(--gold, #fec20e);
}

/* ============ left-aligned project hero ============ */
.bex-project .title-section.no-top-margin {
  width: 100%;
  max-width: 1340px;
  align-items: flex-start;
  text-align: left;
}
.bex-project .top-sub-heading {
  font-family: Poppins, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  color: #9a6a00;
}
.bex-project .title-section.no-top-margin .body-text-paragraph {
  text-align: left;
  margin-left: 0;
  margin-right: 0;
}
/* The hero h1 carries Webflow's .h2 class and the eyebrow its .top-sub-heading,
   both of which set `text-align: center` ON THE ELEMENT — that beats the left
   alignment inherited from the wrapper above, which is why the case-study hero
   still rendered centred. Restate it on the children. */
.bex-project .title-section.no-top-margin h1,
.bex-project .title-section.no-top-margin .top-sub-heading {
  text-align: left;
}

/* ============ two-column shell: sticky sidebar + content ============ */
.bex-shell {
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: 8px 3% 40px;
  display: flex;
  gap: 56px;
  align-items: flex-start;
}
.bex-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.bex-sidebar {
  position: sticky;
  top: 110px;
  flex: 0 0 250px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 3rem;
}

/* left-align everything that lives in the content column */
.bex-content .section-normal {
  padding-left: 0;
  padding-right: 0;
  align-items: flex-start;
}
.bex-content .container-normal { align-items: flex-start; }
.bex-content .title-section {
  width: 100%;
  align-items: flex-start;
  margin-top: 2rem;
  margin-bottom: 2rem;
}
.bex-content .body-text-paragraph { text-align: left; }
.bex-content .alternative-h2 { text-align: left; }
.bex-content .w-container { margin-left: 0; }
.bex-content .full-width-image {
  height: 52vh;
  border-radius: 12px;
}

/* ============ table of contents (sticky "on this page") ============ */
.bex-toc-label {
  margin: 0 0 10px;
  font-family: Poppins, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7b88a8;
}
.toc-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.toc-link {
  color: #7b88a8;
  border-left: 2px solid #e6e9f0;
  padding: .45rem .5em .45rem 1em;
  font-family: Raleway, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: color .2s, border-color .2s;
}
.toc-link:hover { color: #232936; }
.toc-link[data-toc-status="active"] {
  color: #232936;
  border-left-color: var(--gold, #fec20e);
}
.toc-link[data-toc-depth="3"] {
  padding-left: 1.9em;
  font-size: 14px;
  font-weight: 500;
}

/* sidebar contact card */
.bex-side-card {
  width: 100%;
  background: #f7f8fa;
  border: 1px solid #e9edf2;
  border-radius: 10px;
  padding: 22px;
}
.bex-side-card p {
  margin: 0 0 14px;
  font-family: Raleway, sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: #232936;
}

@media (max-width: 991px) {
  .bex-sidebar { display: none; }
  .bex-shell { display: block; padding-top: 0; }
}

/* ============ blog article sidebar (TOC + author chip) ============ */
.bex-article .author-column { row-gap: 26px; }
.bex-article .author-column .bex-toc-block { width: 100%; }
.bex-article .author-social-links {
  display: flex;
  align-items: center;
  column-gap: 12px;
}
.bex-article .blog-by-image {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0;
}
.bex-article .bex-author-lines .author-connect {
  margin: 0;
  line-height: 1.4;
}

/* ============ click-to-zoom ============ */
img[data-click-zoom],
[data-click-zoom] img { cursor: zoom-in; }

[data-click-zoom-lightbox] {
  z-index: 9999;
  cursor: zoom-out;
  background-color: #000000e6;
  justify-content: center;
  align-items: center;
  padding: 3em;
  display: none;
  position: fixed;
  inset: 0%;
}
[data-click-zoom-lightbox] > img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: .75em;
}

/* gallery navigation inside the lightbox */
.bex-lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 4px;
  transition: background .2s;
}
.bex-lb-btn:hover { background: rgba(255, 255, 255, .28); }
.bex-lb-prev { left: 20px; }
.bex-lb-next { right: 20px; }
.bex-lb-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  opacity: .85;
  font-family: Poppins, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
}
@media (max-width: 767px) {
  [data-click-zoom-lightbox] { padding: 1.25em; }
  .bex-lb-prev { left: 8px; }
  .bex-lb-next { right: 8px; }
}

/* ============ blog hero: 16:9 image, tighter band, wider headline ============
   The mirror hero is a 50/50 split forced to min-height:70vh, which crops the
   new 16:9 article illustrations hard and pushes the article itself below the
   fold. Let the image keep its own 16:9 ratio and let the band size to it, give
   the headline more width, and trade a little type size for line length. */
.bex-article .hero_home-2 {
  min-height: 0;
  align-items: stretch;
}
.bex-article .hero_content-2 {
  width: 54vw;
  align-self: center;
  /* left edge tracks the centred article container below (94% wide, capped at
     1100px), so the eyebrow/h1/date line up with the article copy */
  padding: 44px 56px 44px max(3vw, calc(50vw - 550px));
}
.bex-article .hero_content-2 h1 {
  margin-top: 0;
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.22;
}
.bex-article .hero_home-2 .overflow-off {
  flex: 0 0 46vw;
  display: flex;
}
.bex-article .article-main-image {
  width: 46vw;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  object-position: 50% 50%;
  align-self: center;
}
@media screen and (max-width: 991px) {
  .bex-article .hero_content-2 {
    width: 100vw;
    padding: 28px 24px 34px;
  }
  .bex-article .hero_home-2 .overflow-off {
    flex: 0 0 auto;
    width: 100vw;
  }
  .bex-article .article-main-image {
    width: 100vw;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
}

/* ============ blog "Read more": listing-style rows ============
   design.py rebuilds the two read-more cards as .bex-rows rows (tag | title |
   image, no excerpt) — all styling comes from the shared row rules below. */

/* ============ blog hub + category pages (scope .bex-bloghub) ============
   design.py rebuilds the listing DOM: compact left hero, articles as
   dhk-style rows (tag | title | wide image) with a directional hover tile,
   and on /blog the FSL scaffolding (filters + search + load more). */

/* --- compact left hero, same shape as the sector-service hero --- */
.bex-bloghub #info .header-2-grid {
  width: 100%;
  grid-template-columns: 1fr;
  grid-row-gap: 0;
  place-items: start;
  justify-content: start;
}
.bex-bloghub #info .title-section,
.bex-bloghub #info .title-section.blog {
  width: 100%;
  align-items: flex-start;
  margin-top: 1.25rem;
  margin-bottom: 0;
  row-gap: 14px;
}
.bex-bloghub #info .hero-copy {
  margin-bottom: 0;
  font-size: clamp(36px, 4.4vw, 54px);
  text-align: left;
}
.bex-bloghub #info .flex-vertical.centred {
  width: 100%;
  text-align: left;
  align-items: flex-start;
}
.bex-bloghub #info .flex-vertical.gap-40 { grid-row-gap: 26px; }
.bex-bloghub #info.section-normal { padding-top: 34px; padding-bottom: 0; }
.bex-bloghub #All-Articles.section-normal { padding-top: 34px; }

/* --- category chip links (category pages) — site button style, smaller --- */
.bex-chips .grid-3,
.bex-chips .w-dyn-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.bex-bloghub .primary-button-alt {
  height: auto;
  padding: 10px 18px;
  background-color: #fff;
  border: 2px solid #000;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.2;
}
.bex-bloghub .primary-button-alt:hover { background-color: #f5f5f5; }
.bex-bloghub .primary-button-alt.w--current {
  background-color: var(--gold, #fec20e);
  transform: none;
}
.bex-bloghub .primary-button-alt.w--current:hover {
  background-color: var(--gold, #fec20e);
}

/* --- FSL controls: filter buttons + search --- */
.bex-fsl-controls {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 32px;
  width: 100%;
  margin-bottom: 28px;
}
.bex-fsl-buttons {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.bex-fsl-search { flex: 0 0 auto; }
.bex-fsl-btn {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background-color: #fff;
  color: var(--black, #18191f);
  border: 2px solid #000;
  border-radius: 8px;
  padding: 10px 18px;
  font-family: Raleway, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color .3s, border-color .3s, opacity .3s, visibility .3s;
}
.bex-fsl-btn:hover { background-color: #f5f5f5; }
.bex-fsl-btn:not(.bex-fsl-reset)[data-fsl-status="active"] {
  background-color: var(--gold, #fec20e);
}
.bex-fsl-btn:not(.bex-fsl-reset)[data-fsl-status="active"]:hover {
  background-color: var(--gold, #fec20e);
}
/* hidden Reset must not occupy layout space — it would read as a phantom gap
   and confuse the widow-guard's line maths */
.bex-fsl-reset {
  border-color: #c9c6bf;
  color: #4a5162;
  display: none;
}
.bex-fsl-reset[data-fsl-status="active"] { display: inline-block; }

.bex-fsl-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 280px;
  height: 41px;
  background-color: #fff;
  border: 2px solid #dfdedb;
  border-radius: 8px;
  transition: border-color .3s;
}
.bex-fsl-search:focus-within { border-color: #000; }
.bex-fsl-search svg {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: #6b7280;
  pointer-events: none;
}
.bex-fsl-search input {
  border: 0;
  outline: 0;
  background: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 14px 0 40px;
  font-family: Raleway, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #232936;
}
.bex-fsl-search input::placeholder { color: #9aa1af; opacity: 1; }

/* --- the row list --- */
.bex-bloghub #All-Articles .w-layout-grid.services {
  display: block;
  width: 100%;
}
.bex-bloghub #All-Articles .w-dyn-list { width: 100%; }
.bex-rows {
  display: block;
  width: 100%;
  position: relative;
  transition: height 1s cubic-bezier(0.19, 1, 0.22, 1);
}
/* the list's opening rule — a pseudo-element rather than a border-top so the
   listing pages can sweep it in left→right like the hero rule */
.bex-rows::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: #18191f33;
}

.bex-row { width: 100%; }
.bex-row[data-fsl-status="active"] {
  transition: opacity 1.4s cubic-bezier(0.19, 1, 0.22, 1), transform 1.4s cubic-bezier(0.19, 1, 0.22, 1);
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  position: relative;
}
.bex-row[data-fsl-status="transition-out"] {
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(10px);
  opacity: 0;
  visibility: visible;
  position: relative;
}
.bex-row[data-fsl-status="not-active"] {
  transform: translateY(12px);
  opacity: 0;
  visibility: hidden;
  position: absolute;
  left: 0;
  right: 0;
}
.bex-row.fsl-enter {
  transition: none;
  opacity: 0;
  transform: translateY(12px);
}

/* --- one row: tag | title + excerpt | image --- */
.bex-row-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 26px 20px;
  overflow: hidden;
  border-bottom: 1px solid #18191f33;
  text-decoration: none;
  color: var(--black, #18191f);
}
.bex-row-tile {
  position: absolute;
  inset: 0;
  background-color: #f5f5f5;
  transform: translateY(-101%);
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.bex-row-side,
.bex-row-main,
.bex-row-media { position: relative; z-index: 1; }
.bex-row-side {
  flex: 0 0 170px;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding-top: 4px;
}
.bex-tag {
  display: inline-flex;
  padding: 7px 12px;
  background-color: #fff;
  border: 2px solid #000;
  border-radius: 8px;
  font-family: Poppins, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.2;
}
.bex-row-main {
  flex: 1;
  min-width: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 16px;
}
.bex-row-title {
  font-family: Raleway, sans-serif;
  font-size: clamp(19px, 1.8vw, 25px);
  font-weight: 800;
  line-height: 1.25;
}
.bex-row-excerpt {
  margin: 0;
  max-width: 44em;
  font-family: Raleway, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
  color: #4a5162;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.bex-row-link:hover .bex-row-excerpt {
  opacity: 1;
  transform: none;
}
.bex-row-media { flex: 0 0 37%; }
.bex-row-img {
  width: 100%;
  aspect-ratio: 2 / 1;
  background-size: cover;
  background-position: 50% 50%;
  clip-path: inset(0);
  transition: clip-path 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.bex-row-link:hover .bex-row-img { clip-path: inset(10px); }

/* --- FSL footer: count + load more + empty state --- */
.bex-fsl-data { display: none; }
.bex-fsl-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding-top: 40px;
}
.bex-fsl-count {
  margin: 0;
  font-family: Poppins, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #7b88a8;
}
.bex-fsl-load {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background-color: var(--gold, #fec20e);
  color: var(--black, #18191f);
  border: 2px solid transparent;
  border-radius: 8px;
  padding: 15px 40px;
  font-family: Raleway, sans-serif;
  font-size: 16px;
  font-weight: 600;
  transition: transform .25s ease-out;
}
.bex-fsl-load:hover { transform: scale(1.03); }
.bex-fsl-load[data-fsl-status="not-active"] { display: none; }
.bex-fsl-empty {
  width: 100%;
  padding: 56px 20px;
  text-align: center;
  border-bottom: 1px solid #18191f33;
}
.bex-fsl-empty[hidden] { display: none; }
.bex-fsl-empty-p {
  margin: 0;
  font-family: Raleway, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #4a5162;
}

/* --- responsive --- */
@media (max-width: 991px) {
  .bex-row-link {
    flex-wrap: wrap;
    gap: 14px 20px;
    padding: 22px 0;
  }
  .bex-row-tile { display: none; }
  .bex-row-media { flex: 0 0 100%; order: -1; }
  .bex-row-img { aspect-ratio: 16 / 9; }
  .bex-row-link:hover .bex-row-img { clip-path: inset(0); }
  .bex-row-side {
    flex: 0 0 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 0;
  }
  .bex-row-main { flex: 1 1 100%; padding-right: 0; }
  .bex-row-excerpt {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 767px) {
  .bex-fsl-controls { flex-direction: column; align-items: stretch; }
  .bex-fsl-search { max-width: none; }
}

/* --- page entrance: one quiet staggered rise, top to bottom ---
   Replaces the Webflow IX2 hero reveal (stripped by design.py). Every element
   rides easeOutExpo — nearly all of the travel happens in the first third,
   then a long asymptotic glide into place, so nothing ever "lands". Fill is
   `backwards` only, so once an animation finishes the FSL status transitions
   own opacity/transform again. */
@keyframes bexRise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* the gold rule unveils left→right like a loading bar */
@keyframes bexRuleSweep {
  from { opacity: 1; transform: scaleX(0); }
  to   { opacity: 1; transform: scaleX(1); }
}
@media (prefers-reduced-motion: no-preference) {
  .bex-bloghub #info .bex-eyebrow,
  .bex-bloghub #info .hero-copy,
  .bex-bloghub .bex-chips,
  .bex-bloghub .bex-fsl-controls,
  .bex-bloghub .bex-rows .bex-row:nth-child(-n+6) {
    animation: bexRise 1.8s cubic-bezier(0.19, 1, 0.22, 1) backwards;
  }
  .bex-bloghub #info .bex-eyebrow { animation-delay: .05s; }
  .bex-bloghub #info .hero-copy { animation-delay: .11s; }
  .bex-bloghub #info .bex-hero-rule {
    transform-origin: 0 50%;
    animation: bexRuleSweep 1.1s cubic-bezier(0.19, 1, 0.22, 1) .3s backwards;
  }
  /* the rule that opens the article list sweeps in just ahead of the rows */
  .bex-bloghub .bex-rows::before {
    transform-origin: 0 50%;
    animation: bexRuleSweep 1.4s cubic-bezier(0.19, 1, 0.22, 1) .24s backwards;
  }
  .bex-bloghub .bex-chips,
  .bex-bloghub .bex-fsl-controls { animation-delay: .22s; }
  .bex-bloghub .bex-rows .bex-row:nth-child(1) { animation-delay: .28s; }
  .bex-bloghub .bex-rows .bex-row:nth-child(2) { animation-delay: .36s; }
  .bex-bloghub .bex-rows .bex-row:nth-child(3) { animation-delay: .44s; }
  .bex-bloghub .bex-rows .bex-row:nth-child(4) { animation-delay: .52s; }
  .bex-bloghub .bex-rows .bex-row:nth-child(5) { animation-delay: .60s; }
  .bex-bloghub .bex-rows .bex-row:nth-child(6) { animation-delay: .68s; }
  /* article hero image: one soft settle from 120% (design.py strips the two
     fighting Webflow presets that zoomed from huge and jolted sideways) */
  .bex-article .article-main-image {
    animation: bexHeroSettle 1.8s cubic-bezier(0.19, 1, 0.22, 1) .1s backwards;
  }
}
@keyframes bexHeroSettle {
  from { opacity: 0; transform: scale(1.2); }
  to   { opacity: 1; transform: scale(1); }
}
