/*
 * Content Sections — Apple-Inspired Full Redesign
 * =================================================
 * Covers all 17 pages: 13 calculators + about, contact, privacy, terms.
 * Applied on top of style.css and apple-design.css.
 *
 * Sections:
 *  A. Page Hero — all corporate + calculator pages
 *  B. Content section typography & spacing
 *  C. Key stat callouts (first <strong> in section)
 *  D. Section headings with Apple-style accent
 *  E. Data tables — extended polish
 *  F. About page — formula source grid + mission stats
 *  G. Contact page — Apple HIG form + info cards
 *  H. Privacy / Terms — document prose + TOC sidebar
 *  I. Calculator content — inline stat cards
 *  J. Reading progress indicator
 */

/* ═══════════════════════════════════════════════════════
   A. PAGE HERO — applies to all /about /contact /privacy /terms
   ═══════════════════════════════════════════════════════ */

.page-hero {
  background:
    radial-gradient(ellipse 100% 70% at 70% -20%, rgba(0,122,255,.07) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at -10% 90%, rgba(0,196,216,.05) 0%, transparent 50%),
    linear-gradient(160deg, #EEF6FF 0%, #F6FAFF 60%, #ECF5FA 100%);
  padding: 48px 0 56px;
  border-bottom: 1px solid rgba(0,0,0,.06);
  position: relative;
  overflow: hidden;
}

.page-hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 32px;
  background: linear-gradient(to bottom, transparent, #fff);
  pointer-events: none;
}

.page-hero h1 {
  font-size: clamp(1.875rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -.035em;
  color: #1C1C1E;
  margin-bottom: 14px;
  line-height: 1.1;
}

.page-hero .meta-desc {
  font-size: 1.0625rem;
  color: #6C6C70;
  max-width: 600px;
  line-height: 1.7;
}

/* Hero breadcrumb */
.page-hero .breadcrumb {
  margin-bottom: 14px;
}

/* Decorative watermark numeral for legal pages */
.page-hero[data-pagetype="legal"]::before {
  content: attr(data-initial);
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  font-size: clamp(120px, 20vw, 200px);
  font-weight: 900;
  color: rgba(0,122,255,.04);
  line-height: 1;
  letter-spacing: -.05em;
  pointer-events: none;
  user-select: none;
}

/* ═══════════════════════════════════════════════════════
   B. CONTENT SECTION TYPOGRAPHY & SPACING
   ═══════════════════════════════════════════════════════ */

.content-section {
  padding: 64px 0;
}

.content-section + .content-section {
  padding-top: 0;
}

.content-section--alt {
  background: #F7FAFE;
  border-top: 1px solid rgba(0,0,0,.04);
  border-bottom: 1px solid rgba(0,0,0,.04);
}

/* Section h2 — Apple-style large chapter heading */
.content-section h2,
.section h2,
.prose h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -.035em;
  color: #1C1C1E;
  margin-bottom: 20px;
  margin-top: 56px;
  line-height: 1.2;
  position: relative;
}

.content-section h2:first-child,
.prose h2:first-child {
  margin-top: 0;
}

/* h2 accent line */
.content-section h2::after,
.prose h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #007AFF, rgba(0,122,255,.3));
  border-radius: 2px;
  margin-top: 10px;
}

/* Section h3 — Medium-weight chapter sub-head */
.content-section h3,
.prose h3 {
  font-size: clamp(1.125rem, 2.2vw, 1.375rem);
  font-weight: 700;
  letter-spacing: -.02em;
  color: #1C1C1E;
  margin-top: 44px;
  margin-bottom: 14px;
  line-height: 1.3;
}

/* Body prose paragraphs */
.content-section p,
.prose p {
  font-size: 1.0rem;
  line-height: 1.8;
  color: #3C3C43;
  margin-bottom: 20px;
}

