/* ==========================================================================
   Pages — Styles for static / utility pages (privacy, terms, contact, about, 404)
   Loaded by pages that do NOT load blog.css.
   ========================================================================== */

/* ==========================================================================
   Section 1: Breadcrumbs
   Duplicated from blog.css because pages don't load blog.css.
   ========================================================================== */

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-xs);
  font-size: var(--text-body-small);
  line-height: var(--text-body-small-lh);
  margin-bottom: var(--space-lg);
}

.breadcrumbs a {
  color: var(--color-text-tertiary);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

.breadcrumbs .breadcrumb-separator {
  color: var(--color-text-tertiary);
}

.breadcrumbs .breadcrumb-separator::after {
  content: '›';
}

.breadcrumbs .breadcrumb-current {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

/* ==========================================================================
   Section 2: Page Header
   Used on all static pages for title, optional description, breadcrumbs.
   ========================================================================== */

.page-header {
  padding-top: var(--space-xxl);
  padding-bottom: var(--space-xl);
}

.page-header h1 {
  font-size: var(--text-display-medium);
  line-height: var(--text-display-medium-lh);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
}

.page-header .page-meta {
  font-size: var(--text-body-medium);
  line-height: var(--text-body-medium-lh);
  color: var(--color-text-tertiary);
}

@media (min-width: 768px) {
  .page-header h1 {
    font-size: var(--text-display-large);
    line-height: var(--text-display-large-lh);
  }
}

/* ==========================================================================
   Section 3: Legal Content Typography
   Mirrors .post-content from blog.css for legal documents.
   ========================================================================== */

.legal-content {
  font-size: var(--text-body-large);
  line-height: var(--text-body-large-lh);
  color: var(--color-text-secondary);
}

/* Links */
.legal-content a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: var(--space-xxs);
  transition: color 0.2s ease;
}

.legal-content a:hover {
  color: var(--color-purple);
}

/* Headings */
.legal-content h2 {
  font-size: var(--text-heading-large);
  line-height: var(--text-heading-large-lh);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-top: var(--space-xxl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-purple);
  scroll-margin-top: calc(var(--header-height) + var(--space-lg));
}

.legal-content h3 {
  font-size: var(--text-heading-medium);
  line-height: var(--text-heading-medium-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  scroll-margin-top: calc(var(--header-height) + var(--space-lg));
}

.legal-content h4 {
  font-size: var(--text-body-large);
  line-height: var(--text-body-large-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-xs);
  scroll-margin-top: calc(var(--header-height) + var(--space-lg));
}

/* Paragraphs */
.legal-content p {
  margin-bottom: var(--space-md);
}

/* Lists */
.legal-content ul,
.legal-content ol {
  margin-bottom: var(--space-md);
  padding-left: var(--space-lg);
}

.legal-content ul {
  list-style-type: disc;
}

.legal-content ol {
  list-style-type: decimal;
}

.legal-content li {
  margin-bottom: var(--space-xs);
  line-height: var(--text-body-large-lh);
}

.legal-content li::marker {
  color: var(--color-accent);
}

/* Nested lists */
.legal-content li ul,
.legal-content li ol {
  margin-top: var(--space-xs);
  margin-bottom: var(--space-xs);
}

/* Blockquote */
.legal-content blockquote {
  border-left: var(--space-xxs) solid var(--color-purple);
  padding-left: var(--space-lg);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-lg);
  font-style: italic;
  color: var(--color-text-secondary);
}

.legal-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Tables */
.legal-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-lg);
  font-size: var(--text-body-medium);
  line-height: var(--text-body-medium-lh);
}

.legal-content th {
  text-align: left;
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 2px solid var(--color-border);
}

.legal-content td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-secondary);
}

.legal-content tr:nth-child(even) td {
  background: var(--color-surface);
}

/* Horizontal rule */
.legal-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-xl) 0;
}

/* Strong / emphasis */
.legal-content strong {
  color: var(--color-text-primary);
  font-weight: var(--font-weight-semibold);
}

/* ==========================================================================
   Section 4: Table of Contents
   Sticky sidebar on desktop, in-flow block on mobile.
   ========================================================================== */

.legal-toc {
  background: var(--color-surface);
  border-radius: var(--corner-radius);
  padding: var(--space-lg);
}

