@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&display=swap');

/* =========================================================================
   GovCat docs — sidebar restyle to match govhub-app-v2 (Link.it brand)
   Target: sphinx_rtd_theme
   ========================================================================= */

/* Link.it brand palette */
:root {
  --lnk-canvas:           #f4f8fa;
  --lnk-surface:          #ffffff;
  --lnk-text-primary:     #333333;
  --lnk-text-secondary:   #6a8da5;
  --lnk-accent-light:     #cce3ed;
  --lnk-accent-light-50:  rgba(204, 227, 237, 0.5);
  --lnk-accent-dark:      #8ce1d8;
  --lnk-cta:              #ff4050;
  --lnk-denim:            #2e445a;
  --lnk-radius:           8px;
}

/* -------------------------------------------------------------------------
   Global font — Prompt everywhere (matches govhub-app-v2)
   ------------------------------------------------------------------------- */
body,
.wy-body-for-nav,
.wy-nav-content,
.rst-content,
.rst-content p,
.rst-content li,
.rst-content dl,
.wy-menu-vertical,
.wy-menu-vertical a,
.wy-menu-vertical p.caption,
.wy-side-nav-search,
.wy-side-nav-search > a,
h1, h2, h3, h4, h5, h6,
.rst-content h1,
.rst-content h2,
.rst-content h3,
.rst-content h4,
.rst-content h5,
.rst-content h6 {
  font-family: 'Prompt', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
}

/* -------------------------------------------------------------------------
   Sidebar container
   ------------------------------------------------------------------------- */
.wy-nav-side {
  background: var(--lnk-surface);
  border-right: 1px solid var(--lnk-accent-light);
  box-shadow: 0 1px 2px 0 rgba(51, 51, 51, 0.05);
  color: var(--lnk-text-primary);
  font-family: 'Prompt', system-ui, -apple-system, 'Segoe UI', sans-serif;
  padding-bottom: 1em;
}

/* Top search / brand area — sticky so the logo + search stay visible while the menu scrolls */
.wy-side-nav-search,
.wy-nav-top {
  background: var(--lnk-surface);
  color: var(--lnk-text-primary);
  border-bottom: none;
  padding: 1rem 0.75rem;
}

.wy-side-nav-search {
  position: sticky;
  top: 0;
  z-index: 10;
}

/* The scroll container has three stacked children:
   - .wy-side-nav-search  (logo + search, fixed top)
   - .wy-menu             (scrollable nav)
   - .lnk-info-footer     (info button, fixed bottom)
   overflow:hidden makes theme's scrollToActive on .wy-side-scroll a no-op.

   IMPORTANT: by default the theme sets .wy-side-scroll to 320px (20px wider
   than .wy-nav-side, with the overflow hidden by the parent) so a native
   scrollbar of 20px can sit invisibly. We removed the scrollbar by switching
   overflow to hidden — so the 20px extra width becomes dead space clipped
   off-screen. Setting width:100% makes .wy-side-scroll match the visible
   sidebar width exactly, so children that use width:100% align properly. */
.wy-side-scroll {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
}

