:root {
  color-scheme: dark;
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #000 url("https://www.tastenundco.de/dateien/template/bg.gif") repeat-x;
  color: #9e9e9e;
  font-size: 0.75rem;
  text-align: center;
}

a {
  color: #9e9e9e;
  font-weight: 700;
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: #bcbcbc;
}

#wrapper {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vh, 4rem) 1rem 2.5rem;
}

#alles {
  width: 100%;
}

#jahrlink,
#jahrlink-bottom {
  color: #e11515;
  font-size: clamp(2rem, 5vw, 2.5rem);
  margin-bottom: 1.25rem;
}

.prev,
.next {
  font-size: 1.5rem;
  font-weight: 400;
  opacity: 0.45;
}

.prev:hover,
.next:hover,
.prev:focus-visible,
.next:focus-visible {
  opacity: 1;
}

.web {
  color: #2069a0;
}

.jahrverlinkt .web {
  font-weight: 400;
}

.jahrverlinkt:hover .web,
.jahrverlinkt:focus-visible .web {
  color: #2a73aa;
}

.jahreskalender {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.monatscontainer table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 2px;
  table-layout: fixed;
}

caption.monat {
  color: #9e9e9e;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.35rem 0;
}

th,
td {
  height: 1.4rem;
  padding: 0.1rem;
  color: #c4c4c4;
  font-size: 0.75rem;
  text-align: center;
}

th {
  font-weight: 700;
}

.kw {
  color: #808080;
}

.sa {
  color: #2069a0;
}

.so {
  color: #af0200;
}

td:not(.empty):hover,
td:not(.empty):focus-visible,
.aktuell {
  border-radius: 3px;
  background: #fff;
  color: #000;
}

.ferien,
.feiertag {
  border-radius: 3px;
  background: #8a8a8a;
  color: #000;
  cursor: help;
}

#copyright {
  width: 100%;
  padding: 1.5rem 0 2rem;
  clear: both;
  line-height: 1.6;
}

#copyright a {
  color: #225487;
}

#jahrlink-bottom {
  display: none;
}

@media (max-width: 900px) {
  .jahreskalender {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #wrapper {
    padding-top: 2rem;
  }

  .jahreskalender {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .monatscontainer table {
    width: min(100%, 28rem);
    margin: 0 auto;
  }

  th,
  td {
    height: 1.8rem;
    font-size: 0.9rem;
  }

  #jahrlink-bottom {
    display: block;
    margin-top: 0.5rem;
    margin-bottom: 0;
  }
}

/* Mobile Jahresnavigation per Wischgeste: vertikales Scrollen bleibt möglich. */
#jahreskalender {
    touch-action: pan-y;
}

/* Touch-Hinweis für Feiertage und Ferien. Desktop nutzt weiterhin den title-Hover.
   Die Zelle ist nur der Positionsanker; der Tooltip liegt absolut darüber und
   nimmt deshalb keinen Platz im Tabellenlayout ein. */
td[data-tip] {
  position: relative;
}

.day-anchor {
  display: inline;
}

.touch-tooltip {
  position: absolute;
  z-index: 1000;
  left: 50%;
  bottom: calc(100% + 8px);
  width: max-content;
  max-width: min(18rem, calc(100vw - 1rem));
  padding: 0.45rem 0.65rem;
  border: 1px solid #666;
  border-radius: 4px;
  background: #fff;
  color: #000;
  font-size: 0.85rem;
  line-height: 1.3;
  text-align: left;
  pointer-events: none;
  transform: translateX(calc(-50% + var(--tooltip-shift-x, 0px)));
}

.touch-tooltip.below {
  top: calc(100% + 8px);
  bottom: auto;
}

.touch-tooltip[hidden] {
  display: none;
}
