/* ==========================================================================
   Ferrier Architecture Studio – mobile & icon fixes (Oct 2026)
   Loaded after app.css.
   ========================================================================== */

/* --- Built-in icons ---------------------------------------------------------
   Replaces the Font Awesome kit (which no longer loads). Each icon is an
   inline SVG mask, so it takes the text colour of its parent. */
i.fa, i.fal, i.far, i.fas {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  background-color: currentColor;
  -webkit-mask: var(--fas-icon) center / contain no-repeat;
          mask: var(--fas-icon) center / contain no-repeat;
}
i.fa::before, i.fal::before, i.far::before, i.fas::before { content: none; }
.fa-bars { --fas-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M3 6h18M3 12h18M3 18h18'/%3E%3C/svg%3E"); }
.fa-search { --fas-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21'/%3E%3C/svg%3E"); }
.fa-chevron-left { --fas-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4l-8 8 8 8'/%3E%3C/svg%3E"); }
.fa-chevron-right { --fas-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4l8 8-8 8'/%3E%3C/svg%3E"); }
.fa-arrow-up { --fas-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20V4M5 11l7-7 7 7'/%3E%3C/svg%3E"); }
.fa-arrow-to-bottom { --fas-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v13M5 10l7 7 7-7M4 21h16'/%3E%3C/svg%3E"); }

/* --- Close button on project / news / office pages ------------------------- */
.single-close {
  position: fixed;
  top: 64px;
  right: 0;
  z-index: 9998;
  display: block;
  padding: 0.3rem;
  line-height: 0;
  background-color: #03ff50;
}
.single-close img { width: 1.5rem; transition: transform 0.25s ease-in-out; }
.single-close:hover img { transform: rotate(45deg); }
#colorbox ~ .single-close, body.cbox-open .single-close { display: none; }
@media screen and (max-width: 39.9375em) {
  .single-close { top: 8vh; padding: 0.6rem; }
}

/* --- Project galleries: images sit on a common bottom line ----------------
   Every slide is as tall as the tallest image in its gallery; each image is
   pushed to the bottom, with its number directly underneath, so all images
   end on the same line and the numbers stay in the same place. */
.slick-track:has(> .project-slide) {
  display: flex;
  align-items: stretch;
}
.slick-track > .project-slide {
  float: none;
  height: auto;
  flex: 0 0 auto;
  display: flex !important;      /* slick sets display:block inline */
  flex-direction: column;
  justify-content: flex-end;
}
.slick-track > .project-slide .image-caption {
  flex: 0 0 auto;
}

/* --- Phones (Foundation "small": under 640px) ------------------------------ */
@media screen and (max-width: 39.9375em) {

  /* Menu button: bigger tap area */
  .nav-mobile-right .nav-menu {
    display: inline-block;
    padding: 0.5rem;
    margin: -0.5rem -0.5rem 0 0;
    line-height: 1;
  }

  /* Menu items: same colour for all (Index was showing faded) */
  .mobile-menu-btn,
  .mobile-menu-btn:visited { color: #000006; }

  /* Captions over photos and video: readable on light images */
  .video-content {
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,.35) 35%, rgba(0,0,0,.7) 100%);
  }
  .hero-desc p,
  .hero-desc p a,
  .video-info-2 h1, .video-info-2 h2, .video-info-2 h3 {
    text-shadow: 0 1px 2px rgba(0,0,0,.45), 0 0 18px rgba(0,0,0,.45);
  }
  .action-btn.button {
    min-height: 44px;
    padding: 0.8rem 1.2rem;
    background: rgba(0,0,0,.25);
  }

  /* Project gallery arrows: at least 44px to tap */
  .gallery-nav .button,
  .nav-prev, .nav-next {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Home video slideshow: keep the titles and the slide dots clear of the
     phone's bottom toolbar / home bar, and stop them overlapping */
  .home-video-1 .fp-slidesNav.fp-bottom {
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)) !important;
    padding-right: 1rem;
  }
  .home-video-1 .video-content {
    bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    padding-bottom: 0.5rem;
    background: none;          /* shade is drawn by ::before below */
  }
  /* Shade behind the titles, running down to the bottom of the screen
     (behind the slide dots too) */
  .home-video-1 .video-content::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: calc(-4rem - env(safe-area-inset-bottom, 0px));
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,.35) 30%, rgba(0,0,0,.7) 100%);
  }

  /* Project galleries: one image per screen, as wide as the phone
     (100vw minus the 0.625rem gutter on each side) */
  .project-slide {
    width: calc(100vw - 1.25rem);
  }
  .project-slide a.fancybox {
    display: block;
  }
  .content-grid .project-slide img,
  .project-slide img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;       /* tall portrait images stay on screen */
    object-fit: contain;
    padding-left: 0;
  }

  /* Contact page and footer links: easier to tap */
  .contact-info p a,
  .contact-address p a,
  .footer-left a {
    display: inline-block;
    padding: 0.35rem 0;
  }
}

/* --- Phone category filter (Work / Office / News): drop-down -------------- */
.mobile-subnav { display: none; }
@media screen and (max-width: 39.9375em) {
  .mobile-subnav {
    display: block;
    position: fixed;
    top: 64px;                 /* updated by app_dev.js to sit right under the header */
    left: 0;
    right: 0;
    z-index: 9998;             /* just below the phone header and its menu */
    background: #fff;
    border-bottom: 1px solid #eee;
  }
  .mobile-subnav-dd summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
    padding: 0 1rem;
    font-size: 0.95rem;
    font-weight: 300;
    color: #000006;
    cursor: pointer;
  }
  .mobile-subnav-dd summary::-webkit-details-marker { display: none; }
  .mobile-subnav-dd .dd-label { color: #777; }
  .mobile-subnav-dd .dd-current { font-weight: 400; }
  .mobile-subnav-dd .dd-arrow {
    margin-left: auto;
    width: 0.6rem;
    height: 0.6rem;
    border-right: 1.5px solid #000006;
    border-bottom: 1.5px solid #000006;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.2s ease;
  }
  .mobile-subnav-dd[open] .dd-arrow { transform: rotate(-135deg) translate(-2px, -2px); }
  .mobile-subnav-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0 0.5rem;
    border-top: 1px solid #eee;
    max-height: calc(100vh - 140px);   /* long lists scroll inside the panel */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 10px 20px rgba(0,0,0,.08);
  }
  .mobile-subnav-list a {
    display: block;
    padding: 0.7rem 1rem;
    font-size: 1rem;
    font-weight: 300;
    color: #000006;
  }
  .mobile-subnav-list a.active {
    background: #03ff50;
  }
}

/* --- Home page on phones/tablets: video panel scrolls up and away ---------
   On desktop the panel is fixed and slid away by script; on mobile it now
   sits in the page flow like the WORK / STUDIO / NEWS landing panels. */
#section0.home-video-mobile {
  position: relative;
  top: 0;
  height: 100vh;
  height: 100svh;
  z-index: 1;
}
.footer-legal {
  margin: 0;
  font-size: 0.75rem;
  color: #666;
}
.footer-legal a { display: inline !important; padding: 0 !important; }
