/*
 * Computerwerkstatt â€“ Cassiopeia child
 * Recreates the look of the former Themler template computerwerkstatt_1
 * (white page, Open Sans light, blue titles, orange active menu tab, blue hero band on the homepage).
 */

/* Open Sans, self-hosted (Fontsource 5.0.28, latin subset, SIL OFL 1.1 â€“ see ../fonts/OFL.txt) */
@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url("../fonts/open-sans-latin-300-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/open-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Open Sans";
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/open-sans-latin-400-italic.woff2") format("woff2");
}

@font-face {
    font-family: "Open Sans";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../fonts/open-sans-latin-700-normal.woff2") format("woff2");
}

/* html:root outranks the :root block Cassiopeia prints inline after this file */
html:root {
    --cwp-width: 1170px;
    --cwp-blue: #428bca;
    --cwp-blue-hover: #609dd2;
    --cwp-orange: #f5a314;
    --cwp-text: #555;
    --cwp-muted: #777;
    --cwp-hero: #8fbbe0;
    --cwp-footer: #ededed;
    --cwp-row: #f5f5f5;
    --cwp-border: #ccc;
    --cwp-font: "Open Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --cassiopeia-color-primary: #fff;
    --cassiopeia-color-link: var(--cwp-blue);
    --cassiopeia-color-hover: var(--cwp-orange);
    --cassiopeia-font-family-body: var(--cwp-font);
    --cassiopeia-font-family-headings: var(--cwp-font);
    --cassiopeia-font-weight-headings: 300;
    --template-special-color: var(--cwp-blue);
    --body-bg: #fff;
    --body-color: var(--cwp-text);
    --link-color: var(--cwp-blue);
    --link-color-rgb: 66, 139, 202;
    --link-hover-color: var(--cwp-orange);
    --link-hover-color-rgb: 245, 163, 20;
    --heading-color: var(--cwp-blue);
}

body {
    font-size: .875rem;
    color: var(--cwp-text);
    background: #fff;
}

h1,
h2 {
    color: var(--cwp-blue);
}

h3,
h4,
h5,
h6 {
    color: var(--cwp-text);
}

/* ------------------------------------------------------------------ header */

.container-header {
    padding-top: 1rem;
    background: #fff;
    box-shadow: none;
}

.container-header > .grid-child {
    width: 100%;
    max-width: var(--cwp-width);
    margin-inline: auto;
    padding-inline: 15px;
}

/* Brand = Themler headline: embossed computer logo, site title beside it, slogan below */
.container-header .navbar-brand {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 1.25rem;
    align-items: center;
    padding: 0;
}

.container-header .navbar-brand .brand-logo {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: clamp(1.4rem, 3.5vw, 1.875rem);
    font-weight: 300;
    line-height: 1.3;
    color: var(--cwp-blue);
    text-decoration: none;
}

.container-header .navbar-brand .brand-logo::before {
    flex: none;
    width: 96px;
    height: 73px;
    content: "";
    background: url("../images/logo.png") center / contain no-repeat;
}

.container-header .navbar-brand .brand-logo:hover,
.container-header .navbar-brand .brand-logo:focus {
    color: var(--cwp-blue-hover);
    text-decoration: none;
}

.container-header .site-description {
    grid-column: 1 / -1;
    margin-top: .5rem;
    padding-inline-start: .3rem;
    font-size: .875rem;
    color: var(--cwp-text);
}

/* Menu bar: uppercase items with dotted separators, orange active tab, blue hover */
.container-header .container-nav {
    padding-block: .75rem 1.75rem;
}

.container-header nav {
    --bs-navbar-padding-y: 0;
    margin-top: 0;
}

.container-header .navbar-toggler {
    color: var(--cwp-text);
    border-color: var(--cwp-border);
}

.container-header .metismenu.mod-menu > li {
    padding: 0;
    font-size: .875rem;
}

.container-header .metismenu.mod-menu > li > a {
    display: block;
    width: 100%;
    padding: 0 1.5rem;
    line-height: 40px;
    color: var(--cwp-text);
    text-transform: uppercase;
    text-decoration: none;
}

