﻿/*
 *  Event-Kalender (SQLite) - style.css (utf-8)
 * von Werner Zenk
 */

@charset "utf-8";

/* Globale Styles */
:root {
  --font-family: system-ui, -apple-system, "Segoe UI", "Roboto", "Ubuntu", "Cantarell", "Noto Sans", "Verdana", "Arial",
    sans-serif;
  --color: rgb(55, 55, 55);
  --bgcolor-even: rgba(250, 250, 250, 0.97);
  --bgcolor-odd: rgba(240, 240, 240, 0.97);
  --bgcolor-scheme: rgb(255, 255, 255);
  --highlight-color: rgb(4 122 240);
  --highlight-bgcolor: rgba(223, 238, 255, 0.97);
  color-scheme: light dark;
}

/* Kalender */
div#kalender {
  min-height: 325px;
  width: 100%;
}

/* Tabelle */
table#tabelle {
  font-family: var(--font-family);
  font-size: clamp(0.9rem, 1vw, 1.1rem);
  table-layout: auto;
  border-collapse: separate;
  border-spacing: 1px;
  width: 100%;
  z-index: 10;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}

/* Tabelle (nth-child even/odd) */
table#tabelle th:nth-child(even),
table#tabelle td:nth-child(even) {
  background-color: var(--bgcolor-even);
}

table#tabelle th:nth-child(odd),
table#tabelle td:nth-child(odd) {
  background-color: var(--bgcolor-odd);
}

/* th (Wochentage) */
table#tabelle th.spalten {
  font-weight: normal;
  text-align: center;
  width: 14.285714%;
  box-shadow: inset 0px -0.5px rgb(190, 190, 190);
  position: sticky;
  top: 30px;
  z-index: 50;
}

table#tabelle th.spalten:hover {
  color: var(--highlight-color);
}

/* Woche */
table#tabelle th.spalte {
  font-weight: normal;
  text-align: center;
  box-shadow: inset 0px -0.5px rgb(190, 190, 190);
  position: sticky;
  top: 30px;
  z-index: 50;
}

/* Ein Tag */
table#tabelle td.eintag {
  vertical-align: top;
  height: 65px;
}

table#tabelle td.eintag:hover {
  color: var(--highlight-color);
}

/* Kein Tag */
table#tabelle td.keintag {
  color: rgba(184, 184, 184, 0.5);
  vertical-align: top;
}

/* Heute */
table#tabelle td.heute {
  box-shadow: inset 0px 0px 4px var(--highlight-color);
  border-radius: 2px;
}

/* Woche */
table#tabelle th.woche {
  font-weight: normal;
  text-align: center;
  vertical-align: middle;
  padding: 0px 5px 0px 5px;
}

table#tabelle th.woche:hover {
  color: var(--highlight-color);
}

/* Navigation */
table#tabelle th#navigation {
  font-size: clamp(1.2rem, 1.3vw, 1.5rem);
  font-weight: normal;
  text-align: center;
  white-space: nowrap;
  background-image: linear-gradient(var(--bgcolor-scheme), var(--bgcolor-odd));
  position: sticky;
  top: 0px;
  z-index: 100;
}

/* Menue */
table#tabelle td#menue {
  text-align: right;
  background-image: linear-gradient(var(--bgcolor-odd), var(--bgcolor-scheme));
}

/* Tabellenzeile hervorheben */
table#tabelle > tbody > tr {
  transition: background-color 0.3s;
}

table#tabelle > tbody > tr:hover {
  background-color: var(--highlight-color);
}

/* Hyperlinks */
a:link.link,
a:visited.link {
  color: var(--highlight-color);
  word-break: break-all;
}

/* Funktionsaufrufe */
.navLink {
  display: inline-block;
  padding: 1px 8px 1px 8px;
  border-radius: 2px;
  transition: all 0.3s;
}

.navLink:hover {
  color: var(--highlight-color);
  background-color: var(--highlight-bgcolor);
  outline: solid 1px var(--highlight-color);
  cursor: pointer;
}

/* Fenster schließen */
div#titelleiste > .navLink {
  padding: 5px 8px 5px 8px;
}

/* Tage außerhalb des aktuellen Monats */
div.keineAuswahl {
  padding: 1px 8px 1px 8px;
}

/* Abmelden Markierung */
span.abmelden {
  text-decoration: underline solid 0.5px currentColor;
  text-underline-offset: 2px;
}

/* Fenster */
form#form {
  margin-top:-53px;
  font-family: var(--font-family);
  font-size: clamp(1rem, 1.1vw, 1.1rem);
  color: var(--color);
  background-color: var(--bgcolor-even);
  border-radius: 5px;
  outline: solid 1px rgb(153, 153, 153);
  box-shadow: 0px 0px 2px 2px rgb(140 140 140 / 55%);
  position: absolute;
  z-index: 1500;
  -webkit-user-select: none;
  user-select: none;
}