.prose a {
  color: #007AFF;
  font-weight: 500;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.prose a:hover {
  color: #0056CC;
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════════════
   C. KEY STAT CALLOUT BOXES
   Added by JS to the first <strong> sentence in each h3 section
   ═══════════════════════════════════════════════════════ */

.key-stat-callout {
  background: linear-gradient(135deg, #EFF6FF 0%, #F0F9FF 100%);
  border: 1px solid rgba(0,122,255,.14);
  border-radius: 16px;
  padding: 20px 24px;
  margin: 0 0 24px 0;
  position: relative;
  overflow: hidden;
}

.key-stat-callout::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #007AFF 0%, #409CFF 100%);
  border-radius: 4px 0 0 4px;
}

.key-stat-callout p {
  margin: 0 !important;
  font-size: .9375rem !important;
  line-height: 1.65 !important;
  color: #1C1C1E !important;
  font-weight: 400;
}

.key-stat-callout strong {
  color: #007AFF;
  font-weight: 700;
}

/* Label above the callout */
.key-stat-callout::after {
  content: 'KEY FINDING';
  position: absolute;
  top: 14px; right: 16px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(0,122,255,.5);
}

/* ═══════════════════════════════════════════════════════
   D. SECTION HEADINGS — numbered + accent line variant
   ═══════════════════════════════════════════════════════ */

/* Chapter counter for prose pages */
.prose {
  counter-reset: prose-h2;
}

/* Inline stat chips — added by JS inside h3 paragraphs */
.stat-chip {
  display: inline-flex;
  align-items: center;
  background: rgba(0,122,255,.08);
  color: #007AFF;
  font-size: .75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  margin: 0 2px;
  vertical-align: middle;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════
   E. DATA TABLES — extended polish across all pages
   ═══════════════════════════════════════════════════════ */

.table-annotation {
  font-size: .875rem;
  color: #6C6C70;
  font-style: italic;
  margin-bottom: 10px;
}

/* Sticky first column for wide tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table td:first-child {
  font-weight: 600;
  color: #1C1C1E;
}

.data-table thead th:first-child {
  border-radius: 0;
}

/* Highlight row hover with blue tint */
.data-table tbody tr {
  transition: background .12s ease;
  cursor: default;
}

/* ═══════════════════════════════════════════════════════
   F. ABOUT PAGE — mission stats + formula source grid
   ═══════════════════════════════════════════════════════ */

/* Mission stats row — 3 numbers across */
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 40px 0;
}

.about-stat-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}

.about-stat-card:hover {
  transform: translateY(-3px);
}

.about-stat-num {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -.04em;
  color: #007AFF;
  line-height: 1;
  margin-bottom: 6px;
}

.about-stat-label {
  font-size: .875rem;
  color: #6C6C70;
  font-weight: 500;
  line-height: 1.4;
}

/* Formula source list → visual cards */
.prose ul.formula-sources {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0 32px;
}

.prose ul.formula-sources li {
  background: #F8FAFD;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: .875rem;
  color: #3C3C43;
  line-height: 1.5;
  margin: 0;
  border-left: 3px solid #007AFF;
  border-radius: 0 12px 12px 0;
  transition: background .15s ease;
}

.prose ul.formula-sources li:hover {
  background: #EFF6FF;
}

.prose ul.formula-sources li strong {
  display: block;
  font-weight: 700;
  color: #1C1C1E;
  margin-bottom: 2px;
  font-size: .8125rem;
}

/* Regular prose lists */
.prose ul:not(.formula-sources),
.prose ol {
  padding-left: 0;
  margin-bottom: 24px;
}

.prose ul:not(.formula-sources) li,
.prose ol li {
  position: relative;
  padding: 8px 0 8px 28px;
  border-bottom: 1px solid rgba(0,0,0,.04);
  font-size: .9375rem;
  line-height: 1.65;
  color: #3C3C43;
  margin-bottom: 0;
}

.prose ul:not(.formula-sources) li:last-child,
.prose ol li:last-child {
  border-bottom: none;
}

.prose ul:not(.formula-sources) li::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 17px;
  width: 6px;
  height: 6px;
  background: #007AFF;
  border-radius: 50%;
}

.prose ol {
  counter-reset: prose-ol;
}

.prose ol li {
  counter-increment: prose-ol;
  padding-left: 36px;
}

.prose ol li::before {
  content: counter(prose-ol);
  position: absolute;
  left: 6px;
  top: 7px;
  width: 20px;
  height: 20px;
  background: rgba(0,122,255,.1);
  color: #007AFF;
  font-size: .75rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════
   G. CONTACT PAGE — Apple HIG form + info layout
   ═══════════════════════════════════════════════════════ */

/* Contact page grid */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: start;
}

.contact-form-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 20px;
  padding: 36px 36px 40px;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
}

.contact-form-card h2 {
  font-size: 1.5rem !important;
  margin-top: 0 !important;
  margin-bottom: 8px !important;
}

