:root {
  --ink: #271b12;
  --ink-soft: #4d392d;
  --paper: rgba(248, 239, 217, 0.80);
  --paper-strong: rgba(248, 239, 217, 0.90);
  --line: rgba(71, 46, 28, 0.22);
  --brown: #743b1b;
  --brown-dark: #552812;
  --max: 900px;
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  background: #1d1712;
  line-height: 1.43;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(16,12,9,0.28), rgba(16,12,9,0.52)),
    url('../img/rio-grande-canyon-background.png') center center / cover no-repeat;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 0%, rgba(250, 232, 183, 0.14), transparent 44%),
    linear-gradient(90deg, rgba(0,0,0,0.22), transparent 26%, transparent 74%, rgba(0,0,0,0.22));
}

img { max-width: 100%; display: block; }
a { color: inherit; }
.container {
  width: min(100% - 1.2rem, var(--max));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 232, 208, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(61, 39, 23, 0.14);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}
.header-inner.no-nav { justify-content: center; }
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
}
.brand-name {
  font-weight: 700;
  font-size: clamp(1.1rem, 2.4vw, 1.55rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.1;
}
.brand-line {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #7b6147;
}

.main {
  padding: clamp(1.5rem, 4vw, 3.5rem) 0 4rem;
}
.stack {
  display: grid;
  gap: clamp(1.4rem, 4vw, 2.25rem);
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(0,0,0,0.25);
  backdrop-filter: blur(5px);
  overflow: hidden;
}
.card.pad { padding: clamp(1.1rem, 3vw, 1.65rem); }
.author-card { margin-top: clamp(0.4rem, 3vw, 1.6rem); }
.author-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: clamp(1rem, 3vw, 1.6rem);
  align-items: center;
}
.author-photo-wrap {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(55, 34, 19, 0.18);
  box-shadow: 0 12px 25px rgba(0,0,0,0.23);
}
.author-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 42% 30%;
  filter: sepia(0.08) contrast(1.05);
}
.card-grid {
  display: grid;
  grid-template-columns: 144px 1fr;
  gap: 1rem;
  align-items: center;
  padding: clamp(1rem, 2.4vw, 1.35rem);
}
.card-grid.new-book {
  grid-template-columns: 180px 1fr;
  padding: clamp(1.1rem, 3vw, 1.65rem);
  background: linear-gradient(135deg, rgba(255, 248, 231, 0.84), rgba(232, 205, 163, 0.76));
}
.cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(55, 34, 19, 0.18);
  box-shadow: 0 12px 24px rgba(0,0,0,0.22);
}
.kicker {
  display: inline-block;
  font-size: 0.73rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brown);
  font-weight: 700;
  margin-bottom: 0.45rem;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  margin-bottom: 0.7rem;
}
h2 {
  font-size: clamp(1.65rem, 4vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin-bottom: 0.45rem;
}
h3 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  line-height: 1.08;
  margin-bottom: 0.35rem;
}
p {
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.7vw, 1.06rem);
  margin-bottom: 0.72rem;
}
.tight { margin-bottom: 0; }
.meta {
  font-size: 0.94rem;
  color: #76583e;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.btn,
button.btn {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.66rem 1rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary {
  background: var(--brown);
  color: #fff7e8;
}
.btn.primary:hover { background: var(--brown-dark); text-decoration: none; }
.btn.light {
  background: rgba(255,255,255,0.44);
  color: var(--ink);
  border: 1px solid rgba(61, 39, 23, 0.13);
}
.btn.light:hover { background: rgba(255,255,255,0.68); text-decoration: none; }

.intro p { max-width: 50ch; }
.event-card { background: rgba(248, 239, 217, 0.76); }
.footer {
  color: rgba(255,248,235,0.74);
  padding: 1.5rem 0 2.5rem;
  font-size: 0.88rem;
  text-align: center;
}
.footer a { color: rgba(255,248,235,0.9); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(20, 14, 9, 0.68);
}
.modal[aria-hidden='false'] { display: flex; }
.modal-panel {
  width: min(100%, 720px);
  max-height: min(84vh, 760px);
  overflow: auto;
  background: #f7ecd5;
  color: var(--ink);
  border: 1px solid rgba(83, 52, 30, 0.22);
  border-radius: 24px;
  box-shadow: 0 26px 80px rgba(0,0,0,0.45);
  padding: clamp(1.1rem, 3vw, 2rem);
}
.modal-panel.wide-modal { width: min(100%, 820px); }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.close {
  border: 1px solid rgba(61,39,23,0.18);
  background: rgba(255,255,255,0.5);
  color: var(--ink);
  border-radius: 999px;
  min-width: 42px;
  min-height: 42px;
  font-size: 1.4rem;
  cursor: pointer;
}
.modal-photo {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(61,39,23,0.18);
  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
  margin-bottom: 1rem;
}
.full-author-photo {
  max-height: 58vh;
  object-fit: contain;
  background: #191511;
}
.detail-list {
  display: grid;
  gap: 0.7rem;
  margin: 1rem 0;
  padding: 0;
}
.detail-list li {
  list-style: none;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  background: rgba(116, 59, 27, 0.08);
  color: var(--ink-soft);
}

@media (min-width: 900px) {
  .book-card:nth-of-type(odd) .card-grid:not(.new-book) { grid-template-columns: 1fr 144px; }
  .book-card:nth-of-type(odd) .card-grid:not(.new-book) .cover-wrap { order: 2; }
  .book-card:nth-of-type(odd) .card-grid:not(.new-book) .book-copy { order: 1; }
}

@media (max-width: 740px) {
  body::before { background-position: 44% center; }
  .container { width: min(100% - 0.9rem, var(--max)); }
  .header-inner { min-height: 60px; padding: 0.55rem 0; }
  .brand-name { font-size: 1.02rem; }
  .brand-line { font-size: 0.6rem; letter-spacing: 0.12em; }
  .main { padding-top: 1rem; }
  .card { border-radius: 18px; }
  .card.pad { padding: 1rem; }
  .author-grid {
    grid-template-columns: 112px 1fr;
    gap: 0.9rem;
  }
  .author-photo-wrap { border-radius: 14px; }
  h1 { font-size: 2.15rem; }
  h2 { font-size: 1.55rem; }
  h3 { font-size: 1.32rem; }
  p { font-size: 0.98rem; }
  .card-grid,
  .card-grid.new-book {
    grid-template-columns: 92px 1fr;
    gap: 0.85rem;
    padding: 0.9rem;
  }
  .cover { border-radius: 9px; }
  .meta { font-size: 0.84rem; }
  .btn,
  button.btn {
    min-height: 36px;
    padding: 0.56rem 0.8rem;
    font-size: 0.9rem;
  }
  .actions { gap: 0.42rem; }
  .new-book .book-copy p:not(.meta),
  .book-copy p:not(.meta) {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

@media (max-width: 410px) {
  .brand-name { font-size: 0.92rem; }
  .brand-line { font-size: 0.54rem; }
  .author-grid { grid-template-columns: 96px 1fr; }
  h1 { font-size: 1.92rem; }
  .card-grid,
  .card-grid.new-book { grid-template-columns: 82px 1fr; }
  .btn,
  button.btn { font-size: 0.84rem; padding-inline: 0.66rem; }
  .book-copy p:not(.meta) { -webkit-line-clamp: 2; }
}


.modal-book {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1rem 1.2rem;
  align-items: start;
}
.modal-book-cover {
  width: 100%;
  max-width: 160px;
  border-radius: 12px;
  border: 1px solid rgba(61,39,23,0.18);
  box-shadow: 0 14px 28px rgba(0,0,0,0.16);
}
.modal-book-copy p:first-child {
  margin-top: 0.2rem;
}
@media (max-width: 640px) {
  .modal-book { grid-template-columns: 1fr; }
  .modal-book-cover { max-width: 180px; }
}

/* v10 revisions: vintage purchase links, clickable author card, concise book facts. */
.clickable-card { cursor: pointer; }
.clickable-card:focus-visible {
  outline: 3px solid rgba(116, 59, 27, 0.55);
  outline-offset: 4px;
}
.clickable-card:hover {
  background: rgba(248, 239, 217, 0.88);
}
.available-line {
  margin: 0.35rem 0 0.28rem;
  color: #5b3b24;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.book-facts {
  margin: 0.85rem 0 0.45rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(83, 52, 30, 0.18);
  color: #6b5039;
  font-size: 0.94rem;
  line-height: 1.42;
}
.btn,
button.btn {
  min-height: 36px;
  border-radius: 5px;
  padding: 0.56rem 0.85rem;
  border: 1px solid rgba(65, 38, 19, 0.45);
  box-shadow: 2px 2px 0 rgba(65, 38, 19, 0.18);
  font-size: 0.88rem;
  letter-spacing: 0.075em;
  text-transform: uppercase;
  font-weight: 700;
}
.btn.primary {
  background: #733917;
  color: #fff2d9;
  border-color: #522611;
}
.btn.primary:hover {
  background: #5f2e13;
}
.btn.light {
  background: #f8efd9;
  color: #2a1d13;
  border-color: rgba(65, 38, 19, 0.38);
}
.btn.light:hover {
  background: #fff7e8;
}
.purchase-actions {
  margin-top: 0.25rem;
}
.details-link {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin-top: 0.55rem;
  color: #633316;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}
.details-link:hover { color: #3d210f; }
.modal-book {
  align-items: start;
}
.modal-book-copy .available-line {
  margin-top: 0.85rem;
}

@media (max-width: 740px) {
  .book-copy p.available-line {
    display: block !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    overflow: visible !important;
    font-size: 0.86rem;
    margin-top: 0.45rem;
  }
  .purchase-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
  }
  .purchase-actions .btn {
    min-width: 0;
    padding-inline: 0.55rem;
    font-size: 0.78rem;
  }
  .details-link {
    font-size: 0.88rem;
  }
  .modal-panel .purchase-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 410px) {
  .purchase-actions .btn {
    font-size: 0.72rem;
    letter-spacing: 0.05em;
  }
}


/* v16: author bio modal image is embedded in the article, not a banner */
.author-bio-flow {
  display: block;
}

.author-bio-flow p:first-of-type {
  margin-top: 0;
}

.author-bio-photo {
  display: block;
  width: 100%;
  max-height: 58vh;
  height: auto;
  object-fit: cover;
  object-position: center top;
  background: transparent;
  border-radius: 16px;
  border: 1px solid rgba(61,39,23,0.18);
  box-shadow: 0 14px 28px rgba(0,0,0,0.18);
  margin: 0 0 1rem 0;
}

/* Landscape phones and wider screens: wrap text around the portrait */
@media (min-width: 560px), (orientation: landscape) {
  .modal-panel.wide-modal {
    width: min(100%, 860px);
    max-height: min(88vh, 780px);
  }

  .author-bio-photo {
    float: left;
    width: clamp(165px, 26vw, 245px);
    max-width: 38%;
    max-height: none;
    object-fit: contain;
    margin: 0.15rem 1.15rem 0.65rem 0;
  }

  .author-bio-flow::after {
    content: "";
    display: block;
    clear: both;
  }

  .author-bio-actions {
    clear: both;
  }
}


/* v17 preservation overrides:
   - no modern pill buttons
   - purchase links are introduced by "Available here:"
   - metadata is just text
   - author card is clickable
   - author bio photo wraps with text when space allows
*/
.clickable-card {
  cursor: pointer;
}

.available-line {
  display: block !important;
  margin: 0.45rem 0 0.28rem !important;
  color: #5b3b24 !important;
  font-size: 0.92rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
}

.book-facts {
  display: block !important;
  margin: 0.85rem 0 0.45rem !important;
  padding: 0.65rem 0 0 !important;
  border: 0 !important;
  border-top: 1px solid rgba(83, 52, 30, 0.18) !important;
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #6b5039 !important;
  font-size: 0.94rem !important;
  line-height: 1.42 !important;
}

.detail-list,
.detail-list li,
.legacy-detail-list,
.legacy-detail-list li {
  list-style: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.btn,
button.btn {
  appearance: none !important;
  border-radius: 5px !important;
  min-height: 36px !important;
  padding: 0.56rem 0.85rem !important;
  border: 1px solid rgba(65, 38, 19, 0.45) !important;
  box-shadow: 2px 2px 0 rgba(65, 38, 19, 0.18) !important;
  font: inherit !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.075em !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  cursor: pointer !important;
}

.btn.primary {
  background: #733917 !important;
  color: #fff2d9 !important;
  border-color: #522611 !important;
}

.btn.light {
  background: #f8efd9 !important;
  color: #2a1d13 !important;
  border-color: rgba(65, 38, 19, 0.38) !important;
}

.purchase-actions {
  margin-top: 0.2rem !important;
  gap: 0.45rem !important;
}

.author-bio-flow {
  display: block !important;
}

.author-bio-flow p:first-of-type {
  margin-top: 0 !important;
}

.author-bio-photo {
  display: block !important;
  width: 100% !important;
  max-height: 58vh !important;
  height: auto !important;
  object-fit: cover !important;
  object-position: center top !important;
  background: transparent !important;
  border-radius: 16px !important;
  border: 1px solid rgba(61,39,23,0.18) !important;
  box-shadow: 0 14px 28px rgba(0,0,0,0.18) !important;
  margin: 0 0 1rem 0 !important;
}

@media (min-width: 560px), (orientation: landscape) {
  .modal-panel.wide-modal {
    width: min(100%, 860px) !important;
    max-height: min(88vh, 780px) !important;
  }

  .author-bio-photo {
    float: left !important;
    width: clamp(165px, 26vw, 245px) !important;
    max-width: 38% !important;
    max-height: none !important;
    object-fit: contain !important;
    margin: 0.15rem 1.15rem 0.65rem 0 !important;
  }

  .author-bio-flow::after {
    content: "" !important;
    display: block !important;
    clear: both !important;
  }

  .author-bio-actions {
    clear: both !important;
  }
}


/* v20: praise/review clippings in book popups */
.praise-section {
  margin: 1rem 0 0.4rem;
  padding-top: 0.7rem;
  border-top: 1px solid rgba(83, 52, 30, 0.18);
}

.praise-section h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5b3b24;
}

.review-list {
  display: grid;
  gap: 0.55rem;
}

.review-list blockquote {
  margin: 0;
  padding: 0.6rem 0.7rem;
  background: rgba(255, 248, 235, 0.45);
  border-left: 3px solid rgba(115, 57, 23, 0.5);
}

.review-list p {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
  line-height: 1.35;
}

.review-list cite {
  display: block;
  font-size: 0.82rem;
  font-style: normal;
  color: #6b5039;
}
