@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap");

:root {
  --abisso: #0b2a45;
  --oceano: #16679b;
  --acqua: #26a6b8;
  --acqua-chiaro: #e3f4f6;
  --sabbia: #f4f1ea;
  --carta: #ffffff;
  --testo: #2a3644;
  --tenue: #6b7888;
  --linea: #dde5ec;
  --raggio: 12px;
  --ombra: 0 1px 2px rgba(11, 42, 69, .06), 0 8px 22px rgba(11, 42, 69, .08);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", "Pontano Sans", Arial, sans-serif;
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

body,
body.custom-background {
  margin: 0;
  background: var(--sabbia) !important;
  background-image: linear-gradient(180deg, #d9ecf3 0, var(--sabbia) 420px) !important;
  background-repeat: no-repeat !important;
  color: var(--testo);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

a,
.post-title a,
#comments > h4.current a { color: var(--oceano); text-decoration: none; transition: color .15s, background-color .15s; }
a:hover { color: var(--acqua); text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--acqua); outline-offset: 2px; border-radius: 3px; }

img { max-width: 100%; height: auto; }
iframe { max-width: 100%; }

.printonly { display: none !important; }
.clear { clear: both; }

/* ---------- Contenitore ---------- */

#container.container_16,
.container_16 {
  width: auto !important;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 30px;
  background: none;
}

/* ---------- Testata (immagine) ---------- */

#header {
  position: relative;
  width: auto !important;
  height: auto !important;
  margin: 20px 0 0;
  background: none !important;
  border-radius: var(--raggio) var(--raggio) 0 0;
  overflow: hidden;
  line-height: 0;
}
#header .header-img {
  position: static !important;
  display: block;
  width: 100%;
  height: auto;
  max-height: 300px;
  margin: 0 !important;
  object-fit: cover;
}
/* nome dell'unita' sopra l'immagine */
#header::after {
  content: "ULR CoNISMa \00B7  Milano-Bicocca";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 60px 28px 20px;
  background: linear-gradient(180deg, transparent, rgba(11, 42, 69, .82));
  color: #fff;
  font-family: var(--serif);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

/* ---------- Menu principale ---------- */

#nav {
  position: relative;
  z-index: 100;
  width: auto !important;
  height: auto !important;
  margin: 0 0 26px;
  padding: 0;
  background: var(--abisso) !important;
  border-radius: 0 0 var(--raggio) var(--raggio);
  box-shadow: var(--ombra);
}
#nav .menu-bottom-shadow { display: none; }
#header-menu-wrap { width: auto !important; padding: 0 12px; background: none !important; }

#header-menu,
#header-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
#header-menu {
  display: flex;
  flex-wrap: wrap;
  width: auto !important;
  background: none !important;
}
#header-menu > li {
  position: relative;
  float: none;
  margin: 0;
  background: none !important;
  border: 0 !important;
}
#header-menu > li > a {
  display: block;
  height: auto !important;
  padding: 15px 14px 13px !important;
  background: none !important;
  border: 0 !important;
  border-bottom: 3px solid transparent !important;
  color: #dbe7f1 !important;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.2;
  text-shadow: none !important;
  text-decoration: none !important;
}
#header-menu > li > a strong { font-weight: 600; }
#header-menu > li > a > span { display: none; } /* descrizioni vuote del tema */
#header-menu > li:hover > a,
#header-menu > li:focus-within > a {
  background: rgba(255, 255, 255, .07) !important;
  color: #fff !important;
}
#header-menu > li.current-menu-item > a,
#header-menu > li.current-menu-ancestor > a {
  border-bottom-color: var(--acqua) !important;
  color: #fff !important;
}
#header-menu > li.menu-item-has-children > a strong::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 0 3px 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: .7;
}

