/* ============================================================
   SEOTpreneur Clickstream Traffic Journey - styles.css
   Mobile-first, calm + readable, no frameworks.
   Custom properties live in :root so they are easy to tweak.
   ============================================================ */

:root {
  /* Colors - restrained, warm palette */
  --color-bg: #faf7f2;          /* warm cream */
  --color-surface: #ffffff;     /* card / section alt */
  --color-surface-alt: #f3eee5; /* subtle banding */
  --color-text: #1f2024;        /* near-black, slightly warm */
  --color-text-muted: #545861;
  --color-border: #e3ddd1;
  --color-accent: #2f6f6a;      /* muted deep teal */
  --color-accent-hover: #245550;
  --color-accent-soft: #e6efed;
  --color-highlight: #b46a2a;   /* warm amber for BEST VALUE */
  --color-highlight-soft: #fbf1e3;
  --color-link: var(--color-accent);
  --color-link-hover: var(--color-accent-hover);
  --color-focus: #b46a2a;

  /* Typography */
  --font-serif: Georgia, "Iowan Old Style", Cambria, "Times New Roman", Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-base: 1.0625rem;   /* 17px */
  --fs-lead: 1.15rem;
  --fs-small: 0.95rem;
  --fs-h1: clamp(2rem, 4.8vw + 1rem, 3.25rem);
  --fs-h2: clamp(1.55rem, 2.4vw + 1rem, 2.1rem);
  --fs-h3: clamp(1.2rem, 1.2vw + 1rem, 1.4rem);
  --lh-base: 1.65;
  --lh-tight: 1.25;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Layout */
  --container-width: 68rem;
  --container-narrow: 44rem;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(31, 32, 36, 0.04), 0 1px 1px rgba(31, 32, 36, 0.03);
  --shadow-md: 0 4px 12px rgba(31, 32, 36, 0.06), 0 2px 4px rgba(31, 32, 36, 0.04);
  --shadow-lg: 0 10px 30px rgba(31, 32, 36, 0.08), 0 4px 8px rgba(31, 32, 36, 0.04);
}

/* ---------- Base ---------- */
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem; /* offset for sticky header if used */
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Allow sections to bleed left/right to viewport edges without horizontal
     scrollbars. overflow-x: clip does not create a scroll container, so the
     sticky header keeps working. */
  overflow-x: clip;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover {
  color: var(--color-link-hover);
}
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--color-text);
  color: #fff;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  z-index: 100;
  text-decoration: none;
}

/* ---------- Layout containers ---------- */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}
.prose {
  max-width: var(--container-narrow);
  margin-inline: auto;
}

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
  /* Tiny inner shadow on scroll feel */
  -webkit-backdrop-filter: saturate(120%);
  backdrop-filter: saturate(120%);
}
.nav {
  max-width: var(--container-width);
  margin-inline: auto;
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  font-weight: 600;
  max-width: 70%; /* leave room for the menu toggle on narrow screens */
}
.nav-brand-text {
  font-size: 0.95rem;
  line-height: 1.25;
}
@media (min-width: 800px) {
  .nav-brand { max-width: none; }
  .nav-brand-text { font-size: 1rem; }
}
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 1.1rem;
  height: 2px;
  background: var(--color-text);
  margin: 0 auto;
  border-radius: 2px;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  width: 100%;
  flex-direction: column;
  gap: var(--space-1);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-3);
  margin-top: var(--space-3);
}
.nav-list.open {
  display: flex;
}
.nav-list a {
  display: block;
  padding: 0.7rem 0.4rem;
  font-size: 1rem;
  text-decoration: none;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  min-height: 44px; /* mobile tap target */
  line-height: 1.4;
}
.nav-list a:hover {
  color: var(--color-accent);
}
.nav-list a.nav-cta {
  background: var(--color-accent);
  color: #fff;
  text-align: center;
  font-weight: 600;
  padding: 0.7rem 1rem;
  margin-top: 0.3rem;
}
.nav-list a.nav-cta:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

