/* home.css - Option A Bookshop Homepage
   Scoped specifically to body.bookshop-home to prevent global style leakage.
   Other pages continue using style.css / books.css untouched.
*/

body.bookshop-home {
  --bookshop-paper: #fffdf7;
  --bookshop-ink: #163c32;
  --bookshop-muted: #143329;
  --bookshop-line: #d7dfd4;
  --bookshop-soft: #eff3e9;
  --bookshop-saffron: #fbebd0;
  --bookshop-wine: #59272d;
  --bookshop-green-dark: #143d31;
  --bookshop-action-math: #143d31;
  --bookshop-action-math-hover: #0e2a22;
  --bookshop-action-eng: #5c2d30;
  --bookshop-action-eng-hover: #432123;
  --bookshop-focus: #bd782a;
}

body.bookshop-home {
  margin: 0;
  padding: 0;
  background-color: var(--bookshop-paper);
  color: var(--bookshop-ink);
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

/* Skip link */
body.bookshop-home .skip {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--bookshop-green-dark);
  color: #fff9e8;
  padding: 12px 18px;
  font-weight: 600;
  z-index: 10000;
  border-radius: 4px;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: top 0.15s ease;
}

body.bookshop-home .skip:focus {
  top: 16px;
  outline: 3px solid var(--bookshop-focus);
}

/* Accessible focus styling */
body.bookshop-home a:focus-visible,
body.bookshop-home button:focus-visible {
  outline: 3px solid var(--bookshop-focus);
  outline-offset: 3px;
}

/* Green slim topline - removed per user request */
body.bookshop-home .topline,
.topline {
  display: none !important;
}

/* Bookshop header */
body.bookshop-home header {
  background: var(--bookshop-paper);
  color: var(--bookshop-ink);
  border-bottom: 1px solid var(--bookshop-line);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 100%;
  margin: 0 auto;
}

body.bookshop-home .brand {
  color: var(--bookshop-ink);
  text-decoration: none;
  font-size: 23px;
  letter-spacing: 1px;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  flex-direction: row !important;
  align-items: center !important;
  min-height: 44px;
}

body.bookshop-home .brand small {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.3px;
  font-weight: 400;
  color: var(--bookshop-muted);
  margin-top: 3px;
}

body.bookshop-home header nav {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
}

body.bookshop-home header nav a {
  padding: 10px 4px;
  color: var(--bookshop-ink);
  font-size: 13px;
  text-decoration: none;
  font-weight: 500;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

body.bookshop-home header nav a:hover {
  color: var(--bookshop-green-dark);
  border-bottom-color: var(--bookshop-line);
}

body.bookshop-home header nav a.nav-active {
  border-bottom-color: currentColor;
  font-weight: 700;
}

/* Main Container */
body.bookshop-home main {
  max-width: 1200px;
  margin: 0 auto;
}

/* Compact Intro Section */
body.bookshop-home .intro {
  padding: 28px 30px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

body.bookshop-home .intro .kicker {
  font-size: 10.5px;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  margin: 0 0 9px;
  font-weight: 600;
  color: var(--bookshop-muted);
}

body.bookshop-home .intro h1 {
  font-family: Georgia, serif;
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: -0.8px;
  margin: 0 0 8px;
  color: var(--bookshop-ink);
  font-weight: 600;
}

body.bookshop-home .intro .sub {
  font-size: 16px;
  line-height: 1.55;
  color: #143d31;
  font-weight: 500;
  margin: 0;
}

body.bookshop-home .intro .small-link {
  color: var(--bookshop-ink);
  text-decoration: none;
  font-size: 12.5px;
  white-space: nowrap;
  font-weight: 600;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

body.bookshop-home .intro .small-link:hover {
  border-bottom-color: var(--bookshop-ink);
}

/* Shelf & Product Cards Grid */
/* ========================================================
   OPTION 2: THE 4-PILLAR HORIZONTAL BOOK SHELF
   All 4 books side-by-side in a single row on desktop:
   Mathematics, English, General Knowledge, and Akshara Setu.
   Total desktop height: ~310px. Zero clunky tabs.
   ======================================================== */

body.bookshop-home .book-shelf-4-section,
body.bookshop-home .shelf {
  padding: 0 28px 24px;
  max-width: 1140px;
  margin: 0 auto;
  position: relative;
  display: block;
}

body.bookshop-home .anchor-target {
  position: absolute;
  top: -24px;
  left: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* 4-Pillar Grid */
body.bookshop-home .book-shelf-4-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: stretch;
}

/* Individual Book Column Card */
body.bookshop-home .book-card-col {
  background: #ffffff;
  border: 1px solid var(--bookshop-line);
  border-radius: 8px;
  padding: 16px 14px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  box-sizing: border-box;
}

body.bookshop-home .book-card-col:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

/* Subject Accent Top Borders */
body.bookshop-home .book-card-col.theme-math {
  border-top: 3px solid #143d31;
}

body.bookshop-home .book-card-col.theme-english {
  border-top: 3px solid #59272d;
}

body.bookshop-home .book-card-col.theme-gk {
  border-top: 3px solid #b45309;
}

body.bookshop-home .book-card-col.theme-akshara {
  border-top: 3px solid #047857;
}

/* Cover Wrapper */
body.bookshop-home .book-card-cover {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

body.bookshop-home .book-card-cover a {
  display: inline-block;
  line-height: 0;
  transition: transform 0.18s ease;
}

body.bookshop-home .book-card-cover a:hover {
  transform: scale(1.03);
}

body.bookshop-home .book-card-cover img {
  height: 155px !important;
  width: auto !important;
  max-width: 100% !important;
  object-fit: contain !important;
  border-radius: 4px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.16));
}

/* Content Container */
body.bookshop-home .book-card-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  width: 100%;
  align-items: center;
}

body.bookshop-home .book-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 8px;
}