/* tendine */
#header-menu ul.sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 200;
  width: 240px !important;
  margin: 0;
  padding: 6px;
  background: var(--carta) !important;
  border: 0 !important;
  border-top: 3px solid var(--acqua) !important;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 16px 36px rgba(11, 42, 69, .22);
}
#header-menu li:hover > ul.sub-menu,
#header-menu li:focus-within > ul.sub-menu { display: block; }
#header-menu ul.sub-menu ul.sub-menu {
  top: -9px;
  left: 100%;
  margin: 0 0 0 4px !important;
  border-top: 0 !important;
  border-left: 3px solid var(--acqua) !important;
  border-radius: 0 10px 10px 0;
}
#header-menu ul.sub-menu li {
  position: relative;
  float: none;
  width: auto !important;
  margin: 0;
  background: none !important;
  border: 0 !important;
}
#header-menu ul.sub-menu li a {
  display: block;
  width: auto !important;
  height: auto !important;
  padding: 8px 12px !important;
  background: none !important;
  border: 0 !important;
  border-radius: 7px;
  color: var(--testo) !important;
  font-size: 14.5px;
  line-height: 1.35;
  text-shadow: none !important;
  text-decoration: none !important;
}
#header-menu ul.sub-menu li a:hover,
#header-menu ul.sub-menu li:hover > a {
  background: var(--acqua-chiaro) !important;
  color: var(--abisso) !important;
}
#header-menu ul.sub-menu li.menu-item-has-children > a::after {
  content: "\203A";
  float: right;
  color: var(--tenue);
}

/* ---------- Corpo: articoli + colonna destra ---------- */

#content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 28px;
  width: auto !important;
  min-height: 0 !important;
  margin: 0;
  padding: 0;
  background: none !important;
}
#content::after { display: none; }
#content-main,
#content-main.grid_11 {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  min-width: 0;
}
#sidebar1,
#sidebar1.grid_5 {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  min-width: 0;
}

/* ---------- Slider ---------- */

