/* ==========================================================================
   Room for Hebrew – site footer (same on every page)

   Structure: the brand (logo, title, slogan and social links) on the left,
   two link lists on the right, then a bottom row with the copyright and the
   dark mode switch. On mobile everything is centred: the brand on top, the two
   link lists side by side when they fit (otherwise stacked). The bottom row
   (copyright left, dark mode switch right) is the same on every screen.

   The same dark blue in both themes. Every link and text keeps at least 9:1
   contrast against it.
   ========================================================================== */

.site-footer {
  color: var(--white);
  background-color: var(--night);
  border-top: 4px solid var(--sky);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  padding: var(--space-2xl) var(--page-inline-padding) var(--space-xl);
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2xl);
  text-align: center;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-basis: 100%;
  gap: var(--space-m);
}

.site-footer__slogan {
  color: var(--color-on-dark-muted);
}

.site-footer__heading {
  margin-bottom: var(--space-s);
  font-family: var(--font-body);
  font-size: var(--font-size-label);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky);
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: 0;
  margin: 0;
  list-style: none;
}

.site-footer__links a,
.site-footer__links button {
  display: inline-block;
  padding-block: 0.125rem;
  font: inherit;
  font-size: var(--font-size-footer-link);
  color: var(--color-on-dark-muted);
  text-decoration: none;
}

/* The "Cookie settings" button (js/cookies.js shows it) looks like the links around it */
.site-footer__links button {
  padding-inline: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.site-footer__links a:hover,
.site-footer__links button:hover {
  color: var(--white);
  text-decoration: underline;
}

/* Social buttons: round, outlined */
.social {
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0;
  margin: 0;
  list-style: none;
}

.social a {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  color: var(--white);
  border: 2px solid rgb(255 255 255 / 0.35);
  border-radius: 50%;
}

.social .icon {
  width: 1.375rem;
  height: 1.375rem;
}

@media (hover: hover) {
  .social a:hover {
    color: var(--night);
    background-color: var(--sun);
    border-color: var(--sun);
  }
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
  padding-top: var(--space-l);
  font-size: var(--font-size-footer-link);
  color: var(--color-on-dark-muted);
  border-top: 1px solid rgb(255 255 255 / 0.12);
}

@media (min-width: 40em) {
  .site-footer__top {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    align-items: start;
    text-align: start;
  }

  .site-footer__brand {
    align-items: flex-start;
    max-width: 22rem;
  }

  .site-footer__links {
    align-items: flex-start;
  }

  .social {
    justify-content: flex-start;
  }
}

/* --------------------------------------------------------------------------
   Dark mode switch (in the bottom row; behaviour in js/theme.js)
   A small pill with a sun on the left and a moon on the right. A white disc
   sits behind the icon of the current theme, so the state shows by position
   and shape, not by colour alone.
   -------------------------------------------------------------------------- */
.theme-toggle {
  --toggle-option-size: 1.75rem;

  position: relative;
  display: flex;
  padding: 2px;
  color: var(--color-on-dark-muted);    /* Icons not in use, and the outline */
  background: none;
  border: var(--divider-width) solid currentColor;
  border-radius: var(--toggle-option-size);
  cursor: pointer;
}

/* Hidden until js/theme.js has set it up (it does nothing without JavaScript) */
.theme-toggle[hidden] {
  display: none;
}

/* The white disc behind the current theme's icon */
.theme-toggle::before {
  content: "";
  position: absolute;
  inset-block: 2px;
  inset-inline-start: 2px;
  width: var(--toggle-option-size);
  background-color: var(--white);
  border-radius: 50%;
}

.theme-toggle[aria-pressed="true"]::before {
  transform: translateX(100%);
}

.theme-toggle__option {
  position: relative;                   /* above the disc */
  display: grid;
  place-items: center;
  width: var(--toggle-option-size);
  height: var(--toggle-option-size);
}

.theme-toggle__option .icon {
  width: 1rem;
  height: 1rem;
}

/* The current theme's icon, on the white disc */
.theme-toggle[aria-pressed="false"] .theme-toggle__option--light,
.theme-toggle[aria-pressed="true"] .theme-toggle__option--dark {
  color: var(--navy);
}

@media (prefers-reduced-motion: no-preference) {
  .theme-toggle::before {
    transition: transform var(--duration-base) ease;
  }
}
