/*
 * Site footer (template-parts/site-footer.php), as in the Footer wireframe: darkest teal, with the logo and
 * tagline, the Plans and Company menus and "Get in touch" in columns, then a bottom line with the legal text.
 * It runs the full width of the window, with the same gutters as the header: 48px, 24px on tablets, 16px on phones.
 */

/* The footer band */

.site-footer {
  --site-footer-gutter: 48px;

  background: #0d3d39;
  color: #f4f3ee;
  font-size: 15px;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 40px;
  padding: 56px var(--site-footer-gutter) 32px;
}

.site-footer a {
  color: #f4f3ee;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
}

/* Logo, or the site name when there's no footer logo, with the tagline below */

.site-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.site-footer__logo {
  display: block;
  width: 200px;
  height: auto;
}

.site-footer__site-name {
  font-size: 1.25rem;
  font-weight: 800;
}

.site-footer__tagline {
  margin: 0;
  color: var(--teal-light);
  line-height: 1.5;
}

/* Link columns and "Get in touch" */

.site-footer__column {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer__heading {
  margin: 0;
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__contact-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* The icons ship dark; this filter turns them the footer's cream */

.site-footer__icon {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  filter: brightness(0) invert(96%) sepia(6%) saturate(250%) hue-rotate(10deg);
}

.site-footer__socials {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.site-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--teal-dark);
  border-radius: 50%;
  transition: border-color 0.2s ease;
}

.site-footer__social-link:hover,
.site-footer__social-link:focus-visible {
  border-color: var(--teal);
}

.site-footer__social-link .site-footer__icon {
  width: 20px;
  height: 20px;
}

.site-footer__address {
  margin: 0;
  color: var(--teal-light);
}

/* Booking button, in light teal on the dark footer */

.site-footer a.site-footer__button {
  align-self: flex-start;
  margin-top: 6px;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--teal);
  color: #0d3d39;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.site-footer a.site-footer__button:hover,
.site-footer a.site-footer__button:focus-visible {
  background: var(--teal-light);
}

/* Bottom line: the legal text, and the legal menu on the right */

.site-footer__bottom {
  border-top: 1px solid var(--teal-darker);
}

.site-footer__bottom-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding: 18px var(--site-footer-gutter);
  color: var(--teal-light);
  font-size: 13px;
}

.site-footer__legal {
  margin: 0;
}

.site-footer__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__legal-links a {
  color: var(--teal-light);
  text-decoration: underline;
}

/*
 * The developer's credit: a thin, darker strip across the bottom of the page under a fine red line. "Website by" and
 * the white Digidopt logo sit on the left. On the right, a question in Digidopt's Matcha Home font turns over like a
 * billboard panel, slowly so it never pulls the eye from the client's site, then "Check us out".
 */

@font-face {
  font-family: "Matcha Home";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/matcha-home/matcha-home.woff2") format("woff2");
}

.site-footer__credit {
  padding: 16px var(--site-footer-gutter);
  border-top: 1px solid rgba(208, 16, 28, 0.6);
  background: rgba(0, 0, 0, 0.18);
  font-size: 12px;
  line-height: 1.4;
}

.site-footer__credit-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  text-decoration: none;
}

a.site-footer__credit-link:hover,
a.site-footer__credit-link:focus-visible {
  text-decoration: none;
}

/* Left: "Website by" and the logo */

.site-footer__credit-by {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  color: var(--teal-light);
}

.site-footer__credit-logo {
  display: block;
  width: auto;
  height: 28px;
}

/* Right: the turning question, a fine divider, then "Check us out" and its arrow */

.site-footer__credit-offer {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-footer__credit-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 14px;
  border-left: 1px solid rgba(223, 245, 242, 0.25);
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
}

a.site-footer__credit-link:hover .site-footer__credit-cta-text,
a.site-footer__credit-link:focus-visible .site-footer__credit-cta-text {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer__credit-arrow {
  color: #ff4d57;
  transition: transform 0.2s ease;
}

a.site-footer__credit-link:hover .site-footer__credit-arrow,
a.site-footer__credit-link:focus-visible .site-footer__credit-arrow {
  transform: translateX(2px);
}

/*
 * The questions sit on top of each other in one line's space. Each turns over on its middle into view, stays up for
 * five seconds, then turns away as the next comes up: a 15 second round for the three. The negative delays start the
 * round with the first question already showing.
 */

.site-footer__credit-questions {
  position: relative;
  display: block;
  width: 14.5em;
  height: 16px;
  perspective: 300px;
  color: var(--teal-light);
  font-family: "Matcha Home", "Inter", sans-serif;
  font-size: 13px;
  line-height: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.site-footer__credit-questions > span {
  position: absolute;
  inset: 0;
  text-align: right;
  white-space: nowrap;
  backface-visibility: hidden;
  transform: rotateX(-90deg);
  transform-origin: 50% 50% -8px;
  animation: site-footer-credit-flip 15s cubic-bezier(0.55, 0, 0.35, 1) infinite both;
}

.site-footer__credit-questions > span.is-first {
  transform: none;
}

.site-footer__credit-questions > span:nth-child(1) {
  animation-delay: -0.9s;
}

.site-footer__credit-questions > span:nth-child(2) {
  animation-delay: 4.1s;
}

.site-footer__credit-questions > span:nth-child(3) {
  animation-delay: 9.1s;
}

/* 0.9 seconds to turn in, up until a third of the round, then 0.9 seconds to turn away */
@keyframes site-footer-credit-flip {
  0% {
    transform: rotateX(-90deg);
  }

  6% {
    transform: rotateX(0);
  }

  33.333% {
    transform: rotateX(0);
  }

  39.333% {
    transform: rotateX(90deg);
  }

  100% {
    transform: rotateX(90deg);
  }
}

/* With reduced motion the first question stays up and nothing turns */
@media (prefers-reduced-motion: reduce) {
  .site-footer__credit-questions > span {
    animation: none;
  }

  .site-footer__credit-arrow {
    transition: none;
  }

  a.site-footer__credit-link:hover .site-footer__credit-arrow,
  a.site-footer__credit-link:focus-visible .site-footer__credit-arrow {
    transform: none;
  }
}

/*
 * On a phone everything stacks down the middle: "Website by" and the logo, then the question, then "Check us out",
 * without the divider, so nothing sits off to one side.
 */
@media (max-width: 700px) {
  .site-footer__credit-link {
    flex-direction: column;
    justify-content: center;
    gap: 12px;
  }

  .site-footer__credit-offer {
    flex-direction: column;
    gap: 8px;
  }

  .site-footer__credit-questions > span {
    text-align: center;
  }

  .site-footer__credit-cta {
    padding-left: 0;
    border-left: 0;
  }
}

/* Phones */

@media (max-width: 980px) {
  .site-footer {
    --site-footer-gutter: 24px;
  }
}

@media (max-width: 700px) {
  .site-footer {
    --site-footer-gutter: 16px;
  }

  .site-footer__inner {
    gap: 32px;
    padding-top: 40px;
    padding-bottom: 24px;
  }
}

/* "Cookie settings" when it reopens the cookie banner: a button that looks like the links beside it */

.site-footer__cookie-settings {
  padding: 0;
  border: 0;
  background: none;
  color: var(--teal-light);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