@media (min-width: 800px) {
  .nav-toggle { display: none; }
  .nav-list {
    display: flex;
    flex-direction: row;
    width: auto;
    border-top: none;
    padding-top: 0;
    margin-top: 0;
    align-items: center;
    gap: var(--space-2);
  }
  .nav-list a {
    padding: 0.5rem 0.7rem;
    min-height: 0;
  }
  .nav-list a.nav-cta {
    margin-top: 0;
    margin-left: var(--space-2);
  }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--color-text);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-4);
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 {
  font-size: var(--fs-h1);
  margin-bottom: var(--space-5);
}
h2 {
  font-size: var(--fs-h2);
  margin-top: 0;
  margin-bottom: var(--space-4);
}
h3 {
  font-size: var(--fs-h3);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}
p {
  margin: 0 0 var(--space-4);
}
ul, ol {
  margin: 0 0 var(--space-5);
  padding-left: 1.25rem;
}
li {
  margin-bottom: var(--space-2);
}
li::marker {
  color: var(--color-text-muted);
}
strong {
  font-weight: 600;
  color: var(--color-text);
}
blockquote {
  margin: var(--space-5) 0;
  padding: var(--space-4) var(--space-5);
  background: var(--color-accent-soft);
  border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
blockquote p { margin: 0; }
.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-accent);
  margin: 0 0 var(--space-4);
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-7) 0 var(--space-7);
  background: var(--color-bg);
}
.hero-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  align-items: stretch; /* image column matches text column height */
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-copy p {
  font-size: var(--fs-lead);
  color: var(--color-text);
}
.hero-figure {
  margin: 0;
  min-width: 0; /* allow grid track to shrink instead of forcing overflow on mobile */
}
.hero-figure img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  background: #fff;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}
@media (min-width: 900px) {
  .hero {
    padding: var(--space-9) 0;
    overflow-x: clip; /* contain the image bleed without affecting sticky nav */
  }
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
    gap: var(--space-8);
  }
  /* On desktop the figure fills the text column height. We let it bleed
     all the way to the right edge of the viewport using a negative right
     margin computed from the centered container's offset:
       50% (of the container's content box) - 50vw  ==  -(viewport-container)/2
     and the image is left-justified so the meaningful part stays visible. */
  .hero-figure {
    height: 100%;
    display: flex;
    margin-right: calc(50% - 50vw);
  }
  .hero-figure img {
    aspect-ratio: auto;
    height: 100%;
    width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: left center;
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  }
}

/* ---------- Split block (reusable hero-style 2-column with right-bleed image) ---------- */
.split {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  align-items: stretch;
}
.split-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: var(--container-narrow);
}
.split-figure {
  margin: 0;
  min-width: 0;
}
.split-figure img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  background: #fff;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}
.split-figure .image-trigger {
  display: flex;
  width: 100%;
}
@media (min-width: 900px) {
  .split {
    grid-template-columns: 1.05fr 1fr;
    gap: var(--space-8);
  }
  /* Image fills the text column height and bleeds to the viewport's right edge.
     The image stays left-justified so its meaningful content remains visible. */
  .split-figure {
    height: 100%;
    display: flex;
    margin-right: calc(50% - 50vw);
  }
  .split-figure .image-trigger {
    height: 100%;
  }
  .split-figure img {
    aspect-ratio: auto;
    height: 100%;
    width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: left center;
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  }
}

/* ---------- Sections ---------- */
.section {
  padding: var(--space-7) 0;
}
.section-alt {
  background: var(--color-surface-alt);
}
@media (min-width: 800px) {
  .section { padding: var(--space-8) 0; }
}

/* ---------- TOC ---------- */
.toc {
  padding: var(--space-6) 0 var(--space-7);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.toc h2 {
  font-size: 1.25rem;
  margin-bottom: var(--space-4);
}
.toc-list {
  columns: 1;
  column-gap: var(--space-6);
  padding-left: 1.4rem;
  margin: 0;
}
.toc-list li {
  break-inside: avoid;
  margin-bottom: var(--space-2);
}
.toc-list a {
  text-decoration: none;
  color: var(--color-text);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
}
.toc-list a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}
@media (min-width: 700px) {
  .toc-list { columns: 2; }
}

