/* =========================================================
   MICA EDUCO PUBLISHERS — BOOKS PUBLICATION PAGE
   Editorial, typographic, Awwwards-inspired layout
   ========================================================= */

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Hero Band (clean light editorial matching Soft Solution) ---------- */
.pub-hero {
  background:
    radial-gradient(ellipse 50% 60% at 85% 30%, #EEF2FF 0%, transparent 70%),
    radial-gradient(ellipse 40% 50% at 10% 100%, #E9F8FA 0%, transparent 70%),
    #fff;
  color: var(--ink);
  min-height: calc(100vh - 76px);
  display: flex;
  align-items: center;
  padding: clamp(24px, 3.5vh, 40px) 0;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.pub-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.pub-kicker {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}
.pub-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 3.8vw, 3.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.035em;
  max-width: 17ch;
  color: var(--ink);
}
.pub-hero .pub-lede {
  margin: 0 0 22px;
  font-size: clamp(0.96rem, 1.15vw, 1.08rem);
  line-height: 1.6;
  color: var(--slate);
  max-width: 48ch;
}
.pub-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}
.pub-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--slate);
}
.pub-hero-meta span b {
  color: var(--ink);
  font-weight: 800;
  margin-right: 4px;
}

/* Interactive 3D Fanned Book Showcase */
.hero-stage {
  position: relative;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
}
.stage-book {
  position: absolute;
  width: 195px;
  aspect-ratio: 3 / 4;
  border-radius: 6px 14px 14px 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  padding: 0;
  cursor: pointer;
  background: #fff;
  box-shadow:
    -6px 0 0 rgba(15, 23, 42, 0.08) inset,
    0 24px 48px -14px rgba(15, 23, 42, 0.25);
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, z-index 0s;
}
.stage-book::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 14px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(255, 255, 255, 0.2) 45%, transparent);
  pointer-events: none;
  z-index: 3;
}
.stage-book img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sb-front {
  z-index: 3;
  transform: translate3d(0, 0, 30px) rotate(-1.5deg);
}
.sb-back-left {
  z-index: 1;
  transform: translate3d(-105px, 18px, -40px) rotate(-12deg) scale(0.92);
  opacity: 0.9;
}
.sb-back-right {
  z-index: 2;
  transform: translate3d(105px, 14px, -20px) rotate(11deg) scale(0.94);
  opacity: 0.94;
}
.hero-stage:hover .sb-back-left {
  transform: translate3d(-140px, 10px, -20px) rotate(-16deg) scale(0.95);
}
.hero-stage:hover .sb-back-right {
  transform: translate3d(140px, 8px, -10px) rotate(15deg) scale(0.96);
}
.hero-stage:hover .sb-front {
  transform: translate3d(0, -10px, 50px) rotate(0deg) scale(1.03);
}
.stage-book:hover {
  box-shadow: 0 34px 64px -12px rgba(47, 91, 255, 0.45);
}

/* ---------- Editorial Story & Features ---------- */
.pub-story {
  padding: clamp(68px, 8vw, 112px) 0;
  border-bottom: 1px solid var(--line);
}
.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: clamp(36px, 6vw, 84px);
  align-items: start;
}
.story-copy {
  position: sticky;
  top: 100px;
}
.section-eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 12px;
}
.story-copy h2 {
  font-size: clamp(1.85rem, 3vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 22px;
  color: var(--ink);
}
.story-copy p {
  margin: 0 0 16px;
  color: var(--slate);
  font-size: 1.02rem;
  line-height: 1.7;
}
.story-copy p strong {
  color: var(--ink);
}

/* Numbered Editorial Feature List (No Icon Clutter) */
.feature-ledger {
  border-top: 1px solid var(--ink);
}
.ledger-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 16px;
  padding: 20px 8px;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.25s ease, padding-left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.ledger-row:hover {
  background: var(--soft);
  padding-left: 16px;
}
.ledger-num {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 0.04em;
  padding-top: 2px;
}
.ledger-text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}

/* ---------- Catalogue & Filter Bar ---------- */
.pub-catalogue {
  padding: clamp(68px, 8vw, 112px) 0;
  background: var(--soft);
}
.cat-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
}
.cat-head h2 {
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.cat-count {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--slate);
}
.cat-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 28px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--line);
}
.filter-tab {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--slate);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.filter-tab:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.filter-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* Book Grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 30px);
}
.book-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.book-card.is-hidden {
  display: none;
}
.book-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px 12px 12px 6px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow:
    -4px 0 0 rgba(15, 23, 42, 0.06) inset,
    0 14px 28px -14px rgba(15, 23, 42, 0.22);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
