/* ── AUTHOR PAGE ─────────────────────────────────────────── */

/* ── Hero ─────────────────────────────────────────────────── */
.author-hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10rem 2rem 6rem;
  position: relative;
  overflow: hidden;
}

/* Background photo with cream overlay to keep text legible */
.author-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/images/joe-writing.png');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  opacity: 0.20;
  z-index: 0;
}

/* Ensure hero content sits above the background */
.author-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
}

.author-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3.5rem, 10vw, 6rem);
  font-weight: 300;
  color: var(--wine);
  line-height: 1.1;
  letter-spacing: 0.02em;
  margin-bottom: 2rem;
  transition: opacity 600ms ease;
}
.author-name-last { font-style: italic; }

.hero-divider {
  width: 50px;
  height: 1px;
  background: var(--amber);
  margin: 0 auto 2.5rem;
}

/* Epigraph */
.author-epigraph {
  border-left: 2px solid var(--amber);
  padding: 1.2rem 1.8rem;
  margin: 0 auto 2rem;
  max-width: 560px;
  text-align: left;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  font-style: italic;
  font-weight: 600;
  color: var(--burgundy);
  line-height: 1.7;
  text-shadow: 0 1px 6px rgba(30,18,10,0.15);
  transition: opacity 1000ms ease;
}
.author-epigraph p { margin: 0; }

/* Change 1: Emotional hook / dedication */
.author-dedication {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.88rem, 2vw, 1rem);
  font-style: italic;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 2rem;
  text-shadow: 0 1px 6px rgba(30,18,10,0.15);
  transition: opacity 800ms ease;
}

/* Accessibility: skip animation, show all elements statically */
@media (prefers-reduced-motion: reduce) {
  .author-name,
  .author-epigraph,
  .author-dedication {
    opacity: 1 !important;
    transition: none !important;
  }
}

/* ── Bio section ─────────────────────────────────────────── */
.author-bio-section {
  background: var(--soft);
}

.author-bio-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 5rem;
  align-items: start;
}

.author-bio-sidebar {
  position: sticky;
  top: 7rem;
}

.author-bio-text p {
  margin-bottom: 1.4rem;
  color: var(--ink);
}
.author-bio-text p:last-child { margin-bottom: 0; }

/* Change 2: Micro-CTA arrow link */
.author-micro-cta {
  display: inline-block;
  margin-top: 1.8rem;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--burgundy);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.25s, transform 0.2s;
}
.author-micro-cta:hover {
  color: var(--wine);
  transform: translateX(4px);
}
.author-micro-cta--center {
  margin-top: 0;
}

/* ── Book section ────────────────────────────────────────── */
.author-book-section {
  background: var(--cream);
}

.author-book-publisher {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem !important;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted) !important;
  margin-top: -0.5rem;
}

/* Change 3: Poem fragment in book section */
.author-poem-fragment {
  border-left: 2px solid var(--amber);
  padding: 1.1rem 1.5rem;
  margin: 2rem 0;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  color: var(--burgundy);
  line-height: 1.8;
}
.author-poem-fragment p { margin: 0 0 0.8rem; }
.author-poem-fragment p:last-child { margin-bottom: 0; }
.author-poem-fragment-attr {
  text-align: right;
  font-family: 'Cinzel', serif;
  font-style: normal;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--amber);
  margin-top: 0.8rem !important;
}
.author-poem-fragment-attr cite { font-style: normal; }

.author-buy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

/* ── Social Proof section (Change 4) ─────────────────────── */
.author-social-proof-section {
  background: var(--parchment);
  border-top: 1px solid rgba(180,150,100,0.25);
  border-bottom: 1px solid rgba(180,150,100,0.25);
}

