/* AziMiner: scoped integration styles for three approved homepage changes.
   Load after the existing theme. No global element selectors or JS required. */

.az-home-v2 {
  --az-v2-white: #ffffff;
  --az-v2-charcoal: #17251f;
  --az-v2-muted: #65756d;
  --az-v2-amber: #eda424;
  --az-v2-border: #dde4dd;
  --az-v2-dark-amber: #a66b08;
  box-sizing: border-box;
  color: var(--az-v2-charcoal);
  font-family: inherit;
}

.az-home-v2 *,
.az-home-v2 *::before,
.az-home-v2 *::after {
  box-sizing: border-box;
}

.az-home-v2 .az-home-v2__section-title {
  margin: 0 0 16px;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.az-home-v2 .az-home-v2__card-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.az-home-v2 .az-home-v2__body {
  margin: 0;
  color: var(--az-v2-muted);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.55;
}

.az-home-v2 .az-home-v2__eyebrow {
  margin: 0 0 12px;
  color: var(--az-v2-dark-amber);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.az-home-v2 .az-home-v2__accent {
  color: var(--az-v2-dark-amber);
}

.az-home-v2 .az-home-v2__diagram {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
}

/* AI card: occupy the existing card slot; retain the original three-card grid. */
.az-home-v2.az-home-v2--ai {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--az-v2-border);
  border-radius: 16px;
  background: var(--az-v2-white);
}

.az-home-v2 .az-home-v2__ai-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.az-home-v2 .az-home-v2__ai-head .az-home-v2__card-title {
  margin: 0;
}

.az-home-v2 .az-home-v2__ai-copy {
  padding: 24px 24px 18px;
}

.az-home-v2 .az-home-v2__ai-diagram {
  background: var(--az-v2-white);
}

/* Calculator: mobile/tablet DOM order is intro, functional calculator, image. */
.az-home-v2.az-home-v2--calculator {
  position: relative;
  isolation: isolate;
  /* Do not clip the existing calculator's menus, tooltips or focus rings.
     The image figure clips its own artwork independently. */
  background: var(--az-v2-white);
}

.az-home-v2 .az-home-v2__calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding: 40px 24px 24px;
}

.az-home-v2 .az-home-v2__calculator-intro {
  min-width: 0;
  max-width: 500px;
}

.az-home-v2 .az-home-v2__calculator-card {
  position: relative;
  min-width: 0;
  border: 1px solid var(--az-v2-border);
  border-radius: 20px;
  padding: 28px;
  background: var(--az-v2-white);
  box-shadow: 0 16px 44px rgb(23 37 31 / 7%);
}

.az-home-v2 .az-home-v2__calculator-scene {
  position: relative;
  min-width: 0;
  height: clamp(140px, 25vw, 200px);
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
}

.az-home-v2 .az-home-v2__calculator-scene picture,
.az-home-v2 .az-home-v2__calculator-scene img {
  display: block;
  width: 100%;
  height: 100%;
}

.az-home-v2 .az-home-v2__calculator-scene img {
  object-fit: cover;
  object-position: 50% 55%;
}

.az-home-v2 .az-home-v2__scene-caption {
  position: absolute;
  z-index: 2;
  left: 16px;
  bottom: 12px;
  max-width: calc(100% - 32px);
  border-radius: 5px;
  padding: 5px 8px;
  background: rgb(255 255 255 / 94%);
  color: var(--az-v2-muted);
  font-size: 11px;
  line-height: 1.35;
}

/* Affiliate: existing copy is live HTML; illustration contains no offer terms. */
.az-home-v2.az-home-v2--affiliate {
  background: var(--az-v2-white);
}

.az-home-v2 .az-home-v2__affiliate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding: 40px 24px;
}

.az-home-v2 .az-home-v2__affiliate-copy {
  min-width: 0;
}

.az-home-v2 .az-home-v2__affiliate-diagram {
  max-width: 600px;
  justify-self: center;
}