.contact-form-card h2::after {
  display: none;
}

.contact-form-card > p {
  margin-bottom: 28px !important;
  color: #6C6C70 !important;
}

/* Form inputs inside contact */
.contact-form .form-group {
  margin-bottom: 20px;
}

.contact-form .form-input,
.contact-form select.form-input,
.contact-form textarea.form-input {
  background: #F8FAFC;
  border: 1.5px solid rgba(0,0,0,.08);
  border-radius: 12px;
  font-size: .9375rem;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.contact-form select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236C6C70' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.contact-form textarea.form-input {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.contact-form .form-input:focus,
.contact-form select.form-input:focus,
.contact-form textarea.form-input:focus {
  background: #fff;
  border-color: #007AFF;
  box-shadow: 0 0 0 4px rgba(0,122,255,.1);
  outline: none;
}

/* Submit button */
.btn-submit {
  display: block;
  width: 100%;
  padding: 15px 24px;
  background: #007AFF;
  background-image: linear-gradient(180deg, rgba(255,255,255,.12) 0%, transparent 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  letter-spacing: -.01em;
  box-shadow: 0 4px 16px rgba(0,122,255,.4);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,122,255,.45);
}

.btn-submit:active {
  transform: scale(.98);
  transition-duration: .08s;
}

/* Success state */
.contact-success {
  background: linear-gradient(135deg, #F0FFF4 0%, #E8FFF2 100%);
  border: 1px solid rgba(52,199,89,.25);
  border-radius: 14px;
  padding: 24px 28px;
  text-align: center;
}

.contact-success-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.contact-success h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1C1C1E;
  margin-bottom: 6px;
  margin-top: 0 !important;
}

.contact-success p {
  color: #6C6C70 !important;
  margin: 0 !important;
  font-size: .9375rem !important;
}

/* Contact info cards side */
.contact-info-side h2 {
  font-size: 1.25rem !important;
  margin-top: 0 !important;
  margin-bottom: 20px !important;
}

.contact-info-side h2::after { display: none; }

.contact-info-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-info-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 14px;
  padding: 16px 18px;
  transition: box-shadow .2s ease;
}

.contact-info-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

.contact-info-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0,122,255,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  flex-shrink: 0;
}

.contact-info-body { flex: 1; min-width: 0; }

.contact-info-title {
  font-size: .875rem;
  font-weight: 700;
  color: #1C1C1E;
  margin-bottom: 3px;
}

.contact-info-text {
  font-size: .875rem;
  color: #6C6C70;
  line-height: 1.5;
  margin: 0;
}

.contact-info-text a {
  color: #007AFF;
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════
   H. PRIVACY & TERMS — document layout with sidebar TOC
   ═══════════════════════════════════════════════════════ */

.legal-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}

/* TOC sidebar */
.legal-toc {
  position: sticky;
  top: 80px;
}

.legal-toc-title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(60,60,67,.45);
  margin-bottom: 12px;
}

.legal-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1.5px solid rgba(0,0,0,.08);
}

.legal-toc-list li {
  padding: 0;
  margin: 0;
  border: none !important;
}

.legal-toc-list li::before { display: none; }

.legal-toc-list a {
  display: block;
  padding: 7px 0 7px 16px;
  font-size: .84rem;
  font-weight: 500;
  color: #6C6C70;
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -1.5px;
  transition: color .15s ease, border-color .15s ease;
  line-height: 1.4;
}

.legal-toc-list a:hover,
.legal-toc-list a.active {
  color: #007AFF;
  border-left-color: #007AFF;
}

/* Legal prose */
.legal-prose h2 {
  font-size: 1.375rem;
  margin-top: 48px;
}

.legal-prose h2:first-child {
  margin-top: 0;
}

.legal-prose p,
.legal-prose li {
  font-size: .9375rem;
}

/* Effective date chip */
.legal-date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,122,255,.07);
  color: #007AFF;
  font-size: .8rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid rgba(0,122,255,.15);
  margin-bottom: 28px;
}

/* Legal disclaimer box */
.legal-disclaimer {
  background: #FFFBEB;
  border: 1px solid rgba(245,158,11,.25);
  border-radius: 12px;
  padding: 16px 20px;
  margin: 28px 0;
  font-size: .9rem;
  color: #92400E;
  line-height: 1.6;
}

.legal-disclaimer strong {
  color: #78350F;
}