.featured_slider {
  width: auto !important;
  margin: 0 0 26px !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  border-radius: var(--raggio);
  overflow: hidden;
  box-shadow: var(--ombra);
}
.featured_slider #slider_root {
  width: auto !important;
  height: 200px !important;
}
.featured_slider .slider_post {
  position: relative;
  width: auto !important;
  height: 200px;
  background-size: cover !important;
  background-position: center !important;
}
.featured_slider .slider-entry-wrap {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: auto !important;
  height: auto !important;
  padding: 50px 24px 18px !important;
  background: linear-gradient(180deg, transparent, rgba(11, 42, 69, .8)) !important;
}
.featured_slider .slider-content-wrap { background: none !important; padding: 0 !important; }
.featured_slider .slider_post_title,
.featured_slider .slider_post_title a {
  margin: 0;
  color: #fff !important;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
.featured_slider .slider_post_entry:empty { display: none; }
.featured_slider .permalink-overlay span { display: none; }

.slider_nav {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  display: flex;
  gap: 6px;
  width: auto !important;
  background: none !important;
}
.slider_nav a {
  display: block;
  width: 10px !important;
  height: 10px !important;
  padding: 0 !important;
  background: rgba(255, 255, 255, .45) !important;
  border-radius: 50%;
  text-indent: -9999px;
  overflow: hidden;
}
.slider_nav a.active { background: #fff !important; }
.featured_slider { position: relative; }

/* ---------- Articoli ---------- */

.post {
  position: relative;
  margin: 0 0 24px !important;
  padding: 0 !important;
  background: var(--carta) !important;
  border: 0 !important;
  border-radius: var(--raggio);
  box-shadow: var(--ombra);
}
.post .entry {
  padding: 28px 32px 24px !important;
  background: none !important;
  border: 0 !important;
}

/* data in un badge "onda" */
.post .date {
  position: static !important;
  display: inline-flex;
  margin: 0 0 12px !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
  background: none !important;
}
.post .date .default_date {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  padding: 4px 12px;
  background: var(--acqua-chiaro) !important;
  border-radius: 999px;
  color: var(--oceano);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.post .date .day { font-size: 13px; order: -1; }
.post .date .month,
.post .date .day {
  position: static !important;
  display: inline !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  background: none !important;
  color: inherit !important;
  line-height: 1.4;
}

.post-title,
.post-title a {
  margin: 0 0 8px !important;
  padding: 0 !important;
  color: var(--abisso) !important;
  font-family: var(--serif);
  font-size: 27px !important;
  font-weight: 700;
  line-height: 1.25;
}
.post-title a:hover { color: var(--oceano) !important; text-decoration: none; }

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0 0 18px !important;
  padding: 0 0 14px !important;
  border-bottom: 1px solid var(--linea);
  color: var(--tenue);
  font-size: 14px;
}
.post-meta p { float: none !important; margin: 0 !important; padding: 0 !important; background: none !important; }
.post-meta .meta_categories a {
  padding: 2px 9px;
  background: var(--sabbia);
  border-radius: 999px;
  color: var(--tenue);
  font-size: 12.5px;
}

/* testo degli articoli: gli h4 usati come paragrafi tornano normali */
.entry-content {
  color: var(--testo);
  font-size: 16.5px;
  line-height: 1.75;
}
.entry-content p { margin: 0 0 14px; }
.entry-content p:has(> br:only-child),
.entry-content > p:empty { display: none; }
.entry-content h2,
.entry-content h3 {
  margin: 0 0 12px;
  color: var(--abisso);
  font-family: var(--serif);
  line-height: 1.3;
}
.entry-content h2 { font-size: 24px; }
.entry-content h3 { font-size: 19px; }
.entry-content h4 {
  margin: 0 0 14px;
  color: var(--testo);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.65;
  text-transform: none;
}
.entry-content h4 strong { font-weight: 700; }
.entry-content span[style*="font-family"] { font-family: inherit !important; }
.entry-content p[style*="justify"] { text-align: left !important; }

.entry-content ol,
.entry-content ul { margin: 0 0 16px; padding-left: 1.4em; }
.entry-content li { margin-bottom: 6px; }
.entry-content li h4 { margin: 0; }
.entry-content li::marker { color: var(--acqua); font-weight: 700; }

/* immagini: centrate, mai fuori misura */
.entry-content img,
.entry-content .alignleft,
.entry-content .alignright,
.entry-content .aligncenter {
  display: block;
  float: none !important;
  max-width: 100%;
  height: auto;
  margin: 18px auto !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  border-radius: 8px;
  box-shadow: none !important;
}
.entry-content a:has(img) { display: block; }

/* video YouTube a tutta larghezza */
.entry-content iframe[src*="youtube"] {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  margin: 8px auto 20px;
  border: 0;
  border-radius: 10px;
}

.entry-content blockquote {
  margin: 20px 0;
  padding: 12px 20px;
  background: var(--acqua-chiaro);
  border-left: 4px solid var(--acqua);
  border-radius: 0 10px 10px 0;
}

/* tag */
.entry-footer {
  margin: 18px 0 0 !important;
  padding: 14px 0 0 !important;
  border-top: 1px solid var(--linea);
  background: none !important;
}
.post-tags {
  margin: 0;
  padding: 0 !important;
  background: none !important;
  color: var(--tenue);
  font-size: 13.5px;
  line-height: 2;
}
.post-tags a {
  display: inline-block;
  margin: 0 2px;
  padding: 1px 10px;
  background: var(--sabbia);
  border-radius: 999px;
  color: var(--oceano);
  font-size: 12.5px;
  line-height: 1.7;
}
.post-tags a:hover { background: var(--oceano); color: #fff; text-decoration: none; }

/* paginazione */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin: 0 0 20px;
  padding: 0 !important;
  background: none !important;
}
.post-nav p { float: none !important; margin: 0; }
.post-nav a {
  display: inline-block;
  padding: 9px 20px;
  background: var(--abisso);
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
}
.post-nav a:hover { background: var(--oceano); color: #fff; text-decoration: none; }
.post-nav p:empty { display: none; }

/* ---------- Colonna destra ---------- */

#sidebar1 .sidebar-wrap {
  margin: 0 0 20px !important;
  padding: 20px 22px !important;
  background: var(--carta) !important;
  border: 0 !important;
  border-radius: var(--raggio);
  box-shadow: var(--ombra);
}
#sidebar1 .sidebar-wrap h3 {
  margin: 0 0 12px !important;
  padding: 0 0 10px !important;
  background: none !important;
  border-bottom: 2px solid var(--acqua) !important;
  color: var(--abisso) !important;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  text-shadow: none !important;
}
#sidebar1 ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
#sidebar1 li {
  margin: 0;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
}
#sidebar1 li a {
  display: block;
  padding: 5px 0;
  color: var(--testo);
}
#sidebar1 li a:hover { color: var(--oceano); }

