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

/* CKEditor content overrides — loaded site-wide (not just the public article
   page) so admins get accurate visual feedback while editing, matching what
   the public page will actually render. */

/* CKEditor's default "Insert Table" button produces a borderless "layout
   table" (ckeditor5-content.css deliberately excludes :not(.layout-table)
   selectors from border styling). News-article tables should always be
   visibly bordered regardless of which table variant got inserted. */
.ck-content table, .ck-content th, .ck-content td {
  border: 1px solid #c4c6d0;
  padding: 0.4em;
}
.ck-content table { border-collapse: collapse; }

/* Alignment/Indent default to inline styles, which the sanitizer strips (see
   app/models/news_article.rb) — both are configured in
   config/initializers/ckeditor5.rb to emit these classes instead. */
.ck-content .text-align-left { text-align: left; }
.ck-content .text-align-center { text-align: center; }
.ck-content .text-align-right { text-align: right; }
.ck-content .text-align-justify { text-align: justify; }
.ck-content .indent-block-1 { margin-left: 2em; }
.ck-content .indent-block-2 { margin-left: 4em; }
.ck-content .indent-block-3 { margin-left: 6em; }
.ck-content .indent-block-4 { margin-left: 8em; }

/* Tailwind preflight makes links inherit colour and drop the underline. */
.ck-content a {
  color: var(--color-primary, #002b5b);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.ck-content a:hover { color: var(--color-secondary, #8b5e3c); }
