/* ============================================================
 * Neurotype V2 — Reusable Section Patterns
 * Hero base, page hero variant, intro prose, CTA
 * ========================================================== */

/* Shared hero curve height */
:root { --hero-curve-height: 70px; }

/* ---- Hero base (homepage full-viewport) ---- */
.hero {
  --hero-mobile-position: center center;
  padding-top: var(--space-10);
  padding-bottom: var(--space-8);
  background-size: cover;
  background-position: 40% 20%;
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
}

.hero-curve {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: var(--hero-curve-height);
  z-index: 1;
  display: block;
  width: 100%;
}

.hero-grid {
  position: relative;
  z-index: 1;
}

/* ---- Scroll indicator (mobile-only) ---- */
.hero-scroll-hint {
  display: none;
}

@media (max-width: 768px) {
  .hero-scroll-hint {
    display: flex;
    justify-content: center;
    position: absolute;
    bottom: calc(var(--hero-curve-height) + var(--space-2));
    left: 0;
    right: 0;
    z-index: 2;
    pointer-events: none;
    animation: scroll-bounce 2s ease-in-out infinite;
  }

  .hero-scroll-hint svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
    opacity: 0.45;
    filter: drop-shadow(0 1px 2px rgba(255,255,255,0.5));
  }

  @keyframes scroll-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(5px); }
  }
}

/* ---- Page hero (inner pages) ---- */
.page-hero {
  --hero-mobile-position: center center;
  padding-top: var(--space-11);
  padding-bottom: var(--space-11);
  background: var(--bg-secondary-translucent);
  position: relative;
  min-height: 70vh;
}

.page-hero .section {
  max-width: var(--prose-narrow-max-width);
  margin-right: auto;
  margin-left: var(--space-7);
}

.page-hero .breadcrumbs {
  justify-content: flex-start;
  margin-bottom: var(--space-5);
}

.page-hero .overline {
  margin-bottom: var(--space-3);
}

.page-hero h1 {
  margin-bottom: var(--space-4);
}

.page-hero .hero-subtitle {
  max-width: var(--prose-narrow-max-width);
}

@media (min-width: 769px) {
  .page-hero .section {
    margin-left: calc((100% - var(--content-max-width)) / 2 + var(--space-7));
  }
}

@media (max-width: 768px) {
  .page-hero .section {
    margin-left: auto;
  }

}

.page-hero-curve {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: var(--hero-curve-height);
  z-index: 1;
  display: block;
  width: 100%;
}

/* ---- Breadcrumbs ---- */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-5);
}

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

.breadcrumbs a:hover {
  color: var(--neurotype-accent-primary);
}

.breadcrumbs [aria-hidden="true"] {
  color: var(--text-muted);
  font-size: var(--text-caption);
}

.breadcrumbs [aria-current="page"] {
  color: var(--text-secondary);
  font-size: var(--text-caption);
}

/* ---- Intro prose ---- */
.intro-section {
  padding-top: var(--space-9);
  padding-bottom: var(--space-9);
  position: relative;
}

.intro-section h2 {
  margin-bottom: var(--space-6);
}

/* ---- Intro with photo ---- */
.intro-with-photo {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-8);
  align-items: center;
}

.intro-photo-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Photo with organic blob shape and running stitch border */
.intro-headshot-frame {
  position: relative;
  width: 280px;
  height: 330px;
}

.intro-headshot-frame::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 65% 35% 45% 55% / 40% 60% 50% 50%;
  border: 2px dashed var(--neurotype-accent-primary);
  opacity: 0.6;
}

.intro-headshot {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  border-radius: 65% 35% 45% 55% / 40% 60% 50% 50%;
  display: block;
}

.intro-byline-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

