/*
Theme Name: Vereinigung Technische Orthopädie
Theme URI: https://vereinigung-to.de/
Author: SF
Author URI: https://vereinigung-to.de/
Description: Eigenes WordPress-Theme für die Vereinigung Technische Orthopädie e. V.
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vereinigung-to
*/

/* ==============================================================
   Variablen
============================================================== */

:root {
    --vto-primary: #00318d;
    --vto-primary-light: #4865aa;
    --vto-text: #292929;
    --vto-muted: #999;
    --vto-border: #00318d;
    --vto-background-light: #f2f2f2;
    --vto-white: #fff;
}

/* ==============================================================
   Grundlayout
============================================================== */

html {
    box-sizing: border-box;
}

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

body {
    overflow-wrap: break-word;
    color: var(--vto-text);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--vto-primary);
}

a:hover,
a:focus {
    color: var(--vto-primary-light);
}

.site-content {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.site-main:focus {
    outline: none;
}

/* ==============================================================
   Header
============================================================== */

.site-header {
    margin-bottom: 0;
}

.site-header > .container {
    border-top: 4px solid var(--vto-primary);
}

.header-left,
.header-right {
    min-height: 176px;
}

.header-left,
.header-right {
    border-bottom: 1px dotted var(--vto-border);
}

.header-right {
    position: relative;
}

/* ==============================================================
   Logo
============================================================== */

.site-logo {
    padding-top: 40px;
    padding-bottom: 40px;
}

.site-logo img,
.custom-logo {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Das von WordPress erzeugte Custom-Logo nicht inline darstellen. */
.custom-logo-link {
    display: inline-block;
}

/* ==============================================================
   Meta-Navigation
============================================================== */

#metanav {
    float: right;
    clear: both;
    margin-top: 13px;
    color: var(--vto-text);
    font-size: 12px;
}

.meta-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.meta-menu li {
    margin: 0;
    padding: 0;
}

.meta-menu li + li::before {
    content: "|";
    margin: 0 0.5rem;
    color: var(--vto-text);
}

.meta-menu a {
    color: var(--vto-text);
    text-decoration: none;
}

.meta-menu a:hover,
.meta-menu a:focus,
.meta-menu .current-menu-item > a {
    color: var(--vto-primary);
    text-decoration: underline;
}

/* ==============================================================
   Claim
============================================================== */

.site-claim {
    position: absolute;
    right: 12.5px;
    bottom: 40px;
}

.site-claim p {
    margin-bottom: 0;
    font-size: 14px;
    text-align: right;
}

/* ==============================================================
   Hauptnavigation
============================================================== */

/*
 * Alle Navigationselemente nehmen die vollständige Breite der
 * linken Bootstrap-Spalte ein.
 */
.main-navigation,
#macronav,
#macronav .sub-menu {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

#macronav,
#macronav .sub-menu {
    list-style: none;
}

/*
 * Jeder Menüpunkt nimmt die vollständige Navigationsbreite ein.
 * position: relative dient als Bezugspunkt für das Pluszeichen.
 */
#macronav li {
    position: relative;
    display: block;
    float: none;
    width: 100%;
    margin: 0;
    padding: 6px 0;
    border-bottom: 1px dotted var(--vto-border);
    text-transform: uppercase;
}

/*
 * Die Links nehmen ebenfalls die vollständige Breite ein.
 * Der rechte Innenabstand hält Platz für das Pluszeichen frei.
 */
#macronav li > a {
    position: relative;
    display: block;
    float: none;
    width: 100%;
    min-height: 24px;
    margin: 0;
    padding: 0 2rem 0 0;
    color: var(--vto-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none;
}

/*
 * Das Pluszeichen wird absolut am rechten Rand des vollständigen
 * Menülinks positioniert. Es bleibt auch im geöffneten Zustand ein Plus.
 */
#macronav li.menu-item-has-children > a::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 0;
    display: block;
    width: 1.5rem;
    margin: 0;
    padding: 0;
    color: var(--vto-text);
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    text-align: right;
    transform: translateY(-50%);
}

/* Untermenüs standardmäßig ausblenden. */
#macronav .sub-menu {
    display: none;
}

/*
 * Untermenü anzeigen, wenn sich der aktuell aufgerufene Menüpunkt
 * in diesem Zweig befindet.
 */
#macronav .current-menu-item > .sub-menu,
#macronav .current-menu-parent > .sub-menu,
#macronav .current-menu-ancestor > .sub-menu,
#macronav .current_page_item > .sub-menu,
#macronav .current_page_parent > .sub-menu,
#macronav .current_page_ancestor > .sub-menu {
    display: block;
}

