:root {
/**********************************
  Color palette - Warmer, Literary Theme
**********************************/
  /* Warm earth tones with literary feel */
  --main-100: hsl(25, 30%, 95%);
  --main-200: hsl(25, 25%, 88%);
  --main-300: hsl(25, 20%, 78%);
  --main-400: hsl(25, 45%, 68%);
  --main-500: hsl(25, 40%, 58%);
  --main-600: hsl(25, 35%, 48%);
  --main-700: hsl(25, 30%, 38%);
  --main-800: hsl(25, 25%, 28%);
  --main-900: hsl(25, 20%, 18%);
  --main-1000: hsl(25, 15%, 12%);

  /* Soft, warm greys */
  --grey-100: hsl(30, 15%, 97%);
  --grey-200: hsl(30, 12%, 93%);
  --grey-300: hsl(30, 10%, 85%);
  --grey-400: hsl(30, 8%, 70%);
  --grey-500: hsl(30, 6%, 55%);
  --grey-600: hsl(30, 8%, 45%);
  --grey-700: hsl(30, 10%, 35%);
  --grey-800: hsl(30, 12%, 25%);
  --grey-900: hsl(30, 15%, 18%);
  --grey-1000: hsl(30, 18%, 12%);

  /* Accent colors */
  --accent-100: hsl(45, 70%, 95%);
  --accent-200: hsl(45, 65%, 88%);
  --accent-300: hsl(45, 60%, 78%);
  --accent-400: hsl(45, 55%, 68%);
  --accent-600: hsl(45, 45%, 48%);
  --accent-800: hsl(45, 35%, 28%);
  --accent-900: hsl(45, 30%, 18%);

  /* Literary green for accents */
  --literary-100: hsl(150, 30%, 95%);
  --literary-200: hsl(150, 25%, 88%);
  --literary-300: hsl(150, 20%, 75%);
  --literary-600: hsl(150, 15%, 45%);
  --literary-800: hsl(150, 20%, 25%);

  /* More muted, literary colors */
  --ink: hsl(220, 15%, 25%);
  --parchment: hsl(45, 40%, 96%);
  --leather: hsl(25, 30%, 35%);
}


/*******************************
  General Styling and Layout
*******************************/

/* Elegant, readable typography */
html {
  color: var(--grey-800);
  background: linear-gradient(135deg, var(--grey-200) 0%, var(--main-100) 100%);
  font-family: 'Playfair Display', 'Crimson Text', serif;
  font-size: 18px;
  line-height: 1.6;
  min-height: 100vh;
}

/* make the body a wrapper */
body {
  max-width: 85rem;
  margin: 0 auto;
  display: grid;
  min-height: 100vh;
  /* to make the footer 'sticky' */
  grid-template-rows: auto 1fr auto;
  background: var(--grey-100);
  /* elegant shadow */
  box-shadow: 0 0 30px 0 hsla(30, 20%, 20%, 0.15);
  border-radius: 0 0 8px 8px;
}

/* Typography improvements */
h1 {
  font-size: 2.2rem;
  color: var(--main-700);
  font-weight: 400;
  font-family: 'Playfair Display', 'Crimson Text', serif;
  letter-spacing: 0.5px;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  margin-top: 2rem;
  color: var(--main-800);
  font-weight: 400;
  font-family: 'Playfair Display', 'Crimson Text', serif;
  text-align: center;
  position: relative;
}

h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(to right, var(--main-400), var(--accent-400));
  margin: 0.5rem auto;
  border-radius: 1px;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
  color: var(--grey-700);
  font-weight: 300;
  font-style: italic;
  text-align: center;
}

p {
  margin: 1rem 0;
  color: var(--grey-700);
}


/*******************************
  Section styling
*******************************/

section {
  box-sizing: border-box;
  margin: 2rem 0;
}

section li {
  list-style: none;
  margin-left: 1rem;
  position: relative;
  padding-left: 1.5rem;
}

section li::before {
  content: '◆';
  color: var(--main-500);
  position: absolute;
  left: 0;
  top: 0;
}

.wrapper {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding: 3rem 2rem;
}

.wrapper--top-border {
  border-top: 1px solid var(--main-300);
}

