/* ===================================
   Encounter Press - Main Stylesheet
   Warm, clean, professional design
   =================================== */

/* CSS Variables */
:root {
  /* Warm cream/paper palette */
  --color-cream: #FAF7F2;
  --color-cream-dark: #F2EDE5;
  --color-parchment: #EDE8DE;
  --color-warm-white: #FFFDF9;
  
  /* Text colors */
  --color-charcoal: #2C2825;
  --color-warm-gray: #5C5552;
  --color-muted: #8A8481;
  
  /* Accent */
  --color-terracotta: #B85C38;
  --color-terracotta-dark: #9A4D2F;
  --color-gold: #C9A962;
  
  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;
  
  /* Max widths */
  --max-width: 1200px;
  --max-width-narrow: 800px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-charcoal);
  background-color: var(--color-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-charcoal);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: var(--space-sm);
}

h3 {
  font-size: 1.5rem;
  color: var(--color-warm-gray);
}

p {
  margin-bottom: 1em;
}

a {
  color: var(--color-terracotta);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-terracotta-dark);
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: var(--max-width-narrow);
}

/* Header */
.header {
  padding: var(--space-md) 0;
  background: var(--color-warm-white);
  border-bottom: 1px solid var(--color-parchment);
}

.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header__logo img {
  height: 65px;
  width: auto;
}

.header__logo-text {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--color-charcoal);
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  gap: var(--space-md);
}

.nav__link {
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-warm-gray);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-xs) 0;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-terracotta);
  transition: width 0.3s ease;
}

.nav__link:hover {
  color: var(--color-charcoal);
}

.nav__link:hover::after {
  width: 100%;
}

.nav__link--active {
  color: var(--color-charcoal);
}

.nav__link--active::after {
  width: 100%;
}

/* Hero Section */
.hero {
  padding: var(--space-lg) 0 var(--space-md);
  text-align: center;
  background: linear-gradient(180deg, var(--color-warm-white) 0%, var(--color-cream) 100%);
}

.hero__tagline {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-muted);
  margin-top: var(--space-sm);
}

/* Books Section */
.books {
  padding: var(--space-lg) 0 var(--space-xl);
}

.books__header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.books__tagline {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-muted);
  margin-top: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.section-divider {
  width: 60px;
  height: 2px;
  background: var(--color-terracotta);
  margin: var(--space-md) auto;
}

/* Book Card */
.book {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: var(--space-lg);
  align-items: start;
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--color-parchment);
}

.book:last-child {
  border-bottom: none;
}

.book:nth-child(even) {
  direction: rtl;
}

.book:nth-child(even) > * {
  direction: ltr;
}

.book__cover {
  position: relative;
}

.book__cover img {
  width: 100%;
  max-width: 350px;
  height: auto;
  box-shadow: 
    0 20px 40px rgba(44, 40, 37, 0.15),
    0 10px 20px rgba(44, 40, 37, 0.1);
  border-radius: 2px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book__cover img:hover {
  transform: translateY(-5px);
  box-shadow: 
    0 25px 50px rgba(44, 40, 37, 0.2),
    0 15px 30px rgba(44, 40, 37, 0.12);
}

.book__content {
  padding-top: var(--space-sm);
}

.book__title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  margin-bottom: var(--space-xs);
  color: var(--color-charcoal);
}

.book__subtitle {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-terracotta);
  margin-bottom: var(--space-md);
}

