/**
 * Class names of the Canvas template stored in the content (node bodies,
 * Views rewrites). Kept for the existing content only – do not use them in
 * templates.
 */

/* Section titles: <div class="fancy-title title-bottom-border"><br><h2>…</h2></div> */
.fancy-title {
  position: relative;
  margin-bottom: 30px;
}

.fancy-title h1,
.fancy-title h2,
.fancy-title h3,
.fancy-title h4,
.fancy-title h5,
.fancy-title h6 {
  margin-bottom: 0;
}

.fancy-title.title-bottom-border h1,
.fancy-title.title-bottom-border h2,
.fancy-title.title-bottom-border h3,
.fancy-title.title-bottom-border h4,
.fancy-title.title-bottom-border h5,
.fancy-title.title-bottom-border h6 {
  padding: 0 0 10px;
  border-bottom: 2px solid var(--ncmg-color-accent);
}

/* Columns */
.col_one_fourth,
.col_three_fourth {
  position: relative;
  float: left;
  margin-right: 4%;
  margin-bottom: 50px;
}

.col_one_fourth { width: 22%; }
.col_three_fourth { width: 74%; }

.col_last {
  margin-right: 0 !important;
  clear: right;
}

@media (max-width: 767.98px) {
  .col_one_fourth,
  .col_three_fourth {
    float: none;
    width: 100%;
    margin-right: 0;
  }
}

.clear {
  clear: both;
  display: block;
  height: 0;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

.alignleft {
  float: left;
  margin: 5px 20px 13px 0;
}

.alignright {
  float: right;
  margin: 5px 0 13px 20px;
}

@media (max-width: 479.98px) {
  .alignleft,
  .alignright {
    float: none;
    display: block;
    margin: 0 auto 20px;
  }
}

.notopmargin { margin-top: 0 !important; }
.nobottommargin { margin-bottom: 0 !important; }

/* Bootstrap visibility helpers used in the side menu content. */
.visible-md,
.visible-lg {
  display: block;
}

/* Social icons in the side menu (font icons replaced by inline SVG masks). */
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 5px 5px 0;
  overflow: hidden;
  color: var(--ncmg-color-text);
  border-radius: 3px;
  transition: background-color var(--ncmg-transition), color var(--ncmg-transition);
}

.social-icon i + i {
  display: none;
}

.social-icon i {
  display: block;
  width: 14px;
  height: 14px;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.social-icon.si-facebook:hover,
.social-icon.si-facebook:focus-visible {
  color: #fff;
  background-color: #3b5998;
}

.social-icon.si-twitter:hover,
.social-icon.si-twitter:focus-visible {
  color: #fff;
  background-color: #000;
}

.icon-facebook {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 8V6c0-.9.6-1.1 1-1.1h2.6V1h-3.6C10 1 9.2 3.9 9.2 5.8V8H7v4h2.2v11H14V12h3.2l.4-4H14z'/%3E%3C/svg%3E");
}

.icon-twitter {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18.2 2.3h3.4l-7.4 8.4L23 21.7h-6.8l-5.3-6.9-6.1 6.9H1.4l7.9-9L1 2.3h7l4.8 6.3 5.4-6.3zm-1.2 17.4h1.9L7 4.2H5z'/%3E%3C/svg%3E");
}

/* Front page gallery: <div id="portfolio" class="portfolio-masonry …"> */
.portfolio-masonry {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-flow: dense;
  margin: 0;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  min-width: 0;
  aspect-ratio: 4 / 3;
}

.portfolio-item.wide {
  grid-column: span 2;
  aspect-ratio: 8 / 3;
}

/* The first (building) tile spans two rows; its height comes from them. */
.portfolio-item:first-child {
  grid-row: span 2;
  aspect-ratio: auto;
}

.portfolio-item:first-child .portfolio-image {
  position: absolute;
  inset: 0;
}

.portfolio-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portfolio-image,
.portfolio-image > a,
.portfolio-item .fslider,
.portfolio-item .flexslider,
.portfolio-item .slider-wrap {
  display: block;
  height: 100%;
}

.portfolio-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  background-color: rgba(255, 255, 255, 0.9);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.portfolio-overlay a {
  pointer-events: auto;
}

.portfolio-item:hover .portfolio-overlay,
.portfolio-item:focus-within .portfolio-overlay {
  opacity: 1;
}

.portfolio-desc h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.portfolio-desc h3 a {
  color: #333;
}

.portfolio-desc h3 a:hover {
  color: var(--ncmg-color-accent);
}

@media (max-width: 991.98px) {
  .portfolio-masonry {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Carousel built from the gallery tiles on phones (js/content.js). */
.mobile-gallery {
  display: none;
}

@media (max-width: 575.98px) {
  .portfolio-masonry {
    grid-template-columns: 1fr;
  }

  /* Phones: only the wide logo tile stays in the grid, shown whole; the
     photos are in the carousel below it. Without JS all tiles stay. */
  .portfolio-masonry:has(+ .mobile-gallery) .portfolio-item:not(.portfolio-item--logo) {
    display: none;
  }

  /* The logo image (800×300) has the lettering in its centre (x 196–652,
     y 98–201): show only that area plus a margin (x 160–688, y 70–229). */
  .portfolio-masonry .portfolio-item.portfolio-item--logo {
    aspect-ratio: 528 / 159;
    background-color: #fff;
  }

  .portfolio-masonry .portfolio-item--logo img {
    position: absolute;
    top: -44%;
    left: -30.3%;
    width: 151.5%;
    max-width: none;
    height: auto;
    object-fit: fill;
  }

  .mobile-gallery {
    position: relative;
    display: block;
  }

  .mobile-gallery__track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .mobile-gallery__track::-webkit-scrollbar {
    display: none;
  }

  .mobile-gallery__track:focus-visible {
    outline: 2px solid var(--ncmg-color-accent);
    outline-offset: -2px;
  }

  .mobile-gallery__slide {
    flex: 0 0 100%;
    margin: 0;
    aspect-ratio: 4 / 3;
    scroll-snap-align: start;
  }

  .mobile-gallery__slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobile-gallery__dots {
    position: absolute;
    right: 0;
    bottom: 10px;
    left: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
  }

  .mobile-gallery__dot {
    width: 24px;
    height: 24px;
    padding: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.55);
    background-clip: content-box;
    border: 0;
    border-radius: 50%;
  }

  .mobile-gallery__dot[aria-pressed="true"] {
    background-color: #fff;
  }

  .portfolio-item.wide {
    grid-column: auto;
    aspect-ratio: 4 / 3;
  }

  .portfolio-item:first-child {
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }
}

/* Image sliders: .fslider > .flexslider > .slider-wrap > .slide */
.fslider {
  position: relative;
}

.fslider--ready .slider-wrap {
  position: relative;
}

.fslider--ready .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--fslider-speed, 0.6s) ease, visibility 0s linear var(--fslider-speed, 0.6s);
}

.fslider--ready .slide.is-active {
  position: relative;
  height: 100%;
  opacity: 1;
  visibility: visible;
  transition: opacity var(--fslider-speed, 0.6s) ease;
}

.fslider:not(.fslider--ready) .slide + .slide {
  display: none;
}

.slide > a,
.slide img {
  display: block;
  height: 100%;
}

.fslider__dots {
  position: absolute;
  top: 14px;
  right: 10px;
  z-index: 2;
  display: flex;
  gap: 4px;
}

.fslider__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  opacity: 0.85;
}

.fslider__dot[aria-pressed="true"] {
  background: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .fslider--ready .slide,
  .portfolio-overlay {
    transition: none;
  }
}
