/*********************
Single agent page (rechat/agents-single-custom.php). Loaded only on single "agents" posts.
Brand band hero with a framed portrait overlapping into the page; bio + details left, sticky contact
form right; the plugin's listings sections below. Tokens follow the site design system.
*********************/
.ag-page {
  --ag-green: var(--primary-color, #1c5e36);
  --ag-canopy: #123d23;
  --ag-leaf: #9cc5a6;
  --ag-loam: var(--bg-color, #fbf9f7);
  --ag-sage: #e6eee8;
  --ag-line: #d7ddd9;
  --ag-ink: #1a1a1a;
  --ag-bark: var(--text-color-1, #5c5c5c);
  --ag-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- buttons ---------- */
.ag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 26px;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.ag-btn:focus-visible {
  outline: 2px solid var(--ag-leaf);
  outline-offset: 3px;
}

.ag-btn--light {
  color: var(--ag-canopy);
  background-color: #fff;
}

.ag-btn--light:hover {
  background-color: var(--ag-leaf);
}

.ag-btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}

.ag-btn--ghost:hover {
  color: var(--ag-canopy);
  background-color: #fff;
  border-color: #fff;
}

/* ---------- hero ---------- */
.ag-hero {
  position: relative;
  padding-top: 184px;
  color: #fff;
  background:
    radial-gradient(90% 120% at 85% 0%, rgba(156, 197, 166, 0.22), transparent 60%),
    linear-gradient(160deg, var(--ag-green) 0%, var(--ag-canopy) 75%);
}

.ag-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 64px;
  align-items: end;
}

.ag-hero__text {
  padding-bottom: 96px;
}

.ag-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: var(--ag-leaf);
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}

.ag-eyebrow svg {
  transition: transform 0.25s var(--ag-ease);
}

.ag-eyebrow:hover {
  color: #fff;
}

.ag-eyebrow:hover svg {
  transform: translateX(-4px);
}

.ag-hero__name {
  margin: 0;
  color: #fff;
  font-family: var(--font-family);
  font-size: clamp(42px, 6vw, 88px);
  font-weight: 200;
  line-height: 1.02;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ag-hero .ag-hero__meta {
  margin: 18px 0 0;
  color: var(--ag-leaf);
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ag-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

/* portrait: framed, overlapping the band into the page */
.ag-hero__portrait {
  position: relative;
  z-index: 2;
  margin-bottom: -96px;
}

.ag-portrait {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  background-color: var(--ag-canopy);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.45);
}

.ag-portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border: 1px solid var(--ag-leaf);
  transform: translate(18px, 18px);
}

.ag-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.ag-portrait--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(80% 80% at 30% 20%, rgba(156, 197, 166, 0.3), transparent 60%),
    linear-gradient(160deg, var(--ag-green), var(--ag-canopy));
}

.ag-portrait__initials {
  color: #fff;
  font-family: var(--font-family);
  font-size: 96px;
  font-weight: 100;
  letter-spacing: 0.06em;
}

/* ---------- content ---------- */
.ag-page .ag-content {
  margin-block: 0;
  padding-block: 160px 96px;
}

.ag-layout {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 72px;
  align-items: start;
}

.ag-page .ag-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  color: var(--ag-green);
  font-size: 12px;
  font-weight: 500 !important;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.ag-page .ag-label::before {
  content: "";
  width: 32px;
  height: 1px;
  background-color: currentColor;
}

