/* ==========================================================================
   AwesomeGCP Read & Blog Stylesheet - Clean, Modern, Google-Branded Design
   ========================================================================== */

:root {
  /* Google Brand Colors */
  --g-blue: #4285F4;
  --g-blue-dark: #3367D6;
  --g-blue-light: #E8F0FE;
  --g-red: #EA4335;
  --g-yellow: #FBBC05;
  --g-green: #34A853;

  /* Extended UI Palette (for Compact Books) */
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-500: #22c55e;
  --green-800: #166534;
  --red-50: #fef2f2;
  --red-100: #fee2e2;
  --red-800: #991b1b;

  /* Neutrals */
  --text-primary: #1F2937;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --bg-main: #F9FAFB;
  --bg-card: #FFFFFF;
  --bg-white: #FFFFFF;
  --bg-light: #F8F9FA;
  --border-color: #E5E7EB;
  --border-light: #E5E7EB;
  --border-focus: #4285F4;
  --code-bg: #1F2937;
  --code-fg: #F9FAFB;

  /* Typography */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-main: var(--font-body);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.09), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background-color: var(--bg-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Layout Containers */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --------------------------------------------------------------------------
   Header & Navigation
   -------------------------------------------------------------------------- */
.site-header {
  background-color: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  position: relative;
}

.nav-center-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
}

.nav-center-title:hover {
  color: var(--g-blue);
  text-decoration: none;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-img {
  height: 2.25rem;
  width: auto;
  object-fit: contain;
}

.logo-text {
  font-family: 'Pacifico', cursive;
  font-size: 1.4rem;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
}

.nav-links a:hover {
  color: var(--text-primary);
  background-color: #F3F4F6;
  text-decoration: none;
}

.nav-links a.active {
  color: var(--g-blue-dark);
  background-color: var(--g-blue-light);
  text-decoration: none;
}

/* Section Headers on Unified Landing Page */
.read-section {
  margin-bottom: 3.5rem;
}

.read-section[hidden] {
  display: none !important;
}

.section-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
}

.section-heading-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-heading-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-heading-title i {
  color: var(--g-blue);
}

/* Level Filter Pills for Compact Books */
.level-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.level-pill-btn {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: #FFFFFF;
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.level-pill-btn:hover {
  border-color: var(--g-blue);
  color: var(--g-blue);
}

.level-pill-btn.active {
  background-color: var(--g-blue-light);
  border-color: var(--g-blue);
  color: var(--g-blue-dark);
}

/* --------------------------------------------------------------------------
   Compact Books Grid & Cards (Home Page)
   -------------------------------------------------------------------------- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.5rem;
}

.book-card-item[hidden] {
  display: none !important;
}

.book-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem 1.65rem;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.book-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4285F4 0%, #EA4335 33%, #FBBC05 66%, #34A853 100%);
}

.book-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #CBD5E1;
  text-decoration: none;
}

.book-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.book-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.65rem;
  border-radius: 0.375rem;
  background-color: var(--g-blue-light);
  color: var(--g-blue-dark);
}

.book-level-badge {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
  background-color: #F3F4F6;
  color: var(--text-secondary);
}

.book-level-badge.level-foundational {
  background-color: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
}

.book-level-badge.level-associate {
  background-color: #EFF6FF;
  color: #1E40AF;
  border-color: #BFDBFE;
}

.book-level-badge.level-professional {
  background-color: #FEF3C7;
  color: #92400E;
  border-color: #FDE68A;
}

.book-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.book-card:hover .book-card-title {
  color: var(--g-blue);
}

.book-card-summary {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.book-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  border-top: 1px solid #F3F4F6;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.book-chapter-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Blog Post List (Card Stack)
   -------------------------------------------------------------------------- */
.blog-list-section {
  padding: 2.75rem 0 5rem;
}

.blog-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.blog-card {
  display: flex;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: #CBD5E1;
  text-decoration: none;
}

.card-image-wrap {
  position: relative;
  overflow: hidden;
  background-color: #F3F4F6;
  width: 320px;
  min-width: 320px;
  max-width: 320px;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.blog-card:hover .card-image-wrap img {
  transform: scale(1.04);
}

.card-content {
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
}

.card-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.75rem;
}

.tag-badge {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 0.375rem;
  background-color: #F3F4F6;
  color: #4B5563;
  border: 1px solid #E5E7EB;
}

.pinned-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--g-blue);
  font-size: 1rem;
  line-height: 1;
  background: none;
  border: none;
  padding: 0;
  margin-right: 0.15rem;
}

