/* Indie Writer — Classic stack, shared hosting */

:root {
  --color-bg: #faf8f5;
  --color-paper: #f5f1eb;
  --color-ink: #2c2825;
  --color-ink-muted: #5c5650;
  --color-accent: #8b6914;
  --color-accent-hover: #6b5010;
  --color-border: #e0d9cf;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --max-width: 720px;
  --header-height: 4rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
  /* Fragment links (#id): keep target clear of sticky header */
  scroll-padding-top: var(--header-height);
}

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

/* Header & nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.95);
  border-bottom: 1px solid var(--color-border);
}

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

.logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

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

.nav-links a {
  color: var(--color-ink-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9375rem;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-ink);
}

@media (max-width: 600px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem;
    display: none;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links li {
    border-bottom: 1px solid var(--color-border);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-links a {
    display: block;
    padding: 0.75rem 0;
  }
}

/* Main content */
.main-content {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  width: 100%;
}

/* Hero */
.hero {
  margin-bottom: 3rem;
}

.hero-tagline {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 0.5rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 600;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.hero-intro {
  color: var(--color-ink-muted);
  margin: 0;
  max-width: 36em;
}

/* Section title */
.section-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-ink-muted);
  margin: 0 0 1.25rem;
}

/* Featured book */
.featured-book {
  margin-bottom: 3rem;
}

.book-card-featured {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.75rem;
  align-items: start;
  padding: 1.5rem;
  background: var(--color-paper);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.book-card-featured .book-cover {
  margin-left: 1.75rem;
}

.book-card-featured .book-cover img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

@media (max-width: 480px) {
  .book-card-featured {
    grid-template-columns: 1fr;
  }
}

.book-cover-placeholder {
  aspect-ratio: 2/3;
  background: linear-gradient(145deg, #d4c9b8 0%, #c4b8a5 100%);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(44, 40, 37, 0.7);
  text-align: center;
  padding: 0.5rem;
}

.book-details h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.book-meta {
  font-size: 0.875rem;
  color: var(--color-ink-muted);
  margin: 0 0 0.75rem;
}

.book-description {
  margin: 0 0 1rem;
  color: var(--color-ink-muted);
}

.book-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

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

.btn.disabled {
  pointer-events: none;
  cursor: not-allowed;
  background: #b0b0b0;
  color: #e8e8e8;
}

/* Quick links */
.quick-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-ink);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.quick-link:hover {
  color: var(--color-accent);
}

.quick-link-arrow {
  color: var(--color-accent);
  margin-left: 0.5rem;
}

/* Page title (inner pages) */
.page-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 600;
  margin: 0 0 2rem;
}

/* Books list */
.books-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.books-list li {
  border-bottom: 1px solid var(--color-border);
}

.books-list li:last-child {
  border-bottom: none;
}

.book-card {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 1.25rem;
  align-items: start;
  padding: 1.5rem 0;
}

@media (max-width: 480px) {
  .book-card {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
  }
}

.book-card .book-cover-placeholder {
  font-size: 0.75rem;
}

.book-card .book-cover img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

/* About page */
.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 2rem 2.25rem;
  align-items: start;
}

.about-profile {
  margin: 0;
  padding: 0;
  justify-self: center;
  width: 100%;
  max-width: 220px;
}

.about-profile img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 20%;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 14px rgba(44, 40, 37, 0.08);
}

@media (max-width: 640px) {
  .about-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about-profile {
    max-width: min(240px, 72vw);
    margin: 0 auto;
  }
}

.bio-content {
  max-width: 42em;
  min-width: 0;
}

.bio-content p {
  margin: 0 0 1.25rem;
  color: var(--color-ink-muted);
}

.bio-content p:last-child {
  margin-bottom: 0;
}

/* Newsletter page — MailerLite embed width */
.main-content.newsletter-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2rem;
}

.main-content.newsletter-page .newsletter-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.main-content.newsletter-page .newsletter-section .ml-embedded {
  display: block;
  width: 100%;
}

.main-content.newsletter-page .newsletter-section iframe {
  max-width: 100%;
}

.contact-info h3,
.newsletter-section h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.contact-info p,
.newsletter-section > p {
  margin: 0 0 0.5rem;
  color: var(--color-ink-muted);
}

.contact-info a {
  color: var(--color-accent);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
}

.form-group input {
  width: 100%;
  max-width: 320px;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: #fff;
}

.form-group input:focus {
  outline: none;
  border-color: var(--color-accent);
}

.newsletter-form .btn {
  margin-top: 0.25rem;
}

.form-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 0.9375rem;
  display: none;
}

.form-message.is-visible {
  display: block;
}

.form-message.success {
  background: #e8f5e9;
  color: #2e7d32;
}

.form-message.error {
  background: #ffebee;
  color: #c62828;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1.25rem 1.25rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-ink-muted);
}