/* Book spine sheen */
.book-cover-wrap::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.16), rgba(255, 255, 255, 0.18) 45%, transparent);
  pointer-events: none;
  z-index: 2;
}
.book-card:hover .book-cover-wrap {
  transform: translateY(-8px) scale(1.015);
  box-shadow:
    0 24px 44px -16px rgba(15, 23, 42, 0.32);
}
.book-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

/* Typographic Fallback Cover (renders cleanly if cover photo is missing) */
.book-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 20px 20px 26px;
  background: linear-gradient(155deg, #0b1536, #192b66);
  color: #fff;
}
.book-fallback[data-series="ai"] { background: linear-gradient(155deg, #1b1464, #4f46e5); }
.book-fallback[data-series="composite"] { background: linear-gradient(155deg, #064e3b, #0d9488); }
.book-fallback[data-series="branding"] { background: linear-gradient(155deg, #7c2d12, #ea580c); }
.book-fallback[data-series="application"] { background: linear-gradient(155deg, #1e293b, #334155); }
.book-fallback[data-series="it402"] { background: linear-gradient(155deg, #4c1d95, #7c3aed); }

.bf-imprint {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.72;
}
.bf-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 12px 0 auto;
}
.bf-class {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  padding-top: 12px;
}

.book-meta {
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.book-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.book-card:hover .book-title {
  color: var(--brand);
}
.book-series-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--slate);
  flex: none;
}

/* ---------- Lightbox Modal ---------- */
.book-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(6, 12, 34, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.book-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}
.book-modal {
  width: 100%;
  max-width: 820px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 320px 1fr;
  box-shadow: 0 32px 72px -18px rgba(0, 0, 0, 0.45);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.book-modal-backdrop.open .book-modal {
  transform: none;
}
.book-modal-media {
  background: var(--soft);
  padding: 28px;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
}
.book-modal-media img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 18px 36px -14px rgba(15, 23, 42, 0.28);
}
.book-modal-body {
  padding: clamp(24px, 4vw, 40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.book-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.book-modal-close:hover {
  border-color: var(--ink);
  background: var(--soft);
}
.bm-series {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand);
  margin-bottom: 8px;
}
.bm-title {
  margin: 0 0 14px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.bm-desc {
  margin: 0 0 24px;
  color: var(--slate);
  font-size: 0.98rem;
  line-height: 1.65;
}
.bm-specs {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 0.88rem;
}
.bm-specs div span {
  display: block;
  color: var(--slate);
  font-size: 0.8rem;
}
.bm-specs div strong {
  color: var(--ink);
}

/* ---------- Specimen Request Form ---------- */
.pub-specimen {
  padding: clamp(68px, 8vw, 112px) 0;
  background: #fff;
}
.specimen-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(32px, 5vw, 68px);
  align-items: start;
}
.specimen-copy h2 {
  margin: 0 0 16px;
  font-size: clamp(1.9rem, 3.2vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
}
.specimen-copy p {
  margin: 0 0 24px;
  color: var(--slate);
  font-size: 1.04rem;
  line-height: 1.65;
}
.specimen-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  background: var(--soft);
  padding: clamp(22px, 3vw, 34px);
  border-radius: 18px;
  border: 1px solid var(--line);
}
.specimen-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.specimen-form .field.full {
  grid-column: 1 / -1;
}
.specimen-form label {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
}
.specimen-form input,
.specimen-form select,
.specimen-form textarea {
  font: inherit;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 0.96rem;
}
.specimen-form input:focus,
.specimen-form select:focus,
.specimen-form textarea:focus {
  outline: none;
  border-color: var(--brand);
}
.specimen-note {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand);
}

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .pub-hero-grid,
  .story-grid,
  .specimen-grid {
    grid-template-columns: 1fr;
  }
  .story-copy {
    position: static;
  }
  .book-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .hero-stage {
    height: 310px;
  }
  .stage-book {
    width: 155px;
  }
  .sb-back-left {
    transform: translate3d(-72px, 12px, -30px) rotate(-11deg) scale(0.9);
  }
  .sb-back-right {
    transform: translate3d(72px, 10px, -20px) rotate(10deg) scale(0.92);
  }
  .book-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .book-modal {
    grid-template-columns: 1fr;
  }
  .book-modal-media {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 20px;
  }
  .book-modal-media img {
    max-height: 240px;
  }
  .specimen-form {
    grid-template-columns: 1fr;
  }
}
