/* BNSS Models — scheda profilo, builder, anteprima admin */
/* Split from frontend.css — see frontend-gallery.css for elenco/filtri/group */

/* Scheda ragazza — profilo singolo */
.mam-profile-wrap {
  max-width: 1100px;
  margin: 0 auto;
  font-family: var(--mam-font);
  color: var(--mam-primary);
  background: var(--mam-profile-page-bg, transparent);
  padding: clamp(12px, 2vw, 24px);
  box-sizing: border-box;
  text-align: var(--mam-align);
  --mam-profile-media-width: 58%;
  --mam-profile-text-width: 42%;
  --mam-profile-stage-max: 100%;
}

.mam-profile-body,
.mam-profile-builder-rows {
  background: var(--mam-card-bg, #fff);
  border-radius: var(--mam-card-border-radius, var(--mam-radius, 18px));
  border: var(--mam-card-border-width, 0) var(--mam-card-border-style, solid) var(--mam-card-border-color, var(--mam-card-bg, #fff));
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.mam-profile-wrap.mam-profile-shadow-none .mam-profile-body,
.mam-profile-wrap.mam-profile-shadow-none .mam-profile-builder-rows {
  box-shadow: none;
}

.mam-profile-wrap.mam-profile-shadow-soft .mam-profile-body,
.mam-profile-wrap.mam-profile-shadow-soft .mam-profile-builder-rows {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.mam-profile-wrap.mam-profile-shadow-medium .mam-profile-body,
.mam-profile-wrap.mam-profile-shadow-medium .mam-profile-builder-rows {
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.13);
}

.mam-profile-wrap.mam-profile-shadow-strong .mam-profile-body,
.mam-profile-wrap.mam-profile-shadow-strong .mam-profile-builder-rows {
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.22);
}

.mam-profile-wrap.mam-profile-card-minimal .mam-profile-body,
.mam-profile-wrap.mam-profile-card-minimal .mam-profile-builder-rows {
  box-shadow: none;
  border-radius: 0;
}

.mam-profile-wrap.mam-profile-card-luxury .mam-profile-body,
.mam-profile-wrap.mam-profile-card-luxury .mam-profile-builder-rows {
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
  letter-spacing: 0.03em;
}

.mam-profile-wrap.mam-profile-card-bordered .mam-profile-body,
.mam-profile-wrap.mam-profile-card-bordered .mam-profile-builder-rows {
  box-shadow: none;
}

.mam-profile-body {
  display: grid;
  gap: 0;
}

.mam-profile-layout-side .mam-profile-body {
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
}

.mam-profile-layout-stack .mam-profile-body {
  grid-template-columns: 1fr;
}

.mam-profile-gallery {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: var(--mam-card-padding, 24px);
  background: transparent;
  width: 100%;
  box-sizing: border-box;
}

.mam-profile-photo-frame {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--mam-img-size, 100%);
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: var(--mam-ratio, 3/4);
  background: var(--mam-profile-photo-frame-bg, transparent);
  border-width: var(--mam-img-border-width, 0);
  border-style: var(--mam-img-border-style, solid);
  border-color: var(--mam-img-border-color, transparent);
  border-radius: var(--mam-profile-photo-radius, var(--mam-radius, 18px));
  overflow: hidden;
}

.mam-photo-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--mam-profile-photo-frame-bg, transparent);
  border-radius: inherit;
}

.mam-profile-photo-frame.mam-profile-photo-empty,
.mam-profile-stage-empty {
  background: transparent;
}

.mam-profile-media-frame {
  width: var(--mam-profile-media-width, 100%);
  max-width: 100%;
  height: var(--mam-profile-media-height, auto);
  aspect-ratio: var(--mam-profile-media-ratio, var(--mam-ratio, 3/4));
  position: relative;
  box-sizing: border-box;
}

.mam-profile-media-frame > .mam-photo-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.mam-profile-media-frame[data-width-mode="auto"] {
  width: auto;
  max-width: 100%;
}

.mam-profile-media-frame[data-height-mode="custom"] {
  aspect-ratio: unset;
  height: var(--mam-profile-media-height, auto);
}

.mam-profile-media-frame[data-height-mode="auto"][data-width-mode="custom"] {
  height: auto;
  aspect-ratio: var(--mam-profile-media-ratio, var(--mam-ratio, 3/4));
}

.mam-profile-media-frame[data-height-mode="auto"][data-width-mode="auto"] {
  width: 100%;
  height: auto;
  aspect-ratio: var(--mam-profile-media-ratio, var(--mam-ratio, 3/4));
}

.mam-profile-media-frame .mam-profile-embed {
  min-height: 0;
}

.mam-profile-media-frame[data-height-mode="custom"] .mam-profile-embed {
  min-height: 100%;
}

.mam-photo-inner img,
.mam-photo-inner video,
.mam-profile-stage img,
.mam-profile-stage video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  background: var(--mam-profile-photo-frame-bg, transparent);
  border-radius: inherit;
}

.mam-profile-stage-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--mam-secondary);
  font-weight: 700;
}

.mam-profile-embed {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 280px;
}

.mam-profile-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.mam-profile-wrap.mam-profile-shape-square .mam-profile-photo-frame {
  aspect-ratio: 1/1;
}

.mam-profile-wrap.mam-profile-shape-rounded .mam-profile-photo-frame,
.mam-profile-wrap.mam-profile-shape-rounded .mam-photo-inner {
  border-radius: 24px;
}

.mam-profile-wrap.mam-profile-shape-circle .mam-profile-photo-frame {
  aspect-ratio: 1/1;
  max-width: min(100%, 420px);
  border-radius: 999px;
}

.mam-profile-wrap.mam-profile-shape-circle .mam-photo-inner,
.mam-profile-wrap.mam-profile-shape-circle .mam-photo-inner img {
  border-radius: 999px;
}

.mam-profile-wrap.mam-profile-shape-pill .mam-profile-photo-frame,
.mam-profile-wrap.mam-profile-shape-pill .mam-photo-inner {
  border-radius: 999px;
}

.mam-profile-wrap.mam-profile-shape-rounded .mam-photo-inner img,
.mam-profile-wrap.mam-profile-shape-pill .mam-photo-inner img {
  border-radius: inherit;
}

.mam-profile-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.mam-profile-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  overflow: hidden;
  background: #eee;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.mam-profile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mam-profile-thumb.is-active {
  border-color: #7c3aed;
  transform: translateY(-2px);
}

.mam-profile-thumb-video {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #312e81, #7c3aed);
  color: #fff;
  font-size: 22px;
}

.mam-profile-thumb-empty span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-weight: 800;
  color: #666;
}

