/* ============================================================
   DG Elemento Addons · Media Cards

   --dgmc-* defaults live on .dgmc, so Elementor controls that
   override them must target "{{WRAPPER}} .dgmc".
   ============================================================ */

.dgmc {
  --dgmc-deep: #0B3A19;
  --dgmc-gold: #BC864D;
  --dgmc-body: #4B504D;
  --dgmc-sand: #E7E2D6;
  --dgmc-line: rgba(11, 58, 25, 0.15);

  --dgmc-serif: 'Cormorant Garamond', Georgia, serif;
  --dgmc-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --dgmc-gap: 40px;
  --dgmc-ratio: 4/3;
  --dgmc-slide: 82%;
  --dgmc-dot: rgba(11, 58, 25, 0.22);
  --dgmc-dot-on: var(--dgmc-gold);

  font-family: var(--dgmc-sans);
  color: var(--dgmc-body);
  max-width: min(100%, 100vw);
  min-width: 0;
  overflow-x: clip;
}

.elementor-widget-dg_media_cards,
.elementor-widget-dg_media_cards > .elementor-widget-container {
  min-width: 0;
  max-width: 100%;
}

.dgmc *,
.dgmc *::before,
.dgmc *::after {
  box-sizing: border-box;
}

.dgmc__heading,
.dgmc__intro,
.dgmc__title,
.dgmc__text,
.dgmc__eyebrow,
.dgmc__foot-text {
  white-space: normal;
  overflow-wrap: break-word;
}

/* ---------- header ---------- */
.dgmc__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 60px;
  align-items: start;
  margin-bottom: 60px;
}

.dgmc--head-stacked .dgmc__head {
  grid-template-columns: minmax(0, 1fr);
}

.dgmc__head-main,
.dgmc__head-aside {
  min-width: 0;
}

.dgmc__eyebrow {
  display: block;
  margin-bottom: 16px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--dgmc-gold);
}

.dgmc__heading {
  margin: 0;
  font-family: var(--dgmc-serif);
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--dgmc-deep);
}

.dgmc__intro {
  margin: 0;
  max-width: 58ch;
  font-size: 1.125rem;
  line-height: 1.7;
}

.dgmc--head-stacked .dgmc__intro {
  margin-top: 24px;
}

/* ---------- cards ---------- */
.dgmc__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--dgmc-gap);
  /* media / body / footer, repeated for each row of cards */
  grid-auto-rows: auto 1fr auto;
  align-items: stretch;
  max-width: 100%;
}

.dgmc__card {
  min-width: 0;
}

.dgmc__media,
.dgmc__body,
.dgmc__foot {
  min-width: 0;
}

/* Cards share the grid's row tracks, so the footer rule lands at the same
   height in every card no matter how the text above it wraps. gap:0 removes
   the row gutters inside a card; the gutter between rows of cards is not
   spanned by any card, so it survives. */
@supports (grid-template-rows: subgrid) {
  .dgmc__card {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    gap: 0;
  }
}

/* Older browsers: bottom-align the footer instead. Rules can sit at
   different heights, which is what subgrid is there to fix. */
@supports not (grid-template-rows: subgrid) {
  .dgmc__card {
    display: flex;
    flex-direction: column;
  }
  .dgmc__body {
    flex: 1;
  }
  .dgmc__foot {
    margin-top: auto;
  }
}

.dgmc__media {
  overflow: hidden;
  background: var(--dgmc-sand);
  margin-bottom: 24px;
}

.dgmc__media--empty::before {
  content: '';
  display: block;
  width: 100%;
  aspect-ratio: var(--dgmc-ratio);
}

.dgmc__media img {
  display: block;
  width: 100%;
  aspect-ratio: var(--dgmc-ratio);
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.dgmc--zoom .dgmc__card:hover .dgmc__media img {
  transform: scale(1.04);
}

/* No card has an image: the media row stays in the grid so the tracks still
   line up, but collapses to nothing. */
.dgmc--no-media .dgmc__media {
  background: none;
  margin-bottom: 0;
}

.dgmc--no-media .dgmc__media--empty::before {
  content: none;
}

.dgmc__title {
  margin: 0 0 10px;
  font-family: var(--dgmc-serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--dgmc-deep);
}

.dgmc__title a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.dgmc__title a:hover,
.dgmc__title a:focus-visible {
  border-bottom-color: var(--dgmc-gold);
}

.dgmc__text {
  margin: 0 0 24px;
  font-size: 1rem;
  line-height: 1.68;
}

.dgmc__foot {
  padding-top: 16px;
  border-top: 1px solid var(--dgmc-line);
}

.dgmc__foot:empty {
  padding-top: 0;
  border-top: 0;
}

.dgmc__foot-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--dgmc-gold);
}

.dgmc__foot-text {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.dgmc :focus-visible {
  outline: 2px solid var(--dgmc-gold);
  outline-offset: 3px;
}

/* ---------- carousel ---------- */
@media (max-width: 767px) {
  .dgmc.dgea--carousel-mobile .dgmc__grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .dgmc.dgea--carousel-mobile .dgmc__grid::-webkit-scrollbar {
    display: none;
  }
  .dgmc.dgea--carousel-mobile .dgmc__card {
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--dgmc-slide);
    scroll-snap-align: start;
  }
  .dgmc.dgea--carousel-mobile .dgmc__body {
    flex: 1;
  }
  .dgmc.dgea--carousel-mobile .dgmc__foot {
    margin-top: auto;
  }
  .dgmc.dgea--carousel-mobile .dgea-dots {
    display: flex;
  }
}

@media (max-width: 1024px) {
  .dgmc.dgea--carousel-tablet .dgmc__grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .dgmc.dgea--carousel-tablet .dgmc__grid::-webkit-scrollbar {
    display: none;
  }
  .dgmc.dgea--carousel-tablet .dgmc__card {
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--dgmc-slide);
    scroll-snap-align: start;
  }
  .dgmc.dgea--carousel-tablet .dgmc__body {
    flex: 1;
  }
  .dgmc.dgea--carousel-tablet .dgmc__foot {
    margin-top: auto;
  }
  .dgmc.dgea--carousel-tablet .dgea-dots {
    display: flex;
  }
}

/* ---------- dots ---------- */
.dgmc .dgea-dots {
  display: none;
  gap: 8px;
  align-items: center;
  margin-top: 28px;
}

.dgmc .dgea-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--dgmc-dot);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.dgmc .dgea-dot.is-active {
  background: var(--dgmc-dot-on);
  transform: scale(1.35);
}

@media (prefers-reduced-motion: reduce) {
  .dgmc__grid {
    scroll-behavior: auto;
  }
  .dgmc__media img,
  .dgmc .dgea-dot {
    transition: none;
  }
}

/* ---------- fallback for themes without Elementor breakpoints set ---------- */
@media (max-width: 1024px) {
  .dgmc__head {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}