.wy-side-scroll > .wy-menu {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.wy-side-scroll > .wy-side-nav-search,
.wy-side-scroll > .lnk-info-footer {
  flex: 0 0 auto;
}

.wy-side-nav-search > a,
.wy-side-nav-search .wy-dropdown > a,
.wy-side-nav-search > div.version {
  color: var(--lnk-text-primary);
  font-family: 'Prompt', sans-serif;
  font-weight: 600;
}

/* Logo: hide the textual app title (we use the SVG which already has "GovDesk") */
.wy-side-nav-search > a img.logo {
  width: 150px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  background: transparent;
  padding: 0;
}

.wy-side-nav-search > a.icon::before {
  display: none;
}

.wy-side-nav-search.wy-side-nav-search a span,
.wy-side-nav-search > a:not(:has(img))::after {
  display: none;
}

/* When a logo is present, hide the text node next to it */
.wy-side-nav-search a:has(img.logo) {
  font-size: 0;
}

.wy-side-nav-search > div.version {
  color: var(--lnk-text-secondary);
  font-weight: 500;
}

/* Input — govregistry-app-v2 standard (.lnk-field-editable):
   base: border primary/30
   hover: border primary/60 + shadow-sm
   focus: border primary + ring primary/20 + shadow-md
   "primary" in docs context = text-primary #333333 */
.wy-side-nav-search input[type="text"] {
  border: 1px solid rgba(51, 51, 51, 0.3);
  border-radius: var(--lnk-radius);
  background: var(--lnk-surface);
  color: var(--lnk-text-primary);
  box-shadow: none;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.wy-side-nav-search input[type="text"]::placeholder {
  color: var(--lnk-text-secondary);
  opacity: 1;
}

.wy-side-nav-search input[type="text"]:hover {
  border-color: rgba(51, 51, 51, 0.6);
  box-shadow: 0 1px 2px 0 rgba(51, 51, 51, 0.05);
}

.wy-side-nav-search input[type="text"]:focus {
  outline: none;
  border-color: var(--lnk-text-primary);
  box-shadow: 0 0 0 2px rgba(51, 51, 51, 0.2),
              0 4px 6px -1px rgba(51, 51, 51, 0.1);
}

/* -------------------------------------------------------------------------
   Vertical menu
   ------------------------------------------------------------------------- */
.wy-menu-vertical {
  font-family: 'Prompt', sans-serif;
}

/* Section captions (group headers) — celeste / text-secondary like govhub-app-v2
   Important: override sphinx_rtd_theme's hard 32px height + nowrap */
.wy-menu-vertical p.caption {
  color: var(--lnk-text-secondary);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1.25rem 0 0.5rem 0;
  padding: 0 1.25rem;
  height: auto;
  line-height: 1.4;
  white-space: normal;
  display: block;
}

.wy-menu-vertical p.caption .caption-text {
  color: var(--lnk-text-secondary);
  display: inline-block;
  line-height: 1.4;
}

/* Collapsible captions (enabled by sidebar.js) — extra left padding so they
   appear visually nested under the section header above. */
.wy-menu-vertical p.caption.lnk-caption-toggle {
  cursor: pointer;
  user-select: none;
  padding-left: 3rem;
  position: relative;
}

/* Chevron: centered vertically on the caption text using transform-origin trick.
   We use line-height matching the caption (1.4) + top:0 + translateY for stable centering. */
.wy-menu-vertical p.caption.lnk-caption-toggle::before {
  content: "";
  position: absolute;
  left: 2rem;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--lnk-text-secondary);
  margin-top: -2px;
  transform-origin: 50% 25%;
  transition: transform 150ms ease;
}

.wy-menu-vertical p.caption.lnk-caption-toggle.lnk-collapsed::before {
  transform: rotate(-90deg);
}


/* Dark super-headers — DOM-injected by sidebar.js, not via ::before
   (avoids width/layout issues). Two of them today:
   - .lnk-header-pdnd     → "BANCHE DATI PDND"
   - .lnk-header-supporto → "GESTIONE E SUPPORTO" */
.lnk-section-header {
  display: block;
  color: var(--lnk-text-primary);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  padding: 1.25rem 1.25rem 1rem 1.25rem;
  margin: 0 0 0.5rem 0;
  border-bottom: none;
  user-select: none;
  cursor: default;
}

/* The second top-level header gets extra space above so the two macro-areas
   (PDND vs Gestione e supporto) read as distinct without a divider line. */
.lnk-section-header.lnk-header-supporto {
  margin-top: 2rem;
  border-top: none;
}

/* Collapsible section headers — chevron on the LEFT. Background appears
   only on hover or while pressing (click), never as default. */
.lnk-section-header.lnk-section-toggle {
  position: relative;
  margin: 0 0.5rem 0.5rem 0.5rem;
  padding: 0.5rem 0.75rem 0.5rem 1.75rem;
  border-radius: var(--lnk-radius);
  background: transparent;
  cursor: pointer;
  user-select: none;
  transition: background-color 150ms ease;
}

.lnk-section-header.lnk-section-toggle::after {
  content: "";
  position: absolute;
  left: 0.625rem;
  top: 50%;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--lnk-text-primary);
  margin-top: -2px;
  transform-origin: 50% 25%;
  transition: transform 150ms ease;
}

