/* The recovered pages share a React mount, with public HTML available before hydration. */
#root {
  --legacy-control-ink: #173654;
  --legacy-control-edge: #9aaec1;
  --legacy-control-surface: #f7fafd;
}

/* Plain references in running text keep their line flow, including long email addresses. */
#root :where(section, article, main, form) :where(p, label) a[href]:not([hidden]):not(:has(img, svg, button, [data-slot="button"])):not([class*="bg-"]),
#root > main > p a[href]:not([hidden]) {
  padding: .1em .36em;
  border: 1px solid var(--legacy-control-edge);
  border-radius: .35rem;
  background: var(--legacy-control-surface);
  color: var(--legacy-control-ink);
  font-weight: 650;
  text-decoration: none;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Menus, text actions and links listed as destinations get a full touch target. */
#root :is(nav[aria-label="Navigazione principale"], nav[aria-label="Navigazione mobile"]) a[href]:not([hidden]),
#root :is(section, article, main) :where(li, .flex-wrap, .grid) > a[href]:not([hidden], [class*="bg-"], [class*="border"], [data-slot="button"]):not(:has(div, img, h2, h3, button, [data-slot="button"])),
#root :is(section, article, main) a:is(.underline, [class~="hover:underline"]):not([hidden], [class*="bg-"], :where(p *, label *, nav *)):not(:has(div, img, button)),
#root > main :is(li, p) > a:only-child:not([hidden]),
#root > main > p:has(a + a) > a:not([hidden]) {
  box-sizing: border-box;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  max-width: 100%;
  min-height: 44px;
  padding: .48rem .75rem;
  border: 1px solid var(--legacy-control-edge);
  border-radius: .5rem;
  background: var(--legacy-control-surface);
  color: var(--legacy-control-ink);
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

#root > main :where(ul):has(> li > a:only-child) {
  display: grid;
  justify-items: start;
  gap: .45rem;
  list-style: none;
  padding-inline-start: 0;
}

/* Existing boxed product cards and native form submits retain their entire hit area. */
#root nav[aria-label="Navigazione principale"] {
  flex-wrap: wrap;
  gap: .3rem;
}
#root nav[aria-label="Navigazione principale"] a[href]:not([hidden]) {
  padding-inline: .55rem;
  font-size: .875rem;
}
#root nav[aria-label="Navigazione principale"] :where(.absolute) a[href]:not([hidden]) {
  justify-content: flex-start;
  width: 100%;
}
#root nav[aria-label="Navigazione mobile"] {
  gap: .4rem;
  padding: .5rem;
}
#root nav[aria-label="Navigazione mobile"] a[href]:not([hidden]) {
  justify-content: flex-start;
}
#root nav[aria-label="Navigazione mobile"] div.flex:has(> button[aria-expanded]) {
  gap: .4rem;
}
#root nav[aria-label="Navigazione mobile"] a[href="/prenota-appuntamento"]:not([hidden]) {
  justify-content: center;
  border-color: #d6b66e;
  background: #f3d68c;
  color: #162d47;
}
#root header[data-loc*="/MainNav.tsx:"] > div:first-child a[href]:not([hidden]) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: .75rem;
  border: 1px solid #8aa3bd;
  border-radius: .5rem;
  color: #fff;
  text-decoration: none;
}
#root nav[aria-label="Navigazione mobile"] button[aria-expanded],
#root header button[aria-label="Apri menu"],
#root header button[aria-label="Chiudi menu"] {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--legacy-control-edge);
  border-radius: .5rem;
}
#root nav[aria-label="Menu mobile"] a[href]:not([hidden]) {
  min-height: 44px;
  border: 1px solid #7290a8;
  border-radius: .5rem;
}

#root :where(main, section, article, header, nav, form) :is(a[href], button):focus-visible {
  outline: 3px solid #996800;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px white;
}

@media (hover: hover) {
  #root nav:is([aria-label="Navigazione principale"], [aria-label="Navigazione mobile"]) a[href]:not([hidden]):hover,
  #root :is(main, section, article) a:is(.underline, [class~="hover:underline"]):not([hidden], [class*="bg-"]):hover,
  #root > main :is(p, li) > a[href]:hover {
    border-color: #607f99;
    background: #e6eef6;
    color: #102e49;
    text-decoration: none;
  }
}

@media (max-width: 640px) {
  #root > main > p > a:only-child,
  #root > main > p:has(a + a) > a {
    margin-block: .2rem;
  }
}