.pinned-icon i {
  display: inline-block;
}

.published-date {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
  transition: color 0.2s ease;
}

.blog-card:hover .card-title {
  color: var(--g-blue);
}

.card-summary {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid #F3F4F6;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.card-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.author-avatar-sm {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  background-color: var(--g-blue-light);
  color: var(--g-blue-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.read-more-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--g-blue);
}

/* --------------------------------------------------------------------------
   Pinned Blog Card Styling (AwesomeGCP Blue)
   -------------------------------------------------------------------------- */
article[data-pinned="true"] .blog-card,
article[data-pinned] .blog-card,
article.is-pinned .blog-card,
article:has(.pinned-icon) .blog-card {
  background-color: var(--g-blue);
  border-color: var(--g-blue-dark);
  color: #FFFFFF;
  box-shadow: 0 4px 14px 0 rgba(66, 133, 244, 0.25);
}

article[data-pinned="true"] .blog-card:hover,
article[data-pinned] .blog-card:hover,
article.is-pinned .blog-card:hover,
article:has(.pinned-icon) .blog-card:hover {
  border-color: #2A56C6;
  box-shadow: 0 14px 28px -4px rgba(66, 133, 244, 0.4);
}

article[data-pinned="true"] .card-title,
article[data-pinned] .card-title,
article.is-pinned .card-title,
article:has(.pinned-icon) .card-title,
article[data-pinned="true"] .blog-card:hover .card-title,
article[data-pinned] .blog-card:hover .card-title,
article.is-pinned .blog-card:hover .card-title,
article:has(.pinned-icon) .blog-card:hover .card-title {
  color: #FFFFFF;
}

article[data-pinned="true"] .card-summary,
article[data-pinned] .card-summary,
article.is-pinned .card-summary,
article:has(.pinned-icon) .card-summary {
  color: rgba(255, 255, 255, 0.92);
}

article[data-pinned="true"] .published-date,
article[data-pinned] .published-date,
article.is-pinned .published-date,
article:has(.pinned-icon) .published-date,
article[data-pinned="true"] .published-date i,
article[data-pinned] .published-date i,
article.is-pinned .published-date i,
article:has(.pinned-icon) .published-date i {
  color: rgba(255, 255, 255, 0.82);
}

article[data-pinned="true"] .tag-badge,
article[data-pinned] .tag-badge,
article.is-pinned .tag-badge,
article:has(.pinned-icon) .tag-badge {
  background-color: rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
}

article[data-pinned="true"] .pinned-icon,
article[data-pinned] .pinned-icon,
article.is-pinned .pinned-icon,
article:has(.pinned-icon) .pinned-icon {
  color: #FFFFFF;
}

article[data-pinned="true"] .card-meta-bottom,
article[data-pinned] .card-meta-bottom,
article.is-pinned .card-meta-bottom,
article:has(.pinned-icon) .card-meta-bottom {
  border-top-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
}

article[data-pinned="true"] .card-author,
article[data-pinned] .card-author,
article.is-pinned .card-author,
article:has(.pinned-icon) .card-author {
  color: rgba(255, 255, 255, 0.95);
}

article[data-pinned="true"] .author-avatar-sm,
article[data-pinned] .author-avatar-sm,
article.is-pinned .author-avatar-sm,
article:has(.pinned-icon) .author-avatar-sm {
  background-color: #FFFFFF;
  color: var(--g-blue);
}

article[data-pinned="true"] .read-more-link,
article[data-pinned] .read-more-link,
article.is-pinned .read-more-link,
article:has(.pinned-icon) .read-more-link {
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   Article Page Styles (Blog Posts)
   -------------------------------------------------------------------------- */
.article-header {
  padding: 3rem 0 2rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--g-blue);
  text-decoration: none;
}

.article-title {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.article-cover-wrap {
  margin: 2rem 0 3rem;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 16 / 9;
  background-color: #F3F4F6;
}

.article-cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Article Body Content */
.article-body {
  font-size: 1.125rem;
  line-height: 1.8;
  color: #374151;
}

.article-body h2,
.article-body h3,
.article-body h4,
.content-card h2,
.content-card h3,
.content-card h4 {
  scroll-margin-top: 5.5rem;
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.article-body h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.75rem 0 0.75rem;
}

.article-body h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.5rem;
}