.legal-toc h2 {
  font-size: var(--text-body-large);
  line-height: var(--text-body-large-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.legal-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

.legal-toc li {
  margin-bottom: var(--space-xxs);
}

.legal-toc a {
  display: block;
  padding: var(--space-xxs) var(--space-xs);
  font-size: var(--text-body-small);
  line-height: var(--text-body-small-lh);
  color: var(--color-text-tertiary);
  text-decoration: none;
  border-radius: var(--corner-radius-sm);
  transition: color 0.2s ease, background-color 0.2s ease;
}

.legal-toc a:hover {
  color: var(--color-accent);
  background: var(--color-surface-elevated);
}

.legal-toc a.active {
  color: var(--color-accent);
  background: var(--color-surface-elevated);
  font-weight: var(--font-weight-medium);
}

/* Desktop: sticky sidebar */
@media (min-width: 768px) {
  .legal-toc {
    position: sticky;
    top: calc(var(--header-height) + var(--space-lg));
    max-height: calc(100vh - var(--header-height) - var(--space-xxl));
    overflow-y: auto;
  }
}

/* ==========================================================================
   Section 5: Legal Page 2-Column Layout
   Content + ToC sidebar, collapses to single column on mobile.
   ========================================================================== */

.legal-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

/* Mobile-first: ToC above content */
.legal-layout .legal-content {
  order: 2;
  min-width: 0;
}

.legal-layout .legal-toc {
  order: 1;
}

/* Desktop: side-by-side */
@media (min-width: 768px) {
  .legal-layout {
    flex-direction: row;
    gap: var(--space-xxl);
  }

  .legal-layout .legal-content {
    order: 1;
    flex: 1 1 0;
    min-width: 0;
  }

  .legal-layout .legal-toc {
    order: 2;
    flex: 0 0 260px;
  }
}

/* ==========================================================================
   Section 6: Contact Layout & Form
   2-column layout (form + info card), inputs, focus states, keycap submit.
   ========================================================================== */

.contact-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-xxl);
}

@media (min-width: 768px) {
  .contact-layout {
    flex-direction: row;
    gap: var(--space-xxl);
  }

  .contact-layout .contact-form {
    flex: 1 1 0;
    min-width: 0;
  }

  .contact-layout .contact-info-card {
    flex: 0 0 320px;
  }
}

/* -- Contact Info Card ---------------------------------------------------- */

.contact-info-card {
  background: var(--color-surface-elevated);
  border-radius: var(--corner-radius);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  align-self: flex-start;
}

