/* ── Nav / Footer / Flash ─────────────────────────────────────────────── */
/* Vanilla replacement for Tailwind utilities in layout.html + base.html  */

:root {
  --nav-dropdown-hover-bg: #f4f7f9;
}

/* ── Utilities ─────────────────────────────────────────────────────────── */

.hidden { display: none !important; }

/* ── Navbar shell — floating pill → full-width sticky bar ────────────── */
/* At rest: centered floating pill with shadow + margin.                  */
/* When scrolled past threshold (.pinned): morphs into full-width frosted  */
/* bar flush to top. Smooth transitions on width, radius, padding, etc.    */

.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 18px 24px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background-color: transparent;
  transition: padding 0.38s cubic-bezier(0.2, 0.7, 0.2, 1),
              background-color 0.3s ease,
              box-shadow 0.3s ease;
}

.nav-bar.pinned {
  padding: 0;
  background-color: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 1px 0 rgba(12, 12, 16, 0.06),
              0 8px 24px -12px rgba(12, 12, 16, 0.1);
}

.nav-inner {
  width: min(960px, 100%);
  max-width: 100%;
  margin: 0;
  padding: 0 18px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(12, 12, 16, 0.08);
  border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(12, 12, 16, 0.18),
              0 4px 12px -4px rgba(12, 12, 16, 0.08);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  transition: width 0.42s cubic-bezier(0.2, 0.7, 0.2, 1),
              max-width 0.42s cubic-bezier(0.2, 0.7, 0.2, 1),
              border-radius 0.38s cubic-bezier(0.2, 0.7, 0.2, 1),
              padding 0.34s cubic-bezier(0.2, 0.7, 0.2, 1),
              height 0.38s cubic-bezier(0.2, 0.7, 0.2, 1),
              box-shadow 0.3s ease,
              background-color 0.3s ease,
              border-color 0.3s ease;
}

.nav-bar.pinned .nav-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-bottom: 1px solid rgba(12, 12, 16, 0.08);
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Brand mark shrinks subtly on pin */
.nav-logo img {
  transition: transform 0.3s ease;
}
.nav-bar.pinned .nav-logo img {
  transform: scale(0.96);
}

/* Scroll progress rail — sits under the pinned bar */
.nav-rail {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}
.nav-rail-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary, #c73737), #7c3aed);
  transition: width 0.12s linear, opacity 0.3s ease;
  opacity: 0;
}
.nav-bar.pinned .nav-rail-fill {
  opacity: 1;
}

/* ── Logo ──────────────────────────────────────────────────────────────── */

.nav-logo {
  display: flex;
  align-items: center;
  padding-left: 6px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.nav-logo:hover { color: var(--color-text); }

.nav-logo img {
  height: 26px;
  width: auto;
  max-width: none;
}

/* ── Hamburger ─────────────────────────────────────────────────────────── */

.nav-hamburger {
  display: none;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-hamburger svg {
  width: 20px;
  height: 20px;
}

/* ── Desktop menu ──────────────────────────────────────────────────────── */

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* ── Nav links ─────────────────────────────────────────────────────────── */

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.nav-link:hover { color: var(--color-text); }

/* ── Login button ──────────────────────────────────────────────────────── */

.nav-login-btn {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-inverse);
  background: var(--color-primary);
  padding: 10px 20px;
  border-radius: 9999px;
  transition: background 0.15s;
}

.nav-login-btn:hover {
  background: #a82f2f;
  color: var(--color-text-inverse);
}

/* ── Dropdown ──────────────────────────────────────────────────────────── */

.nav-dropdown-wrap { position: relative; }

.nav-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: color 0.15s;
}

.nav-dropdown-btn:hover { color: var(--color-text); }

.nav-dropdown-btn svg {
  width: 14px;
  height: 14px;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  margin-top: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  min-width: 208px;
  padding: 8px 0;
  z-index: 50;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s, background 0.15s;
}

.dropdown-menu a:hover {
  color: var(--color-text);
  background: var(--nav-dropdown-hover-bg);
}

/* ── Tools two-pane dropdown ─────────────────────────────────────────── */
/* Block: .tools-panel  Elements: .tools-rail, .tools-pane, .tools-row    */

