/*
 * base.css — Reset, @font-face, body, typography, elements, focus, skip link.
 */

/* ── @font-face (self-hosted Plus Jakarta Sans) ── */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../fonts/pjs-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../fonts/pjs-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../fonts/pjs-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('../fonts/pjs-800.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ── Base ── */
body {
  background-color: var(--mj-white);
  color: var(--mj-black);
  font-family: var(--mj-font-body);
  font-size: var(--mj-text-base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

/* ── Skip link ── */
.mjc-skip-link {
  position: absolute;
  top: -999px;
  left: var(--mj-space-s);
  background: var(--mj-orange);
  color: var(--mj-white);
  padding: 0.5rem 1rem;
  font-weight: 700;
  font-size: var(--mj-text-sm);
  text-decoration: none;
  border-radius: var(--mj-radius);
  z-index: var(--mj-z-skip);
  transition: top var(--mj-ease);
}
.mjc-skip-link:focus {
  top: var(--mj-space-s);
}

/* ── Focus ── */
:focus-visible {
  outline: 2px solid var(--mj-orange);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--mj-font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--mj-black);
}

h1 { font-size: var(--mj-text-4xl); }
h2 { font-size: var(--mj-text-3xl); }
h3 { font-size: var(--mj-text-2xl); }
h4 { font-size: var(--mj-text-xl); }
h5 { font-size: var(--mj-text-lg); font-weight: 700; }
h6 { font-size: var(--mj-text-base); font-weight: 700; }

p {
  max-width: 65ch;
}

a {
  color: var(--mj-green);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--mj-ease);
}
a:hover {
  color: var(--mj-green-mid);
}

ul, ol {
  padding-left: var(--mj-space-m);
}

strong { font-weight: 700; }
em     { font-style: italic; }

hr {
  border: none;
  border-top: 1px solid var(--mj-grey-200);
  margin: var(--mj-space-m) 0;
}

/* ── Entry content (posts / pages) ── */
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin-top: var(--mj-space-m);
  margin-bottom: var(--mj-space-xs);
}
.entry-content p,
.entry-content ul,
.entry-content ol {
  margin-bottom: var(--mj-space-s);
}
.entry-content a {
  text-decoration: underline;
}
.entry-content img {
  border-radius: var(--mj-radius);
  margin: var(--mj-space-m) 0;
}

/* ── Placeholder image (Phase 1 scaffold) ── */
.mjc-placeholder-img {
  position: relative;
  width: 100%;
  background: var(--mj-grey-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.mjc-placeholder-img svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.mjc-placeholder-img__label {
  position: relative;
  z-index: 1;
  font-size: var(--mj-text-xs);
  color: var(--mj-grey-500);
  text-align: center;
  padding: var(--mj-space-xs);
  background: rgba(255, 255, 255, 0.8);
  border-radius: var(--mj-radius);
}

/* ── Screen reader only ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
