/*
 * WordPress glue for Variante 1 Fassung B.
 *
 * v1.css is the stylesheet of the static page (prototyp/style.css) and v1-<seite>.css are its seite-*.css files. They stay word
 * for word; this file only covers what WordPress puts around or inside the markup: template part wrappers, core block
 * wrappers (figure around an image, wrapper around a button, group around a card link), the textual stand-ins of attributes
 * a block cannot store, the admin bar, the language switcher and the block editor. Values come from v1.css (variables of its
 * :root), nothing new is invented here.
 */

/* Template part wrappers (header, drawer and footer are parts): the wrapper must not become a box of its own, so the
   sticky header keeps the whole page as its range and the footer still sits at the end of the flow. */
.wp-site-blocks > .wp-block-template-part { display: contents; }
.wp-site-blocks { padding: 0; }
/* #29: the site wrapper carries the column of v1.css (body is a flex column), so the footer reaches the end of the window. */
.wp-site-blocks { flex: 1 0 auto; display: flex; flex-direction: column; }
.wp-site-blocks > main { flex: 1 0 auto; }

/* The static page has no block wrappers: figure and heading margins of the block library off, the V1 rules decide. */
:where(figure.wp-block-image, figure.wp-block-table) { margin: 0; }
:where(.wp-block-image) img { height: auto; }
.wp-block-image > a { display: block; }

/* Text that the static page writes directly into an element (li, div, nav) is a paragraph with the class gsb-t: it inherits
   font and color and has no margin of its own. */
.wp-block-group p.gsb-t, p.gsb-t { margin: 0; font: inherit; color: inherit; line-height: inherit; }

/* Links of the footer columns are flex items (boxes) on the static page */
.fuss nav > .gsb-lz > a { display: block; }

/* Lists, definition lists and tables as groups: browser margins off, the rules of the static page decide. */
:where(ul.wp-block-group, ol.wp-block-group, dl.wp-block-group) { margin: 0; }
:where(li.wp-block-group, dt.wp-block-group, dd.wp-block-group) { margin-left: 0; }
:where(address.wp-block-group) { font-style: normal; }
:where(table.wp-block-group) { border-collapse: collapse; }
:where(caption.wp-block-group) { text-align: left; }

/* Buttons: core/button wraps the link (inc/v1-ausgabe.php moves the design classes to the <a>). The row of buttons is a flex
   container of its own, the wrapper is the flex or grid item of the static page. */
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center; justify-self: start; align-self: flex-start; }
/* Margins without specificity: the row stands in for a <p> of the static page (p { margin: 0 }), so the page's own rules
   (.standort__weg, .mat-eig .knopf ...) must win. */
:where(.wp-block-buttons) { margin: 0; }
.wp-block-button { margin: 0; }
.wp-block-button > .knopf { display: inline-flex; }
.wp-block-buttons.absatz { display: block; }
.kopf > .wp-block-buttons { align-self: center; margin-left: 0; }
.kopf > .wp-block-buttons .kopf__cta { margin-left: 0; }
@media (max-width: 1080px) { .kopf > .wp-block-buttons { margin-left: auto; } }
@media (max-width: 760px) { .kopf > .wp-block-buttons { display: none; } }
.schublade__panel > .wp-block-buttons { align-self: flex-start; }
/* Drawer links: the prototype has the links as flex children of the nav (full rows). Here each link sits in a
   paragraph block and would stay inline: rule only as wide as the text, <small> below the rule (#27). */
.schublade nav > p { margin: 0; }
.schublade nav > p > a { display: block; }

/* Logo link of the header: the image block sits in the flex row */
.kopf__marke { flex: none; margin: 0; }
.kopf__marke > a { display: block; }
.kopf__marke img { width: 112px; height: auto; }
.nav-auf, .kopf__menue, .schublade__zu { margin-top: 0; margin-bottom: 0; }

/* Logged in: the admin bar (32 px, 46 px below 783 px) pushes the sticky and fixed elements down. */
.admin-bar .kopf { top: var(--wp-admin--admin-bar--height, 32px); }
.admin-bar .schublade { top: var(--wp-admin--admin-bar--height, 32px); }
.admin-bar html { scroll-padding-top: calc(var(--kopf-h) + var(--wp-admin--admin-bar--height, 32px)); }

/* Language switcher (block gsb/sprachwahl): the rules (.sprachwahl, drawer, breakpoints) come from v1.css, the markup is the one of the
   static page. Only the contact button differs: in WordPress it is a core/buttons block, not .kopf__cta. */
