/* Wisploft — site chrome.
 *
 * The header and the mobile tab bar, in one file because they are the one
 * thing every page shares. They used to live in landing.css, which meant the
 * landing page was the only page in the product with a brand mark, a way home
 * or a navigation bar: tapping "FAQ" in the tab bar opened a page with no tab
 * bar on it.
 *
 * Loaded by home.blade.php next to landing.css and by layouts/app.blade.php
 * next to app.css. The two stylesheets name their tokens differently but
 * resolve to the same palette, so the colours here are written out rather than
 * referenced — this file has to look identical on both sides.
 */

:root {
  --chrome-paper: #FAF8F5;
  --chrome-ink: #191714;
  --chrome-ink-soft: #57534B;
  --chrome-accent: #1F4D7A;
  --chrome-edge: rgba(25, 23, 20, .12);
  --chrome-edge-soft: rgba(25, 23, 20, .07);
}

/* ============================================================ topbar === */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem var(--gutter, 1.25rem);
  background: rgba(250, 248, 245, .86);
  border-bottom: 1px solid var(--chrome-edge-soft);
  backdrop-filter: blur(14px);
}
.topbar__brand {
  color: var(--chrome-ink);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0;
}
.topbar__nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .45rem .9rem;
}
.topbar__links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: .15rem .85rem;
}
.topbar__links a {
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  color: var(--chrome-ink-soft);
  font-size: .9rem;
  text-decoration: none;
}
.topbar__links a:hover { color: var(--chrome-accent); }
.topbar__links a[aria-current="page"] {
  color: var(--chrome-ink);
  font-weight: 500;
}
.topbar__cta {
  color: var(--chrome-ink) !important;
  font-weight: 600;
}
.language-switch {
  display: inline-flex;
  align-items: center;
}
.language-switch__link {
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .1rem .65rem;
  border: 1px solid var(--chrome-edge);
  border-radius: 999px;
  color: var(--chrome-ink);
  text-decoration: none;
  background: rgba(255, 255, 255, .5);
}
.language-switch__link:hover {
  border-color: var(--chrome-accent);
  color: var(--chrome-accent);
}
.language-switch__flag { font-size: 1rem; line-height: 1; }
.language-switch__text { font-size: .86rem; font-weight: 600; }

.topbar--compact .topbar__nav { justify-content: flex-end; }

/* ========================================================== back link === */

/* Not in the bar. The bar is about the site and is the same on every page;
   this is about the page you are on, so it sits at the top of the body where
   a breadcrumb would, aligned with the heading it precedes.

   `.shell` is a flex column, hence align-self rather than a float. The
   negative margin pulls it against its own heading instead of sitting a full
   1.4rem gap away from it, which read as a stray button. */
.pageback {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  min-height: 2.5rem;
  margin-block-end: -.7rem;
  padding: .3rem .85rem .3rem .6rem;
  border: 1px solid var(--chrome-edge);
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  color: var(--chrome-ink-soft);
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  transition: color .18s ease, border-color .18s ease;
}
.pageback:hover,
.pageback:focus-visible {
  color: var(--chrome-accent);
  border-color: var(--chrome-accent);
}
.pageback__icon {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}

.mobile-tabbar {
  display: none;
}

@media (max-width: 40rem) {
  /* Only the pages that actually carry the bar reserve room for it — the
     focused pages (manage, save-your-link) render the brand and no bar. */
  body:has(.mobile-tabbar) {
    padding-bottom: calc(5.3rem + env(safe-area-inset-bottom));
  }
  html {
    scroll-padding-top: 4.25rem;
  }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .55rem;
    padding-block: .68rem;
    border-bottom: 1px solid rgba(25,23,20,.065);
    box-shadow: 0 8px 26px -24px rgba(25,23,20,.6);
  }
  .topbar__brand {
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    font-size: 1.05rem;
  }
  .topbar__nav {
    justify-content: flex-end;
  }
  .topbar__links {
    display: none;
  }
  .topbar__language {
    justify-content: flex-end;
  }
  .language-switch__link {
    min-height: 2rem;
    padding-inline: .58rem;
    background: rgba(255,255,255,.74);
    box-shadow: 0 12px 28px -24px rgba(25,23,20,.75);
  }
  .mobile-tabbar {
    position: fixed;
    z-index: 25;
    right: max(.75rem, env(safe-area-inset-right));
    bottom: max(.65rem, env(safe-area-inset-bottom));
    left: max(.75rem, env(safe-area-inset-left));
    display: grid;
    /* The primary label is the longest in both languages ("Make your list",
       "Maak je lijst"), so it gets more than a fifth — but not so much that it
       starves "Voorbeelden" in the cell beside it. */
    grid-template-columns: 1.22fr repeat(4, minmax(0, 1fr));
    gap: .22rem;
    padding: .36rem;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 1.6rem;
    background:
      linear-gradient(180deg, rgba(50,48,44,.94), rgba(23,22,20,.94)),
      #1D1D1F;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.12),
      0 1px 2px rgba(0,0,0,.18),
      0 24px 74px -34px rgba(0,0,0,.82);
    backdrop-filter: blur(24px) saturate(1.25);
  }
  .mobile-tabbar__item {
    min-width: 0;
    min-height: 3.45rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .18rem;
    border-radius: 1.15rem;
    color: rgba(255,255,255,.68);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background .18s cubic-bezier(.22,.61,.36,1), color .18s cubic-bezier(.22,.61,.36,1), transform .18s cubic-bezier(.22,.61,.36,1);
  }
  .mobile-tabbar__item:hover,
  .mobile-tabbar__item:focus-visible {
    color: #fff;
    background: rgba(255,255,255,.08);
  }
  /* Now that the bar follows you off the landing page, it has a page to be on. */
  .mobile-tabbar__item[aria-current="page"] {
    color: #fff;
    background: rgba(255,255,255,.13);
  }
  .mobile-tabbar__item span {
    display: grid;
    place-items: center;
    width: 1.3rem;
    height: 1.3rem;
    font-size: 1rem;
    line-height: 1;
  }
  .mobile-tabbar__item small {
    max-width: 100%;
    overflow: hidden;
    padding-inline: .1rem;
    /* Fluid rather than stepped. A breakpoint at 376px left 377–414 on the
       old size, which is where most iPhones are — and "Voorbeelden", the
       longest label in the first market's language, clipped across that whole
       band. */
    font-size: clamp(.55rem, 2.4vw, .66rem);
    font-weight: 650;
    line-height: 1;
    letter-spacing: -.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .mobile-tabbar__item--primary {
    background:
      linear-gradient(180deg, #FFFDF8, #E8DDC9);
    color: #191714;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.74),
      0 16px 36px -24px rgba(0,0,0,.95);
  }
  .mobile-tabbar__item--primary:hover,
  .mobile-tabbar__item--primary:focus-visible {
    color: #191714;
    background: linear-gradient(180deg, #FFFFFF, #EDE2CF);
  }
  .mobile-tabbar__icon { width: 1.15rem; height: 1.15rem; display: block; }
}

/* 360px is still a very common Android width. Below that the five labels only
   fit if they give up a little tracking. */
/* The narrow end: 320px is an iPhone SE and 360px half the Android world.
   Below this the bar also gives up its gaps and its tracking. */
@media (max-width: 23.5rem) {
  .mobile-tabbar { gap: .16rem; padding: .32rem; }
  .mobile-tabbar__item small { letter-spacing: -.03em; padding-inline: 0; }
  .mobile-tabbar { grid-template-columns: 1.08fr repeat(4, minmax(0, 1fr)); }
}