/* ============================================
   FOOTER BLOCK — Mobile-first
   Mobile: brand (logo+tagline+social) → accordion columns → legal
   Desktop: brand left, 4 columns right, legal bar full-width
   ============================================ */

/* Block-local tokens */
footer .footer {
  --footer-logo-width: 150px;
  --footer-social-size: var(--icon-size-l);
  --footer-icon-invert: brightness(0) invert(1);
  --footer-rule: 1px solid var(--digicert-medium-blue);
  --footer-brand-max-width: var(--footer-brand-column);
  --footer-chevron-size: calc(var(--icon-size-xs) * 0.625);
  --footer-brand-column: clamp(200px, 120px + 8vw, 280px);
  --footer-heading-size: var(--heading-font-size-s);
  --footer-link-size: var(--body-font-size-s);
  --footer-legal-size: var(--body-font-size-xs);
}

footer {
  background-color: var(--digicert-dark-blue);
  color: var(--digicert-white);
  font-family: var(--body-font-family);
}

footer .footer-content {
  margin: 0 auto;
  max-width: var(--container-max-width);
  box-sizing: border-box;
  padding-inline: var(--container-padding);
  padding-block: var(--space-3xl);
}

/* ============================================
   BRAND (Logo + Tagline + Social)
   ============================================ */
footer .footer-brand .default-content-wrapper {
  margin: 0;
}

footer .footer-brand p {
  margin: 0;
}

footer .footer-brand {
  margin-bottom: var(--space-xl);
}

footer .footer-brand img:not(.footer-social-icon) {
  width: var(--footer-logo-width);
  height: auto;
  filter: var(--footer-icon-invert);
}

footer .footer-brand p:not(:has(picture)) {
  font-size: var(--footer-link-size);
  color: var(--digicert-white);
  line-height: var(--line-height-relaxed);
  margin: var(--space-l) 0 0;
}

/* Social icons (within brand section) */
footer .footer-social-icons {
  display: flex;
  gap: var(--space-s);
  margin-top: var(--space-l);
}

footer .footer-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--footer-social-size);
  height: var(--footer-social-size);
  transition: opacity var(--duration-fast) ease;
}

footer .footer-social-link:hover {
  opacity: var(--state-disabled-opacity);
  text-decoration: none;
}

footer .footer-social-icon {
  width: var(--icon-size-m);
  height: var(--icon-size-m);
  filter: var(--footer-icon-invert);
}

/* DigiCert Seal (below social icons) — :not(:empty) avoids reserving
   whitespace on hosts where the seal doesn't render. */
footer .footer-seal:not(:empty) {
  margin-top: var(--space-l);
}

/* ============================================
   COLUMNS — Mobile accordion
   ============================================ */
footer .footer-columns .default-content-wrapper {
  margin: 0;
}

footer .footer-columns-container {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--space-2xl);
}

footer .footer-column {
  border-bottom: var(--footer-rule);
}

footer .footer-column:has(.footer-column-toggle[aria-expanded="true"]) {
  padding-bottom: var(--space-l);
}

/* Accordion toggle button */
footer .footer-column-heading {
  margin: 0;
}

footer .footer-column-toggle {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  color: var(--digicert-white);
  font-family: var(--heading-font-family);
  font-weight: var(--font-weight-medium);
  font-size: var(--footer-heading-size);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-heading);
  padding: var(--space-l) 0;
  cursor: pointer;
  outline: none;
}

footer .footer-column-toggle:focus-visible {
  outline: var(--focus-outline-width) solid var(--digicert-blue);
  outline-offset: var(--focus-outline-offset);
  border-radius: var(--border-radius-s);
}

/* Chevron */
footer .footer-chevron {
  display: inline-block;
  width: var(--footer-chevron-size);
  height: var(--footer-chevron-size);
  border: solid var(--digicert-neutral-400);
  border-width: 0 var(--focus-outline-width) var(--focus-outline-width) 0;
  transform: rotate(45deg);
  transition: transform var(--duration-fast) ease;
  flex-shrink: 0;
  margin-right: var(--space-xs);
}

footer .footer-column-toggle[aria-expanded="true"] .footer-chevron {
  transform: rotate(-135deg);
}

/* Accordion animation wrapper */
footer .footer-links-animate {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--duration-normal) ease-out;
}

footer .footer-column:has(.footer-column-toggle[aria-expanded="true"]) .footer-links-animate {
  grid-template-rows: 1fr;
}

footer .footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  overflow: hidden;
  min-height: 0;
}

footer .footer-column:has(.footer-column-toggle[aria-expanded="true"]) .footer-links {
  padding-bottom: var(--space-m);
}