/* Titelleiste */
div#titelleiste {
  font-family: var(--font-family);
  font-size: 0.90em;
  color: rgb(0, 0, 0);
  letter-spacing: 0.5px;
  background-color: var(--highlight-bgcolor);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom: Solid 1px rgba(155, 155, 155, 0.5);
  display: grid;
  grid-template-columns: 1.9fr 0.27fr;
  height: 20px;
  padding: 5px 0px 5px 10px;
  position: sticky;
  top: 0px;
  cursor: move;
}

/* Kalender-Icon */
div#titel::before {
  content: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAR0lEQVR42mNggIGqM//BGB3gEideA0yAWGy/8PZ/UjDD7asP/xMLQGrhGpbP3QjHMIDsFMo1UMVJ6GKUaSDaSTAA4uDDMHUA2DOWmpNPH+AAAAAASUVORK5CYII=");
  padding-right: 5px;
}

/* Schließen Kreuz */
div#schliessen {
  font-size: 0.9rem;
  text-align: center;
  height: 21px;
  margin-top: -5px;
  border-top-right-radius: 5px;
  outline: 0px;
}

div#schliessen:hover {
  color: rgb(255, 255, 255);
  background-color: rgb(232, 17, 35);
}

/* Ueberschrift */
div#ueberschrift {
  font-family: var(--font-family);
  font-size: clamp(1.2rem, 1.3vw, 1.4rem);
  font-variant: small-caps;
  color: var(--highlight-color);
  letter-spacing: 2px;
  text-align: center;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
}

/* Beschreibung */
div#beschreibung {
  margin-bottom: 5px;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
  -ms-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;
}

/* Formblock */
div#formblock {
  padding: 10px;
  min-width: 330px;
  max-width: 650px;
  min-height: 80px;
  resize: both;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

/* Zentrierter Absatz */
p.absatz {
  text-align: center;
}

/* Event */
.event {
  font-family: var(--font-family);
  font-size: clamp(0.8rem, 1vw, 1.1rem) !important;
  text-align: left;
  word-break: break-all;
  padding: 0px 0px 0px 2px;
  border-radius: 2px;
  border: none !important;
  box-shadow: 1px 1px 2px 0.5px rgb(130, 130, 130);
  display: block;
  width: 100%;
  margin-bottom: 4px;
  cursor: pointer;
}

form div.event {
  font-family: var(--font-family);
  font-size: clamp(1rem, 1.1vw, 1.1rem) !important;
  line-height: 22px;
  padding-left: 5px;
  width: 97%;
  cursor: text;
}

/* Bild, Video */
figure :is(img, video) {
  display: block;
  max-width: 100%;
  height: auto;
  border: Solid 1px rgb(32, 32, 32);
  border-radius: 5px;
  box-shadow: 5px 5px 5px rgb(153, 153, 153);
  margin-block-start: 0.5em;
  margin-block-end: 0.5em;
  cursor: default;
}

/* Kein JavaScript! */
noscript {
  color: rgb(255, 0, 0);
}

/* Mit JavaScript gesetzte CSS-Klassen */
.aktivevent {
  box-shadow: 0px 0px 0px 3px var(--highlight-color);
  outline: solid 0.5px rgb(255 255 255);
  position: relative;
}

.zeigeWoche {
  display: none;
}

/* Tooltip */
span.tool {
  display: inline-table;
  color: currentColor;
  cursor: help;
}

span.tip {
  display: none;
}

span.tool:hover span.tip {
  font-family: var(--font-family);
  font-size: 12px;
  color: currentColor;
  -webkit-user-select: text;
  user-select: text;
  cursor: text;
  display: table-caption;
  position: absolute;
  z-index: 2000;
  width: 250px;
  padding: 5px 0 5px 10px;
  background-color: var(--bgcolor-scheme);
  line-height: 20px;
  outline: solid 1px currentColor;
}

/* Monatsbilder */
div#monatsbild {
  height: 175px;
  background-size: cover !important;
  background-position: center center;
  box-shadow: inset 0px 0px 20px 0px rgba(170, 170, 170, 0.9);
  border-radius: 12px 12px 0 0;
  animation: bewegeMonatsbild 35s 2s ease-in-out infinite alternate;
}

@keyframes bewegeMonatsbild {
  from {
    background-position: top center;
  }
  to {
    background-position: bottom center;
  }
}

/* Fokusindikator (all) */
:focus-visible {
  outline: solid 1.5px var(--highlight-color);
}

/* Textbereich */
textarea {
  margin-top: 3px;
  width: 100%;
  max-width: 98%;
  min-width: 320px;
  height: 120px;
  min-height: 120px;
  max-height: 450px;
}

