/* Base web footer - design refresh (purple-accented, tracked eyebrow titles, brand column) */

/* Rounded-top "shell" - the footer reads as a floating card rising from the
   bottom of the page rather than a flat strip, so the divider above it
   (previously ::before) is retired in favour of the shell's own top edge. */
.footer {
  margin-top: 104px;
  border-radius: 72px 72px 0 0;
  position: relative;
  overflow: visible;
  box-shadow: inset 0 1px 0 var(--footer-border);
}

.footer::before {
  display: none;
}

.footer-navigation {
  padding: 56px 0 26px;
  background: transparent;
  position: relative;
}

.footer-nav-container,
.footer-bottom-container {
  max-width: 1280px;
  /* !important: some projects (e.g. eduloo.ai) ship their own global reset
     with "margin: 0 !important" on nearly every element, which otherwise
     beats this centering rule regardless of specificity and leaves the
     footer content flush-left instead of centered. */
  margin: 0 auto !important;
  padding: 0 30px;
}

/* Grid adapts to however many groups the admin configures: the brand
   column gets a fixed minimum track, every other column splits the
   remaining width evenly via auto-fit. Keeps the layout balanced whether
   there are 2 groups or 6. Rendered as one elevated card rather than a
   flat row of columns. */
.footer-nav-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 32px 40px;
  align-items: flex-start;
  padding: 36px 36px;
  border-radius: 32px;
  background: var(--card-bg);
}

.footer-nav-grid > .footer-nav-section {
  flex: 1 1 0;
  min-width: 0;
}

.footer-nav-grid > .footer-brand-section {
  flex: 1.3 1 0;
}

@media (max-width: 900px) {
  .footer-nav-grid {
    display: grid;
  }
}

@media (max-width: 900px) {
  .footer-nav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 32px;
  }
}

@media (max-width: 560px) {
  .footer-nav-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer-nav-section {
    align-items: center;
    text-align: center;
  }

  .footer-nav-title {
    justify-content: center;
  }

  .footer-nav-links {
    align-items: center;
  }

  .footer-nav-section .footer-nav-links a,
  .footer-nav-section .footer-nav-links li.has-description a {
    justify-content: center;
    margin-left: 0;
  }

  .footer-brand-section {
    align-items: center;
  }

  .footer-brand {
    justify-content: center;
  }

  .footer-brand-tagline,
  .footer-rating {
    text-align: center;
  }

  .footer-socials {
    justify-content: center;
  }
}

.footer-nav-section {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: transparent;
}

/* Column heading: plain bold in the page font. The old treatment was a
   tracked, ALL-CAPS monospace eyebrow in muted grey, which read as a system
   label rather than a section title. */
/* Column heading. Needs a clear step up from the links below it - at the same
   weight and near the same size, the heading read as just another link. */
.footer-nav-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-transform: none;
  color: var(--heading-color);
  margin: 0 0 16px 0;
  padding: 0;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: inherit;
}

.footer-nav-title i {
  color: var(--primary-blue);
  font-size: 1em;
  width: 14px;
  text-align: center;
}

.footer-nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-nav-links li {
  margin: 0;
}

.footer-nav-links a {
  color: var(--muted-text);
  text-decoration: none;
  border-bottom: none;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  margin-left: -10px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.footer-nav-links a:hover {
  color: var(--primary-blue);
  border-bottom: none;
  background: color-mix(in srgb, var(--primary-blue) 12%, var(--card-bg));
  transform: translateX(2px);
}

.footer-nav-links a i {
  font-size: 0.9em;
  opacity: 0.8;
}

/* Two-line link variant - rendered when an optional description is set.
   Title goes bold (full heading color), description below in muted text. */
.footer-nav-links li.has-description {
  margin-bottom: 4px;
}

.footer-nav-links li.has-description a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.3;
  /* The single-line pill uses 6px/10px, which hugs a two-line block far too
     tightly - the hover background ends up almost touching the description. */
  padding: 10px 12px;
  margin-left: -12px;
  border-radius: 14px;
  text-align: left;
}

/* A wrapped description made the row taller than the pill was designed for. */
.footer-nav-links li.has-description a {
  min-height: 0;
}

