.ashwick-layout {
  display: grid;
  grid-template-columns: minmax(360px, 24vw) minmax(0, 1fr);
  gap: 2rem;
  padding: 4rem 4%;
  background: #f8f4eb;
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.ashwick-sidebar {
  position: sticky;
  top: 120px;
  align-self: start;
  padding: 1rem 0;
}

.ashwick-sidebar h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(3rem, 5vw, 4rem);
  color: #3f5e32;
  margin: .5rem 0 1rem;
  max-width: 100%;
  word-break: normal;
  hyphens: none;
}

.ashwick-sidebar p {
  line-height: 1.7;
}

.side-link {
  display: block;
  margin-top: 1rem;
  padding: 1rem;
  text-decoration: none;
  color: #222;
  border-bottom: 1px solid #d8cbb8;
}

.side-link.active,
.side-link:hover {
  background: #eee4d3;
}

.map-frame {
  position: relative;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  background: #efe4d2;
  padding: .75rem;
  box-shadow: 0 15px 40px rgba(0,0,0,.15);
}

.map-frame img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.map-pin {
    position: absolute;
    width: 18px;
    height: 18px;
    background: #b01818;
    border: 3px solid #ffffff;
    border-radius: 50%;
    cursor: default;
    transform: translate(-50%, -50%);
    transition: transform .15s ease;
}

.map-pin:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

.reading-order,
.locations-section,
.newsletter-section {
  margin-top: 4rem;
}

.reading-order h2,
.locations-section h2,
.newsletter-section h2 {
  font-family: "Playfair Display", serif;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* ==========================
   READING ORDER SCROLLER
========================== */

.book-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(min(245px, 78vw), 290px);
  gap: 3rem;
  max-width: 100%;
  min-width: 0;
  margin-top: 2.5rem;
  padding: 0 0 1.75rem;

  overflow-x: auto;
  overflow-y: hidden;

  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}

.book-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  scroll-snap-align: start;
}

.book-card,
.book-actions,
.book-actions .btn,
.cover-badge {
  min-width: 0;
  max-width: 100%;
}

.cover-badge,
.book-actions .btn {
  white-space: normal;
  overflow-wrap: anywhere;
  flex: 1 1 0;
}

/* ==========================
   BOOK BADGES
========================== */

.book-badge-row {
  min-height: 2rem;
  height: auto;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
}

.cover-badge {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 5px 14px rgba(0,0,0,.18);
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.cover-badge.coming-soon {
  background: #3f5e32;
}

.cover-badge.special {
  background: #c59b45;
}

/* ==========================
   BOOK COVERS
========================== */

.book-cover-wrap {
  position: relative;
}

.book-cover-wrap img,
.book-placeholder {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
}

.book-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;

  padding: 1rem;

  background: #fffaf2;
  border: 1px solid #e2d6c4;

  font-family: "Playfair Display", serif;
  font-size: 1.35rem;
  line-height: 1.25;
  text-align: center;
  color: #666666;
}

/* ==========================
   BOOK ACTION BUTTONS
========================== */

.book-actions {
  display: flex;
  gap: .75rem;
  margin: 1rem 0 1.5rem;
}

.book-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 3rem;
  padding: .85rem .75rem;
  border: 0;
  box-shadow: 0 7px 18px rgba(0,0,0,.12);

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 800;
  font-size: .76rem;
  letter-spacing: .04em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;

  transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.book-actions .btn:hover,
.book-actions .btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,.16);
}

.btn-buy {
  background: #b40000;
  color: #ffffff;
}

.btn-buy:hover,
.btn-buy:focus-visible {
  background: #8e0000;
}

.btn-view {
  background: #fffaf2;
  color: #222222;
  border: 1px solid #cfc5b6;
}

.btn-view:hover,
.btn-view:focus-visible {
  background: #efe8dc;
}

.btn-notify {
  background: #3f5e32;
  color: #ffffff;
}

.btn-notify:hover,
.btn-notify:focus-visible {
  background: #314b27;
}

/* ==========================
   BOOK TEXT
========================== */