.has-anchor {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.heading-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85em;
  padding: 0.2rem 0.4rem;
  border-radius: 0.375rem;
  transition: opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

.has-anchor:hover .heading-anchor,
.heading-anchor:focus-visible {
  opacity: 1;
}

.heading-anchor:hover {
  color: var(--g-blue);
  background-color: var(--g-blue-light);
  transform: scale(1.1);
  text-decoration: none;
}

.heading-anchor.copied {
  opacity: 1;
  color: var(--g-green);
  background-color: #E6F4EA;
}

.article-body p {
  margin-bottom: 1.5rem;
}

.article-body ul,
.article-body ol {
  margin: 1rem 0 1.75rem 1.5rem;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body blockquote {
  border-left: 4px solid var(--g-blue);
  background-color: var(--g-blue-light);
  padding: 1rem 1.5rem;
  margin: 1.75rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
  color: #1E3A8A;
  font-style: italic;
}

.article-body .callout {
  background-color: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-left: 4px solid var(--g-green);
  padding: 1.25rem 1.5rem;
  border-radius: 0.5rem;
  margin: 1.75rem 0;
}

.article-body .callout-title {
  font-weight: 700;
  color: #166534;
  margin-bottom: 0.5rem;
}

.article-body figure {
  margin: 2rem 0;
  text-align: center;
}

.article-body figcaption {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.5;
}

.article-body code {
  background-color: #F3F4F6;
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.article-body pre {
  background-color: #1F2937;
  color: #F9FAFB;
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Compact Book Reader Layout & Components (/books/<slug>/*)
   -------------------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  max-width: 1320px;
  margin: 0 auto;
  min-height: calc(100vh - 4rem);
}

.sidebar-section-title {
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin: 10px 8px 8px;
}

.content-wrap {
  padding: 32px 36px 64px;
  min-width: 0;
}

.content-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 36px 44px;
  box-shadow: var(--shadow-md);
  max-width: 960px;
  margin: 0 auto;
}

.content-card a {
  color: var(--blue-600);
  text-decoration: none;
  transition: color 0.15s ease;
}

.content-card a:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

.chapter-book-header {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.chapter-book-title {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary) !important;
  text-decoration: none !important;
  letter-spacing: -0.01em;
}

.chapter-book-title:hover {
  color: var(--blue-600) !important;
}

/* Right TOC Sidebar */
.toc-sidebar {
  position: sticky;
  top: 4rem;
  height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 32px 16px 32px 8px;
  font-size: 12.5px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 2px solid var(--border-light);
}

.toc-list li {
  margin: 0;
}

.toc-list a {
  display: block;
  padding: 5px 12px;
  color: var(--text-secondary);
  line-height: 1.35;
  border-radius: 0 6px 6px 0;
  text-decoration: none;
  transition: all 0.15s ease;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--blue-600);
  background: var(--blue-50);
  text-decoration: none;
  font-weight: 600;
}

.toc-list li.toc-h3 a {
  padding-left: 24px;
  font-size: 12px;
}

/* Book Hero Cover Banner */
.cover-banner {
  position: relative;
  overflow: hidden;
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 40px 36px;
  margin-bottom: 32px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.cover-banner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #4285F4 0%, #EA4335 33%, #FBBC05 66%, #34A853 100%);
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

.hero-blob.blob-blue {
  width: 260px;
  height: 260px;
  background: #4285F4;
  top: -80px;
  left: -60px;
}

.hero-blob.blob-red {
  width: 220px;
  height: 220px;
  background: #EA4335;
  top: 10px;
  right: -60px;
}

.hero-blob.blob-yellow {
  width: 180px;
  height: 180px;
  background: #FBBC05;
  bottom: -60px;
  left: 35%;
}

.cover-banner-content {
  position: relative;
  z-index: 1;
}

.cover-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--blue-700);
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
  padding: 5px 14px;
  border-radius: 9999px;
  margin-bottom: 16px;
}

.cover-title {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 0;
  letter-spacing: -0.02em;
}

.cover-subtitle {
  font-size: 17px;
  font-weight: 400;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.5;
}

/* Chapter Directory Cards */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 16px;
  margin: 22px 0 34px;
}

.chapter-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 20px 18px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  text-decoration: none !important;
}

.chapter-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--g-blue);
}

