/*
 * Footer v2 – Figma "footer_1920_3" (desktop) and "footer_414" (mobile).
 * Loaded only where asa_use_footer_v2() is true (inc/footer-v2.php).
 *
 * Breakpoints follow the theme: mobile <= 991px.
 */

.site-footer-v2 {
  background: #111;
  color: #fff;
  font-family: 'Poppins', sans-serif;
  padding: 60px 0;
}

.site-footer-v2 a {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s;
}

.site-footer-v2 a:hover,
.site-footer-v2 a:focus-visible {
  color: #e4f018;
}

.site-footer-v2 ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Scoped to .fv2 so the site's "Discuss Your Project" button, which the
   theme moves into the footer on mobile, keeps its own styles. */
.fv2 button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.fv2 button:focus-visible {
  outline: 1px solid #e4f018;
  outline-offset: 3px;
}

.site-footer-v2 .screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Layout ---------- */

.fv2 {
  display: flex;
  flex-direction: column;
  gap: 50px;
}

.fv2-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

/* ---------- Brand column ---------- */

/* Link columns are as wide as their text, so the free space is shared
   evenly; the contacts column gets extra air on top of that. It grows
   from 0 at 1440px (where the row is already tight) up to 60px. */
.fv2-brand {
  margin-right: clamp(0px, (100vw - 1440px) * 0.25, 60px);
}

.fv2-brand {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
}

.fv2-logo {
  display: block;
  line-height: 0;
}

.fv2-logo img {
  display: block;
  /* The column width comes from the contacts text; the logo fills
     exactly that width instead of sticking out past it. */
  width: 0;
  min-width: 100%;
  height: auto;
}

.fv2-contacts {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 17px;
}

.fv2-contacts-title {
  display: none;
}

.fv2-contact {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fv2-icon {
  flex: 0 0 18px;
  width: 18px;
  height: auto;
}

.fv2-address {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  font-style: normal;
  font-weight: 300;
  font-size: 15px;
  line-height: 21px;
}

.site-footer-v2 .fv2-address a {
  font-weight: 300;
}

.fv2-contact--strong a {
  font-weight: 500;
  font-size: 17px;
  line-height: 24px;
}

.fv2-insta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
  font-size: 16px;
  line-height: 23px;
}

.fv2-insta svg {
  flex: 0 0 25px;
}

.fv2-riba {
  margin-top: 30px;
  line-height: 0;
}

.fv2-riba img {
  width: 100px;
  height: auto;
}

/* ---------- Menu columns ---------- */

.fv2-col {
  flex: 0 0 auto;
}


.fv2-col-head {
  position: relative;
  margin-bottom: 15px;
}

.site-footer-v2 .fv2-col-title {
  display: block;
  font-weight: 600;
  font-size: 15px;
  line-height: 23px;
  white-space: nowrap;
}

.fv2-acc-btn {
  display: none;
}

.fv2-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.fv2-list > li {
  line-height: 23px;
}

.fv2-list a {
  font-weight: 300;
  font-size: 15px;
  line-height: 23px;
}

.fv2-col--about .fv2-list a,
.fv2-col--residential .fv2-list a,
.fv2-col--extra .fv2-list a {
  white-space: nowrap;
}

/* ---------- Collapsible (shared) ---------- */

.fv2-collapse {
  display: grid;
  grid-template-rows: 1fr;
}

.fv2-collapse-inner {
  min-height: 0;
  overflow: hidden;
}

.fv2-area .fv2-collapse {
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.35s ease, visibility 0.35s;
}

.fv2-area.is-open .fv2-collapse {
  grid-template-rows: 1fr;
  visibility: visible;
}

/* Round plus icon (16px desktop, 22px mobile) */
.fv2-plus {
  position: relative;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: inline-block;
}

.fv2-plus::before,
.fv2-plus::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 1.2px;
  background: currentColor;
  border-radius: 1px;
  transform: translate(-50%, -50%);
  transition: transform 0.3s;
}

.fv2-plus::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.is-open > .fv2-area-btn .fv2-plus::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.fv2-toggle {
  display: inline-flex;
  align-items: center;
  transition: color 0.3s;
}

.fv2-toggle:hover {
  color: #e4f018;
}

.fv2-loc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px 30px;
}

.fv2-loc-list > li {
  line-height: 20px;
}

.fv2-loc-list a {
  font-weight: 300;
  font-size: 14px;
  line-height: 20px;
}

/* ---------- Locations bar ---------- */

.fv2-areas {
  position: relative;
  background: #1a1a1a;
  padding: 35px 50px;
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: space-between;
  column-gap: 30px;
}