/* ═══════════════════════════════════════════════════════
   I. CALCULATOR CONTENT — inline stat callout cards
   ═══════════════════════════════════════════════════════ */

/* Pull quote / key insight box — added by JS */
.content-insight {
  display: grid;
  grid-template-columns: 4px 1fr;
  gap: 0 18px;
  margin: 32px 0;
  align-items: stretch;
}

.content-insight-bar {
  background: linear-gradient(180deg, #007AFF 0%, #409CFF 100%);
  border-radius: 2px;
  width: 4px;
}

.content-insight-body {
  background: linear-gradient(135deg, #F0F7FF 0%, #F5FAFF 100%);
  border-radius: 0 14px 14px 0;
  border: 1px solid rgba(0,122,255,.1);
  border-left: none;
  padding: 18px 22px;
}

.content-insight-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: rgba(0,122,255,.6);
  margin-bottom: 6px;
}

.content-insight-text {
  font-size: .9375rem;
  font-weight: 500;
  color: #1C1C1E;
  line-height: 1.65;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════
   J. READING PROGRESS BAR
   ═══════════════════════════════════════════════════════ */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #007AFF 0%, #409CFF 100%);
  z-index: 9999;
  width: 0%;
  transition: width .1s linear;
  border-radius: 0 2px 2px 0;
}

/* Only show on content-heavy pages */
body.has-reading-progress .reading-progress {
  display: block;
}

/* ═══════════════════════════════════════════════════════
   K. HIGHLIGHT BOX (shared) — refined
   ═══════════════════════════════════════════════════════ */

.highlight-box {
  background: linear-gradient(135deg, rgba(0,122,255,.04) 0%, rgba(64,156,255,.03) 100%);
  border-left: 3px solid #007AFF;
  border-radius: 0 14px 14px 0;
  padding: 16px 20px;
  margin: 24px 0 0;
}

.highlight-box p {
  font-size: .9rem;
  color: #3C3C43;
  margin: 0;
  line-height: 1.65;
}

.highlight-box p strong {
  color: #1C1C1E;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════
   L. ABOUT PAGE — mission statement hero + source grid
   ═══════════════════════════════════════════════════════ */

.about-mission {
  font-size: 1.1875rem;
  font-weight: 500;
  color: #3C3C43;
  line-height: 1.75;
  border-left: 3px solid #007AFF;
  padding-left: 20px;
  margin: 28px 0;
}

/* ═══════════════════════════════════════════════════════
   M. FAQ — full expanded animation (replaces basic toggle)
   ═══════════════════════════════════════════════════════ */

.faq-answer {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height .35s cubic-bezier(.22,1,.36,1),
    opacity .25s ease,
    padding .25s ease;
  padding-top: 0;
  padding-bottom: 0;
}

details[open] > .faq-answer {
  max-height: 800px;
  opacity: 1;
  padding-bottom: 18px;
}

/* Prevent layout jump from details open/close */
details summary { display: flex; }
details summary::-webkit-details-marker { display: none; }

/* ═══════════════════════════════════════════════════════
   N. RESPONSIVE BREAKPOINTS — all content improvements
   ═══════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .legal-layout { grid-template-columns: 1fr; gap: 0; }
  .legal-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: #F4F7FC;
    border-radius: 12px;
    margin-bottom: 32px;
  }
  .legal-toc-title { width: 100%; margin-bottom: 8px; }
  .legal-toc-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-left: none;
  }
  .legal-toc-list li { display: inline-block; }
  .legal-toc-list a {
    border: 1.5px solid rgba(0,122,255,.2);
    border-left: 1.5px solid rgba(0,122,255,.2) !important;
    border-radius: 100px;
    padding: 5px 12px;
    margin: 0;
    font-size: .8rem;
    color: #007AFF;
    background: rgba(0,122,255,.05);
    white-space: nowrap;
  }
}

@media (max-width: 680px) {
  .content-section { padding: 48px 0; }
  .page-hero { padding: 32px 0 40px; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .prose ul.formula-sources { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-form-card { padding: 24px 20px 28px; }
  .key-stat-callout { padding: 16px 18px; }
  .key-stat-callout::after { display: none; }
}

@media (max-width: 440px) {
  .about-stats { grid-template-columns: 1fr; }
  .about-stat-num { font-size: 2rem; }
  .page-hero h1 { font-size: 1.75rem; }
}