.chapter-card:nth-child(4n+2)::before { background: var(--g-red); }
.chapter-card:nth-child(4n+3)::before { background: var(--g-yellow); }
.chapter-card:nth-child(4n+4)::before { background: var(--g-green); }

.chapter-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  border-color: var(--blue-200);
  text-decoration: none !important;
}

.chapter-card-num {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--g-blue);
  margin-bottom: 8px;
}

.chapter-card:nth-child(4n+2) .chapter-card-num { color: var(--g-red); }
.chapter-card:nth-child(4n+3) .chapter-card-num { color: #d97706; }
.chapter-card:nth-child(4n+4) .chapter-card-num { color: var(--g-green); }

.chapter-card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color 0.15s ease;
}

.chapter-card:hover .chapter-card-title {
  color: var(--blue-600);
}

/* Book Content Typography */
.content-card h1 {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--g-blue);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.content-card h2 {
  font-family: var(--font-heading);
  font-size: 23px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 36px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.content-card h3 {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  color: var(--blue-600);
  margin-top: 26px;
  margin-bottom: 10px;
}

.content-card h4 {
  font-family: var(--font-heading);
  font-size: 15.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4b5563;
  margin-top: 20px;
  margin-bottom: 10px;
}

.content-card p {
  margin-top: 8px;
  margin-bottom: 12px;
}

.content-card ul,
.content-card ol {
  margin-top: 8px;
  margin-bottom: 14px;
  padding-left: 24px;
}

.content-card li {
  margin-bottom: 6px;
}

.content-card li.nested-li {
  margin-left: 20px;
}

/* Interactive Multiple-Choice Option Cards */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 20px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  padding: 14px 16px;
  border: 2px solid var(--border-light);
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.option-item:hover {
  border-color: #93c5fd;
  background-color: rgba(239, 246, 255, 0.4);
}

.option-item.selected {
  border-color: #3b82f6;
  background-color: rgba(239, 246, 255, 0.65);
}

.option-marker {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  font-weight: 700;
  font-size: 14px;
  color: #6b7280;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.option-item:hover .option-marker {
  border-color: #60a5fa;
  color: var(--blue-600);
}

.option-item.selected .option-marker {
  border-color: var(--blue-600);
  background-color: var(--blue-600);
  color: #ffffff;
}

.option-content {
  flex: 1;
  min-width: 0;
  padding-top: 3px;
}

.option-text {
  color: #1f2937;
  font-weight: 500;
  line-height: 1.5;
}

/* Verdict Banner & Verdict Pills */
.verdict-banner {
  background-color: var(--green-50);
  border: 2px solid var(--green-500);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 14px 0;
  color: var(--green-800);
  font-weight: 600;
  font-size: 15.5px;
}

.verdict-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.verdict-pill.correct {
  background-color: var(--green-100);
  color: var(--green-800);
}

.verdict-pill.trap {
  background-color: var(--red-100);
  color: var(--red-800);
}

/* Code & Pre Blocks inside Books */
.content-card code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
  background-color: #f1f3f4;
  color: #d93025;
  padding: 2px 6px;
  border-radius: 5px;
}

.code-block-box {
  background-color: var(--code-bg);
  border: 1px solid #3c4043;
  border-radius: 10px;
  padding: 16px 18px;
  margin: 16px 0;
  overflow-x: auto;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

pre.code-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--code-fg);
  margin: 0;
  white-space: pre;
}

/* Callout Blockquotes */
blockquote.callout-quote {
  background-color: var(--blue-50);
  border-left: 4px solid var(--g-blue);
  border-radius: 0 10px 10px 0;
  padding: 14px 20px;
  margin: 16px 0;
  color: #1e3a8a;
}

blockquote.callout-quote p {
  margin: 6px 0;
}

/* Interactive Answer & Explanation Accordion (<details>) */
details.details-box,
div.details-box {
  border: 1px solid var(--blue-200);
  background-color: #ffffff;
  border-radius: 12px;
  margin: 20px 0;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.06);
}

summary.details-header,
div.details-header {
  background-color: var(--blue-50);
  color: var(--blue-700);
  font-weight: 700;
  font-size: 15px;
  padding: 12px 18px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
  transition: background-color 0.15s ease;
}

summary.details-header:hover {
  background-color: var(--blue-100);
}