/* Untermenüpunkte */
#macronav .sub-menu li {
    padding: 3px 0;
    border-bottom: 0;
    text-transform: none;
}

/*
 * Die Einrückung erfolgt am Link und nicht am ul-Element.
 * Dadurch bleibt das Pluszeichen an derselben rechten Außenkante.
 */
#macronav .sub-menu li > a {
    padding-left: 1rem;
    font-size: 14px;
    font-weight: 400;
}

/* Zweite Untermenüebene weiter einrücken. */
#macronav .sub-menu .sub-menu li > a {
    padding-left: 2rem;
}

/* Dritte Untermenüebene weiter einrücken. */
#macronav .sub-menu .sub-menu .sub-menu li > a {
    padding-left: 3rem;
}

/* Interaktion und aktueller Menüpunkt */
#macronav li > a:hover,
#macronav li > a:focus,
#macronav .current-menu-item > a,
#macronav .current_page_item > a {
    color: var(--vto-primary);
    text-decoration: none;
}

#macronav .current-menu-item > a,
#macronav .current_page_item > a {
    font-weight: 700;
}

/* Pluszeichen übernimmt beim Hover die Linkfarbe. */
#macronav li.menu-item-has-children > a:hover::after,
#macronav li.menu-item-has-children > a:focus::after,
#macronav li.menu-item-has-children.current-menu-item > a::after,
#macronav li.menu-item-has-children.current-menu-ancestor > a::after {
    color: var(--vto-primary);
}

/* Tastaturfokus sichtbar machen */
#macronav a:focus-visible,
.meta-menu a:focus-visible,
.footer-menu a:focus-visible {
    outline: 2px solid var(--vto-primary);
    outline-offset: 2px;
}

/* ==============================================================
   Inhaltsbereich
============================================================== */

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

.entry-content::after {
    display: table;
    clear: both;
    content: "";
}

/* WordPress-Bildausrichtungen */
.alignleft {
    float: left;
    margin: 0 1.5rem 1rem 0;
}

.alignright {
    float: right;
    margin: 0 0 1rem 1.5rem;
}

.aligncenter {
    display: block;
    margin-right: auto;
    margin-left: auto;
}

/* ==============================================================
   Tabellen
============================================================== */

.entry-content table {
    max-width: 100%;
}

/* ==============================================================
   Footer
============================================================== */

.site-footer {
    clear: both;
    margin-top: 40px;
    border-top: 4px solid var(--vto-primary);
}

.site-footer .footer {
    margin: 5px -12.5px;
    padding: 4px 0;
}

.copyright,
.footernav {
    color: var(--vto-primary);
    line-height: 36px;
}

.footer-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-menu li {
    margin: 0;
    padding: 0;
}

.footer-menu li + li::before {
    content: "|";
    margin: 0 0.5rem;
    color: var(--vto-primary);
}

.footer-menu a {
    color: var(--vto-primary);
    text-decoration: none;
}

.footer-menu a:hover,
.footer-menu a:focus,
.footer-menu .current-menu-item > a {
    text-decoration: underline;
}

/* ==============================================================
   Barrierefreiheit
============================================================== */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.screen-reader-text:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 100000;
    width: auto;
    height: auto;
    margin: 0;
    padding: 1rem;
    overflow: visible;
    clip-path: none;
    color: #000;
    background: #fff;
}

/* ==============================================================
   Responsive Darstellung
============================================================== */

@media (max-width: 991px) {
    .site-logo {
        padding: 5px 0;
    }

    .header-left,
    .header-right {
        min-height: 0;
    }

    /*
     * Entspricht dem Verhalten der bisherigen Website:
     * Meta-Menü und Claim werden unter 992 px ausgeblendet.
     */
    .header-right {
        display: none;
    }
}

@media (max-width: 767px) {
    .site-content {
        margin-top: 1rem;
        margin-bottom: 1rem;
    }

    .site-sidebar {
        margin-bottom: 2rem;
    }

    .site-main {
        margin-bottom: 2rem;
    }

    .site-footer .footer {
        margin-right: 0;
        margin-left: 0;
    }

    .copyright {
        margin-bottom: 0.5rem;
        line-height: 1.5;
    }

    .footer-menu {
        justify-content: flex-start;
        line-height: 1.8;
    }

    .alignleft,
    .alignright {
        float: none;
        display: block;
        margin-right: auto;
        margin-left: auto;
    }
}