/* myDigiCard card layout harmonization for Templates 01-25.
   Loaded after the existing v34 fixes. Keeps each template's theme and content.
   The rail is capped at 520px to preserve the existing card-view design. */
body.dvc-public-card, body.dvcx { --dvc-v34-width: 520px; --dvc-uniform-width: 520px; --dvc-v34-gap: 10px; --dvc-uniform-section-gap: 10px; }
body.dvc-public-card :is(.card-wrapper > .card,.card-wrapper > .card2,.card-wrapper > section,.dvc-brand-footer,.dvc-advanced-wrap),
body.dvcx :is(.dvcx-hero,.dvcx-top-actions,.dvcx-section,.dvcx-footer,.dvc-brand-footer,.dvc-advanced-wrap) {
  box-sizing: border-box !important; min-width: 0; height: auto;
}
/* Remove excess blank footer padding without hiding content. */
body.dvc-public-card .dvc-brand-footer,
body.dvcx .dvc-brand-footer,
body.dvcx .dvcx-footer {
  min-height: 0 !important; padding-top: 14px !important;
  padding-bottom: 14px !important; margin-top: 0 !important;
  margin-bottom: 10px !important;
}
body.dvc-public-card .dvc-brand-footer__body,
body.dvcx .dvc-brand-footer__body { padding-top: 0 !important; padding-bottom: 0 !important; }
body.dvc-public-card .dvc-brand-footer__legal,
body.dvcx .dvc-brand-footer__legal { margin-top: 8px !important; margin-bottom: 8px !important; }
body.dvc-public-card .dvc-brand-footer__copyright,
body.dvcx .dvc-brand-footer__copyright { margin-top: 7px !important; padding-top: 7px !important; padding-bottom: 0 !important; }
body.dvc-public-card :is(.card-wrapper, .card-wrapper > section, .dvc-advanced-wrap),
body.dvcx :is(.dvcx-shell, .dvcx-section, .dvc-advanced-wrap) { min-height: 0 !important; }
body.dvc-public-card :is(h1,h2,h3,p,a),body.dvcx :is(h1,h2,h3,p,a) { overflow-wrap: break-word; }
@media(max-width:540px) {
  body.dvc-public-card, body.dvcx { --dvc-v34-gap: 8px; --dvc-uniform-side-gap: 18px; }
  body.dvc-public-card .dvc-brand-footer,body.dvcx .dvc-brand-footer,body.dvcx .dvcx-footer { padding-block: 12px !important; margin-bottom: 8px !important; }
}


/* Mobile and footer finishing: additive to the earlier consistency patch.
   For premium templates the bottom navigation is FIXED at 72–74px: its
   clearance is intentional, not an empty footer. Keep it accessible. */
body.dvcx {
  padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
}
@media (max-width: 640px) {
  body.dvcx {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
/* Only the actual footer is compact; no hidden content or fixed heights. */
body.dvc-public-card .dvc-brand-footer,
body.dvcx .dvc-brand-footer {
  height: auto !important;
  overflow: visible;
}
body.dvc-public-card .dvc-brand-footer :is(a,span,p,strong),
body.dvcx .dvc-brand-footer :is(a,span,p,strong) {
  overflow-wrap: anywhere;
}
body.dvc-public-card .dvc-brand-footer__legal,
body.dvcx .dvc-brand-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
}
body.dvc-public-card .dvc-brand-footer__legal a,
body.dvcx .dvc-brand-footer__legal a {
  max-width: 100%;
}
/* Prevent long customer text and flex children from widening card sections. */
body.dvc-public-card :is(.card-wrapper,.card-wrapper > .card,.card-wrapper > .card2,.dvc-advanced-wrap,.dvc-brand-footer) *,
body.dvcx :is(.dvcx-shell,.dvcx-section,.dvc-advanced-wrap,.dvc-brand-footer) * {
  min-width: 0;
}
body.dvc-public-card :is(h1,h2,h3,h4,p),
body.dvcx :is(h1,h2,h3,h4,p) {
  overflow-wrap: break-word;
}
/* Images and embedded media must not force horizontal page scrolling. */
body.dvc-public-card :is(img,video,iframe),
body.dvcx :is(img,video,iframe) {
  max-width: 100%;
}
body.dvc-public-card :is(#home,#about,#products,#gallery,#contact):target,
body.dvcx :is(.dvcx-section,.dvcx-hero):target {
  scroll-margin-top: 16px;
}
body.dvc-public-card :is(a,button):focus-visible,
body.dvcx :is(a,button):focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}
@media (max-width: 540px) {
  body.dvc-public-card .dvc-brand-footer__legal,
  body.dvcx .dvc-brand-footer__legal { gap: 7px 11px; }
}
@media (prefers-reduced-motion: reduce) {
  body.dvc-public-card *,body.dvcx * { scroll-behavior: auto !important; }
}

/* Template UAT finishing layer - scoped to public card views only.
   No theme palette, template markup, data bindings, or footer content changed. */
body.dvc-public-card, body.dvcx { overflow-x: clip; }
/* Content should remain readable without widening the card or cropping media. */
body.dvc-public-card :is(.card-wrapper,.dvc-advanced-wrap,.dvc-brand-footer),
body.dvcx :is(.dvcx-shell,.dvcx-hero,.dvcx-section,.dvcx-footer,.dvc-advanced-wrap) {
  max-width: 100%; box-sizing: border-box;
}
body.dvc-public-card :is(img,video),
body.dvcx :is(img,video) { max-inline-size: 100%; block-size: auto; }
body.dvc-public-card :is(a,button,input,select,textarea),
body.dvcx :is(a,button,input,select,textarea) { touch-action: manipulation; }
body.dvcx .dvcx-bottom-nav {
  max-width: 100vw;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.dvcx .dvcx-bottom-nav-track {
  max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
/* Keep footer fully accessible above the fixed bottom navigation on notched phones. */
body.dvcx { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important; }
body.dvcx .dvcx-bottom-nav a:focus-visible,
body.dvc-public-card a:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
@media (max-width: 540px) {
  body.dvcx { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important; }
  body.dvcx .dvcx-contact-grid { min-width: 0; max-width: 100%; }
  body.dvcx .dvcx-contact { min-width: 0; overflow-wrap: anywhere; }
  body.dvcx :is(.dvcx-section,.dvcx-hero) { scroll-margin-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
  body.dvc-public-card :is(.card-wrapper,.dvc-advanced-wrap) { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  body.dvcx .dvcx-bottom-nav-track { scroll-behavior: auto !important; }
}
