/* ═══════════════════════════════════════════════════════════
   SWOO UNIVERSAL STYLESHEET
   Used by: index.html, book pages, author pages, news pages
   ═══════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --purple: #7B61FF;
  --bg: #F5F5F0;
  --white: #ffffff;
  --dark: #1a1a1a;
  --muted: #888;
  --border: #e8e8e8;
  --card: #ffffff;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow-x: hidden;
}
html::-webkit-scrollbar { display: none; }

body {
  background: var(--bg);
  color: var(--dark);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-x: hidden;
}

/* ══════════════════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════════════════ */

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 40px;
  background: rgba(245,245,240,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background 0.5s ease, border-color 0.5s ease;
}
nav.purple-nav {
  background: var(--purple);
  border-bottom-color: rgba(255,255,255,0.15);
}
.nav-text-logo {
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.nav-logo {
  position: absolute;
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  height: 40px; width: auto;
  filter: brightness(0) invert(1);
}
.nav-brand {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  text-decoration: none;
}
.logo {
  font-size: 22px; font-weight: 900; letter-spacing: -0.5px; color: var(--dark);
}
.logo span { color: var(--purple); }
.nav-cta {
  background: var(--dark); color: #fff;
  border: none; border-radius: 24px;
  padding: 10px 24px; font-size: 14px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: background 0.4s ease, color 0.4s ease;
}
.nav-cta:hover { background: var(--purple); }
nav.purple-nav .nav-cta { background: #fff; color: var(--purple); }
nav.purple-nav .nav-cta:hover { background: rgba(255,255,255,0.85); }

/* ══════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════ */

footer {
  background: var(--dark);
  padding: 48px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
footer .logo { color: #fff; }
footer p { font-size: 13px; color: #555; margin: 0; }
footer a { font-size: 13px; color: #555; text-decoration: none; }
footer a:hover { color: #888; }

/* ══════════════════════════════════════════════════════════
   BOOK & AUTHOR PAGES
   ══════════════════════════════════════════════════════════ */

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 120px 40px 80px;
}

.book-hero, .author-hero {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  margin-bottom: 48px;
}

.book-cover, .author-photo-large {
  width: 240px;
  flex-shrink: 0;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.2);
  border: 3px solid var(--purple);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-cover {
  aspect-ratio: 2/3;
  object-fit: cover;
}

.author-photo-large {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
}

.book-cover:hover, .author-photo-large:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 64px rgba(123,97,255,0.3);
}

.book-info, .author-info {
  flex: 1;
}

.book-info h1, .author-info h1 {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 12px;
  color: var(--dark);
}

.book-info .author {
  font-size: 18px;
  color: var(--muted);
  margin-bottom: 20px;
  font-style: italic;
}

.author-info .years {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 16px;
}

.author-info .bio {
  font-size: 16px;
  line-height: 1.7;
  color: var(--dark);
  margin-bottom: 24px;
}

.desc {
  font-size: 16px;
  line-height: 1.8;
  color: var(--dark);
  margin-bottom: 24px;
}

.cta-btn {
  display: inline-block;
  background: var(--purple);
  color: #fff;
  padding: 14px 32px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(123,97,255,0.3);
}

.about {
  margin-bottom: 48px;
}

.about h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--dark);
}

.about p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--dark);
  margin-bottom: 16px;
}

.about p em {
  font-style: italic;
  color: var(--purple);
}

/* ── AUTHOR SECTION ── */
.author-section {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.author-section h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 20px;
}

.author-link-card {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  border: 2px solid var(--border);
  text-decoration: none;
  transition: border-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.author-link-card:hover {
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(123,97,255,0.15);
}

.author-mini-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  border: 3px solid var(--purple);
  box-shadow: 0 4px 12px rgba(123,97,255,0.2);
}

.author-mini-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-link-info {
  flex: 1;
}

.author-link-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 4px;
}

.author-link-cta {
  font-size: 14px;
  color: var(--purple);
  font-weight: 600;
}

/* ── META SECTION ── */
.meta {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  margin-top: 48px;
}

.meta p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--dark);
  margin-bottom: 8px;
}

.meta p:last-child {
  margin-bottom: 0;
}

.meta strong {
  font-weight: 700;
  color: var(--dark);
}

.meta a {
  color: var(--purple);
  text-decoration: none;
  font-weight: 600;
}

.meta a:hover {
  text-decoration: underline;
}

/* ── BOOKS GRID (for author pages) ── */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.book-card {
  text-decoration: none;
  display: block;
  transition: transform 0.25s ease;
}

.book-card:hover {
  transform: translateY(-8px);
}

.book-cover-img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.14);
  transition: box-shadow 0.25s ease;
  display: block;
  margin-bottom: 12px;
  pointer-events: none;
}

.book-card:hover .book-cover-img {
  box-shadow: 0 14px 32px rgba(0,0,0,0.22);
}

.book-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.4;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE: BOOK & AUTHOR PAGES
   ══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .wrap {
    padding: 100px 20px 60px;
  }
  
  .book-hero, .author-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
  }
  
  .book-cover {
    width: 200px;
  }
  
  .author-photo-large {
    width: 160px;
    height: 160px;
  }
  
  .book-info h1, .author-info h1 {
    font-size: 28px;
  }
  
  .author-link-card {
    gap: 16px;
    padding: 16px;
  }
  
  .author-mini-photo {
    width: 60px;
    height: 60px;
  }
  
  .author-link-name {
    font-size: 16px;
  }
  
  .author-link-cta {
    font-size: 13px;
  }
  
  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 16px;
  }
  
  footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 40px 20px;
  }
  
  nav {
    padding: 16px 20px;
  }
}

@media (max-width: 640px) {
  .book-info h1, .author-info h1 {
    font-size: 24px;
  }
}
