/* Global styles */
:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f7f4ee;
  --surface: #ffffff;
  --text: #1e1a14;
  --muted: #5f5345;
  --accent: #7a4d2b;
  --header: #111111;
  --header-text: #f7f4ee;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #111114;
  --surface: #1a1a1f;
  --text: #f7f4ee;
  --muted: #d7d5da;
  --accent: #d18f5a;
  --header: #0f1116;
  --header-text: #f7f4ee;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  color: inherit;
  text-decoration: none;
}

button,
.btn {
  border: none;
  cursor: pointer;
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header,
.site-footer {
  background: #4a3f35;
  color: #f7f4ee;
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 24px 0;
}

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0 0 12px;
  opacity: 0.85;
}

.site-header h1,
.site-header h2,
.site-header p,
.section-heading h2,
.section-heading p,
.card h2,
.card h3,
.about-content h2 {
  margin: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-nav a {
  color: #f7f4ee;
  padding: 10px 12px;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.hero-section {
  padding: 64px 0;
}

.hero-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 32px;
}

.hero-content h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
}

.hero-content p {
  max-width: 640px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.btn,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 600;
}

.btn {
  background: #7a4d2b;
  color: #fff;
}

.amazon-btn,
.bn-btn,
.apple-books-btn {
  background: none;
  border: none;
  padding: 0;
}

.logo-img {
  height: 40px;
  width: auto;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #f7f4ee;
}

.section {
  padding: 64px 0;
}

.section-heading {
  margin-bottom: 24px;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  align-items: start;
  gap: 32px;
}

.blog-post-list {
  grid-template-columns: 1fr;
}

.blog-archive {
  padding-left: 24px;
  border-left: 1px solid rgba(95, 83, 69, 0.28);
}

.blog-archive h2 {
  margin: 0 0 24px;
}

.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(95, 83, 69, 0.28);
}

.archive-list li {
  border-bottom: 1px solid rgba(95, 83, 69, 0.28);
}

.archive-list a {
  display: grid;
  gap: 4px;
  padding: 16px 4px;
}

.archive-list time {
  color: var(--muted);
  font-size: 0.92rem;
}

.archive-list a span {
  font-weight: 600;
}

.archive-list a:hover span {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pdf-viewer {
  width: 100%;
  height: min(80vh, 960px);
  min-height: 560px;
  border: 0;
  background: var(--surface);
}

.card-grid,
.gallery-grid,
.blog-grid,
.feature-list {
  display: grid;
  gap: 20px;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card,
.article-card {
  background: #fff;
  padding: 28px;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.07);
}

.card h2,
.card h3 {
  margin-bottom: 14px;
}

.featured-header {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  justify-content: space-between;
}

.featured-text {
  flex: 1;
}

.featured-text h3,
.featured-text p {
  margin: 0 0 14px 0;
}

.featured-text p:last-child {
  margin-bottom: 0;
}

.featured-header .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.available-on {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
}

.available-on span {
  font-weight: 600;
}

.gallery-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.blog-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.hero-image {
  width: 80%;
  max-width: 300px;
  height: auto;
  justify-self: center;
  border-radius: 18px;
}

.about-content p,
.blog-content p {
  margin: 18px 0;
}

.author-profile {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 28px;
  align-items: start;
  margin: 20px 0 8px;
}

.author-portrait {
  margin: 0;
  background: var(--surface);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

.author-portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
}

.author-portrait figcaption {
  margin-top: 10px;
  text-align: left;
  font-style: normal;
  color: var(--muted);
}

.author-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.author-actions .btn {
  width: 100%;
  text-align: center;
}

.subscriber-form {
  max-width: 520px;
  padding: 28px;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.08);
}

.subscriber-form label {
  display: block;
  margin: 0 0 6px;
  font-weight: 600;
}

.subscriber-form input {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(95, 83, 69, 0.4);
  border-radius: 6px;
  font: inherit;
}

.feature-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.feature-list .card {
  background: #f4f0e6;
}

/* Carousel styles */
.carousel-container {
  background: var(--surface);
  padding: 28px;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.07);
}

.carousel-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  position: relative;
}

.carousel-wrapper:hover {
  cursor: grab;
}

.carousel-figure {
  flex: 1;
  margin: 0;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.carousel-image {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  border-radius: 12px;
  cursor: grab;
}

figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

.carousel-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-btn:hover {
  background: #905a34;
  transform: scale(1.05);
}

.carousel-btn:active {
  transform: scale(0.95);
}

.carousel-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.carousel-indicators {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.carousel-dot:hover {
  transform: scale(1.2);
}

.carousel-dot.active {
  background: var(--accent);
}

.carousel-speed-control {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.carousel-speed-control label {
  font-weight: 600;
  font-size: 0.9rem;
}

.carousel-speed-slider {
  width: 150px;
  cursor: pointer;
}

.speed-display {
  font-weight: 600;
  color: var(--accent);
  min-width: 40px;
  text-align: right;
}

.carousel-counter {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
}

.carousel-index-display {
  font-weight: 600;
  color: var(--accent);
}

/* Full Gallery Section */
.full-gallery-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 2px solid rgba(122, 77, 43, 0.2);
}

.full-gallery-section h3 {
  margin-top: 0;
  margin-bottom: 24px;
  font-size: 1.3rem;
}

.full-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.gallery-item {
  margin: 0;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.gallery-item-image {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}

.gallery-item figcaption {
  padding: 12px;
  margin: 0;
}

.gallery-item figcaption p {
  margin: 0 0 8px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.rotation-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  border-radius: 4px;
  background: #d4edda;
  color: #155724;
}

.rotation-badge.excluded {
  background: #f8d7da;
  color: #721c24;
}

html[data-theme='dark'] .rotation-badge {
  background: rgba(28, 107, 46, 0.3);
  color: #7dd3c0;
}

html[data-theme='dark'] .rotation-badge.excluded {
  background: rgba(121, 47, 47, 0.3);
  color: #e89e9e;
}

.site-footer {
  padding: 28px 0;
}

@media (max-width: 900px) {
  .author-profile {
    grid-template-columns: 1fr;
  }

  .author-portrait {
    max-width: 360px;
  }
  
  .carousel-wrapper {
    flex-direction: column;
  }
  
  .carousel-figure {
    min-height: 250px;
  }
  
  .full-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 760px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-archive {
    padding: 24px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(95, 83, 69, 0.28);
  }
}

@media (max-width: 640px) {
  .hero-content {
    grid-template-columns: 1fr;
  }

  .hero-image {
    width: 65%;
    max-width: 240px;
  }

  .header-inner,
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
  }
  
  .carousel-btn {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .carousel-speed-control {
    gap: 8px;
  }
  
  .carousel-speed-slider {
    width: 120px;
  }
  
  .carousel-figure {
    min-height: 200px;
  }
  
  .carousel-image {
    max-height: 300px;
  }
  
  .full-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
  }
  
  .gallery-item-image {
    height: 110px;
  }
  
  .gallery-item figcaption {
    padding: 10px;
  }
  
  .gallery-item figcaption p {
    font-size: 0.75rem;
  }
}