.wrapper header {
  text-align: center;
  max-width: 35em;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 3rem;
}

/*******************************
  Navigation Styling
*******************************/

nav {
  background: var(--grey-100);
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--main-200);
  box-shadow: 0 2px 10px hsla(30, 20%, 20%, 0.1);
}

nav h1 {
  margin: 0;
  font-size: 1.8rem;
  font-family: 'Playfair Display', 'Crimson Text', serif;
  font-weight: 300;
  letter-spacing: 1px;
}

nav h1 a {
  color: var(--main-800);
  text-decoration: none;
  transition: color 0.3s ease;
  position: relative;
}

nav h1 a:hover {
  color: var(--main-600);
}

nav h1 a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--main-500), var(--accent-500));
  transition: width 0.3s ease;
}

nav h1 a:hover::after {
  width: 100%;
}

nav ul {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin: 0;
  padding: 0;
}

nav ul li a {
  color: var(--grey-700);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: 0.5px;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.3s ease;
  position: relative;
}

nav ul li a:hover {
  color: var(--main-700);
  background: var(--main-100);
}

nav ul li a.active {
  color: var(--main-800);
  background: var(--main-200);
  font-weight: 400;
}

/*******************************
  Section background colors
*******************************/

.feature {
  background: var(--grey-100);
}

.bg-darker {
  background: linear-gradient(135deg, var(--main-700) 0%, var(--main-800) 100%);
  color: var(--grey-100);
  box-shadow: inset 0 2px 10px hsla(30, 20%, 10%, 0.3);
}

.bg-darker h2 {
  color: var(--grey-100);
}

.bg-darker h2::after {
  background: linear-gradient(to right, var(--accent-400), var(--grey-200));
}

/*******************************
  Cards
*******************************/

.cards {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin: 2rem auto;
}

.bio {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  flex-wrap: nowrap;
  max-width: 1200px;
  margin-inline: auto;
}

/* cancel old floats – this is the bit that was breaking the layout */
.box-left,
.box-right {
  float: none;
}

/* image column: fixed width */
.box-left {
  flex: 0 0 320px;
}

/* text column: takes the rest of the row */
.box-right {
  flex: 1 1 auto;
  min-width: 0;
}

/* make the actual <img> fill its box but not overflow */
.img-profile {
  width: 100%;
  height: auto;
  display: block;
}

.img-profile {
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--main-200);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 1rem 0;
}


.cards__item {
  color: var(--grey-800);
  display: flex;
  flex-direction: column;
  background: var(--grey-100);
  border-radius: 12px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--main-200);
  padding: 1.5rem;
}


.cards__item > p {
  padding: 1rem;
  margin: 0;
  text-align: center;
  line-height: 1.6;
}

.cards__item > h3 {
  font-weight: 400;
  color: var(--main-800);
  margin-top: 1rem;
  text-align: center;
}

.cards__item > h4 {
  font-weight: 300;
  color: var(--grey-600);
  font-style: italic;
  text-align: center;
  margin-bottom: 1rem;
}

/*******************************
  Buttons
*******************************/

.btn {
  border-radius: 4px;
  background: var(--main-600);
  border: 1px solid var(--main-700);
  box-shadow: none;
  display: inline-block;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  font-weight: 400;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  text-align: center;
}

.btn:hover {
  background: var(--main-700);
}

.btn-main {
  background: linear-gradient(135deg, var(--main-500) 0%, var(--main-600) 100%);
  color: var(--grey-100);
  box-shadow: 0 4px 10px hsla(30, 20%, 20%, 0.2);
}

.btn-main:hover {
  background: linear-gradient(135deg, var(--main-400) 0%, var(--main-500) 100%);
}

.btn-cta {
  background: linear-gradient(135deg, var(--accent-600) 0%, var(--accent-800) 100%);
  color: var(--grey-100);
  box-shadow: 0 4px 10px hsla(45, 20%, 20%, 0.2);
}

.btn-cta:hover {
  background: linear-gradient(135deg, var(--accent-500) 0%, var(--accent-700) 100%);
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--main-600);
  color: var(--main-600);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--main-600);
  color: var(--grey-100);
}

/*******************************
  Forms
*******************************/

.newsletter {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
  margin: 2rem auto;
}

