@import url('theme.css');

/* Layout and components – use css/theme.css for colors, fonts, logo */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-nav-bg);
  border-bottom: none;
  padding: var(--space) 0;
}

.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(40, 26, 57, 0.25);
}

.nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-nav-text);
  text-decoration: none;
  font-family: var(--font-heading);
}

.nav-select {
  display: none;
  width: 100%;
  max-width: 220px;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--color-nav-text);
  background: rgba(255, 252, 236, 0.15);
  border: 1px solid rgba(255, 252, 236, 0.4);
  border-radius: var(--radius);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23FFFCEC' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}

.nav-select option {
  background: var(--color-purple);
  color: var(--color-nav-text);
}

.logo img {
  height: var(--logo-height);
  width: var(--logo-width);
  display: block;
  object-fit: contain;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--color-nav-text);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-nav-text);
  opacity: 1;
}

.nav-links a:hover {
  text-decoration: underline;
}

.nav-links a.active {
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-select {
    display: block;
  }
}

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--space) * 2) var(--space);
  width: 100%;
}

.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 3rem;
  font-weight: 700;
  color: var(--color-purple);
}

/* Teal ribbon: full width, focused on tagline + button; logo stamp overlaps and extends out */
.hero-banner {
  background: var(--color-teal);
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-bottom: 1.5rem;
  padding: 1.5rem var(--space);
  overflow: visible;
}

.hero-banner-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-left: 260px; /* room for logo stamp so ribbon hugs text + button */
  min-height: 5rem;
}

/* White square: overlaps the ribbon and extends above/below into the cream area */
.hero-logo-stamp {
  position: absolute;
  left: var(--space);
  top: 50%;
  transform: translateY(-50%);
  width: 240px;
  height: 240px;
  border-radius: 4px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  box-sizing: border-box;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.hero-logo {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero-banner-text {
  flex: 1;
  min-width: 200px;
  text-align: center;
}

.hero-tagline {
  color: #fff;
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  font-weight: 500;
}

.btn-hero {
  display: inline-block;
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.btn-hero:hover {
  background: #fff;
  color: var(--color-teal);
}

.hero-sub {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  margin: 0 0 1rem;
}

@media (max-width: 560px) {
  .hero-banner-inner {
    flex-direction: column;
    justify-content: center;
    padding-left: 0;
    text-align: center;
    gap: 0;
  }

  .hero-logo-stamp {
    position: static;
    transform: none;
    width: 180px;
    height: 180px;
    padding: 1rem;
    margin: 0;
    flex-shrink: 0;
  }

  .hero-banner-text {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 0;
  }
}

.btn-primary {
  background: var(--color-purple);
  color: var(--color-on-accent);
}

.btn-primary:hover {
  background: var(--color-purple-deep);
  color: var(--color-on-accent);
}

.books,
.authors,
.events,
.connect {
  padding: 3rem 0;
  border-top: 1px solid var(--color-surface);
}

.books h2,
.authors h2,
.events h2,
.connect h2 {
  font-family: var(--font-heading);
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  color: var(--color-purple);
}

.section-intro {
  color: var(--color-text-muted);
  margin: 0 0 2rem;
  font-size: 1rem;
}

/* Book categories (Wix-style Our Books) */
.book-category {
  margin-bottom: 2.5rem;
}

.book-category:last-child {
  margin-bottom: 0;
}

.category-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: 0 0 1rem;
  color: var(--color-teal);
}

.book-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.book-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 1px solid transparent;
  transition: border-color var(--transition);
}

.book-card:hover {
  border-color: var(--color-accent);
}

.book-cover {
  aspect-ratio: 2/3;
  background: var(--color-bg);
  border-radius: 4px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Children's books: square cover (Dungeon Treasures, Teddy Bear Knight, Teddy Bear Knight Makes Anger Take Flight) */
.book-cover--square {
  aspect-ratio: 1 / 1;
}

.book-card h4 {
  font-family: var(--font-heading);
  margin: 0 0 1rem;
  font-size: 1.125rem;
  color: var(--color-purple);
}

.book-author {
  color: var(--color-accent);
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
}

.book-desc {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
  line-height: 1.5;
}

.books .btn-more {
  background: var(--color-purple);
  color: var(--color-on-accent);
  border: 1px solid var(--color-purple);
}

.books .btn-more:hover {
  background: var(--color-purple-deep);
  color: var(--color-on-accent);
  border-color: var(--color-purple-deep);
}

.btn-more {
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
}

.btn-more:hover {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  font-size: 0.9rem;
}

.btn-buy {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.btn-buy:hover {
  background: var(--color-accent-hover);
  color: var(--color-on-accent);
}

/* About Our Authors (Wix-style) */
.author-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.author-card {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 560px) {
  .author-card {
    grid-template-columns: 180px 1fr;
  }
}

.author-photo {
  aspect-ratio: 1;
  max-width: 180px;
  background: var(--color-surface);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* When using <img class="author-photo" src="..." alt="..."> instead of placeholder div */
.author-card img.author-photo {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: var(--radius);
}

.author-info h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
  color: var(--color-teal);
}

.author-info p {
  color: var(--color-text-muted);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Events – list first, subscribe to calendar */
.events-list-wrap {
  margin-top: var(--space);
}

.event-item--empty {
  color: var(--color-text-muted);
  font-style: italic;
}

.events-subscribe {
  margin: 1.5rem 0 0.5rem;
}

.btn-subscribe {
  display: inline-block;
  background: var(--color-teal);
  color: var(--color-on-accent);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--transition);
}

.btn-subscribe:hover {
  background: var(--color-teal-light);
  color: var(--color-on-accent);
}

.events-subscribe-note {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0;
}

.event-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.event-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-surface);
  color: var(--color-text-muted);
}

.event-item:last-child {
  border-bottom: none;
}

.event-item strong {
  color: var(--color-text);
}

.social-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-link {
  color: var(--color-accent);
  text-decoration: none;
}

.social-link:hover {
  text-decoration: underline;
}

/* Author + global: social as icons */
.author-social,
.footer-social {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.social-link--icon {
  display: inline-flex;
  color: inherit;
}

.social-link--icon:hover {
  text-decoration: none;
  opacity: 0.85;
}

.social-icon {
  display: block;
  width: 24px;
  height: 24px;
  color: var(--color-accent);
}

.site-footer {
  border-top: 1px solid var(--color-surface);
  padding: var(--space) calc(var(--space) * 2);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

.site-footer p {
  margin: 0;
}

.footer-follow {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--color-text);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.footer-social a {
  color: var(--color-accent);
  text-decoration: none;
}

.footer-social a:hover {
  text-decoration: underline;
}

.footer-copy {
  font-size: 0.8rem;
  opacity: 0.9;
}

/* More Info / book detail page */
.book-detail-page h1 {
  font-family: var(--font-heading);
  margin: 0 0 2rem;
  font-size: 1.75rem;
  color: var(--color-plum);
}

.book-detail {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-surface);
}

.book-detail-cover {
  max-width: 240px;
  margin-bottom: 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(116, 27, 71, 0.15);
}

.book-detail-cover img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.book-detail-cover--square img {
  aspect-ratio: 1;
}

.book-detail-goodreads {
  margin: 0.5rem 0 1.5rem;
  font-size: 0.9rem;
}
.book-detail-goodreads a {
  color: var(--color-accent);
  text-decoration: none;
}
.book-detail-goodreads a:hover {
  text-decoration: underline;
}

.book-detail:last-of-type {
  border-bottom: none;
}

.book-detail h2 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin: 0 0 0.75rem;
  color: var(--color-plum);
}

.book-tagline {
  font-style: italic;
  color: var(--color-accent);
  margin: 0 0 1rem;
}

.book-detail p {
  color: var(--color-text-muted);
  margin: 0 0 1rem;
  line-height: 1.65;
}

.book-praise {
  margin: 1rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--color-accent);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-style: italic;
}

