/*
 * The one stylesheet of the server-rendered public pages (web P2-13 step 5).
 *
 * It is served by Firebase Hosting from the portal's `public/` folder, so a `/kazi/` page loads one
 * static file from the CDN and nothing else: no framework, no font file, no script. The portal's own
 * 86,000 lines of CSS are not loaded here, which is how these pages meet the P1-26 budget.
 *
 * The colours, the sizes and the radii are the portal's own tokens, copied from
 * `wp/styles/variables.css` so the two look like one site (P2-13 step 5: "the same colour tokens").
 * They are copied rather than imported because this file must stand alone: a `@import` would be a
 * second request on every job page, and the portal's variables file is 400 lines of tokens these
 * pages do not use. `wp/scripts/__tests__/publicJobPages.test.js` checks the copied values against
 * `variables.css`, so the two cannot drift.
 *
 * Budget: 15 KB or less, checked by the same test.
 */

:root {
  --np-primary: #ffb400;
  --np-primary-hover: #e6a200;
  --np-primary-light: #fff5e0;
  --np-black: #1d1d1f;
  --np-gray-700: #515154;
  --np-gray-600: #6e6e73;
  --np-gray-300: #d1d1d6;
  --np-gray-200: #e5e5ea;
  --np-gray-50: #f5f5f7;
  --np-white: #ffffff;
  --np-warning-light: #fff4e5;
  --np-warning-dark: #c77700;
  --np-radius: 12px;
  --np-radius-sm: 8px;
  --np-wrap: 760px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--np-white);
  color: var(--np-black);
  font-family: 'Rambla', 'Mulish', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

.np-wrap {
  width: 100%;
  max-width: var(--np-wrap);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */

.np-header {
  border-bottom: 1px solid var(--np-gray-200);
  background: var(--np-white);
}

.np-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.np-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--np-black);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.np-header-link {
  font-size: 0.9375rem;
  color: var(--np-gray-700);
  text-decoration: none;
}

.np-header-link:hover,
.np-brand:hover {
  color: var(--np-warning-dark);
}

/* Main */

.np-main {
  padding-top: 20px;
  padding-bottom: 48px;
}

/* Breadcrumbs */

.np-crumbs {
  margin: 0 0 16px;
  font-size: 0.8125rem;
  color: var(--np-gray-600);
}

.np-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.np-crumb + .np-crumb::before {
  content: '/';
  margin-right: 6px;
  color: var(--np-gray-300);
}

.np-crumbs a {
  color: var(--np-gray-600);
  text-decoration: none;
}

.np-crumbs a:hover {
  text-decoration: underline;
}

/* The job itself */

.np-job {
  margin: 0;
}

.np-job-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
}

.np-logo {
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  border: 1px solid var(--np-gray-200);
  border-radius: var(--np-radius-sm);
  object-fit: contain;
  background: var(--np-white);
}

.np-job h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.np-company {
  margin: 0;
  font-size: 1.0625rem;
  color: var(--np-gray-700);
}

.np-source {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: var(--np-gray-600);
}

/* The facts table */

.np-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  margin: 0 0 24px;
  padding: 0;
  border: 1px solid var(--np-gray-200);
  border-radius: var(--np-radius);
  overflow: hidden;
  background: var(--np-gray-200);
}

.np-fact {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 10px 14px;
  background: var(--np-gray-50);
}

.np-fact dt {
  min-width: 140px;
  font-size: 0.875rem;
  color: var(--np-gray-600);
}

.np-fact dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Apply */

.np-apply {
  margin: 0 0 28px;
}

.np-button {
  display: inline-block;
  padding: 12px 22px;
  border: none;
  border-radius: var(--np-radius-sm);
  background: var(--np-primary);
  color: var(--np-black);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
}

.np-button:hover {
  background: var(--np-primary-hover);
}

.np-apply-fallback {
  margin: 10px 0 0;
  font-size: 0.8125rem;
  color: var(--np-gray-600);
}

.np-apply-fallback a {
  color: var(--np-warning-dark);
}

/* The closed and gone notices */

.np-notice {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--np-primary);
  border-radius: var(--np-radius);
  background: var(--np-warning-light);
}

.np-notice-title {
  margin: 0 0 4px;
  font-size: 1.0625rem;
  font-weight: 700;
}

.np-notice p:last-child {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--np-gray-700);
}

/* The advert's own text */

.np-description {
  margin: 0 0 32px;
}

.np-description h2 {
  margin: 0 0 10px;
  font-size: 1.1875rem;
}

.np-description p,
.np-description ul,
.np-description ol,
.np-description blockquote {
  margin: 0 0 12px;
}

.np-description ul,
.np-description ol {
  padding-left: 22px;
}

.np-description li {
  margin-bottom: 4px;
}

.np-description h3,
.np-description h4 {
  margin: 20px 0 8px;
  font-size: 1.0625rem;
}

.np-description blockquote {
  padding-left: 14px;
  border-left: 3px solid var(--np-gray-200);
  color: var(--np-gray-700);
}

.np-description a {
  color: var(--np-warning-dark);
}

/* Related jobs */

.np-related {
  margin: 0;
  padding-top: 24px;
  border-top: 1px solid var(--np-gray-200);
}

.np-related h2 {
  margin: 0 0 12px;
  font-size: 1.1875rem;
}

.np-related ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.np-related li {
  padding: 10px 0;
  border-bottom: 1px solid var(--np-gray-200);
}

.np-related li:last-child {
  border-bottom: none;
}

.np-related a {
  display: block;
  color: var(--np-black);
  font-weight: 600;
  text-decoration: none;
}

.np-related a:hover {
  text-decoration: underline;
}

.np-related-where {
  display: block;
  font-size: 0.8125rem;
  color: var(--np-gray-600);
}

/* Footer */

.np-footer {
  padding: 28px 0 36px;
  border-top: 1px solid var(--np-gray-200);
  background: var(--np-gray-50);
}

.np-footer-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.np-footer-group h2 {
  margin: 0 0 8px;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--np-gray-600);
}

.np-footer-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.np-footer-group li {
  margin-bottom: 4px;
}

.np-footer-group a {
  font-size: 0.9375rem;
  color: var(--np-gray-700);
  text-decoration: none;
}

.np-footer-group a:hover {
  text-decoration: underline;
}

.np-footer-rights {
  margin: 24px 0 0;
  font-size: 0.8125rem;
  color: var(--np-gray-600);
}

/* Wider screens */

@media (min-width: 640px) {
  .np-job h1 {
    font-size: 2rem;
  }

  .np-facts {
    grid-template-columns: 1fr 1fr;
  }

  .np-footer-groups {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

:focus-visible {
  outline: 3px solid var(--np-primary);
  outline-offset: 2px;
}