.newsletter input[type="text"],
.newsletter input[type="email"] {
  padding: 0.75rem 1rem;
  border: 2px solid var(--main-300);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--grey-100);
  color: var(--grey-800);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.newsletter input[type="text"]:focus,
.newsletter input[type="email"]:focus {
  outline: none;
  border-color: var(--main-500);
  box-shadow: 0 0 0 3px hsla(25, 40%, 58%, 0.1);
}

.newsletter input[type="submit"] {
  background: linear-gradient(135deg, var(--accent-600) 0%, var(--accent-800) 100%);
  color: var(--grey-100);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.3s ease;
}

.newsletter input[type="submit"]:hover {
  background: linear-gradient(135deg, var(--accent-500) 0%, var(--accent-700) 100%);
}

/*******************************
  Footer
*******************************/

footer {
  background: linear-gradient(135deg, var(--main-800) 0%, var(--main-900) 100%);
  color: var(--grey-200);
  text-align: center;
  padding: 2rem;
  border-top: 3px solid var(--main-600);
}

.footer-details {
  max-width: 600px;
  margin: 0 auto;
}

.footer-details p {
  margin: 0.5rem 0;
  font-size: 0.9rem;
  color: var(--grey-300);
}

.footer-details a {
  color: var(--accent-300);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-details a:hover {
  color: var(--accent-200);
}

/* Alpine.js specific styles */
.newsletter-success {
  background: linear-gradient(135deg, var(--literary-100) 0%, var(--accent-100) 100%);
  color: var(--literary-800);
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  margin-top: 1rem;
  border: 1px solid var(--literary-200);
  box-shadow: 0 4px 15px hsla(150, 20%, 20%, 0.1);
}

.book-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(30, 25, 20, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}

.modal-content {
  background: linear-gradient(135deg, var(--grey-100) 0%, var(--main-100) 100%);
  padding: 2.5rem;
  border-radius: 12px;
  max-width: 500px;
  margin: 1rem;
  text-align: center;
  box-shadow: 0 20px 40px hsla(30, 20%, 20%, 0.3);
  border: 1px solid var(--main-200);
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* Home page links */
.home-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Book actions */
.book-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
  width: 100%;
}

/* Stories page styles */
.stories-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.story-card {
  background: linear-gradient(135deg, var(--grey-100) 0%, var(--main-100) 100%);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 6px 20px hsla(30, 20%, 20%, 0.1);
  border-left: 4px solid var(--main-500);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.story-card:hover {
}

.story-meta {
  font-size: 0.9rem;
  color: var(--grey-600);
  margin-bottom: 1rem;
  font-style: italic;
}

.story-excerpt {
  font-style: italic;
  color: var(--grey-700);
  line-height: 1.6;
}

.story-full {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--main-300);
  line-height: 1.7;
  color: var(--grey-800);
}

/* Reviews page styles */
.review-filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--main-500);
  background: var(--grey-100);
  color: var(--main-600);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: var(--main-100);
}

.filter-btn.active {
  background: var(--main-500);
  color: var(--grey-100);
}

.reviews-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Media object for reviews - vertical layout */
.media-object {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1rem;
  background: linear-gradient(135deg, var(--grey-100) 0%, var(--main-100) 100%);
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 12px hsla(30, 20%, 20%, 0.1);
  border-left: 4px solid var(--main-500);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.media-object:hover {
}

.media-object .img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--main-300);
}

.media-object .content {
  flex: 1;
  min-width: 0;
}

.media-object .content p {
  margin: 0;
  font-style: italic;
  line-height: 1.6;
  color: var(--grey-700);
}

.media-object .footer {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--grey-600);
  font-weight: 400;
}