@media (max-width: 768px) {
  .intro-with-photo {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .intro-photo-col {
    order: 2;
    align-items: center;
  }

  .intro-prose {
    order: 1;
  }

  .intro-headshot-frame {
    width: 180px;
    height: 220px;
  }

  .intro-byline {
    justify-content: flex-start;
  }

  .intro-byline-chips {
    justify-content: flex-start;
  }
}

.intro-prose {
  max-width: var(--prose-max-width);
}

.intro-prose p {
  margin-bottom: var(--space-5);
}

.intro-prose p:last-child {
  margin-bottom: 0;
}

.intro-byline {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.intro-byline-name {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text-heading);
}

.intro-byline-title {
  font-size: var(--text-caption);
  color: var(--text-muted);
}

.intro-byline a {
  font-size: var(--text-caption);
  text-decoration: none;
  font-weight: 500;
}

/* ---- CTA section ---- */
.cta-section {
  padding-top: var(--space-10);
  padding-bottom: var(--space-10);
  text-align: center;
  background: var(--bg-secondary-translucent);
}

.cta-section h2 {
  font-size: var(--text-h2);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.cta-section p {
  margin: 0 auto var(--space-6);
}

.cta-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

@media (max-width: 768px) {
  .cta-section {
    text-align: left;
  }
}

/* ---- Content sections with alternating backgrounds ---- */
.section-alt {
  background: var(--bg-secondary-translucent);
}

/* ---- Section vertical rhythm ---- */
.content-section {
  padding-top: var(--space-9);
  padding-bottom: var(--space-9);
}

.content-section h2 {
  margin-bottom: var(--space-6);
}

.content-section h3 {
  margin-bottom: var(--space-4);
}

/* ---- Two-column prose + image grid ---- */
.prose-image-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-7);
  align-items: center;
}

.prose-image-grid.image-first {
  grid-template-columns: 1fr 2fr;
}

.prose-image-grid img {
  width: 100%;
  border-radius: var(--radius-md);
  object-fit: cover;
}

@media (max-width: 768px) {
  .prose-image-grid,
  .prose-image-grid.image-first {
    grid-template-columns: 1fr;
  }
  .prose-image-grid.image-first > :first-child {
    order: 2;
  }
}

/* ---- Card grid utilities ---- */
.card-grid-2 {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.challenges-grid {
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 768px) {
  .challenges-grid {
    grid-template-columns: 1fr;
  }
}

.card-grid-3 {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

/* ---- Section icon colour ---- */
.content-section .card-body svg,
.section-icon {
  width: var(--space-6);
  height: var(--space-6);
  color: var(--neurotype-accent-primary);
  margin-bottom: var(--space-4);
}

/* ---- Prose sections: max-width constraint for readability ---- */
.prose-section {
  max-width: var(--prose-max-width);
}

.prose-section p {
  margin-bottom: var(--space-5);
}

.prose-section p:last-child {
  margin-bottom: 0;
}

.prose-section .panel {
  margin-top: var(--space-6);
}

/* ---- Interest tags / chip row ---- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ---- Mobile spacing overrides ---- */
@media (max-width: 768px) {
  :root { --hero-curve-height: 35px; }

  .hero {
    min-height: 85svh;
    padding-top: var(--space-11);
    padding-bottom: var(--space-7);
    background-position: var(--hero-mobile-position);
    align-items: flex-start;
  }

  .page-hero {
    min-height: auto;
    padding-top: var(--space-10);
    padding-bottom: var(--space-8);
    background-position: var(--hero-mobile-position);
  }

  .content-section {
    padding-top: var(--space-7);
    padding-bottom: var(--space-7);
  }

  .intro-section {
    padding-top: var(--space-7);
    padding-bottom: var(--space-7);
  }

  .cta-section {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
  }
}

/* ---- Parent quote grid (Sound familiar?) ---- */
.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-8) var(--space-5);
  margin-top: var(--space-6);
  position: relative;
  padding-left: var(--space-8);
}

.quote-grid::before {
  content: "\201C";
  position: absolute;
  top: -0.15em;
  left: 0;
  font-size: 5rem;
  line-height: 1;
  color: var(--neurotype-accent-primary);
  opacity: 0.35;
  font-family: Georgia, serif;
}

.parent-quote {
  font-style: italic;
  font-size: var(--text-body);
  color: var(--text-secondary);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .quote-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .quote-grid {
    grid-template-columns: 1fr;
  }
}
