/* ══════════════════════════════════════════════════════════════════════
   Tessly Academy guide — light editorial article surface.
   Centered type-led header, cinematic cover, hairline checklist rows;
   the brand navy is reserved for the Tessly-boundary band.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Article header — centered, type only ───────────────────────────── */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--background);
  padding: 160px 24px 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(29, 52, 84, 0.05) 1px, transparent 1px) 0 0 / 100% 36px,
    linear-gradient(90deg, rgba(29, 52, 84, 0.05) 1px, transparent 1px) 0 0 / 36px 100%;
  mask-image: linear-gradient(180deg, #000 20%, transparent 80%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% -24%, rgba(115, 153, 204, 0.16), transparent 70%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.breadcrumbs {
  display: flex;
  margin-bottom: 36px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted-foreground);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.breadcrumbs span[aria-hidden] {
  color: var(--border-strong);
}

.breadcrumbs a {
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--tessly-navy);
}

.hero .eyebrow {
  display: flex;
  margin: 0 0 20px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--tessly-navy);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  background: var(--tessly-blue);
}

.hero h1,
.hero-lede,
.article-body h2,
.article-body h3,
.article-body p,
.article-body li {
  text-wrap: pretty;
}

.hero h1 {
  margin: 0;
  color: var(--tessly-navy);
  font-size: clamp(32px, 4.2vw, 50px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.hero-lede {
  max-width: 34em;
  margin: 26px auto 0;
  color: var(--muted-foreground);
  font-size: 16.5px;
  line-height: 1.9;
}

.hero-meta {
  display: flex;
  margin-top: 30px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  color: var(--muted-foreground);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
}

.hero-meta span + span::before {
  content: "/";
  margin-right: 18px;
  color: var(--border-strong);
}

.hero-media {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  margin: 56px auto 0;
}

.hero-media img {
  width: 100%;
  height: auto;
  aspect-ratio: 21 / 9;
  border: 1px solid var(--border);
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 32px 64px -40px rgba(15, 23, 42, 0.3);
}

.hero-media figcaption {
  margin: 0;
  padding: 16px 4px 0;
  color: var(--muted-foreground);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}

/* ── Layout — sticky TOC + 720px measure ────────────────────────────── */

.article-layout {
  display: grid;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 96px 0 128px;
  grid-template-columns: 200px minmax(0, 720px);
  justify-content: space-between;
  gap: 72px;
}

.contents {
  position: sticky;
  top: 104px;
  display: grid;
  align-self: start;
  gap: 2px;
}

.contents-title {
  display: flex;
  margin: 0 0 14px;
  align-items: center;
  gap: 10px;
  color: var(--tessly-navy);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contents-title::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  background: var(--tessly-blue);
}

.contents a {
  border-left: 2px solid var(--border);
  padding: 7px 0 7px 16px;
  color: var(--muted-foreground);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.contents a:hover {
  border-color: var(--tessly-blue);
  color: var(--tessly-navy);
}

.article-body > section {
  scroll-margin-top: 96px;
}

/* ── Shared type inside the article ─────────────────────────────────── */

.section-kicker {
  display: flex;
  margin: 0 0 16px;
  align-items: center;
  gap: 10px;
  color: var(--tessly-navy);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  background: var(--tessly-blue);
}

.article-body h2 {
  margin: 0;
  color: var(--tessly-navy);
  font-size: clamp(25px, 3vw, 33px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.005em;
}

.article-body h3 {
  margin: 0;
  color: var(--tessly-navy);
  font-size: 18.5px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 0.005em;
}

.intro-note p,
.check-card p,
.tessly-boundary p,
.closing-cta p,
.faq p,
.answer-box > p:not(.section-kicker) {
  color: var(--muted-foreground);
  font-size: 15.5px;
  line-height: 1.9;
}

/* ── Answer box — the AEO snippet card ──────────────────────────────── */

.answer-box {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(rgba(29, 52, 84, 0.035) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(29, 52, 84, 0.035) 1px, transparent 1px) 0 0 / 28px 100%,
    #ffffff;
  padding: clamp(32px, 4.5vw, 52px);
}

.answer-box > p:not(.section-kicker) {
  margin: 20px 0 0;
}

.answer-points {
  display: grid;
  margin: 28px 0 0;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
  list-style: none;
}

.answer-points li {
  position: relative;
  padding-left: 22px;
  color: var(--tessly-navy);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.6;
}

.answer-points li::before {
  content: "";
  position: absolute;
  top: 0.5em;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--tessly-blue);
}

/* ── Intro note ─────────────────────────────────────────────────────── */

.intro-note {
  margin-top: 72px;
  border-left: 2px solid var(--tessly-blue);
  padding-left: 28px;
}

.intro-note h2 {
  font-size: 21px;
}

.intro-note p {
  margin: 14px 0 0;
}

/* ── Check groups — hairline rows, mono numbering ───────────────────── */

.check-group {
  margin-top: 112px;
}

.group-heading .section-kicker {
  margin-bottom: 18px;
}

.group-index {
  color: var(--tessly-blue-text);
}

.group-index::after {
  content: "/";
  margin: 0 10px;
  color: var(--border-strong);
}

.check-list {
  display: block;
  margin: 44px 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.check-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 24px;
  border-bottom: 1px solid var(--border);
  padding: 36px 0 40px;
}

.check-number {
  padding-top: 6px;
  color: var(--tessly-blue-text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.check-card p {
  margin: 12px 0 0;
}

.check-card .red-flag {
  margin-top: 18px;
  border-left: 2px solid #d9993f;
  border-radius: 0 8px 8px 0;
  background: #fbf5ec;
  padding: 14px 18px;
  color: #7c5325;
  font-size: 14px;
  line-height: 1.8;
}

.check-card .red-flag strong {
  color: #63411d;
}

/* ── Tessly boundary — the article's one navy moment ────────────────── */

.tessly-boundary {
  position: relative;
  display: grid;
  margin-top: 112px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--tessly-navy) 0%, var(--tessly-navy-deep) 100%);
  padding: clamp(36px, 5vw, 56px);
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  color: #ffffff;
}

.tessly-boundary::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(115, 153, 204, 0.07) 1px, transparent 1px) 0 0 / 100% 32px,
    linear-gradient(90deg, rgba(115, 153, 204, 0.07) 1px, transparent 1px) 0 0 / 32px 100%;
  mask-image: linear-gradient(180deg, #000, transparent 92%);
  pointer-events: none;
}

.tessly-boundary > * {
  position: relative;
  z-index: 1;
}

.tessly-boundary .section-kicker {
  color: #bcd3f2;
}

.tessly-boundary h2 {
  max-width: 16em;
  color: #ffffff;
  text-wrap: balance;
}

.tessly-boundary p {
  max-width: 44em;
  margin: 16px 0 0;
  color: #a8bcd8;
}

.tessly-boundary .boundary-note {
  color: #8095b4;
  font-size: 13.5px;
}

.tessly-boundary .button {
  justify-self: start;
}

/* ── FAQ ────────────────────────────────────────────────────────────── */

.faq {
  margin-top: 112px;
}

.faq h2 {
  margin-bottom: 28px;
}

.faq details {
  border-top: 1px solid var(--border);
}

.faq details:last-child {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  cursor: pointer;
  list-style: none;
  padding: 24px 0;
  color: var(--tessly-navy);
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.6;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex-shrink: 0;
  color: var(--tessly-blue-text);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
}

.faq details[open] summary::after {
  content: "−";
}

.faq details p {
  margin: 0;
  padding: 0 48px 26px 0;
}

/* ── Sources ────────────────────────────────────────────────────────── */

.sources {
  margin-top: 96px;
  border-top: 1px solid var(--border);
  padding-top: 40px;
}

.sources h2 {
  font-size: 18px;
}

.sources p {
  margin: 12px 0 0;
  color: var(--muted-foreground);
  font-size: 13.5px;
  line-height: 1.8;
}

.sources ul {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding-left: 20px;
}

.sources li {
  color: var(--muted-foreground);
  font-size: 13.5px;
  line-height: 1.8;
}

.sources a {
  color: var(--muted-foreground);
  text-decoration-color: var(--border-strong);
}

.sources a:hover {
  color: var(--tessly-navy);
  text-decoration-color: var(--tessly-blue);
}

/* ── Closing CTA ────────────────────────────────────────────────────── */

.closing-cta h2 {
  text-wrap: balance;
}

.closing-cta {
  margin-top: 96px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background:
    linear-gradient(rgba(29, 52, 84, 0.035) 1px, transparent 1px) 0 0 / 100% 28px,
    linear-gradient(90deg, rgba(29, 52, 84, 0.035) 1px, transparent 1px) 0 0 / 28px 100%,
    #ffffff;
  padding: clamp(32px, 5vw, 56px);
}

.closing-cta p:not(.section-kicker) {
  max-width: 40em;
  margin: 16px 0 0;
}

.button-row {
  display: flex;
  margin-top: 32px;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* ── Buttons ────────────────────────────────────────────────────────── */

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 22px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.button:active {
  transform: translateY(1px);
}

.button-primary {
  border-color: var(--primary-deep);
  background: var(--primary-deep);
  color: #ffffff;
}

.button-primary:hover {
  border-color: #1e40af;
  background: #1e40af;
}

.tessly-boundary .button-primary {
  border-color: #ffffff;
  background: #ffffff;
  color: var(--tessly-navy);
}

.tessly-boundary .button-primary:hover {
  border-color: #e4edf9;
  background: #e4edf9;
}

.button-secondary {
  border-color: var(--border-strong);
  background: #ffffff;
  color: var(--foreground);
}

.button-secondary:hover {
  border-color: var(--tessly-blue);
  color: var(--tessly-navy);
}

/* ── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero {
    padding-top: 140px;
  }

  .article-layout {
    grid-template-columns: 1fr;
    padding-top: 72px;
    gap: 56px;
  }

  .contents {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 16px;
  }

  .contents-title {
    grid-column: 1 / -1;
  }

  .contents a {
    border-left: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
  }
}

@media (max-width: 620px) {
  .hero {
    padding: 124px 18px 0;
  }

  .hero-copy {
    text-align: left;
  }

  .breadcrumbs,
  .hero .eyebrow,
  .hero-meta {
    justify-content: flex-start;
  }

  .hero h1 {
    font-size: clamp(28px, 8vw, 36px);
  }

  .hero-lede {
    margin-left: 0;
    font-size: 15.5px;
  }

  .hero-media {
    margin-top: 40px;
  }

  .hero-media img {
    aspect-ratio: 16 / 9;
    border-radius: 12px;
  }

  .hero-media figcaption {
    text-align: left;
  }

  .article-layout {
    width: calc(100% - 36px);
    padding-top: 56px;
  }

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

  .contents-title {
    grid-column: auto;
  }

  .answer-box,
  .closing-cta {
    padding: 28px 22px;
  }

  .answer-points {
    grid-template-columns: 1fr;
  }

  .check-card {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 30px 0 34px;
  }

  .check-number {
    padding-top: 0;
  }

  .faq details p {
    padding-right: 0;
  }

  .button-row {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
    min-height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .contents a {
    transition: none;
  }
}