.book-reviews {
  margin: 2rem 0;
}
.book-reviews__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--color-plum);
  margin: 0 0 1rem;
}
.book-reviews .book-praise {
  margin: 0 0 1.25rem;
}
.book-reviews .book-praise:last-child {
  margin-bottom: 0;
}

.book-detail .btn {
  margin-top: 0.5rem;
}

.back-link {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-surface);
}

/* Our Books list page (more-info.html) */
.book-list-links {
  margin-bottom: 2rem;
}

.book-list-links .category-title {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.book-list-links .category-title:first-child {
  margin-top: 0;
}

.book-list-links ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.book-list-links li {
  margin-bottom: 0.35rem;
}

.book-list-links a {
  color: var(--color-accent);
  text-decoration: none;
}

.book-list-links a:hover {
  text-decoration: underline;
}

/* ---------- Carousel (side-scroll) ---------- */
.carousel {
  overflow: hidden;
  margin: 0 calc(-1 * var(--space));
  padding: 0 var(--space);
}

.carousel__track {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.5rem;
}

.carousel__track::-webkit-scrollbar {
  height: 6px;
}

.carousel__track::-webkit-scrollbar-thumb {
  background: var(--color-text-muted);
  border-radius: 3px;
}

.carousel__item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.carousel__item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.carousel__item a:hover {
  color: var(--color-accent);
}

/* Author page: TikTok reels – whole videos only (1/2/3 by breakpoint), nav arrows, load more at end of track */
.author-reels {
  margin-top: 2rem;
}

.reels-viewport {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.reels-nav {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-surface);
  border-radius: var(--radius);
  background: var(--color-bg, #fff);
  color: var(--color-plum);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
}

.reels-nav:hover {
  background: var(--color-surface);
  color: var(--color-teal);
}

.reels-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Viewport width = exactly n whole items (325px each + 20px gap). No partial videos. */
.carousel--reels {
  width: 325px;
  flex: 0 0 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
}

@media (min-width: 690px) {
  .carousel--reels {
    width: 670px;
  }
}

@media (min-width: 1045px) {
  .carousel--reels {
    width: 1015px;
  }
}

.carousel--reels .carousel__track {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.carousel--reels .carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel--reels .carousel__item {
  width: 325px;
  flex: 0 0 325px;
}

/* Last item: link to author’s TikTok profile */
.carousel__item--tiktok-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  background: var(--color-surface-light, #f5f3e8);
  border-radius: var(--radius);
  border: 1px solid var(--color-surface);
}

.reels-tiktok-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 280px;
  padding: 1.5rem;
  text-align: center;
  color: var(--color-plum);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}

.reels-tiktok-link:hover {
  background: var(--color-surface);
  color: var(--color-teal);
}

.reels-tiktok-link__label {
  font-family: var(--font-heading);
  font-size: 1.125rem;
}

.tiktok-embed-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-surface);
}

