/*!
Theme Name: IEDRC Theme
Description: Hybrid theme reset. Design lives in theme.json and compiled SCSS.
Version: 1.0.0
*/

/* Order matters: reset < base < blocks < utilities */
@layer reset, base, blocks, utilities;

/* --------------------------
   RESET
   -------------------------- */
@layer reset {
  /* Better box sizing and text sizing */
  *,*::before,*::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; }

  /* Remove default margins, the editor will manage spacing via block gap */
  :where(body,h1,h2,h3,h4,h5,h6,p,figure,blockquote,dl,dd) { margin: 0; }

  /* Media elements scale nicely */
  :where(img,svg,video,canvas,audio,iframe,embed,object) { display: block; max-width: 100%; }
  img, video { height: auto; }

  /* Forms inherit typography */
  :where(button,input,select,textarea) { font: inherit; color: inherit; }

  /* Links do not carry odd backgrounds */
  a { background-color: transparent; text-decoration-skip-ink: auto; }

  /* Tables, keep them simple */
  table { border-collapse: collapse; border-spacing: 0; width: 100%; }

  /* Reduce motion for users who prefer it */
  @media (prefers-reduced-motion: reduce) {
	* { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  }

  /* Accessibility helper, matches WP convention */
  .screen-reader-text {
	position: absolute !important;
	height: 1px; width: 1px;
	overflow: hidden; clip: rect(1px,1px,1px,1px);
	white-space: nowrap; border: 0; padding: 0; margin: -1px;
  }
  .screen-reader-text:focus {
	clip: auto !important; width: auto; height: auto; margin: 0;
	padding: 0.75rem 1rem; background: #f1f1f1; z-index: 100000; box-shadow: 0 0 0 2px rgba(0,0,0,.6);
  }

  /* Legacy alignment helpers for old content pasted in */
  .alignleft { float: left; margin-right: 1.5rem; }
  .alignright { float: right; margin-left: 1.5rem; }
  .aligncenter { margin-inline: auto; text-align: center; display: block; }
}

/* --------------------------
   BASE, tiny opinionated defaults that play nice with theme.json
   -------------------------- */
@layer base {
  body {
	min-height: 100dvh;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	background: var(--wp--preset--color--brand-white);
	color: var(--wp--preset--color--brand-black);
	font-family: var(--wp--preset--font-family--work-sans, system-ui, -apple-system, Segoe UI, Roboto, sans-serif);
  }

  /* Respect block gap for stacked flow in classic areas too */
  .wp-site-blocks > * + *,
  .entry-content > * + * { margin-block-start: var(--wp--style--block-gap, 1rem); }

  /* Headings inherit font family from theme.json, remove default top margins */
  :where(h1,h2,h3,h4,h5,h6) { line-height: 1.2; }

  /* Figures and lists behave predictably */
  figure { margin: 0; }
  ul,ol { padding-inline-start: 1.25em; }
}

/* --------------------------
   BLOCK-TWEAKS, keep this minimal and generic
   -------------------------- */
@layer blocks {
  /* Buttons should not be underlined, color comes from theme.json */
  :where(.wp-block-button__link) { text-decoration: none; }

  /* Images in .wp-block-image already scale, ensure captions look tidy */
  :where(.wp-element-caption) { text-align: center; font-size: 0.875em; }
}

/* --------------------------
   UTILITIES, optional helpers for templates
   -------------------------- */
@layer utilities {
  .flow > * + * { margin-block-start: var(--wp--style--block-gap, 1rem); }
  .visually-hidden { position: absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(1px,1px,1px,1px); white-space:nowrap; }
}