﻿/* Stylesheet für Selfhtml Design 02 
  responsives Layout mit Flexbox ab Z. 248   */

/* ====================================================   GLOBAL DEFINITION   ==================================================== */

/* alternatives Boxmodell */

html {
  box-sizing: border-box;
}

*,
::before,
::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  font: normal 1em Arial, sans-serif;
  /* Keine Mindestschriftgröße! Dies wird dem Browser, bzw. dem Nutzer überlassen! */
  color: #333;
}


/* ====================================================   HEADER   ==================================================== */

[role="banner"] {
  background: url("../img/Design02.svg") no-repeat right,
  #000 repeating-linear-gradient(-45deg, black, #151515 8em);
  background-size: contain, auto;
  padding: 0 0 0.5em;
}

@media screen and (max-width: 40em) {
  /* Normalerweise werden solche responsiven Layout-Einstellungen gesondert am Schluss notiert. Hier sollen die mulitple backgrounds aber gleich anfangs gezeigt werden. Auf zu kleinen Bildschirmen wird das Bild jedoch ausgeblendet.  */
  [role="banner"] {
    background-image: none;
  }
}

[role="banner"] h1,
[role="banner"] p {
  max-width: 60em;
  margin: 0 auto;
  padding-left: 10%;
  font-family: 'Roboto', sans-serif;
  font-variant: small-caps;
  font-weight: lighter;
  font-size: 2em;
  color: #eee;
}

[role="banner"] p {
  padding: 1em 10%;
  color: white;
}

[role="banner"] img {
  float: right;
  height: 15em;
}


/* ====================================================  NAV   ==================================================== */

nav {
  max-width: 30em;
  margin: 0 auto;
}

nav ul {
  text-align: center;
  margin: 0;
  padding: 0;
  list-style-type: none;
}

nav a {
  background: #28729a;
  color: white;
  text-decoration: none;
  display: inline-block;
  padding: 1em 0 1em 1em;
}

nav a:hover,
nav a:focus {
  background: #28729a;
  color: white;
}

nav a:hover::after,
nav a:focus::after {
  color: transparent;
}


/* ===================== STYLE SWITCHER ============================= */

#styleswitcher {
  max-width: 60em;
  margin: 0 auto;
}

#styleswitcher li {
  list-style-type: none;
  display: inline-block;
}

#styleswitcher button {
  border: 1px solid transparent;
  border-radius: 0.2em;
  color: white;
  width: 4.5em;
  text-align: center;
}

[data-stylesheet="./css/violet.css"] {
  background: #9357b9;
}

[data-stylesheet="./css/standard.css"] {
  background: #28729a;
}

[data-stylesheet="./css/green.css"] {
  background: #8db243;
  color: black;
}

#styleswitcher button[data-stylesheet="./css/yellow.css"] {
  background: #dfac20;
  color: black;  
}

/* ohne die Angabe der id hätte der Attributselektor eine geringere Spezifität und die Farbangabe des Texts wäre ignoriert worden. */

[data-stylesheet="./css/orange.css"] {
  background: #df6c20;
}

[data-stylesheet="./css/red.css"] {
  background: #c32e04;
}

#styleswitcher button:hover,
#styleswitcher button:focus {
  font-weight: bold;
  border: 1px solid white;
}

/* ==================================== content ===========================  */

a,
.akzentfarbe1 {
  color: #28729a;
}

.akzentfarbe2 {
  color: #ccc;
}

h1,
h2 {
  color: #28729a;
  font-size: 1.50em;
  font-weight: normal;
  font-family: 'Tauri', serif;
  text-transform: uppercase;
}

.smallteaser {
  background: #eee;
  padding: 0.5em;
}

.whiteback {
  background: #fff;
  padding: 0.5em;
}

.smallteaser h2 {
  display: flex;
  border-bottom: 2px solid;
  align-items: flex-end;
}

.smallteaser h2 img {
  margin-left: auto;
}

.bigteaser > img {
  float: right;
  margin: .5em;
  width: 2.5em;
}

.smallteaser header p {
  border-bottom: 1px #D1D1D1 solid;
}

a.more {
  float: right;
  padding: .25em 0.5em;
  margin-top: 1em;
  background: #28729a;
  color: white;
}

a.more:hover,
a.more:focus {
  background-color: #909090;
}

aside,
.bigteaser {
  background: #28729a;
  padding: 0.5em;
  color: #FFFFFF;
}


aside a,
.bigteaser a {
  color: white;
}

.bigteaser a.more {
  background: white;
  color: #28729a;
}

/* ==================================== footer ===========================  */

footer {
  background: #666 repeating-linear-gradient(-45deg, black, #151515 8em);
  padding: 0.5em 1em 0;
  margin-top: 1em;
  color: white;
}

footer > * {
  flex:  1 1 20em;
}

footer .branding {
  text-align: right;
}


/* ====================================================   LAYOUT   ==================================================== */

/* Mobile first ! alle Blöcke haben 100%, Navigation unten*/

body {
  padding: 0 1em;
}

main {
  max-width: 65em;
  margin: 0 auto;
  padding: 1em 0;
}

/* Navigationselemente werden untereinander angezeigt */

nav ul {
  display: flex;
  flex-direction: column;
}

nav li {
  margin: .3em 0;
  flex: 1 1 100%;
}

nav a {
  width: 95%;
  margin: 0 5%;
  border-radius: .5em;
}

[aria-current=page] {
  color: black;
  font-weight: bold;
}

[aria-current=page]:hover,
[aria-current=page]:focus {
  color: black;
}

/* 2-Spaltenlayout mit breiterem aside */
@media screen and (min-width: 40em) {

/* Navigation wird nebeneinander ausgerichtet. */	

body {
  padding: 0;
}

/* Navigation wird nebeneinander ausgerichtet. */

nav ul {
  flex-direction: row;
  background: transparent;
}

nav li {
  margin: 0;
  flex: 1 1 0%;
}

nav a {
  background: transparent;
}

[aria-current=page] {
  color: #28729a;
}
}


/* Main wird zum Flex-Container */

main,
footer {
  display: flex;
  flex-flow: row wrap;
}

main > * {
  flex: 1 1 18em;
  margin: 1em;
}

.bigteaser {
  flex: 1 1 18em;
}

/* Alle Unterseiten (nicht die Startseite also :not(.home)) */

:not(.home) h1 {
  flex: 0 0 100%; /* Überschrift über dem Hauptbereich über die gesamte Breite */
}

:not(.home) article {
  flex: 2 2 30em;   /* Hauptartikel zur Seitenspalte im Verhältnis 2:1 */
  max-width: 40em;  /* Begrenzt die Zeilen auf eine gut lesbare Länge */
}

:not(.home) article + aside {
  flex: 1 1 15em;   /* Seitenleiste zum Hauptartikel im Verhältnis 1:2 */
  max-width: 40em;  /* Begrenzt die Zeilen auf eine gut lesbare Länge */
}


/* see https://coder-coder.com/display-divs-side-by-side/#flexbox-method */

.flex-container {
    display: flex;
}

.flex-child {
    flex: 1;
    border: 2px solid blue;
    margin-right: 20px;
}  

.flex-child:first-child {
    margin-right: 20px;
} 