.lnk-section-header.lnk-section-toggle.lnk-collapsed::after {
  transform: rotate(-90deg);
}

.lnk-section-header.lnk-section-toggle:hover,
.lnk-section-header.lnk-section-toggle:active {
  background: var(--lnk-accent-light-50);
}

/* All menu links — base */
.wy-menu-vertical a {
  color: #333333;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  margin: 1px 0.5rem;
  border-radius: var(--lnk-radius);
  transition: background-color 150ms ease, color 150ms ease;
  border: none;
}

/* Hover state */
.wy-menu-vertical a:hover {
  background-color: var(--lnk-accent-light-50);
  color: #333333;
}

/* Level 1 toctree items — medium weight (semibold reserved for active) */
.wy-menu-vertical li.toctree-l1 > a {
  font-weight: 500;
}

/* Current / active item — first level */
.wy-menu-vertical li.current {
  background: transparent;
}

.wy-menu-vertical li.current > a,
.wy-menu-vertical li.on a,
.wy-menu-vertical li.toctree-l1.current > a {
  background-color: var(--lnk-accent-light-50);
  color: #333333;
  font-weight: 600;
  border: none;
}

.wy-menu-vertical li.current > a:hover,
.wy-menu-vertical li.on a:hover,
.wy-menu-vertical li.toctree-l1.current > a:hover {
  background-color: var(--lnk-accent-light);
  color: #333333;
}

/* Nested levels — reset all the cascading grey backgrounds from sphinx_rtd_theme */
.wy-menu-vertical li,
.wy-menu-vertical li.current,
.wy-menu-vertical li.on,
.wy-menu-vertical li.toctree-l1.current,
.wy-menu-vertical li.toctree-l2.current,
.wy-menu-vertical li.toctree-l3.current,
.wy-menu-vertical li.toctree-l4.current,
.wy-menu-vertical li.toctree-l1.current > ul,
.wy-menu-vertical li.toctree-l2.current > ul,
.wy-menu-vertical li.toctree-l3.current > ul,
.wy-menu-vertical li.toctree-l4.current > ul,
.wy-menu-vertical li.toctree-l1.current li.toctree-l2 > a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a,
.wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a,
.wy-menu-vertical li.toctree-l4.current li.toctree-l5 > a,
.wy-menu-vertical li.toctree-l1.current li.toctree-l3 > a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l4 > a {
  background: transparent;
}

/* Nested level items */
.wy-menu-vertical li.toctree-l2 a,
.wy-menu-vertical li.toctree-l3 a,
.wy-menu-vertical li.toctree-l4 a,
.wy-menu-vertical li.toctree-l5 a {
  background: transparent;
  color: #333333;
  font-weight: 500;
}

.wy-menu-vertical li.toctree-l2 a:hover,
.wy-menu-vertical li.toctree-l3 a:hover,
.wy-menu-vertical li.toctree-l4 a:hover,
.wy-menu-vertical li.toctree-l5 a:hover {
  background-color: var(--lnk-accent-light-50);
  color: #333333;
}

.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l3.current > a,
.wy-menu-vertical li.toctree-l4.current > a,
.wy-menu-vertical li.toctree-l5.current > a,
.wy-menu-vertical a.current,
.wy-menu-vertical li.current > a.current {
  background-color: var(--lnk-accent-light-50) !important;
  color: #333333 !important;
  font-weight: 700 !important;
  border: none !important;
}

