/* KI-Werkstatt – statisches Stylesheet
   Nachbau des WordPress-Themes "understrap-child-RS2019" (Bootstrap 4 + Gutenberg-Blöcke),
   reduziert auf das, was die Seiten tatsächlich verwenden. */

/* ---------- Schriften ---------- */

/* Variable Open Sans, wie im Theme auf 80 % Breite festgelegt */
@font-face {
    font-family: 'OpenSansV';
    src: url('../fonts/OpenSans-Variable.woff2') format('woff2');
    font-weight: 300 800;
    font-stretch: 80%;
    font-display: swap;
}

/* Schriftzug "KI-WERKSTATT" in der Navigation */
@font-face {
    font-family: 'Open Sans Condensed';
    src: url('../fonts/OpenSansCondensed-Light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

/* ---------- Variablen ---------- */

:root {
    --brand: #7D212A;
    --brand-dark: #561a20;
    --brand-light: #b52f3c;
    --navbar-bg: #f0f0f0;
    --site-bg: #5a5a5a;
    --text: #000;
    --navbar-height: 70px;
    --font: 'OpenSansV', Arial, sans-serif;
    --font-logo: 'Open Sans Condensed', 'OpenSansV', Arial, sans-serif;
}

/* ---------- Grundlagen ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { font-family: var(--font); font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--site-bg);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
    font-weight: 400;
    line-height: 1.2;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p, ul, ol, table, blockquote { margin-top: 0; margin-bottom: 1rem; }
ul { list-style: square outside; }
ul ul, ol ol, ul ol, ol ul { margin-bottom: 0; }
strong, b { font-weight: 700; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-light); text-decoration: underline; }

img, video { max-width: 100%; height: auto; vertical-align: middle; }
figure { margin: 0 0 1rem; }
figcaption { font-size: 0.8rem; margin-top: .5em; }

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 10000;
    background: #fff; padding: .5rem 1rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}
@media (min-width: 576px)  { .container { max-width: 540px; } }
@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 992px)  { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }

/* ---------- Navigation ---------- */

.site-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 9999;
    background-color: var(--navbar-bg);
    box-shadow: 0 0 8px 0 rgba(0,0,0,.38);
}
.site-header .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    height: var(--navbar-height);
    color: rgb(93,93,93);
    text-decoration: none;
}
.brand:hover { text-decoration: none; color: rgb(93,93,93); }
.brand img { width: 40px; height: 40px; margin-right: 5px; }
.brand span {
    font-family: var(--font-logo);
    font-weight: 300;
    font-size: 35px;
    line-height: var(--navbar-height);
}

.nav-toggle {
    display: none;
    background: none;
    border: 0;
    padding: 10px 0 10px 10px;
    cursor: pointer;
}
.nav-toggle .bar {
    display: block;
    width: 22px; height: 2px;
    margin: 4px 0;
    border-radius: 1px;
    background: #3f3f3f;
    transition: all .2s;
}
.nav-toggle[aria-expanded="true"] .bar:nth-child(1) { transform: rotate(45deg); transform-origin: 10% 10%; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bar:nth-child(3) { transform: rotate(-45deg); transform-origin: 10% 90%; }

.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; }
.main-nav > ul > li { position: relative; padding-left: 20px; padding-top: 3px; }

