/* ============================================================
   मुद्राक्षरविद्या — book page  (palette derived from the cover)
   ============================================================ */
:root {
  --red:       #E33E54;   /* cover red — title panel, accents */
  --red-deep:  #C62742;   /* CTA / links / hover (better contrast) */
  --red-dark:  #A81F37;
  --red-tint:  #FCEBEE;
  --ink:       #2A2622;   /* headings — soft dark, not pure black */
  --body:      #4C463F;   /* body text */
  --muted:     #837B72;   /* author name, meta — grey */
  --line:      #E7E1D8;
  --bg:        #F2F2F2;   /* 5% grey page */
  --bg-warm:   #F6F2EC;   /* warm off-white */

  --serif: 'Noto Serif Devanagari', serif;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--serif);
  background: var(--bg); color: var(--body);
  line-height: 1.85; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.page { overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: var(--red-deep); text-decoration: none; }
a:hover { color: var(--red-dark); text-decoration: underline; }

/* ─────────── HERO ─────────── */
.hero {
  display: grid;
  /* col 1 = gutter matching .info's text left edge (1040px centered box + 6vw padding),
     so the carousel image's left edge lines up with the paragraphs below */
  grid-template-columns: max(6vw, calc((100% - 1040px) / 2 + 6vw)) minmax(0, 1.08fr) minmax(0, 0.92fr);
  padding-top: clamp(24px, 4vh, 60px);
  max-width: 1440px; margin: 0 auto;   /* keeps the two columns together on wide monitors */
}
.carousel-wrap { grid-column: 2; }
.book-info { grid-column: 3; }

/* Carousel — all slides share the same 1400×940 ratio, so the image fills the column
   width and drives the carousel's height (no fixed frame, no leftover side space) */
.carousel-wrap { position: relative; display: flex; flex-direction: column; }
.carousel-track { flex: 1; position: relative; overflow: hidden; }
.carousel-slides { display: flex; transition: transform .55s cubic-bezier(.4,0,.2,1); }
.carousel-slide {
  min-width: 100%;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 26px clamp(20px, 3%, 36px);
}
.carousel-slide img {
  width: 100%; height: auto; aspect-ratio: 1400 / 940;  /* sized before load — no layout shift */
  cursor: zoom-in; border-radius: 4px;
  transition: transform .35s ease; user-select: none; -webkit-user-drag: none;
}
@media (min-width: 901px) {
  /* two-column layout: image spans the full column — left edge on the paragraph rail,
     right edge where the book-info column begins */
  .carousel-slide { padding: 26px 0; }
}
@media (hover: hover) {
  .carousel-slide img:hover { transform: scale(1.015); }  /* real-hover devices only — avoids sticky zoom after tap on touch */
}

.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; color: var(--muted); border: none;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color .2s, background .2s; z-index: 10;
}
.carousel-btn:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.carousel-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }
@media (min-width: 901px) {
  /* both arrows 8px outside the image edges — symmetric */
  .carousel-btn.prev { left: -52px; }
  .carousel-btn.next { right: -52px; }
}
.carousel-dots { display: flex; justify-content: center; gap: 0; padding: 10px 0 16px; }
.dot {
  /* 7px visual dot inside a 23px tap target (transparent border enlarges the hit area) */
  box-sizing: content-box; width: 7px; height: 7px; border-radius: 50%; background: rgba(0,0,0,.18);
  background-clip: padding-box; border: 8px solid transparent;
  cursor: pointer; padding: 0; transition: background .25s;
}
.dot:focus-visible { outline: 2px solid var(--red); }
.dot.active { background-color: var(--red); }  /* -color: the shorthand would reset background-clip and fill the tap ring too */

/* Book info */
.book-info {
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: 26px clamp(34px, 5vw, 64px);
}
@media (min-width: 901px) {
  .book-info { padding-left: 68px; }  /* just clears the right arrow — text sits close to the image */
}
.title-panel { margin-bottom: 2px; }   /* integrated into the page — no box */
.title-art { display: block; width: 290px; max-width: 100%; height: auto; }  /* Logo.svg, recoloured to ink */
.title-sub {
  /* sized to the cover's title:subtitle ratio (~0.26 of the title height) */
  color: var(--body); font-family: var(--serif); font-weight: 600; font-size: 25px; line-height: 1.12; margin-top: 13px;
}
.author { font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--muted); margin-top: 24px; }
.lede { font-size: 17px; line-height: 1.8; color: var(--body); margin-top: 12px; max-width: 42ch; }

