/* Dasig Worldwide — Reusable Author Profile component
 *
 * Markup contract (see the #author section in index.html for a full example):
 *   <section class="author-profile" style="--ap-bg:url('/assets/photos/…')">
 *     <div class="ap-bg" aria-hidden="true"></div>
 *     <div class="wrap"> … .ap-header, .ap-grid (.ap-portrait + .ap-body), .ap-highlights, .ap-quote … </div>
 *   </section>
 *
 * Elements marked with [data-ap-reveal] fade in when scrolled into view
 * (handled by /assets/js/author-profile.js). Without JavaScript, or with
 * reduced motion enabled, everything is simply visible.
 * Uses the site palette variables defined on :root (--green, --deep, --gold, --cream, --ink, --muted).
 */

.author-profile {
  position: relative;
  overflow: hidden;
  background: #fbfaf5;
  border-top: 1px solid #e4e6dc;
  border-bottom: 1px solid #e4e6dc;
}

/* Subtle archive photo layer (~13% opacity), softly faded at the edges */
.author-profile .ap-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--ap-bg, none);
  background-size: cover;
  background-position: var(--ap-bg-position, center 35%);
  background-repeat: no-repeat;
  opacity: var(--ap-bg-opacity, 0.13);
  filter: saturate(0.75);
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 22%, #000 78%, transparent 100%);
}

.author-profile > .wrap {
  position: relative;
  z-index: 1;
  padding-block: 88px;
}

/* Header */
.ap-header {
  max-width: 720px;
  margin-bottom: 44px;
}
.ap-header h2 {
  color: var(--green);
  margin-bottom: 0;
}
.ap-header h2::after {
  content: '';
  display: block;
  width: 64px;
  height: 3px;
  margin-top: 18px;
  border-radius: 3px;
  background: var(--gold);
}

/* Two-column layout */
.ap-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(36px, 5vw, 72px);
  align-items: start;
}

/* Portrait */
.ap-portrait {
  margin: 0;
  position: relative;
  max-width: 460px;
  width: 100%;
}
.ap-portrait-frame {
  position: relative;
}
.ap-portrait-frame::before {
  /* Offset gold keyline behind the photo */
  content: '';
  position: absolute;
  inset: 18px -18px -18px 18px;
  border: 1.5px solid var(--gold);
  border-radius: 22px;
  z-index: 0;
}
.ap-portrait img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  background: #e9eee5;
  box-shadow: 0 22px 48px rgba(11, 41, 34, 0.18), 0 4px 12px rgba(11, 41, 34, 0.08);
}

/* Biography */
.ap-name {
  font-size: clamp(32px, 4vw, 46px);
  color: var(--deep);
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}
.ap-titles {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #81601d;
}
.ap-titles li {
  display: inline-flex;
  align-items: center;
}
.ap-titles li + li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  margin: 0 12px;
}
.ap-bio p {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
}
.ap-bio p:first-child {
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1.6;
  color: var(--green);
}
.ap-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.ap-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}
.ap-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(11, 41, 34, 0.16);
}
.ap-actions .btn.ap-outline {
  background: transparent;
  color: var(--green);
  border: 1.5px solid var(--green);
}
.ap-actions .btn.ap-outline:hover {
  background: var(--green);
  color: #fff;
}
.ap-actions svg {
  width: 16px;
  height: 16px;
  flex: none;
}

/* Highlight cards */
.ap-highlights {
  list-style: none;
  padding: 0;
  margin: 72px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.ap-highlight {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #e1e5dc;
  border-radius: 14px;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.ap-highlight:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(11, 41, 34, 0.08);
}
.ap-icon {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #eef2ea;
  color: var(--green);
}
.ap-icon svg {
  width: 22px;
  height: 22px;
}
.ap-highlight-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.ap-highlight-value {
  display: block;
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.3;
  color: var(--deep);
}

/* Inspirational statement */
.ap-quote {
  position: relative;
  margin: 56px auto 0;
  max-width: 880px;
  padding: 52px clamp(24px, 6vw, 72px) 44px;
  text-align: center;
  background: var(--green);
  color: #fff;
  border-radius: 20px;
  overflow: hidden;
}
.ap-quote::before {
  content: '\201C';
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  font-family: Georgia, serif;
  font-size: 200px;
  line-height: 1;
  color: var(--gold);
  opacity: 0.22;
  pointer-events: none;
}
.ap-quote-label {
  display: block;
  position: relative;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}
.ap-quote-text {
  position: relative;
  margin: 0;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(22px, 3vw, 31px);
  line-height: 1.45;
  color: #f8f6ef;
}
.ap-quote-text::before { content: '\201C'; }
.ap-quote-text::after { content: '\201D'; }

/* Fade-in on scroll (only when JS has enabled it) */
.ap-anim [data-ap-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
  transition-delay: var(--ap-delay, 0s);
}
.ap-anim [data-ap-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .ap-anim [data-ap-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .ap-actions .btn,
  .ap-highlight {
    transition: none;
  }
  .ap-actions .btn:hover,
  .ap-highlight:hover {
    transform: none;
  }
}

/* Tablet */
@media (max-width: 960px) {
  .ap-highlights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile and small tablets: portrait above biography */
@media (max-width: 820px) {
  .author-profile > .wrap {
    padding-block: 60px;
  }
  .ap-header {
    margin-bottom: 32px;
  }
  .ap-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .ap-portrait {
    max-width: 380px;
    margin-inline: auto;
  }
  .ap-portrait-frame::before {
    inset: 12px -12px -12px 12px;
  }
  .ap-highlights {
    margin-top: 52px;
  }
}

@media (max-width: 560px) {
  .ap-portrait {
    max-width: calc(100% - 14px);
    margin-left: 0;
  }
  .ap-bio p:first-child {
    font-size: 18px;
  }
  .ap-bio p {
    font-size: 16px;
  }
  .ap-highlights {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .ap-highlight {
    padding: 18px;
  }
  .ap-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .ap-quote {
    border-radius: 16px;
    margin-top: 40px;
  }
}

/* Desktop: keep the portrait in view while reading the biography */
@media (min-width: 821px) {
  .ap-portrait {
    position: sticky;
    top: 130px;
  }
}
