/* Bookstore catalogue + book detail refinements */

.bookstore-page { padding: 2.5rem 0 4rem; }
.bookstore-wrap { width: min(1120px, 92%); margin: 0 auto; }
.catalogue-body { padding-top: 2rem; background: linear-gradient(180deg, #f7f3ea 0%, #fff 28%); }

/* Catalogue page masthead */
.catalogue-masthead {
  position: relative;
  background:
    radial-gradient(ellipse 800px 420px at 12% -10%, rgba(42,107,82,.28), transparent 60%),
    radial-gradient(ellipse 700px 480px at 110% 10%, rgba(196,163,90,.18), transparent 55%),
    linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 52%, var(--navy-800) 100%);
  color: var(--paper);
  padding: 48px 0 70px;
  overflow: hidden;
}
.catalogue-masthead::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(247,243,234,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247,243,234,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black, transparent);
  pointer-events: none;
}
.catalogue-masthead-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, .8fr);
  gap: 48px;
  align-items: center;
}
.catalogue-copy .eyebrow { color: var(--gold-light); margin-bottom: 16px; }
.catalogue-copy h1 {
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  font-weight: 600;
  line-height: 1.1;
  margin: 0 0 16px;
  font-family: Fraunces, serif;
}
.catalogue-copy .lede {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(247,243,234,.72);
  max-width: 46ch;
  margin: 0 0 28px;
}
.catalogue-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
  align-items: center;
}
.catalogue-ctas .chip,
.catalogue-masthead .chip {
  display: inline-flex;
  align-items: center;
  padding: .4rem .75rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
  background: rgba(247,243,234,.1);
  border: 1px solid rgba(247,243,234,.18);
  color: inherit;
}
.catalogue-masthead .chip-btn {
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.catalogue-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  max-width: 420px;
  border-top: 1px solid rgba(247,243,234,.14);
  padding-top: 22px;
}
.catalogue-stats .m-val {
  font-family: Fraunces, serif;
  font-size: 1.7rem;
  font-weight: 600;
}
.catalogue-stats .m-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(247,243,234,.5);
  margin-top: 4px;
}
.catalogue-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
}
.catalogue-stack {
  position: relative;
  width: min(280px, 72vw);
  height: 340px;
}
.catalogue-stack .stack-item {
  position: absolute;
  width: 78%;
  left: 11%;
  top: 18px;
}
.catalogue-stack .stack-item .cover-wrap { margin: 0; }
.catalogue-stack .stack-1 { z-index: 3; transform: translate(0, 0) rotate(-4deg); }
.catalogue-stack .stack-2 { z-index: 2; transform: translate(28px, 18px) rotate(5deg); opacity: .95; }
.catalogue-stack .stack-3 { z-index: 1; transform: translate(-22px, 36px) rotate(-9deg); opacity: .88; }
.catalogue-seal { width: min(280px, 70%); }

.catalogue-filters {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr) auto;
  gap: .7rem;
  margin-bottom: 1.75rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid rgba(20,32,26,.1);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(20,32,26,.04);
}
.catalogue-filters input,
.catalogue-filters select {
  width: 100%;
  padding: .75rem .85rem;
  border-radius: 10px;
  border: 1px solid rgba(20,32,26,.14);
  background: #fff;
  font: inherit;
}
.catalogue-filters .btn-go {
  border: 0;
  border-radius: 10px;
  padding: .75rem 1.1rem;
  background: #1f4d3a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.section-title {
  font-family: Fraunces, serif;
  font-size: 1.35rem;
  margin: 0 0 1rem;
  color: #14201a;
}
.empty { text-align: center; padding: 3rem 1rem; color: #5c6b63; }
.alert-ok {
  background: #e8f1ec;
  color: #1f4d3a;
  border-radius: 10px;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
}

.home-books { padding: 0 0 4.5rem; }
.home-book-grid,
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.6rem 1.25rem;
  margin-top: 1.25rem;
}

.home-book-card,
.book-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  transition: none;
}
.home-book-card:hover,
.book-card:hover { transform: none; box-shadow: none; }

.home-book-card .cover-wrap,
.book-card .cover-wrap { margin-bottom: 14px; }

