@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Playfair+Display:wght@400;700&display=swap');

body {
  font-family: 'Playfair Display', serif;
  margin: 0;
  background: linear-gradient(135deg, #fffbe6 0%, #e3f0ff 100%);
  color: #2d3a4a;
  min-height: 100vh;
}

/* Language Switcher Styles */
.language-switcher {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.lang-btn {
  background: transparent;
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  color: #3b5ea3;
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-btn:hover {
  background: rgba(126, 182, 255, 0.1);
  border-color: rgba(126, 182, 255, 0.3);
  transform: translateY(-1px);
}

.lang-btn.active {
  background: linear-gradient(135deg, #ffe066 0%, #7eb6ff 100%);
  border-color: #3b5ea3;
  color: #2d3a4a;
  box-shadow: 0 2px 12px rgba(126, 182, 255, 0.3);
  transform: translateY(-1px);
}

.lang-btn:active {
  transform: translateY(0);
}

/* Responsive language switcher */
@media (max-width: 600px) {
  .language-switcher {
    bottom: 15px;
    right: 15px;
    padding: 6px;
    gap: 6px;
  }
  
  .lang-btn {
    padding: 6px 10px;
    font-size: 14px;
    min-width: 45px;
  }
  
  .social-links {
    bottom: 15px;
    left: 15px;
  }
  
  .facebook-link {
    padding: 8px 12px;
    font-size: 12px;
  }
}

/* Book Detail Page Styles */
.book-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 2rem;
  color: #3b5ea3;
  text-decoration: none;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  transition: color 0.3s ease;
}

.back-link:hover {
  color: #7eb6ff;
}

.book-detail-header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  align-items: start;
}

.book-detail-cover,
.book-detail-backcover {
  width: 200px;
  height: 280px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.book-info h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #3b5ea3;
  margin-bottom: 1.5rem;
  font-family: 'Playfair Display', serif;
}

.book-details {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.detail-row {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

.detail-label {
  font-weight: 600;
  color: #3b5ea3;
  min-width: 140px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.9rem;
}

.detail-value {
  color: #2d3a4a;
  font-family: 'Playfair Display', serif;
}

.book-description {
  margin-top: 2rem;
}

.book-description h3 {
  font-size: 1.5rem;
  color: #3b5ea3;
  margin-bottom: 1rem;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

.book-description p {
  line-height: 1.8;
  color: #2d3a4a;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
}

.book-detail h2 {
  font-size: 2rem;
  color: #3b5ea3;
  margin: 2rem 0 1.5rem 0;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

.excerpt-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.excerpt-gallery img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.excerpt-gallery img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Responsive book detail page */
@media (max-width: 900px) {
  .book-detail-header {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .book-detail-cover,
  .book-detail-backcover {
    width: 180px;
    height: 252px;
    margin: 0 auto 1rem auto;
  }
  
  .book-info h1 {
    font-size: 2rem;
    text-align: center;
  }
  
  .detail-row {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .detail-label {
    min-width: auto;
  }
}

@media (max-width: 600px) {
  .book-detail {
    padding: 1rem;
  }
  
  .book-detail-cover,
  .book-detail-backcover {
    width: 150px;
    height: 210px;
  }
  
  .book-info h1 {
    font-size: 1.75rem;
  }
  
  .excerpt-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .book-description p {
    font-size: 1rem;
  }
}

header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  padding: 2.5rem 1rem 1.5rem 1rem;
  background: linear-gradient(90deg, #ffe066 0%, #7eb6ff 100%);
  background-size: 200% 200%;
  animation: gradientMove 8s ease-in-out infinite;
  box-shadow: 0 4px 32px 0 #bcd7fa33;
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  margin-bottom: 2rem;
  position: relative;
}

header::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 0%, transparent 60%, rgba(255, 255, 255, 0.3) 80%, rgba(255, 255, 255, 0.8) 100%);
  border-bottom-left-radius: 32px;
  border-bottom-right-radius: 32px;
  pointer-events: none;
  z-index: 1;
}
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.author-photo {
  width: 320px;
  height: 420px;
  max-height: 50vh;
  border-radius: 32px;
  object-fit: cover;
  margin-bottom: 0;
  border: none;
  box-shadow: 0 8px 40px #7eb6ff55, 0 2px 16px #ffe06655;
  background: linear-gradient(135deg, #fffbe6 60%, #7eb6ff 100%);
  flex-shrink: 0;
  transition: box-shadow 0.4s;
}
.author-photo:hover {
  box-shadow: 0 16px 64px #7eb6ff99, 0 4px 32px #ffe06699;
}
.header-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 420px;
  padding: 0 2rem;
  position: relative;
}
  .author-bio {
    color: #3b5ea3;
    font-size: clamp(1rem, 3vw, 1.25rem);
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-family: 'Montserrat', serif;
    font-style: italic;
    position: relative;
    cursor: pointer;
    padding: 8px 24px;
    border-radius: 8px;
    width: 100%;
    display: block;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: none;
    text-align: center;
    overflow: visible;
    max-height: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
  }

/* Mobile and tablet expandable behavior */
@media (max-width: 900px) {
  .author-bio {
    cursor: pointer;
    overflow: hidden;
    max-height: 70px;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  
  .author-bio.expanded {
    max-height: 500px;
    overflow: visible;
  }
  
  .header-info::after {
    content: '▼';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    color: #3b5ea3;
    font-weight: bold;
    transition: transform 0.3s ease;
    pointer-events: none;
    z-index: 10000;
  }
  
  .author-bio.expanded + .header-info::after,
  .header-info:has(.author-bio.expanded)::after {
    transform: translateX(-50%) rotate(180deg);
  }
}
header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #3b5ea3;
  margin-bottom: 0rem;
  margin-top: -0.5rem;
  letter-spacing: 1px;
  font-family: 'Playfair Display', serif;
  text-shadow: 0 2px 0 #fffbe6;
  background: linear-gradient(90deg, #ffe066 0%, #7eb6ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: gradientMove 8s ease-in-out infinite;
}
.book-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 3rem;
  padding: 2.5rem 2rem 2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
  justify-items: center;
  perspective: 1200px;
}
.book-3d-link {
  display: block;
  position: relative;
  width: 190px;
  height: 320px;
  perspective: 1200px;
  background: transparent;
  text-decoration: none;
  outline: none;
}
.book-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(.4,2,.6,1);
}
.book-3d-link:hover .book-3d,
.book-3d-link:focus-visible .book-3d {
  transform: rotateY(-30deg);
}
.book-cover, .book-spine, .book-pages {
  position: absolute;
  top: 0; left: 0;
  width: 190px; height: 320px;
  border-radius: 8px;
  backface-visibility: hidden;
  box-shadow: 0 4px 24px #bcd7fa55;
}
.book-cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 190px;
  height: 320px;
  background: #fff;
  z-index: 3;
  transform: translateZ(16px);
  box-shadow: 0 4px 24px #bcd7fa55, 0 2px 8px #ffe06644;
  border-radius: 0;
  backface-visibility: visible;
}
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  display: block;
}
.book-spine {
  position: absolute;
  top: 0;
  left: 0;
  margin-left: 0px;
  width: 32px;
  height: 320px;
  background: #8b7355;
  box-shadow: 2px 0 8px rgba(139, 115, 85, 0.3), inset 0 0 12px rgba(107, 91, 58, 0.3);
  border-radius: 0;
  z-index: -10;
  transform: rotateY(-90deg) translateX(-16px);
  transform-origin: left center;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  overflow: hidden;
}
.spine-title {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: #3d2f1f;
  letter-spacing: 0.1em;
  text-align: center;
  width: 100%;
  opacity: 0.9;
  user-select: none;
  pointer-events: none;
}

/* Custom spine text colors for specific books */
.book-3d-link[href*="А сонце сходить щодня"] .spine-title {
  color: #ffd700;
}

.book-3d-link[href*="Живеш тільки раз"] .spine-title {
  color: #ffffff;
}

.book-3d-link[href*="Країна розбитих сердець Land of Broken Hearts Original"] .spine-title {
  color: #ffffff;
}

.book-3d-link[href*="Країна розбитих сердець Land of Broken Hearts Reprint"] .spine-title {
  color: #ffffff;
}

.book-3d-link[href*="Мудрі жінки"] .spine-title {
  color: #ffffff;
}

.book-3d-link[href*="Сага про"] .spine-title {
  color: #ffffff;
}

.book-3d-link[href*="Свої... Чужі"] .spine-title {
  color: #ffffff;
}

.book-3d-link[href*="Чічка"] .spine-title {
  color: #ffffff;
}

.book-3d-link[href*="Якби все розпочати заново"] .spine-title {
  color: #ffffff;
}
.book-spine::after {
  content: '';
  display: block;
  width: 80%;
  height: 60%;
  margin: 0 auto;
  border-left: 2px solid #d4c4a8;
  opacity: 0.4;
}

/* Spine image styling */
.book-spine img {
  width: 100%;
  height: 100%;
  object-fit: fill;
  border-radius: 0;
  display: block;
}
.book-pages {
  left: 190px;
  top: 3px;
  width: 32px;
  height: 314px;
  background: repeating-linear-gradient(90deg, #fffbe6 0 2px, #e3e0d1 2px 4px, #fffbe6 4px 6px);
  z-index: 1;
  transform: rotateY(90deg) translateZ(-20px);
  border-radius: 0 8px 8px 0;
  box-shadow: 2px 0 8px #bcbcbc44, inset 0 0 12px #a08c5a44;
}
.book-shadow {
  content: '';
  position: absolute;
  left: 10%; right: 10%; bottom: -22px;
  height: 32px;
  background: radial-gradient(ellipse at center, #bcd7fa55 0%, transparent 80%);
  opacity: 0.7;
  filter: blur(2px);
  z-index: 0;
  pointer-events: none;
  transition: opacity 0.3s, filter 0.3s;
  border-radius: 50%;
}
.book-3d-link:hover .book-shadow,
.book-3d-link:focus-visible .book-shadow {
  opacity: 1;
  filter: blur(6px);
}
.book-backcover {
  position: absolute;
  top: 0;
  left: 0;
  width: 190px;
  height: 320px;
  border-radius: 0;
  backface-visibility: visible;
  background: #eee;
  z-index: 3;
  transform: rotateY(180deg) translateZ(16px);
  box-shadow: 0 4px 24px #bcd7fa33;
}
.book-backcover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  display: block;
}

/* Book Container and Title Styles */
.book-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.book-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3a4a;
  text-align: center;
  margin: 0;
  padding: 0 8px;
  line-height: 1.3;
  max-width: 200px;
  transition: color 0.3s ease;
}

.book-container:hover .book-title {
  color: #3b5ea3;
}

/* Photo Gallery Section */
.photo-gallery {
  max-width: 1200px;
  margin: 3rem auto 2rem auto;
  padding: 0 2rem;
}

.photo-gallery h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: #2d3a4a;
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.photo-gallery h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, #7eb6ff 0%, #ffe066 100%);
  border-radius: 2px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
  cursor: pointer;
  aspect-ratio: 1;
}

.gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(126, 182, 255, 0.2);
  background: rgba(255, 255, 255, 0.9);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 1rem 0.8rem 0.8rem 0.8rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  text-align: center;
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

  .gallery-overlay span {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    line-height: 1.3;
  }
  
  /* Photo Modal Styles */
  .photo-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
  }
  
  .modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
  }
  
  .modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
  }
  
  .modal-close:hover,
  .modal-close:focus {
    color: #ffe066;
    text-decoration: none;
  }
  
  /* Remove overlay from gallery items since we removed captions */
  .gallery-item:hover .gallery-overlay {
    transform: none;
  }
  
  .gallery-overlay {
    display: none;
  }
