/* FindNivo A17.2.2 production visual polish */
body.findnivo-custom-header #main_header {
  display: none !important;
}

.fn-site-header {
  position: sticky;
  top: 0;
  z-index: 9990;
  width: 100%;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--fn-border, #e2e8f0);
  box-shadow: 0 1px 0 rgba(15,23,42,.02);
  backdrop-filter: blur(14px);
}

.admin-bar .fn-site-header { top: 32px; }

.fn-site-header__inner {
  width: min(1240px, calc(100% - 32px));
  min-height: 70px;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.fn-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--fn-brand-dark, #0f172a) !important;
  text-decoration: none !important;
}

.fn-brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--fn-primary, #2563eb), var(--fn-accent, #6366f1));
  color: #fff;
  font-size: 21px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(37,99,235,.18);
}

.fn-brand__name {
  font-size: 21px;
  font-weight: 820;
  letter-spacing: -.035em;
}

.fn-desktop-nav {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.fn-desktop-nav a {
  padding: 9px 10px;
  border-radius: 8px;
  color: #334155 !important;
  font-size: 14px;
  font-weight: 680;
  text-decoration: none !important;
  white-space: nowrap;
}

.fn-desktop-nav a:hover,
.fn-desktop-nav a:focus-visible {
  background: #f1f5f9;
  color: var(--fn-primary-dark, #1d4ed8) !important;
}

.fn-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.fn-header-search,
.fn-header-cta {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  text-decoration: none !important;
  font-size: 14px;
  font-weight: 750;
}

.fn-header-search {
  gap: 6px;
  padding: 0 10px;
  color: #475569 !important;
}

.fn-header-search:hover { color: var(--fn-primary-dark, #1d4ed8) !important; }

.fn-header-cta {
  padding: 0 15px;
  background: var(--fn-primary, #2563eb);
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(37,99,235,.16);
}

.fn-header-cta:hover { background: var(--fn-primary-dark, #1d4ed8); }

.fn-mobile-nav { display: none; }

/* Remove REHub title leakage on the homepage without touching the FindNivo hero H1. */
body.findnivo-home .title_single_area,
body.findnivo-home .page-title,
body.findnivo-home .rh-post-wrapper > h1,
body.findnivo-home .rh_post_layout_middle > h1,
body.findnivo-home article.page > h1:first-child,
body.findnivo-home article.page > header > h1,
body.findnivo-home .main-side > h1:first-child,
body.findnivo-home .post > h1:first-child {
  display: none !important;
}

/* Pull the custom homepage cleanly under the new header. */
body.findnivo-home .rh-container,
body.findnivo-home .main-side,
body.findnivo-home .content,
body.findnivo-home article.page,
body.findnivo-home .post,
body.findnivo-home .post-inner {
  max-width: none !important;
}

body.findnivo-home article.page,
body.findnivo-home .post,
body.findnivo-home .post-inner {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Category polish */
.fn-category-card,
.findnivo-category-card {
  isolation: isolate;
  min-height: 150px;
  padding: 24px;
  border-color: #dbe4ef;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

.fn-category-card::before,
.findnivo-category-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--fn-primary, #2563eb), var(--fn-accent, #6366f1));
  opacity: 0;
  transition: opacity .18s ease;
}

.fn-category-card:hover::before,
.findnivo-category-card:hover::before { opacity: 1; }

.fn-category-card:hover,
.findnivo-category-card:hover {
  transform: translateY(-3px);
  border-color: #bfdbfe;
  box-shadow: 0 18px 40px rgba(15,23,42,.09);
}

.fn-category-card__icon {
  width: 38px;
  height: 38px;
  background: #eff6ff;
  border: 1px solid #dbeafe;
}

/* Software-card polish */
.findnivo-software-card {
  position: relative;
  border-color: #dbe4ef;
  border-radius: 18px;
  box-shadow: 0 3px 10px rgba(15,23,42,.035);
}

.findnivo-software-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--fn-primary, #2563eb), var(--fn-accent, #6366f1));
  opacity: 0;
  transition: opacity .18s ease;
}

.findnivo-software-card:hover::before { opacity: 1; }

.findnivo-software-card:hover {
  transform: translateY(-4px);
  border-color: #bfdbfe;
  box-shadow: 0 20px 44px rgba(15,23,42,.09);
}

.findnivo-software-card__media {
  min-height: 106px;
  padding: 24px 24px 10px;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  border-bottom: 1px solid #eef2f7;
}

.findnivo-software-card__body { padding: 22px 24px 24px; }

.findnivo-software-card__title {
  margin-bottom: 10px;
  font-size: 21px;
}

.findnivo-software-card__title a:hover { color: var(--fn-primary-dark, #1d4ed8) !important; }

.findnivo-software-card__overview {
  color: #526174;
  line-height: 1.65;
}

.findnivo-software-card__actions { padding-top: 18px; }

.findnivo-software-card__actions .findnivo-button {
  width: 100%;
  min-height: 46px;
}

/* Search refinement */
.fn-hero__search .findnivo-search {
  border-color: #c7d7ee;
  box-shadow: 0 18px 46px rgba(37,99,235,.11), 0 1px 2px rgba(15,23,42,.04);
}

.fn-hero__search .findnivo-search:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(37,99,235,.09), 0 18px 46px rgba(37,99,235,.11);
}

/* Keep discovery pages visually aligned with the homepage system. */
body.findnivo-discovery-view .rh-container {
  width: min(1180px, calc(100% - 32px));
}

body.findnivo-discovery-view .main-side,
body.findnivo-discovery-view .content,
body.findnivo-discovery-view .post,
body.findnivo-discovery-view article {
  border-color: #e2e8f0;
}

@media (max-width: 1180px) {
  .fn-desktop-nav a { padding-inline: 7px; font-size: 13px; }
  .fn-header-search span:last-child { display: none; }
}

@media (max-width: 960px) {
  .fn-desktop-nav,
  .fn-header-actions { display: none; }

  .fn-site-header__inner {
    min-height: 64px;
    justify-content: space-between;
  }

  .fn-mobile-nav {
    position: relative;
    display: block;
    margin-left: auto;
  }

  .fn-mobile-nav summary {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    list-style: none;
    cursor: pointer;
    border: 1px solid #dbe4ef;
    border-radius: 10px;
    background: #fff;
  }

  .fn-mobile-nav summary::-webkit-details-marker { display: none; }

  .fn-mobile-nav__bars {
    display: grid;
    width: 20px;
    gap: 4px;
  }

  .fn-mobile-nav__bars i {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: #0f172a;
  }

  .fn-mobile-nav[open] summary {
    border-color: #93c5fd;
    background: #eff6ff;
  }

  .fn-mobile-nav__panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(340px, calc(100vw - 28px));
    padding: 14px;
    background: #fff;
    border: 1px solid #dbe4ef;
    border-radius: 14px;
    box-shadow: 0 22px 55px rgba(15,23,42,.16);
  }

  .fn-mobile-nav__top {
    padding: 5px 7px 12px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .fn-mobile-nav__panel nav {
    display: grid;
    gap: 2px;
  }

  .fn-mobile-nav__panel nav a {
    display: flex;
    min-height: 45px;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    border-radius: 9px;
    color: #1e293b !important;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;
  }

  .fn-mobile-nav__panel nav a:hover,
  .fn-mobile-nav__panel nav a:focus-visible {
    background: #f1f5f9;
    color: var(--fn-primary-dark, #1d4ed8) !important;
  }

  .fn-mobile-nav__cta {
    display: flex;
    min-height: 46px;
    margin-top: 12px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--fn-primary, #2563eb);
    color: #fff !important;
    font-weight: 800;
    text-decoration: none !important;
  }
}

@media (max-width: 782px) {
  .admin-bar .fn-site-header { top: 46px; }
}

@media (max-width: 639px) {
  .fn-site-header__inner { width: calc(100% - 24px); }
  .fn-brand__mark { width: 35px; height: 35px; border-radius: 10px; }
  .fn-brand__name { font-size: 20px; }

  .fn-category-card,
  .findnivo-category-card {
    min-height: 116px;
    padding: 20px;
  }

  .findnivo-software-card__media { min-height: 92px; }
  .findnivo-software-card__body { padding: 20px; }
}