details.details-box[open] > summary.details-header,
div.details-header {
  border-bottom-color: var(--blue-200);
}

.details-body {
  padding: 18px 22px;
  background: #ffffff;
}

/* Data Tables */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14.5px;
  border-radius: 8px;
  overflow: hidden;
}

table.data-table th {
  background-color: var(--g-blue);
  color: #ffffff;
  font-weight: 700;
  padding: 10px 14px;
  border: 1px solid var(--blue-600);
}

table.data-table td {
  padding: 10px 14px;
  border: 1px solid #dadce0;
  color: var(--text-primary);
  vertical-align: top;
}

table.data-table tr.even-row td {
  background-color: var(--bg-light);
}

/* Figures & Sketch-Notes */
figure.figure-block {
  text-align: center;
  margin: 22px 0;
}

figure.figure-block img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid #dadce0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

figcaption.figure-caption,
.figure-caption {
  font-style: italic;
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.figure-placeholder {
  text-align: center;
  font-style: italic;
  font-size: 14px;
  color: var(--text-secondary);
  background-color: var(--bg-light);
  padding: 12px;
  border-radius: 8px;
  margin: 14px 0;
}

.mermaid-container {
  text-align: center;
  margin: 22px 0;
  overflow-x: auto;
}

.mermaid-container svg {
  max-width: 100%;
  height: auto;
}

hr.section-divider {
  border: 0;
  border-top: 1px solid var(--border-light);
  margin: 32px 0;
}

p.ref-tag {
  font-style: italic;
  font-size: 12.5px;
  color: var(--text-secondary);
  text-align: right;
  margin-top: 6px;
  margin-bottom: 4px;
}

/* Prev / Next Chapter Navigation */
.pager-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 16px;
  margin: 32px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.pager-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  border: 2px solid var(--border-light);
  border-radius: 12px;
  background: #ffffff;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.pager-link:hover {
  border-color: var(--blue-600);
  background: var(--blue-50);
  text-decoration: none !important;
  transform: translateY(-1px);
}

.pager-link.next {
  text-align: right;
}

.pager-label {
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.pager-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-600);
}

/* --------------------------------------------------------------------------
   Article CTA Box
   -------------------------------------------------------------------------- */
.article-cta {
  background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
  color: #FFFFFF;
  padding: 2.5rem;
  border-radius: 1rem;
  text-align: center;
  margin: 3.5rem 0 2rem;
}

.article-cta h3,
.article-body .article-cta h3,
.content-card .article-cta h3 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: #FFFFFF !important;
  margin-bottom: 0.75rem;
}

.article-cta p {
  font-size: 1.05rem;
  opacity: 0.92;
  max-width: 620px;
  margin: 0 auto 1.5rem;
  color: #FFFFFF;
}

.cta-btn {
  display: inline-block;
  background-color: #FFFFFF;
  color: #1E3A8A !important;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
  border-radius: 0.5rem;
  text-decoration: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  text-decoration: none !important;
}

.btn-action-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background-color: var(--g-blue);
  color: #FFFFFF !important;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0.85rem 1.85rem;
  border-radius: 0.5rem;
  text-decoration: none !important;
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-action-primary:hover {
  background-color: var(--g-blue-dark);
  color: #FFFFFF !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(66, 133, 244, 0.4);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: #FFFFFF;
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  margin-top: 5rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
}

.footer-links a {
  text-decoration: none;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--g-blue);
}

.footer-copyright {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .toc-sidebar {
    display: none;
  }
}

@media (max-width: 840px) {
  .blog-card {
    flex-direction: column;
  }
  .card-image-wrap {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
  }
  .article-title {
    font-size: 1.85rem;
  }
  .content-wrap {
    padding: 16px 12px 48px;
  }
  .content-card {
    padding: 22px 18px;
  }
  .pager-nav {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .container,
  .container-narrow {
    padding: 0 1rem;
  }

  .nav-bar {
    height: 3.5rem;
  }

  .logo-img {
    height: 1.5rem;
  }

  .nav-center-title {
    display: none;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .read-tabs {
    flex-wrap: wrap;
    justify-content: center;
  }

  .books-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Toast Notification for Copied Anchor Links
   -------------------------------------------------------------------------- */
.blog-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #1F2937;
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.blog-toast i {
  color: #34A853;
  font-size: 1.1rem;
}

.blog-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
