/* =========================================================
   Books & Cloud — Author cards
   ========================================================= */

.author-card {
  background: var(--paper);
  padding: 36px 32px;
  border: 1px solid var(--hairline);
  position: relative;
  text-align: left;
  transition: border-color 0.3s ease, transform 0.3s ease;
}
.author-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--gold);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.author-card:hover { border-color: var(--hairline-2); }
.author-card:hover::before { opacity: 0.25; }

.author-portrait {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--gold);
  padding: 4px;
  background: var(--cream);
  margin: 0 0 24px;
  position: relative;
}
.author-portrait img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}
.author-card:hover .author-portrait img {
  transform: scale(1.04);
}
.author-portrait .portrait-initial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--brown));
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 500;
}

.author-card h3 {
  font-family: var(--display);
  font-size: 1.4rem;
  color: var(--green);
  font-weight: 500;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.author-card .author-bio {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.author-card .author-count {
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  color: var(--gold-deep);
  text-transform: uppercase;
  font-weight: 500;
  margin: 0;
  padding-top: 18px;
  border-top: 1px solid var(--hairline-2);
}

/* Admin author photo preview (used on admin/authors.php edit form) */
.author-photo-preview {
  display: inline-block;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--hairline);
  padding: 3px;
  background: var(--cream);
  margin-right: 14px;
  vertical-align: middle;
}
.author-photo-preview img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* Small thumbnail in admin authors table */
.author-thumb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--hairline);
  padding: 2px;
  background: var(--cream);
}
.author-thumb-initial {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--brown));
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 500;
  border: 1px solid var(--hairline);
}

@media (max-width: 720px) {
  .author-card { padding: 28px 24px; }
  .author-portrait { width: 96px; height: 96px; margin-bottom: 18px; }
  .author-portrait .portrait-initial { font-size: 2.2rem; }
  .author-card h3 { font-size: 1.2rem; }
}

/* =========================================================
   v8 — Clickable author card (whole card is a link)
   ========================================================= */
.author-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.author-card-link:hover { color: inherit; }
/* The page-wide .reveal/tilt-on-hover anchor-styling sometimes adds
   an underline on hover via inherited rules — kill it here. */
.author-card-link:hover h3,
.author-card-link:hover .author-bio { text-decoration: none; }

/* Footer line of the card: book count on the left, CTA on the right. */
.author-card .author-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.author-count-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s ease;
}
.author-count-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
}
.author-card-link:hover .author-count-cta,
.author-card-link:focus-visible .author-count-cta {
  opacity: 1;
  transform: translateX(0);
  color: var(--gold-deep);
}
.author-card-link:hover .author-count-arrow {
  transform: translateX(4px);
}
/* On touch devices there's no hover — show the CTA permanently so users
   know the card is tappable. */
@media (hover: none) {
  .author-count-cta { opacity: 1; transform: none; }
}

/* =========================================================
   v8 — Author detail page (/pages/author.php)
   ========================================================= */
.author-detail {
  padding: 60px 0 100px;
}
.author-detail .container {
  max-width: 980px;
}

/* "← All authors" back link */
.author-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brown);
  margin-bottom: 48px;
  transition: color 0.2s ease, gap 0.25s ease;
}
.author-back:hover { color: var(--gold-deep); gap: 14px; }
.author-back-arrow { font-size: 1rem; line-height: 1; }
html[dir="rtl"] .author-back-arrow { transform: scaleX(-1); }

/* ---- HERO: portrait + intro ---- */
.author-detail-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--hairline-2);
  margin-bottom: 56px;
}
.author-detail-portrait {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--gold);
  padding: 5px;
  background: var(--cream);
  position: relative;
}
.author-detail-portrait img,
.author-detail-portrait .portrait-initial {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  object-fit: cover;
}
.author-detail-portrait .portrait-initial {
  background: linear-gradient(135deg, var(--green), var(--brown));
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 4.4rem;
  font-weight: 500;
}

.author-detail-intro .subtitle {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 14px;
}
.author-detail-intro h1 {
  font-family: var(--display);
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: var(--green);
  margin: 0 0 22px;
}
.author-detail-lede {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--ink-2);
  margin: 0 0 28px;
  font-style: italic;
}

/* ---- Facts strip (lifespan / birthplace / nationality / website) ---- */
.author-detail-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 18px 28px;
  margin: 0;
  padding-top: 22px;
  border-top: 1px solid var(--hairline-2);
}
.author-fact { margin: 0; }
.author-fact dt {
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brown-2);
  margin-bottom: 6px;
  font-weight: 500;
}
.author-fact dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--ink);
  line-height: 1.4;
}
.author-fact dd a { color: var(--gold-deep); }
.author-fact dd a:hover { color: var(--green); }

/* ---- Signature pull quote ---- */
.author-detail-quote {
  position: relative;
  margin: 0 0 64px;
  padding: 40px 56px 36px;
  text-align: center;
  background: var(--paper);
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
}
.author-detail-quote .quote-mark {
  position: absolute;
  top: -8px;
  inset-inline-start: 24px;
  font-family: var(--display);
  font-size: 4rem;
  line-height: 1;
  color: var(--gold);
  background: var(--paper);
  padding: 0 12px;
}
.author-detail-quote p {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  line-height: 1.5;
  font-style: italic;
  color: var(--ink-2);
  margin: 0;
}

/* ---- Section blocks (Biography / Notable works / Books) ---- */
.author-detail-section {
  margin-bottom: 64px;
}
.author-detail-section h2 {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--green);
  margin: 0 0 24px;
  padding-bottom: 14px;
  position: relative;
  letter-spacing: -0.005em;
}
.author-detail-section h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 56px;
  height: 1px;
  background: var(--gold);
}

/* ---- Biography prose ---- */
.author-detail-prose p {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.78;
  color: var(--ink);
  margin: 0 0 1.1em;
}
.author-detail-prose p:last-child { margin-bottom: 0; }

/* ---- Notable works list ---- */
.author-detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px 32px;
}
.author-detail-list li {
  font-family: var(--serif);
  font-size: 1.02rem;
  color: var(--ink);
  padding: 10px 0 10px 22px;
  border-bottom: 1px solid var(--hairline-2);
  position: relative;
  line-height: 1.5;
}
.author-detail-list li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  width: 8px;
  height: 1px;
  background: var(--gold);
}
html[dir="rtl"] .author-detail-list li { padding-left: 0; padding-right: 22px; }

/* ---- Responsive: stack hero on small screens ---- */
@media (max-width: 720px) {
  .author-detail { padding: 32px 0 60px; }
  .author-detail-head {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
    padding-bottom: 40px;
    margin-bottom: 40px;
  }
  .author-detail-portrait {
    width: 160px;
    height: 160px;
    margin: 0 auto;
  }
  .author-detail-portrait .portrait-initial { font-size: 3.2rem; }
  .author-detail-intro h1 { font-size: 2rem; }
  .author-detail-lede { font-size: 1rem; }
  .author-detail-facts { text-align: start; }
  .author-detail-quote {
    margin-bottom: 48px;
    padding: 32px 24px 28px;
  }
  .author-detail-quote .quote-mark { inset-inline-start: 14px; font-size: 3rem; }
  .author-detail-section { margin-bottom: 48px; }
  .author-detail-section h2 { font-size: 1.35rem; }
  .author-detail-prose p { font-size: 1rem; line-height: 1.7; }
  .author-back { margin-bottom: 28px; }
}
