:root {
  --primary: #253362;
  --bg: #f7f8fa;
  --border: #e0e2ea;
  --card-gap: 16px;
  --search-bar-bg: #ef7b17; 
  --header-height: 59px; 
  --search-bar-height: 47px; 
}

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  margin: 0;
  background: var(--bg);
  color: var(--primary);
  overflow-anchor: auto;
}

a {
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0.62rem 2vw;
  position: sticky;
  top: 0;
  z-index: 30;
}
h1#main-headline-container { 
  font-size: 1.22rem; 
  margin: 0; 
  font-weight: 700; 
  line-height: 1.2; 
}

.header-textblock .subtitle {
  font-size: 0.9em;
  color: #555; 
  margin-top: 2px;
}

#ticket-link-wrapper { 
  font-weight: normal; 
  margin-left: 5px; 
}

.ticket-button { 
  display: inline; 
  color: #ef7b17; 
  text-decoration: none; 
  font-weight: 600; 
  font-size: 0.8em; 
  vertical-align: middle; 
  transition: color 0.2s ease, text-decoration 0.2s ease;
}

.ticket-button:hover, 
.ticket-button:focus {
  color: #d36c15; 
  text-decoration: underline; 
}

.actions-container { 
  display: flex;
  align-items: center;
  gap: 15px; 
}

.lang-buttons { display: flex; gap: 8px; }
.lang-buttons button {
  background: none; border: none; font-size: 1rem; color: var(--primary); font-weight: 600;
  border-bottom: 2px solid transparent; padding: 5px 12px; cursor: pointer;
  height: 34px; 
  display: flex;
  align-items: center;
  justify-content: center;
}
.lang-buttons button.active,
.lang-buttons button:focus {
  border-bottom: 2px solid var(--primary); 
  background: #4387ff22; 
}

#search-icon-btn { 
  background: none;
  border: none;
  color: var(--primary);
  font-size: 1.1rem; 
  cursor: pointer;
  padding: 5px 8px; 
  border-radius: 4px;
  height: 34px; 
  display: flex;
  align-items: center;
  justify-content: center;
}
#search-icon-btn:hover, #search-icon-btn:focus {
  background: #4387ff22; 
}

#search-bar {
  position: sticky;
  top: var(--header-height); 
  background: var(--search-bar-bg); 
  z-index: 25;
  border-bottom: 1px solid #d36c15; 
  display: none; 
  align-items: center;
  padding: 0.6em 2vw;
  gap: 0.5em;
}

body.search-visible #search-bar {
  display: flex; 
}

#search-input {
  background: #fff; 
  border: 1px solid #d36c15;  
  color: #333;
  flex-grow: 1; 
  padding: 0.5em 0.7em;
  border-radius: 4px;
}
#search-input::placeholder {
  color: #555; 
}

#reset-search {
  position: absolute;
  right: calc(2vw + 10px);
  top: 50%;
  background: none;
  border: none;
  font-size: 1.3em;
  color: #fff; 
  cursor: pointer;
  width: 2em;
  height: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: color 0.2s, opacity 0.2s;
  z-index: 100;
  transform: translateY(-50%);
  margin: 0;
}
#reset-search:hover { color: #eee; opacity: 1; }

.no-events {
  text-align: center; color: #bbb; font-size: 1.08em; margin: 3em 0;
}

@media (min-width: 900px) {
  .timetable-day { margin-bottom: 2.5em; }
  .day-label { font-size: 1.4em; font-weight: 700; margin: 1.6em 0 0.8em 0.5vw; }
  .room-grid {
    display: grid; grid-template-columns: repeat(var(--room-count), 1fr); gap: 0.6em;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }
  .room-col {
    background: #fff; border: 1px solid var(--border);
    border-radius: 7px; min-height: 80px; padding: 0.2em 0.7vw 0.8em 0.7vw;
    display: flex; flex-direction: column; gap: var(--card-gap);
    position: relative;
  }
  .room-col .room-header { 
    font-weight: 700; font-size: 1.08em; text-align: center; padding: 0.7em 0 0.3em 0;
    border-bottom: 3.5px solid var(--border); 
    margin-bottom: 0.6em;
    position: relative;
  }
}

