.site-root, html, body {
  height: 100%;
}
:root{
  --accent: #ff5a5f; /* coral accent for primary CTAs */
  --success: #2bb673;
  --sb-text: #0b1a1f;
  --sb-dark: #0f2a33;
  --sb-grey: #f6f8f9;
  --sb-white: #ffffff;
  --sb-blue: #0b2a36;
  --muted: #556067;
  --card-bg: rgba(11,42,54,0.09); /* stronger tinted card background for visibility */
  --card-border: rgba(16,24,40,0.10);
  --blue-accent: #1f6feb; /* primary blue for contact button */
}
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--sb-text, #0b1a1f);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings use Playfair for a thoughtful, editorial tone */
h1, h2, h3, .hero-title {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  color: var(--sb-dark, #10202a);
}

.hero-content {
  max-width: 640px;
  padding: 20px 24px;
  position: relative;
  z-index: 2;
}
  font-weight: 700;
  letter-spacing: -0.02em;
  color: white;
}
  max-width: 640px;
  padding: 20px 24px;
  position: relative;
  z-index: 3;
  font-size: 1.125rem;

/* Fallback hero image element (guarantees visible image if CSS/background fails) */
.hero-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 1;
}
  line-height: 1.45;
}

.hero-ctas { display: flex; gap: 14px; align-items: center; }

/* Shared button base used site-wide */
.btn, a.btn, button.btn, input[type="button"].btn, input[type="submit"].btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  border-radius: 999px; /* pill */
  transition: transform 150ms ease, box-shadow 180ms ease, opacity 120ms ease;
  padding: 10px 16px;
  font-size: 1rem;
  -webkit-tap-highlight-color: transparent;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255,90,95,0.12);
}

.btn-primary, a.btn-primary, button.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 30px rgba(255,90,95,0.12);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 48px rgba(255,90,95,0.18); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled, .btn-primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Blue variant for contact button */
.btn-blue, a.btn-blue, button.btn-blue {
  background: var(--blue-accent);
  color: #fff;
  box-shadow: 0 10px 30px rgba(31,111,235,0.12);
  border: 1px solid rgba(0,0,0,0.06);
}
.btn-blue:hover { transform: translateY(-2px); box-shadow: 0 18px 48px rgba(31,111,235,0.16); }

.btn-outline, a.btn-outline, button.btn-outline {
  background: white;
  color: var(--sb-text);
  border: 1px solid #e6e9eb;
}
.btn-outline:hover { background: rgba(0,0,0,0.04); }

/* Slightly stronger shadow and spacing to anchor the hero */
.hero-with-bg { padding-bottom: 96px; }
  background: var(--sb-white);
  color: var(--sb-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid #e6e9eb;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-logo {
  height: 56px;
  width: auto;
  display: block;
}

header nav a {
  color: var(--sb-text);
  text-decoration: none;
  margin-left: 22px;
  font-size: 0.95rem;
  opacity: 0.85;
}
header nav a:hover {
  opacity: 1;
}

header nav { display: flex; align-items: center; }

/* Layout header: logo left, nav right */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  gap: 20px;
}

/* Style nav links as pill buttons */
header nav a {
  /* layout only - visual styles come from the .btn/.btn-primary classes */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  margin-left: 12px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 120ms ease;
}

/* Smaller padding on very small screens */
@media (max-width: 700px) {
  header { padding: 10px 14px; }
  header nav a { padding: 6px 10px; margin-left: 8px; }
}

/* make the site title smaller so nav aligns visually */
.header-left h1 { font-size: 1.05rem; margin: 0; font-weight: 700; }

.nav-cta {
  background: var(--accent);
  color: white;
  padding: 8px 14px;
  border-radius: 999px; /* pill */
  margin-left: 16px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.hero {
  position: relative;
  padding: 80px 20px;
  color: white;
}

.hero-with-bg {
  background-color: var(--sb-blue);
  /* default hero background (fallback) */
  background-image: url('images/eBook_Hero_Image.jpg');
  /* background-image will also be set dynamically by the loader script using data-bg-sources */
  background-repeat: no-repeat;
  /* use cover for photographic hero so it fills the area nicely */
  background-position: center right;
  background-size: cover;
  padding-bottom: 40px; /* reduced so value section sits closer */
}
.hero-with-bg { padding-bottom: 40px; }

.hero::before {
  /* subtle dark overlay to improve text contrast */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15,38,47,0.85) 0%, rgba(15,38,47,0.4) 60%, rgba(15,38,47,0.0) 100%);
  pointer-events: none;
  z-index: 1;
}