/* Remove the automatic 360 spin animation, JS now controls rotation */
/*
.has-backcover .book-3d {
  /* Remove transition, use animation instead */
  /*
  transition: none;
}
.has-backcover:hover .book-3d,
.has-backcover:focus-visible .book-3d {
  animation: book-spin-360 3.5s cubic-bezier(.4,2,.6,1) 1 forwards;
}
@keyframes book-spin-360 {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(-360deg); }
}
*/
footer {
  text-align: center;
  padding: 1.2rem 1rem 1.5rem 1rem;
  background: linear-gradient(90deg, #7eb6ff 0%, #ffe066 100%);
  background-size: 200% 200%;
  animation: gradientMove 8s ease-in-out infinite;
  color: #3b5ea3;
  font-size: 1rem;
  margin-top: 2.5rem;
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  box-shadow: 0 -2px 16px #bcd7fa33;
  border: none;
  font-family: 'Playfair Display', serif;
}

/* Social Links Styles */
.social-links {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 10001;
}

.facebook-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 10px 16px;
  text-decoration: none;
  color: #3b5ea3;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.facebook-link::before {
  content: "📘";
  font-size: 16px;
}

.facebook-link:hover {
  background: linear-gradient(135deg, #ffe066 0%, #7eb6ff 100%);
  color: #2d3a4a;
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(126, 182, 255, 0.3);
}

.facebook-link:active {
  transform: translateY(0);
}
header:after, footer:before {
  display: none;
}
.floating-decor {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 0;
}
.float-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.18;
  animation: floatAnim 12s ease-in-out infinite alternate;
  filter: blur(2px);
}
.float-yellow {
  width: 180px; height: 180px;
  background: radial-gradient(circle, #ffe066 60%, #fffbe6 100%);
  left: 8vw; top: 12vh;
  animation-delay: 0s;
}
.float-blue {
  width: 220px; height: 220px;
  background: radial-gradient(circle, #7eb6ff 60%, #e3f0ff 100%);
  right: 10vw; top: 30vh;
  animation-delay: 2s;
}
.float-yellow.small {
  width: 90px; height: 90px;
  left: 60vw; top: 70vh;
  animation-delay: 4s;
}
.float-blue.small {
  width: 60px; height: 60px;
  right: 20vw; top: 80vh;
  animation-delay: 6s;
}
@keyframes floatAnim {
  0% { transform: translateY(0) scale(1);}
  100% { transform: translateY(-40px) scale(1.08);}
}
header, main, footer {
  position: relative;
  z-index: 1;
}
@media (max-width: 900px) {
  header {
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem 0.5rem 1rem 0.5rem;
    margin-bottom: 1.2rem;
  }
  .header-info {
    align-items: center;
    text-align: center;
    max-width: 100%;
  }
  .book-gallery {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.2rem;
    padding: 1.5rem 0.5rem 1rem 0.5rem;
    max-width: 100vw;
  }
  .book-gallery img {
    max-width: 160px;
    border-radius: 18px;
  }
  .book-3d-link {
    width: 140px;
    height: 240px;
  }
  .book-cover, .book-spine, .book-pages {
    width: 140px; height: 240px;
  }
  .book-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 140px;
    height: 240px;
    background: #fff;
    z-index: 3;
    transform: translateZ(12px);
    box-shadow: 0 4px 24px #bcd7fa55, 0 2px 8px #ffe06644;
    border-radius: 0 !important;
    backface-visibility: visible;
  }
  .book-cover img {
    border-radius: 0 !important;
  }
  .book-spine {
    margin-left: 0px;
    width: 24px;
    height: 240px;
    transform: rotateY(-90deg) translateX(-12px);
  }
  .book-pages {
    left: 140px;
    top: 3px;
    width: 24px;
    height: 234px;
    border-radius: 0 8px 8px 0;
  }
  .book-backcover {
    width: 140px; height: 240px;
    transform: rotateY(180deg) translateZ(12px);
    border-radius: 0 !important;
    backface-visibility: visible;
    z-index: 3;
  }
  .book-backcover img {
    border-radius: 0 !important;
  }
  
  .book-title {
    font-size: 1rem;
    max-width: 180px;
  }
  
  /* Photo Gallery Mobile Styles */
  .photo-gallery {
    padding: 0 1rem;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
  }
  
  .gallery-overlay {
    padding: 0.8rem 0.6rem 0.6rem 0.6rem;
  }
  
  .gallery-overlay span {
    font-size: 0.8rem;
  }
}
@media (max-width: 600px) {
  .author-photo {
    width: 90vw;
    max-width: 320px;
    height: auto;
    aspect-ratio: 13/17;
    border-radius: 20px;
  }
  header {
    padding: 1.2rem 0.2rem 0.7rem 0.2rem;
    margin-bottom: 0.7rem;
  }
  
  .author-bio {
    max-height: 60px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    cursor: pointer;
    position: relative;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    line-height: 1.4;
    padding: 8px 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
  }
  
  .author-bio.expanded {
    max-height: 400px;
    overflow: visible;
  }
  

  footer {
    padding: 0.7rem 0.2rem 1rem 0.2rem;
    margin-top: 1.2rem;
  }
  .book-gallery {
    padding: 1rem 0.2rem 0.5rem 0.2rem;
    gap: 0.7rem;
    grid-template-columns: repeat(2, 1fr);
  }
  .book-gallery img {
    max-width: 100vw;
    border-radius: 14px;
  }
  
  .book-3d-link {
    width: 120px;
    height: 200px;
  }
  .book-cover, .book-spine, .book-pages {
    width: 120px; height: 200px;
  }
  .book-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 120px;
    height: 200px;
    background: #fff;
    z-index: 3;
    transform: translateZ(10px);
    box-shadow: 0 4px 24px #bcd7fa55, 0 2px 8px #ffe06644;
    border-radius: 0 !important;
    backface-visibility: visible;
  }
  .book-cover img {
    border-radius: 0 !important;
  }
  .book-spine {
    margin-left: 0px;
    width: 20px;
    height: 200px;
    transform: rotateY(-90deg) translateX(-10px);
  }
  .book-pages {
    left: 120px;
    top: 3px;
    width: 20px;
    height: 194px;
    border-radius: 0 8px 8px 0;
  }
  .book-backcover {
    width: 120px; height: 200px;
    transform: rotateY(180deg) translateZ(10px);
    border-radius: 0 !important;
    backface-visibility: visible;
    z-index: 3;
  }
  .book-backcover img {
    border-radius: 0 !important;
  }
  
  .book-title {
    font-size: 0.9rem;
    max-width: 160px;
  }
  
  .book-container {
    gap: 8px;
    margin-bottom: 16px;
  }
  
  /* Photo Gallery Small Mobile Styles */
  .photo-gallery {
    padding: 0 0.5rem;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
  }
  
  .gallery-overlay {
    padding: 0.6rem 0.4rem 0.4rem 0.4rem;
  }
  
  .gallery-overlay span {
    font-size: 0.7rem;
  }
  
  /* Photo Modal Mobile Styles */
  .photo-modal {
    padding: 10px;
  }
  
  .modal-content {
    max-width: 95%;
    max-height: 95%;
  }
  
  .modal-close {
    top: 10px;
    right: 15px;
    font-size: 30px;
    width: 40px;
    height: 40px;
  }
} 