/* archivi su due colonne */
#archives-3 ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 12px;
}
#archives-3 li a { font-size: 14.5px; padding: 3px 0; }

/* "Iscriviti al Forum" come invito */
#text-5 {
  background: linear-gradient(135deg, var(--oceano) 0%, var(--acqua) 100%) !important;
  color: #fff;
}
#text-5 h3 { color: #fff !important; border-bottom-color: rgba(255, 255, 255, .4) !important; }
#text-5 .textwidget a {
  display: inline-block;
  padding: 8px 20px;
  background: #fff;
  border-radius: 999px;
  color: var(--abisso);
  font-weight: 700;
}
#text-5 .textwidget a:hover { background: var(--abisso); color: #fff; text-decoration: none; }

/* ricerca */
#searchform .default_searchform {
  display: flex;
  margin: 0;
  padding: 0;
  background: none !important;
}
#searchform input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  margin: 0 !important;
  padding: 0 14px !important;
  background: var(--sabbia) !important;
  border: 1px solid var(--linea) !important;
  border-right: 0 !important;
  border-radius: 999px 0 0 999px;
  color: var(--testo);
  font: 15px var(--sans);
  box-shadow: none !important;
}
#searchform input[type="text"]:focus {
  outline: 0;
  background: #fff !important;
  border-color: var(--acqua) !important;
}
#searchform button {
  width: auto !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 16px !important;
  background: var(--oceano) !important;
  border: 0 !important;
  border-radius: 0 999px 999px 0;
  color: #fff;
  font: 600 14px var(--sans);
  text-indent: 0 !important;
  cursor: pointer;
}
#searchform button span {
  display: inline !important;
  position: static !important;
  color: #fff;
}
#searchform button:hover { background: var(--abisso) !important; }

/* calendario */
#wp-calendar {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: center;
}
#wp-calendar caption {
  margin-bottom: 8px;
  color: var(--abisso);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  text-transform: capitalize;
}
#wp-calendar th {
  padding: 4px 0;
  background: none !important;
  color: var(--tenue);
  font-size: 12px;
  font-weight: 600;
}
#wp-calendar td {
  padding: 5px 0;
  background: none !important;
  border: 0 !important;
}
#wp-calendar tbody td a {
  display: block;
  background: var(--acqua-chiaro);
  border-radius: 6px;
  font-weight: 700;
}
#wp-calendar #today {
  background: var(--oceano) !important;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
}
#wp-calendar tfoot td { padding-top: 8px; text-align: left; }
#wp-calendar tfoot #next { text-align: right; }

/* ---------- Loghi e indirizzo ---------- */

#sidebar_bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  width: auto !important;
  margin: 10px 0 0;
  padding: 24px 26px !important;
  background: var(--carta) !important;
  border: 0 !important;
  border-radius: var(--raggio) var(--raggio) 0 0;
  box-shadow: var(--ombra);
}
#sidebar_bottom .sidebar-wrap {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
}
#sidebar_bottom .textwidget { height: auto !important; }
#text-2 p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin: 0;
}
#text-2 p br { display: none; }
#text-2 img { max-height: 56px; width: auto; }
#text-3 .textwidget {
  color: var(--tenue);
  font-size: 13.5px !important;
  line-height: 1.6;
}
#text-3 p { margin: 0; text-align: left !important; }