.home-book-body,
.book-body { padding: 0 .15rem; }
.home-book-body h3,
.book-body h3 {
  margin: 0 0 .35rem;
  font-size: 1rem;
  line-height: 1.35;
  font-family: Fraunces, serif;
  font-weight: 600;
}
.home-book-body .meta,
.book-body .author {
  color: var(--ink-soft, #5c6b63);
  font-size: .84rem;
}

.access-book-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: .75rem;
  padding: .55rem .95rem;
  border-radius: 999px;
  background: var(--navy-950, #0f2647);
  color: #fff !important;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  width: fit-content;
  transition: background .2s ease, transform .2s ease;
}
.access-book-btn:hover {
  background: var(--magenta, #d81b72);
  transform: translateY(-1px);
}
.access-book-btn.free {
  background: #1f4d3a;
}

.badge-row,
.book-body .tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .55rem;
  align-items: center;
}
.badge-pill,
.tag {
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .5rem;
  border-radius: 999px;
  background: #f0ece2;
  color: #314039;
}
.badge-pill.free,
.tag.free { background: #e5f4ea; color: #1f4d3a; }

/* Book show masthead */
.book-masthead {
  position: relative;
  background:
    radial-gradient(ellipse 800px 420px at 12% -10%, rgba(42,107,82,.28), transparent 60%),
    radial-gradient(ellipse 700px 480px at 110% 10%, rgba(196,163,90,.18), transparent 55%),
    linear-gradient(160deg, var(--navy-950) 0%, var(--navy-900) 52%, var(--navy-800) 100%);
  color: var(--paper);
  padding: 130px 0 70px;
  overflow: hidden;
}
.book-masthead::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(247,243,234,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247,243,234,.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black, transparent);
  pointer-events: none;
}
.book-masthead-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, .75fr);
  gap: 48px;
  align-items: center;
}
.book-masthead .eyebrow { color: var(--gold-light); margin-bottom: 16px; }
.book-masthead h1 {
  font-size: clamp(1.85rem, 3.4vw, 2.85rem);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 12px;
}
.book-masthead .byline {
  color: rgba(247,243,234,.72);
  margin-bottom: 1.1rem;
  font-size: 1.02rem;
}
.book-masthead .pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: 1.4rem;
}
.book-masthead .pill {
  font-size: .74rem;
  font-weight: 600;
  padding: .32rem .7rem;
  border-radius: 999px;
  background: rgba(247,243,234,.1);
  border: 1px solid rgba(247,243,234,.16);
  color: var(--paper);
}
.book-masthead .pill.free {
  background: rgba(42,107,82,.35);
  border-color: rgba(184,224,200,.35);
}
.book-masthead-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.25rem;
}
.book-masthead-ctas .btn-read,
.book-masthead-ctas .btn-ghost-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .85rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.book-masthead-ctas .btn-read {
  background: var(--gold);
  color: var(--navy-950);
}
.book-masthead-ctas .btn-ghost-light {
  background: transparent;
  color: var(--paper);
  border: 1.5px solid rgba(247,243,234,.35);
}
.book-masthead-visual {
  display: flex;
  justify-content: center;
}
.book-masthead-visual .cover-wrap {
  width: min(260px, 72vw);
  margin: 0;
}
.book-masthead-visual .cover {
  transform: rotateY(-8deg) rotateX(2deg);
}
.book-masthead-visual .cover-wrap:hover .cover {
  transform: rotateY(0deg) rotateX(0deg);
}
.book-show-body {
  padding: 2.5rem 0 4rem;
  background: linear-gradient(180deg, #f7f3ea 0%, #fff 40%);
}
.book-show-wrap { width: min(980px, 92%); margin: 0 auto; }
.book-show-body .desc {
  line-height: 1.75;
  color: #314039;
  font-size: 1.02rem;
  max-width: 68ch;
}
.book-show-note {
  margin-top: 1.25rem;
  color: #5c6b63;
  font-size: .9rem;
}
.alert-err {
  background: #fde8e8;
  color: #8a1f1f;
  border-radius: 10px;
  padding: .8rem 1rem;
  margin-bottom: 1rem;
}
.related { margin-top: 3rem; }
.related h2 {
  font-family: Fraunces, serif;
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

/* Student login modal */
.student-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(10, 16, 14, .62);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 1.25rem;
}
.student-login-overlay[hidden] { display: none !important; }
.student-login-modal {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 1.75rem 1.5rem 1.4rem;
  position: relative;
  box-shadow: 0 28px 70px rgba(0,0,0,.28);
  color: #14201a;
}
.student-login-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  color: #5c6b63;
}
.student-login-brand {
  font-family: Fraunces, serif;
  font-weight: 700;
  color: #1f4d3a;
  margin-bottom: .35rem;
}
.student-login-modal h2 {
  margin: 0 0 .4rem;
  font-size: 1.35rem;
  font-family: Fraunces, serif;
}
.student-login-lead {
  margin: 0 0 1.1rem;
  color: #5c6b63;
  font-size: .92rem;
  line-height: 1.5;
}
.student-login-error {
  background: #fde8e8;
  color: #8a1f1f;
  border-radius: 10px;
  padding: .7rem .85rem;
  margin-bottom: .9rem;
  font-size: .88rem;
}
.student-login-modal label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: .35rem;
}
.student-login-modal input[type="text"],
.student-login-modal input[type="password"] {
  width: 100%;
  padding: .8rem .9rem;
  border: 1px solid rgba(20,32,26,.14);
  border-radius: 10px;
  margin-bottom: .85rem;
  font: inherit;
}
.student-login-remember {
  display: flex !important;
  align-items: center;
  gap: .45rem;
  font-weight: 500 !important;
  margin-bottom: 1rem !important;
}
.student-login-submit {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: .9rem 1.1rem;
  background: #1f4d3a;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.student-login-submit:disabled { opacity: .65; cursor: wait; }
.student-login-foot {
  text-align: center;
  margin: 1rem 0 0;
  font-size: .86rem;
}
.student-login-foot a { color: #1f4d3a; font-weight: 600; text-decoration: none; }

@media (max-width: 900px) {
  .book-masthead { padding: 110px 0 48px; }
  .book-masthead-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
  .book-masthead-visual { order: -1; }
  .book-masthead .pill-row,
  .book-masthead-ctas { justify-content: center; }
  .book-masthead .byline { margin-left: auto; margin-right: auto; }
  .book-masthead-visual .cover {
    transform: rotateY(0deg);
  }
  .catalogue-masthead { padding: 28px 0 48px; }
  .catalogue-masthead-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    text-align: center;
  }
  .catalogue-visual { order: -1; min-height: 240px; }
  .catalogue-copy .lede { margin-left: auto; margin-right: auto; }
  .catalogue-ctas { justify-content: center; }
  .catalogue-stats { margin-left: auto; margin-right: auto; max-width: 360px; text-align: left; }
  .catalogue-filters { grid-template-columns: 1fr 1fr; }
  .home-book-grid,
  .book-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

/* Header student login button */
.btn-student-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1f4d3a;
  color: #f7f3ea !important;
  border: 1px solid rgba(247,243,234,.12);
  border-radius: 11px;
  padding: .62em 1.15em;
  font-size: .84rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .2s ease, transform .2s ease;
}
.btn-student-login:hover {
  background: #2a6b52;
  transform: translateY(-1px);
  color: #fff !important;
}
.btn-student-login .login-short { display: none; }

/* Homepage hero — full-width slider layout */
.hero-bookstore {
  padding-top: 96px;
}
.hero-bookstore .hero-slider-layout {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding-bottom: 64px;
  gap: 28px;
}
.hero-bookstore .hero-slider,
.hero-bookstore .hero-slider-full {
  width: 100%;
  max-width: none;
}
.hero-bookstore .hero-slider-track {
  min-height: 0;
  height: clamp(320px, 52vw, 520px);
}
.hero-bookstore .hero-slide {
  display: block;
}
.hero-bookstore .hero-slide-media {
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  box-shadow: none;
}
.hero-bookstore .hero-slide-cover {
  width: min(220px, 36%);
  margin: 0;
  position: absolute;
  right: max(6%, calc((100% - var(--wrap-max, 1120px)) / 2 + 2rem));
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.hero-bookstore .hero-slide-fallback {
  padding: 48px max(6%, calc((100% - 1120px) / 2 + 1.5rem));
  justify-content: center;
}
.hero-bookstore .hero-slide-caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 0 0 48px;
  background: linear-gradient(90deg, rgba(8,14,18,.78) 0%, rgba(8,14,18,.45) 48%, rgba(8,14,18,.18) 100%);
  z-index: 3;
  color: #f7f3ea;
}
.hero-bookstore .hero-slide-caption-inner {
  max-width: 560px;
  text-align: left;
}
.hero-bookstore .hero-slide-caption h3 {
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  margin-bottom: 10px;
}
.hero-bookstore .hero-slide-caption p {
  font-size: 1rem;
  max-width: 42ch;
  color: rgba(247,243,234,.78);
}
.hero-bookstore .hero-slider-nav {
  margin-top: 16px;
  width: min(1120px, 92%);
  margin-left: auto;
  margin-right: auto;
}
.hero-bookstore .hero-below {
  width: min(1120px, 92%);
  margin: 0 auto;
  text-align: center;
}
.hero-bookstore .hero-ctas {
  justify-content: center;
  margin-bottom: 28px;
}
.hero-bookstore .stat-row {
  margin: 0 auto;
  max-width: 520px;
  grid-template-columns: repeat(3, 1fr);
  text-align: left;
}

/* Homepage hero slider base */
.hero-slider {
  width: 100%;
  position: relative;
}
.hero-slider-track {
  position: relative;
  min-height: 460px;
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.98);
  transition: opacity .45s ease, transform .45s ease, visibility .45s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  z-index: 2;
}
.hero-slide-media {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background:
    linear-gradient(160deg, rgba(247,243,234,.08), rgba(247,243,234,.02)),
    rgba(15, 38, 28, .35);
  border: 1px solid rgba(247,243,234,.12);
  box-shadow: 0 24px 50px rgba(0,0,0,.28);
}
.hero-slide-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-slide-cover {
  width: 72%;
  margin: 8% auto 0;
}
.hero-slide-cover .cover-wrap { margin: 0; }
.hero-slide-fallback {
  height: 100%;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    radial-gradient(circle at 20% 15%, rgba(196,163,90,.28), transparent 45%),
    linear-gradient(160deg, #1f4d3a 0%, #0f2647 100%);
  color: #f7f3ea;
}
.hero-slide-crest {
  width: 54px;
  height: 54px;
  object-fit: contain;
  margin-bottom: auto;
  border-radius: 10px;
  background: rgba(255,255,255,.12);
  padding: 6px;
}
.hero-slide-kicker {
  font-family: 'IBM Plex Mono', monospace;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 8px;
}
.hero-slide-title {
  font-family: Fraunces, serif;
  font-size: 1.55rem;
  line-height: 1.2;
  font-weight: 600;
}
.hero-slide-caption .hero-slide-sub {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 6px;
}
.hero-slide-caption h3 {
  margin: 0 0 6px;
  font-family: Fraunces, serif;
  font-size: 1.15rem;
  line-height: 1.3;
  color: #fff;
}
.hero-slide-caption p {
  margin: 0 0 12px;
  font-size: .88rem;
  line-height: 1.5;
  color: rgba(247,243,234,.68);
}
.hero-slide-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: #1f4d3a;
  color: #f7f3ea !important;
  border: 1px solid rgba(247,243,234,.14);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
}
.hero-slide-btn:hover { background: #2a6b52; }
.hero-slider-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.hero-slider-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(247,243,234,.2);
  background: rgba(247,243,234,.06);
  color: #f7f3ea;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}
.hero-slider-arrow:hover { background: rgba(247,243,234,.14); }
.hero-slider-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 0;
  padding: 0;
  background: rgba(247,243,234,.28);
  cursor: pointer;
  transition: width .25s ease, background .25s ease;
}
.hero-dot.is-active {
  width: 22px;
  background: var(--gold-light, #c4a35a);
}

@media (max-width: 900px) {
  .header-actions .btn-student-login {
    padding: 0.38em 0.72em;
    font-size: 1.2rem;
    letter-spacing: .01em;
  }
  .header-actions .btn-student-login .login-full { display: none; }
  .header-actions .btn-student-login .login-short { display: inline; }
  .hero-slider { width: 100%; margin: 0 auto; }
  .hero-slider-track { min-height: 0; }
  .hero-bookstore { padding-top: 88px; }
  .hero-bookstore .hero-slider-track { height: clamp(280px, 68vw, 420px); }
  .hero-bookstore .hero-slider-layout { padding-bottom: 48px; gap: 22px; }
  .hero-bookstore .hero-slide-cover { display: none; }
  .hero-bookstore .hero-slide-caption { padding-bottom: 28px; background: linear-gradient(180deg, transparent 20%, rgba(8,14,18,.82) 100%); }
  .hero-bookstore .hero-slide-caption h3 { font-size: 1.45rem; }
}

/* Ensure button CTAs match link buttons */
button.btn {
  font: inherit;
  cursor: pointer;
}
button.btn-ghost {
  background: transparent;
  color: var(--paper);
  border: 1.5px solid rgba(247,243,234,.35);
  border-radius: 999px;
  padding: .85rem 1.35rem;
  font-weight: 600;
}

@media (max-width: 560px) {
  .book-masthead h1 { font-size: 1.55rem; }
  .book-masthead-ctas .btn-read,
  .book-masthead-ctas .btn-ghost-light { width: 100%; }
  .access-book-btn { width: 100%; }
  .catalogue-filters { grid-template-columns: 1fr; }
  .catalogue-ctas .btn { width: 100%; }
  .catalogue-stack { height: 280px; }
  .hero-slider-track { min-height: 0; }
  .hero-bookstore .hero-slider-track { height: 260px; }
}
