/* ==========================================================================
   Clueless Book — page styles
   Destination: app/assets/stylesheets/clueless_book/pages.css

   MUST be linked AFTER the "retail" Tailwind build and "retail/application"
   in app/views/layouts/clueless_book.html.erb (it overrides retail-* rules
   of equal specificity by source order).

   Vocabulary:
     .cl-*  site chrome (top bar, navbar, mobile nav, footer) — lifted
            verbatim from the layout's <style> block, plus four classes
            added by this sweep for chrome elements that carried inline
            styles.
     .cb-*  page-level classes introduced by the inline-style sweep.
   ========================================================================== */

/* --------------------------------------------------------------------------
   CHROME — lifted verbatim from the <style> block in
   app/views/layouts/clueless_book.html.erb (order preserved)
   -------------------------------------------------------------------------- */
:root {
  --cl-primary: #003366;
  --cl-accent: #FF3333;
  --cl-bg: #ffffff;
  --cl-nav-bg: #f8f9fa;
  --cl-text: #1a1a2e;
  --cl-text-muted: #6b7280;
  --cl-border: #e5e7eb;
}

/* ── Top bar ── */
.cl-topbar {
  background: var(--cl-primary);
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cl-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: rgba(255,255,255,0.85);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: color 0.2s;
}
.cl-topbar-brand:hover { color: #fff; }
.cl-topbar-brand img { height: 22px; opacity: 0.9; }
.cl-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.cl-topbar-right a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.2s;
}
.cl-topbar-right a:hover { color: #fff; }

/* ── Nav bar ── */
.cl-navbar {
  background: var(--cl-bg);
  border-bottom: 1px solid var(--cl-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.cl-navbar-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 var(--retail-container-padding, 1.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}
.cl-navbar-title {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.cl-navbar-title img {
  display: block;
}
.cl-nav-links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  align-items: center;
}
@media (min-width: 768px) {
  .cl-nav-links { display: flex; }
}
.cl-nav-links a {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--cl-text);
  text-decoration: none;
  border-radius: 0.25rem;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.cl-nav-links a:hover {
  background: var(--retail-gray-50, #f3f4f6);
  color: var(--cl-primary);
}
.cl-nav-links a.cl-nav-active {
  color: var(--cl-primary);
  font-weight: 600;
}
.cl-nav-buy {
  background: var(--cl-accent) !important;
  color: #fff !important;
  font-weight: 600 !important;
  padding: 0.375rem 0.875rem !important;
  border-radius: 0.25rem !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.02em;
}
.cl-nav-buy:hover {
  background: #e02d2d !important;
  color: #fff !important;
}

/* ── Mobile menu toggle ── */
.cl-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: 1px solid var(--cl-border);
  border-radius: 0.25rem;
  cursor: pointer;
  color: var(--cl-text);
  font-size: 1.125rem;
}
@media (min-width: 768px) {
  .cl-mobile-toggle { display: none; }
}

/* ── Mobile nav ── */
.cl-mobile-nav {
  display: none;
  background: var(--cl-bg);
  border-bottom: 1px solid var(--cl-border);
  padding: 0.5rem 1rem 1rem;
}
.cl-mobile-nav.cl-mobile-nav-open { display: block; }
@media (min-width: 768px) {
  .cl-mobile-nav { display: none !important; }
}
.cl-mobile-nav a {
  display: block;
  padding: 0.625rem 0.75rem;
  font-size: 0.9375rem;
  color: var(--cl-text);
  text-decoration: none;
  border-radius: 0.25rem;
  transition: background 0.15s;
}
.cl-mobile-nav a:hover { background: var(--retail-gray-50, #f3f4f6); }
.cl-mobile-nav a.cl-nav-active { color: var(--cl-primary); font-weight: 600; }

/* ── Footer ── */
.cl-footer {
  background: var(--cl-primary);
  color: rgba(255,255,255,0.75);
  padding: 2.5rem 1.5rem;
  margin-top: 0;
}
.cl-footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.cl-footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.cl-footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.8125rem;
  transition: color 0.2s;
}
.cl-footer-links a:hover { color: #fff; }
.cl-footer-copy {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}

/* ── Chrome classes added by the inline-style sweep
      (app/views/layouts/clueless_book.html.erb) ── */

/* <body> — was an inline font-family; must out-rank Tailwind's .font-sans,
   which is also on the element. */
.cl-body {
  font-family: 'Geist Sans', 'Geist', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
}

.cl-navbar-logo { height: 1.375rem; }

.cl-nav-buy-icon {
  font-size: 0.625rem;
  margin-left: 0.25rem;
}

/* Scoped: plain .cl-mobile-buy (0,1,0) would lose to .cl-mobile-nav a (0,1,1). */
.cl-mobile-nav a.cl-mobile-buy {
  color: var(--cl-accent);
  font-weight: 600;
}

.cl-mobile-buy-icon { font-size: 0.625rem; }

/* --------------------------------------------------------------------------
   SHARED — used by two or more Clueless pages
   -------------------------------------------------------------------------- */

/* Body copy ------------------------------------------------------------- */
.cb-text {
  font-size: 0.9375rem;
  color: var(--retail-gray-700);
  line-height: 1.7;
}
.cb-text--center { text-align: center; }
.cb-text--mt-1 { margin-top: 1rem; }
.cb-text--mb-1 { margin-bottom: 1rem; }
.cb-text--mb-2 { margin-bottom: 2rem; }

.cb-link {
  color: var(--retail-primary);
  font-weight: 600;
}

/* Section shells -------------------------------------------------------- */
.cb-section-narrow {
  padding: 3rem 2rem 4rem;
  max-width: 36rem;
  margin: 0 auto;
}
.cb-section-medium {
  padding: 3rem 2rem 4rem;
  max-width: 48rem;
  margin: 0 auto;
}
.cb-section-wide {
  padding: 3rem 2rem 4rem;
  max-width: 56rem;
  margin: 0 auto;
}
.cb-section-wide-tight {
  padding: 2rem 2rem 4rem;
  max-width: 56rem;
  margin: 0 auto;
}
/* Short confirmation / thank-you pages */
.cb-section-confirmation {
  padding: 6rem 2rem;
  text-align: center;
  max-width: 36rem;
  margin: 0 auto;
}
.cb-confirm-icon {
  font-size: 3rem;
  color: var(--retail-primary);
  margin-bottom: 1rem;
}
.cb-confirm-title { margin-bottom: 1rem; }

/* Grouped download / exercise lists ------------------------------------- */
.cb-section-group { margin-bottom: 2.5rem; }
.cb-group-title {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* Centred button row (hero-free CTAs) ----------------------------------- */
.cb-actions-center {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Eyebrow on the dark "results" band ------------------------------------ */
.cb-eyebrow-inverse { color: rgba(255,255,255,0.7); }

/* Three-up results grid (retail default is 2-up/4-up responsive) --------- */
.cb-results-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Forms ----------------------------------------------------------------- */
.cb-form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cb-form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.cb-form-row-3 {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
}
.cb-form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--retail-gray-700);
  margin-bottom: 0.25rem;
}
.cb-required { color: var(--retail-accent); }
.cb-form-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
}
.cb-form-textarea { resize: vertical; }
.cb-form-check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.cb-form-check { margin-top: 0.25rem; }
.cb-form-check-label {
  font-size: 0.8125rem;
  color: var(--retail-gray-600);
  line-height: 1.5;
}
.cb-form-divider {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 0.5rem 0;
}
.cb-form-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--retail-gray-900);
}
.cb-form-hint {
  font-size: 0.75rem;
  color: var(--retail-gray-500);
  margin-top: 0.25rem;
}
.cb-form-alert {
  color: var(--retail-accent);
  font-weight: 600;
  text-align: center;
  margin-bottom: 1rem;
}
.cb-form-submit-row { margin-top: 0.5rem; }
.cb-form-submit {
  width: 100%;
  cursor: pointer;
}

/* ===== The Book — landing page (app/views/clueless_book/index.html.erb) ===== */
.cb-hero-cover {
  display: flex;
  align-items: center;
  justify-content: center;
}
.cb-hero-cover-img {
  max-height: 420px;
  border-radius: 0.5rem;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
/* Single-column provider band (retail default is 320px + 1fr at >=1024px) */
.cb-provider-inner-single {
  grid-template-columns: 1fr;
  max-width: 56rem;
}
/* Centred provider band — keeps the retail grid columns untouched */
.cb-provider-inner-centered {
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 56rem;
}
.cb-section-title { margin-bottom: 2rem; }

.cb-quote {
  font-size: 0.9375rem;
  color: var(--retail-gray-700);
  line-height: 1.7;
  font-style: italic;
  border-left: 3px solid var(--retail-accent);
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}
.cb-quote-attrib {
  font-size: 0.8125rem;
  color: var(--retail-gray-600);
}
.cb-quote-attrib--spaced { margin-bottom: 2rem; }

.cb-toc-actions { margin-top: 1.5rem; }

.cb-quicklinks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  width: 100%;
}
.cb-quicklink {
  padding: 1.5rem 1rem;
  background: var(--retail-gray-50);
  border-radius: 0.5rem;
  text-decoration: none;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: all 0.2s;
}
.cb-quicklink-icon {
  font-size: 1.25rem;
  color: var(--retail-primary);
  margin-bottom: 0.5rem;
  display: block;
}
.cb-quicklink-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--retail-gray-900);
}