.kopf > .sprachwahl { margin-left: 0; }
@media (max-width: 1080px) {
  .kopf > .sprachwahl { margin-left: auto; }
  .kopf > .sprachwahl + .wp-block-buttons { margin-left: 0; }
}

/* Cards that are a link around blocks on the static page (a.pk, a.artikel, ul.leistungen a, the job rows): a group div carries
   the classes of the link, the link sits around the text of the heading and is stretched over the whole card. */
.karte-link { position: relative; }
.kartenlink, .kartenlink:hover { color: inherit; text-decoration: none; }
.kartenlink::after { content: ""; position: absolute; inset: 0; }
/* Rules of the static page that style the link as the card (a.pk, .leistungen a, ...) must not reach the link inside the heading */
.karte-link .kartenlink { display: inline; height: auto; padding: 0; border: 0; grid-template-columns: none; flex-direction: row; }
.kartenlink:focus-visible { outline: none; }
.kartenlink:focus-visible::after { outline: 2px solid var(--blau); outline-offset: 3px; }
.leistungen .karte-link { display: block; height: 100%; padding: 1.1rem 0 0; border-top: 1px solid var(--tinte); }
.leistungen .karte-link:hover h3 { text-decoration: underline; }
.kar-stellenliste .karte-link { display: grid; grid-template-columns: 8rem minmax(0, 1fr) auto; gap: 1rem clamp(1.5rem, 4vw, 4rem); align-items: center; padding: clamp(1.5rem, 3vw, 2.25rem) 0; }
@media (max-width: 960px) { .kar-stellenliste .karte-link { grid-template-columns: 1fr; } }
.kar-stellenliste .karte-link:hover h3, .kar-stellenliste .karte-link:hover .kar-stellenliste__pfeil { text-decoration: underline; }
/* Spans of the static page that are paragraphs in WordPress: the page's p rules of the list must not reach them. */
.kar-stellenliste .karte-link > p { margin-top: 0; max-width: none; }
.mat-einsatz__karten .karte-link > p.mat-karte__link { margin-top: 1rem; max-width: none; }
.kontakt__wege > .kontakt__tel { margin: 0; }
.standort__karte > .wp-element-caption { margin-bottom: 0; }
/* The map is an inline svg on the static page and a file in an <img> here: same frame. */
.standort__karte > img { display: block; width: 100%; height: auto; border: 1px solid rgb(0 0 0 / .18); }
/* Jump bar (Unternehmen, Karriere): on the static page the links are the flex items, here each link sits in a paragraph. */
.unt-sprung > p { flex: none; margin: 0; font-size: var(--t-klein); line-height: 1.55; }
.unt-sprung > p > a { display: block; }
.pk-wolfram .pk__bild { border-bottom-color: var(--c-w); }
.pk-pulvermetallurgie .pk__bild { border-bottom-color: var(--c-wc); }
.pk-wolframoxid .pk__bild { border-bottom-color: var(--c-wo); }

/* Image boxes of the static page (a span or a figure with fixed ratio around an <img>): core/image puts a figure in between. */
.pk__bild > .wp-block-image, .artikel__bild > .wp-block-image { height: 100%; margin: 0; }
.start__bild > img, .einstieg__bild > img, .weg__bild > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: inherit; }
.familie__bild > a { display: block; height: 100%; }
.familie__bild.wp-block-image img { display: block; }
.mgruppen__zelle > .wp-block-image { flex: none; margin: 0; }
.mat-kopf__bild > .wp-block-image { margin: 0; }
.mat-kopf__bild .pse__zelle { z-index: 1; }

/* Tables: a core/table keeps the rules of the static table; the caption sits above (order) and stays visible only where the
   static page shows it, a screen reader caption (class sr on the static page) is hidden by its wrapper. */
.wp-block-table { display: flex; flex-direction: column; }
.wp-block-table > figcaption { order: -1; text-align: left; margin: 0; }
.mat-tab .wp-block-table > figcaption, .mgruppen__tab .wp-block-table > figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mat-tab > .wp-block-table, .k-tab > .wp-block-table, .mgruppen__tab > .wp-block-table { overflow-x: visible; }
/* Tables in the running text of posts, glossary entries and jobs (the static article frame has none, the imported posts do): the look of the
   other tables of the design (row lines, no frame, sizes 17 and 14 px), wide tables scroll sideways. */
