/**
 * Little Astronomy -- site footer
 *
 * 1. Sticky-footer fix: on short pages (404s, thin archives, tool pages) the
 *    footer used to stop wherever the content ended. .main-wrap is the only
 *    element wrapping header + content + footer, so it becomes the flex column
 *    that holds the page to the viewport height.
 * 2. The SEO footer itself (markup: partials/footer/layout-classic.php).
 */

/* ---------------------------------------------------------------------------
 * 1. Sticky footer
 * ------------------------------------------------------------------------ */

html {
  height: 100%;
}

.main-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Small-viewport unit: keeps the footer on the fold on mobile, where 100vh is
   taller than the visible area while the browser chrome is showing. */
@supports (min-height: 100svh) {
  .main-wrap {
    min-height: 100svh;
  }
}

.main-wrap > .main {
  flex: 1 0 auto;
}

.main-wrap > .main-footer {
  flex: 0 0 auto;
  margin-top: auto;
}

/* ---------------------------------------------------------------------------
 * 2. Footer
 * ------------------------------------------------------------------------ */

.la-footer {
  --laf-bg: #060a16;
  --laf-line: rgba(255, 255, 255, 0.1);
  --laf-text: #a7b0c6;
  --laf-muted: #7b8499;
  --laf-link: #dbe2f2;
  --laf-accent: #7b9cff;
}

.main-footer.dark.la-footer {
  background: var(--laf-bg);
  color: var(--laf-text);
  border-top: 1px solid rgba(123, 156, 255, 0.28);
}

/* Night-sky glow, painted on the theme's existing overlay element. */
.la-footer .bg-wrap:before {
  background-image:
    radial-gradient(1100px 360px at 50% -140px, rgba(123, 156, 255, 0.18), transparent 70%),
    linear-gradient(180deg, #0b1226 0%, var(--laf-bg) 58%);
  background-repeat: no-repeat;
}

.la-footer .upper-footer {
  padding-top: 56px;
  padding-bottom: 40px;
}

/* Brand + search ---------------------------------------------------------- */

.la-foot__top {
  display: flex;
  flex-wrap: wrap;
  gap: 28px 40px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 32px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--laf-line);
}

.la-foot__brand {
  flex: 1 1 420px;
  max-width: 600px;
}

.main-footer.dark.la-footer .la-foot__logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  letter-spacing: -0.01em;
}

.main-footer.dark.la-footer .la-foot__logo:hover {
  color: #fff;
}

/* Crescent moon in the logo's yellow. Masked rather than overlaid so it sits on
   the footer gradient without carrying a background colour of its own. */
.la-foot__logo-mark {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffd24a;
  flex: 0 0 auto;
  -webkit-mask-image: radial-gradient(circle 15px at 140% 18%, transparent 99%, #000 100%);
  mask-image: radial-gradient(circle 15px at 140% 18%, transparent 99%, #000 100%);
}

.la-foot__about {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--laf-text);
  max-width: 62ch;
}

.la-foot__search {
  display: flex;
  gap: 8px;
  flex: 0 1 360px;
  width: 100%;
  max-width: 360px;
}

.la-foot__search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--laf-line);
  border-radius: 8px;
  -webkit-appearance: none;
  appearance: none;
}

.la-foot__search input[type="search"]::placeholder {
  color: #798299;
}

.la-foot__search input[type="search"]:focus {
  outline: none;
  border-color: var(--laf-accent);
  box-shadow: 0 0 0 3px rgba(123, 156, 255, 0.22);
}

.la-foot__search button {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(180deg, #4d6dfb, #2d53fe);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.la-foot__search button:hover {
  filter: brightness(1.12);
}

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

.la-foot__cols {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 30px 24px;
}

.main-footer.dark.la-footer .la-foot__col h3,
.main-footer.dark.la-footer .la-foot__latest h3 {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #fff;
}

.la-foot__col ul,
.la-foot__latest ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.la-foot__col li {
  margin: 0;
}

.main-footer.dark.la-footer .la-foot__col a {
  display: inline-block;
  padding: 5px 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--laf-link);
  transition: color 0.15s ease;
}

.main-footer.dark.la-footer .la-foot__col a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--laf-accent);
}