@media (min-width: 1024px) {
  .az-home-v2 .az-home-v2__calculator-grid {
    grid-template-columns: minmax(0, 42fr) minmax(0, 58fr);
    align-items: center;
    gap: 32px;
    min-height: 500px;
    padding: 56px 32px;
  }

  .az-home-v2 .az-home-v2__calculator-intro,
  .az-home-v2 .az-home-v2__calculator-card {
    z-index: 1;
  }

  .az-home-v2 .az-home-v2__calculator-intro {
    position: relative;
    padding-bottom: 32px;
  }

  .az-home-v2 .az-home-v2__calculator-card {
    padding: 32px;
  }

  .az-home-v2 .az-home-v2__calculator-scene {
    /* The section is the containing block. Keep calculator-grid static so
       the image spans the section, including outside the max-width content. */
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    pointer-events: none;
  }

  .az-home-v2 .az-home-v2__calculator-scene img {
    object-position: 50% 58%;
  }

  .az-home-v2 .az-home-v2__calculator-scene::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    content: "";
    background:
      linear-gradient(180deg, rgb(255 255 255 / 78%) 0%, rgb(255 255 255 / 24%) 70%, rgb(255 255 255 / 9%) 100%),
      linear-gradient(90deg, #fff 0%, rgb(255 255 255 / 96%) 23%, rgb(255 255 255 / 86%) 42%, rgb(255 255 255 / 25%) 66%, rgb(255 255 255 / 6%) 100%);
  }

  .az-home-v2 .az-home-v2__scene-caption {
    left: max(32px, calc((100% - 1280px) / 2 + 32px));
    bottom: 16px;
  }

  .az-home-v2 .az-home-v2__affiliate-grid {
    grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
    gap: 32px;
    padding: 48px 32px;
  }
}

@media (max-width: 479px) {
  .az-home-v2 .az-home-v2__calculator-grid,
  .az-home-v2 .az-home-v2__affiliate-grid {
    padding-inline: 16px;
  }

  .az-home-v2 .az-home-v2__calculator-card {
    padding: 20px;
    border-radius: 16px;
  }

  .az-home-v2 .az-home-v2__ai-copy {
    padding: 20px 20px 16px;
  }
}

/* Beat older homepage/theme rules without changing unrelated sections. */
html body #calculator.az-home-v2--calculator {
  background: #ffffff !important;
  min-height: 0 !important;
  overflow: visible !important;
}
html body #calculator.az-home-v2--calculator .az-home-v2__calculator-card.calc-card {
  background: #ffffff;
  border: 1px solid #dde4dd;
  box-shadow: 0 16px 44px rgb(23 37 31 / 7%);
  border-radius: 20px;
  padding: 28px;
}
html body #affiliate.az-home-v2--affiliate .hp-aff-wrap.az-home-v2__affiliate-grid {
  max-width: 1280px;
  min-height: 0;
  gap: 24px;
  padding: 40px 24px;
  grid-template-columns: minmax(0, 1fr);
}
html body #affiliate.az-home-v2--affiliate .az-home-v2__affiliate-diagram,
html body #affiliate.az-home-v2--affiliate .az-home-v2__affiliate-diagram img {
  width: 100%;
  height: auto;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}
html body #affiliate.az-home-v2--affiliate .hp-aff-visual {
  min-height: 0;
}
html body #affiliate.az-home-v2--affiliate .hp-aff-visual::after {
  display: none;
}
html body .hiw-grid .az-home-v2--ai {
  min-width: 320px;
}
@media (max-width: 1023px) {
  html body .hiw-grid .az-home-v2--ai {
    min-width: 0;
  }
}
@media (min-width: 1024px) and (max-width: 1512px) {
  .az-home-v2 .az-home-v2__calculator-grid {
    max-width: 1160px;
    min-height: 0;
    gap: 28px;
    padding: 40px 28px;
  }
  html body #calculator.az-home-v2--calculator .az-home-v2__calculator-card.calc-card {
    padding: 22px 22px 18px;
  }
}
@media (min-width: 1513px) {
  html body #calculator.az-home-v2--calculator .az-home-v2__calculator-card.calc-card {
    padding: 32px;
  }
}
@media (min-width: 1024px) {
  html body #affiliate.az-home-v2--affiliate .hp-aff-wrap.az-home-v2__affiliate-grid {
    grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
    gap: 32px;
    padding: 48px 32px;
  }
}
@media (max-width: 479px) {
  html body #affiliate.az-home-v2--affiliate .hp-aff-wrap.az-home-v2__affiliate-grid {
    padding-inline: 16px;
  }
}