.fv2-area {
  display: contents;
}

.fv2-area-btn {
  grid-row: 1;
  display: inline-flex;
  align-items: center;
  gap: 15px;
  text-align: left;
}

/* beats the generic ".fv2 button { font: inherit }" reset */
.site-footer-v2 .fv2-area-btn {
  font-weight: 300;
  font-size: 15px;
  line-height: 23px;
}

.fv2-area-panel {
  grid-row: 2;
  grid-column: 1 / -1;
}

.fv2-area-panel .fv2-loc-list {
  padding-top: 30px;
}

/* Only the open region occupies the panel row */
.fv2-area:not(.is-open) .fv2-area-panel {
  position: absolute;
  pointer-events: none;
}

/* ---------- Bottom row ---------- */

.fv2-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-weight: 300;
  font-size: 14px;
  line-height: 20px;
}

.site-footer-v2 .fv2-bottom a {
  font-weight: 300;
}

.fv2-policies {
  display: flex;
  gap: 30px;
}

.site-footer-v2 .fv2-policies a {
  font-weight: 200;
}

/* ---------- 992–1439px: one 4-column grid for brand + menus ----------
   Row 1: logo | contacts (spans 2) | RIBA, row 2: the four link columns,
   so the top row lines up with the menu columns below it. */

@media (max-width: 1439px) {
  .fv2-top {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
    column-gap: 30px;
    row-gap: 40px;
  }

  .fv2-brand {
    display: contents;
    margin-right: 0;
  }

  .fv2-logo {
    grid-row: 1;
    grid-column: 1;
  }

  .fv2-logo img {
    width: 260px;
    min-width: 0;
  }

  .fv2-contacts {
    grid-row: 1;
    grid-column: 2 / span 2;
    margin-top: 0;
  }

  .fv2-riba {
    grid-row: 1;
    grid-column: 4;
    margin-top: 0;
  }

  .fv2-col--about       { grid-row: 2; grid-column: 1; }
  .fv2-col--services    { grid-row: 2; grid-column: 2; }
  .fv2-col--residential { grid-row: 2; grid-column: 3; }
  .fv2-col--extra       { grid-row: 2; grid-column: 4; }

  .fv2-col--residential,
  .fv2-col--extra {
    width: auto;
  }

  .fv2-areas {
    grid-template-columns: repeat(2, auto);
    row-gap: 20px;
  }

  .fv2-area-btn {
    grid-row: auto;
  }

  .fv2-area-panel {
    grid-row: 3;
  }

  .fv2-bottom {
    flex-wrap: wrap;
  }
}