.container-header .metismenu.mod-menu > li > a:hover,
.container-header .metismenu.mod-menu > li > a:focus {
    color: #fff;
    background: var(--cwp-blue-hover);
}

.container-header .metismenu.mod-menu > li.active > a {
    color: #fff;
    background: var(--cwp-orange);
}

/* Themler used the filled tab, not Cassiopeia's underline */
.container-header .metismenu > li > a::after {
    display: none;
}

@media (width >= 992px) {
    .container-header .metismenu > li + li {
        border-inline-start: 1px dotted var(--cwp-muted);
    }

    .container-header .metismenu.mod-menu > li > a {
        padding: 0 2.6rem;
    }
}

/* -------------------------------------------------------- homepage hero */

.container-banner .cwp-hero {
    display: flex;
    justify-content: center;
    height: clamp(200px, 27vw, 350px);
    background: var(--cwp-hero);
}

.container-banner .cwp-hero img {
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --------------------------------------------------------- main content */

@supports (display: grid) {
    .site-grid {
        grid-template-columns: [full-start] minmax(0, 1fr) [main-start] repeat(4, minmax(0, calc((var(--cwp-width) - 3em) / 4))) [main-end] minmax(0, 1fr) [full-end];
    }
}

.container-component {
    overflow-wrap: anywhere;
}

.com-content-article .page-header h1,
.com-content-article .page-header h2 {
    margin-bottom: 1rem;
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 300;
    color: var(--cwp-blue);
}

.com-content-article__body h3 {
    font-size: clamp(1.25rem, 2.4vw, 1.6rem);
    font-weight: 300;
    line-height: 1.2;
}

.com-content-article__body h5 {
    font-size: .875rem;
    font-weight: 400;
}

/* Themler showed content links without underline; hover turns them orange */
.container-component a:not(.btn) {
    text-decoration: none;
}

/* Editor tables (Tarife, AGB) carry fixed pixel widths (~855px) and heights */
.com-content-article__body table {
    max-width: 100%;
    margin-bottom: 2rem;
    border-collapse: collapse;
}

.com-content-article__body table[style] {
    height: auto !important;
}

.com-content-article__body td,
.com-content-article__body th {
    padding: .5rem;
    border: 1px solid var(--cwp-border);
}

.com-content-article__body tr:nth-child(odd) > td {
    background: var(--cwp-row);
}

@media (width <= 767.98px) {
    .com-content-article__body table {
        display: block;
        overflow-x: auto;
    }
}

/* Logo slideshow (replaces WOWSlider): five 320x240 images cross-fading, 4s each */
.cwp-slideshow {
    position: relative;
    width: min(320px, 100%);
    aspect-ratio: 4 / 3;
    margin: 1.5rem auto;
}

.cwp-slideshow img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    animation: cwp-slide 20s infinite;
}

.cwp-slideshow img:nth-child(1) { animation-delay: 0s; }
.cwp-slideshow img:nth-child(2) { animation-delay: 4s; }
.cwp-slideshow img:nth-child(3) { animation-delay: 8s; }
.cwp-slideshow img:nth-child(4) { animation-delay: 12s; }
.cwp-slideshow img:nth-child(5) { animation-delay: 16s; }

@keyframes cwp-slide {
    0% { opacity: 0; }
    4% { opacity: 1; }
    20% { opacity: 1; }
    24% { opacity: 0; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .cwp-slideshow img {
        animation: none;
    }

    .cwp-slideshow img:first-child {
        opacity: 1;
    }
}

/* ------------------------------------------------------------------ footer */

.container-footer {
    margin-top: 2rem;
    font-size: .75rem;
    color: var(--cwp-text);
    text-align: center;
    background: var(--cwp-footer);
}

.container-footer .grid-child {
    justify-content: center;
    padding-block: 2rem;
}

.container-footer a {
    color: var(--cwp-blue);
}

.container-footer a:hover,
.container-footer a:focus {
    color: var(--cwp-orange);
}

.back-to-top-link {
    color: #fff;
    background: var(--cwp-blue);
    border-color: var(--cwp-blue);
}
