/* Plotit — unified primary navigation (pair with <header class="site-header">) */

body.logro-form-tile-bg .site-header {
  background: var(--nav-bg, var(--card-bg, #ffffff));
  box-shadow: 0 1px 0 var(--border, #e5e7eb);
  position: sticky;
  top: 0;
  z-index: 100;
}

body.logro-form-tile-bg .site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  min-height: 64px;
  height: 64px;
  box-sizing: border-box;
}

body.logro-form-tile-bg .site-header .nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
  min-width: 0;
  flex: 1 1 auto;
}

body.logro-form-tile-bg .site-header .brand-mark {
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  color: var(--nav-link-active, #3b82f6);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

body.logro-form-tile-bg .site-header .brand-mark:focus-visible {
  box-shadow: var(--focus-ring);
  border-radius: 6px;
  outline: none;
}

body.logro-form-tile-bg .site-header .nav-links {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2rem;
}

/* Desktop: text only */
body.logro-form-tile-bg .site-header .nav-icon  { display: none; }
body.logro-form-tile-bg .site-header .nav-label { display: inline; }

body.logro-form-tile-bg .site-header .nav-link {
  color: var(--nav-link, var(--text-muted, #6b7280));
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-bottom 0.2s;
  outline: none;
  white-space: nowrap;
}

body.logro-form-tile-bg .site-header .nav-link.active,
body.logro-form-tile-bg .site-header .nav-link:focus-visible {
  color: var(--nav-link-active, #3b82f6);
  border-bottom: 2px solid var(--nav-link-active, #3b82f6);
}

body.logro-form-tile-bg .site-header .profile-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--profile-bg, color-mix(in oklab, var(--accent, #3b82f6) 12%, transparent));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  outline: none;
  transition: box-shadow 0.2s;
  text-decoration: none;
}

body.logro-form-tile-bg .site-header .profile-icon:focus-visible {
  box-shadow: var(--focus-ring);
}

body.logro-form-tile-bg .site-header .profile-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent, #3b82f6);
}

body.logro-form-tile-bg .site-header .nav-right-cluster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Tablet (≤900px) ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  body.logro-form-tile-bg .site-header nav {
    padding: 0 1rem;
  }
  body.logro-form-tile-bg .site-header .nav-left {
    gap: 1.25rem;
  }
  body.logro-form-tile-bg .site-header .nav-links {
    gap: 1.25rem;
  }
}

/* ── Mobile (≤640px): grid layout ────────────────────────────────────────── */
@media (max-width: 640px) {
  body.logro-form-tile-bg .site-header nav {
    /* Switch to 2-row grid: [logo | controls] / [nav links…] */
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    height: auto;
    min-height: 52px;
    padding: 0.5rem 1rem;
    column-gap: 0.5rem;
    row-gap: 0;
    align-items: center;
  }

  /* Remove nav-left from the layout — its children (brand + nav-links)
     become direct grid items and can be placed independently */
  body.logro-form-tile-bg .site-header .nav-left {
    display: contents;
  }

  /* Row 1 col 1: logo */
  body.logro-form-tile-bg .site-header .brand-mark {
    grid-column: 1;
    grid-row: 1;
    padding: 0.3rem 0;
  }

  /* Row 1 col 2: locale switcher + profile icon cluster */
  body.logro-form-tile-bg .site-header .nav-right-cluster,
  body.logro-form-tile-bg .site-header nav > .profile-icon,
  body.logro-form-tile-bg .site-header nav > .locale-switcher {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  /* Row 2 full width: nav links (horizontally scrollable, no scrollbar) */
  body.logro-form-tile-bg .site-header .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 0.5rem;
    padding: 0.3rem 0 0.4rem;
    justify-content: center;
    border-top: 1px solid color-mix(in oklab, var(--border, #e5e7eb) 60%, transparent);
    margin-top: 0.25rem;
  }

  /* Mobile: icons only */
  body.logro-form-tile-bg .site-header .nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  body.logro-form-tile-bg .site-header .nav-label { display: none; }

  body.logro-form-tile-bg .site-header .nav-link {
    padding: 0.45rem 0.7rem;
    border-bottom: none !important;
    border-radius: 10px;
    color: var(--nav-link, var(--text-muted, #6b7280));
  }
  body.logro-form-tile-bg .site-header .nav-link.active {
    color: var(--nav-link-active, #3b82f6);
    background: color-mix(in oklab, var(--nav-link-active, #3b82f6) 14%, transparent);
  }
  body.logro-form-tile-bg .site-header .nav-link:hover:not(.active) {
    background: color-mix(in oklab, var(--border, #e5e7eb) 50%, transparent);
  }
}