.book__author {
  font-size: 1rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.book__description {
  color: var(--color-warm-gray);
  margin-bottom: var(--space-md);
}

.book__description--preview {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book__formats {
  margin-bottom: var(--space-md);
}

.book__formats-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  margin-bottom: var(--space-xs);
}

.book__prices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.book__price {
  font-size: 0.95rem;
  color: var(--color-warm-gray);
}

.book__price strong {
  color: var(--color-charcoal);
}

.book__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn--primary {
  background: var(--color-terracotta);
  color: var(--color-warm-white);
}

.btn--primary:hover {
  background: var(--color-terracotta-dark);
  color: var(--color-warm-white);
  transform: translateY(-2px);
}

.btn--secondary {
  background: transparent;
  color: var(--color-charcoal);
  border: 2px solid var(--color-charcoal);
}

.btn--secondary:hover {
  background: var(--color-charcoal);
  color: var(--color-warm-white);
}

.btn--small {
  padding: 0.625rem 1.25rem;
  font-size: 0.8rem;
}

.btn--disabled {
  background: var(--color-parchment);
  color: var(--color-muted);
  cursor: not-allowed;
}

.btn--disabled:hover {
  transform: none;
  background: var(--color-parchment);
  color: var(--color-muted);
}

/* Book Details (pages, publisher) */
.book__details {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-parchment);
}

.book__detail {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.book__detail + .book__detail::before {
  content: "·";
  margin-right: var(--space-sm);
}

/* Free Resource Callout */
.book__resource {
  background: var(--color-parchment);
  padding: var(--space-sm) var(--space-md);
  border-radius: 4px;
  margin-top: var(--space-md);
  border-left: 3px solid var(--color-terracotta);
}

.book__resource p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--color-warm-gray);
}

.book__resource a {
  font-weight: 600;
}

/* ISBN Display */
.book__isbn {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: var(--space-sm);
}

/* Multi-Edition Book Styles */
.book--multi-edition .book__cover--multi {
  display: flex;
  justify-content: center;
}

.book__edition {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-parchment);
}

.book__edition-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-terracotta);
  margin-bottom: var(--space-xs);
}

.book__edition-desc {
  font-size: 0.95rem;
  color: var(--color-muted);
  font-style: italic;
  margin-bottom: var(--space-sm);
}

.book__edition .book__actions {
  margin-top: var(--space-sm);
}

.book__edition .book__isbn {
  margin-top: var(--space-xs);
}

/* Print Volumes Layout */
.book__volumes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}

.book__volume {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}

.book__volume img {
  width: 100px;
  height: auto;
  box-shadow: 
    0 8px 20px rgba(44, 40, 37, 0.12),
    0 4px 10px rgba(44, 40, 37, 0.08);
  border-radius: 2px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book__volume img:hover {
  transform: scale(1.05);
  box-shadow: 
    0 12px 30px rgba(44, 40, 37, 0.18),
    0 6px 15px rgba(44, 40, 37, 0.12);
}

/* Lightbox Modal */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 40, 37, 0.92);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox__image {
  max-width: 90%;
  max-height: 90vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox.active .lightbox__image {
  transform: scale(1);
}

.lightbox__close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--color-warm-white);
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  color: var(--color-charcoal);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.lightbox__close:hover {
  transform: scale(1.1);
}

/* Share Buttons */
.book__share {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-parchment);
}

.book__share-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
}

.book__share-links {
  display: flex;
  gap: 0.5rem;
}

.book__share-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-parchment);
  color: var(--color-warm-gray);
  transition: all 0.2s ease;
}

.book__share-link:hover {
  transform: translateY(-2px);
}

.book__share-link--facebook:hover {
  background: #1877F2;
  color: white;
}

.book__share-link--twitter:hover {
  background: #000000;
  color: white;
}

.book__share-link--pinterest:hover {
  background: #E60023;
  color: white;
}

.book__share-link svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media (max-width: 600px) {
  .book__share {
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
  }
}

.book__volume-info {
  flex: 1;
}

.book__volume-info h4 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--color-charcoal);
}

.book__volume-info p {
  font-size: 0.9rem;
  color: var(--color-warm-gray);
  margin-bottom: var(--space-xs);
}

.book__volume-info .book__prices {
  flex-direction: column;
  gap: 0.25rem;
}

.book__volume-info .book__price {
  font-size: 0.85rem;
}

.book__volume-info .book__actions {
  margin-top: var(--space-xs);
}

.book__volume-info .book__isbn {
  font-size: 0.75rem;
  margin-top: var(--space-xs);
}