/* Eingabefelder und Buttons */
input[type="text"],
input[type="date"],
input[type="password"],
input[type="time"],
input[type="checkbox"],
button[type="button"],
textarea,
select {
  font-family: var(--font-family);
  font-size: 1rem;
  caret-color: rgb(255, 0, 0);
  border: solid 1px rgb(118, 118, 118);
  border-radius: 2px;
}

button[type="button"]:hover {
  color: var(--highlight-color);
  background-color: var(--highlight-bgcolor);
  border: solid 1px var(--highlight-color);
}

/* Akzentfarbe für Checkboxen */
input[type="checkbox"] {
  accent-color: var(--highlight-color);
}

/* Normale Checkboxen (checked) */
input[type="checkbox"]:checked + label {
  color: var(--highlight-color);
}

/* Checkbox zum kopieren (checked) */
input[type="checkbox"]:checked + label#copy {
  color: rgb(0, 172, 0);
}

/* Checkbox zum löschen (checked) */
input[type="checkbox"]:checked + label#delete {
  color: rgb(238, 0, 0);
}

/* Eingabefeld Event */
input[type="text"].eventfeld {
  width: 83%;
}

/* Pflichtfelder */
input:invalid {
  background-color: rgb(255, 255, 240);
}

/* Label (Transition-Effekt) */
label {
  transition: color 0.3s;
}

label:hover {
  color: var(--highlight-color);
}

/* Accesskey hervorheben */
label > u,
summary > u,
button > u {
  text-decoration: underline 1px var(--highlight-color);
  text-underline-offset: 1px;
}

/* Auswahlliste, abwechselnde Hintergrundfarbe */
option:nth-child(even) {
  background-color: var(--highlight-bgcolor);
}

/* Summary */
summary {
  transition: color 300ms;
}

summary:hover {
  color: var(--highlight-color);
}

/* Summary Pfeil-Symbol */
summary::marker {
  color: var(--highlight-color);
}

/* Media Screen */
@media screen and (max-width: 48rem) {
  table#tabelle td.eintag {
    height: 45px;
  }

  table#tabelle,
  div#aktiv form {
    font-size: 0.8rem;
  }

  /* Name des Wochentages kürzen */
  span.abbrWochentag {
    display: none;
  }

  .event {
    font-size: 0.6rem !important;
    line-height: 12px;
  }
}

@media screen and (min-width: 90rem) {
  table#tabelle td.eintag {
    height: 85px;
  }

  .event {
    line-height: 20px;
  }
}

@media screen and (min-width: 134rem) {
  table#tabelle td.eintag {
    height: 115px;
  }
}

/* Media Print
   Hier Elemente eintragen die beim ausdrucken nicht angezeigt werden sollen.
 */
@media print {
  p {
    display: none;
  }

  div#kalender,
  table#tabelle td {
    outline: solid 1px rgb(215, 215, 215);
  }
}

/* Media Color-Scheme (dark) */
@media (prefers-color-scheme: dark) {
  :root {
    --color: rgb(245, 245, 245);
    --bgcolor-even: rgba(0, 0, 0, 0.9);
    --bgcolor-odd: rgba(61, 61, 61, 0.9);
    --bgcolor-scheme: rgb(18, 18, 18);
  }

  div.event {
    box-shadow: 1px 1px 2px 0.5px rgb(255, 255, 255);
  }

  /* Heute */
  table#tabelle td.heute {
    box-shadow: inset 0px 0px 12px var(--highlight-color);
    border-radius: 2px;
  }

  /* Auswahlliste, abwechselnde Hintergrundfarbe */
  option:nth-child(even) {
    background-color: rgba(100, 100, 100, 0.9);
  }

  /* Pflichtfelder */
  input:invalid {
    background-color: rgb(92, 92, 51);
  }
}

/* Tag hervorheben 
td[data-tag="05.07.2022"],
td[data-tag="25.07.2022"] {
  background-color: #c6e3fd !important;
}
*/

/* Tag mit einem Bild hervorheben 
td[data-tag="07.07.2022"] {
  background-image: url("img/event.png");
  background-size: cover;
}
*/

/* Jeden zweiten Tag hervorheben 
td:nth-child(2n+1) {
  background-color: #dbf5fd !important;
}
*/

/* Tag mit einem Farbverlauf (Querstreifen) hervorheben 
td[data-tag="04.07.2022"] {
  background-image: repeating-linear-gradient(45deg, Lightsteelblue, Lightsteelblue 5px, White 5px, White 10px);
}
*/

/* Wochentag hervorheben 
td[data-wochentag="Samstag"],
td[data-wochentag="Sonntag"] {
  background-color: #ffcece !important;
}
*/

/* Name des Wochentags hervorheben 
th.Dienstag,
th.Donnerstag,
th.Samstag {
  background-color: #85ddf8 !important;
}
*/

/* Woche hervorheben 
tr[data-woche="1"],
tr[data-woche="29"] {
  outline: Solid 2px #11d100;
}
*/