.main-nav .nav-link {
    display: block;
    font: inherit;
    font-family: var(--font);
    font-size: 1.25rem;
    line-height: calc(var(--navbar-height) - 6px);
    letter-spacing: .5px;
    color: var(--text);
    background: none;
    border: 0;
    border-bottom: 3px solid var(--navbar-bg);
    padding: 0;
    cursor: pointer;
    transition-duration: .2s;
}
.main-nav .nav-link:hover,
.main-nav .nav-link[aria-expanded="true"],
.main-nav .is-active > .nav-link {
    color: var(--text);
    text-decoration: none;
    border-bottom-color: var(--brand);
}
.main-nav button.nav-link::after {
    content: "";
    display: inline-block;
    margin-left: .255em;
    vertical-align: .255em;
    border-top: .3em solid;
    border-right: .3em solid transparent;
    border-left: .3em solid transparent;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 10rem;
    padding: 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,.15);
    border-radius: .25rem;
}
.dropdown.is-open { display: block; }
/* Hintere Menüpunkte rechtsbündig öffnen, damit breite Einträge im Bild bleiben */
.main-nav > ul > li:nth-last-child(-n+2) > .dropdown { left: auto; right: 0; }
.dropdown a {
    display: block;
    white-space: nowrap;
    padding: .25rem 1.5rem;
    line-height: 2em;
    font-size: 1.1em;
    color: var(--text);
    border-bottom: 3px solid var(--navbar-bg);
}
.dropdown li:last-child a { border-bottom: 0; }
.dropdown a:hover, .dropdown a:focus { background: #f8f9fa; text-decoration: none; color: var(--text); }
.dropdown a[aria-current="page"], .dropdown a:active { background: var(--brand); color: #fff; }

/* Handy / kleines Tablet: Menü aufklappbar wie im Original (navbar-expand-md) */
@media (max-width: 767.98px) {
    .brand img { display: none; }
    .brand span { font-size: 30px; }
    .nav-toggle { display: block; }
    .main-nav { display: none; width: 100%; padding: 20px 0 30px; }
    .main-nav.is-open { display: block; }
    .main-nav > ul { display: block; }
    .main-nav > ul > li { padding: 0; text-align: center; }
    .main-nav .nav-link {
        width: 100%;
        font-size: 1.4rem;
        line-height: 4rem;
        border: 0;
        text-align: center;
    }
    .main-nav .nav-link:hover { background: #f8f9fa; }
    .dropdown {
        position: static;
        border: 0;
        border-radius: 0;
        background: #ececec;
    }
    .dropdown a {
        text-align: center;
        font-size: 1.3rem;
        line-height: 45px;
        padding: 0;
        border: 0;
        white-space: normal;
    }
}

/* ---------- Inhalt ---------- */

.nav-spacer { height: var(--navbar-height); }

.ar-content {
    position: relative;
    z-index: 1000;
    padding: 30px 0 20px;
    background: #fff;
    box-shadow: 0 0 11px 0 rgba(0,0,0,.75);
}
.ar-content .container { padding-top: 1px; }

.entry-title { margin-top: 0; }

.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    padding: .375rem .75rem;
    font-size: 1rem;
    border: 1px solid var(--brand);
    border-radius: .25rem;
    color: #fff;
    background-color: var(--brand);
    transition: background-color .15s, border-color .15s;
}
.btn:hover { color: #fff; background-color: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }

/* Gutenberg-Blöcke */
.wp-block-image { display: inline-block; text-align: center; }
.wp-block-image img { height: auto; }
.wp-block-image.aligncenter, .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-block-image.aligncenter { display: table; }
.wp-block-image.aligncenter > figcaption { display: table-caption; caption-side: bottom; }

.has-text-align-center { text-align: center; }
.has-text-align-left { text-align: left; }

.wp-block-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 2em;
    margin-bottom: 1.75em;
}
.wp-block-column { flex-grow: 1; min-width: 0; overflow-wrap: break-word; word-break: break-word; }
@media (max-width: 781px) {
    .wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
}
@media (min-width: 782px) {
    .wp-block-columns { flex-wrap: nowrap; }
    .wp-block-columns > .wp-block-column { flex-basis: 0; flex-grow: 1; }
    .wp-block-columns > .wp-block-column[style*="flex-basis"] { flex-grow: 0; }
}

.wp-block-spacer { clear: both; }

.wp-block-quote {
    margin: 0 0 1rem;
    padding-left: 10px;
    border-left: 5px solid var(--brand);
}
.wp-block-quote p { margin-bottom: .3rem; }
.wp-block-quote cite { font-size: .875em; font-style: normal; }

.wp-block-table { overflow-x: auto; }
.wp-block-table table { width: 100%; border-collapse: collapse; }
.wp-block-table .has-fixed-layout { table-layout: fixed; }
.wp-block-table th, .wp-block-table td {
    padding: .75rem;
    vertical-align: top;
    border: 1px solid #dee2e6;
    text-align: left;
    overflow-wrap: break-word;
}
.wp-block-table thead { background-color: #eee; }

.wp-block-video video { width: 100%; }

.wp-block-page-list { list-style: square outside; }

/* Platzhalter für Medien, die im Backup fehlen */
.media-missing {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    max-width: 100%;
    padding: 1rem;
    background: repeating-linear-gradient(45deg, #f4f4f4, #f4f4f4 10px, #e9e9e9 10px, #e9e9e9 20px);
    border: 1px dashed #999;
    color: #555;
    font-size: .85rem;
    text-align: center;
}

/* ---------- Footer ---------- */

.site-footer {
    background-color: var(--site-bg);
    color: #fff;
    font-size: .8rem;
    padding: 30px 0;
}
.site-footer .container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}
.footer-brand { font-weight: 600; font-size: 1.1em; }
.footer-logo { text-align: center; }
.footer-logo img { width: 146px; }
.footer-nav { list-style: none; margin: 0; padding: 0; text-align: right; }
.footer-nav li { line-height: 20px; }
.footer-nav a { color: #fff; }
.footer-nav a:hover { color: #fff; text-decoration: underline; }

@media (max-width: 767.98px) {
    .site-footer { font-size: 1rem; }
    .site-footer .container { grid-template-columns: 1fr; }
    .footer-logo { order: 3; text-align: left; }
    .footer-nav { text-align: left; }
    .footer-nav li { line-height: 1.5rem; }
}