.mam-profile-side {
  padding: var(--mam-card-padding, 24px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  box-sizing: border-box;
}

.mam-profile-head h1,
.mam-profile-side h2 {
  margin: 0;
  font-size: var(--mam-title-size, 32px);
  font-weight: var(--mam-title-weight, 700);
  line-height: 1.1;
  color: var(--mam-primary);
}

.mam-profile-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--mam-block-gap, 10px);
}

.mam-profile-desc {
  color: var(--mam-primary, #111827);
  line-height: 1.65;
  font-size: var(--mam-text-size, 15px);
}

.mam-profile-empty {
  color: #666;
}

.mam-profile-preview {
  max-width: 100%;
  padding: 0;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.mam-profile-preview .mam-profile-side h2 {
  font-size: var(--mam-title-size, 22px);
}

.mam-profile-preview .mam-profile-stage {
  min-height: 220px;
}

.mam-profile-preview .mam-profile-thumb {
  width: 52px;
  height: 52px;
}

.mam-profile-stage,
.mam-profile-media-frame.mam-profile-stage {
  max-width: var(--mam-profile-stage-max, 100%);
}

/* BNSS Models 0.5.0 - layout scheda ragazza */
.mam-profile-layout-editorial_split .mam-profile-body,
.mam-profile-layout-magazine .mam-profile-body,
.mam-profile-layout-side .mam-profile-body {
  grid-template-columns: minmax(0, var(--mam-profile-media-width)) minmax(260px, var(--mam-profile-text-width));
}

.mam-profile-order-text_first.mam-profile-layout-editorial_split .mam-profile-body,
.mam-profile-order-text_first.mam-profile-layout-magazine .mam-profile-body,
.mam-profile-order-text_first.mam-profile-layout-side .mam-profile-body {
  grid-template-columns: minmax(260px, var(--mam-profile-text-width)) minmax(0, var(--mam-profile-media-width));
}

.mam-profile-layout-editorial_split .mam-profile-side {
  justify-content: center;
  padding: clamp(28px, 4vw, 64px);
}

.mam-profile-layout-editorial_split .mam-profile-head h1 {
  font-size: clamp(34px, 5vw, 72px);
  letter-spacing: -0.04em;
}

.mam-profile-layout-hero .mam-profile-body {
  grid-template-columns: 1fr;
}

.mam-profile-layout-hero .mam-profile-gallery {
  padding: 0;
}

.mam-profile-layout-hero .mam-profile-stage {
  max-width: 100%;
  border-radius: 0;
  border-width: 0;
  min-height: min(74vh, 760px);
}

.mam-profile-layout-hero .mam-profile-side {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 72px);
  align-items: center;
  text-align: center;
}

.mam-profile-layout-hero .mam-profile-meta {
  justify-content: center;
}

.mam-profile-layout-magazine .mam-profile-body,
.mam-profile-layout-magazine .mam-profile-builder-rows {
  background: linear-gradient(135deg, var(--mam-card-bg), rgba(248, 250, 252, 0.92));
}

.mam-profile-layout-magazine .mam-profile-gallery {
  padding: clamp(18px, 3vw, 42px);
}

.mam-profile-layout-magazine .mam-profile-side {
  margin: auto 0;
  padding: clamp(24px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  border-left: var(--mam-profile-column-border-width, 0) solid rgba(15, 23, 42, 0.08);
}

.mam-profile-layout-magazine .mam-profile-head h1 {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mam-profile-thumbs-right .mam-profile-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  align-items: start;
}

.mam-profile-thumbs-right .mam-profile-thumbs {
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 620px;
}

.mam-profile-thumbs-hidden .mam-profile-thumbs {
  display: none !important;
}

/* BNSS Models 0.5.1 - pagine profilo automatiche */
.mam-public-profile-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: clamp(24px, 4vw, 64px) 18px;
  box-sizing: border-box;
  min-height: 50vh;
}

.mam-profile-layout-stack .mam-profile-body {
  grid-template-columns: 1fr;
}

.mam-profile-layout-stack .mam-profile-gallery {
  padding-bottom: 0;
}

.mam-profile-layout-stack .mam-profile-side {
  padding-top: 18px;
}

/* BNSS Models 0.5.2 / 0.5.4 - meta row typography */
.mam-meta-row {
  display: block !important;
  width: 100%;
  line-height: 1.45 !important;
  white-space: normal;
}

.mam-meta-row > div {
  display: block !important;
  width: 100%;
}

.mam-meta-row dd {
  display: block;
  margin: 0;
  line-height: inherit;
  white-space: normal;
}

.mam-meta-row dd span,
.mam-meta-row dd em,
.mam-meta-row dd strong,
.mam-meta-row span,
.mam-meta-row strong,
.mam-meta-row em {
  font-size: inherit !important;
  font-family: inherit !important;
  line-height: inherit !important;
}

.mam-meta-row dd strong,
.mam-meta-row strong {
  font-weight: 700 !important;
}

.mam-meta-row dd em,
.mam-meta-row em {
  font-style: italic !important;
}

.mam-meta-row,
.mam-layout-row-live {
  line-height: 1.35 !important;
  white-space: normal !important;
}

.mam-meta-row .mam-text-bold,
.mam-meta-row .mam-text-bold *,
.mam-layout-row-live .mam-text-bold,
.mam-layout-row-live .mam-text-bold * {
  font-weight: 900 !important;
}

.mam-meta-row strong,
.mam-meta-row strong *,
.mam-layout-row-live strong,
.mam-layout-row-live strong * {
  font-weight: 900 !important;
}

.mam-meta-row .mam-text-italic,
.mam-layout-row-live .mam-text-italic {
  font-style: italic !important;
}

.mam-meta-row .mam-text-sized,
.mam-meta-row .mam-text-sized *,
.mam-layout-row-live .mam-text-sized,
.mam-layout-row-live .mam-text-sized * {
  font-size: inherit;
  line-height: 1.2 !important;
}

.mam-meta-row br,
.mam-layout-row-live br {
  display: block !important;
  content: "" !important;
}

/* BNSS 0.8.5 — field display + admin control cards (builder anteprima) */
.mam-field-display-value .mam-meta dt {
  display: none;
}

.mam-field-display-label .mam-meta dd {
  display: none;
}

.mam-control-card .mam-section-title {
  cursor: pointer;
}

.mam-control-card.is-collapsed > *:not(.mam-section-title) {
  display: none !important;
}

.mam-control-card.is-collapsed .mam-section-title {
  border-bottom: 0;
}

.mam-control-card .mam-section-title:after {
  content: "−";
  margin-left: auto;
  font-weight: 900;
  color: #6366f1;
}

.mam-control-card.is-collapsed .mam-section-title:after {
  content: "+";
}

/* BNSS Models 0.5.5 - scheda ragazza a blocchi flessibili */
.mam-profile-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: clamp(18px, 3vw, 42px);
  align-items: start;
  padding: var(--mam-card-padding, 24px);
  box-sizing: border-box;
}

