/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Prevent iOS WKWebView auto-zoom on focused inputs (triggers when font-size < 16px).
   Zoom state persists across Turbo navigations causing layout issues post-login. */
@supports (-webkit-touch-callout: none) {
  input, textarea, select {
    font-size: max(16px, 1em);
  }
}

/* Guide page content — typography styles (no @tailwindcss/typography available) */
.guide-content h1 { font-size: 1.5rem; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.75rem; color: #0f172a; }
.guide-content h2 { font-size: 1.25rem; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.5rem; color: #1e293b; }
.guide-content h3 { font-size: 1.05rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.4rem; color: #1e293b; }
.guide-content p { margin-bottom: 0.875rem; line-height: 1.7; }
.guide-content ul { list-style-type: disc; padding-left: 1.5rem; margin-bottom: 0.875rem; }
.guide-content ol { list-style-type: decimal; padding-left: 1.5rem; margin-bottom: 0.875rem; }
.guide-content li { margin-bottom: 0.25rem; line-height: 1.65; }
.guide-content strong { font-weight: 600; color: #0f172a; }
.guide-content a { color: #4f46e5; text-decoration: underline; }
.guide-content a:hover { color: #3730a3; }
.guide-content code { font-family: ui-monospace, monospace; font-size: 0.85em; background: #f1f5f9; border-radius: 0.25rem; padding: 0.1em 0.35em; color: #0f172a; }
.guide-content pre { background: #0f172a; color: #e2e8f0; padding: 1rem; border-radius: 0.5rem; overflow-x: auto; margin-bottom: 1rem; font-size: 0.85em; line-height: 1.6; }
.guide-content pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.guide-content blockquote { border-left: 3px solid #6366f1; padding-left: 1rem; margin: 1rem 0; color: #475569; font-style: italic; }
.guide-content hr { border-color: #e2e8f0; margin: 1.5rem 0; }
.guide-content table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.875rem; }
.guide-content th { background: #f8fafc; font-weight: 600; text-align: left; padding: 0.5rem 0.75rem; border: 1px solid #e2e8f0; }
.guide-content td { padding: 0.5rem 0.75rem; border: 1px solid #e2e8f0; }

/* Notebook entry content — prevent layout breaks from long code blocks */
.notebook-entry-content pre,
.notebook-entry-content code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.notebook-entry-content pre {
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 0.375rem;
  font-family: ui-monospace, monospace;
  font-size: 0.875em;
  line-height: 1.6;
}

.notebook-entry-content code {
  font-family: ui-monospace, monospace;
  font-size: 0.875em;
  background: #f1f5f9;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
}

.notebook-entry-content pre code {
  background: transparent;
  padding: 0;
}

/* ── Print / PDF export ─────────────────────────────────────────────────── */
@media print {
  /* Hide all UI chrome */
  nav,
  header,
  .notebook-toolbar,
  [data-notebook-toc-target="sidebar"],
  [data-turbo-frame],
  .tab-bar,
  footer {
    display: none !important;
  }

  /* Show only editor prose content */
  .notebook-editor-content {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  [data-editor-target="editor"] {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  /* Print typography */
  body {
    font-family: Georgia, serif;
    font-size: 12pt;
    line-height: 1.6;
    color: #000;
    background: #fff;
  }

  h1 { font-size: 20pt; margin-top: 24pt; }
  h2 { font-size: 16pt; margin-top: 18pt; }
  h3 { font-size: 13pt; margin-top: 14pt; }

  /* Suppress link URL printing */
  a[href]:after { content: none !important; }

  /* Avoid orphaned lines */
  p, li { orphans: 3; widows: 3; }
  h1, h2, h3 { page-break-after: avoid; }

  @page { margin: 2cm; }
}