.recht__text .wp-block-table { display: block; overflow-x: auto; margin: 1.5rem 0; }
.recht__text table { width: 100%; border-collapse: collapse; font-size: var(--t-text); }
.recht__text th, .recht__text td { text-align: left; padding: .9rem 1.5rem .9rem 0; border-bottom: 1px solid var(--linie); vertical-align: top; }
.recht__text th { font-size: var(--t-klein); font-weight: 500; color: var(--tinte-2); }
.recht__text tr:first-child > th, .recht__text thead th { border-bottom-color: var(--tinte); }
.recht__text td { color: var(--tinte-2); }

/* Reveal: the editor shows every block (the render register adds data-zeigen only in the frontend) */
.editor-styles-wrapper [data-zeigen], .editor-styles-wrapper .zeigen { opacity: 1; transform: none; }

/* Filter buttons are paragraphs (in the editor) and buttons (on the page) */
.filter .gsb-als-knopf { margin: 0 .5rem .5rem 0; padding: .5rem .9rem; border: 1px solid var(--tinte); border-radius: 999px; background: none; font: 500 var(--t-klein) var(--schrift); color: var(--tinte-2); cursor: pointer; }
.filter .gsb-als-knopf.ist-an { background: var(--tinte); color: var(--weiss); }
.filter legend > span { margin: 0; }

/* Filter links of the server list (block gs-bavaria/beitragsliste, variant verzeichnis) look like the buttons */
.filter--links { display: flex; flex-wrap: wrap; gap: 0 0; }
.filter--links a { margin: 0 .5rem .5rem 0; padding: .5rem .9rem; border: 1px solid var(--tinte); border-radius: 999px; font: 500 var(--t-klein) var(--schrift); color: var(--tinte-2); text-decoration: none; }
.filter--links a:hover, .filter--links a[aria-current="page"] { background: var(--tinte); color: var(--weiss); }

/* Glossary: a term links to its single page */
.gl-eintrag h3 a.gl-link { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; text-decoration-color: var(--linie); }
.gl-eintrag h3 a.gl-link:hover, .gl-eintrag h3 a.gl-link:focus-visible { text-decoration-color: currentColor; }

/* Search results (core/query, patterns/ansicht-suche.php) in the card style of .artikelliste of the static page */
.treffer { margin-top: 1.5rem; }
.treffer .artikelliste { list-style: none; margin: 0; padding: 0; }
.treffer .wp-block-post-featured-image { margin: 0; }
.treffer .artikel .wp-block-post-date { margin-top: .9rem; font-size: var(--t-klein); color: var(--tinte-2); font-weight: 500; }
.treffer .artikel .wp-block-post-title { margin: .3rem 0 0; font-size: var(--t-h3); font-weight: 600; line-height: 1.25; }
.treffer .artikel .wp-block-post-title a { color: inherit; text-decoration: none; }
.treffer .artikel .wp-block-post-title a::after { content: ""; position: absolute; inset: 0; }
.treffer .artikel:hover .wp-block-post-title a { text-decoration: underline; }
.treffer .artikel .wp-block-post-excerpt { margin-top: .4rem; font-size: var(--t-klein); color: var(--tinte-2); font-weight: 500; }
.treffer .artikel .wp-block-post-excerpt p { margin: 0; }
.treffer .wp-block-query-pagination { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1.5rem; font-size: var(--t-klein); font-weight: 500; }

/* Contact form: status message after sending (inc/formular-senden.php) */
.kform__status { margin-top: 1rem; font-size: var(--t-text); color: var(--tinte-2); }
.kform__status--fehler { color: var(--tinte); font-weight: 600; }
.kform__status:focus { outline: 2px solid var(--blau); outline-offset: 4px; }

/* Editor: the drawer is shown as a block, the buttons carry their design classes on the wrapper */
.editor-styles-wrapper .kopf__menue { display: block; }
.editor-styles-wrapper .schublade { display: block; position: static; background: none; }
.editor-styles-wrapper .schublade__panel { position: static; width: auto; transform: none; border: 1px dashed var(--linie); }
.editor-styles-wrapper .nav-panel { display: block; position: static; width: auto; visibility: visible; opacity: 1; }
.wp-block-button.knopf > .wp-block-button__link { background: none; border: 0; padding: 0; color: inherit; font: inherit; border-radius: 0; text-decoration: none; }
.wp-block-button.knopf { display: inline-flex; align-items: center; }

/* #29: search results mix pages (no image) and posts (image). One card with an image tore the three-column grid
   apart, so the result list is a plain text list. Category archives (posts only) keep their images. */
.search .treffer .artikel__bild { display: none; }