.book-content {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.book-card h3 {
  font-family: "Playfair Display", serif;
  margin: 0 0 .35rem;
  font-size: 1.65rem;
  line-height: 1.08;
}

.book-card p {
  margin: 0 0 1rem;
  font-size: .95rem;
  line-height: 1.55;
}

.book-card p strong {
  display: block;
  margin-bottom: .45rem;
  font-size: 1rem;
}

.book-load-error {
  padding: 1.5rem;
  background: #fffaf2;
  border: 1px solid #e2d6c4;
}

/* ==========================
   LOCATIONS
========================== */

.location-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.location-card {
  min-width: 0;
  overflow: hidden;
  background: #fffaf2;
  border: 1px solid #e2d6c4;
}

.location-image-wrap {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.location-image-wrap img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.location-card-content {
  padding: 1.5rem;
}

.location-grid h3 {
  font-family: "Playfair Display", serif;
  margin-top: 0;
}

.location-grid p {
  margin-bottom: 0;
}

/* ==========================
   RESPONSIVE
========================== */

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

  .ashwick-sidebar {
    position: static;
  }

  .location-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .ashwick-layout {
    padding: 3rem 1.5rem;
  }

  .ashwick-sidebar {
    padding: 1rem 0;
  }

  .ashwick-sidebar h1 {
    font-size: 3rem;
  }

  .book-row {
    grid-auto-columns: minmax(220px, 78vw);
    gap: 1.5rem;
  }

  .book-actions {
    gap: .5rem;
  }

  .book-actions .btn {
    font-size: .72rem;
    padding: .8rem .55rem;
  }


}


/* =========================================================
   Accessibility / zoom overflow hardening
   Prevents map, sidebar text, book cards, badges, and buttons
   from making the whole document wider than the viewport.
========================================================= */

.ashwick-layout,
.ashwick-sidebar,
.map-frame,
.reading-order,
.locations-section,
.newsletter-section,
.location-grid,
.location-grid article,
.book-row,
.book-card,
.book-content,
.book-actions,
.book-cover-wrap {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.ashwick-sidebar h1,
.ashwick-sidebar p,
.side-link,
.book-card h3,
.book-card p,
.location-grid h3,
.location-grid p {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.map-frame {
  overflow: hidden;
}

.map-frame img {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.book-row {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.book-actions {
  flex-wrap: wrap;
}

.book-actions .btn,
.cover-badge {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.book-actions .btn {
  flex: 1 1 0;
}

.book-badge-row {
  min-width: 0;
  max-width: 100%;
  height: auto;
  align-items: flex-start;
}

@media (max-width: 1000px) {
  .ashwick-layout {
    grid-template-columns: 1fr;
  }
  
  .ashwick-sidebar h1 {
    max-width: 100%;
    font-size: clamp(3rem, 12vw, 4rem);
  }
}

@media (max-width: 700px) {
  .ashwick-layout {
    padding-inline: 1.5rem;
  }

  .book-row {
    grid-auto-columns: minmax(min(220px, 78vw), 78vw);
  }
}

/* ==========================
   CHARACTERS
========================== */

.characters-section {
  margin-top: 4rem;
}

.characters-section h2 {
  font-family: "Playfair Display", serif;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.character-card {
  min-width: 0;
  overflow: hidden;
  background: #fffaf2;
  border: 1px solid #e2d6c4;
  box-sizing: border-box;
}

.character-image-wrap {
  width: 100%;
  max-width: 100%;
  padding: 1rem 1rem 0;
  overflow: hidden;
  box-sizing: border-box;
}

.character-image-wrap img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  box-sizing: border-box;
}

.character-card-content {
  padding: 1.5rem;
}

.character-card h3 {
  font-family: "Playfair Display", serif;
  margin-top: 0;
}

.character-role {
  margin: -.25rem 0 .75rem;
  font-weight: 700;
  color: #3f5e32;
}

.character-card p {
  margin-bottom: 1rem;
}

.character-card-link {
  display: inline-flex;
}

@media (max-width: 1000px) {
  .character-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Corrected Ashwick layout
   Keeps the sidebar compact so the map/books do not get pushed
   sideways and create horizontal scrolling.
========================================================= */

.ashwick-layout {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
  gap: 1.5rem;
  padding: 3rem 3%;
  max-width: 100%;
  overflow-x: clip;
}

.ashwick-sidebar {
  width: 100%;
  max-width: 300px;
  min-width: 0;
  padding: 1rem 0;
}

.ashwick-sidebar h1 {
  font-size: clamp(3rem, 4.5vw, 4rem);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.map-frame,
.characters-section,
.reading-order,
.locations-section,
.newsletter-section {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1100px) {
  .ashwick-layout {
    grid-template-columns: 1fr;
    padding: 2.5rem 1.25rem;
  }

  .ashwick-sidebar {
    position: static;
    max-width: none;
    width: 100%;
    padding: 0;
  }

  .ashwick-sidebar h1 {
    font-size: clamp(3rem, 11vw, 4.6rem);
  }
}

@media (max-width: 700px) {
  .ashwick-layout {
    padding: 2rem 1rem;
  }
}


/* =========================================================
   Interactive map parchment cards
   A click on a map pin opens a compact location card next to it.
========================================================= */

#map-pins {
  position: absolute;
  inset: .75rem;
  z-index: 2;
  pointer-events: none;
}

.map-pin {
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
  padding: 0;
  z-index: 3;
}

.map-pin:focus-visible {
  outline: 3px solid #fffaf2;
  outline-offset: 3px;
}

.map-location-card {
  position: absolute;
  z-index: 4;
  width: min(320px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  pointer-events: auto;

  padding: 1rem;
  background: #f7edd8;
  border: 1px solid #9f8761;
  box-shadow: 0 16px 35px rgba(0,0,0,.35);
  color: #241b12;
}

.map-location-card::before {
  content: "";
  position: absolute;
  inset: .35rem;
  border: 1px solid rgba(117, 88, 47, .35);
  pointer-events: none;
}

.map-location-card img {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  margin-bottom: .85rem;
  border: 1px solid rgba(117, 88, 47, .35);
}

.map-location-card h3 {
  margin: 0 2rem .5rem 0;
  font-family: "Playfair Display", serif;
  font-size: 1.45rem;
  line-height: 1.1;
}

.map-location-card p {
  margin: 0 0 .85rem;
  font-size: .95rem;
  line-height: 1.45;
}

.map-location-card-close {
  position: absolute;
  top: .45rem;
  right: .55rem;
  z-index: 5;
  width: 1.8rem;
  height: 1.8rem;
  border: 0;
  background: transparent;
  color: #241b12;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
}

@media (max-width: 700px) {
  .map-location-card {
    left: 12px !important;
    right: 12px;
    top: 12px !important;
    width: auto;
    max-height: calc(100% - 24px);
  }
}
/* =========================================================
   HARD MOBILE OVERFLOW FIX
========================================================= */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  position: relative;
}

nav {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.logo,
nav ul {
  min-width: 0;
  max-width: 100%;
}

.logo span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ashwick-layout {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.ashwick-main,
.ashwick-sidebar,
.map-frame,
.locations-section,
.characters-section,
.reading-order,
.location-grid,
.character-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.ashwick-main {
  overflow: hidden;
}

.map-frame img {
  width: 100%;
  max-width: 100%;
  height: auto;
}

.book-row {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 700px) {
  nav {
    padding-inline: 1rem;
  }

  .logo {
    justify-content: center;
    width: 100%;
  }

  .logo span {
    font-size: 1.05rem;
  }

  nav ul {
    width: 100%;
    justify-content: center;
  }

  .ashwick-layout {
    display: block;
    padding: 2rem 1rem;
  }

  .ashwick-sidebar {
    max-width: 100%;
  }

  .ashwick-sidebar h1 {
    font-size: clamp(2.6rem, 16vw, 3.5rem);
  }

  .book-row {
    grid-auto-columns: minmax(210px, 78vw);
  }
}
@media (min-width: 1101px) {
  .ashwick-layout {
    grid-template-columns: 360px minmax(0, 1fr);
  }

  .ashwick-sidebar {
    position: fixed;
    top: 150px;
    left: 4%;
    width: 320px;
    max-height: calc(100vh - 170px);
    overflow-y: auto;
    z-index: 20;
  }

  .ashwick-main {
    grid-column: 2;
    min-width: 0;
  }
}

#map,
#locations,
#characters,
#reading-order,
#newsletter {
  scroll-margin-top: 120px;
}
