/**
 * Global Styles
 *
 * Body typography, heading elements (h1-h6), links, captions.
 * Extracted from theme.json styles.elements, styles.css, and styles.typography.
 */

/* ============================================
   Body / Global Typography
   ============================================ */
body {
	font-weight: var(--font-weight-normal);
	letter-spacing: var(--letter-spacing-base);
	line-height: var(--line-height-body);
}

/* ============================================
   Layout Fixes
   (from theme.json styles.css - layout gap/margin resets)
   ============================================ */
main {
	margin-bottom: 0 !important;
	padding-bottom: 0 !important;
}

body > .wp-site-blocks {
	padding-bottom: 0 !important;
}

.wp-block-template-part {
	margin-top: 0 !important;
}

footer.wp-block-template-part,
.wp-block-template-part[data-slug='footer'] {
	margin-top: 0 !important;
}

.wp-site-blocks > *:last-child {
	margin-bottom: 0 !important;
}

/* ============================================
   Bold / Strong
   GT America only has 400 (Regular) and 500 (Medium).
   Override the browser default (700) so <strong>/<b>
   use the real 500-weight font instead of faux-bold.
   ============================================ */
strong,
b {
	font-weight: var(--font-weight-bold);
}

/* ============================================
   Heading Defaults (all levels)
   ============================================ */
:where(h1, h2, h3, h4, h5, h6) {
	font-weight: var(--font-weight-normal);
	letter-spacing: var(--letter-spacing-base);
	line-height: var(--line-height-heading);
}

/* ============================================
   Heading Sizes & Spacing
   ============================================ */
:where(h1) {
	font-size: var(--wp--preset--font-size--xx-large);
	margin-top: 5rem;
	margin-bottom: 1rem;
}

:where(h2) {
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: var(--font-weight-bold);
	padding-top: 1rem;
	margin-bottom: 1rem;
}

:where(h3) {
	font-size: var(--wp--preset--font-size--large);
	margin-top: 1rem;
	margin-bottom: 1rem;
}

:where(h4) {
	font-size: var(--wp--preset--font-size--medium);
	margin-bottom: 1rem;
}

:where(h5) {
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.5px;
	margin-bottom: 1rem;
}

:where(h6) {
	font-size: var(--wp--preset--font-size--small);
	font-weight: var(--font-weight-normal);
	letter-spacing: 1.4px;
	text-transform: uppercase;
	margin-bottom: 1rem;
}

/* ============================================
   Heading & Paragraph Margins in Flow Layouts
   (override WP blockGap-generated margins)
   ============================================ */
.is-layout-flow > .wp-block-heading,
.is-layout-constrained > .wp-block-heading {
	margin-block-end: 1.5rem !important;
}

.is-layout-flow > .wp-block-post-title,
.is-layout-constrained > .wp-block-post-title {
	margin-block-end: 1.5rem !important;
}

.is-layout-flow > .wp-block-paragraph,
.is-layout-constrained > .wp-block-paragraph {
	margin-block-end: 1rem !important;
}

.is-layout-flow > .wp-block-post-content,
.is-layout-constrained > .wp-block-post-content {
	margin-block-end: 1rem !important;
}

.is-layout-flow > h1.wp-block-heading,
.is-layout-constrained > h1.wp-block-heading,
.is-layout-flow > h1.wp-block-post-title,
.is-layout-constrained > h1.wp-block-post-title,
.wp-block-post > h1.wp-block-heading,
.wp-block-post > h1.wp-block-post-title {
	margin-block-start: 2rem !important;
	margin-block-end: 5rem !important;
}

.is-layout-flow > h2.wp-block-heading,
.is-layout-constrained > h2.wp-block-heading,
.is-layout-flow > h2.wp-block-post-title,
.is-layout-constrained > h2.wp-block-post-title {
	margin-block-start: 1rem !important;
}

/* Projekte archive intro: space below the text is 2/3 of the
   title-to-text gap (h1 margin-block-end: 5rem). */
.tgbw-projekte-intro {
	margin-block-end: calc(5rem * 2 / 3);
}

/* ============================================
   Text Column Width
   Cap text blocks at 800px for legibility,
   independent of container width. Images, figures,
   embeds, columns, and custom blocks are untouched.
   WordPress doesn't add a class to <p>/<h*>/<ul>/<ol>
   inside post-content, so target raw tags scoped to
   .wp-block-post-content as well.
   ============================================ */
:where(
	.wp-block-paragraph,
	.wp-block-heading,
	.wp-block-list,
	.wp-block-quote,
	.wp-block-pullquote,
	.wp-block-post-title,
	.wp-block-post-excerpt
) {
	max-width: 800px;
}

.wp-block-post-content > :where(p, h1, h2, h3, h4, h5, h6, ul, ol, blockquote, pre) {
	max-width: 800px;
}

/* ============================================
   Links
   ============================================ */
:where(a) {
	color: currentColor;
}

:where(a:hover) {
	text-decoration: none;
}

/* ============================================
   Captions
   ============================================ */
:where(.wp-element-caption, figcaption) {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
}

/* ============================================
   Site logo mark (header)
   ============================================ */
.site-title-with-logo {
	align-items: center;
}

.site-logo-mark {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	/* Height 0 so the logo does not stretch the header row; the SVG
	   overflows evenly above/below and stays vertically centered. */
	height: 0;
	overflow: visible;
}

.site-logo-mark svg {
	display: block;
	height: 4.5rem;
	width: auto;
}

/* Footer variant: same size, but takes normal vertical space
   and sits centered just below the title. */
.site-logo-mark--footer {
	height: auto;
}