/* ===== Endorsements (app/views/clueless_book/endorsements.html.erb) ===== */
.cb-endorsement {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #e5e7eb;
}
.cb-endorsement-quote {
  font-size: 1rem;
  color: var(--retail-gray-700);
  line-height: 1.8;
  font-style: italic;
  border-left: 3px solid var(--retail-accent);
  padding-left: 1.25rem;
  margin: 0 0 1rem;
}
.cb-endorsement-attrib {
  font-size: 0.875rem;
  color: var(--retail-gray-600);
  margin: 0;
}

/* ===== Exercises index (app/views/clueless_book/exercises.html.erb) ===== */
.cb-hero-link {
  color: white;
  text-decoration: underline;
}
.cb-exercise-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cb-exercise-item {
  padding: 0.75rem 1rem;
  background: var(--retail-gray-50);
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  color: var(--retail-gray-700);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.cb-exercise-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--retail-gray-400);
  min-width: 2rem;
}
.cb-exercise-link {
  color: var(--retail-primary);
  font-weight: 600;
  text-decoration: none;
}
.cb-exercise-icon {
  margin-right: 0.25rem;
  color: var(--retail-accent);
}

/* ===== Exercises portal, book owners (app/views/clueless_book/clueless.html.erb) ===== */
.cb-portal-intro {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.cb-portal-intro-text { flex: 1; }
.cb-portal-intro-media { flex-shrink: 0; }
.cb-portal-cover {
  width: 140px;
  border-radius: 0.375rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.cb-download-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cb-download-item {
  padding: 0.875rem 1rem;
  background: var(--retail-gray-50);
  border-radius: 0.375rem;
  border: 1px solid #e5e7eb;
}
.cb-download-link {
  color: var(--retail-primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9375rem;
}
.cb-download-icon {
  color: var(--retail-accent);
  margin-right: 0.5rem;
}
.cb-download-title {
  font-size: 0.9375rem;
  color: var(--retail-gray-700);
}
.cb-download-desc {
  font-size: 0.8125rem;
  color: var(--retail-gray-500);
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* NOTE: app/views/clueless_book/clueless_login.html.erb was NOT converted — the
   controller renders it with `layout: false`, so no stylesheet is loaded at all
   and its single `padding: 10px` inline style is load-bearing. See report. */

/* ===== Free chapter (app/views/clueless_book/free.html.erb) ===== */
.cb-free-chapter-figure {
  text-align: center;
  margin-bottom: 2rem;
}
.cb-free-chapter-img {
  max-width: 200px;
  margin: 0 auto;
}
.cb-form-footnote {
  font-size: 0.75rem;
  color: var(--retail-gray-500);
  text-align: center;
  margin-top: 1rem;
}

/* ===== Contact the authors (app/views/clueless_book/authors.html.erb) ===== */
.cb-authors-row {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-bottom: 2rem;
}
.cb-authors-item { text-align: center; }
.cb-authors-portrait {
  width: 120px;
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.cb-authors-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--retail-gray-700);
  margin-top: 0.5rem;
}
/* Closing line under the form — deliberately has NO line-height (unlike .cb-text) */
.cb-contact-outro {
  font-size: 0.9375rem;
  color: var(--retail-gray-700);
  text-align: center;
  margin-top: 2rem;
}


/* ===== Hero backgrounds =====
   These four used to be inline `background-image: url(<%= asset_path(…) %>)`
   attributes. `.retail-hero-bg` (retail/application.css) now carries the Retail
   default; each Clueless page overrides it with its own art. This file is
   linked after retail/application.css, so a single-class modifier wins. */
.cb-hero-bg--book { background-image: url("/assets/clueless/hero_book-1f8244a5.png"); }
.cb-hero-bg--model { background-image: url("/assets/clueless/hero_model-bbdd9444.png"); }
.cb-hero-bg--free { background-image: url("/assets/clueless/hero_free-f39b3a5d.png"); }
.cb-hero-bg--exercises { background-image: url("/assets/clueless/hero_exercises-aaa10bc0.png"); }