.event-card { 
  background: #f8fafd;
  border: 1.3px solid var(--border); 
  display: flex; flex-direction: column; gap: 0.35em;
  font-size: 1em; padding: 0.35em 0.35em 0.7em 0.35em; border-radius: 4px;
  box-shadow: 0 1px 5px #0001;
  min-width: 0;
  transition: box-shadow 0.16s;
  position: relative;
}

.event-time-start {
  color: #222;
  font-weight: 500;
}
.event-time-end {
  color: #aaa;
  font-weight: 400;
  font-size: 0.96em;
}

.event-title.with-link {
  color: #2370e2;
  cursor: pointer;
  transition: text-decoration 0.13s, color 0.13s;
}
.event-title.with-link:hover,
.event-title.with-link:focus {
  color: #174099;
}

.event-img-link { display: block; position: relative;}
.event-img {
  width: 100%; min-width: 0; max-width: 100%; object-fit: cover;
  aspect-ratio: 1170/600;
  margin-bottom: 0.22em; margin-top: 0.13em;
  border-radius: 3px; border: 1px solid #f0f0f4;
  transition: outline 0.16s;
}
.event-img-link:hover .event-img, .event-img-link:focus .event-img {
  outline: 2px solid #2781e7;
}
.event-title { 
  font-size: 0.99em; font-weight: 600; color: #2d3140; line-height: 1.3; word-break: break-word;
  max-height: none;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  display: block;
}

.day-label {
  position: sticky;
  z-index: 10;
  background: #fff;
  border-bottom: 1.5px solid var(--border);
  padding: 0.65em 0 0.45em 0; 
  color: #253362;
  top: var(--header-height);
}

body.search-visible .day-label {
  top: calc(var(--header-height) + var(--search-bar-height));
}

@media (max-width: 899px) {
  .timetable-day { margin-bottom: 2em; }
  .day-label {
    font-size: 1.17em;
    font-weight: 700 !important;
    margin-top: 0; 
    margin-bottom: 0.3em;
  }

  .room-mobile {
    margin-bottom: 1em; background: #fff; border-radius: 5px; border: 1px solid var(--border);
    padding: 0.18em 0.5em 0.5em 0.5em;
    position: relative;
  }
  .room-header { 
    font-weight: 700 !important;
    font-size: 1.07em;
    padding: 0.6em 0 0.55em 0.15em !important;
    color: #253362;
    border-bottom: 2px solid var(--border); 
  }
  .mobile-event-list {
    display: flex; flex-direction: column; gap: 13px;
  }
  .event-card { 
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.7em;
    padding: 0.32em 0.19em 0.6em 0.13em;
    min-width: 0;
    min-height: unset;
    position: relative;
  }
  .event-main-mobile {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.45em;
    flex: 1 1 0;
    min-width: 0;
  }
  .event-time-mobile {
    min-width: 54px;
    max-width: 60px;
    text-align: right;
    font-size: 0.98em;
    line-height: 1.08;
    flex-shrink: 0;
    margin-top: 3px;
    margin-bottom: 0;
    display: block;
  }
  .event-img-link, .event-img {
    width: 180px !important; 
    min-width: 180px !important;
    max-width: 180px !important;
    height: auto;
    aspect-ratio: 1170/600;
    margin-right: 0.11em;
    flex-shrink: 0;
  }
  .event-title, .event-title.with-link { 
    font-size: 1em; 
    max-width: 100%;
    word-break: break-word;
    white-space: normal;
    margin-bottom: 0;
    max-height: unset;
    line-height: 1.28;
    overflow: visible;
    text-align: left;
    display: block;
    flex: 1 1 0;
  }
  .event-icons-mobile {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 0.16em;
    min-width: 2.1em;
    margin-left: 0.5em;
    margin-right: 0.1em;
    margin-top: 0.1em;
  }
  .event-youtube-link a, 
  .event-youtube-link { 
    color: #ff2321 !important;
    font-size: 1.05em;
    display: inline-block;
    vertical-align: middle;
    margin-bottom: 0.07em;
  }
  .event-youtube-link a:hover, 
  .event-youtube-link a:focus,
  .event-youtube-link:hover,
  .event-youtube-link:focus {
    background: #ffeaea !important;
    border-radius: 50%;
  }
  .event-info-link a,
  .event-info-link { 
    color: #2781e7 !important;
    font-size: 1em;
    margin-top: 0.10em;
    display: inline-block;
    vertical-align: middle;
  }
  .event-info-link a:hover, 
  .event-info-link a:focus,
  .event-info-link:hover,
  .event-info-link:focus {
    background: #eaf4ff !important;
    border-radius: 50%;
  }
}