.wy-menu-vertical li.toctree-l2.current > a:hover,
.wy-menu-vertical li.toctree-l3.current > a:hover,
.wy-menu-vertical li.toctree-l4.current > a:hover,
.wy-menu-vertical a.current:hover {
  background-color: var(--lnk-accent-light) !important;
}

/* Sub-menu group container — flat, no left line. Indent only via padding on items. */
.wy-menu-vertical li.toctree-l1.current > ul,
.wy-menu-vertical li.toctree-l2.current > ul,
.wy-menu-vertical li.toctree-l3.current > ul {
  border-left: none;
  margin-left: 0;
  padding-left: 0;
}

/* Items belonging to a caption group are indented so the hierarchy is
   visually obvious (no vertical line, just left padding). The caption text
   sits at padding-left: 3rem, so items below align/exceed that. */
.wy-menu-vertical p.caption + ul li.toctree-l1 > a {
  padding-left: 3rem;
}

.wy-menu-vertical p.caption + ul li.toctree-l1 li.toctree-l2 > a {
  padding-left: 4rem;
}

/* Reset every default sphinx_rtd_theme border/shadow on nested anchors
   (the curved/`)`-looking edges on the right of sub-items came from these) */
.wy-menu-vertical li.toctree-l1 > a,
.wy-menu-vertical li.toctree-l2 > a,
.wy-menu-vertical li.toctree-l3 > a,
.wy-menu-vertical li.toctree-l4 > a,
.wy-menu-vertical li.toctree-l5 > a,
.wy-menu-vertical li.toctree-l1.current li.toctree-l2 > a,
.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a,
.wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a,
.wy-menu-vertical li.toctree-l4.current li.toctree-l5 > a {
  border: none !important;
  box-shadow: none !important;
}

/* Nested indent */
.wy-menu-vertical li.toctree-l2 a {
  padding-left: 1.75rem;
}
.wy-menu-vertical li.toctree-l3 a {
  padding-left: 2.5rem;
}
.wy-menu-vertical li.toctree-l4 a {
  padding-left: 3.25rem;
}

/* Expand toggle buttons — hidden (sidebar is a flat list of page titles with maxdepth:1) */
.wy-menu-vertical li button.toctree-expand,
.wy-menu-vertical li .toctree-expand {
  display: none !important;
}

/* -------------------------------------------------------------------------
   Body background — soft canvas like govhub-app-v2
   ------------------------------------------------------------------------- */
.wy-nav-content-wrap {
  background: var(--lnk-canvas);
}

.wy-nav-content {
  background: var(--lnk-canvas);
  max-width: none;
}

/* Article body becomes a white "card" sitting on the celeste canvas, so the
   left/right padding of .wy-nav-content shows through as celeste gutters. */
.rst-content > [role="main"],
.rst-content > div[role="main"],
.rst-content [role="main"] {
  background: var(--lnk-surface);
  border-radius: 12px;
  padding: 2rem 2.25rem;
  margin: 0;
}

/* Footer area (copyright, "Built with Sphinx") sits on celeste canvas too —
   give it some breathing room above the body card. */
.rst-content > [role="contentinfo"],
.rst-content > footer {
  margin-top: 1.5rem;
}

/* Footer area in sidebar (if present) */
.rst-versions {
  background: var(--lnk-surface);
  border-top: 1px solid var(--lnk-accent-light);
  color: var(--lnk-text-primary);
}

.rst-versions a {
  color: var(--lnk-cta);
}

.rst-versions .rst-current-version {
  background: var(--lnk-surface);
  color: var(--lnk-text-primary);
}

/* Scrollbar inside the sidebar — subtle */
.wy-nav-side::-webkit-scrollbar {
  width: 6px;
}
.wy-nav-side::-webkit-scrollbar-thumb {
  background: var(--lnk-accent-light);
  border-radius: 3px;
}
.wy-nav-side::-webkit-scrollbar-track {
  background: transparent;
}

/* -------------------------------------------------------------------------
   Breadcrumb / top navigation bar — styled like govhub-app-v2 page header.
   The whole navigation wrapper becomes a full-width celeste strip that sits
   above the white article area.
   ------------------------------------------------------------------------- */
