/* UST Typography System
   - Controlled by CSS variables:
     --ust-font-base (rem)
     --ust-line-height-base (unitless)
   - Responsive sizing via clamp()
   - Best-practice readable defaults for mobile (320-360px) through large desktops (2560px+)
*/

:root{
  --ust-font-base: 1rem;
  --ust-line-height-base: 1.55;
}

html{ font-size: var(--ust-font-base, 1rem); }


/* Base text */
body{
  font-size: 1rem;
  line-height: var(--ust-line-height-base);
  text-rendering: optimizeLegibility;
}

/* Prevent overflow with long words/URLs, especially German compounds */
p, li, h1, h2, h3, h4, h5, h6{
  overflow-wrap: break-word;
  word-break: normal;
}

/* Paragraphs and lists: consistent rhythm */
p{
  margin: 0 0 1em 0;
}

ul, ol{
  margin: 0 0 1em 0;
  padding-left: 1.25em;
}

li{
  margin: 0.25em 0;
}

/* Headings: responsive but controlled. Keep long titles readable on mobile. */
h1, h2, h3, h4, h5, h6{
  margin: 0 0 0.6em 0;
  font-weight: 700;
  line-height: 1.15;
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6a,
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6a:hover {
	text-decoration:none;
}

h1{ font-size: clamp(1.8rem, 2.2vw + 1.2rem, 3.0rem); }
h2{ font-size: clamp(1.55rem, 1.6vw + 1.05rem, 2.35rem); }
h3{ font-size: clamp(1.35rem, 1.15vw + 0.95rem, 1.85rem); }
h4{ font-size: clamp(1.20rem, 0.85vw + 0.90rem, 1.55rem); }
h5{ font-size: clamp(1.05rem, 0.55vw + 0.85rem, 1.25rem); }
h6{ font-size: 1rem; }

/* Tighten spacing when headings are followed by text */
h1 + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p{
  margin-top: 0;
}

/* Small text */
small{
  font-size: 0.875em;
  line-height: 1.4;
}

/* Links inherit overall color system; keep underline conventional */
a{
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

/* Blockquote */
blockquote{
  margin: 0 0 1em 0;
  padding-left: 1em;
  border-left: 3px solid currentColor;
  opacity: 0.9;
}

/* Code */
code, pre{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
pre{
  overflow: auto;
  padding: 0.9em 1em;
  margin: 0 0 1em 0;
}

/* Ensure Gutenberg post title uses the same heading scale */
.entry-title, .wp-block-post-title{
  font-size: clamp(1.85rem, 2.2vw + 1.2rem, 3.0rem);
  line-height: 1.15;
  margin: 0 0 0.6em 0;
}

/* Ensure content inherits the chosen rhythm */
.entry-content{
  line-height: var(--ust-line-height-base);
}
.entry-content p, .entry-content li{
  line-height: inherit;
}