@media (max-width: 499px) {
  .event-img-link, .event-img {
    width: 90px !important; 
    min-width: 90px !important;
    max-width: 90px !important;
  }
  .event-title, .event-title.with-link { 
    font-size: 0.9em; 
    line-height: 1.25; 
  }
  .event-main-mobile {
    gap: 0.3em; 
  }
  .event-time-mobile {
    min-width: 48px; 
    font-size: 0.92em;
  }
}

@media (min-width: 900px) {
  .day-label {
    font-size: 1.4em; 
    font-weight: 700;
    padding: 0.65em 0.35em 0.35em 0.65em; 
    margin: 1.6em 0 0.8em 0.5vw; 
  }
}

@media (min-width: 900px) { 
  .event-toprow {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0.1em;
    gap: 0.13em;
  }
  .event-time {
    margin-right: auto;
  }
  .event-icons-wrap {
    display: flex;
    align-items: center;
    gap: 0.15em;
    margin-left: 1.2em;
  }
  .event-youtube-link { 
    display: flex;
    align-items: center;
    margin: 0 0.28em 0 0;
  }
  .event-youtube-link a {
    color: #ff2321;
    background: none !important;
    font-size: 1em;
    padding: 0 0.1em 0 0.1em;
    border-radius: 50%;
    display: inline-block;
    line-height: 1;
  }
  .event-youtube-link a:hover,
  .event-youtube-link a:focus {
    background: #ffeaea !important;
  }
  .event-youtube-link i.fa-youtube {
    font-size: 1.05em;
    vertical-align: middle;
    position: relative;
    top: 1px;
  }
  .event-info-link { 
    margin-left: 0.12em;
    min-width: 2.2em;
    align-self: flex-start;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 1em;
    padding: 0;
  }
  .event-info-link a {
    color: #2781e7;
    font-size: 1em;
    padding: 2px 5px 0 5px;
    border-radius: 50%;
    background: #eaf4ff;
    display: inline-block;
    transition: background 0.14s;
    line-height: 1;
  }
  .event-info-link a:hover,
  .event-info-link a:focus { background: #d5ebff; }
  .event-info-link i.fa-up-right-from-square {
    font-size: 1em;
    line-height: 1;
    color: #2781e7;
    vertical-align: middle;
    position: relative;
    top: 1px;
  }
}

@media (min-width: 900px) and (max-width: 1300px) {
  html, body {
    font-size: 15px;
  }
  .day-label,
  .room-header { 
    font-size: 1em !important; 
  }
  .event-card, .event-title, .event-time {
    font-size: 0.97em !important;
  }
  .room-col .room-header { 
    font-size: 1em !important;
    padding-top: 0.55em;
    padding-bottom: 0.18em;
  }
}

footer {
  text-align: center;
  padding: 20px;
  font-size: 0.9em;
  color: #777;
}

footer a {
  color: var(--primary); /* Verwendet Ihre Hauptfarbe für Links im Footer */
}

footer a:hover,
footer a:focus {
  color: #ef7b17; /* Verwendet Ihre Akzentfarbe für Hover im Footer */
}