.mam-profile-block {
  box-sizing: border-box;
  min-width: 0;
  width: var(--mam-block-width, auto);
}

.mam-profile-block-left {
  grid-column: 1;
}

.mam-profile-block-right {
  grid-column: 2;
}

.mam-profile-block-full {
  grid-column: 1/-1;
  width: 100%;
}

.mam-profile-block-title {
  margin: 0 0 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mam-secondary);
  font-weight: 800;
}

.mam-profile-block-title + .mam-profile-gallery {
  margin-top: 4px;
}

.mam-profile-block-media {
  width: 100%;
}

.mam-profile-block-title .mam-profile-head {
  margin: 0;
}

.mam-profile-custom-text {
  color: var(--mam-primary, #111827);
  font-size: var(--mam-text-size, 15px);
  line-height: 1.65;
}

.mam-profile-builder-grid .mam-profile-gallery {
  padding: 0;
}

.mam-profile-builder-grid .mam-profile-side {
  padding: 0;
}

.mam-profile-builder-grid .mam-profile-head h1 {
  margin: 0;
  font-size: var(--mam-title-size, 42px);
  font-weight: var(--mam-title-weight, 800);
  line-height: 1.05;
  color: var(--mam-primary);
}

.mam-profile-builder-grid .mam-profile-meta {
  margin: 0;
}

.mam-profile-builder-grid .mam-profile-desc {
  max-width: 900px;
}

/* BNSS visual profile builder */
.mam-profile-visual-layouts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.mam-profile-layout-option {
  border: 1px solid #d8dee9;
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  text-align: left;
  display: grid;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.mam-profile-layout-option.is-active {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
}

.mam-profile-layout-option strong {
  font-size: 12px;
  color: #111827;
}

.mam-profile-layout-thumb {
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #f8fafc;
  display: grid;
  gap: 4px;
  padding: 5px;
}

.mam-profile-layout-thumb > * {
  display: block;
  background: #cbd5e1;
  border-radius: 1px;
}

.mam-profile-thumb-split_2_1,
.mam-profile-thumb-split_1_2 {
  grid-template-columns: 1fr 1fr;
}

.mam-profile-thumb-three_equal {
  grid-template-columns: 1fr 1fr 1fr;
}

.mam-profile-thumb-four_grid {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.mam-profile-thumb-stacked {
  grid-template-columns: 1fr;
}

.mam-profile-thumb-top_two_bottom {
  grid-template-columns: 1fr 1fr;
}

.mam-profile-thumb-top_two_bottom i {
  grid-column: 1/-1;
}

.mam-profile-thumb-top_two_bottom u {
  grid-column: 1/-1;
}

.mam-profile-thumb-hero_right {
  grid-template-columns: 1.4fr 0.8fr;
}

.mam-profile-thumb-hero_right u {
  grid-column: 1/-1;
}

.mam-profile-thumb-sidebar_left {
  grid-template-columns: 0.75fr 1.25fr;
}

.mam-profile-builder-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
}

.mam-profile-builder-tools span {
  font-size: 12px;
  color: #64748b;
}

.mam-profile-layout-canvas {
  display: grid;
  grid-template-columns: var(--mam-builder-cols, 1fr 1fr);
  gap: 14px;
  margin: 14px 0 22px;
}

.mam-profile-dropzone {
  min-height: 150px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  padding: 12px;
}

.mam-profile-dropzone.is-over {
  border-color: #4f46e5;
  background: #eef2ff;
}

.mam-profile-dropzone h4 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #64748b;
}

.mam-profile-zone-blocks {
  display: grid;
  gap: 10px;
}

.mam-profile-block-card {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  cursor: grab;
}

.mam-profile-block-card[aria-disabled="true"] {
  opacity: 0.45;
}

.mam-profile-block-card strong {
  font-size: 13px;
  color: #111827;
}

.mam-profile-block-card small {
  display: block;
  color: #64748b;
  font-size: 11px;
}

.mam-profile-block-actions {
  display: flex;
  gap: 6px;
}

.mam-profile-block-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.mam-profile-block-modal.is-open {
  display: block;
}

.mam-profile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.mam-profile-modal-panel {
  position: absolute;
  right: 24px;
  top: 24px;
  width: min(560px, calc(100vw - 48px));
  background: #fff;
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 30px 90px rgba(15, 23, 42, 0.32);
}

.mam-profile-modal-head,
.mam-profile-modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mam-profile-modal-head h3 {
  margin: 0;
  font-size: 20px;
}

.mam-modal-help {
  color: #64748b;
}

.mam-profile-css-box textarea {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 12px;
  background: #0f172a;
  color: #e5e7eb;
}

.mam-profile-blocks-source {
  display: none !important;
}

.mam-profile-builder-layout-split_2_1 {
  grid-template-columns: 1fr 1fr;
}

.mam-profile-builder-layout-split_1_2 {
  grid-template-columns: 0.8fr 1.2fr;
}

.mam-profile-builder-layout-three_equal {
  grid-template-columns: 1fr 1fr 1fr;
}

.mam-profile-builder-layout-four_grid {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.mam-profile-builder-layout-stacked {
  grid-template-columns: 1fr;
}

.mam-profile-builder-layout-hero_right,
.mam-profile-builder-layout-sidebar_left {
  grid-template-columns: 1.4fr 0.8fr;
}

.mam-profile-builder-layout-sidebar_left {
  grid-template-columns: 0.75fr 1.25fr;
}

.mam-profile-builder-layout-top_two_bottom {
  grid-template-columns: 1fr 1fr;
}

.mam-profile-block-col1 {
  grid-column: 1;
}

.mam-profile-block-col2 {
  grid-column: 2;
}

.mam-profile-block-col3 {
  grid-column: 3;
}

.mam-profile-block-col4 {
  grid-column: 4;
}

.mam-profile-block-top,
.mam-profile-block-bottom,
.mam-profile-block-full {
  grid-column: 1/-1;
  width: 100%;
}

/* BNSS profile builder layouts v2 */
.mam-profile-builder-layout-mr_2_rows {
  grid-template-columns: 1fr;
}

.mam-profile-builder-layout-mr_2x2 {
  grid-template-columns: 1fr 1fr;
}

.mam-profile-builder-layout-mr_top_2 {
  grid-template-columns: 1fr 1fr;
}

.mam-profile-builder-layout-mr_2_top {
  grid-template-columns: 1fr 1fr;
}

.mam-profile-builder-layout-mr_3x2 {
  grid-template-columns: 1fr 1fr 1fr;
}

.mam-profile-builder-layout-mr_sidebar_stack {
  grid-template-columns: 0.75fr 1.25fr;
}

.mam-profile-builder-layout-mr_stack_sidebar {
  grid-template-columns: 1.25fr 0.75fr;
}

.mam-profile-builder-layout-mr_header_grid {
  grid-template-columns: 1fr 1fr;
}

.mam-profile-builder-layout-mc_left_sidebar {
  grid-template-columns: 0.7fr 1fr 1fr;
}

.mam-profile-builder-layout-mc_right_sidebar {
  grid-template-columns: 1fr 1fr 0.7fr;
}

.mam-profile-builder-layout-mc_three {
  grid-template-columns: 1fr 1fr 1fr;
}

.mam-profile-builder-layout-mc_four {
  grid-template-columns: repeat(4, 1fr);
}

.mam-profile-builder-layout-mc_hero_left {
  grid-template-columns: 1.45fr 0.8fr 0.8fr;
}

.mam-profile-builder-layout-mc_hero_right {
  grid-template-columns: 0.8fr 0.8fr 1.45fr;
}

.mam-profile-builder-layout-mc_left_plus_grid {
  grid-template-columns: 1.2fr 1fr 1fr;
}

.mam-profile-builder-layout-mc_grid_plus_right {
  grid-template-columns: 1fr 1fr 1.2fr;
}

/* BNSS modular profile frontend rows */
.mam-profile-builder-rows {
  display: grid;
  gap: 0;
  width: 100%;
  background: var(--mam-card-bg, #fff);
  overflow: hidden;
}

.mam-profile-builder-row {
  display: grid;
  grid-template-columns: var(--mam-profile-row-cols, 1fr 1fr);
  column-gap: var(--mam-profile-row-column-gap, 0);
  row-gap: 0;
  align-items: start;
  width: 100%;
  min-width: 0;
  min-height: var(--mam-profile-row-height, auto);
  padding: var(--mam-profile-row-padding, 0);
  margin-top: var(--mam-profile-row-margin-top, 0);
  margin-bottom: var(--mam-profile-row-margin-bottom, 0);
  box-sizing: border-box;
  text-align: var(--mam-profile-row-text-align, var(--mam-align, left));
}

.mam-profile-builder-cell {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  flex: 1 1 0;
  color: var(--mam-primary, #111);
  background: var(--mam-card-bg, #fff);
  overflow: visible;
  align-items: stretch;
}

.mam-profile-builder-cell > .mam-profile-builder-row {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}

.mam-profile-row-title-in-grid {
  grid-column: 1/-1;
}

.mam-profile-builder-rows .mam-profile-gallery {
  padding: var(--mam-profile-row-photo-padding, 0);
  background: transparent;
  box-sizing: border-box;
}

.mam-profile-builder-rows .mam-profile-media-frame {
  padding: 0;
  box-sizing: border-box;
}

.mam-profile-builder-rows .mam-profile-media-frame[data-height-mode="auto"] {
  height: auto !important;
  aspect-ratio: var(--mam-profile-media-ratio, var(--mam-ratio, 3/4));
  min-height: 0;
}

.mam-profile-builder-rows .mam-profile-media-frame[data-height-mode="auto"] .mam-photo-inner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
}

.mam-profile-builder-rows .mam-profile-media-frame[data-height-mode="auto"] .mam-photo-inner img,
.mam-profile-builder-rows .mam-profile-media-frame[data-height-mode="auto"] .mam-photo-inner video {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center center;
}

.mam-profile-builder-rows .mam-profile-media-frame[data-width-mode="auto"],
.mam-profile-builder-rows .mam-profile-stage[data-width-mode="auto"] {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0;
}

.mam-profile-builder-rows .mam-profile-media-frame[data-width-mode="custom"],
.mam-profile-builder-rows .mam-profile-stage[data-width-mode="custom"] {
  width: var(--mam-profile-media-width, 100%) !important;
  max-width: 100% !important;
  margin-left: 0;
  margin-right: auto;
}

.mam-profile-builder-rows .mam-profile-media-frame[data-height-mode="custom"],
.mam-profile-builder-rows .mam-profile-stage[data-height-mode="custom"] {
  height: var(--mam-profile-media-height, auto) !important;
  aspect-ratio: unset !important;
}

.mam-profile-builder-rows .mam-profile-media-frame[data-height-mode="custom"] .mam-photo-inner,
.mam-profile-builder-rows .mam-profile-stage[data-height-mode="custom"] .mam-photo-inner {
  height: 100%;
}

.mam-profile-builder-rows .mam-profile-block {
  width: 100% !important;
  max-width: 100%;
  flex-shrink: 0;
  box-sizing: border-box;
  color: #111111;
  color: var(--mam-primary, #111111);
}

.mam-profile-builder-rows .mam-profile-thumbs {
  padding: 10px 12px 12px;
}

.mam-profile-builder-rows .mam-profile-block-field,
.mam-profile-builder-rows .mam-profile-block-fields,
.mam-profile-builder-rows .mam-profile-block-description,
.mam-profile-builder-rows .mam-profile-block.mam-profile-block-title,
.mam-profile-builder-rows .mam-profile-block-custom_text {
  padding: var(--mam-profile-field-padding-y, 6px) var(--mam-profile-field-padding-x, 12px);
  box-sizing: border-box;
}

.mam-profile-builder-rows .mam-profile-block-photo,
.mam-profile-builder-rows .mam-profile-block-video,
.mam-profile-builder-rows .mam-profile-block-media {
  padding: var(--mam-profile-row-photo-padding, var(--mam-profile-photo-block-padding, 0px));
  box-sizing: border-box;
  background: transparent;
}

.mam-profile-builder-rows .mam-profile-meta,
.mam-profile-builder-rows .mam-profile-field-single,
.mam-profile-builder-rows .mam-profile-desc {
  margin: 0;
}

.mam-profile-builder-rows .mam-profile-head {
  margin: 0;
  padding: 0;
}

.mam-profile-builder-rows .mam-profile-block-title + .mam-profile-gallery,
.mam-profile-builder-rows .mam-profile-block-title + .mam-profile-meta {
  padding-top: 0;
}

.mam-profile-builder-rows .mam-profile-field-single {
  font-size: var(--mam-text-size, 14px);
  line-height: var(--mam-profile-field-line-height, var(--mam-block-line-height, 1.35));
  color: var(--mam-profile-value-color, var(--mam-primary, #111111));
  text-align: inherit;
}

.mam-profile-builder-rows .mam-profile-field-single span,
.mam-profile-builder-rows .mam-profile-field-single strong,
.mam-profile-field-single span,
.mam-profile-field-single strong {
  color: var(--mam-profile-value-color, var(--mam-primary, #111111));
}

.mam-profile-wrap .mam-profile-field-single em,
.mam-profile-wrap .mam-profile-field-single span em,
.mam-profile-wrap .mam-meta-row em,
.mam-profile-wrap .mam-profile-meta em {
  color: var(--mam-profile-label-color, var(--mam-secondary, #666666)) !important;
  font-style: italic;
}

.mam-profile-wrap .mam-profile-field-single > span,
.mam-profile-wrap .mam-profile-field-single span:not(:has(em)) {
  color: var(--mam-profile-value-color, var(--mam-primary, #111111)) !important;
}

.mam-profile-wrap .mam-meta-row dd,
.mam-profile-wrap .mam-meta-row dd span,
.mam-profile-wrap .mam-profile-meta dd {
  color: var(--mam-profile-value-color, var(--mam-primary, #111111));
}

.mam-profile-wrap .mam-meta-row dt,
.mam-profile-wrap .mam-profile-meta dt {
  color: var(--mam-profile-label-color, var(--mam-secondary, #666666));
}

.mam-field-display-label .mam-profile-builder-rows .mam-meta dd,
.mam-field-display-value .mam-profile-builder-rows .mam-meta dt,
.mam-field-display-label .mam-profile-preview .mam-meta dd,
.mam-field-display-value .mam-profile-preview .mam-meta dt,
.mam-profile-wrap .mam-profile-builder-rows .mam-field-display-label .mam-meta dd,
.mam-profile-wrap .mam-profile-builder-rows .mam-field-display-value .mam-meta dt {
  display: block !important;
}

.mam-profile-builder-rows .mam-profile-main-title {
  color: #111111;
  color: var(--mam-profile-title-color, var(--mam-primary, #111111));
}

.mam-profile-field-single {
  font-size: var(--mam-text-size, 14px);
  line-height: var(--mam-profile-field-line-height, var(--mam-block-line-height, 1.35));
  color: var(--mam-profile-value-color, var(--mam-primary, #111111));
}

.mam-profile-field-single span {
  display: inline;
}

.mam-field-empty {
  opacity: 0.45;
  font-style: italic;
}

.mam-profile-builder-orphans {
  border-top: var(--mam-profile-row-border-width, 0) dashed var(--mam-profile-inner-border-color, var(--mam-card-bg, transparent));
  padding: var(--mam-card-padding, 16px);
}

.mam-profile-builder-cell .mam-profile-block {
  width: 100%;
}

.mam-profile-builder-cell + .mam-profile-builder-cell {
  border-left: var(--mam-profile-column-border-width, 0) solid var(--mam-profile-inner-border-color, var(--mam-card-bg, transparent));
}

/* BNSS nested 4-level frontend profile layout */
.mam-profile-builder-cell .mam-profile-builder-row {
  margin-top: 0;
  border-top: var(--mam-profile-row-border-width, 0) solid var(--mam-profile-inner-border-color, var(--mam-card-bg, transparent));
}

.mam-profile-wrap.mam-profile-dividers-off .mam-profile-builder-cell + .mam-profile-builder-cell,
.mam-profile-wrap.mam-profile-dividers-off .mam-profile-builder-cell .mam-profile-builder-row,
.mam-profile-wrap.mam-profile-dividers-off .mam-profile-row-title-box,
.mam-profile-wrap.mam-profile-dividers-off .mam-profile-builder-orphans,
.mam-profile-wrap.mam-profile-dividers-off .mam-profile-layout-magazine .mam-profile-side {
  border: 0 !important;
}

.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-builder-row,
.mam-profile-wrap.mam-profile-photo-bare .mam-profile-builder-row {
  column-gap: var(--mam-profile-row-column-gap, var(--mam-gallery-gap, 16px));
}

.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-builder-rows .mam-profile-block-photo,
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-builder-rows .mam-profile-block-video,
.mam-profile-wrap.mam-profile-photo-bare .mam-profile-builder-rows .mam-profile-block-photo,
.mam-profile-wrap.mam-profile-photo-bare .mam-profile-builder-rows .mam-profile-block-video {
  padding: var(--mam-profile-row-photo-padding, 12px);
  box-sizing: border-box;
}

.mam-profile-wrap.mam-profile-photo-padding-none.mam-profile-photo-chrome-off .mam-profile-builder-rows .mam-profile-block-photo,
.mam-profile-wrap.mam-profile-photo-padding-none.mam-profile-photo-chrome-off .mam-profile-builder-rows .mam-profile-block-video,
.mam-profile-wrap.mam-profile-photo-padding-none.mam-profile-photo-bare .mam-profile-builder-rows .mam-profile-block-photo,
.mam-profile-wrap.mam-profile-photo-padding-none.mam-profile-photo-bare .mam-profile-builder-rows .mam-profile-block-video {
  padding: var(--mam-profile-row-photo-padding, 12px) !important;
}

.mam-profile-wrap.mam-profile-card-border-off,
.mam-profile-wrap.mam-profile-card-border-off .mam-profile-body,
.mam-profile-wrap.mam-profile-card-border-off .mam-profile-builder-rows,
.mam-profile-wrap.mam-profile-card-border-off .mam-profile-builder-row,
.mam-profile-wrap.mam-profile-card-border-off .mam-profile-builder-cell,
.mam-profile-wrap.mam-profile-card-border-off .mam-profile-block,
.mam-profile-wrap.mam-profile-card-border-off .mam-profile-gallery,
.mam-profile-wrap.mam-profile-card-border-off .mam-profile-side {
  border: none !important;
  border-width: 0 !important;
  border-style: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
}

.mam-profile-wrap.mam-profile-card-border-off .mam-profile-builder-rows {
  overflow: visible !important;
}

.mam-profile-wrap.mam-profile-image-border-off .mam-profile-photo-frame,
.mam-profile-wrap.mam-profile-image-border-off .mam-profile-media-frame,
.mam-profile-wrap.mam-profile-image-border-off .mam-profile-stage {
  border: none !important;
  border-width: 0 !important;
  border-style: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.mam-profile-wrap.mam-profile-image-border-off .mam-profile-photo-frame .mam-photo-inner,
.mam-profile-wrap.mam-profile-image-border-off .mam-profile-media-frame .mam-photo-inner {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Interruttore dedicato: div .mam-profile-photo-frame (cornice bianca fantasma / tema) */
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-photo-frame,
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-media-frame.mam-profile-photo-frame,
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-stage.mam-profile-photo-frame,
.mam-profile-wrap.mam-profile-photo-fit-natural .mam-profile-photo-frame,
.mam-profile-wrap.mam-profile-photo-fit-natural .mam-profile-media-frame {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  aspect-ratio: unset !important;
  height: auto !important;
  overflow: visible !important;
}

.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-photo-frame .mam-photo-inner,
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-photo-frame .mam-photo-inner img,
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-photo-frame .mam-photo-inner video,
.mam-profile-wrap.mam-profile-photo-fit-natural .mam-profile-media-frame .mam-photo-inner,
.mam-profile-wrap.mam-profile-photo-fit-natural .mam-profile-photo-frame img,
.mam-profile-wrap.mam-profile-photo-fit-natural img.mam-profile-img {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.mam-profile-wrap.mam-profile-photo-fit-natural .mam-profile-media-frame[data-height-mode="auto"],
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-media-frame[data-height-mode="auto"] {
  aspect-ratio: unset !important;
  height: auto !important;
}

.mam-profile-wrap.mam-profile-photo-fit-natural .mam-profile-media-frame[data-height-mode="auto"] .mam-photo-inner,
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-media-frame[data-height-mode="auto"] .mam-photo-inner {
  position: relative !important;
  inset: auto !important;
  height: auto !important;
  aspect-ratio: unset !important;
  background: var(--mam-card-bg, transparent) !important;
}

.mam-profile-wrap.mam-profile-photo-fit-natural .mam-profile-media-frame[data-height-mode="auto"] .mam-photo-inner img,
.mam-profile-wrap.mam-profile-photo-fit-natural .mam-profile-media-frame[data-height-mode="auto"] .mam-photo-inner video,
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-media-frame[data-height-mode="auto"] .mam-photo-inner img,
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-media-frame[data-height-mode="auto"] .mam-photo-inner video {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  object-fit: unset !important;
  display: block !important;
}

.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-photo-frame .mam-photo-inner,
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-photo-frame .mam-photo-inner img,
.mam-profile-wrap.mam-profile-photo-chrome-off .mam-profile-photo-frame .mam-photo-inner video {
  background: transparent !important;
}

.mam-profile-wrap.mam-profile-photo-radius-none .mam-profile-photo-frame,
.mam-profile-wrap.mam-profile-photo-radius-none .mam-profile-photo-frame .mam-photo-inner,
.mam-profile-wrap.mam-profile-photo-radius-none .mam-profile-photo-frame .mam-photo-inner img,
.mam-profile-wrap.mam-profile-photo-radius-none .mam-profile-photo-frame .mam-photo-inner video {
  border-radius: 0 !important;
}

.mam-profile-wrap.mam-profile-photo-padding-none .mam-profile-builder-rows .mam-profile-block-photo,
.mam-profile-wrap.mam-profile-photo-padding-none .mam-profile-builder-rows .mam-profile-block-video,
.mam-profile-wrap.mam-profile-photo-padding-none .mam-profile-builder-rows .mam-profile-block-media {
  padding: var(--mam-profile-row-photo-padding, 0px) !important;
}

.mam-profile-builder-row-depth-2,
.mam-profile-builder-row-depth-3,
.mam-profile-builder-row-depth-4 {
  width: 100%;
}

.mam-profile-row-title-box {
  padding: var(--mam-profile-row-title-padding-y, 12px) var(--mam-profile-row-title-padding-x, 16px);
  background: var(--mam-profile-row-title-bg, #f3f4f6);
  border: 0;
  border-bottom: var(--mam-profile-row-title-effective-border-width, var(--mam-profile-row-title-border-width, 0)) solid var(--mam-profile-row-title-border-color, #e5e7eb);
  border-radius: var(--mam-profile-row-title-radius, 0);
  margin: 0 0 var(--mam-profile-row-title-margin-bottom, 0);
  text-align: var(--mam-profile-row-title-align, left);
  box-sizing: border-box;
  width: 100%;
}

.mam-profile-row-title-box.is-published .mam-profile-row-title-text,
.mam-profile-row-title-in-grid.is-published .mam-profile-row-title-text {
  color: var(--mam-profile-row-title-color, #2563eb);
}

.mam-profile-row-title-text {
  display: block;
  font-family: var(--mam-font, inherit);
  font-size: var(--mam-profile-row-title-size, 12px);
  font-weight: var(--mam-profile-row-title-weight, 800);
  font-style: var(--mam-profile-row-title-style, normal);
  text-transform: var(--mam-profile-row-title-transform, uppercase);
  letter-spacing: var(--mam-profile-row-title-spacing, 1px);
  color: var(--mam-profile-row-title-color, var(--mam-secondary, #667085));
  line-height: 1.35;
}

.mam-profile-builder-cell:empty {
  min-height: 0;
}

.mam-profile-main-title {
  color: var(--mam-profile-title-color, var(--mam-primary, #111));
  font-weight: var(--mam-profile-title-weight, var(--mam-title-weight, 700));
  font-style: var(--mam-profile-title-style, normal);
  text-transform: var(--mam-profile-title-transform, none);
  text-align: var(--mam-profile-title-align, var(--mam-align, left));
  letter-spacing: var(--mam-profile-title-spacing, 0);
  margin: 0 0 var(--mam-profile-title-mb, 12px);
  font-size: var(--mam-title-size, 32px);
  line-height: 1.08;
}

@media (max-width: 860px) {
  .mam-profile-layout-side .mam-profile-body {
    grid-template-columns: 1fr;
  }

  .mam-profile-layout-editorial_split .mam-profile-body,
  .mam-profile-layout-magazine .mam-profile-body,
  .mam-profile-layout-side .mam-profile-body,
  .mam-profile-order-text_first.mam-profile-layout-editorial_split .mam-profile-body,
  .mam-profile-order-text_first.mam-profile-layout-magazine .mam-profile-body,
  .mam-profile-order-text_first.mam-profile-layout-side .mam-profile-body {
    grid-template-columns: 1fr;
  }

  .mam-profile-thumbs-right .mam-profile-gallery {
    display: flex;
  }

  .mam-profile-thumbs-right .mam-profile-thumbs {
    flex-direction: row;
    overflow-x: auto;
    max-height: none;
  }

  .mam-profile-layout-magazine .mam-profile-side {
    border-left: 0;
    border-top: var(--mam-profile-row-border-width, 0) solid var(--mam-profile-inner-border-color, rgba(15, 23, 42, 0.08));
  }

  .mam-profile-builder-grid {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .mam-profile-block-left,
  .mam-profile-block-right,
  .mam-profile-block-full {
    grid-column: 1;
    width: 100% !important;
  }

  .mam-profile-builder-grid {
    grid-template-columns: 1fr !important;
  }

  .mam-profile-block-col1,
  .mam-profile-block-col2,
  .mam-profile-block-col3,
  .mam-profile-block-col4,
  .mam-profile-block-top,
  .mam-profile-block-bottom,
  .mam-profile-block-full {
    grid-column: 1 !important;
    width: 100% !important;
  }
}

@media (max-width: 980px) {
  .mam-profile-layout-canvas {
    grid-template-columns: 1fr !important;
  }

  .mam-profile-modal-panel {
    left: 16px;
    right: 16px;
    width: auto;
  }
}

@media (max-width: 768px) {
  .mam-profile-builder-row {
    grid-template-columns: 1fr !important;
  }

  .mam-profile-builder-cell + .mam-profile-builder-cell {
    border-left: 0 !important;
    border-top: var(--mam-profile-row-border-width, 0) solid var(--mam-profile-inner-border-color, var(--mam-card-border-color, #e5e7eb));
  }

  .mam-profile-wrap.mam-profile-dividers-off .mam-profile-builder-cell + .mam-profile-builder-cell {
    border-top: 0 !important;
  }
}


/* BNSS v5.1 - controlli per singolo elemento builder */
.mam-profile-builder-rows .mam-profile-block{font-size:var(--mam-block-font-size, inherit);font-weight:var(--mam-block-font-weight, inherit);text-align:var(--mam-block-text-align, inherit);}
.mam-profile-builder-rows .mam-profile-block .mam-profile-main-title,
.mam-profile-builder-rows .mam-profile-block .mam-meta,
.mam-profile-builder-rows .mam-profile-block .mam-profile-desc,
.mam-profile-builder-rows .mam-profile-block .mam-profile-custom-text{font-size:var(--mam-block-font-size, inherit);font-weight:var(--mam-block-font-weight, inherit);text-align:var(--mam-block-text-align, inherit);}
.mam-profile-builder-rows .mam-profile-block-photo .mam-profile-media-frame,
.mam-profile-builder-rows .mam-profile-block-video .mam-profile-media-frame,
.mam-profile-builder-rows .mam-profile-block-media .mam-profile-media-frame{width:var(--mam-block-photo-size, 100%);max-width:100%;margin-left:auto;margin-right:auto;}

/* Foto in colonna griglia: riempiono sempre la cella (evita 95px salvati per errore) */
.mam-profile-builder-row > .mam-profile-builder-cell > .mam-profile-block-photo,
.mam-profile-builder-row > .mam-profile-builder-cell > .mam-profile-block-video {
  width: 100% !important;
  max-width: 100% !important;
}

.mam-profile-builder-row > .mam-profile-builder-cell > .mam-profile-block-photo img.mam-profile-img,
.mam-profile-builder-row > .mam-profile-builder-cell > .mam-profile-block-video video {
  width: 100% !important;
  max-width: 100% !important;
  height: auto;
  display: block;
}


/* BNSS v8 - interlinea e spaziatura righe interne nel frontend */
.mam-profile-builder-rows .mam-profile-block{
  line-height:var(--mam-block-line-height, inherit);
}
.mam-profile-builder-rows .mam-profile-block .mam-profile-main-title,
.mam-profile-builder-rows .mam-profile-block .mam-meta,
.mam-profile-builder-rows .mam-profile-block .mam-profile-desc,
.mam-profile-builder-rows .mam-profile-block .mam-profile-custom-text{
  line-height:var(--mam-block-line-height, inherit);
}
.mam-profile-builder-row > .mam-profile-builder-cell > .mam-profile-block-field,
.mam-profile-builder-rows .mam-profile-builder-row .mam-profile-block-field {
  padding-top: var(--mam-profile-field-padding-y, 6px);
  padding-bottom: var(--mam-profile-field-padding-y, 6px);
}

.mam-profile-builder-row > .mam-profile-builder-cell > .mam-profile-block-field .mam-meta,
.mam-profile-builder-row > .mam-profile-builder-cell > .mam-profile-block-field .mam-profile-field-single,
.mam-profile-builder-rows .mam-profile-builder-row .mam-profile-block-field .mam-meta,
.mam-profile-builder-rows .mam-profile-builder-row .mam-profile-block-field .mam-profile-field-single {
  line-height: var(--mam-block-line-height, var(--mam-profile-field-line-height, 1.35));
}


/* BNSS v14 - lightbox fullscreen foto scheda */
.mam-profile-wrap[data-mam-lightbox="1"] .mam-lightbox-image,
.mam-profile-wrap[data-mam-lightbox="1"] .mam-profile-stage img,
.mam-profile-wrap[data-mam-lightbox="1"] .mam-profile-block-photo img{cursor:zoom-in;}
html.mam-lightbox-open{overflow:hidden;}
.mam-lightbox{position:fixed;inset:0;z-index:999999;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.92);padding:28px;box-sizing:border-box;}
.mam-lightbox.is-open{display:flex;}
.mam-lightbox figure{margin:0;display:flex;flex-direction:column;align-items:center;justify-content:center;max-width:100%;max-height:100%;}
.mam-lightbox figure img{max-width:min(96vw,1600px);max-height:88vh;width:auto;height:auto;object-fit:contain;border-radius:10px;box-shadow:0 20px 80px rgba(0,0,0,.45);}
.mam-lightbox-counter{min-height:24px;margin-top:12px;color:#fff;font:600 13px/1.4 var(--mam-font,Arial,sans-serif);letter-spacing:.08em;}
.mam-lightbox-close,.mam-lightbox-prev,.mam-lightbox-next{position:absolute;border:0;background:rgba(255,255,255,.12);color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .18s ease, transform .18s ease;}
.mam-lightbox-close:hover,.mam-lightbox-prev:hover,.mam-lightbox-next:hover{background:rgba(255,255,255,.22);transform:scale(1.04);}
.mam-lightbox-close{top:18px;right:18px;width:44px;height:44px;border-radius:999px;font-size:34px;line-height:1;}
.mam-lightbox-prev,.mam-lightbox-next{top:50%;width:54px;height:76px;margin-top:-38px;border-radius:14px;font-size:58px;line-height:1;}
.mam-lightbox-prev{left:18px;}.mam-lightbox-next{right:18px;}
@media (max-width: 768px){.mam-lightbox{padding:14px}.mam-lightbox figure img{max-width:96vw;max-height:82vh}.mam-lightbox-prev,.mam-lightbox-next{width:42px;height:60px;font-size:42px}.mam-lightbox-close{width:40px;height:40px;font-size:30px}}

/* Isolamento dal tema (Divi e simili) — cornice foto gestita solo dal plugin */
.mam-profile-wrap .mam-profile-photo-frame,
.mam-profile-wrap .mam-profile-media-frame,
.mam-profile-wrap .mam-profile-stage,
.mam-profile-wrap .mam-profile-media-reset {
  isolation: isolate;
  contain: layout style paint;
  margin-left: auto;
  margin-right: auto;
  padding: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
}

.mam-profile-wrap .mam-profile-photo-frame *,
.mam-profile-wrap .mam-profile-media-frame *,
.mam-profile-wrap .mam-profile-stage * {
  box-sizing: border-box;
}

.mam-profile-wrap .mam-profile-photo-frame .mam-photo-inner,
.mam-profile-wrap .mam-profile-photo-frame img,
.mam-profile-wrap .mam-profile-photo-frame video,
.mam-profile-wrap .mam-profile-stage img,
.mam-profile-wrap .mam-profile-stage video,
.mam-profile-wrap .mam-profile-img,
.mam-profile-wrap img.mam-profile-img,
.mam-profile-wrap img.mam-lightbox-image {
  outline: 0 !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  filter: none !important;
}

.mam-profile-wrap .mam-profile-photo-frame img,
.mam-profile-wrap .mam-profile-photo-frame video,
.mam-profile-wrap .mam-profile-stage img,
.mam-profile-wrap .mam-profile-stage video,
.mam-profile-wrap .mam-profile-img,
.mam-profile-wrap img.mam-profile-img,
.mam-profile-wrap img.mam-lightbox-image {
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  vertical-align: top;
  max-width: 100%;
}

/* Divi Image / wrapper globali che avvolgono la scheda */
.mam-profile-wrap .mam-profile-block-photo a,
.mam-profile-wrap .mam-profile-block-photo figure,
.mam-profile-wrap .mam-profile-block-media a,
.mam-profile-wrap .mam-profile-block-media figure,
.mam-profile-wrap .et_pb_image_wrap,
.mam-profile-wrap .et_pb_image,
.mam-profile-wrap .et_pb_module .mam-profile-photo-frame,
.mam-profile-wrap .et_pb_row .mam-profile-photo-frame,
.mam-profile-wrap .et_pb_column .mam-profile-photo-frame,
.mam-profile-wrap .wp-block-image,
.mam-profile-wrap .wp-block-image img {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.mam-profile-wrap .mam-profile-thumb img {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}

.mam-profile-wrap:not(.mam-profile-card-border-off) > .mam-profile-body,
.mam-profile-wrap:not(.mam-profile-card-border-off) > .mam-profile-builder-rows {
  border-width: var(--mam-card-border-width, 0);
  border-style: var(--mam-card-border-style, solid);
  border-color: var(--mam-card-border-color, var(--mam-card-bg, transparent));
}

.mam-profile-wrap:not(.mam-profile-image-border-off) .mam-profile-photo-frame {
  border-width: var(--mam-img-border-width, 0);
  border-style: var(--mam-img-border-style, solid);
  border-color: var(--mam-img-border-color, transparent);
  background: var(--mam-profile-photo-frame-bg, transparent);
}

.mam-profile-wrap.mam-profile-image-border-off .mam-profile-photo-frame:not([style*="border:none"]) {
  border: none !important;
}

.mam-public-profile-page {
  box-sizing: border-box;
  border: none !important;
  outline: none !important;
}

body.mam-model-profile .mam-public-profile-page,
body.mam-model-profile .mam-profile-wrap,
body.mam-model-profile .mam-profile-wrap .mam-profile-body,
body.mam-model-profile .mam-profile-wrap .mam-profile-builder-rows {
  border: none !important;
  outline: none !important;
}

/* Modalità bare: nessun div .mam-profile-photo-frame, solo img */
.mam-profile-wrap.mam-profile-photo-bare .mam-profile-block-photo,
.mam-profile-wrap.mam-profile-photo-bare .mam-profile-block-media {
  background: transparent;
}

.mam-profile-wrap.mam-profile-photo-bare .mam-profile-block-photo img.mam-profile-img,
.mam-profile-wrap.mam-profile-photo-bare .mam-profile-block-media img.mam-profile-img {
  width: 100%;
  height: auto;
  display: block;
  max-width: var(--mam-block-photo-size, 100%);
  margin-left: auto;
  margin-right: auto;
  border: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

/* Rimuove bianco incorporato in GIF/JPG polaroid su sfondo scuro */
.mam-profile-wrap.mam-profile-photo-knockout img.mam-profile-img-knockout {
  filter: url(#mam-knockout-white);
  -webkit-filter: url(#mam-knockout-white);
}

/* Modalità Mosaic — indipendente da mam-profile-photo-bare / cornice off */
.mam-profile-wrap.mam-profile-photos-mosaic .mam-profile-builder-row {
  column-gap: var(--mam-profile-row-column-gap, var(--mam-profile-mosaic-gap, 16px));
  row-gap: var(--mam-profile-mosaic-gap, 16px);
  align-items: stretch;
}

.mam-profile-wrap.mam-profile-photos-mosaic .mam-profile-builder-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mam-profile-wrap.mam-profile-photos-mosaic .mam-profile-builder-cell > .mam-profile-block-photo,
.mam-profile-wrap.mam-profile-photos-mosaic .mam-profile-builder-cell > .mam-profile-block-video {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding: var(--mam-profile-row-photo-padding, var(--mam-profile-mosaic-padding, 12px));
  box-sizing: border-box;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.mam-profile-wrap.mam-profile-photos-mosaic .mam-profile-builder-cell > .mam-profile-block-photo img.mam-profile-img,
.mam-profile-wrap.mam-profile-photos-mosaic .mam-profile-builder-cell > .mam-profile-block-video video {
  width: 100% !important;
  max-width: 100% !important;
  height: auto;
  flex: 1 1 auto;
  display: block;
  margin: 0;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  object-fit: cover;
  aspect-ratio: var(--mam-profile-mosaic-ratio, 3/4);
}

.mam-profile-wrap.mam-profile-photos-mosaic .mam-profile-photo-frame,
.mam-profile-wrap.mam-profile-photos-mosaic .mam-profile-media-frame {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  overflow: hidden;
  width: 100%;
  aspect-ratio: var(--mam-profile-mosaic-ratio, 3/4);
}

.mam-profile-wrap.mam-profile-photos-mosaic .mam-profile-photo-frame img,
.mam-profile-wrap.mam-profile-photos-mosaic .mam-profile-media-frame img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}