@media (max-width: 900px) {
  .book__volumes {
    grid-template-columns: 1fr;
  }
  
  .book__volume {
    justify-content: center;
    text-align: left;
  }
}

@media (max-width: 600px) {
  .book__volume {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .book__volume img {
    width: 120px;
  }
  
  .book__volume-info .book__prices {
    justify-content: center;
  }
  
  .book__volume-info .book__actions {
    justify-content: center;
  }
}

/* Page Content */
.page-content {
  padding: var(--space-lg) 0 var(--space-xl);
  min-height: 60vh;
}

.page-content h1 {
  margin-bottom: var(--space-md);
}

.page-content h2 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.page-content p {
  color: var(--color-warm-gray);
}

.page-content ul {
  margin-left: var(--space-md);
  margin-bottom: var(--space-md);
  color: var(--color-warm-gray);
}

.page-content li {
  margin-bottom: var(--space-xs);
}

/* Contact Form */
.contact-form {
  max-width: 600px;
  margin-top: var(--space-lg);
}

.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-charcoal);
  margin-bottom: var(--space-xs);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-charcoal);
  background: var(--color-warm-white);
  border: 1px solid var(--color-parchment);
  border-radius: 2px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-terracotta);
  box-shadow: 0 0 0 3px rgba(184, 92, 56, 0.1);
}

.form-group textarea {
  min-height: 180px;
  resize: vertical;
}

/* Footer */
.footer {
  padding: var(--space-lg) 0;
  background: var(--color-charcoal);
  color: var(--color-cream);
  text-align: center;
}

.footer__nav {
  display: flex;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.footer__link {
  color: var(--color-cream-dark);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.footer__link:hover {
  color: var(--color-warm-white);
}

.footer__copyright {
  font-size: 0.9rem;
  color: var(--color-muted);
}

.footer__logo {
  margin-bottom: var(--space-md);
}

.footer__logo img {
  height: 40px;
  width: auto;
  opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 900px) {
  .book {
    grid-template-columns: 1fr;
    gap: var(--space-md);
    text-align: center;
  }
  
  .book:nth-child(even) {
    direction: ltr;
  }
  
  .book__cover {
    display: flex;
    justify-content: center;
  }
  
  .book__cover img {
    max-width: 280px;
  }
  
  .book__actions {
    justify-content: center;
  }
  
  .book__prices {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  :root {
    --space-lg: 3rem;
    --space-xl: 4rem;
  }
  
  .header__inner {
    flex-direction: column;
    text-align: center;
  }
  
  .nav {
    gap: var(--space-sm);
  }
  
  .book__actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .footer__nav {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

/* About the Author Section */
.author {
  padding: var(--space-xl) 0;
  background: var(--color-warm-white);
  border-top: 1px solid var(--color-parchment);
}

.author__inner {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.author__photo img {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 4px;
  box-shadow: 
    0 10px 30px rgba(44, 40, 37, 0.12),
    0 5px 15px rgba(44, 40, 37, 0.08);
}

.author__content h2 {
  margin-bottom: var(--space-xs);
}

.author__content p {
  color: var(--color-warm-gray);
}

.author__location {
  font-style: italic;
  margin-top: var(--space-md);
  color: var(--color-muted) !important;
}

@media (max-width: 768px) {
  .author__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .author__photo {
    display: flex;
    justify-content: center;
  }
  
  .author__photo img {
    max-width: 220px;
  }
  
  .author__content .section-divider {
    margin-left: auto !important;
    margin-right: auto;
  }
}

/* Expand/Collapse for long descriptions */
.book__description-full {
  display: none;
}

.book__description-full.active {
  display: block;
}

.book__read-more {
  color: var(--color-terracotta);
  cursor: pointer;
  font-weight: 500;
  border: none;
  background: none;
  font-size: inherit;
  font-family: inherit;
  padding: 0;
}

.book__read-more:hover {
  text-decoration: underline;
}

