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

/* Temporary base styles — remove when real Tailwind styling is applied */

/*
 * Mail-merge variable highlighting in the compose editor (compose_controller.js). Uses the
 * CSS Custom Highlight API — purely visual, so it never touches the editor's serialized HTML
 * (the {{variables}} are sent/merged untouched). A {{variable}} is green when it's a known
 * merge variable that resolves to content, and red when it's unknown OR resolves to blank
 * (empty/nil) for the previewed context. These are ::highlight() pseudo-elements and cannot be
 * expressed as Tailwind utilities. Browsers without the API simply show no highlight.
 */
::highlight(mailmerge-known) {
  background-color: #dcfce7; /* green-100 */
  color: #166534;            /* green-800 */
}
::highlight(mailmerge-unknown) {
  background-color: #fee2e2; /* red-100 */
  color: #991b1b;            /* red-800 */
}

/*
 * Disabled controls always show the not-allowed cursor, however they were rendered
 * (the button component, a raw <button>, an <input>/<select>, or an aria-disabled link).
 * A single base rule is more reliable than a per-element Tailwind utility; native
 * `:disabled` outweighs `.cursor-pointer` on specificity, so it wins without !important.
 */
button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
fieldset:disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

/*
 * Two-column blocks in the advert (spec 039 § Kolommen). The classes arrive inside stored HTML, so
 * they cannot be Tailwind utilities on a template: this rule serves both the editor and the
 * dashboard vacancy page, which renders the same advert. The jobsite has its own stylesheet.
 */
.t2m-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.t2m-column {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 768px) {
  .t2m-columns {
    grid-template-columns: 1fr 1fr;
  }
}

/*
 * Editor chrome, never stored and never rendered: an empty column has nothing to show, so it needs
 * an outline to be visible and a height to be clickable. Lexical reconciles an empty block to a
 * lone <br>, which is what the second selector matches.
 */
lexxy-editor .t2m-column:has(> p:only-child:empty),
lexxy-editor .t2m-column:has(> p:only-child > br:only-child) {
  min-height: 1.5rem;
  outline: 1px dashed #d1d5db; /* gray-300 */
  outline-offset: 2px;
}
