/*
 * Layout and components for careers.karri.io.
 * Brand values (colours, fonts, radii, base type styles) live in brand-tokens.css.
 * Mobile first: base styles target ~360px, wider screens are layered on.
 */

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 1.0625rem;
}

main {
  flex: 1;
  padding-block: 1.5rem 4rem;
}

main:focus {
  outline: none;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 8vw, 4rem);
}

h2 {
  font-size: clamp(1.5rem, 4.5vw, 2rem);
}

h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  font-size: 1.375rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1em;
}

a {
  color: inherit;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 3px;
}

:focus-visible {
  outline: 3px solid var(--karri-off-black);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---- Layout ---- */

.wrap {
  width: 100%;
  max-width: 64rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 40em) {
  .wrap {
    padding-inline: 2rem;
  }
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 10;
  padding: 0.75rem 1.25rem;
  background: var(--karri-off-black);
  color: var(--karri-cream);
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skip-link:focus {
  top: 1rem;
}

/* ---- Header ---- */

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.25rem;
}

.site-header__home {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

/* The PNG includes its own mint box: at 56px tall the letters are ~32px, above the 25px minimum. */
.site-header__logo {
  display: block;
  height: 56px;
  width: auto;
}

.site-header__section,
.site-header__main-site {
  font-size: 0.875rem;
}

/* ---- Footer ---- */

.site-footer {
  background: var(--karri-off-black);
  color: var(--karri-cream);
  padding-block: 2.5rem;
}

.site-footer :focus-visible {
  outline-color: var(--karri-cream);
}

.site-footer__links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
}

.site-footer__links a {
  font-size: 0.875rem;
}

.site-footer__legal {
  font-size: 0.875rem;
  margin: 0;
  max-width: 40rem;
}

/* ---- Shared components ---- */

.detail {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.label {
  font-size: 0.875rem;
}

.button {
  font-size: 0.9375rem;
  padding: 0.75em 1.5em;
  line-height: 1.2;
  text-align: center;
}

.button:hover {
  background: #000;
}

.button--outline:hover {
  background: var(--karri-off-black);
  color: var(--karri-cream);
}

.prose {
  max-width: 40rem;
}

.prose h2 {
  margin-top: 1.75em;
}

.prose > :first-child > h2:first-child {
  margin-top: 0;
}

.prose li + li {
  margin-top: 0.35em;
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

/* ---- Listing page ---- */

.hero__card {
  padding-block: clamp(2rem, 7vw, 4.5rem);
}

.hero__title {
  margin-bottom: 0.4em;
}

.hero__intro {
  font-size: clamp(1.125rem, 3.5vw, 1.5rem);
  margin: 0;
}

.hero__intro > :last-child {
  margin-bottom: 0;
}

.roles {
  margin-top: 3rem;
}

/* Jump links to each team: pill-shaped labels, shown when there are 2+ teams. */
.team-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.team-nav__link {
  display: inline-block;
  padding: 0.5em 1.1em;
  border: 1.5px solid var(--karri-off-black);
  border-radius: var(--radius-pill);
  text-decoration: none;
}

.team-nav__link:hover {
  background: var(--karri-off-black);
  color: var(--karri-cream);
}

.team + .team {
  margin-top: 2.5rem;
}

.team__heading {
  font-size: 1rem;
  margin-bottom: 1rem;
  scroll-margin-top: 1rem;
}

.roles__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 48em) {
  .roles__list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.job-card {
  position: relative;
  height: 100%;
  background: var(--karri-cream);
  border-radius: var(--radius-card);
  padding: 1.5rem;
}

.job-card__title {
  margin-bottom: 0.75rem;
}

.job-card__title a {
  text-decoration: none;
}

/* Whole card is clickable via the title link. */
.job-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
}

.job-card:hover .job-card__title a {
  text-decoration: underline;
}

.job-card__meta {
  margin: 0;
}

.roles__empty p:last-child {
  margin-bottom: 0;
}

/* ---- Job page ---- */

.job__back a {
  text-decoration: none;
}

.job__back a:hover {
  text-decoration: underline;
}

.job__header {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.job__title {
  font-size: clamp(2rem, 7vw, 3.5rem);
}

.job__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}

.job__meta div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.job__meta dt {
  font-size: 0.75rem;
  opacity: 0.75;
}

.job__meta dd {
  margin: 0;
}

.notice {
  max-width: 40rem;
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--karri-off-black);
  border-radius: var(--radius-card);
  background: var(--karri-cream);
}

.apply {
  max-width: 40rem;
  margin-top: 3rem;
}

.apply__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-block: 1.5rem;
}

.apply__privacy {
  font-size: 0.9375rem;
}

.apply__privacy {
  margin-bottom: 0;
}

/* ---- Simple pages (privacy, 404) ---- */

.page {
  padding-top: 1rem;
}
