/*
 * RHpositive — Cassiopeia child template
 * user.css
 *
 * Direzione visiva: editoriale, leggera, contemporanea.
 * Colore identitario: #3b82c4
 */

:root {
  --rh-blue: #3b82c4;
  --rh-blue-dark: #225f97;
  --rh-blue-soft: #e7f0f8;
  --rh-blue-pale: #f4f8fc;
  --rh-ink: #202a33;
  --rh-muted: #65717d;
  --rh-line: #dfe7ee;
  --rh-surface: #ffffff;
  --rh-page: #f7f9fb;
  --rh-radius: 0.75rem;
  --rh-shadow: 0 0.5rem 1.75rem rgb(31 50 68 / 7%);
  --cassiopeia-color-primary: var(--rh-blue-dark);
  --cassiopeia-color-link: var(--rh-blue-dark);
  --cassiopeia-color-hover: var(--rh-blue);
}

/* Base */

html {
  scroll-behavior: smooth;
}

body.site {
  color: var(--rh-ink);
  background: var(--rh-page);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--rh-blue-dark);
  text-decoration-color: rgb(59 130 196 / 35%);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition: color 160ms ease, text-decoration-color 160ms ease;
}

a:hover,
a:focus-visible {
  color: var(--rh-blue);
  text-decoration-color: currentColor;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--rh-ink);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
}

h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.15rem);
}

h3 {
  font-size: clamp(1.15rem, 1.7vw, 1.45rem);
}

img {
  max-width: 100%;
  height: auto;
}

::selection {
  color: var(--rh-ink);
  background: #cfe4f6;
}

/* Accessibilita */

:focus-visible {
  outline: 3px solid rgb(59 130 196 / 45%);
  outline-offset: 3px;
}

/* Testata */

.container-header {
  position: relative;
  z-index: 10;
  color: var(--rh-ink);
  background: var(--rh-surface);
  background-image: none;
  border-top: 0.4rem solid var(--rh-blue);
  border-bottom: 1px solid var(--rh-line);
  box-shadow: 0 0.25rem 1rem rgb(31 50 68 / 5%);
}