/* Latest posts ------------------------------------------------------------ */

.la-foot__latest {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--laf-line);
}

.la-foot__latest ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.main-footer.dark.la-footer .la-foot__latest a {
  display: inline-block;
  padding: 7px 14px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--laf-link);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--laf-line);
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.main-footer.dark.la-footer .la-foot__latest a:hover {
  color: #fff;
  background: rgba(123, 156, 255, 0.16);
  border-color: rgba(123, 156, 255, 0.55);
}

/* Legal bar --------------------------------------------------------------- */

/* The theme zeroes this wrap's side padding with a shorthand, which is fine at
   1170px fixed width but runs the legal bar into the screen edge once .wrap
   goes fluid. Side padding is restored at the theme's own breakpoints. */
.main-footer.dark.la-footer .lower-footer > .wrap {
  padding: 24px 0 30px;
  text-align: left;
  border-top: 1px solid var(--laf-line);
}

@media (max-width: 1200px) {
  .main-footer.dark.la-footer .lower-footer > .wrap {
    padding-left: 35px;
    padding-right: 35px;
  }
}

@media (max-width: 540px) {
  .main-footer.dark.la-footer .lower-footer > .wrap {
    padding-left: 22px;
    padding-right: 22px;
  }
}

@media (max-width: 350px) {
  .main-footer.dark.la-footer .lower-footer > .wrap {
    padding-left: 15px;
    padding-right: 15px;
  }
}

.main-footer.dark.la-footer .lower-footer .bottom {
  display: flex;
  gap: 20px 32px;
  align-items: flex-start;
  justify-content: space-between;
}

/* The theme's .cf clearfix pseudo-elements would otherwise count as flex items
   and eat the space-between distribution. */
.main-footer.dark.la-footer .lower-footer .bottom:before,
.main-footer.dark.la-footer .lower-footer .bottom:after {
  display: none;
}

.main-footer.dark.la-footer .la-foot__legal {
  flex: 1 1 auto;
}

.main-footer.dark.la-footer .copyright {
  float: none;
  width: auto;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: #c4cbdd;
}

.la-foot__legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.main-footer.dark.la-footer .la-foot__legal-links a {
  font-size: 13px;
  color: var(--laf-link);
}

.main-footer.dark.la-footer .la-foot__legal-links a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.la-foot__disclosure {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--laf-muted);
  max-width: 88ch;
}

.main-footer.dark.la-footer .to-top {
  float: none;
  flex: 0 0 auto;
}

.main-footer.dark.la-footer .back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  font-size: 12px;
  color: #c4cbdd;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--laf-line);
  border-radius: 999px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.main-footer.dark.la-footer .back-to-top:hover {
  color: #fff;
  background: rgba(123, 156, 255, 0.16);
  border-color: rgba(123, 156, 255, 0.55);
}

.main-footer.dark.la-footer .back-to-top i {
  font-size: 13px;
  color: inherit;
}

/* Accessibility ----------------------------------------------------------- */

.la-footer .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.la-footer a:focus-visible,
.la-foot__search button:focus-visible {
  outline: 2px solid var(--laf-accent);
  outline-offset: 3px;
  border-radius: 3px;
}

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

@media (max-width: 1100px) {
  .la-foot__cols {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* The theme centres the copyright below 940px; keep the legal block aligned
   with the link columns instead. */
@media (max-width: 940px) {
  .main-footer.dark.la-footer .lower-footer .copyright {
    text-align: left;
  }
}

@media (max-width: 767px) {
  .la-footer .upper-footer {
    padding-top: 40px;
    padding-bottom: 30px;
  }

  .la-foot__top {
    gap: 22px;
    padding-bottom: 26px;
    margin-bottom: 28px;
  }

  .la-foot__search {
    flex: 1 1 100%;
    max-width: none;
  }

  .la-foot__cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 20px;
  }

  .main-footer.dark.la-footer .la-foot__col a {
    font-size: 13.5px;
  }

  .la-foot__latest {
    margin-top: 28px;
    padding-top: 24px;
  }

  .main-footer.dark.la-footer .lower-footer .bottom {
    flex-direction: column;
    align-items: stretch;
  }

  .main-footer.dark.la-footer .to-top {
    align-self: flex-start;
  }
}