.rst-content > [role="navigation"]:first-child,
.rst-content div[role="navigation"][aria-label*="Naviga"] {
  background: var(--lnk-canvas);
  margin: -3.236em -3.236em 1.5rem -3.236em;
  padding: 2.25rem 1.5rem 1rem 0.5rem;
  border-bottom: none;
}

/* Remove the default RTD <hr/> below the breadcrumb — the celeste strip
   already provides visual separation from the white content. */
.rst-content > [role="navigation"]:first-child > hr,
.rst-content div[role="navigation"][aria-label*="Naviga"] > hr {
  display: none;
}

.wy-breadcrumbs {
  background: transparent;
  padding: 0;
  margin: 0;
  font-family: 'Prompt', sans-serif;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.wy-breadcrumbs li {
  color: var(--lnk-text-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* Remove the default sphinx_rtd_theme separator (» or /) — we use ::after for › */
.wy-breadcrumbs li::before {
  content: none !important;
}

/* Chevron separator AFTER every item except the last one */
.wy-breadcrumbs li:not(:last-child)::after {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-top: 1.5px solid var(--lnk-text-secondary);
  border-right: 1.5px solid var(--lnk-text-secondary);
  transform: rotate(45deg);
  display: inline-block;
  margin-left: 0.25rem;
}

/* No chevron after the active page or after the (hidden) breadcrumbs-aside */
.wy-breadcrumbs li.breadcrumb-item.active::after,
.wy-breadcrumbs li.wy-breadcrumbs-aside::after {
  content: none !important;
}

.wy-breadcrumbs li a,
.wy-breadcrumbs li a:visited,
.rst-content .wy-breadcrumbs li a {
  color: var(--lnk-text-primary) !important;
  font-weight: 500;
  text-decoration: none !important;
  transition: color 150ms ease;
}

.wy-breadcrumbs li a:hover,
.rst-content .wy-breadcrumbs li a:hover {
  color: var(--lnk-text-primary) !important;
  opacity: 0.75;
  text-decoration: none !important;
}

.wy-breadcrumbs li.breadcrumb-item.active,
.wy-breadcrumbs li:last-child {
  color: var(--lnk-text-primary);
  font-weight: 600;
}

/* Home icon — neutral dark, not coral */
.wy-breadcrumbs li a.icon-home::before,
.wy-breadcrumbs li.icon-home::before,
.wy-breadcrumbs li > a > .fa-home,
.wy-breadcrumbs li > a > .icon-home {
  color: var(--lnk-text-primary);
  font-size: 1rem;
  display: inline-block;
}

/* Hide the wy-breadcrumbs-aside (RTD's "Edit on GitHub" area) — keep header clean */
.wy-breadcrumbs-aside {
  display: none;
}

.wy-breadcrumbs hr,
.rst-content hr {
  background: var(--lnk-accent-light);
  border: none;
  height: 1px;
}

/* Mobile top bar (when sidebar is hidden) */
.wy-nav-top {
  background: var(--lnk-surface) !important;
  color: var(--lnk-text-primary);
  border-bottom: 1px solid var(--lnk-accent-light);
  line-height: 50px;
}

.wy-nav-top a {
  color: var(--lnk-cta);
  font-weight: 600;
}

.wy-nav-top i {
  color: var(--lnk-text-primary);
}

/* -------------------------------------------------------------------------
   Content typography
   ------------------------------------------------------------------------- */
.rst-content h1,
.rst-content h2,
.rst-content h3,
.rst-content h4 {
  color: var(--lnk-text-primary);
  font-weight: 600;
}

.rst-content a,
.rst-content a:visited,
.rst-content a:hover,
.rst-content a:focus,
.rst-content a:active,
.wy-menu-vertical a,
.wy-menu-vertical a:hover,
.wy-breadcrumbs a,
.wy-breadcrumbs a:hover {
  text-decoration: none !important;
}

.rst-content a {
  color: var(--lnk-cta);
}

.rst-content a:hover {
  color: var(--lnk-cta);
  opacity: 0.85;
}

.rst-content a:visited {
  color: var(--lnk-cta);
}

/* -------------------------------------------------------------------------
   Admonitions — gov-info-box style (canvas bg, accent-light border, no side strip)
   ------------------------------------------------------------------------- */
.rst-content .admonition,
.rst-content .note,
.rst-content .tip,
.rst-content .hint,
.rst-content .important,
.rst-content .seealso {
  border-radius: var(--lnk-radius);
  border: 1px solid var(--lnk-accent-light) !important;
  background: var(--lnk-canvas) !important;
  padding: 0.875rem 1rem;
  margin: 1rem 0;
  color: var(--lnk-text-secondary);
}

.rst-content .admonition .admonition-title,
.rst-content .note .admonition-title,
.rst-content .tip .admonition-title,
.rst-content .hint .admonition-title,
.rst-content .important .admonition-title,
.rst-content .seealso .admonition-title {
  background: transparent !important;
  color: var(--lnk-text-primary) !important;
  font-weight: 700;
  padding: 0;
  margin: 0 0 0.25rem 0;
}

.rst-content .admonition > *:not(.admonition-title),
.rst-content .note > *:not(.admonition-title),
.rst-content .tip > *:not(.admonition-title),
.rst-content .hint > *:not(.admonition-title),
.rst-content .important > *:not(.admonition-title),
.rst-content .seealso > *:not(.admonition-title) {
  color: var(--lnk-text-secondary);
}

/* Warning / caution / danger — coral border + faint coral bg */
.rst-content .warning,
.rst-content .caution,
.rst-content .attention,
.rst-content .danger,
.rst-content .error {
  border-radius: var(--lnk-radius);
  border: 1px solid var(--lnk-cta) !important;
  background: rgba(255, 64, 80, 0.04) !important;
  padding: 0.875rem 1rem;
  margin: 1rem 0;
}

.rst-content .warning .admonition-title,
.rst-content .caution .admonition-title,
.rst-content .attention .admonition-title,
.rst-content .danger .admonition-title,
.rst-content .error .admonition-title {
  background: transparent !important;
  color: var(--lnk-cta) !important;
  font-weight: 700;
  padding: 0;
  margin: 0 0 0.25rem 0;
}

/* -------------------------------------------------------------------------
   Buttons — govhub-app-v2 / govregistry-app-v2 PRIMARY standard
   bg-cta coral + white text + rounded-md + subtle shadow.
   Includes .btn-neutral (sphinx_rtd_theme's Prev/Next) — same primary style.
   ------------------------------------------------------------------------- */
.rst-content .btn,
.rst-footer-buttons .btn,
.rst-content .rst-footer-buttons .btn,
.rst-content .btn-neutral,
.rst-footer-buttons .btn-neutral {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: 'Prompt', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--lnk-radius);
  border: 1px solid var(--lnk-cta) !important;
  background: var(--lnk-cta) !important;
  color: #ffffff !important;
  height: 40px;
  padding: 0 1rem;
  box-shadow: none;
  transition: background-color 150ms ease, filter 150ms ease;
  text-decoration: none !important;
  text-transform: none;
  cursor: pointer;
}

.rst-content .btn:hover,
.rst-footer-buttons .btn:hover,
.rst-content .btn-neutral:hover,
.rst-footer-buttons .btn-neutral:hover {
  background: var(--lnk-cta) !important;
  border-color: var(--lnk-cta) !important;
  color: #ffffff !important;
  filter: brightness(0.9);
  box-shadow: none !important;
}

.rst-content .btn:focus,
.rst-footer-buttons .btn:focus,
.rst-content .btn:focus-visible,
.rst-content .btn-neutral:focus {
  outline: none;
  box-shadow: none !important;
}

.rst-content .btn:active,
.rst-footer-buttons .btn:active,
.rst-content .btn-neutral:active {
  filter: brightness(0.85);
}

/* Icons inside the button inherit white text color */
.rst-content .btn .fa,
.rst-content .btn .fas,
.rst-content .btn .icon-circle-arrow-left,
.rst-content .btn .icon-circle-arrow-right,
.rst-content .btn-neutral .fa,
.rst-content .btn-neutral .icon-circle-arrow-left,
.rst-content .btn-neutral .icon-circle-arrow-right {
  color: #ffffff !important;
}

/* -------------------------------------------------------------------------
   Fixed "Informazioni" footer button — pinned to the very bottom of the sidebar.
   The button mirrors the styling of regular menu links: gutter, rounded card,
   hover with celeste accent-light/50 background. */
.lnk-info-footer {
  border-top: none;
  padding: 0.5rem 0.5rem 0 0.5rem;
  background: var(--lnk-surface);
  margin-top: auto;
}

.lnk-info-btn {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0.4rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--lnk-text-primary);
  font-family: 'Prompt', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--lnk-radius);
  cursor: pointer;
  transition: background-color 150ms ease;
  text-align: left;
}

