/**
 * Job posting body: the typography of whatever the block editor holds (.jp-prose).
 *
 * TWO READERS. The posting page loads this file after posting.css, and the plugin loads
 * the SAME file into the block editor, so the editor looks like the page. That is why:
 *
 *   - every selector starts with .jp-prose (the editor swaps that first .jp-prose for its
 *     own canvas element);
 *   - the custom properties the rules read are declared on .jp-prose itself, with the
 *     values global.css and posting.css give them on the page;
 *   - nothing leans on the site's reset in global.css. Margins, padding, list markers and
 *     link decoration are set here, because the editor does not load that reset;
 *   - the rules that space a block from the next one are written twice: for a child of
 *     .jp-prose (the page) and for a child of .is-root-container (the editor's own block
 *     list, which sits one level inside its canvas and gets a 24px gap from WordPress
 *     that a plain element rule cannot outrank). On the page that second selector matches
 *     nothing.
 *
 * The scale is the article prose scale already in the theme (19px / 1.7, Anton H2, bold
 * H3), exactly as the approved mockup has it: .mockups/posting-redesign/mockup.src.html.
 * Table, quote, button, image and separator are not in the mockup; they are built only
 * from its tokens and patterns (see design-standards.md, "Job posting page").
 *
 * NOT HERE: the plugin's own blocks (operating area map, hiring area map, ZIP check).
 * They ship their own styles and only take their place in the rhythm from this file.
 */

.jp-prose {
  --orange: #BD5117;
  --orange-bright: #FF840B;
  --orange-border: #C74300;
  --slate: #576371;
  --gray-light: #EFF1F3;
  --prose: #4a4a4a;
  --hairline: rgba(87, 99, 113, 0.28);
  --display-font: 'Anton', 'Helvetica Neue', Arial, sans-serif;
  --body-font: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  font-family: var(--body-font);
  font-size: 19px;
  line-height: 1.7;
  color: var(--prose);
}

/* =============================================================================
   RHYTHM: 28px under every block.
   ============================================================================= */
/* First, the same gap for a block that arrives one level down, inside a wrapper of its
   own (a shared section, a block preview in the editor). :where() adds no weight, so
   every rule below can still decide otherwise. One selector per element, with no comma
   inside the brackets, so the editor can swap each leading .jp-prose by a plain split. */
.jp-prose :where(p),
.jp-prose :where(ul),
.jp-prose :where(ol),
.jp-prose :where(figure),
.jp-prose :where(blockquote),
.jp-prose :where(.wp-block-columns),
.jp-prose :where(.wp-block-buttons) { margin: 0 0 28px; }

.jp-prose > *,
.jp-prose .is-root-container > * { margin: 0 0 28px; }
.jp-prose > *:last-child,
.jp-prose .is-root-container > *:last-child { margin-bottom: 0; }

/* The opening paragraph reads as a lead: larger and in the heading ink. Only when the
   body really opens with a paragraph. */
