/*
  ========================================================================
  AUTHOR BIOGRAPHY STYLES (author.css)
  ========================================================================
  Shared by the Home page (short author intro) and the About page (full
  biography, honours & awards). Light/dark theming rides on the CSS custom
  properties already re-mapped by dark-mode.css (var(--color-white) becomes
  the dark card surface, var(--color-sand-dark) the dark border, etc.), so
  most rules adapt to both themes without separate dark declarations.
*/

/* Entrance animation shared by the stat & award cards. Defined here (not
   just in home.css) so the About page — which doesn't load home.css —
   gets the same staggered reveal. Identical to home.css's copy. */
@keyframes cardRise {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Section shell — mirrors .hero-section's soft radial tinting */
.author-section {
  position: relative;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(114, 125, 83, 0.08), transparent 55%),
    radial-gradient(circle at bottom right, rgba(66, 124, 115, 0.06), transparent 55%);
}

/* --- Portrait --------------------------------------------------------- */
.author-portrait-frame {
  position: relative;
  padding: 10px;
  border-radius: 24px;
  background: linear-gradient(150deg, var(--color-teal-light), var(--color-white) 45%, rgba(114, 125, 83, 0.18));
  border: 1px solid var(--color-sand-dark);
  box-shadow: 0 24px 44px -20px rgba(44, 80, 74, 0.35);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s ease;
  will-change: transform;
}

.author-portrait-frame:hover {
  transform: translateY(-6px) rotate(-1.25deg);
  box-shadow: 0 32px 56px -22px rgba(44, 80, 74, 0.42);
}

.author-portrait-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
}

/* Floating dove badge pinned to the portrait's corner */
.author-portrait-dove {
  position: absolute;
  inset-inline-end: -12px;
  bottom: -16px;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border-radius: 9999px;
  background-color: var(--color-white);
  border: 1px solid var(--color-sand-dark);
  box-shadow: 0 12px 26px -10px rgba(15, 23, 42, 0.3);
  animation: floatDove 6s ease-in-out infinite;
  will-change: transform;
}

/* Own keyframes — author.css is loaded standalone on /about, where
   home.css's floatLogo keyframes don't exist */
@keyframes floatDove {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

/* --- Mini highlight badges under the name ------------------------------ */
.author-mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-teal-dark);
  background-color: var(--color-teal-light);
  border: 1px solid var(--color-sand-dark);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: default;
}

.author-mini-badge:hover {
  transform: translateY(-2px);
  border-color: var(--color-teal);
  box-shadow: 0 8px 16px -8px rgba(66, 124, 115, 0.35);
}

/* Pashto script must not carry latin letter-spacing */
.author-mini-badge.font-pashto {
  letter-spacing: normal;
}
/* --- At-a-glance stat cards -------------------------------------------- */
.author-stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.3rem;
  padding: 1.4rem 1rem 1.2rem;
  background-color: var(--color-white);
  border: 1px solid var(--color-sand-dark);
  border-radius: 18px;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  will-change: transform;
  animation: cardRise 0.65s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* Staggered one-by-one reveal */
.author-stat-card:nth-child(1) { animation-delay: 0.05s; }
.author-stat-card:nth-child(2) { animation-delay: 0.12s; }
.author-stat-card:nth-child(3) { animation-delay: 0.19s; }
.author-stat-card:nth-child(4) { animation-delay: 0.26s; }

.author-stat-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-teal);
  box-shadow:
    0 20px 38px -16px rgba(66, 124, 115, 0.25),
    0 6px 14px -8px rgba(66, 124, 115, 0.12);
}

.author-stat-icon {
  width: 46px;
  height: 46px;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  border-radius: 14px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.author-stat-card:hover .author-stat-icon {
  transform: scale(1.12) rotate(-6deg);
}

.author-stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2.1rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-slate);
}

.author-stat-label {
  font-size: 0.78rem;
  font-weight: 500;
}

/* --- Honours & awards cards -------------------------------------------- */
.author-award-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.35rem 1.25rem;
  background-color: var(--color-white);
  border: 1px solid var(--color-sand-dark);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  will-change: transform;
  animation: cardRise 0.65s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.author-award-card:nth-child(1) { animation-delay: 0.08s; }
.author-award-card:nth-child(2) { animation-delay: 0.16s; }
.author-award-card:nth-child(3) { animation-delay: 0.24s; }
.author-award-card:nth-child(4) { animation-delay: 0.32s; }

.author-award-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-teal);
  box-shadow:
    0 20px 38px -16px rgba(66, 124, 115, 0.25),
    0 6px 14px -8px rgba(66, 124, 115, 0.12);
}

/* Teal→olive accent bar that sweeps in across the top edge on hover */
.author-award-card::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(to right, var(--color-teal), var(--color-olive));
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.author-award-card:hover::before {
  transform: scaleX(1);
}

.author-award-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border-radius: 9999px;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.author-award-card:hover .author-award-icon {
  transform: scale(1.1) rotate(8deg);
}

.author-award-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  color: var(--color-teal-dark);
  background-color: var(--color-teal-light);
  border: 1px solid var(--color-sand-dark);
}

/* --- Dark-mode tuning ---------------------------------------------------
   author.css loads after dark-mode.css, so these dark-scoped rules win the
   cascade at equal specificity — same approach as the category cards.
   Text/border colors need no overrides here: the markup uses Tailwind
   utilities (text-slate-*, bg-amber-50, border-peace-100, …) that
   dark-mode.css already re-themes globally. */
html.dark .author-portrait-frame {
  box-shadow: 0 24px 44px -20px rgba(0, 0, 0, 0.55);
}

html.dark .author-portrait-frame:hover {
  box-shadow: 0 32px 56px -22px rgba(0, 0, 0, 0.65);
}

html.dark .author-portrait-dove {
  box-shadow: 0 12px 26px -10px rgba(0, 0, 0, 0.55);
}

html.dark .author-stat-card:hover,
html.dark .author-award-card:hover {
  box-shadow:
    0 20px 38px -16px rgba(111, 179, 166, 0.15),
    0 6px 14px -8px rgba(111, 179, 166, 0.08);
}

html.dark .author-mini-badge:hover {
  box-shadow: 0 8px 16px -8px rgba(111, 179, 166, 0.3);
}

/* Motion-sensitive users get the section without the theatrics */
@media (prefers-reduced-motion: reduce) {
  .author-portrait-frame,
  .author-portrait-frame:hover,
  .author-stat-card,
  .author-stat-card:hover,
  .author-award-card,
  .author-award-card:hover,
  .author-mini-badge:hover {
    transform: none;
    animation: none;
  }
  .author-portrait-dove {
    animation: none;
  }
  .author-stat-card:hover .author-stat-icon,
  .author-award-card:hover .author-award-icon {
    transform: none;
  }
  .author-award-card::before {
    display: none;
  }
}