.lnk-info-btn:hover {
  background: var(--lnk-accent-light-50);
}

.lnk-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--lnk-text-primary);
  flex-shrink: 0;
}

/* -------------------------------------------------------------------------
   Informazioni modal
   ------------------------------------------------------------------------- */
.lnk-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(51, 51, 51, 0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: lnk-fade-in 150ms ease;
}

@keyframes lnk-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lnk-modal {
  background: var(--lnk-surface);
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
              0 10px 10px -5px rgba(0, 0, 0, 0.04);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Prompt', sans-serif;
}

.lnk-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--lnk-accent-light);
}

.lnk-modal-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--lnk-text-primary);
}

.lnk-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--lnk-text-secondary);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--lnk-radius);
  transition: background-color 150ms ease, color 150ms ease;
}

.lnk-modal-close:hover {
  background: var(--lnk-accent-light-50);
  color: var(--lnk-text-primary);
}

.lnk-modal-body {
  padding: 2rem 1.25rem;
  text-align: center;
  overflow-y: auto;
}

.lnk-modal-logo {
  width: 96px;
  height: auto;
  margin: 0 auto 1rem;
  display: block;
}

.lnk-modal-product {
  font-size: 1rem;
  font-weight: 600;
  color: var(--lnk-text-primary);
  margin: 0 0 0.25rem 0;
}

