/*
 * 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.
 */

body {
  font-family: 'Manrope', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.15;
  letter-spacing: -0.02em;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

dialog[open] {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

@keyframes progress {
  0%   { width: 0% }
  60%  { width: 75% }
  90%  { width: 90% }
  100% { width: 95% }
}

/* Chevron rotation for native <details> disclosure elements.
   Applied to .details-chevron SVGs sitting inside a <details> element.
   Uses the CSS sibling/descendant relationship: when <details> has the
   [open] attribute, the summary's sibling container finds the SVG. */
details[open] .details-chevron {
  transform: rotate(180deg);
}

/* ---------------------------------------------------------------------------
 * Blog body — typographic styles for Action Text rendered content (post#show).
 * Tailwind utilities are not applied INSIDE rich-text output (Trix emits plain
 * HTML), so the `.prose-blog` scope re-establishes hierarchy + readability.
 * US-A AC-2.1, AC-3.6.
 * ------------------------------------------------------------------------- */
.prose-blog { color: #1f2937; }
.prose-blog h1 {
  /* Trix's toolbar emits <h1> as the canonical heading when the admin clicks
     the "Heading" button. The page already owns a single document <h1>
     (the post headline), so in-content <h1> is treated as a section header
     and styled at the same scale as <h2> to avoid an h1-inside-h1 hierarchy
     break (Nielsen #4 — consistency) and to defend against headline-sized
     visual inversion. BUG-26 paydown. */
  font-size: 1.5rem;
  font-weight: 800;
  color: #12192b;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
.prose-blog h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #12192b;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}
@media (min-width: 640px) {
  .prose-blog h1 { font-size: 1.875rem; margin-top: 2.5rem; }
  .prose-blog h2 { font-size: 1.875rem; margin-top: 2.5rem; }
}
.prose-blog h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #12192b;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.prose-blog p,
.prose-blog .trix-content > div {
  /* Trix emits paragraph-shaped blocks as <div> (not <p>). The trix-content
     wrapper holds them as direct children; styling those direct children
     restores readable paragraph spacing without affecting layout <div>s
     elsewhere on the page. BUG-26 paydown. */
  margin: 0 0 1rem 0;
  line-height: 1.7;
}
.prose-blog a {
  color: #12192b;
  text-decoration: underline;
  text-decoration-color: #9cd52a;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  font-weight: 600;
}
.prose-blog a:hover {
  color: #9cd52a;
}
.prose-blog ul,
.prose-blog ol {
  margin: 0 0 1.25rem 1.5rem;
  line-height: 1.7;
}
.prose-blog ul { list-style: disc; }
.prose-blog ol { list-style: decimal; }
.prose-blog li { margin-bottom: 0.4rem; }
.prose-blog blockquote {
  border-left: 4px solid #9cd52a;
  background: #f9fafb;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: #4b5563;
  border-radius: 0 0.75rem 0.75rem 0;
}
.prose-blog blockquote p:last-child { margin-bottom: 0; }
.prose-blog img,
.prose-blog action-text-attachment img {
  border-radius: 0.75rem;
  margin: 1.5rem 0;
  max-width: 100%;
  height: auto;
}
.prose-blog figure { margin: 1.5rem 0; }
.prose-blog figcaption {
  font-size: 0.875rem;
  color: #6b7280;
  text-align: center;
  margin-top: 0.5rem;
}

/* ---------------------------------------------------------------------------
 * Blog Trix editor — admin authoring surface. Code-block button parked for v2
 * per AC-3.6 (hide the toolbar button; the keyboard shortcut still works but
 * is documented as unsupported).
 * ------------------------------------------------------------------------- */
.blog-trix {
  display: block;
  min-height: 320px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  line-height: 1.65;
}
.blog-trix:focus { outline: 2px solid #9cd52a; outline-offset: 2px; border-color: transparent; }
trix-toolbar { margin-bottom: 0.5rem; }
/* AC-3.6 — hide code button in v1 */
trix-toolbar .trix-button--icon-code,
trix-toolbar [data-trix-attribute="code"] { display: none !important; }
