/* Site footer: brand column, three link columns, legal strip. */

footer {
  border-top: 1px solid var(--light-gray);
  padding: var(--gap-sec) var(--pad) 40px;
  max-width: calc(var(--max) + var(--pad)*2);
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--gap-col);
  margin-bottom: 56px;
}

.footer-logo { margin-bottom: 16px; }
.footer-logo img { height: 32px; width: auto; display: block; }

.footer-tagline { font-family: var(--font-soft); font-size: var(--step--1); color: var(--gray); line-height: 1.4; max-width: 252px; }

.footer-socials { display: flex; gap: 12px; margin-top: 24px; }
.social-icon {
  width: 24px; height: 24px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
/* Glyph size is independent of the box so the box can grow to a touch target
   without the artwork growing with it. --lg is instagram, whose source file
   draws the mark small inside a lot of padding that the box then crops. */
.social-glyph { width: 24px; height: 24px; object-fit: contain; display: block; flex: none; }
.social-glyph--lg { width: 50px; height: 50px; }

/* A <button> at every width so the phone accordion has a real control, but
   above that breakpoint it is styled back into the plain heading it has always
   been — no UA chrome, no pointer, chevron hidden. */
.footer-col-title {
  display: block;
  width: 100%;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font-family: inherit;
  font-size: var(--step-0);
  font-weight: 600;
  color: inherit;
  margin-bottom: 20px;
  cursor: default;
}
.footer-col-chevron { display: none; }
.footer-links { display: flex; flex-direction: column; gap: 12px; }
.footer-links a { font-family: var(--font-soft); font-size: var(--step--1); color: var(--gray); transition: color .15s; }

.footer-bottom {
  border-top: 1px solid var(--light-gray);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-legal { font-family: var(--font-soft); font-size: var(--step--1); color: var(--gray); }
.footer-legal a { margin-left: 20px; }

@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover { color: var(--black); }
  .social-icon:hover { opacity: .7; }
}

/* ── TABLET ── */
@media (max-width: 1023px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
}

/* ── PHONE ──
   Two columns of ~150px each still had to hold a 252px tagline. One column,
   and the icons grow to a real target. */
@media (max-width: 479px) {
  /* gap 0 because the three columns now carry their own separator lines; the
     brand block keeps its breathing room with a margin of its own. */
  .footer-top { grid-template-columns: 1fr; gap: 0; margin-bottom: 36px; }
  .footer-top > div:first-child { margin-bottom: 28px; }
  .footer-tagline { max-width: none; }
  .footer-bottom { padding-top: 20px; gap: 10px; }

  /* ── ACCORDION ──
     Open, the three stacks cost 498px of a 940px footer — more than half of it,
     for links nobody scrolls the whole page to reach. Collapsed they cost one
     tap target each. */
  .footer-col { border-bottom: 1px solid var(--light-gray); }
  .footer-col:last-of-type { border-bottom: none; }
  .footer-col-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: var(--tap);
    margin-bottom: 0;
    cursor: pointer;
  }
  .footer-col-chevron {
    display: block;
    flex: none;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--gray);
    border-bottom: 1.5px solid var(--gray);
    /* Rotated square, so it needs nudging back onto the optical centre. */
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform .18s ease;
  }
  .footer-col.is-open .footer-col-chevron { transform: rotate(-135deg) translate(-2px, -2px); }
  .footer-col .footer-links { display: none; }
  .footer-col.is-open .footer-links { display: flex; padding-bottom: 8px; }
  /* margin-left on a wrapped row leaves the first item of each new line
     indented for no reason. */
  .footer-legal a { margin-left: 0; margin-right: 16px; }
}

@media (pointer: coarse), (max-width: 1023px) {
  .footer-socials { gap: 4px; }
  .social-icon { width: var(--tap); height: var(--tap); }
  .footer-links { gap: 2px; }
  .footer-links a { min-height: var(--tap); display: flex; align-items: center; }
}
