/* ==========================================================================
   Blackfire slideshow + October image layouts for the homepage and the three
   company pages. Loaded after css/style.css and uses its tokens (--ink,
   --graphite, --fire, --accent, --stone, --rule, --ash). Behaviour: js/slideshow.js
   ========================================================================== */

/* ---------- carousel component ---------- */
.bf-show {
  position: relative;
  overflow: hidden;
  background: var(--graphite, #262626);
  touch-action: pan-y;
}
.bf-show__viewport { position: absolute; inset: 0; z-index: 0; }
.bf-show__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .6s ease, visibility 0s linear .6s;
}
.bf-show__slide.is-active { opacity: 1; visibility: visible; z-index: 2; transition: opacity .6s ease, visibility 0s; }
.bf-show__slide.is-leaving { opacity: 1; visibility: visible; z-index: 1; transition: none; }
/* Not-yet-needed slides are not rendered, so their lazy images are not fetched. */
.bf-show__slide:not(.is-active):not(.is-leaving):not(.is-primed) { display: none; }
.bf-show__slide picture { display: block; width: 100%; height: 100%; }
.bf-show__slide img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.bf-show--contain .bf-show__slide img { object-fit: contain; }

/* label on a slide: "Illustration", "Styling idea", "Example layout" */
.bf-show__tag,
.bf-tag {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 3px;
  background: rgba(21, 21, 21, .78);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .01em;
}
.bf-show__tag { position: absolute; top: 10px; left: 10px; z-index: 3; max-width: calc(100% - 20px); }
/* the label is a <figcaption>: keep it white on dark even inside .feature-media, whose figcaption rule is grey */
.bf-show .bf-show__tag { color: #fff; padding: 4px 9px; font-size: 13px; line-height: 1.3; }

/* caption on wide hero slides */
.bf-show__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  margin: 0;
  padding: 36px max(var(--gutter, 24px), calc((100% - var(--max, 1180px)) / 2)) 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, .68), rgba(0, 0, 0, 0));
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
}

/* controls: pause/play, previous, next on one row; the position dots below */
.bf-show__controls {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: calc(100% - 16px);
}
.bf-show__buttons { display: flex; gap: 4px; }
.bf-show__btn {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 21, 21, .78);
  /* a thin light ring keeps the round buttons visible over dark parts of a photo (palm trunks, night skies) */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .4);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.bf-show__btn svg { width: 22px; height: 22px; fill: currentColor; }