.container-header .grid-child {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.container-header .navbar-brand {
  margin: 0;
}

.container-header .navbar-brand img {
  width: auto;
  max-height: 5.25rem;
}

.container-header .site-description {
  margin-top: 0.25rem;
  color: var(--rh-muted);
  font-size: 0.9rem;
  letter-spacing: 0.015em;
}

/* Menu principale */

.container-header .container-nav {
  padding-top: 0;
  padding-bottom: 0;
  background: var(--rh-blue-soft);
}

.container-header .mod-menu {
  color: var(--rh-ink);
}

.container-header .mod-menu > li > a,
.container-header .mod-menu > li > span {
  position: relative;
  padding: 0.85rem 1rem;
  color: var(--rh-ink);
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.025em;
  text-decoration: none;
}

.container-header .mod-menu > li > a::after {
  position: absolute;
  right: 1rem;
  bottom: 0.55rem;
  left: 1rem;
  height: 2px;
  content: "";
  background: var(--rh-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.container-header .mod-menu > li > a:hover::after,
.container-header .mod-menu > li.active > a::after,
.container-header .mod-menu > li.current > a::after {
  transform: scaleX(1);
}

.container-header .mod-menu > li.active > a,
.container-header .mod-menu > li.current > a {
  color: var(--rh-blue-dark);
}

.container-header .navbar-toggler {
  color: var(--rh-blue-dark);
  border: 1px solid rgb(59 130 196 / 35%);
}

/* Fascia superiore e lingue */

.container-topbar {
  color: var(--rh-muted);
  background: var(--rh-blue-soft);
  border-bottom: 1px solid rgb(59 130 196 / 14%);
  font-size: 0.84rem;
}

.container-topbar .grid-child {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 2.75rem;
}

.container-topbar .mod-languages {
  margin-inline-start: auto;
}

.container-topbar .mod-languages ul {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.container-topbar .mod-languages li {
  opacity: 0.58;
  transition: opacity 160ms ease;
}

.container-topbar .mod-languages li:hover,
.container-topbar .mod-languages li:focus-within,
.container-topbar .mod-languages li.lang-active,
.container-topbar .mod-languages li.active {
  opacity: 1;
}

.container-topbar .mod-languages a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.65rem;
  color: var(--rh-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  text-decoration: none;
}

.container-topbar .mod-languages li.lang-active a,
.container-topbar .mod-languages li.active a,
.container-topbar .mod-languages a[aria-current="true"],
.container-topbar .mod-languages a[aria-current="page"] {
  color: var(--rh-blue-dark);
  background: #fff;
  border-color: rgb(59 130 196 / 28%);
  box-shadow: 0 2px 8px rgb(30 74 110 / 10%);
  font-weight: 750;
}

.container-topbar .mod-languages li.lang-active img,
.container-topbar .mod-languages li.active img {
  border-radius: 0.12rem;
  box-shadow: 0 0 0 2px var(--rh-blue);
}

/* Impaginazione */

.site-grid {
  gap: clamp(1.25rem, 3vw, 2.5rem);
}

.grid-child {
  max-width: 82rem;
}

.container-component {
  padding-top: clamp(1.5rem, 4vw, 3.5rem);
  padding-bottom: clamp(2rem, 5vw, 4.5rem);
}

.page-header,
.page-header h1,
.page-header h2 {
  margin-top: 0;
}

.page-header {
  margin-bottom: 1.5rem;
}

/* Introduzione o modulo in posizione top-a */

.container-top-a {
  background: linear-gradient(135deg, var(--rh-blue-soft), var(--rh-blue-pale));
  border-bottom: 1px solid var(--rh-line);
}

.container-top-a .mod-custom,
.container-top-a .moduletable {
  max-width: 72rem;
  padding: clamp(1.5rem, 4vw, 3.25rem) 0;
}

.container-top-a p:last-child {
  margin-bottom: 0;
}

/* Blog: schede editoriali */

.blog-items {
  gap: 1.4rem;
}

.blog-items .blog-item,
article.blog-item {
  position: relative;
  overflow: hidden;
  padding: clamp(1.15rem, 2.5vw, 1.75rem);
  background: var(--rh-surface);
  border: 1px solid var(--rh-line);
  border-radius: var(--rh-radius);
  box-shadow: var(--rh-shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease,
    transform 180ms ease;
}

.blog-items .blog-item:hover,
article.blog-item:hover {
  border-color: rgb(59 130 196 / 35%);
  box-shadow: 0 0.75rem 2rem rgb(31 50 68 / 11%);
  transform: translateY(-2px);
}

.blog-items .blog-item .item-image,
article.blog-item .item-image {
  margin: calc(clamp(1.15rem, 2.5vw, 1.75rem) * -1);
  margin-bottom: 1.25rem;
}

.blog-items .blog-item .item-image img,
article.blog-item .item-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.blog-items .blog-item h2,
.blog-items .blog-item .item-title,
article.blog-item h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.blog-items .blog-item h2 a,
.blog-items .blog-item .item-title a,
article.blog-item h2 a {
  color: var(--rh-ink);
  text-decoration: none;
}

.blog-items .blog-item h2 a:hover,
.blog-items .blog-item .item-title a:hover,
article.blog-item h2 a:hover {
  color: var(--rh-blue-dark);
}

.blog-items .blog-item .article-info,
article.blog-item .article-info {
  color: var(--rh-muted);
  font-size: 0.82rem;
}

.blog-items .blog-item .readmore,
article.blog-item .readmore {
  margin-top: 1.15rem;
}

.blog-items .blog-item .readmore .icon-chevron-right,
article.blog-item .readmore .icon-chevron-right {
  display: none;
}

.blog-items .blog-item .readmore a,
article.blog-item .readmore a {
  display: inline-flex;
  align-items: center;
  min-height: 2.55rem;
  padding: 0.45rem 0.9rem;
  color: var(--rh-blue-dark);
  background: var(--rh-blue-soft);
  border: 1px solid rgb(59 130 196 / 22%);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
}

.blog-items .blog-item .readmore a:hover,
article.blog-item .readmore a:hover {
  color: #fff;
  background: var(--rh-blue-dark);
  border-color: var(--rh-blue-dark);
}

/* Articolo singolo */

.com-content-article {
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background: var(--rh-surface);
  border: 1px solid var(--rh-line);
  border-radius: var(--rh-radius);
  box-shadow: var(--rh-shadow);
}

.com-content-article .page-header,
.com-content-article__body,
.com-content-article > .article-info,
.com-content-article > .tags {
  width: min(100%, 70ch);
  max-width: 70ch;
  margin-right: auto;
  margin-left: clamp(2rem, 10vw, 9rem);
}

.com-content-article .item-image {
  float: none !important;
  overflow: hidden;
  width: min(82%, 62rem);
  max-height: 32rem;
  margin: 0 auto 2.25rem 0;
  border-radius: calc(var(--rh-radius) - 0.2rem);
}

.com-content-article .item-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 32rem;
  aspect-ratio: 16 / 8;
  object-fit: cover;
}

.article-info {
  margin-bottom: 1rem;
  color: var(--rh-muted);
  font-size: 0.84rem;
}

.com-content-article blockquote {
  margin: 1.75rem 0;
  padding: 0.8rem 0 0.8rem 1.25rem;
  color: #344454;
  border-left: 4px solid var(--rh-blue);
}

/* Elenchi nel corpo degli articoli: il segno + riprende il logo. */

.com-content-article__body ul {
  padding-left: 1.55rem;
  list-style: none;
}

.com-content-article__body ul > li {
  position: relative;
  margin-bottom: 0.4rem;
}

.com-content-article__body ul > li::before {
  position: absolute;
  top: 0;
  left: -1.35rem;
  content: "+";
  color: var(--rh-blue);
  font-weight: 750;
}

/* Etichette e tag */

.tags,
.com-tags-tag__category {
  gap: 0.4rem;
}

.tags .tag,
.tags a,
.badge,
.label {
  display: inline-flex;
  align-items: center;
  padding: 0.24rem 0.58rem;
  color: var(--rh-blue-dark);
  background: var(--rh-blue-soft);
  border: 1px solid rgb(59 130 196 / 18%);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  text-decoration: none;
}

/* Colonna laterale */

.container-sidebar-left,
.container-sidebar-right {
  padding-top: clamp(1.5rem, 4vw, 3.5rem);
  padding-bottom: clamp(2rem, 5vw, 4.5rem);
}

.container-sidebar-left .moduletable,
.container-sidebar-right .moduletable,
.container-sidebar-left .card,
.container-sidebar-right .card {
  margin-bottom: 1rem;
  padding: 1.15rem;
  background: rgb(255 255 255 / 78%);
  border: 1px solid var(--rh-line);
  border-radius: var(--rh-radius);
  box-shadow: none;
}

.container-sidebar-left h3,
.container-sidebar-right h3,
.container-sidebar-left .card-header,
.container-sidebar-right .card-header {
  margin: 0 0 0.8rem;
  padding: 0 0 0.55rem;
  color: var(--rh-blue-dark);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--rh-blue-soft);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.container-sidebar-left ul,
.container-sidebar-right ul {
  margin-bottom: 0;
  padding-left: 1.1rem;
}

.container-sidebar-left li,
.container-sidebar-right li {
  margin-bottom: 0.45rem;
  line-height: 1.45;
}

.container-sidebar-left a,
.container-sidebar-right a {
  font-size: 0.91rem;
  text-decoration: none;
}

/* Ricerca e moduli form */

input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea,
select,
.form-control,
.form-select {
  color: var(--rh-ink);
  background-color: #fff;
  border-color: #cfd9e2;
  border-radius: 0.45rem;
}

input:focus,
textarea:focus,
select:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--rh-blue);
  box-shadow: 0 0 0 0.2rem rgb(59 130 196 / 16%);
}

.btn-primary {
  color: #fff;
  background-color: var(--rh-blue-dark);
  border-color: var(--rh-blue-dark);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--rh-blue);
  border-color: var(--rh-blue);
}

/* Breadcrumb */

.mod-breadcrumbs,
.breadcrumb {
  color: var(--rh-muted);
  background: transparent;
  font-size: 0.82rem;
}

.breadcrumb a {
  text-decoration: none;
}

/* Paginazione */

.pagination {
  gap: 0.25rem;
  margin-top: 2rem;
}

.page-link {
  color: var(--rh-blue-dark);
  border-color: var(--rh-line);
  border-radius: 0.35rem;
}

.page-item.active .page-link {
  background: var(--rh-blue-dark);
  border-color: var(--rh-blue-dark);
}

/* Footer */

.container-bottom-a,
.container-bottom-b {
  color: var(--rh-ink);
  background: var(--rh-blue-soft);
  border-top: 1px solid rgb(59 130 196 / 14%);
}

.container-footer {
  color: #4f5d69;
  background: #f1f5f8;
  background-image: none;
  border-top: 1px solid var(--rh-line);
  box-shadow: none;
}

.container-footer .grid-child {
  align-items: flex-start;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.container-footer a {
  color: var(--rh-blue-dark);
}

.container-footer p {
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.55;
}

.back-to-top-link {
  color: #fff;
  background: var(--rh-blue-dark);
  border-color: var(--rh-blue-dark);
}

/* Tabelle e contenuti incorporati */

.table,
table {
  border-color: var(--rh-line);
}

.table > :not(caption) > * > *,
table th,
table td {
  padding: 0.7rem;
}

iframe,
video {
  max-width: 100%;
}

/* Responsive */

@media (max-width: 991.98px) {
  .container-header .grid-child {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .container-header .navbar-brand img {
    max-height: 4.25rem;
  }

  .container-header .container-nav {
    padding: 0.35rem 0;
  }

  .container-header .mod-menu > li > a,
  .container-header .mod-menu > li > span {
    padding: 0.7rem 0.5rem;
  }

  .container-header .mod-menu > li > a::after {
    right: 0.5rem;
    left: 0.5rem;
  }

  .container-sidebar-left,
  .container-sidebar-right {
    padding-top: 0;
  }

}

@media (max-width: 767.98px) {
  body.site {
    font-size: 0.97rem;
  }

  .grid-child {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .blog-items {
    display: block;
    column-count: 1 !important;
    column-gap: 0 !important;
    grid-template-columns: 1fr !important;
  }

  .blog-items .blog-item,
  article.blog-item,
  .com-content-article {
    width: 100%;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 0.55rem;
    break-inside: avoid;
  }

  .blog-items .blog-item .item-image,
  article.blog-item .item-image {
    margin: -1rem -1rem 1rem;
  }

  .blog-items .blog-item .item-image img,
  article.blog-item .item-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .com-content-article {
    padding: 1rem;
  }

  .com-content-article .page-header,
  .com-content-article__body,
  .com-content-article > .article-info,
  .com-content-article > .tags {
    width: 100%;
    margin-left: 0;
  }

  .com-content-article .item-image {
    width: 100%;
    max-height: none;
    margin: 0 0 1.5rem;
  }

  .com-content-article .item-image img {
    height: auto;
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .container-footer .grid-child {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