.lnk-modal-version {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--lnk-text-primary);
  margin: 0 0 1rem 0;
}

.lnk-modal-subtext {
  font-size: 0.875rem;
  color: var(--lnk-text-secondary);
  margin: 0 0 1.5rem 0;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.lnk-modal-brand {
  width: 140px;
  height: auto;
  margin: 1rem auto 0;
  display: block;
}

.lnk-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--lnk-accent-light);
}

.lnk-modal-btn-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lnk-cta);
  border: 1px solid var(--lnk-cta);
  color: #ffffff;
  font-family: 'Prompt', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  height: 40px;
  padding: 0 1.25rem;
  border-radius: var(--lnk-radius);
  cursor: pointer;
  transition: filter 150ms ease;
  box-shadow: none;
}

.lnk-modal-btn-close:hover {
  filter: brightness(0.9);
}

.lnk-modal-btn-close:focus {
  outline: none;
}


/* -------------------------------------------------------------------------
   Mermaid diagrams — specifico di GovCat docs (non presente in govdesk-docs)
   sphinxcontrib-mermaid impone di default un'altezza fissa di 500px agli
   SVG, che per diagrammi larghi e bassi (es. flowchart) lascia molto spazio
   vuoto sopra/sotto. Qui l'altezza segue le proporzioni naturali del
   diagramma, con un tetto massimo per quelli molto verticali.
   ------------------------------------------------------------------------- */
.mermaid > svg,
.mermaid-container > pre > svg {
  height: auto !important;
  max-height: 700px;
}