.hero-inner {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.hero-content {
  max-width: 640px;
  padding: 20px 24px;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 2.8rem;
  line-height: 1.04;
  margin-bottom: 12px;
  font-weight: 700;
  color: #ffffff;
}

.hero-sub {
  color: rgba(255,255,255,0.92);
  margin-bottom: 20px;
  font-size: 1.05rem;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 400;
}

.hero-ctas { display: flex; gap: 12px; align-items: center; }

.btn-primary {
  background: var(--accent);
  color: white;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  box-shadow: 0 10px 30px rgba(255,90,95,0.12);
  font-size: 1.05rem;
  min-width: 140px;
  justify-content: center;
  border: 1px solid rgba(0,0,0,0.06);
}

.btn-outline {
  border: 1px solid #e6e9eb;
  padding: 8px 14px;
  border-radius: 12px;
  color: var(--sb-text);
  background: white;
  text-decoration: none;
  font-weight: 600;
}

.btn-primary.small { padding: 8px 12px; }

/* make hero-specific outline button readable over photo */
.hero-ctas .btn-outline { background: transparent; color: rgba(255,255,255,0.95); border-color: rgba(255,255,255,0.35); }

.books { padding: 30px 20px; max-width: 1200px; margin: 40px auto; }

.cards-grid {
  display: grid;
  /* stack cards on small/medium widths for stable side-by-side image+text layout */
  grid-template-columns: 1fr;
  gap: 28px;
  align-items: start;
}

@media (min-width: 1100px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(540px, 1fr));
  }
}

.card {
  background: var(--card-bg, #ffffff);
  border-radius: 12px;
  position: relative;
  box-shadow: 0 8px 24px rgba(16,24,40,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column; /* stack blocks vertically */
  gap: 8px;
  padding: 22px;
  text-align: left;
}

.card-top { display:flex; gap:20px; align-items:flex-start; margin-bottom:6px; }
.card-media { flex: 0 0 240px; display:flex; flex-direction: column; justify-content:center; align-items:center; padding:8px 0; background: transparent; }
.card-media a { display: block; text-decoration: none; }
.card-media img { width: 100%; max-width: 240px; height: auto; max-height: 420px; object-fit: cover; display: block; border-radius:16px; box-shadow: 0 10px 30px rgba(16,24,40,0.12); transition: transform 200ms ease, box-shadow 200ms ease; }
.card:hover .card-media img { transform: translateY(-6px); box-shadow: 0 24px 60px rgba(16,24,40,0.18); }
.card-media .card-stats { margin-top: 12px; text-align: center; }
.card-media .card-downloads { font-size: 0.9rem; color: var(--muted); }

.card-body { padding: 8px 10px; flex: 1 1 auto; display: block; min-width: 0; }

.card-body h3 { margin-bottom: 12px; color: var(--sb-dark); font-size: 1.6rem; font-family: 'Playfair Display', serif; font-weight: 700; }
.card-body h3 a { text-decoration: none; color: inherit; transition: opacity 200ms ease; }
.card-body h3 a:hover { opacity: 0.8; }
.muted { color: var(--muted); margin-bottom: 16px; font-size: 1.05rem; max-width: 56ch; }
.card-inside { margin-top: 8px; text-align: center; }
.card-inside p { margin-bottom: 8px; font-weight:700; font-size: 1.05rem; }
.card-inside ul {
  margin: 0 auto 12px;
  padding-left: 0;
  display: inline-block;
  text-align: left;
  color: var(--muted);
  line-height: 1.6;
  list-style: none;
}
.card-inside ul li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 8px;
}
.card-inside ul li::before {
  content: '✔';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--success);
  font-weight: 800;
  line-height: 1;
}
.card-actions { margin-top: 6px; width:100%; display:flex; flex-direction: column; align-items:center; justify-content:center; }
.card-actions .btn-primary { margin: 8px auto 0; }