body.bookshop-home .theme-math .book-badge {
  background: #e3ede7;
  color: #143d31;
}

body.bookshop-home .theme-english .book-badge {
  background: #fae8eb;
  color: #59272d;
}

body.bookshop-home .theme-gk .book-badge {
  background: #fef3c7;
  color: #92400e;
}

body.bookshop-home .theme-akshara .book-badge {
  background: #d1fae5;
  color: #065f46;
}

body.bookshop-home .book-title {
  font-family: Georgia, serif;
  font-size: 18px;
  line-height: 1.25;
  margin: 0 0 8px;
  color: #0c261e;
  font-weight: 700;
}

body.bookshop-home .book-title a {
  color: inherit;
  text-decoration: none;
}

body.bookshop-home .book-title a:hover {
  color: var(--bookshop-green-dark);
}

body.bookshop-home .book-tagline {
  font-size: 15.5px;
  line-height: 1.45;
  color: #0c261e;
  font-weight: 600;
  margin: 0 0 14px;
  min-height: 48px;
}

/* Action Buttons */
body.bookshop-home .book-links {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

body.bookshop-home .btn-read {
  background: #f59e0b;
  color: #111827;
  border: 1px solid #d97706;
  font-size: 13.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  box-sizing: border-box;
  transition: all 0.15s ease;
}

body.bookshop-home .btn-read:hover {
  background: #d97706;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3);
}

body.bookshop-home .btn-subtle {
  color: #143d31;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #f4f7f2;
  border: 1px solid #c2d4c8;
  border-radius: 6px;
  min-height: 36px;
  transition: all 0.15s ease;
}

body.bookshop-home .btn-subtle:hover {
  background: #e7efe4;
  border-color: #143d31;
  color: #0c261e;
}

/* Responsive: Tablet (2x2 Grid) */
@media (max-width: 900px) {
  body.bookshop-home .book-shelf-4-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  body.bookshop-home .book-card-cover {
    height: 150px;
  }
  body.bookshop-home .book-card-cover img {
    height: 145px !important;
  }
}

/* Responsive: Mobile Compact Cards */
@media (max-width: 560px) {
  body.bookshop-home .book-shelf-4-section,
  body.bookshop-home .shelf {
    padding: 0 16px 18px;
  }
  body.bookshop-home .book-shelf-4-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  body.bookshop-home .book-card-col {
    flex-direction: row;
    text-align: left;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
  }
  body.bookshop-home .book-card-cover {
    height: auto;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  body.bookshop-home .book-card-cover img {
    height: 115px !important;
  }
  body.bookshop-home .book-card-content {
    align-items: flex-start;
  }
  body.bookshop-home .book-tagline {
    min-height: auto;
    margin-bottom: 8px;
  }
  body.bookshop-home .book-links {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  body.bookshop-home .btn-read {
    flex: 1;
    min-height: 32px;
    padding: 5px 8px;
    font-size: 11px;
  }
}

/* Free Tools Section */
body.bookshop-home .tools {
  padding: 24px 30px;
  background: var(--bookshop-paper);
  border-top: 1px solid var(--bookshop-line);
  margin-top: 6px;
}

body.bookshop-home .tools-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

body.bookshop-home .tools h2 {
  font-family: Georgia, serif;
  font-size: 21px;
  line-height: 1.2;
  margin: 0;
  color: var(--bookshop-ink);
  font-weight: 600;
}

body.bookshop-home .tools-head .meta {
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--bookshop-muted);
}

body.bookshop-home .tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

body.bookshop-home .tool {
  border: 0;
  border-left: 2px solid var(--bookshop-line);
  background: none;
  text-align: left;
  padding: 6px 14px;
  color: var(--bookshop-ink);
  text-decoration: none;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 0 4px 4px 0;
  transition: border-left-color 0.15s ease, background 0.15s ease;
}

body.bookshop-home .tool:hover {
  border-left-color: var(--bookshop-ink);
  background: var(--bookshop-soft);
}

body.bookshop-home .tool strong {
  font-size: 12.5px;
  font-weight: 700;
  display: block;
  margin: 0 0 5px;
  color: var(--bookshop-ink);
}

body.bookshop-home .tool span {
  font-size: 11.5px;
  color: var(--bookshop-muted);
  line-height: 1.5;
  display: block;
}

/* Lower content sections (Our story, corrections, biryani) - Compact & scoped */
body.bookshop-home .section {
  padding: 44px 30px;
  border-top: 1px solid var(--bookshop-line);
  max-width: 1200px;
  margin: 0 auto;
}

body.bookshop-home .section .eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--bookshop-muted);
  margin: 0 0 14px;
  text-transform: uppercase;
}