.tiktok-embed {
  display: block;
  vertical-align: top;
}

.carousel-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  margin: 0 0 1rem;
  color: var(--color-plum);
}

/* Author carousel item (photo + name) */
.carousel-author {
  width: 160px;
  text-align: center;
}

.carousel-author__photo {
  width: 120px;
  height: 120px;
  margin: 0 auto 0.5rem;
  border-radius: var(--radius);
  object-fit: cover;
  display: block;
  background: var(--color-surface);
}

.carousel-author__name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  margin: 0;
  color: var(--color-teal);
  font-weight: 600;
}

/* Book carousel item (cover + title) */
.carousel-book {
  width: 140px;
  text-align: center;
}

.carousel-book__cover {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin-bottom: 0.5rem;
  background: var(--color-surface);
}

.carousel-book--square .carousel-book__cover {
  aspect-ratio: 1/1;
}

.carousel-book__title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.3;
}

/* Author page: social links (placeholder until URLs provided) */
.author-social {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.author-social a {
  color: var(--color-accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.author-social a:hover {
  text-decoration: underline;
}

.author-social a[href=""],
.author-social a[href=""],
.author-social a[href="#"] {
  opacity: 0.7;
  cursor: default;
}

/* Author detail page */
.author-detail {
  margin-bottom: 2rem;
}

.author-detail h1 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  margin: 0 0 1rem;
  color: var(--color-teal);
}

.author-detail-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  display: block;
}

.author-detail-bio {
  color: var(--color-text-muted);
  line-height: 1.65;
  margin: 0 0 1.5rem;
}

/* Book page: buy CTA – Ingram Spark primary, Amazon secondary */
.buy-cta {
  margin-top: 1rem;
}
.buy-cta__support {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 0.5rem;
}
.buy-cta__release {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
  font-style: italic;
}
.buy-cta__buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}
.btn-ingram {
  /* primary already from .btn .btn-primary */
}

/* Hide Ingram Spark button when link is the generic (invalid) URL */
a.btn-ingram[href="https://shop.ingramspark.com/b/084"] {
  display: none;
}
/* Book page: related books in series (below buy CTA) */
.book-series {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-surface);
}
.book-series__title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--color-plum);
  margin: 0 0 0.25rem;
}
.book-series__name {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
}
.book-series__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.book-series__item {
  display: block;
  width: 100px;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition);
}
.book-series__item:hover {
  transform: translateY(-2px);
}
.book-series__item:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
.book-series__cover {
  aspect-ratio: 2/3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(116, 27, 71, 0.12);
  margin-bottom: 0.5rem;
  background: var(--color-bg);
}
.book-series__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.book-series__cover--square {
  aspect-ratio: 1;
}
.book-series__label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-purple);
  line-height: 1.3;
}
.book-series__item:hover .book-series__label {
  color: var(--color-accent);
}

.btn-amazon--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.25rem;
  padding: 0 0.6rem;
  background: #232f3e;
  color: #ff9900;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.btn-amazon--icon:hover {
  background: #37475a;
  color: #febd69;
}
.btn-amazon[href="#"][data-placeholder] {
  opacity: 0.6;
}

/* ---------- Mobile-friendly ---------- */
@media (max-width: 640px) {
  .nav-links {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .carousel-author {
    width: 140px;
  }

  .carousel-author__photo {
    width: 100px;
    height: 100px;
  }

  .carousel-book {
    width: 120px;
  }
}