.bf-show__btn:hover { background: rgba(21, 21, 21, .9); color: #fff; }
.bf-show__toggle .bf-show__icon-play,
.bf-show__toggle.is-paused .bf-show__icon-pause { display: none; }
.bf-show__toggle.is-paused .bf-show__icon-play { display: block; }
.bf-show__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 0 4px;
  border-radius: 22px;
  background: rgba(21, 21, 21, .62);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .3);
}
.bf-show__dot {
  width: 32px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.bf-show__dot::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .6);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35);
}
.bf-show__dot[aria-current="true"]::before { background: var(--fire, #e2451c); box-shadow: 0 0 0 2px #fff; }
.bf-show__btn:focus-visible,
.bf-show__dot:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -3px;
  box-shadow: 0 0 0 3px var(--fire, #e2451c);
}
@media (max-width: 860px) {
  .bf-show__dot { width: 44px; }   /* full 44 px tap targets on phones */
  /* Phones: the floating "Ask Blackfire" button sits at the bottom right of the screen (about 151 x 48 px,
     16 px from the edges), so the controls move to the top LEFT. Previous / next / pause (140 px wide) then
     never pass under it while the page scrolls, and the dots row sits above them so that, in the first
     view at 360-390 px, the dots also stay clear of it. Labels move to the top right. */
  .bf-show__controls { left: 8px; right: auto; align-items: flex-start; flex-direction: column-reverse; }
  .bf-show__dots { justify-content: flex-start; }
  .bf-show__tag { left: auto; right: 10px; }
}

/* ---------- homepage: three company panels, one slideshow each ---------- */
.panels .panel.bf-panel {
  height: auto;
  aspect-ratio: 1 / 1;
  max-height: min(560px, 78vh);
  touch-action: pan-y;
}
.bf-panel .bf-show { position: absolute; inset: 0; background: var(--graphite, #262626); }
/* the gradient from style.css (.panel::after) sits over the slides, under the text and controls */
.bf-panel::after { pointer-events: none; }
.panels .bf-panel-link {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px 28px;
  color: #fff;
}
.panels .bf-panel-link:hover,
.panels .bf-panel-link:focus { color: #fff; }
.panels .bf-panel-link h2 { text-decoration: underline transparent; transition: text-decoration-color .15s ease; }
.panels .bf-panel-link:hover h2 { text-decoration-color: var(--fire, #e2451c); text-underline-offset: 5px; }
.panels .bf-panel-link:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.panels .bf-panel-link .bar { margin-bottom: 12px; }
@media (max-width: 860px) {
  .panels .panel.bf-panel { max-height: none; }
  .panels .bf-panel-link { padding: 20px 20px 22px; }
}

/* company logo boxes: the events logo is a <picture> sized from 200/400/600 px files */
.company-row .logo-box picture { display: flex; align-items: center; justify-content: center; height: 100%; max-width: 100%; }
.company-row .logo-box picture img { height: 100%; width: auto; max-width: 100%; object-fit: contain; }

/* ---------- homepage: recent updates + enquiry form fallback ---------- */
.bf-updates-section { border-top: 1px solid var(--rule, #dcdcd8); }
.bf-updates-section .section-head { margin-bottom: 20px; }
.bf-updates-more { margin: 14px 0 0; font-weight: 600; }
.bf-updates-more a { border-bottom: 2px solid var(--accent, #e2451c); }
/* js/updates.js (data stream) sets data-state on the container and, once it shows a list ("ready") or an error
   ("failed"), prints its own link to updates.html; the static link then steps aside so it is never shown twice.
   It stays for the "empty" state, without JavaScript and while the script is missing. */
.bf-updates-section [data-bf-updates][data-state="ready"] ~ .bf-updates-more,
.bf-updates-section [data-bf-updates][data-state="failed"] ~ .bf-updates-more { display: none; }

.bf-tf-widget { position: relative; }
.bf-tf-widget.is-embedding { min-height: 620px; }
.bf-tf-widget.has-form { height: 620px; }
.bf-tf-fallback { padding: 22px 20px; }
.bf-tf-fallback h3 { font-size: 20px; margin-bottom: 6px; }
.bf-tf-fallback p { color: var(--graphite, #262626); }
.bf-tf-widget.has-form .bf-tf-fallback { display: none; }
/* once the frame is in, a one-line link stays under it: Typeform's script may load while the form host is
   blocked, and the frame would then show a browser error page with no way out */
.bf-tf-alt { display: none; margin: 4px 8px 0; font-size: 14px; color: var(--stone, #6a6a68); }
/* its line is already reserved (invisible) while the form is on its way, so showing it never pushes the page */
.bf-tf-widget.is-embedding + .bf-tf-alt { display: block; visibility: hidden; }
.bf-tf-widget.has-form + .bf-tf-alt { display: block; visibility: visible; }
.bf-tf-alt a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--ink, #151515); border-bottom: 0; text-decoration: underline; text-decoration-color: var(--accent, #e2451c); text-underline-offset: 3px; }

/* ---------- company pages: wide hero slideshow (events) and still hero (real estate) ---------- */
.hero-photo.bf-hero { position: relative; overflow: hidden; height: clamp(300px, 36vw, 480px); }
.hero-photo.bf-hero > .bf-show { position: absolute; inset: 0; }
.hero-photo.bf-hero picture { display: block; width: 100%; height: 100%; }
.hero-photo.bf-hero img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.bf-hero-still figure { margin: 0; height: 100%; position: relative; }
.bf-hero-still .bf-show__caption { padding-top: 40px; }

/* ---------- figures: captions and contained graphics ---------- */
.feature-media figure { margin: 0; }
.feature-media picture { display: block; }
.bf-caption,
.feature-media figcaption {
  font-size: 14px;
  color: var(--stone, #6a6a68);
  padding: 8px 2px 0;
  line-height: 1.45;
}
.section-dark .bf-caption { color: rgba(255, 255, 255, .7); }
.bf-show--card { aspect-ratio: 4 / 3; border-radius: 2px; }

/* grid cells never grow to an image's intrinsic width (pictures with large width attributes) */
.photo-grid > * { min-width: 0; }
.photo-grid picture { display: block; }

/* society graphics carry logos and headlines: show them whole (letterboxed), never cropped */
.photo-grid img.bf-contain {
  object-fit: contain;
  background: var(--ink, #151515);
}
.photo-grid .bf-tile {
  aspect-ratio: 4 / 3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 20px;
  background: var(--ash, #f3f3f1);
  border-top: 3px solid var(--accent, #e2451c);
}
.photo-grid .bf-tile strong { font-size: 19px; }
.photo-grid .bf-tile a { font-weight: 600; border-bottom: 2px solid var(--accent, #e2451c); align-self: flex-start; }
@media (max-width: 860px) {
  .photo-grid .bf-tile { aspect-ratio: auto; min-height: 140px; padding: 14px; font-size: 15px; }
  .photo-grid .bf-tile strong { font-size: 17px; }
}
.photo-grid-5 { grid-template-columns: repeat(5, 1fr); }
.photo-grid-5 img { aspect-ratio: 1 / 1; }
@media (max-width: 1024px) { .photo-grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 860px) { .photo-grid-5 { grid-template-columns: repeat(2, 1fr); } }

/* portrait card strip ("Styling ideas", "Example layouts") */
.bf-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bf-strip li { margin: 0; }
.bf-strip figure { margin: 0; }
.bf-strip picture { display: block; }
.bf-strip img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.bf-strip figcaption { font-size: 14px; color: var(--stone, #6a6a68); padding: 8px 2px 0; line-height: 1.4; }
.bf-strip-note { font-size: 15px; color: var(--stone, #6a6a68); max-width: 760px; }
@media (max-width: 860px) {
  /* one card and a peek of the next; the strip scrolls inside itself, never the page */
  .bf-strip {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    padding-bottom: 8px;
  }
  .bf-strip li { scroll-snap-align: start; }
}

/* marketing: hero card + example layouts strip */
.bf-showcase { padding: 8px 0 0; }
.bf-showcase-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 14px;
  align-items: end;
}
.bf-showcase-grid figure { margin: 0; }
.bf-showcase-grid picture { display: block; }
.bf-showcase-grid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.bf-showcase-grid figcaption { font-size: 14px; color: var(--stone, #6a6a68); padding: 8px 2px 0; }
.bf-showcase-note { margin: 14px 0 0; font-size: 15px; color: var(--stone, #6a6a68); }
@media (max-width: 860px) {
  .bf-showcase-grid { grid-template-columns: 1fr 1fr; }
  .bf-showcase-grid .bf-hero-card { grid-column: 1 / -1; }
  .bf-showcase-grid .bf-hero-card img { aspect-ratio: 1 / 1; }
}

.feature.bf-solo { grid-template-columns: minmax(0, 1fr); max-width: 860px; }

/* events: decor grid of ten (five across) and concept label */
.bf-concept-note { font-size: 14px; color: var(--stone, #6a6a68); margin: 10px 0 0; }

/* real estate: simple floor-plan drawing (decorative) */
.bf-plan-art { width: 100%; height: auto; aspect-ratio: 4 / 3; display: block; background: #1f1f1f; }

.bf-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* reduced motion: slides change instantly (no cross-fade); autoplay is already off in js/slideshow.js */
@media (prefers-reduced-motion: reduce) {
  .bf-show__slide,
  .bf-show__slide.is-active { transition: none; }
  .panels .bf-panel-link h2 { transition: none; }
}

@media print {
  .bf-show__controls { display: none; }
  .bf-show__slide:not(.is-active) { display: none !important; }
  .bf-tf-widget { height: auto !important; }
}