/* 992–1199px: equal columns, long link texts may wrap */
@media (max-width: 1199px) {
  .fv2-top {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .fv2-logo img {
    width: 100%;
    max-width: 260px;
  }

  .site-footer-v2 .fv2-col-title,
  .fv2-col--about .fv2-list a,
  .fv2-col--residential .fv2-list a,
  .fv2-col--extra .fv2-list a {
    white-space: normal;
  }
}

/* ---------- Mobile (<= 991px) – "footer_414" ---------- */

@media (max-width: 991px) {
  .site-footer-v2 {
    /* bottom space so the fixed "Discuss Your Project" button
       (bottom: 20px, ~46px tall) never covers the credit line */
    padding: 40px 0 90px;
  }

  .fv2 {
    gap: 0;
    text-align: center;
  }

  .fv2-top,
  .fv2-brand,
  .fv2-bottom {
    display: contents;
  }

  /* Visual order from the mobile frame */
  .fv2-logo       { order: 1; }
  .fv2-contacts   { order: 2; margin-top: 40px; }
  .fv2-riba       { order: 3; margin-top: 40px; }
  .fv2-col--about { order: 4; margin-top: 40px; }
  .fv2-col--services { order: 5; margin-top: 40px; }
  .fv2-col--residential { order: 6; margin-top: 40px; }
  .fv2-col--extra { order: 7; }
  .fv2-areas      { order: 8; margin-top: 40px; }
  .fv2-policies   { order: 9; }
  .site-footer-v2 .fv2-policies { margin-top: 50px; } /* beats the ul reset */
  .fv2-copy       { order: 10; margin-top: 20px; }
  .fv2-credit     { order: 11; margin-top: 8px; }

  .fv2-contacts {
    align-items: center;
    gap: 17px;
  }

  .fv2-contacts-title {
    display: block;
    font-weight: 600;
    font-size: 15px;
    line-height: 23px;
    margin-bottom: 3px;
  }

  .fv2-contact .fv2-icon {
    display: none;
  }

  .fv2-address {
    align-items: center;
    font-size: 14px;
  }

  /* Google Maps link highlighted by default on mobile (no hover on touch) */
  .site-footer-v2 .fv2-address a {
    color: #e4f018;
  }

  .fv2-logo {
    align-self: stretch;
  }

  .fv2-logo img {
    width: 100%;
    max-width: 374px;
    margin: 0 auto;
  }

  .fv2-policies {
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    line-height: 18px;
  }

  .site-footer-v2 .fv2-policies a {
    font-weight: 300;
  }

  .fv2-riba {
    align-self: center;
  }

  .fv2-riba img {
    width: 133px;
  }

  /* Menu + Services accordions */
  .fv2-acc {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 20px;
    text-align: left;
  }

  .fv2-acc .fv2-col-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
  }

  /* Title stays a link to its page; only the icon area on the right toggles */
  .fv2-acc .fv2-col-head {
    padding-right: 40px;
  }

  .fv2-acc-btn {
    display: block;
    position: absolute;
    right: 0;
    top: 50%;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
  }

  .fv2-cross {
    position: absolute;
    right: 0;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
  }

  .fv2-cross::before,
  .fv2-cross::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 16px;
    height: 1.4px;
    background: currentColor;
    transform: translateY(-50%);
    transition: transform 0.3s;
  }

  .fv2-cross::after {
    transform: translateY(-50%) rotate(90deg);
  }

  .fv2-acc.is-open .fv2-cross::after {
    transform: translateY(-50%) rotate(0deg);
  }

  .fv2-acc .fv2-collapse {
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows 0.35s ease, visibility 0.35s;
  }

  .fv2-acc.is-open .fv2-collapse {
    grid-template-rows: 1fr;
    visibility: visible;
  }

  .fv2-acc .fv2-list {
    gap: 20px;
    padding-top: 30px;
  }

  /* Residential accordion continues into the extensions list */
  .fv2-col--residential.is-open {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .fv2-col--extra {
    width: 100%;
    text-align: left;
  }

  .fv2-col--extra .fv2-collapse {
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows 0.35s ease, visibility 0.35s;
  }

  .fv2-col--extra.is-open .fv2-collapse {
    grid-template-rows: 1fr;
    visibility: visible;
  }

  .fv2-col--extra.is-open {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 20px;
  }

  .fv2-col--extra .fv2-list {
    gap: 20px;
    padding-top: 20px;
  }

  /* Location regions: same row style as the About / Services accordions */
  .fv2-areas {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 0;
    background: none;
  }

  .fv2-area {
    display: block;
    position: relative;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 20px;
    text-align: left;
  }

  .fv2-area-btn {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    padding-right: 40px;
  }

  .site-footer-v2 .fv2-area-btn {
    font-weight: 600;
    font-size: 15px;
    line-height: 23px;
  }

  /* The title stays a link to the region page; the icon on the right toggles */
  .fv2-area-btn .fv2-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    justify-content: flex-end;
  }

  .fv2-area .fv2-plus {
    flex-basis: 16px;
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 0;
  }

  .fv2-area .fv2-plus::before,
  .fv2-area .fv2-plus::after {
    width: 16px;
    height: 1.4px;
    background: currentColor;
  }

  .fv2-area:not(.is-open) .fv2-area-panel {
    position: static;
  }

  .site-footer-v2 .fv2-loc-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 20px;
    padding: 30px 0 5px;
    text-align: center;
  }

  .fv2-copy,
  .fv2-credit {
    font-size: 12px;
    line-height: 18px;
  }
}

/* Open block: title and icon stay highlighted while the list is shown */
.fv2-area.is-open .fv2-area-label,
.fv2-area.is-open .fv2-toggle,
.fv2-acc.is-open .fv2-col-title,
.fv2-acc.is-open .fv2-acc-btn {
  color: #e4f018;
}

/* Keep the focus ring for keyboard users only */
.fv2 button:focus:not(:focus-visible) {
  outline: none;
}

/* "Discuss Your Project" button (theme header, moved into the footer on
   mobile): 1px white outline so it stays visible over the dark footer.
   body prefix beats the theme's ".letdis_btn { border: unset }". */
body .letdis_btn {
  border: 1px solid #fff;
}

@media (prefers-reduced-motion: reduce) {
  .site-footer-v2 *,
  .site-footer-v2 *::before,
  .site-footer-v2 *::after {
    transition: none !important;
  }
}