body.bookshop-home .section h2 {
  font-family: Georgia, serif;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -0.5px;
  margin: 0 0 18px;
  color: var(--bookshop-ink);
}

body.bookshop-home .section p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--bookshop-ink);
  margin-bottom: 12px;
}

body.bookshop-home .section .lead {
  font-size: 17px;
  line-height: 1.5;
  font-weight: 500;
  color: var(--bookshop-ink);
  margin-bottom: 16px;
}

body.bookshop-home .story {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 40px;
  align-items: start;
}

body.bookshop-home .corrections {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 40px;
  align-items: start;
  background: var(--bookshop-green-dark);
  color: #fff9e8;
  border-radius: 8px;
  padding: 36px 30px;
  margin: 16px 30px 36px;
  max-width: calc(1200px - 60px);
}

body.bookshop-home .corrections h2,
body.bookshop-home .corrections p {
  color: #fff9e8;
}

body.bookshop-home .corrections .eyebrow {
  color: #d1deda;
}

body.bookshop-home .corrections .button.outline {
  border: 1px solid #fff9e8;
  color: #fff9e8;
  background: transparent;
  padding: 11px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
  transition: background 0.15s ease, color 0.15s ease;
}

body.bookshop-home .corrections .button.outline:hover {
  background: #fff9e8;
  color: var(--bookshop-green-dark);
}

body.bookshop-home .corrections .small {
  font-size: 12px;
  color: #d1deda;
  margin-top: 6px;
}

body.bookshop-home .support {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 40px;
  align-items: center;
}

body.bookshop-home .support figure {
  margin: 0;
  text-align: center;
}

body.bookshop-home .support figure img {
  max-width: 240px;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--bookshop-line);
}

body.bookshop-home .support figcaption {
  font-size: 12px;
  color: var(--bookshop-muted);
  margin-top: 8px;
}

body.bookshop-home .support .heart-i {
  display: inline-block;
  position: relative;
}

body.bookshop-home .support .heart-i svg {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-left: 2px;
}