.purchase { margin-top: 32px; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.price-wrap { display: flex; flex-direction: column; }
.price { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.price-note { font-family: var(--serif); font-size: 13px; color: var(--muted); margin-top: 3px; }
.cta {
  background: var(--red-deep); color: #fff; font-family: var(--serif); font-weight: 600; font-size: 16px;
  padding: 14px 32px; border-radius: 6px;
  box-shadow: 0 4px 16px rgba(198,39,66,.26); transition: background .2s, transform .15s, box-shadow .2s;
}
.cta:hover { background: var(--red-dark); color: #fff; text-decoration: none; transform: translateY(-2px); box-shadow: 0 7px 22px rgba(198,39,66,.34); }
.cta:focus-visible { outline: 2px solid var(--red-dark); outline-offset: 3px; }

/* ─────────── INFO TABS / ACCORDION ─────────── */
.info { max-width: 1040px; margin: 0 auto; padding: clamp(28px, 3.5vw, 48px) 6vw clamp(46px, 6.5vw, 84px); }
.info-tabs {
  display: grid;
  grid-template-columns: repeat(3, max-content) 1fr;
  column-gap: 30px;
}
.info-tabs::before {                       /* full-width baseline under tabs */
  content: ""; grid-row: 1; grid-column: 1 / -1; align-self: end;
  height: 1px; background: var(--line);
}
.info-tabs > .tab {
  grid-row: 1; appearance: none; background: none; border: none; cursor: pointer;
  font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--muted);
  padding: 0 0 16px; border-bottom: 2px solid transparent; position: relative; z-index: 1;
  transition: color .2s;
}
.info-tabs > .tab:nth-of-type(1) { grid-column: 1; }
.info-tabs > .tab:nth-of-type(2) { grid-column: 2; }
.info-tabs > .tab:nth-of-type(3) { grid-column: 3; }
.info-tabs > .tab:hover { color: var(--ink); }
.info-tabs > .tab.active { color: var(--ink); border-bottom-color: var(--red); }
.info-tabs > .tab:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; }

.info-tabs > .panel { grid-row: 2; grid-column: 1 / -1; display: none; padding-top: 34px; }
.info-tabs > .panel.active { display: block; }

.prose p { font-size: 16.5px; line-height: 1.95; color: var(--body); margin-bottom: 16px; max-width: 72ch; }
.prose p:last-child { margin-bottom: 0; }
.prose .scope { font-size: 15px; color: var(--muted); }
.prose .hint { color: var(--muted); }

.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 4vw, 58px); align-items: start; }
.spec > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.spec dt { font-family: var(--serif); font-size: 14px; color: var(--muted); }
.spec dd { font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--ink); text-align: right; }
.spec dd small { font-weight: 400; color: var(--muted); font-family: var(--serif); font-size: 12px; }
.pub p { font-size: 14.5px; line-height: 1.78; color: var(--body); margin-bottom: 12px; }
.pub-head { font-family: var(--serif); font-size: 11px; color: var(--red); margin-bottom: 8px; }
.pub strong { color: var(--ink); font-weight: 600; }
.pub-meta { color: var(--muted); font-size: 13px; }

/* ─────────── PUBLISHER LOGO STRIP ─────────── */
.credits {
  margin-top: clamp(40px, 6vw, 70px); padding-top: 30px; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; gap: 34px; flex-wrap: wrap;
}
.credit { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.credit-label { font-family: var(--serif); font-size: 11px; color: var(--muted); }
.credit-name { font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--ink); }
.credit-logo { height: 42px; width: auto; }
.credit-sep { width: 1px; height: 36px; background: var(--line); }

/* ─────────── LIGHTBOX ─────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(26,21,18,.93);
  display: none; align-items: center; justify-content: center; padding: 4vh 4vw;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 92vh; object-fit: contain; border-radius: 6px; box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.lightbox-close { position: absolute; top: 18px; right: 26px; font-size: 40px; line-height: 1; color: #fff; background: none; border: none; cursor: pointer; }
.lightbox-close:hover { color: var(--red); }

/* ─────────── RESPONSIVE ─────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .carousel-wrap, .book-info { grid-column: 1; }
  .book-info { align-items: flex-start; }
}
@media (max-width: 768px) {
  /* tabs → accordion */
  .info-tabs { display: block; }
  .info-tabs::before { display: none; }
  .info-tabs > .tab {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: 16px 2px; border-top: none; border-bottom: 1px solid var(--line); font-size: 19px; font-weight: 700;
  }
  .info-tabs > .tab::after { content: "+"; font-weight: 400; font-size: 24px; color: var(--muted); line-height: 1; }
  .info-tabs > .tab.active { color: var(--ink); border-bottom-color: var(--red); }
  .info-tabs > .tab.active::after { content: "\2013"; color: var(--red); }
  .info-tabs > .panel { padding: 10px 2px 26px; }
  .details-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 560px) {
  .carousel-slide { padding: 26px 20px; }
  .title-art { width: 220px; }
  .title-sub { font-size: 19px; }
  .purchase { gap: 18px; }
  .price { font-size: 27px; }
  .credits { gap: 22px; }
  .credit-sep { display: none; }
}
