/*
 * Living Coastal — Author Block
 *
 * Place this in WPCodeBox 2 → CSS Snippets as a single snippet:
 *   Title:   CSS — Author Block
 *   Run on:  Frontend
 *   Activate: yes
 *
 * Class scope: .lc-author-block and descendants.
 * Brand colors per project_listing_design_system.md.
 * Gold (#d0a667) used here for the primary CTA — its functional debut.
 */

.lc-author-block {
  width: 100%;
  padding-top: 60px;
  padding-bottom: 60px;
}

/* Outer card — same look whether single-author or co-author.
 * Grid layout: photo + brokerage badge stack in the fixed-width left column
 * (photo row 1, badge row 2); content spans the right column across both rows.
 * Grid is used (rather than a flex media wrapper) because the photo/badge Code
 * element renders without a root wrapper (noRoot), so the two <img>s are direct
 * children of this card — grid placement groups them into one visual column. */
.lc-author-card {
  background: #334376;
  border: 1px solid #2a3760;
  border-radius: 14px;
  box-shadow: 0 12px 34px rgba(31, 45, 80, 0.28);
  padding: 30px;
  display: grid;
  grid-template-columns: 140px 1fr;
  grid-template-rows: auto auto;
  column-gap: 24px;
  row-gap: 12px;
  align-items: start;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

/* Photo column (wrapper class retained for back-compat; unused under grid) */
.lc-author-photo-wrap {
  flex-shrink: 0;
}

.lc-author-photo {
  grid-column: 1;
  grid-row: 1;
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  display: block;
}

/* Brokerage badge — agent-photo⇒brokerage-logo rule (2026-06-19).
 * Rendered at the photo's size, in the same column, whenever the author
 * photo appears in an advertising context. PHP suppresses it on
 * pure-editorial and for non-licensee authors. */
.lc-author-badge {
  grid-column: 1;
  grid-row: 2;
  width: 140px;
  height: 140px;
  object-fit: contain;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: #ffffff;
  display: block;
}

/* Content column — spans all rows of the left media column */
.lc-author-content {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: start;
  min-width: 0;
}

.lc-author-eyebrow {
  font-family: 'Mulish', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #a9b6d6;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 6px;
}

.lc-author-name,
.lc-author-name a {
  font-family: 'Montserrat', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  line-height: 1.2;
  margin: 0;
  display: inline-block;
}

.lc-author-name a:hover,
.lc-author-name a:focus {
  color: #d0a667;
}

.lc-author-credential {
  font-family: 'Mulish', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #dbe1f0;
  margin: 4px 0 0;
  line-height: 1.4;
}

.lc-author-bio {
  font-family: 'Mulish', sans-serif;
  font-size: 15px;
  font-weight: 400;
  color: #e7ebf5;
  line-height: 1.65;
  margin: 14px 0 18px;
}

/* CTA strip */
.lc-cta-strip {
  display: flex;
  flex-direction: row;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
}

/* Pure-editorial hide: the PHP blanks the primary CTA label on pure-editorial
   (lc_author_cta_label() returns ''), leaving <a class="lc-btn-primary"> empty.
   When that happens, hide the whole strip — a non-advertising author block must
   not show a contact CTA, and the hardcoded "Browse Homes" shouldn't stand alone.
   This replaces the Bricks visibility condition, which doesn't resolve post-level
   ACF reliably inside a nested Template element. */
.lc-cta-strip:has(.lc-btn-primary:empty) {
  display: none;
}

.lc-btn-primary,
a.lc-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: 8px;
  background: #d0a667;
  color: #ffffff;
  font-family: 'Mulish', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(208, 166, 103, 0.35);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.lc-btn-primary:hover,
.lc-btn-primary:focus {
  background: #b88a4f;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(208, 166, 103, 0.45);
  color: #ffffff;
  text-decoration: none;
}

.lc-btn-secondary,
a.lc-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-family: 'Mulish', sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid #ffffff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.lc-btn-secondary:hover,
.lc-btn-secondary:focus {
  background: #ffffff;
  color: #334376;
  text-decoration: none;
}

/* License fine-print */
.lc-author-license {
  font-family: 'Mulish', sans-serif;
  font-size: 11px;
  color: #9aa6c6;
  letter-spacing: 0.02em;
  margin: 16px 0 0;
}

.lc-author-license:empty {
  display: none;
}

/* ─── Tablet portrait (≤991px) ────────────────────────────────────────── */
@media (max-width: 991px) {
  .lc-author-block {
    padding-top: 48px;
    padding-bottom: 48px;
    padding-left: 20px;
    padding-right: 20px;
  }
  .lc-author-card {
    padding: 26px;
    grid-template-columns: 120px 1fr;
    column-gap: 22px;
  }
  .lc-author-photo {
    width: 120px;
    height: 120px;
  }
  .lc-author-badge {
    width: 120px;
    height: 120px;
  }
  .lc-author-name,
  .lc-author-name a {
    font-size: 22px;
  }
}

/* ─── Mobile portrait (≤478px) ────────────────────────────────────────── */
@media (max-width: 478px) {
  .lc-author-block {
    padding-top: 36px;
    padding-bottom: 36px;
  }
  .lc-author-card {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    justify-items: center;
    text-align: center;
    padding: 22px;
    row-gap: 10px;
  }
  .lc-author-photo {
    grid-column: 1;
    grid-row: auto;
    width: 100px;
    height: 100px;
  }
  .lc-author-badge {
    grid-column: 1;
    grid-row: auto;
    width: 100px;
    height: 100px;
  }
  .lc-author-content {
    grid-column: 1;
    grid-row: auto;
    width: 100%;
    margin-top: 6px;
  }
  .lc-author-name,
  .lc-author-name a {
    font-size: 20px;
  }
  .lc-author-credential {
    font-size: 13px;
  }
  .lc-author-bio {
    font-size: 14px;
  }
  .lc-cta-strip {
    justify-content: center;
  }
  .lc-btn-primary,
  a.lc-btn-primary,
  .lc-btn-secondary,
  a.lc-btn-secondary {
    padding-left: 18px;
    padding-right: 18px;
    font-size: 13px;
  }
}