body.bookshop-home .support .text-link.dark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--bookshop-green-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.bookshop-home .support a[download] {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--bookshop-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.bookshop-home .support .small {
  font-size: 12px;
  color: var(--bookshop-muted);
}

/* Bookshop Footer */
body.bookshop-home footer {
  padding: 32px 30px;
  border-top: 1px solid var(--bookshop-line);
  background: var(--bookshop-paper);
  color: var(--bookshop-muted);
  font-size: 12px;
  max-width: 1200px;
  margin: 0 auto;
}

body.bookshop-home footer .brand {
  font-size: 19px;
  margin-bottom: 10px;
  display: block;
  min-height: auto;
}

body.bookshop-home footer .small {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--bookshop-muted);
  max-width: 900px;
  margin-bottom: 12px;
}

body.bookshop-home footer a {
  color: var(--bookshop-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

body.bookshop-home footer .small a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
}

body.bookshop-home footer nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--bookshop-line);
}

body.bookshop-home footer nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--bookshop-ink);
}

body.bookshop-home footer nav a:hover {
  text-decoration: underline;
}

/* Responsive Breakpoints: 768px and below */
@media (max-width: 768px) {
  body.bookshop-home header {
    padding: 18px 20px;
    flex-wrap: wrap;
    gap: 14px;
  }

  body.bookshop-home header nav {
    gap: 16px;
  }

  body.bookshop-home .intro {
    padding: 22px 20px 16px;
    gap: 16px;
  }

  body.bookshop-home .intro h1 {
    font-size: 30px;
  }

  body.bookshop-home .tools {
    padding: 20px;
  }

  body.bookshop-home .tool-grid {
    gap: 12px;
  }

  body.bookshop-home .tool {
    padding: 4px 10px;
  }

  body.bookshop-home .section {
    padding: 36px 20px;
  }

  body.bookshop-home .story,
  body.bookshop-home .corrections,
  body.bookshop-home .support {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  body.bookshop-home .corrections {
    margin: 16px 20px 32px;
    max-width: none;
    padding: 28px 20px;
  }

  body.bookshop-home footer {
    padding: 28px 20px;
  }
}

/* Responsive Breakpoints: 580px and below */
@media (max-width: 580px) {
  body.bookshop-home .tool-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  body.bookshop-home .intro {
    flex-direction: column;
    align-items: flex-start;
  }

  body.bookshop-home .intro .small-link {
    display: none;
  }
}

/* Responsive Breakpoints: 420px / 360px mobile */
@media (max-width: 420px) {
  body.bookshop-home .book {
    display: grid;
    grid-template-columns: 35% 1fr;
    gap: 16px;
    padding: 16px;
  }

  body.bookshop-home .book img {
    height: 164px;
  }

  body.bookshop-home .book h2 {
    font-size: 22px;
  }

  body.bookshop-home .book p {
    font-size: 11.5px;
  }

  body.bookshop-home .brand {
    font-size: 21px;
  }

  body.bookshop-home header nav a {
    font-size: 12px;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Final review: centre the support image within its caption. */
body.bookshop-home .support figure img { margin-inline: auto; }

/* Dedicated tool links remain visible and wrap on smaller screens. */
body.bookshop-home header { flex-wrap: wrap; }
body.bookshop-home header nav { column-gap: 16px; row-gap: 2px; }
body.bookshop-home header nav a { white-space: nowrap; }


/* Confidence / EEE Labs in Numbers Section */
body.bookshop-home .confidence {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 40px;
  align-items: start;
}

body.bookshop-home .metrics-block {
  display: flex;
  flex-direction: column;
}

body.bookshop-home .metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 12px;
}

body.bookshop-home .metric-card {
  background: #fff;
  border: 1px solid var(--bookshop-line);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

body.bookshop-home .metric-num {
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--bookshop-green-dark);
  line-height: 1.1;
  margin-bottom: 4px;
}

body.bookshop-home .metric-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--bookshop-ink);
  margin-bottom: 3px;
}

body.bookshop-home .metric-sub {
  font-size: 12px;
  color: var(--bookshop-muted);
  line-height: 1.4;
}

body.bookshop-home .metric-note {
  font-size: 12px;
  line-height: 1.55;
  color: var(--bookshop-muted);
  margin: 8px 0 0;
}

body.bookshop-home .metric-note a {
  color: var(--bookshop-ink);
  text-decoration: underline;
}

@media (max-width: 768px) {
  body.bookshop-home .confidence {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  body.bookshop-home .metrics-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  body.bookshop-home .metric-card {
    padding: 14px;
  }
}
