/* AW Category Carousel: public rules are confined to this component. */
.aw-cc {
  width: 100%;
  max-width: var(--aw-cc-max-width, 1100px);
  min-width: 0;
  margin: 0 auto;
  padding: 0;
  color: inherit;
  font-family: inherit;
  isolation: isolate;
  --aw-cc-control-size: max(44px, calc(var(--aw-cc-arrow-size, 26px) + 8px));
}
.aw-cc *, .aw-cc *::before, .aw-cc *::after { box-sizing: border-box; }
.aw-cc [hidden] { display: none !important; }
.aw-cc .aw-cc-categories {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--aw-cc-gap, 10px);
  margin: 0;
  /* L'opzione del carosello prevale sui margini applicati dal tema ai contenuti. */
  margin-bottom: var(--aw-cc-category-gap, 20px) !important;
  padding: 0;
  width: 100%;
  min-width: 0;
}
.aw-cc .aw-cc-category {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: var(--aw-cc-padding-y, 12px) var(--aw-cc-padding-x, 18px);
  border: 0;
  border-radius: var(--aw-cc-radius, 6px);
  background: var(--aw-cc-bg-color, #f1f1f1);
  color: var(--aw-cc-text-color, #252525);
  font: inherit;
  font-size: var(--aw-cc-font-size, 16px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: normal;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: none;
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease;
}
@media (hover: hover) {
  .aw-cc .aw-cc-category:hover {
    color: var(--aw-cc-hover-text, #111111);
    background: var(--aw-cc-hover-bg, #e0e0e0);
  }
}
.aw-cc .aw-cc-category[aria-pressed="true"] {
  color: var(--aw-cc-active-text, #ffffff);
  background: var(--aw-cc-active-bg, #333333);
}
.aw-cc .aw-cc-current-category {
  padding: 0;
  margin: 0;
  margin-bottom: var(--aw-cc-category-gap, 20px) !important;
  font: inherit;
  font-size: var(--aw-cc-font-size, 16px);
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}
.aw-cc .aw-cc-track {
  display: grid;
  grid-template-columns: var(--aw-cc-track-columns, var(--aw-cc-control-size) minmax(0, 1fr) var(--aw-cc-control-size));
  gap: 8px;
  align-items: start;
  min-width: 0;
}
.aw-cc .aw-cc-slides {
  grid-column: var(--aw-cc-slide-column, 2);
  grid-row: 1;
  display: grid;
  min-width: 0;
  width: 100%;
  touch-action: pan-y pinch-zoom;
}
.aw-cc .aw-cc-slide {
  grid-area: 1 / 1;
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  visibility: hidden;
  pointer-events: none;
}
.aw-cc .aw-cc-slide--active { visibility: visible; pointer-events: auto; }
.aw-cc .aw-cc-media {
  width: 100%;
  min-width: 0;
  aspect-ratio: var(--aw-cc-ratio, 4 / 3);
  overflow: hidden;
  position: relative;
}
.aw-cc .aw-cc-media .aw-cc-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
  object-position: center;
  user-select: none;
  -webkit-user-drag: none;
}
.aw-cc .aw-cc-caption {
  margin: 0;
  padding: 14px 0 0;
  font: inherit;
  font-size: 15px;
  line-height: 1.55;
  text-align: center;
  overflow-wrap: anywhere;
}
.aw-cc .aw-cc-caption:empty { padding: 0; }
.aw-cc .aw-cc-caption p { margin: 0 0 .6em; padding: 0; }
.aw-cc .aw-cc-caption p:last-child { margin-bottom: 0; }
.aw-cc .aw-cc-arrow {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-row: 1;
  width: var(--aw-cc-control-size);
  height: var(--aw-cc-control-size);
  min-width: 44px;
  min-height: 44px;
  margin: max(0px, calc(var(--aw-cc-media-mid, 180px) - var(--aw-cc-control-size) / 2)) 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--aw-cc-arrow-bg, transparent);
  color: var(--aw-cc-arrow-color, #333333);
  font: inherit;
  line-height: 1;
  box-shadow: none;
  cursor: pointer;
}
.aw-cc .aw-cc-arrow--prev { grid-column: 1; }
.aw-cc .aw-cc-arrow--next { grid-column: 3; }
.aw-cc .aw-cc-arrow svg {
  display: block;
  width: var(--aw-cc-arrow-size, 26px);
  height: var(--aw-cc-arrow-size, 26px);
  max-width: 100%;
  max-height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.aw-cc .aw-cc-arrow:disabled { opacity: .3; cursor: default; }
@media (hover: hover) {
  .aw-cc .aw-cc-arrow:not(:disabled):hover { background: var(--aw-cc-arrow-hover-bg, rgba(127, 127, 127, .12)); }
}
.aw-cc:focus-visible,
.aw-cc .aw-cc-category:focus-visible,
.aw-cc .aw-cc-arrow:focus-visible,
.aw-cc .aw-cc-bullet:focus-visible,
.aw-cc .aw-cc-caption a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}
.aw-cc.aw-cc--single .aw-cc-track { grid-template-columns: minmax(0, 1fr); }
.aw-cc.aw-cc--single .aw-cc-slides { grid-column: 1; }
.aw-cc .aw-cc-error { margin: 0; padding: 20px 0; text-align: center; }
.aw-cc .aw-cc-nojs { margin-top: 16px; }
.aw-cc .aw-cc-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
@media (max-width: 480px) {
  .aw-cc .aw-cc-track { gap: 2px; }
  .aw-cc .aw-cc-caption { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .aw-cc .aw-cc-category { transition: none; }
}

/* FRONTEND > NAVIGAZIONE A PALLINI COMPATTA E ACCESSIBILE */
.aw-cc .aw-cc-bullets {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 12px 0 0;
  padding: 4px 0;
}
.aw-cc .aw-cc-bullet-list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: var(--aw-cc-bullet-gap, 6px);
  width: max-content;
  max-width: 100%;
  min-width: 44px;
  min-height: 44px;
  margin: 0 auto;
  padding: 0;
  cursor: pointer;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
.aw-cc .aw-cc-bullet {
  display: block;
  flex: 0 0 var(--aw-cc-bullet-size, 10px);
  width: var(--aw-cc-bullet-size, 10px);
  height: var(--aw-cc-bullet-size, 10px);
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--aw-cc-bullet-color, #b8b8b8);
  box-shadow: none;
  pointer-events: none;
}
.aw-cc .aw-cc-bullet[aria-current="true"] { background: var(--aw-cc-bullet-active-color, #333333); }
.aw-cc .aw-cc-bullet--edge { opacity: .45; }
.aw-cc .aw-cc-bullet-list:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
@media (forced-colors: active) {
  .aw-cc .aw-cc-bullet { background: CanvasText; }
  .aw-cc .aw-cc-bullet[aria-current="true"] { background: Highlight; outline: 2px solid CanvasText; }
}

/* FRONTEND > CONTEGGI E APERTURA IMMAGINE */
.aw-cc .aw-cc-category-count { white-space: pre; font-variant-numeric: tabular-nums; }
.aw-cc .aw-cc-category-position {
  margin: 12px 0 0;
  padding: 0;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.aw-cc .aw-cc-open {
  appearance: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
  cursor: zoom-in;
  touch-action: pan-y pinch-zoom;
}
.aw-cc .aw-cc-open svg {
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .65);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.aw-cc .aw-cc-open:focus-visible { outline: 3px solid #4775b5; outline-offset: -3px; }

/* LIGHTBOX > IL DIALOG E NEL TOP LAYER, FUORI DAI CONTENITORI DEL TEMA */
html.aw-cc-lightbox-open { overflow: hidden; }
dialog.aw-cc-lightbox {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: calc(100% - 32px);
  max-width: 1800px;
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  max-height: none;
  margin: auto;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: #171717;
  color: #fff;
  font: 16px/1.5 system-ui, sans-serif;
  overflow: hidden;
  box-shadow: 0 12px 60px #0008;
}
dialog.aw-cc-lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; }
.aw-cc-lightbox::backdrop { background: rgba(0, 0, 0, .85); }
.aw-cc-lightbox *, .aw-cc-lightbox *::before, .aw-cc-lightbox *::after { box-sizing: border-box; }
.aw-cc-lightbox [hidden] { display: none !important; }
.aw-cc-lightbox .aw-cc-lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.aw-cc-lightbox .aw-cc-lightbox-original { color: #fff; font: inherit; font-size: 14px; padding: 10px 4px; text-decoration: underline; overflow-wrap: anywhere; }
.aw-cc-lightbox button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #333;
  color: #fff;
  font: 32px/1 system-ui, sans-serif;
  box-shadow: none;
  cursor: pointer;
}
.aw-cc-lightbox button:hover { background: #555; }
.aw-cc-lightbox button:disabled { opacity: .3; cursor: default; }
.aw-cc-lightbox button:focus-visible, .aw-cc-lightbox a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.aw-cc-lightbox .aw-cc-lightbox-stage { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 0; }
.aw-cc-lightbox .aw-cc-lightbox-media { flex: 1 1 0; height: 100%; min-height: 0; min-width: 0; touch-action: pan-y pinch-zoom; }
.aw-cc-lightbox .aw-cc-lightbox-image { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; padding: 0; border: 0; border-radius: 0; object-fit: contain; object-position: center; user-select: none; -webkit-user-drag: none; }
.aw-cc-lightbox button svg { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aw-cc-lightbox .aw-cc-lightbox-info { text-align: center; max-height: 24vh; overflow-y: auto; overflow-wrap: anywhere; }
.aw-cc-lightbox .aw-cc-lightbox-position { margin: 0; padding: 0; color: inherit; font: inherit; font-variant-numeric: tabular-nums; }
.aw-cc-lightbox .aw-cc-lightbox-caption { margin: 8px 0 0; padding: 0; color: #eee; font: inherit; font-size: 14px; }
.aw-cc-lightbox .aw-cc-lightbox-caption p { margin: 0 0 .5em; padding: 0; }
.aw-cc-lightbox .aw-cc-lightbox-caption a { color: #fff; text-decoration: underline; }
@media (max-width: 600px) {
  dialog.aw-cc-lightbox { width: 100%; height: 100vh; height: 100dvh; max-width: 100%; margin: 0; padding: 8px; border-radius: 0; }
  .aw-cc-lightbox .aw-cc-lightbox-stage { gap: 2px; }
}