.footer-nav-link-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.footer-nav-link-head i {
  font-size: 0.9em;
  color: var(--heading-color);
}

.footer-nav-link-title {
  color: var(--heading-color);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
}

.footer-nav-link-desc {
  color: var(--muted-text);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.35;
}

.footer-nav-links li.has-description a:hover .footer-nav-link-title {
  color: var(--link-hover);
}

/* Special "highlight" emphasis — text-only: the title goes bold in the
   warm accent color with a soft glow around the glyphs. No pill, border,
   or background box. This is the single source of truth for highlighted
   footer links across ALL projects, including ones with a fully custom
   footer (it also targets their `.sn-fhl` highlight class).

   Color is driven by `--footer-highlight-color` (default warm amber/gold,
   deliberately NOT blue); a project may override the variable to rebrand.
   The footer component registry injects this file whenever a highlighted
   link is present, so no per-project CSS is needed. */
.footer-nav-link-title--highlight,
.sn-fhl {
  --footer-highlight-color: #f5a623;
  color: var(--footer-highlight-color);
  font-weight: 700;
  text-shadow:
    0 0 6px color-mix(in srgb, var(--footer-highlight-color) 55%, transparent),
    0 0 14px color-mix(in srgb, var(--footer-highlight-color) 30%, transparent);
}

/* Keep the accent + glow on hover too (base hover rule would otherwise
   shift the color). */
.footer-nav-links li.has-description a:hover .footer-nav-link-title--highlight,
.sn-footer-full a:hover .sn-fhl {
  color: var(--footer-highlight-color);
}

/* Brand column - optional, driven by app.settings.app.* */
.footer-brand-section {
  gap: 16px;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--heading-color);
  text-decoration: none;
  border: none;
}

.footer-brand:hover {
  border-bottom: none;
}

/* Brand mark. Sized defensively: project favicons are often large squares
   (eduloo's is 512x512) and an SVG without intrinsic dimensions falls back to
   300x150, so `height` alone is not enough to guarantee containment. The
   second selector catches the case where the class is missing or a project
   override drops the height - the image still cannot blow out the row. */
.footer-brand-logo,
.footer-brand img {
  flex: 0 0 auto;
  height: 30px;
  width: auto;
  max-height: 30px;
  max-width: 140px;
  object-fit: contain;
  border-radius: 8px;
}

/* Not `inherit`: body's font became 'Be Vietnam Pro' when base adopted
   eduloo's typography, but a project's brand wordmark that never set its
   own display font (see brand.jinja2) should still render in the neutral
   system stack it always has, not silently pick up the new brand font. */
.footer-brand-name {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

.footer-brand-name .brand-tld {
  font-size: 0.72em;
  color: var(--primary-blue);
}

.footer-brand-tagline {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted-text);
  max-width: 34ch;
}

.footer-rating {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--card-bg);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
}

/* Partially-filled stars: the glyphs get color via background-clip: text,
   and the gradient hard-stops at --star-pct (set inline from the template)
   so a 4.6/5 rating cleanly fills the first 4 stars and ~60% of the 5th. */