.jp-prose > p:first-child,
.jp-prose .is-root-container > p:first-child { font-size: 22px; line-height: 1.6; color: #111111; margin-bottom: 8px; }

/* =============================================================================
   HEADINGS. The template owns the H1; the body starts at H2. Anton is display only
   (H2); H3 and H4 stay on the body font.
   ============================================================================= */
.jp-prose h2,
.jp-prose .is-root-container > h2 {
  margin: 60px 0 20px;
  font-family: var(--display-font);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #111111;
}
.jp-prose h3,
.jp-prose .is-root-container > h3 { margin: 36px 0 12px; font-size: 22px; font-weight: 700; line-height: 1.35; color: #111111; }
.jp-prose h4,
.jp-prose .is-root-container > h4 { margin: 28px 0 8px; font-size: 19px; font-weight: 700; line-height: 1.4; color: #111111; }
/* A heading right under its parent heading, or opening the body, needs no room above. */
.jp-prose h2 + h3,
.jp-prose h3 + h4,
.jp-prose .is-root-container > h2 + h3,
.jp-prose .is-root-container > h3 + h4,
.jp-prose > h2:first-child,
.jp-prose > h3:first-child,
.jp-prose > h4:first-child,
.jp-prose .is-root-container > h2:first-child,
.jp-prose .is-root-container > h3:first-child,
.jp-prose .is-root-container > h4:first-child { margin-top: 0; }

/* =============================================================================
   TEXT, LINKS, LISTS
   ============================================================================= */
.jp-prose strong { color: #111111; font-weight: 700; }
.jp-prose a { color: var(--orange); text-decoration: none; border-bottom: 1px solid rgba(189, 81, 23, 0.35); }
.jp-prose a:hover { color: var(--orange-bright); border-bottom-color: currentColor; }

.jp-prose ul { list-style: disc; padding-left: 26px; line-height: 1.55; }
.jp-prose ol { list-style: decimal; padding-left: 26px; line-height: 1.55; }
.jp-prose li { margin: 0 0 7px; }
.jp-prose li:last-child { margin-bottom: 0; }
.jp-prose li > ul,
.jp-prose li > ol { margin: 7px 0 0; }

/* =============================================================================
   TWO COLUMNS (core/columns): two columns, one on a phone.
   ============================================================================= */
.jp-prose .wp-block-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
.jp-prose .wp-block-column { min-width: 0; }
.jp-prose .wp-block-column > h2:first-child,
.jp-prose .wp-block-column > h3:first-child,
.jp-prose .wp-block-column > h4:first-child { margin-top: 0; }
.jp-prose .wp-block-column > * { margin: 0 0 28px; }
.jp-prose .wp-block-column > h2 { margin: 60px 0 20px; }
.jp-prose .wp-block-column > h3 { margin: 36px 0 12px; }
.jp-prose .wp-block-column > h4 { margin: 28px 0 8px; }

/* =============================================================================
   IMAGE (core/image). On the text's left edge at its own size, never wider than the
   column, with the 10px corner of the key facts box and the map frame. No floats: this
   is a one column read.
   ============================================================================= */
.jp-prose .wp-block-image img { display: block; max-width: 100%; height: auto; border-radius: 10px; }
.jp-prose .wp-block-image a { border-bottom: 0; }
.jp-prose .wp-block-image.alignleft,
.jp-prose .wp-block-image.alignright,
.jp-prose .wp-block-image.aligncenter,
.jp-prose .wp-block-image .alignleft,
.jp-prose .wp-block-image .alignright,
.jp-prose .wp-block-image .aligncenter { display: block; float: none; margin-left: 0; margin-right: 0; }
/* The caption under an image or a table: the small slate note of the form's labels. */
.jp-prose figcaption { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--slate); text-align: left; }

/* =============================================================================
   QUOTE (core/quote). The tinted box of the map frame, holding words. No edge stripe.
   ============================================================================= */
.jp-prose blockquote {
  padding: 20px;
  border: 0;
  border-radius: 10px;
  background: var(--gray-light);
  color: #111111;
}
.jp-prose blockquote > * { margin: 0 0 12px; }
.jp-prose blockquote > *:last-child { margin-bottom: 0; }
.jp-prose blockquote cite { display: block; font-size: 14px; font-style: normal; font-weight: 700; line-height: 1.5; color: var(--slate); }

/* =============================================================================
   TABLE (core/table). Rows on the hairline, the header row on the light gray in the
   form's label type. A table wider than the column scrolls inside itself, so the page
   never scrolls sideways on a phone.
   ============================================================================= */
.jp-prose .wp-block-table { overflow-x: auto; }
.jp-prose .wp-block-table table { width: 100%; margin: 0; border-collapse: collapse; font-size: 17px; line-height: 1.45; }
.jp-prose .wp-block-table thead,
.jp-prose .wp-block-table tfoot { border: 0; }
.jp-prose .wp-block-table th,
.jp-prose .wp-block-table td { padding: 12px 16px; border: 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
/* Left by default, and weightless, so a column the editor aligns right or centre stays so. */
.jp-prose :where(.wp-block-table th),
.jp-prose :where(.wp-block-table td) { text-align: left; }
.jp-prose .wp-block-table thead th { border-bottom: 0; background: var(--gray-light); font-size: 14px; font-weight: 700; line-height: 1.4; color: #111111; }
.jp-prose .wp-block-table tfoot td { border-bottom: 0; font-weight: 700; color: #111111; }

/* =============================================================================
   BUTTON (core/buttons, core/button). The page's own buttons: the default is the orange
   Apply button, the Outline style is the dark outline button of the Apply bar.
   ============================================================================= */
.jp-prose .wp-block-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.jp-prose .wp-block-buttons > .wp-block-button { margin: 0; }
.jp-prose .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 54px;
  padding: 8px 30px;                 /* one line of words sits at the 54px height; more lines get air */
  border: 2px solid var(--orange-border);
  border-radius: 40px;
  background: var(--orange);
  font-family: var(--body-font);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.jp-prose .wp-block-button__link:hover { border-color: var(--orange-border); background: var(--orange-border); color: #ffffff; }
.jp-prose .wp-block-button.is-style-outline > .wp-block-button__link { border-color: #111111; background: #ffffff; color: #111111; }
.jp-prose .wp-block-button.is-style-outline > .wp-block-button__link:hover { border-color: #111111; background: #111111; color: #ffffff; }

/* =============================================================================
   SEPARATOR (core/separator). The page's hairline, with the room a sub heading opens with.
   ============================================================================= */
.jp-prose hr,
.jp-prose .is-root-container > hr { margin: 36px 0; border: 0; border-top: 1px solid var(--hairline); }

/* =============================================================================
   PHONE
   ============================================================================= */
/* The "no room above" and "last block" rules further up outrank these by their weight, so
   they hold here without being repeated. */
@media (max-width: 860px) {
  .jp-prose { font-size: 17px; }
  .jp-prose :where(p),
  .jp-prose :where(ul),
  .jp-prose :where(ol),
  .jp-prose :where(figure),
  .jp-prose :where(blockquote),
  .jp-prose :where(.wp-block-columns),
  .jp-prose :where(.wp-block-buttons) { margin-bottom: 22px; }
  .jp-prose > *,
  .jp-prose .is-root-container > * { margin-bottom: 22px; }
  .jp-prose > p:first-child,
  .jp-prose .is-root-container > p:first-child { font-size: 19px; }
  .jp-prose h2,
  .jp-prose .is-root-container > h2 { font-size: 26px; margin: 46px 0 16px; }
  .jp-prose h3,
  .jp-prose .is-root-container > h3 { font-size: 19px; margin: 28px 0 10px; }
  .jp-prose h4,
  .jp-prose .is-root-container > h4 { font-size: 17px; margin: 22px 0 8px; }

  .jp-prose .wp-block-columns { grid-template-columns: 1fr; }
  /* Stacked, the second column's first heading follows the first column's last list. */
  .jp-prose .wp-block-column + .wp-block-column > h3:first-child { margin-top: 28px; }
  .jp-prose .wp-block-column + .wp-block-column > h4:first-child { margin-top: 22px; }
  .jp-prose .wp-block-column > * { margin-bottom: 22px; }
  .jp-prose .wp-block-column > h2 { margin: 46px 0 16px; }
  .jp-prose .wp-block-column > h3 { margin: 28px 0 10px; }
  .jp-prose .wp-block-column > h4 { margin: 22px 0 8px; }

  .jp-prose .wp-block-table table { font-size: 16px; }
  .jp-prose .wp-block-table th,
  .jp-prose .wp-block-table td { padding: 10px 12px; }
  .jp-prose hr,
  .jp-prose .is-root-container > hr { margin: 28px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .jp-prose .wp-block-button__link { transition: none; }
}