/* Mobile responsive for reviews */
@media (max-width: 600px) {
  .media-object {
    flex-direction: column;
    text-align: center;
  }
  
  .media-object .img {
    align-self: center;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .box-left {
    flex: 0 0 auto;
  }
  
  .img-profile {
    width: 250px;
  }
  
  .wrapper:has(.cards__item--horizontal) {
    max-width: 100% !important;
    padding: 2rem 1rem;
  }
  
  .cards__item--horizontal {
    padding: 2rem 1.5rem;
    gap: 2rem;
  }
}

/* Transition styles for Alpine.js */
[x-cloak] {
  display: none !important;
}

/* Responsive adjustments */
@media (min-width: 600px) {
  nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .book-actions {
    flex-direction: row;
    justify-content: center;
  }
  
  .newsletter {
    flex-direction: row;
    align-items: end;
  }
  
  .newsletter input[type="submit"] {
    flex-shrink: 0;
  }
}

/* =========================================================
   AUTHOR BIO — force two-column grid on screens ≥ 600 px
   ========================================================= */
@media (min-width: 600px) {

  /* parent becomes a two-column grid */
  .bio{
    display:grid !important;             /* overrides old flex / block / float */
    grid-template-columns: 320px 1fr;    /* 320-px image column + flexible text */
    gap:2rem;
    align-items:start;
    max-width:1200px;
    margin-inline:auto;
  }

  /* cancel any legacy floats once and for all */
  .bio .box-left,
  .bio .box-right{
    float:none !important;
  }

  /* left column (image) must not grow or shrink */
  .bio .box-left{
    width:320px;                         /* ~300 px image + padding */
  }

  /* right column (text) fills the remaining space */
  .bio .box-right{
    min-width:0;                         /* lets long words wrap */
  }
}

/* below 600 px we fall back to the single-column mobile stack */

/*******************************
  Banner styling
*******************************/

.banner {
  padding: 0 2rem;
}

.banner-image {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 8px hsla(30, 20%, 20%, 0.1);
}

/*******************************
  Horizontal book cards for novels page
*******************************/

/* Override the cards grid for horizontal layout */
.cards:has(.cards__item--horizontal) {
  display: block !important;
  grid-template-columns: none !important;
}

/* Horizontal book cards for novels page */
.cards__item--horizontal {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 3rem;
  margin-bottom: 4rem;
  padding: 3rem;
  background: linear-gradient(135deg, var(--grey-100) 0%, var(--main-100) 100%);
  border-radius: 12px;
  border: 1px solid var(--main-200);
  width: 100%;
  max-width: none;
}

.book-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.book-image img {
  border-radius: 8px;
  width: 250px;
  height: 375px;
}

.book-image img:hover {
}

.book-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-self: stretch;
  justify-content: flex-start;
}

.book-content h3 {
  margin: 0 !important;
  font-size: 1.8rem;
  color: var(--main-800);
  text-align: left !important;
  font-weight: 400;
}

.book-content h4 {
  margin: 0 !important;
  font-size: 1.2rem;
  color: var(--grey-600);
  font-weight: 300;
  font-style: italic;
  text-align: left !important;
}

.book-content p {
  margin: 0 !important;
  line-height: 1.7;
  color: var(--grey-700);
  text-align: left !important;
  padding: 0 !important;
  font-size: 1rem;
}

.cards__item--horizontal .book-actions {
  display: flex;
  flex-direction: row !important;
  gap: 1rem;
  margin-top: auto;
  width: auto !important;
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--main-600);
  color: var(--main-600);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--main-600);
  color: var(--grey-100);
}

/* Expand wrapper width for horizontal cards - make it even wider */
.wrapper:has(.cards__item--horizontal) {
  max-width: 1400px !important; /* Increased from 1200px to 1400px */
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .cards__item--horizontal {
    flex-direction: column !important;
    text-align: center;
    align-items: center;
  }
  
  .book-content h3,
  .book-content h4,
  .book-content p {
    text-align: center !important;
  }
  
  .cards__item--horizontal .book-actions {
    justify-content: center;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  .wrapper:has(.cards__item--horizontal) {
    max-width: 600px !important;
  }
}

/* Certificate styling */
.certificate-image {
  margin-top: 1rem;
  text-align: center;
  width: 200px;
}

.certificate-image img {
  max-width: 100%;
  width: 200px;
  height: auto;
  border-radius: 8px;
  border: 2px solid var(--main-300);
}

.certificate-caption {
  font-size: 0.85rem;
  color: var(--grey-600);
  font-style: italic;
  margin-top: 0.5rem;
}

/* Full width for novels page */
.novels-full-width {
  max-width: none !important;
  padding: 3rem 4rem; /* Increased horizontal padding */
}