.footer-stars {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 0.1em;
  background: linear-gradient(
    90deg,
    #f59e0b 0,
    #f59e0b var(--star-pct, 100%),
    color-mix(in srgb, var(--muted-text) 45%, transparent) var(--star-pct, 100%),
    color-mix(in srgb, var(--muted-text) 45%, transparent) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Trustpilot variant: the whole chip is the outbound link to the public
   profile, and the stars take Trustpilot green rather than the amber default. */
.footer-rating--trustpilot {
  color: var(--text);
  text-decoration: none;
  border: none;
  transition: opacity 0.2s ease;
}

.footer-rating--trustpilot:hover {
  opacity: 0.8;
  border: none;
}

.footer-rating--trustpilot .footer-stars {
  background: linear-gradient(
    90deg,
    #00b67a 0,
    #00b67a var(--star-pct, 100%),
    color-mix(in srgb, var(--muted-text) 45%, transparent) var(--star-pct, 100%),
    color-mix(in srgb, var(--muted-text) 45%, transparent) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
}

.footer-rating-logo {
  height: 21px;
  width: auto;
  display: block;
}

.footer-rating-value {
  color: var(--text);
}

.footer-rating-count {
  color: var(--muted-text);
  font-weight: 500;
}

/* -- Social icons (rendered beneath the rating chip in the brand column
   when the admin marks a FooterExtraLink group as is_social_group).
   Clean surface at rest, subtle hover shift in line with the rest of
   the footer link styling. -- */
.footer-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--muted-text) 10%, transparent);
  color: var(--muted-text);
  border: 0;
  text-decoration: none;
  font-size: 17px;
  line-height: 1;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.footer-social:hover {
  color: var(--primary-blue);
  background: color-mix(in srgb, var(--primary-blue) 14%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px -6px
    color-mix(in srgb, var(--primary-blue) 28%, transparent);
}

.footer-social:active {
  transform: translateY(0);
  transition-duration: 0.08s;
  box-shadow: none;
}

body.theme-dark .footer-social:hover {
  background: color-mix(in srgb, var(--primary-blue) 22%, transparent);
}

.footer-social:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

body.theme-dark .footer-social {
  background: color-mix(in srgb, var(--muted-text) 16%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .footer-social {
    transition: none;
  }
  .footer-social:hover {
    transform: none;
  }
}

/* Bottom bar */
.footer-bottom {
  padding: 0 0 26px;
  background: transparent;
}

/* When a project has nothing configured for the nav section (no link
   groups, no blog recs, no rating, no tagline), `.footer-navigation` is
   skipped entirely by the template and this bar becomes the first thing
   inside the rounded-top shell - with no top padding it sat flush against
   the shell's top edge/divider. Scoped to :first-child so the normal case
   (nav section present) keeps its original, smaller gap. */
.footer > .footer-bottom:first-child {
  padding-top: 40px;
}

/* Dev-only build strip (branch / hash / last commit). Hidden on live. */
.footer-dev-build {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 8px 32px;
  background: var(--footer-bottom-bg);
  border-top: 1px solid var(--footer-border);
}

/* Stacked build rows (project + startup) share one divider. */
.footer-dev-build + .footer-dev-build {
  border-top: none;
  padding-top: 0;
}

.footer-dev-build-item {
  font-size: 0.72em;
  color: var(--muted-text);
  opacity: 0.75;
  white-space: nowrap;
}

.footer-dev-build-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.55;
}

.footer-dev-build-item i {
  margin-right: 3px;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 18px;
  padding: 18px 22px;
  border-radius: 24px;
  background: var(--footer-bottom-bg);
  border: 1px solid var(--footer-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.footer-copyright {
  margin: 0;
  color: var(--muted-text);
  font-size: 13px;
}

.footer-made-in-europe {
  margin: 0;
  color: var(--muted-text);
  font-size: 13px;
}

.footer-red-heart {
  color: #e74c3c;
}

.footer-copyright-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-credit-inline {
  margin: 0;
  color: var(--muted-text);
  font-size: 13px;
  opacity: 0.8;
}

.footer-credit-inline a {
  color: var(--primary-blue);
  text-decoration: none;
  border-bottom: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-credit-inline a:hover {
  color: var(--link-hover);
  border-bottom: none;
}

@media (max-width: 750px) {
  .footer {
    margin-top: 76px;
    border-radius: 46px 46px 0 0;
  }

  .footer-navigation {
    padding: 44px 0 22px;
  }

  .footer-nav-container,
  .footer-bottom-container {
    padding: 0 18px;
  }

  .footer-nav-grid {
    padding: 24px 20px;
    border-radius: 24px;
  }

  .footer-nav-section {
    padding: 0;
  }

  .footer-bottom {
    padding: 0 0 16px;
  }

  .footer-bottom-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 16px 14px;
    border-radius: 20px;
  }

  .footer-copyright,
  .footer-credit-inline,
  .footer-made-in-europe {
    text-align: center;
    width: 100%;
  }
}

/* ==================================================================
   Footer blog menu — link with hover-popup of recent posts. Lives as
   a single item inside any footer-nav-section column (created via the
   admin FooterExtraLink editor with link_type = "blog_menu").
   ================================================================== */

.footer-blog-menu-item {
  position: relative;
}

.footer-nav-links a.footer-blog-menu-link,
.footer-blog-menu-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

.footer-blog-menu-chevron {
  font-size: 0.7em;
  transition:
    transform 0.25s ease,
    color 0.18s ease;
  opacity: 0.65;
  transform-origin: center;
}

.footer-blog-menu-item:hover .footer-blog-menu-chevron,
.footer-blog-menu-item:focus-within .footer-blog-menu-chevron {
  transform: rotate(180deg);
  opacity: 1;
  color: var(--primary-blue, #fb596e);
}

/* Hover-bridge: a transparent strip below the popup so the cursor can
   travel from the link UP into the popup without crossing a dead zone
   that would close it. The strip is part of the popup's hit area so
   the parent :hover state stays active. */
.footer-blog-menu-popup::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 16px;
}

.footer-blog-menu-popup--below::before {
  top: auto;
  bottom: 100%;
}

.footer-blog-menu-popup {
  position: absolute;
  left: 0;
  bottom: calc(100% + 12px);
  z-index: 50;
  width: min(420px, 90vw);
  padding: 12px;
  display: grid;
  gap: 8px;
  background: var(--container-bg, #ffffff);
  border: 1px solid var(--border-color, rgba(15, 20, 25, 0.08));
  border-radius: 16px;
  box-shadow:
    0 24px 60px -16px rgba(15, 20, 25, 0.28),
    0 4px 12px rgba(15, 20, 25, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0s linear 0.18s;
}

.footer-blog-menu-popup--below {
  bottom: auto;
  top: calc(100% + 12px);
  transform: translateY(-6px);
}

body.theme-dark .footer-blog-menu-popup {
  background: var(--container-bg, #1d1d22);
}

.footer-blog-menu-item:hover .footer-blog-menu-popup,
.footer-blog-menu-item:focus-within .footer-blog-menu-popup {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0s linear 0s;
}

/* The blog-menu popup is a desktop hover/preview affordance. On mobile (no
   hover) it can't open, and as an absolutely-positioned 90vw box it overflows
   the viewport even while closed — causing horizontal page scroll. Hide it on
   small screens; the "Blog" link still navigates to the blog index. */
@media (max-width: 750px) {
  .footer-blog-menu-popup {
    display: none !important;
  }
}

.footer-nav-links a.footer-blog-menu-popup-item,
.footer-blog-menu-popup-item {
  display: grid !important;
  grid-template-columns: 64px 1fr !important;
  gap: 12px !important;
  align-items: start !important;
  padding: 8px !important;
  min-height: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  text-decoration: none !important;
  color: inherit !important;
  white-space: normal !important;
  transition:
    background 0.22s ease,
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.22s ease,
    color 0.22s ease !important;
}

.footer-nav-links a.footer-blog-menu-popup-item:hover,
.footer-nav-links a.footer-blog-menu-popup-item:focus-visible,
.footer-blog-menu-popup-item:hover,
.footer-blog-menu-popup-item:focus-visible {
  background: color-mix(
    in srgb,
    var(--primary-blue, #fb596e) 8%,
    transparent
  ) !important;
  transform: translateX(3px) !important;
  box-shadow: 0 6px 14px -8px
    color-mix(in srgb, var(--primary-blue, #fb596e) 30%, transparent) !important;
  outline: none !important;
  color: inherit !important;
}

.footer-blog-menu-popup-thumb-wrap {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
}

.footer-blog-menu-popup-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.footer-blog-menu-popup-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary-blue, #fb596e) 18%, transparent);
  color: var(--primary-blue, #fb596e);
  font-size: 20px;
}

.footer-blog-menu-popup-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.footer-blog-menu-popup-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--heading-color, #111);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.footer-blog-menu-popup-excerpt {
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted-text, #6b7280);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 720px) {
  .footer-blog-menu-popup {
    /* Drop the popup ABOVE the link still, but stretch full-width and
       align left edge to the link so it stays inside the viewport. */
    left: 0;
    right: auto;
    width: calc(100vw - 32px);
    max-width: 360px;
  }
}
