/* ==================================================================
   RESET — reset + raw HTML element defaults.

   Nothing in this file is a class. If you're tempted to add a class
   here, it belongs in components.css or pages.css instead. This
   file only answers: "what does a bare <body>, <a>, <img> etc. look
   like before any component touches it?"

   Element-level typography (h1–h3, p, ul, li) already lives in
   tokens.css next to the type tokens they use — that's the one
   exception, kept there so type primitives and their application
   stay in the same place.
   ================================================================== */

/* tokens.css is intentionally NOT re-imported here: main.css already
   loads it before this file in the cascade (tokens -> reset ->
   components -> pages), so every custom property below is already
   available. Re-importing here just added an extra hop to the CSS
   import chain for no benefit. */

html {
	overflow-x: clip;
	/* clip instead of hidden: prevents horizontal scrollbar from the
	   off-canvas drawer without creating a scroll container. overflow:hidden
	   creates a scroll container which clips position:fixed descendants
	   on some browsers — exactly what was stopping the drawer from appearing. */
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

img {
	max-width: 100%;
	height: auto;
	/* Baseline safety net so no image can ever render wider than its
	   container or override a component's aspect-ratio-based sizing
	   (e.g. .pli, .lore) just because it has HTML width/height
	   attributes. Anything that needs a different, explicit size
	   (.hero-mock, .lightbox img, .image-card img) sets its own
	   width/height and wins on specificity as normal. */
}

picture {
	display: contents;
	/* <picture> is inline by default, which breaks every rule above
	   and every component rule below that targets `img` directly
	   (.pli img, .image-card img, .masonry-item img, etc.) — those
	   were all written assuming the <img> itself is the flex/grid
	   item. display:contents removes <picture> from the box tree
	   entirely so the <img> behaves exactly as if it had no wrapper. */
}

source {
	display: none;
	/* <source> isn't meant to generate a box at all — but that's
	   normally enforced by the browser treating <picture> as a
	   special "pick one rendered child" element. Once <picture> is
	   display:contents (above), that special-casing stops applying,
	   and <source> quietly becomes a real (zero-width) flex/grid item
	   sitting between the image and whatever follows it — stealing an
	   extra gap's worth of space for every <source> in the markup.
	   That's what was making .lore's image read as more than 50%: two
	   invisible phantom items, each pulling an extra gap out of the
	   row, all of it absorbed by whichever sibling had flex-shrink
	   left to give (the text column, since the image is flex-shrink:0).
	   This one rule fixes it everywhere <picture> is used, not just .lore. */
}

body {
	font-family: var(--font-family-body);
	background: var(--colour-surface-background);
	min-height: 100vh;
	display: flex;
	overflow-x: clip;
}

@media (max-width: 900px) {
	/* Side nav collapses to a top bar below — page becomes a
	   top-to-bottom stack instead of a side-by-side layout. */
	body {
		flex-direction: column;
	}
}