.contact-info-card h2 {
  font-size: var(--text-heading-medium);
  line-height: var(--text-heading-medium-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.contact-info-item {
  margin-bottom: var(--space-lg);
}

.contact-info-item:last-child {
  margin-bottom: 0;
}

.contact-info-item h3 {
  font-size: var(--text-body-medium);
  line-height: var(--text-body-medium-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-xxs);
}

.contact-info-item p {
  font-size: var(--text-body-small);
  line-height: var(--text-body-small-lh);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.contact-info-item a:not(.keycap) {
  color: var(--color-accent);
  text-decoration: none;
  font-size: var(--text-body-small);
  transition: color 0.2s ease;
}

.contact-info-item a:not(.keycap):hover {
  color: var(--color-purple);
  text-decoration: underline;
}

/* -- Contact Form --------------------------------------------------------- */

.contact-form {
  max-width: 640px;
}

.contact-form .form-group {
  margin-bottom: var(--space-lg);
}

.contact-form label {
  display: block;
  font-size: var(--text-body-medium);
  line-height: var(--text-body-medium-lh);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.contact-form .label-hint {
  font-size: var(--text-body-small);
  line-height: var(--text-body-small-lh);
  color: var(--color-text-tertiary);
  font-weight: var(--font-weight-regular);
  margin-left: var(--space-xs);
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--corner-radius-sm);
  font-family: inherit;
  font-size: var(--text-body-medium);
  line-height: var(--text-body-medium-lh);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input[type="text"]::placeholder,
.contact-form input[type="email"]::placeholder,
.contact-form textarea::placeholder {
  color: var(--color-text-tertiary);
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: none;
  border-color: var(--color-purple);
  box-shadow: 0 0 0 3px var(--color-purple-dim);
}

.contact-form textarea {
  min-height: 160px;
  resize: vertical;
}

.contact-form .form-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

/* ==========================================================================
   Section 7: About Page
   Mission statement and values grid.
   ========================================================================== */

.about-mission {
  max-width: 720px;
  margin-bottom: var(--space-xxl);
}

.about-mission p {
  font-size: var(--text-body-large);
  line-height: var(--text-body-large-lh);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.about-values {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
}

.about-value-card {
  background: var(--color-surface);
  border-radius: var(--corner-radius);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
}

.about-value-card .value-icon {
  font-size: var(--text-display-medium);
  margin-bottom: var(--space-sm);
}

.about-value-card h3 {
  font-size: var(--text-heading-medium);
  line-height: var(--text-heading-medium-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.about-value-card p {
  font-size: var(--text-body-medium);
  line-height: var(--text-body-medium-lh);
  color: var(--color-text-secondary);
}

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

@media (min-width: 1024px) {
  .about-values {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* -- About Steps (How It Works brief) ------------------------------------- */

.about-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  max-width: 900px;
  margin: 0 auto;
}

.about-step {
  text-align: center;
  padding: var(--space-lg);
}

.about-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-purple);
  color: var(--color-text-primary);
  font-size: var(--text-heading-large);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--space-md);
}

.about-step h3 {
  font-size: var(--text-heading-medium);
  line-height: var(--text-heading-medium-lh);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-xs);
}

.about-step p {
  font-size: var(--text-body-medium);
  line-height: var(--text-body-medium-lh);
  color: var(--color-text-secondary);
  max-width: 280px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .about-steps {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ==========================================================================
   Section 8: 404 Error Page
   Centered layout, large heading, search input.
   ========================================================================== */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - var(--header-height) - 200px);
  padding: var(--space-xxl) var(--space-lg);
}

.error-page .error-code {
  font-size: 120px;
  line-height: 1;
  font-weight: var(--font-weight-bold);
  color: var(--color-purple);
  margin-bottom: var(--space-md);
}

.error-page h1 {
  font-size: var(--text-display-medium);
  line-height: var(--text-display-medium-lh);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-sm);
}

.error-page p {
  font-size: var(--text-body-large);
  line-height: var(--text-body-large-lh);
  color: var(--color-text-secondary);
  max-width: 480px;
  margin-bottom: var(--space-xl);
}

.error-page .error-search {
  display: flex;
  gap: var(--space-sm);
  width: 100%;
  max-width: 400px;
  margin-bottom: var(--space-lg);
}

.error-page .error-search input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--corner-radius-sm);
  font-family: inherit;
  font-size: var(--text-body-medium);
  line-height: var(--text-body-medium-lh);
}

.error-page .error-search input:focus {
  outline: none;
  border-color: var(--color-purple);
  box-shadow: 0 0 0 3px var(--color-purple-dim);
}

.error-page .error-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: center;
}

.error-page .error-links a {
  color: var(--color-accent);
  text-decoration: none;
  font-size: var(--text-body-medium);
  transition: color 0.2s ease;
}

.error-page .error-links a:hover {
  color: var(--color-purple);
  text-decoration: underline;
}

/* Error page CTA (App Store button below links) */
.error-page .error-cta {
  margin-top: var(--space-lg);
}

/* ==========================================================================
   Section 9: Pre-Footer CTA Banner
   Reusable CTA section between main content and footer.
   ========================================================================== */

.cta-banner {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-xxxl) 0;
}

.cta-banner-inner {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--screen-padding);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.cta-banner h2 {
  font-size: 24px;
  line-height: 32px;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0;
}

.cta-banner p {
  font-size: var(--text-body-large);
  line-height: var(--text-body-large-lh);
  color: var(--color-text-secondary);
  max-width: 480px;
  margin: 0;
}

@media (min-width: 768px) {
  .cta-banner h2 {
    font-size: 28px;
    line-height: 36px;
  }
}

@media (min-width: 1024px) {
  .cta-banner h2 {
    font-size: var(--text-display-medium);
    line-height: var(--text-display-medium-lh);
  }
}

/* ==========================================================================
   Section 10: Responsive Table Scroll Wrapper
   ========================================================================== */

/* Responsive table scroll wrapper */
.legal-content .table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-lg);
}

.legal-content .table-wrapper table {
  margin-bottom: 0;
  min-width: 500px;
}

/* SEO Content Grid styles are in shared.css (Section 6) */
