/* Tessin-Blog: Tablets und Smartphones.
 * Ergänzt style.css (Artisteer 4, feste Breite 975 px) und das Zusatz-CSS aus
 * „Simple Custom CSS“, das ab 994 px die Seitenleiste ausblendet und den Kopf in festen
 * Höhen beschneidet. Wird nach beiden geladen.
 *   ab 995 px    Desktop wie bisher, nur das Untermenü lässt sich auch antippen
 *   768–994 px   Tablet hochkant: zwei Spalten, schmalere Seitenleiste
 *   bis 767 px   Smartphone: eine Spalte, Kategorien und Suche unter dem Inhalt */

/* ------------------------------------------------ Untermenü (alle Breiten) */

ul.art-hmenu > li.tfw-open > ul {
    visibility: visible;
    top: 100%;
}

@media (hover: none) {
    ul.art-hmenu li:hover > ul {
        visibility: hidden;
    }
    ul.art-hmenu > li.tfw-open > ul {
        visibility: visible;
    }
}

ul.art-hmenu > li.tfw-has-sub > a:after {
    content: "";
    display: inline-block;
    margin-left: .45em;
    vertical-align: middle;
    border: .3em solid transparent;
    border-top-color: currentColor;
    border-bottom: 0;
}

ul.art-hmenu a:focus-visible {
    outline: 2px solid #e2001a;
    outline-offset: -2px;
}

/* ------------------------------------------------- Tablet und Smartphone */

@media (max-width: 994px) {
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    body {
        min-width: 0;
    }
    /* Das 1900-px-Hintergrundbild ist neben der vollen Seitenbreite nie zu sehen. */
    #art-main {
        background: #fff;
    }

    /* Kopf im Seitenverhältnis des Bildes (975 × 340) statt fester Höhen mit Beschnitt */
    .art-header {
        height: 0;
        padding-top: 34.872%;
        background-size: 100% auto;
        background-position: 0 0;
    }

    /* Hauptmenü: ganze Breite, 46 px hohe Flächen zum Antippen */
    .art-nav {
        position: relative;
    }
    ul.art-hmenu {
        display: flex;
        width: 100%;
    }
    ul.art-hmenu:after,
    ul.art-hmenu > li:before {
        display: none;
    }
    ul.art-hmenu > li {
        float: none;
        flex: 1 1 auto;
        position: static;
        margin: 0;
    }
    ul.art-hmenu > li + li {
        border-left: 1px solid rgba(0, 0, 0, .12);
    }
    ul.art-hmenu > li > a,
    ul.art-hmenu > li > a:link,
    ul.art-hmenu > li > a:visited,
    ul.art-hmenu > li > a:hover,
    ul.art-hmenu > li:hover > a {
        height: 46px;
        line-height: 46px;
        padding: 0 10px;
        font-size: 16px;
        text-align: center;
        white-space: nowrap;
    }
    ul.art-hmenu > li.tfw-open > a,
    ul.art-hmenu > li.tfw-open > a:link,
    ul.art-hmenu > li.tfw-open > a:visited {
        background: #e2001a;
        color: #fff;
    }

    /* Untermenü als Tafel unter dem Menü, über die ganze Breite */
    ul.art-hmenu li:hover > ul {
        visibility: hidden;
    }
    ul.art-hmenu > li > ul,
    ul.art-hmenu > li > ul.art-hmenu-left-to-right,
    ul.art-hmenu > li > ul.art-hmenu-right-to-left,
    ul.art-hmenu > li.tfw-open > ul {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 30;
        margin: 0;
        padding: 6px 0 10px;
        background: #fff;
        border-top: 3px solid #e2001a;
        box-shadow: 0 10px 24px rgba(0, 0, 0, .22);
        column-count: 2;
        column-gap: 0;
    }
    ul.art-hmenu > li.tfw-open > ul {
        visibility: visible;
    }
    ul.art-hmenu > li > ul:before {
        display: none;
    }
    ul.art-hmenu ul li {
        break-inside: avoid;
    }
    ul.art-hmenu ul li a,
    ul.art-hmenu ul li a:link,
    ul.art-hmenu ul li a:visited,
    ul.art-hmenu ul li a:hover,
    ul.art-hmenu ul li:hover > a {
        width: auto !important;
        height: auto;
        min-width: 0;
        padding: 11px 20px;
        font-size: 16px;
        line-height: 1.35;
        white-space: normal;
        background: none;
    }
    ul.art-hmenu ul li a:hover,
    ul.art-hmenu ul li a:focus {
        background: #f3f3f3;
        color: #e2001a;
    }

    /* Beiträge */
    .art-post {
        padding: 0 20px;
    }
    .art-postcontent,
    .art-postcontent table {
        font-size: 15px;
    }
    /* „#art-main span“ im Zusatz-CSS ist für die Metazeile gedacht, trifft aber auch
       Textstellen in 14 Beiträgen und macht sie klein und in Grossbuchstaben. */
    #art-main .art-postcontent span {
        font-size: inherit;
        text-transform: none;
    }
    .art-postcontent img,
    .art-postcontent .wp-caption {
        max-width: 100%;
        height: auto;
        box-sizing: border-box;
    }
    .art-postcontent .wp-caption {
        margin: 10px 0;
    }
    .art-postcontent iframe {
        max-width: 100%;
    }
    .art-postcontent iframe[src*="youtube"],
    .art-postcontent iframe[src*="vimeo"] {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .art-postcontent table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
    }

    /* Formulare: ab 16 px zoomt iOS beim Antippen nicht mehr in das Feld */
    #respond input,
    #respond textarea,
    form.art-search input[type="text"] {
        font-size: 16px;
    }
    form.art-search input[type="text"] {
        padding: 9px 40px 9px 10px;
    }
    form.art-search input[type="submit"] {
        width: 40px;
        right: 0;
        top: 0;
    }

    .tfw-share {
        font-size: 15px;
        line-height: 2.2;
    }
}