footer .footer-links li {
  margin: 0 0 var(--space-xs) 0;
  padding: 0;
  line-height: var(--line-height-tight);
}

footer .footer-links a,
footer .footer-column a {
  font-weight: var(--font-weight-regular);
  font-size: var(--footer-link-size);
  line-height: var(--line-height-tight);
  color: var(--digicert-white);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

/* Nav-style content within columns */
footer .footer-column ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

footer .footer-column li {
  list-style: none;
  margin: 0 0 var(--space-xs) 0;
  padding: 0;
  line-height: var(--line-height-tight);
}

/* Section headers within columns ({{heading}} syntax) — 80% of column heading */
footer .footer-column .footer-section-header {
  font-family: var(--heading-font-family);
  font-weight: var(--font-weight-bold);
  font-size: calc(var(--footer-heading-size) * 0.8);
  color: var(--digicert-white);
  margin-top: var(--space-m);
  margin-bottom: var(--space-s);
  line-height: var(--line-height-tight);
}

footer .footer-column .footer-section-header:first-child {
  margin-top: 0;
}

/* Icons within columns ({{icon}} syntax) */
footer .footer-item-icon {
  width: var(--icon-size-s);
  height: var(--icon-size-s);
  filter: var(--footer-icon-invert);
  margin-right: var(--space-xs);
  vertical-align: middle;
}

/* ============================================
   DIVIDER + LEGAL
   ============================================ */
footer .footer-divider {
  display: none;
  border: none;
  border-top: var(--footer-rule);
  margin: var(--space-xl) 0;
}

footer .footer-legal .default-content-wrapper {
  margin: 0;
}

footer .footer-copyright {
  font-weight: var(--font-weight-regular);
  font-size: var(--footer-legal-size);
  color: var(--digicert-white);
  margin: 0 0 var(--space-s) 0;
}

footer .footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) 0;
}

footer .footer-legal-link {
  display: inline-flex;
  align-items: center;
}

footer .footer-legal-link::after {
  content: '|';
  margin: 0 var(--space-s);
  color: var(--digicert-medium-blue);
}

footer .footer-legal-link:last-child::after {
  content: none;
}

footer .footer-legal-link a {
  font-size: var(--footer-legal-size);
  color: var(--digicert-white);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}

/* ============================================
   HOVER STATES
   ============================================ */
footer .footer-links a:hover,
footer .footer-column a:hover {
  text-decoration: underline;
}

footer .footer-legal-link a:hover {
  text-decoration: underline;
}

/* ============================================
   TABLET (600px)
   ============================================ */
@media (width >= 600px) {
  footer .footer-content {
    padding-block: var(--space-4xl);
  }
}

/* ============================================
   DESKTOP (900px)
   Brand left, 4 columns right, legal bar full-width.
   ============================================ */
@media (width >= 900px) {
  footer .footer {
    --footer-link-size: clamp(var(--body-font-size-xs), 0.75rem + 0.2vw, var(--body-font-size-s));
  }

  footer .footer-content {
    display: grid;
    grid-template-columns: var(--footer-brand-column) 1fr;
    grid-template-areas:
      "brand columns"
      "legal legal";
    column-gap: var(--space-4xl);
    align-items: start;
    padding-block: var(--space-5xl);
  }

  footer .footer-brand {
    grid-area: brand;
    margin-bottom: 0;
  }

  footer .footer-columns {
    grid-area: columns;
  }

  footer .footer-legal {
    grid-area: legal;
  }

  /* Columns: grid instead of accordion */
  footer .footer-columns-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-xl);
    margin-bottom: 0;
  }

  footer .footer-column {
    border-bottom: none;
  }

  footer .footer-column-heading {
    font-family: var(--heading-font-family);
    font-weight: var(--font-weight-bold);
    font-size: var(--footer-heading-size);
    margin: 0 0 var(--space-l) 0;
  }

  /* Accordion disabled: button unwrapped visually, tabindex managed by JS */
  footer .footer-column-toggle {
    display: contents;
  }

  footer .footer-chevron {
    display: none;
  }

  footer .footer-links-animate {
    grid-template-rows: 1fr;
  }

  footer .footer-links {
    overflow: visible;
    padding-bottom: 0;
  }

  /* Legal bar: copyright left, links right */
  footer .footer-divider {
    display: block;
    margin: var(--space-3xl) 0 var(--space-xl);
  }

  footer .footer-legal .default-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-m);
  }

  footer .footer-copyright {
    margin: 0;
  }

  footer .footer-legal-links {
    justify-content: flex-end;
  }
}
