/**
 * DJ Refresh — Footer.
 * Figma: dark panel, brand block left (logo + blurb + 3 round social buttons),
 * four link columns right, rule, then the legal row.
 */

.djr-footer {
  --djr-footer-bg: var(--djr-red); /* brand-red footer, matching the header bar (was #000000) */
  --djr-footer-title: #ffffff;
  /* Figma: footer body copy and links are white, not grey. */
  --djr-footer-link: #ffffff;

  /* Figma: 56px above the columns, 36px below the legal row. */
  padding-top: 56px;
  padding-bottom: 36px;
  background: var(--djr-footer-bg);
  color: var(--djr-footer-link);
  font-size: 14px;
}

.djr-footer__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 48px;
}

/* ---------- Brand block ---------- */

.djr-footer__brand {
  flex: 0 1 348px;
  min-width: 0;
}

.djr-footer__logo img {
  width: 165px;
  height: auto;
  aspect-ratio: 146 / 60;
  object-fit: contain;
}

/* Figma: the brand column stacks logo / blurb / socials on a 15px rhythm. */
.djr-footer__blurb {
  margin-top: 15px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--djr-footer-link);
}

.djr-footer__social {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.djr-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  /* On the red footer, invert: white circle with a red glyph (a red circle would vanish). */
  background: var(--djr-white);
  color: var(--djr-red);
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.djr-footer__social-link:hover,
.djr-footer__social-link:focus-visible {
  background: rgba(255, 255, 255, 0.85);
  transform: translateY(-2px);
  color: var(--djr-red);
}

/* ---------- Link columns ---------- */

/* Figma spreads hug-width columns across the remaining space with justify-between (the last
   one flush to the right gutter) — not four equal-width grid tracks, which bunched them up. */
.djr-footer__nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  /* Keeps the columns out in the right two-thirds, as drawn. */
  padding-left: 140px;
}

.djr-footer__col {
  flex: 0 0 auto;
}

.djr-footer__col-title {
  margin-bottom: 24px;
  font-size: 15px;
  font-weight: 700;
  color: var(--djr-footer-title);
  white-space: nowrap;
  /* Desktop: a plain heading, not an interactive summary. */
  list-style: none;
  cursor: default;
}

/* Remove the native <details> disclosure triangle in every engine. */
.djr-footer__col-title::-webkit-details-marker {
  display: none;
}

.djr-footer__col-title::marker {
  content: "";
}

/* The chevron only appears once the column is an accordion (mobile). */
.djr-footer__col-chevron {
  display: none;
}

.djr-footer__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.djr-footer__list a {
  white-space: nowrap;
}

.djr-footer__list a {
  color: var(--djr-footer-link);
  transition: color 0.18s ease;
}

.djr-footer__list a:hover,
.djr-footer__list a:focus-visible {
  color: var(--djr-white);
}

/* ---------- Rule + legal ---------- */

/* Industry / association member badges. The source PNGs are light-grey lockups, so they read as
   subtle badges on the red footer; brighten slightly on hover. */
/* Sits in the middle of the legal row (between the copyright and the legal links). */
.djr-footer__assoc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.djr-footer__assoc img {
  display: block;
  height: 40px;
  width: auto;
  /* The source badges are light-grey; flatten them to solid white for the red footer. */
  filter: brightness(0) invert(1);
  opacity: 0.9;
  transition: opacity 0.18s ease;
}
.djr-footer__assoc a:hover img,
.djr-footer__assoc a:focus-visible img {
  opacity: 1;
}

.djr-footer__rule {
  height: 1px;
  margin: 40px 0 0;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
}

.djr-footer__legal {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 40px;
  font-size: 13px;
}

/* Desktop: copyright + legal links group on the left; badges pushed to the right. */
.djr-footer__legal-links {
  display: flex;
  gap: 24px;
  order: 1;
}
.djr-footer__legal .djr-footer__assoc {
  order: 2;
  margin-left: auto;
}

.djr-footer__legal-links a:hover,
.djr-footer__legal-links a:focus-visible {
  color: var(--djr-white);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .djr-footer__top {
    flex-direction: column;
    gap: 40px;
  }

  .djr-footer__brand {
    flex: 1 1 auto;
    max-width: 480px;
  }

  .djr-footer__nav {
    max-width: none;
    width: 100%;
  }
}

/*
 * Below 700px the link columns become an accordion (native <details>). Rows stack full
 * width with a hairline between them and a chevron that flips when open.
 */
@media (max-width: 700px) {
  .djr-footer__nav {
    display: block;
    padding-left: 0;
  }

  .djr-footer__col {
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }

  .djr-footer__col:last-of-type {
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .djr-footer__col-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    padding: 16px 0;
    cursor: pointer;
  }

  .djr-footer__col-chevron {
    display: block;
    width: 9px;
    height: 9px;
    border-right: 2px solid var(--djr-muted);
    border-bottom: 2px solid var(--djr-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease, border-color 0.2s ease;
  }

  .djr-footer__col[open] .djr-footer__col-chevron {
    transform: rotate(-135deg);
    border-color: var(--djr-red);
  }

  .djr-footer__list {
    padding-bottom: 20px;
  }

  .djr-footer__legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  /* Badges sit above the copyright + legal links on mobile. */
  .djr-footer__legal .djr-footer__assoc {
    order: -1;
    margin-left: 0;
    gap: 24px;
  }
}