/* ------------------------------------------------------ Tablet hochkant */

@media (min-width: 768px) and (max-width: 994px) {
    .art-content-layout .art-layout-cell.art-sidebar1 {
        display: table-cell;
        width: 210px;
    }
    .art-sidebar1 .art-block li {
        display: flex;
        align-items: center;
        margin: 0;
        font-size: 14px;
        line-height: 1.35;
    }
    .art-sidebar1 .art-block li a {
        display: block;
        padding: 6px 0;
    }
}

/* ----------------------------------------------------------- Smartphone */

@media (max-width: 767px) {
    ul.art-hmenu > li > a,
    ul.art-hmenu > li > a:link,
    ul.art-hmenu > li > a:visited,
    ul.art-hmenu > li > a:hover,
    ul.art-hmenu > li:hover > a {
        padding: 0 6px;
        font-size: 15px;
    }
    ul.art-hmenu > li > ul,
    ul.art-hmenu > li > ul.art-hmenu-left-to-right,
    ul.art-hmenu > li > ul.art-hmenu-right-to-left,
    ul.art-hmenu > li.tfw-open > ul {
        column-count: 1;
    }
    ul.art-hmenu ul li a,
    ul.art-hmenu ul li a:link,
    ul.art-hmenu ul li a:visited {
        padding: 12px 16px;
    }
    ul.art-hmenu ul li + li {
        border-top: 1px solid #eee;
    }

    /* Eine Spalte; die Seitenleiste (Suche, Kategorien) rückt unter den Inhalt */
    .art-content-layout,
    .art-content-layout .art-layout-cell {
        display: block;
        width: auto;
    }
    .art-content-layout-row {
        display: flex;
        flex-direction: column;
    }
    .art-content-layout .art-layout-cell.art-sidebar1 {
        display: block;
        order: 2;
        width: auto;
        margin: 28px 16px 0;
        padding-top: 12px;
        border-right: 0;
        border-top: 1px dotted #b5b5b5;
    }
    .art-sidebar1 .art-block ul > li:before {
        display: none;
    }
    .art-sidebar1 form.art-search {
        margin: 5px 0 12px;
        right: 0;
    }
    .art-sidebar1 .widget_categories .art-blockcontent ul {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 12px 0 4px;
    }
    .art-sidebar1 .widget_categories li {
        margin: 0;
    }
    .art-sidebar1 .widget_categories li a,
    .art-sidebar1 .widget_categories li a:link,
    .art-sidebar1 .widget_categories li a:visited {
        display: inline-block;
        padding: 8px 12px;
        border: 1px solid #d6d6d6;
        border-radius: 18px;
        background: #fafafa;
        color: #333;
        font-size: 14px;
        line-height: 1.2;
        text-decoration: none;
    }

    .art-post {
        padding: 0 16px;
    }
    .art-postheader {
        font-size: 22px;
    }
    .art-postcontent,
    .art-postcontent table {
        font-size: 16px;
    }
    .art-postcontent h2 {
        font-size: 20px;
    }
    .art-postcontent .alignleft,
    .art-postcontent .alignright {
        float: none;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }
    .art-postcontent .navigation .alignleft,
    .art-postcontent .navigation .alignright {
        margin: 0;
        padding: 8px 0;
        text-align: left;
    }

    /* Einzelbeitrag: Titel zuerst; die Links zum vorigen und nächsten Beitrag stehen im
       Theme darüber und schieben den Anfang sonst einen Bildschirm nach unten. */
    .single .art-layout-cell.art-content {
        display: flex;
        flex-direction: column;
    }
    .single .art-content > article.post {
        order: -1;
    }
    .single .art-postcontent .navigation {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid #ddd;
    }
}
