/* ============================================================
   FedSmith — Author detail
   Loaded only on is_author() routes, on top of archive.css.
   Breadcrumb / pagination / blog-card chrome live in archive.css
   and theme.css; this file owns just the author-header block.
   ============================================================ */

/* ============================================================
   Author detail header
   ============================================================ */
.author-detail {
  padding: 28px 0 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.author-detail__head {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 28px;
  align-items: start;
  margin-top: 14px;
}
.author-detail__avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--brand-deep-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: 0.02em;
  user-select: none;
  flex: 0 0 auto;
}
:root[data-theme="dark"] .author-detail__avatar { background: #5A6BE8; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .author-detail__avatar { background: #5A6BE8; }
}
.author-detail__avatar img { width: 100%; height: 100%; object-fit: cover; }

.author-detail__body { display: flex; flex-direction: column; gap: 12px; }
.author-detail h1 {
  font-family: "Outfit", sans-serif;
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--text-heading);
  margin: 0;
}
.author-detail__bio {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-body);
  margin: 0;
  max-width: 760px;
}
.author-detail__bio p { margin: 0 0 10px; }
.author-detail__bio p:last-child { margin-bottom: 0; }

/* Social icon row */
.author-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.author-socials a,
.author-socials button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r);
  color: #fff;
  background: var(--brand-navy);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.author-socials a:hover,
.author-socials button:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  text-decoration: none;
}
.author-socials svg { width: 18px; height: 18px; fill: currentColor; }
.author-socials .social--email { background: var(--brand-red); }
.author-socials .social--web { background: var(--social-web); }
.author-socials .social--x { background: var(--social-x); }
.author-socials .social--facebook { background: var(--social-facebook); }
.author-socials .social--linkedin { background: var(--social-linkedin); }
:root[data-theme="dark"] .author-socials .social--x { background: #1E1E1E; border: 1px solid #333; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .author-socials .social--x { background: #1E1E1E; border: 1px solid #333; }
}

/* Articles-by-author heading */
.author-articles-heading {
  font-family: "Outfit", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 22px;
}

/* Responsive: stack avatar above bio on mobile */
@media (max-width: 720px) {
  .author-detail__head {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .author-detail__avatar {
    width: 84px;
    height: 84px;
    font-size: 1.5rem;
  }
  .author-detail h1 { font-size: 2rem; }
  .author-articles-heading { font-size: 1.25rem; }
}

/* ============================================================
   Email-author modal (per-author contact form)
   Rendered only when an author opted in (fedsmith_contact_form_enabled).
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 10, 24, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-backdrop[data-open="true"] { display: flex; }
:root[data-theme="dark"] .modal-backdrop { background: rgba(0, 0, 0, 0.7); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .modal-backdrop { background: rgba(0, 0, 0, 0.7); }
}

.modal {
  background: var(--bg-card);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
  overflow: hidden;
}
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.modal__head h2 {
  font-family: "Outfit", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0;
}
.modal__close {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r);
  color: var(--text-heading);
  cursor: pointer;
  transition: background 0.15s;
}
.modal__close:hover { background: var(--bg-light-navy); color: var(--brand-navy); }
:root[data-theme="dark"] .modal__close:hover { background: #2A2A35; color: var(--link); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .modal__close:hover { background: #2A2A35; color: var(--link); }
}
.modal__close svg { width: 18px; height: 18px; }

.modal__body { padding: 20px; overflow-y: auto; }
.modal__body p {
  margin: 0 0 14px;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-row label {
  font-family: "DM Sans", sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-heading);
  letter-spacing: 0.01em;
}
.form-row input,
.form-row textarea {
  font-family: "DM Sans", sans-serif;
  font-size: 0.9375rem;
  color: var(--text-heading);
  background: var(--bg-page);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(6, 6, 171, 0.12);
}
:root[data-theme="dark"] .form-row input,
:root[data-theme="dark"] .form-row textarea {
  background: #2A2A2A; border-color: #3A3A3A; color: #E8E8E8;
}
:root[data-theme="dark"] .form-row input:focus,
:root[data-theme="dark"] .form-row textarea:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(122, 179, 224, 0.18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .form-row input,
  :root:not([data-theme]) .form-row textarea {
    background: #2A2A2A; border-color: #3A3A3A; color: #E8E8E8;
  }
  :root:not([data-theme]) .form-row input:focus,
  :root:not([data-theme]) .form-row textarea:focus {
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(122, 179, 224, 0.18);
  }
}
.form-row textarea { resize: vertical; min-height: 110px; }

/* Honeypot — visually hidden but still focusable so accessibility tools
   don't flag it; bots that auto-fill every field will trip it. */
.form-row--honeypot {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

/* Inline status banner (success / error) — sits above the form fields
   while the modal is open. */
.form-status {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--r);
  font-size: 0.875rem;
  line-height: 1.45;
  display: none;
}
.form-status[data-state="success"] {
  display: block;
  background: var(--bg-federal-blue);
  color: var(--brand-deep-navy);
  border: 1px solid var(--brand-navy);
}
.form-status[data-state="error"] {
  display: block;
  background: var(--bg-alert-red);
  color: var(--text-alert-red);
  border: 1px solid #A9271C;
}
:root[data-theme="dark"] .form-status[data-state="success"] {
  background: #1A2030; color: var(--link); border-color: var(--link);
}
:root[data-theme="dark"] .form-status[data-state="error"] {
  background: #2A1414; color: #E58A82; border-color: #A9271C;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .form-status[data-state="success"] {
    background: #1A2030; color: var(--link); border-color: var(--link);
  }
  :root:not([data-theme]) .form-status[data-state="error"] {
    background: #2A1414; color: #E58A82; border-color: #A9271C;
  }
}

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg-sand);
}
:root[data-theme="dark"] .modal__foot { background: #181820; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .modal__foot { background: #181820; }
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-heading);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-family: "DM Sans", sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
}
.btn-secondary:hover {
  background: var(--bg-light-navy);
  color: var(--brand-navy);
  border-color: var(--brand-navy);
}
:root[data-theme="dark"] .btn-secondary:hover {
  background: #2A2A35; color: var(--link); border-color: var(--link);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .btn-secondary:hover {
    background: #2A2A35; color: var(--link); border-color: var(--link);
  }
}

.btn-primary {
  background: var(--brand-navy);
  color: #fff;
  border: 0;
  border-radius: var(--r);
  font-family: "DM Sans", sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 22px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--brand-deep-navy); }
.btn-primary[disabled],
.btn-primary[aria-busy="true"] {
  opacity: 0.65;
  cursor: progress;
}