/* Gold stars for ratings */
.gold-stars { color: #FFD700; }

/* Review preview styling */
.card-review-preview { margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(16,24,40,0.08); }
.review-preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.review-preview-name { font-weight: 600; color: var(--sb-dark); font-size: 0.95rem; }
.review-preview-rating { font-size: 0.9rem; }
.review-preview-text { color: var(--muted); font-size: 0.95rem; font-style: italic; line-height: 1.5; }

/* Buy trust text styling */
.buy-trust { margin-top: 12px; text-align: center; font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.buy-trust span { display: inline-block; }

/* Sale ribbon in the top-right of the card */
.ribbon {
  position: absolute;
  top: 14px;
  right: 14px;
  transform: rotate(8deg);
  background: var(--accent);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 8px 20px rgba(16,24,40,0.12);
  z-index: 6;
}
.ribbon span { display: block; }

/* Price block used on each card to show original and sale price */
.price {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
}
.price .was {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 0.95rem;
}
.price .now {
  background: var(--blue-accent);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 8px 22px rgba(31,111,235,0.10);
}

/* Reduce cover size on medium screens and stack top area on small screens */
@media (max-width: 1200px) {
  .card-media { flex: 0 0 200px; }
  .card-media img { max-width: 200px; max-height: 360px; }
}

@media (max-width: 900px) {
  .card-top { flex-direction: column; align-items: center; }
  .card-body { text-align: center; }
  .card-media { flex: 0 0 auto; }
  .card-media img { max-width: 220px; height: auto; }
}

/* Stack cards vertically on small screens so text doesn't wrap into narrow columns */
@media (max-width: 900px) {
  .card { flex-direction: column; }
  .card-media { flex: 0 0 auto; padding: 12px 16px; }
  .card-media img { width: 160px; height: 240px; margin: 0 auto; }
  .card-actions { justify-content: center; }
}

.testimonials {
  background: var(--sb-grey);
  padding: 60px 20px;
}

.testimonials h2 {
  text-align: center;
  font-size: 2.25rem;
  margin-bottom: 40px;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

/* Footer layout and improved contrast */
footer {
  padding: 28px 0;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-left {
  color: var(--sb-white);
  font-size: 0.95rem;
}
.footer-contact {
  text-align: right;
  color: var(--sb-white);
}
.footer-contact h3 {
  margin: 0 0 6px 0;
  font-size: 1rem;
  font-family: 'Playfair Display', serif;
  color: var(--sb-white);
}
.footer-contact a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}
.footer-contact a:hover { text-decoration: underline; }

/* Value section styles (placed here to keep site styles centralized) */
.value-section {
  padding: 28px 40px 8px; /* reduce bottom padding so books sit closer */
  background: #ffffff;
  text-align: center;
}
.value-container { max-width: 900px; margin: 0 auto; }
.value-section h2 { font-size: 2rem; margin-bottom: 20px; color: #17394B; font-weight: 700; }
.value-lead { font-size: 1.2rem; color: #23343B; opacity: 0.9; margin-bottom: 35px; line-height: 1.6; }
.value-features { display: grid; gap: 12px; max-width: 620px; margin: 0 auto 35px; }
.value-features { display: grid; gap: 12px; max-width: 620px; margin: 0 auto 12px; grid-template-columns: 1fr; }
.value-item {
  font-size: 1.05rem;
  color: var(--sb-dark);
  background: var(--card-bg);
  padding: 14px 20px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(16,24,40,0.04);
  display: block;
  text-align: left;
  line-height: 1.5;
}

@media (min-width: 900px) {
  .value-features { grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 880px; }
  .value-item { 
    text-align: left; 
    padding: 16px 20px;
  }
}
.value-bottom { font-size: 1.15rem; opacity: 0.9; max-width: 750px; margin: 0 auto; line-height: 1.6; }

.testimonial-card {
  background: white;
  padding: 25px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  font-size: 1.05rem;
}

.bundle {
  text-align: center;
  background: var(--sb-blue);
  color: white;
  padding: 100px 40px;
}

.bundle h2 {
  font-size: 2.5rem;
  margin-bottom: 25px;
}

.bundle p {
  font-size: 1.2rem;
  margin-bottom: 30px;
}

footer {
  padding: 40px 20px;
  background: #0b1a1f;
  color: white;
  text-align: center;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .hero-inner { padding: 20px; }
  .hero-title { font-size: 1.9rem; }
  .hero-sub { font-size: 1rem; }
  .site-logo { height: 48px; }
  .card-media img { height: 220px; }
  .btn-primary { width: auto; }
}

@media (max-width: 1100px) {
  .hero-with-bg { background-size: 40%; background-position: right 4% center; }
}

@media (max-width: 700px) {
  .hero-with-bg { background-image: none; }
}

/* Card title spacing fix */
.card-body h3 { margin-top: 12px; margin-bottom: 8px; }
.cards-grid { margin-top: 12px; }

@media (min-width: 1400px) {
  .hero-title { font-size: 3.8rem; }
  .hero-inner { padding: 72px 40px; }
}
