/* AGM Current Promotion — popup + side tab (Altman branding) */

:root {
  --agm-promo-black: #000000;
  --agm-promo-white: #ffffff;
  --agm-promo-font: Function, "Open Sans", Arial, Helvetica, sans-serif;
  --agm-promo-font-bold: FunctionBold, Function, "Open Sans", Arial, Helvetica, sans-serif;
  --agm-promo-z: 2147483646;
  --agm-promo-tab-bottom: 72px;   /* sits just above the accessibility widget */
}

/* ---------- Side tab ---------- */

.agm-promo-tab {
  position: fixed;
   bottom: calc(var(--agm-promo-tab-bottom) + env(safe-area-inset-bottom, 0px)); 
  left: 0;
  z-index: calc(var(--agm-promo-z) - 1);
  writing-mode: vertical-rl;
  transform: rotate(180deg);    /* text reads bottom to top */
    padding: 20px 13px;
  background: var(--agm-promo-black);
  border: 2px solid var(--agm-promo-black);
  border-radius: 0;
  color: var(--agm-promo-white);
  font-family: var(--agm-promo-font-bold);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 1.35px;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease, color 0.2s ease, padding 0.2s ease;
}

.agm-promo-tab:hover,
.agm-promo-tab:focus-visible, .agm-promo-tab:focus {
  padding-left: 17px;           /* slides out toward the page after rotation */
  background: var(--agm-promo-white);
  color: var(--agm-promo-black);
  text-decoration: none;
}

.agm-promo-tab:focus-visible {
  outline: 2px solid var(--agm-promo-black);
  outline-offset: 3px;
}

@media (max-width: 1023px) {
  .agm-promo-tab {
    padding: 15px 10px;
    font-size: 12px;
    letter-spacing: 1px;
  }

  .agm-promo-tab:hover,
  .agm-promo-tab:focus-visible {
    padding-left: 10px;         /* no slide on touch screens */
  }
}

/* ---------- Popup ---------- */

.agm-promo-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--agm-promo-z);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: rgba(0, 0, 0, 0.75);
  animation: agm-promo-fade 0.25s ease;
}

.agm-promo-overlay[hidden] {
  display: none;
}

html.agm-promo-open,
html.agm-promo-open body {
  overflow: hidden;
}

.agm-promo-dialog {
  position: relative;
  width: auto;                  /* shrink to fit the graphic */
  max-width: 1000px;            /* override per promo with data-max-width */
  max-height: calc(100vh - 64px);
  line-height: 0;
  background: var(--agm-promo-white);
  border: 3px solid var(--agm-promo-white);
  border-radius: 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.agm-promo-link {
  display: block;
}

.agm-promo-image {
  display: block;
  width: auto;                  /* never upscale past the image's own size */
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 150px);   /* leaves room for the button bar */
  object-fit: contain;
}

/* ---------- Call-to-action button (matches Altman's Apply Now) ---------- */

.agm-promo-actions {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: var(--agm-promo-white);
  line-height: normal;
}

.agm-promo-cta {
  display: inline-block;
  min-width: 220px;
  padding: 14px 28px;
  border: 2px solid var(--agm-promo-black);
  border-radius: 0;
  background: var(--agm-promo-black);
  color: var(--agm-promo-white);
  font-family: var(--agm-promo-font-bold);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.agm-promo-cta:hover,
.agm-promo-cta:focus-visible {
  background: var(--agm-promo-white);
  color: var(--agm-promo-black);
  text-decoration: none;
}

.agm-promo-cta:focus-visible {
  outline: 2px solid var(--agm-promo-black);
  outline-offset: 3px;
}

/* Square black close button on the top-right corner, like Altman's discount boxes */
.agm-promo-close {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--agm-promo-black);
  color: var(--agm-promo-white);
  font-family: var(--agm-promo-font);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.agm-promo-close:hover, .agm-promo-close:focus {
  background: var(--agm-promo-white);
  color: var(--agm-promo-black);
  box-shadow: inset 0 0 0 2px var(--agm-promo-black);
}

.agm-promo-close:focus-visible {
  outline: 3px solid var(--agm-promo-white);
  outline-offset: 2px;
  color: #fff;
  background:#000;
}

/* ---------- Floor Plans special highlight ---------- */

.agm-promo-highlight {
  animation: agm-promo-pulse 1.1s ease 2;
}

@keyframes agm-promo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
  50%      { box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.85); }
}

@keyframes agm-promo-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .agm-promo-overlay,
  .agm-promo-highlight {
    animation: none;
  }
}