.ag-title {
  margin: 0 0 32px;
  color: var(--ag-green);
  font-family: var(--font-family);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 200;
  line-height: 1.2;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ag-bio {
  max-width: 68ch;
  color: var(--ag-bark);
}

.ag-bio p {
  margin: 0 0 1.1em;
  font-size: 17px;
  line-height: 1.85 !important;
  letter-spacing: 0.01em !important;
}

.ag-bio a {
  color: var(--ag-green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* details */
.ag-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 40px 0 0;
}

.ag-details > div {
  padding-block: 18px;
  border-top: 1px solid var(--ag-sage);
}

.ag-details dt {
  margin-bottom: 6px;
  color: var(--ag-bark);
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.ag-details dd {
  margin: 0;
  color: var(--ag-ink);
  font-family: var(--font-family);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.5;
  word-break: break-word;
}

.ag-details a {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.ag-details a:hover {
  color: var(--ag-green);
}

/* social */
.ag-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.ag-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ag-line);
  border-radius: 50%;
  transition: border-color 0.2s, background-color 0.2s;
}

.ag-social a:hover,
.ag-social a:focus-visible {
  background-color: var(--ag-sage);
  border-color: var(--ag-green);
  outline: none;
}

.ag-social img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.8;
}

/* ---------- contact form card (plugin JS binds by id; markup unchanged) ---------- */
.ag-aside {
  position: sticky;
  top: 40px;
}

/* the plugin also makes this wrapper sticky; the aside handles it */
.ag-page .ag-form {
  position: static;
}

.ag-page .ag-form form {
  margin: 0;
  padding: 40px 36px 44px;
  background-color: #fff;
  border: 1px solid var(--ag-sage);
  border-top: 4px solid var(--ag-green);
  border-radius: 0;
  box-shadow: 0 30px 60px -30px rgba(18, 61, 35, 0.22);
}

.ag-page .ag-form form h2 {
  margin: 0 0 28px;
  color: var(--ag-green);
  font-family: var(--font-family);
  font-size: 22px;
  font-weight: 200;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.ag-page .ag-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 18px;
}

.ag-page .ag-form .form-group label {
  margin: 0;
  color: var(--ag-bark);
  font-family: var(--font-family);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.ag-page .ag-form .form-group:focus-within label {
  color: var(--ag-green);
}

.ag-page .ag-form .form-group input,
.ag-page .ag-form .form-group textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  color: var(--ag-ink);
  font-family: var(--font-family);
  font-size: 15px;
  font-weight: 300;
  text-align: left;
  background-color: var(--ag-loam);
  border: 1px solid var(--ag-line);
  border-radius: 0 !important;
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.ag-page .ag-form .form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.ag-page .ag-form .form-group input::placeholder,
.ag-page .ag-form .form-group textarea::placeholder {
  color: #9aa39d !important;
  font-size: 14px;
}

.ag-page .ag-form .form-group input:focus,
.ag-page .ag-form .form-group textarea:focus {
  background-color: #fff;
  border-color: var(--ag-green);
  box-shadow: 0 0 0 4px rgba(28, 94, 54, 0.12);
  outline: none;
}

.ag-page .ag-form button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  color: #fff;
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  background-color: var(--ag-green);
  border: 1px solid var(--ag-green);
  border-radius: 0;
  transition: background-color 0.2s, border-color 0.2s;
}

.ag-page .ag-form button[type="submit"]:hover {
  color: #fff;
  background-color: var(--ag-canopy);
  border-color: var(--ag-canopy);
}

.ag-page .ag-form button[type="submit"]:focus-visible {
  outline: 2px solid var(--ag-green);
  outline-offset: 3px;
}

.ag-page .ag-form .rch-success-box-listing,
.ag-page .ag-form .rch-error-box-listing {
  margin-top: 14px;
  padding: 14px 16px;
  font-size: 14px;
  text-align: left;
  border: 0;
  border-left: 3px solid;
  border-radius: 0;
}

.ag-page .ag-form .rch-success-box-listing {
  color: var(--ag-canopy);
  background-color: var(--ag-sage);
  border-left-color: var(--ag-green);
}

.ag-page .ag-form .rch-error-box-listing {
  color: #8c1d18;
  background-color: #fbeceb;
  border-left-color: #b3261e;
}

.ag-page #leadCaptureForm {
  scroll-margin-top: 24px;
}

/* ---------- plugin listings sections ---------- */
.ag-page .rch-agents-list {
  margin-top: 96px;
}

.ag-page .rch-agents-list > h2 {
  margin: 0 0 40px;
  color: var(--ag-bark);
  font-family: var(--font-family);
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 200;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

/* ---------- responsive ---------- */
@media screen and (max-width: 1200px) {
  .ag-hero__grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 48px;
  }

  .ag-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 48px;
  }
}

@media screen and (max-width: 992px) {
  .ag-hero {
    padding-top: 150px;
  }

  .ag-hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    text-align: center;
  }

  .ag-hero__portrait {
    order: -1;
    width: min(280px, 70%);
    margin: 0 auto;
  }

  .ag-hero__text {
    padding-bottom: 64px;
  }

  .ag-hero__actions {
    justify-content: center;
  }

  .ag-page .ag-content {
    padding-block: 64px 72px;
  }

  .ag-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ag-aside {
    position: static;
  }
}

@media screen and (max-width: 576px) {
  .ag-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .ag-hero__actions .ag-btn {
    flex: 1 1 calc(50% - 6px);
  }

  .ag-page .ag-form form {
    padding: 32px 22px 36px;
  }

  .ag-portrait::before {
    transform: translate(12px, 12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag-btn,
  .ag-eyebrow svg,
  .ag-social a {
    transition: none;
  }
}