.author-testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.author-testimonial-card {
  padding: 2.2rem 1.8rem 1.8rem;
  border: 1px solid rgba(184,115,51,0.35);
  border-top: 3px solid var(--amber);
  background: var(--cream);
  box-shadow: 0 4px 20px rgba(30,18,10,0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.author-testimonial-card::before {
  content: '\201C';
  font-family: 'Cormorant Garamond', serif;
  font-size: 4.5rem;
  line-height: 1;
  color: var(--amber);
  opacity: 0.25;
  position: absolute;
  top: 0.6rem;
  left: 1.2rem;
  pointer-events: none;
}

.author-testimonial-quote {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.75;
  margin: 0;
  padding-top: 1rem;
}

.author-testimonial-source {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0;
}

/* ── Instagram / Social section (Change 5) ──────────────── */
.author-ig-section {
  background: var(--cream);
}

.author-ig-subtext {
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 3rem;
}

.author-ig-handle {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  margin-top: -0.5rem;
  margin-bottom: 3rem;
  transition: color 0.25s;
}
.author-ig-handle:hover { color: var(--burgundy); }

/* Carousel container */
.author-ig-carousel {
  display: flex;
  gap: 1.2rem;
  padding: 0 2rem 1rem;
  max-width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.author-ig-carousel::-webkit-scrollbar { display: none; }

/* Individual card */
.ig-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--soft);
  border: 1px solid rgba(180,150,100,0.25);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.ig-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(30,18,10,0.12);
}

/* Thumbnail */
.ig-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--parchment);
}
.ig-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.82;
}

/* Placeholder when image fails */
.ig-card-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: var(--parchment);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Reel badge */
.ig-reel-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  background: rgba(30,18,10,0.65);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 2px;
}

/* Excerpt */
.ig-card-excerpt {
  padding: 0.8rem 1rem 0.4rem;
  font-family: 'EB Garamond', serif;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Engagement stats */
.ig-card-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.3rem 1rem 0.6rem;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* "Ver en Instagram" link */
.ig-card-cta {
  display: block;
  padding: 0.65rem 1rem;
  border-top: 1px solid rgba(180,150,100,0.2);
  font-family: 'EB Garamond', serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--burgundy);
  text-align: center;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}
.ig-card-cta:hover {
  background: var(--parchment);
  color: var(--wine);
}

/* Platform footer bar */
.ig-card-platform {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid rgba(180,150,100,0.2);
  font-family: 'EB Garamond', serif;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--burgundy);
}
.ig-card-platform svg {
  flex-shrink: 0;
}
.ig-card-platform:hover {
  background: var(--parchment);
  color: var(--wine);
}

/* Skeleton loading */
.ig-skeleton { pointer-events: none; }

.ig-skeleton-thumb {
  width: 100%;
  aspect-ratio: 4 / 5;
  background: var(--parchment);
  animation: igPulse 1.5s ease-in-out infinite;
}

.ig-skeleton-line {
  height: 12px;
  margin: 0.8rem 1rem 0;
  background: var(--parchment);
  border-radius: 2px;
  animation: igPulse 1.5s ease-in-out infinite;
}
.ig-skeleton-line--short { width: 60%; margin-top: 0.5rem; }

@keyframes igPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 0.8; }
}

/* ── Connect section (Change 6) ─────────────────────────── */
.author-connect-section {
  background: var(--parchment);
}

.excerpt-divider {
  width: 50px;
  height: 1px;
  background: var(--amber);
  margin: 0 auto 2.5rem;
}

.author-connect-body {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-style: italic;
  color: var(--muted);
  max-width: 400px;
  margin: 0 auto 2.5rem;
  line-height: 1.8;
}

.author-connect-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  margin-bottom: 2.5rem;
}

.author-social-btn {
  min-width: 240px;
  text-align: center;
}

.author-email-link {
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  transition: color 0.3s;
  display: inline-block;
  margin-top: 0.5rem;
}
.author-email-link:hover { color: var(--burgundy); }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .author-hero { padding: 8rem 1.5rem 5rem; }

  .author-bio-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .author-bio-sidebar { position: static; }

  .author-buy-links {
    flex-direction: column;
  }
  .author-buy-links .btn-primary,
  .author-buy-links .btn-outline {
    width: 100%;
    text-align: center;
  }

  .author-testimonials-grid {
    grid-template-columns: 1fr;
  }

  /* Carousel: 1.2 cards visible to hint overflow */
  .author-ig-carousel {
    padding: 0 1.5rem 1rem;
  }

  .author-connect-links {
    flex-direction: column;
    align-items: center;
  }
  .author-social-btn {
    width: 100%;
  }
}

/* lg (992px): up to 3 cards visible */
@media (min-width: 992px) {
  .author-ig-carousel {
    padding: 0 2rem 1rem;
  }
  .ig-card {
    flex: 0 0 calc(33.333% - 0.8rem);
    max-width: calc(33.333% - 0.8rem);
  }
}

/* xl (1200px): up to 6 cards visible */
@media (min-width: 1200px) {
  .ig-card {
    flex: 0 0 calc(16.666% - 1rem);
    max-width: calc(16.666% - 1rem);
  }
}