.tools-panel {
  --tp-line: rgba(20, 16, 12, 0.08);
  --tp-line-2: #f4f7f9;
  --tp-ink: #1a1614;
  --tp-ink-2: #4a4540;
  --tp-ink-3: #8a857f;
  --tp-rail-bg: #f4f7f9;
  --tp-row-hover-border: #dbe7f0;
  --tp-accent: var(--color-primary);
  --tp-accent-soft: #fbe9e3;

  /* Override default .dropdown-menu list styling. */
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 12px;
  padding: 0;
  width: 720px;
  max-width: calc(100vw - 32px);
  min-height: 360px;
  list-style: none;
  border: 1px solid var(--tp-line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 2px 4px rgba(20, 16, 12, 0.05),
    0 24px 60px rgba(20, 16, 12, 0.16);
  display: grid;
  grid-template-columns: 220px 1fr;
  animation: tools-panel-in 0.14s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes tools-panel-in {
  from { opacity: 0; transform: translate(-50%, -4px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* LEFT — categories rail */
.tools-rail {
  background: var(--tp-rail-bg);
  border-right: 1px solid var(--tp-line-2);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
}

.tools-rail-head {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.7px;
  color: var(--tp-ink-3);
  text-transform: uppercase;
  padding: 6px 10px 8px;
}

.tools-cats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tools-cat {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--tp-ink-2);
  transition: background 0.12s, box-shadow 0.12s, color 0.12s;
}

.tools-cat-icon {
  display: inline-flex;
  color: var(--tp-ink-3);
  transition: color 0.12s;
}

.tools-cat-name {
  font-size: 0.8125rem;
  font-weight: 500;
}

.tools-cat-count {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--tp-ink-3);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tools-cat:hover { color: var(--tp-ink); }

.tools-cat.is-active {
  background: #ffffff;
  color: var(--tp-ink);
  box-shadow: 0 1px 2px rgba(20, 16, 12, 0.06);
}

.tools-cat.is-active .tools-cat-icon { color: var(--tp-accent); }
.tools-cat.is-active .tools-cat-name { font-weight: 600; }

.tools-keys {
  margin: auto 0 4px;
  padding: 12px 10px 4px;
  font-size: 0.6875rem;
  color: var(--tp-ink-3);
  border-top: 1px solid var(--tp-line-2);
  line-height: 1.55;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tools-keys > div {
  display: flex;
  justify-content: space-between;
}

.tools-keys dt,
.tools-keys dd {
  margin: 0;
}

/* RIGHT — pane container; only the active pane is visible */
.tools-panes {
  position: relative;
  min-height: 360px;
}

.tools-pane {
  display: none;
  padding: 16px 18px 14px;
  flex-direction: column;
}

.tools-pane.is-active {
  display: flex;
  animation: tools-pane-fade 0.14s ease-out both;
}

@keyframes tools-pane-fade {
  from { opacity: 0; transform: translateX(4px); }
  to   { opacity: 1; transform: translateX(0); }
}

.tools-pane-head {
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.tools-pane-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--tp-ink);
}

.tools-pane-desc {
  font-size: 0.75rem;
  color: var(--tp-ink-3);
  margin-top: 2px;
}

.tools-pane-all {
  font-size: 0.75rem;
  color: var(--tp-ink-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  text-decoration: none;
}

.tools-pane-all:hover { color: var(--tp-ink); }

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.tools-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 9px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: transparent;
  box-shadow: none;
  transition: background 0.1s, box-shadow 0.1s;
}

.tools-panel .tools-row:hover,
.tools-panel .tools-row.is-active {
  background: var(--tp-rail-bg);
  box-shadow: inset 0 0 0 1px var(--tp-row-hover-border);
}

.tools-row-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--tp-line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--tp-ink-2);
  flex-shrink: 0;
}

.tools-row-body {
  flex: 1;
  min-width: 0;
  display: block;
}

.tools-row-name {
  display: block;
  font-size: 0.78125rem;
  font-weight: 600;
  color: var(--tp-ink);
}

.tools-row-desc {
  display: -webkit-box;
  font-size: 0.71875rem;
  color: var(--tp-ink-3);
  line-height: 1.4;
  margin-top: 2px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Below 760px the two-pane gets crowded; collapse to a single-column list
   that still shows category headings inline with their tools. */
@media (max-width: 760px) {
  .tools-panel {
    width: calc(100vw - 32px);
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .tools-rail { display: none; }
  .tools-pane { display: flex; padding: 12px 14px; }
  .tools-pane + .tools-pane { border-top: 1px solid var(--tp-line-2); }
  .tools-grid { grid-template-columns: 1fr; }
}

/* ── Mobile menu — card that drops below the pill ─────────────────────── */

.nav-mobile {
  width: min(960px, 100%);
  margin-top: 8px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(12, 12, 16, 0.08);
  border-radius: 18px;
  box-shadow: 0 10px 30px -10px rgba(12, 12, 16, 0.18),
              0 4px 12px -4px rgba(12, 12, 16, 0.08);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

.nav-bar.pinned .nav-mobile {
  margin-top: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  box-shadow: none;
  padding: 12px 24px;
  background: transparent;
}

.nav-mobile a {
  display: block;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.nav-mobile a:hover { color: var(--color-text); }

/* ── Flash messages ────────────────────────────────────────────────────── */

.flash-bar {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(560px, calc(100vw - 24px));
  pointer-events: none;
}

.flash-msg {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 18px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
  border: 1px solid transparent;
  pointer-events: auto;
  animation: flash-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.flash-msg.is-leaving {
  animation: flash-out 180ms ease-in forwards;
}

.flash-text {
  flex: 1;
  min-width: 0;
}

.flash-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 120ms ease, background-color 120ms ease;
}

.flash-close:hover,
.flash-close:focus-visible {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
  outline: none;
}

.flash-danger {
  background: #fef2f2;
  color: #b32525;
  border-color: #fecaca;
}

.flash-info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #c7dbff;
}

.flash-success {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes flash-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .flash-msg,
  .flash-msg.is-leaving { animation: none; }
}

@media (max-width: 640px) {
  .flash-bar { top: 76px; }
}

/* ── Footer ────────────────────────────────────────────────────────────── */

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px;
}

.footer-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.footer-logo {
  display: flex;
  align-items: center;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

.footer-logo:hover { color: var(--color-text); }

.footer-logo img {
  height: 56px;
  width: auto;
  max-width: none;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-col--end {
  align-items: flex-end;
}

.footer-col hr {
  width: 100%;
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--color-border);
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--color-text); }

.footer-cookie-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.footer-link-beer {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

.footer-link-beer:hover { color: var(--color-text); }

.footer-copy {
  font-size: .88rem;
  margin: 0;
  color: #b4b4b4;
}

/* ── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .nav-hamburger { display: block; }
  .nav-desktop { display: none; }

  .footer-row {
    /*flex-direction: column;*/
    text-align: center;
  }
}

@media (min-width: 768px) {
  .nav-mobile { display: none !important; }
}