/* ---------- Footer ---------- */

#footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  width: auto !important;
  height: auto !important;
  margin: 0;
  padding: 18px 26px !important;
  background: var(--abisso) !important;
  border-radius: 0 0 var(--raggio) var(--raggio);
  color: #b9c9d7;
  font-size: 13.5px;
}
#footer #copyright,
#footer .footer-menu-wrap,
#footer #developer {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
}
#footer #copyright h3 { display: none; }
#footer p { margin: 0; color: #b9c9d7; }
#footer #developer { display: flex; gap: 6px 14px; flex-wrap: wrap; }
#footer #developer .sidebar-wrap { margin: 0 !important; padding: 0 !important; background: none !important; border: 0 !important; }
#footer #developer .textwidget { color: #8fa6ba; }
#footer-menu { margin: 0; padding: 0; list-style: none; }
#footer-menu li { margin: 0; padding: 0; background: none !important; border: 0 !important; }
#footer-menu a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px;
  color: #fff;
  font-weight: 600;
}
#footer-menu a::before { content: "\2191  "; }
#footer-menu a:hover { background: var(--acqua); border-color: var(--acqua); text-decoration: none; }
#footer a { color: #d7e6f1; }

/* ---------- Forum bbPress e pagine (stili di base) ---------- */

#bbpress-forums {
  font-size: 15px;
}
#bbpress-forums li.bbp-header {
  background: var(--abisso) !important;
  border: 0 !important;
  color: #fff;
}
#bbpress-forums li.bbp-header a { color: #fff; }
#bbpress-forums ul.bbp-forums,
#bbpress-forums ul.bbp-topics,
#bbpress-forums ul.bbp-replies {
  border-color: var(--linea) !important;
  border-radius: 10px;
  overflow: hidden;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.entry-content th,
.entry-content td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--linea);
  text-align: left;
  vertical-align: top;
}
.entry-content th { background: var(--acqua-chiaro); color: var(--abisso); }

#page-list-ext { background: var(--acqua-chiaro) !important; border-radius: 10px; }

/* ---------- Tablet ---------- */

@media (max-width: 960px) {
  #content { grid-template-columns: minmax(0, 1fr) 250px; gap: 20px; }
  .post .entry { padding: 22px 22px 20px !important; }
}

/* ---------- Telefono ---------- */

@media (max-width: 760px) {
  #container.container_16,
  .container_16 { padding: 0 10px 20px; }
  #header { margin-top: 10px; }
  #header::after { padding: 40px 16px 12px; }

  #header-menu > li > a { padding: 11px 10px 9px !important; font-size: 14px; }
  #header-menu ul.sub-menu { width: 220px !important; }
  #header-menu ul.sub-menu ul.sub-menu {
    position: static;
    width: auto !important;
    margin: 2px 0 4px 10px !important;
    box-shadow: none;
    border-left-width: 2px !important;
  }

  #content { grid-template-columns: minmax(0, 1fr); }

  .featured_slider #slider_root,
  .featured_slider .slider_post { height: 150px !important; }
  .featured_slider .slider_post_title,
  .featured_slider .slider_post_title a { font-size: 22px; }

  .post-title, .post-title a { font-size: 22px !important; }
  .entry-content { font-size: 16px; }
  .entry-content h4 { font-size: 16px; }

  #sidebar_bottom { grid-template-columns: minmax(0, 1fr); padding: 18px !important; }
  #footer { flex-direction: column; align-items: flex-start; }
}

@media print {
  body, body.custom-background { background: #fff !important; }
  #nav, #sidebar1, .featured_slider, #sidebar_bottom, #footer-menu { display: none !important; }
  #content { display: block; }
  .post { box-shadow: none; }
}