/* ---------- Inline figure (image2) ---------- */
.inline-figure {
  margin: 0 0 var(--space-6);
}
.inline-figure img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  background: #fff;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  width: 100%;
}

/* image2: sits inside .prose (max-width 44rem) but breaks out to 80vw and
   stays horizontally centered relative to the viewport. The math:
     50% (of .prose) is the viewport center (since .prose is centered);
     subtracting 40vw shifts the figure's left edge to "viewport_center - 40vw",
     making it 80vw wide and centered.
   The image is shown FULL (no cropping) — aspect ratio follows the source. */
.inline-figure-full-bleed {
  width: 80vw;
  max-width: none;
  margin-left: calc(50% - 40vw);
  margin-right: calc(50% - 40vw);
  margin-top: var(--space-4);
  margin-bottom: var(--space-7);
}
.inline-figure-full-bleed img {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 12px 28px rgba(31, 32, 36, 0.10), 0 4px 10px rgba(31, 32, 36, 0.05);
}

/* ---------- Image trigger (button wrapping a clickable image) ---------- */
.image-trigger {
  display: block;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.image-trigger img {
  display: block;
  width: 100%;
}
.image-trigger:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
  border-radius: var(--radius-md);
}
/* Inside the hero figure the button needs to also fill the available height */
.hero-figure .image-trigger {
  display: flex;
  height: 100%;
  width: 100%;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 22, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: var(--space-5);
}
.lightbox.open {
  display: flex;
}
.lightbox-image {
  max-width: min(100%, 1600px);
  max-height: 90vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  background: #fff;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  font-size: 1.5rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, transform 0.05s ease;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
.lightbox-close:active {
  transform: translateY(1px);
}
.lightbox-close:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .lightbox, .lightbox-close { transition: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  min-height: 44px;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
  border-color: var(--color-accent-hover);
}
.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-secondary:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

/* ---------- Next steps / CTA cards ---------- */
.section-next-steps {
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}
.cta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-top: var(--space-6);
}
@media (min-width: 900px) {
  .cta-grid {
    grid-template-columns: 1fr 1fr 1fr;
    /* Stretch the row to 80vw on desktop, but never narrower than the
       surrounding container content area. The max() keeps the cards visually
       wider than the prose blocks above and below. */
    width: max(100%, 80vw);
    margin-left: calc((100% - max(100%, 80vw)) / 2);
    margin-right: calc((100% - max(100%, 80vw)) / 2);
  }
}

/* "If you don't have a report yet" block sits below the cards in regular prose */
.no-report {
  margin-top: var(--space-8);
}
.no-report h3 {
  margin-top: 0;
}
.cta-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.cta-card h3 {
  margin-top: 0;
  margin-bottom: var(--space-3);
}
.cta-card-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: var(--space-3);
}
.cta-card-subtitle {
  color: var(--color-text-muted);
  margin-top: -0.5rem;
  font-style: italic;
}
.cta-card-price {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0;
}
.cta-card-highlight {
  background: var(--color-highlight-soft);
  border-color: var(--color-highlight);
  box-shadow: var(--shadow-md);
}
.cta-card-ribbon {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: var(--color-highlight);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.cta-card-highlight .cta-card-eyebrow {
  color: var(--color-highlight);
}
.cta-card .btn {
  margin-top: var(--space-2);
}

/* ---------- Closing ---------- */
.section-closing {
  background: var(--color-surface-alt);
  border-top: 1px solid var(--color-border);
}
.section-closing h2 {
  text-align: center;
}

/* ---------- "Next steps →" link repeated at the bottom of each section ---------- */
.next-steps-link {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  text-align: right;
  margin-top: var(--space-6);
  margin-bottom: 0;
  color: var(--color-text-muted);
}
.next-steps-link a {
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-bottom-color 0.15s ease;
}
.next-steps-link a:hover,
.next-steps-link a:focus-visible {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* ---------- Selection ---------- */
::selection {
  background: var(--color-accent);
  color: #fff;
}
