/* ==========================================================================
   Termine – latest events row (Bootstrap 5)
   Recreates the old Gravity/Warp "Aktuelle Termine" look:
   green month tab, white day tile with two small rings, 18/32 title,
   12.8/32 time. Scoped to .mod_events_latest_table.
   ========================================================================== */

/* Optional: same webfonts as the old site. Keep @import at the very top. */
@import url("https://fonts.googleapis.com/css2?family=Catamaran:wght@200;700&family=Varela&display=swap");

.mod_events_latest_table {
  --tt-green: #9cb440;
  --tt-green-dark: #859a37;
  --tt-link: #a0b2b6;
  --tt-link-hover: rgba(168, 192, 78, 0.8);
  width: 100%;
}

.mod_events_latest_table td {
  padding: 0;
  border: 0;
  vertical-align: top;
}

/* JEvents puts all events of the module into ONE table row, side by side.
   Stack them vertically so they stay inside the card. */
.mod_events_latest_table,
.mod_events_latest_table tbody,
.mod_events_latest_table tr,
.mod_events_latest_table td {
  display: block;
  width: 100%;
  max-width: 100%;
}

.mod_events_latest_table .tt-event__title a.ev_link_row {
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 32px;
}

/* JEvents' events_css.css sets 12px / 14px on a.ev_link_row on list pages.
   Keep the title size of the card (18px / 32px) on every page. */
.mod_events_latest_table .tt-event__title .mod_events_latest_content {
  line-height: 32px;
}

/* JEvents' modstyle.css adds a bottom border to every row; the old card had none. */
.mod_events_latest_table tr {
  border: 0;
}

.mod_events_latest_table .tt-event,
.mod_events_latest_table .tt-event * {
  box-sizing: border-box;
}

.mod_events_latest_table .tt-event {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.mod_events_latest_table .tt-event__date {
  flex: 0 0 52px;
  width: 52px;
  margin-top: 10px;
  text-align: center;
  font-family: "Catamaran", "Helvetica Neue", Arial, sans-serif;
}

.mod_events_latest_table .tt-event__month {
  display: block;
  padding-top: 4px;
  border-radius: 2px;
  background: var(--tt-green);
  border-bottom: 2px solid var(--tt-green-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.mod_events_latest_table .tt-event__day {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 5px;
  padding-bottom: 4px;
  border: 1px solid rgba(156, 180, 64, 0.25);
  border-bottom: 4px double rgba(156, 180, 64, 0.25);
  border-radius: 3px;
  background: #fff;
  color: var(--tt-green);
  font-size: 24px;
  font-weight: 200;
  line-height: 40px;
  text-align: center;
}

.mod_events_latest_table .tt-event__day::before,
.mod_events_latest_table .tt-event__day::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: rgba(156, 180, 64, 0.3);
}

.mod_events_latest_table .tt-event__day::before {
  left: 7px;
}

.mod_events_latest_table .tt-event__day::after {
  right: 7px;
}

.mod_events_latest_table .tt-event__body {
  flex: 1 1 auto;
  min-width: 0;
}

.mod_events_latest_table .tt-event__title {
  margin: 0 0 5px;
  font-family: "Catamaran", "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 32px;
}

/* --------------------------------------------------------------------------
   Event title link
   JEvents renders {{Titel-Link:TITLE_LINK}} as:
     <a class="ev_link_row" href="…" title="…">Event title</a>
   The old theme only coloured links without a class
   (`.uk-panel-box-secondary a:not([class])`), so this anchor kept the default
   green. Target .ev_link_row explicitly and keep the old selectors as
   fallbacks for manually written links.
   -------------------------------------------------------------------------- */
.mod_events_latest_table .tt-event__title a.ev_link_row,
.mod_events_latest_table .tt-event__title .mod_events_latest_content a,
.mod_events_latest_table .tt-event__body .tt-event__title a,
.mod_events_latest_table .mod_events_latest_content a,
.mod_events_latest_table a.tt-event__link {
  color: var(--tt-link);
  text-decoration: none;
  transition: color 250ms linear;
}

.mod_events_latest_table .tt-event__title a.ev_link_row:hover,
.mod_events_latest_table .tt-event__title a.ev_link_row:focus,
.mod_events_latest_table .tt-event__title .mod_events_latest_content a:hover,
.mod_events_latest_table .tt-event__title .mod_events_latest_content a:focus,
.mod_events_latest_table .tt-event__body .tt-event__title a:hover,
.mod_events_latest_table .tt-event__body .tt-event__title a:focus,
.mod_events_latest_table .mod_events_latest_content a:hover,
.mod_events_latest_table .mod_events_latest_content a:focus,
.mod_events_latest_table a.tt-event__link:hover,
.mod_events_latest_table a.tt-event__link:focus {
  color: var(--tt-link-hover);
  text-decoration: underline;
}

.mod_events_latest_table .tt-event__time {
  color: inherit;
  font-family: "Varela", "Helvetica Neue", Arial, sans-serif;
  font-size: 12.8px;
  font-weight: 400;
  line-height: 32px;
}

/* All-day events produce an empty time line – hide it completely.
   Important: the JEvents layout must keep the two time tags on the same line
   as <small>, with no whitespace between them:
   <small class="tt-event__time">{{Startzeit:...}}{{Endzeit:...}}</small>
   Otherwise the leftover spaces/newlines make the element non-empty. */
.mod_events_latest_table .tt-event__time:empty {
  display: none;
}

/* Reset JEvents' own latest-events styles (modstyle.css) inside the card.
   It sets line-height: 14px on .mod_events_latest_content. */
.mod_events_latest_table .mod_events_latest_content {
  margin-top: 0;
  line-height: inherit;
  vertical-align: baseline;
}

/* Keep the inner date spans from inheriting module styles. */
.mod_events_latest_table .tt-event__month .mod_events_latest_date,
.mod_events_latest_table .tt-event__day .mod_events_latest_date {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  line-height: inherit;
}

/* Bootstrap spacing utilities use !important. If you keep mt-3 / mb-0 on the
   <h4>, these rules restore the old 0 top / 5px bottom spacing. You can drop
   the utilities from the markup instead and delete this block. */
.mod_events_latest_table .tt-event__title.mt-3 {
  margin-top: 10px !important;
}

.mod_events_latest_table .tt-event__title.mb-0 {
  margin-bottom: 5px !important;
}

/* Tabelle der Events für 1.Halbjahr */
#eventlist a.ev_link_row {
  font-family: "Catamaran", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: #808080;
  text-decoration: none;
}
#eventlist a.ev_link_row:hover,
#eventlist a.ev_link_row:focus {
  color: #808080;
  text-decoration: underline;
}


/* ==========================================================================
   Header menu – old Gravity/UIkit look for Joomla's mod_menu (Cassiopeia)
   Recreates the original falken-grundschule.de navigation:
     · Varela 16px, 35px rows, 0 15px padding
     · lime links (#dbea9e) that turn white on hover / current / open
     · skewed translucent white stripe that grows to full height
     · orange (#f86625) dropdown panels, 240px wide, 10px padding, 4px radius
     · white 16px/32px dropdown links, 3px 10px padding, green hover
     · optional translucent uppercase dropdown headings
   Everything is scoped to .container-header .mod-menu so nothing else on the
   site is touched.

   Requires the Varela webfont. The Termine stylesheet already imports it:
     @import url("...&family=Varela&display=swap");
   If you paste this file without the Termine CSS, add that @import as the very
   first line of the custom CSS block.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Variables + shared resets
   -------------------------------------------------------------------------- */
.container-header .mod-menu {
  --mnu-font: "Varela", "Noto Sans", sans-serif;
  --mnu-link: #dbea9e;
  --mnu-link-active: #ffffff;
  --mnu-drop-bg: #f86625;
  --mnu-drop-bg-hover: #9cb440;
  --mnu-drop-width: 240px;
  --mnu-ease: cubic-bezier(0.27, 1.5, 0.32, 0.95);
  --mnu-gap: 6px;          /* space between the bar and the dropdown */
  --mnu-max-width: none;   /* set to 655px to force the old two-row wrap */

  font-family: var(--mnu-font);
  margin: 0;
  padding: 0;
  list-style: none;
}

.container-header .mod-menu li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.container-header .mod-menu a,
.container-header .mod-menu .mod-menu__heading {
  font-family: var(--mnu-font);
  text-transform: none;
  letter-spacing: 0;
}

/* Cassiopeia's own indicators are replaced by the old skewed stripe. */
.container-header .mod-menu > li::after {
  content: none;
  display: none;
}

/* Joomla 6 renders an accessible "submenu" toggle button (chevron icon) after
   every parent link. The old design has no arrow, and as a block sibling it
   wraps onto a second line and makes the header taller. Submenus are still
   reachable: hover / :focus-within on desktop, always expanded on mobile. */
.container-header .mod-menu .mod-menu__toggle-sub {
  display: none;
}

/* --------------------------------------------------------------------------
   2. Desktop bar (>= 992px)
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
  .container-header .mod-menu {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    align-content: flex-start;
    max-width: var(--mnu-max-width);
  }

  .container-header .mod-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
  }

  /* Cassiopeia spaces items with margin; the old menu used link padding. */
  .container-header .mod-menu > li + li {
    margin-left: 0;
  }

  /* --- top-level links ------------------------------------------------- */
  .container-header .mod-menu > li > a,
  .container-header .mod-menu > li > .mod-menu__heading {
    position: relative;
    display: block;
    box-sizing: border-box;
    height: 35px;
    padding: 0 15px;
    font-size: 16px;
    font-weight: 400;
    line-height: 35px;
    color: var(--mnu-link);
    background-color: transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.5s var(--mnu-ease);
  }

  /* Skewed highlight – starts as a 0px-high stripe and grows to full height. */
  .container-header .mod-menu > li > a::after {
    content: "";
    position: absolute;
    top: 0;
    left: 45%;
    display: inline-block;
    width: 8px;
    height: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transform: skew(-20deg);
    transition: height 0.5s var(--mnu-ease);
    pointer-events: none;
  }

  .container-header .mod-menu > li:hover > a,
  .container-header .mod-menu > li:focus-within > a,
  .container-header .mod-menu > li.current > a,
  .container-header .mod-menu > li.active > a,
  .container-header .mod-menu > li > a:focus-visible {
    color: var(--mnu-link-active);
    background-color: transparent;
    text-decoration: none;
  }

  .container-header .mod-menu > li:hover > a::after,
  .container-header .mod-menu > li:focus-within > a::after,
  .container-header .mod-menu > li.current > a::after,
  .container-header .mod-menu > li.active > a::after,
  .container-header .mod-menu > li > a:focus-visible::after {
    height: 100%;
  }

  /* --- dropdown panel -------------------------------------------------- */
  .container-header .mod-menu > li > .mod-menu__sub {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1001;
    display: none;
    box-sizing: border-box;
    width: var(--mnu-drop-width);
    min-width: 0;
    margin: var(--mnu-gap) 0 0;
    padding: 10px;
    list-style: none;
    font-size: 16px;
    background-color: var(--mnu-drop-bg);
    background-image: linear-gradient(180deg, var(--mnu-drop-bg) 0%, var(--mnu-drop-bg) 100%);
    border-radius: 4px;
    box-shadow:
      inset -1px -1px 0 rgba(0, 0, 0, 0.1),
      inset 1px 0 0 rgba(0, 0, 0, 0.1),
      2px 2px 1px rgba(0, 0, 0, 0.075),
      inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  }

  /* Transparent bridge so the mouse can cross the gap without closing it. */
  .container-header .mod-menu > li > .mod-menu__sub::before {
    content: "";
    position: absolute;
    top: calc(-1 * var(--mnu-gap));
    left: 0;
    right: 0;
    height: var(--mnu-gap);
  }

  /* mod_menu.js toggles aria-hidden; :hover / :focus-within is the no-JS fallback. */
  .container-header .mod-menu > li > .mod-menu__sub[aria-hidden="false"],
  .container-header .mod-menu > li:hover > .mod-menu__sub,
  .container-header .mod-menu > li:focus-within > .mod-menu__sub {
    display: block;
    animation: mnu-fade 0.2s ease-in-out;
  }

  /* --- dropdown links -------------------------------------------------- */
  .container-header .mod-menu .mod-menu__sub > li {
    position: relative;
  }

  .container-header .mod-menu .mod-menu__sub > li > a,
  .container-header .mod-menu .mod-menu__sub > li > .mod-menu__heading {
    display: block;
    box-sizing: border-box;
    padding: 3px 10px;
    font-size: 16px;
    font-weight: 400;
    line-height: 32px;
    color: #ffffff;
    background-color: transparent;
    text-decoration: none;
    border-radius: 4px;
    transition: none;
  }

  .container-header .mod-menu .mod-menu__sub > li > a:hover,
  .container-header .mod-menu .mod-menu__sub > li > a:focus,
  .container-header .mod-menu .mod-menu__sub > li > a:focus-visible,
  .container-header .mod-menu .mod-menu__sub > li.current > a,
  .container-header .mod-menu .mod-menu__sub > li.active > a {
    color: #ffffff;
    background-color: var(--mnu-drop-bg-hover);
    box-shadow:
      inset 0 -1px 0 rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.075);
    text-decoration: none;
  }

  /* First item sits flush with the panel edge – no top inner shadow. */
  .container-header .mod-menu .mod-menu__sub > li:first-child > a:hover,
  .container-header .mod-menu .mod-menu__sub > li:first-child > a:focus,
  .container-header .mod-menu .mod-menu__sub > li:first-child.current > a,
  .container-header .mod-menu .mod-menu__sub > li:first-child.active > a {
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.1);
  }

  /* --- dropdown headings ("Menu Heading" items) ------------------------ */
  .container-header .mod-menu .mod-menu__sub > li > .mod-menu__heading {
    padding: 7px 10px 0;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 400;
    line-height: 32px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.2);
    cursor: default;
  }

  /* --- third level: flyout to the right -------------------------------- */
  .container-header .mod-menu .mod-menu__sub .mod-menu__sub {
    position: absolute;
    top: 0;
    left: 100%;
    z-index: 999;
    display: none;
    box-sizing: border-box;
    width: var(--mnu-drop-width);
    margin: 0;
    padding: 10px;
    background-color: var(--mnu-drop-bg);
    background-image: linear-gradient(180deg, var(--mnu-drop-bg) 0%, var(--mnu-drop-bg) 100%);
    border-radius: 4px;
    box-shadow:
      inset 0 0 0 1px #f7550c,
      2px 2px 1px rgba(0, 0, 0, 0.075);
  }

  .container-header .mod-menu .mod-menu__sub > li:hover > .mod-menu__sub,
  .container-header .mod-menu .mod-menu__sub > li:focus-within > .mod-menu__sub,
  .container-header .mod-menu .mod-menu__sub > li > .mod-menu__sub[aria-hidden="false"] {
    display: block;
    animation: mnu-fade 0.2s ease-in-out;
  }
}

@keyframes mnu-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* --------------------------------------------------------------------------
   3. Mobile / tablet (<= 991.98px)
   Cassiopeia stacks the menu vertically here. The default mod_menu layout has
   no toggle button, so submenus stay expanded – nothing can get "stuck shut"
   on touch devices.
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .container-header .mod-menu {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .container-header .mod-menu > li {
    position: relative;
    margin: 0;
    padding: 0;
  }

  .container-header .mod-menu > li > a,
  .container-header .mod-menu > li > .mod-menu__heading {
    display: block;
    padding: 8px 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: var(--mnu-link);
    background-color: transparent;
    text-decoration: none;
  }

  .container-header .mod-menu > li:hover > a,
  .container-header .mod-menu > li.current > a,
  .container-header .mod-menu > li.active > a {
    color: var(--mnu-link-active);
    text-decoration: none;
  }

  /* Submenus always visible, indented, slightly quieter than the top level.
     The two selectors need to beat Cassiopeia's `.mod-menu .parent > ul`. */
  .container-header .mod-menu > li > .mod-menu__sub,
  .container-header .mod-menu .mod-menu__sub > li > .mod-menu__sub {
    display: block;
    margin: 0 0 4px;
    padding: 0 0 0 15px;
    list-style: none;
    font-size: 16px;
    color: inherit;
  }

  .container-header .mod-menu .mod-menu__sub > li {
    margin: 0;
    padding: 0;
  }

  .container-header .mod-menu .mod-menu__sub > li > a,
  .container-header .mod-menu .mod-menu__sub > li > .mod-menu__heading {
    display: block;
    padding: 5px 0;
    font-size: 15px;
    line-height: 24px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
  }

  .container-header .mod-menu .mod-menu__sub > li > a:hover,
  .container-header .mod-menu .mod-menu__sub > li.current > a,
  .container-header .mod-menu .mod-menu__sub > li.active > a {
    color: #ffffff;
    text-decoration: none;
  }

  .container-header .mod-menu .mod-menu__sub > li > .mod-menu__heading {
    margin-top: 4px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: default;
  }
}

/* --------------------------------------------------------------------------
   4. Accessibility
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .container-header .mod-menu > li > a,
  .container-header .mod-menu > li > a::after,
  .container-header .mod-menu > li > .mod-menu__sub,
  .container-header .mod-menu .mod-menu__sub .mod-menu__sub {
    transition: none;
    animation: none;
  }
}

/* ===========================================================================
   --------------------------------------------------------------------------
   Left sidebar submenu – active subpage in green with white text.
   Scoped to the left sidebar so the header menu is not affected.
   Paste into the custom CSS block (below the other styles). 
   ----------------------------------------------------------------------------*/
.container-sidebar-left .mod-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.container-sidebar-left .mod-menu > li {
  margin: 0;
  padding: 0;
}

.container-sidebar-left .mod-menu > li > a {
  display: block;
  padding: 6px 10px;
  border-radius: 4px;
  color: #232b2d;
  text-decoration: none;
  line-height: 24px;
}

.container-sidebar-left .mod-menu > li.current > a,
.container-sidebar-left .mod-menu > li > a:hover {
  background-color: #9cb440;
  color: #ffffff;
}


/* ================================================================
   ----------------------------------------------------------------
  Article headline (h1) – same look as the old uk-article-title.
   Paste below the menu CSS in the custom CSS block. Catamaran is already
   loaded by the Termine stylesheet (weights 200 and 700). */

main .page-header h1 {
  margin: 0 0 20px 0;
  font-family: "Catamaran", sans-serif;
  font-size: 42px;
  font-weight: 200;
  line-height: 60px;
  letter-spacing: normal;
  text-transform: none;
  color: #232b2d;
  hyphens: auto;
  -webkit-hyphens: auto;
}

main .page-header h1::after {
  content: "//";
  right: -10px;
  bottom: 0;
  color: #9cb440;
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -3px;
  position: relative;
}

main .page-header h1 a {
  color: inherit;
  text-decoration: none;
}

@media (max-width: 900px) {
  main .page-header h1 {
    font-size: 32px;
    line-height: 48px;
  }

  main .page-header h1::after {
    font-size: 32px;
  }
}

/* Category blog headings (h2 in .page-header) – same look as the article h1. */
.com-content-category-blog .page-header h2 {
  margin: 0 0 20px 0;
  font-family: "Catamaran", sans-serif;
  font-size: 42px;
  font-weight: 200;
  line-height: 60px;
  letter-spacing: normal;
  text-transform: none;
  color: #232b2d;
  hyphens: auto;
  -webkit-hyphens: auto;
}

.com-content-category-blog .page-header h2::after {
  content: "//";
  right: -10px;
  bottom: 0;
  color: #9cb440;
  font-size: 42px;
  font-weight: 400;
  letter-spacing: -3px;
  position: relative;
}

.com-content-category-blog .page-header h2 a {
  color: inherit;
  text-decoration: none;
}

@media (max-width: 900px) {
  .com-content-category-blog .page-header h2 {
    font-size: 32px;
    line-height: 48px;
  }

  .com-content-category-blog .page-header h2::after {
    font-size: 32px;
  }
}


/* =========================================================
   blog formatting
*/
.com-content-category-blog .blog-item {
  display: block;
  width: 100%;
  break-inside: avoid;
}

.com-content-category-blog .page-header h2 {
  overflow-wrap: break-word;
  word-break: normal;
}


/* --------------------------------------------------------------------------
   smaller logo */
.brand-logo img.logo {
  max-height: 48px;
  width: auto;
}

.container-header .brand-logo img.logo 
{ 
  max-height: 48px; 
  width: auto; 
}

/* --------------------------------------------------------------------------
  box design */
.card.orange-box {
  background-color: #f86625;
  color: #ffffff;
  border: 0;
}
.card.orange-box > .card-header,
.card-header.orange-box {
  background-color: #f86625;
  background-image: none;
  color: #ffffff;
  border-bottom: 0;
}
.card.orange-box a {
  color: #ffffff;
}

.card.green-box {
  background-color: #9cb440;
  color: #ffffff;
  border: 0;
}
.card.green-box > .card-header,
.card-header.green-box {
  background-color:  #9cb440;
  background-image: none;
  color: #ffffff;
  border-bottom: 0;
}
.card.green-box a {
  color: #ffffff;
}

.card.dunkelgrau-box {
  background-color: #313d40;
  color: #ffffff;
  border: 0;
}
.card.dunkelgrau-box > .card-header,
.card-header.dunkelgrau-box {
  background-color:  #313d40;
  background-image: none;
  color: #ffffff;
  border-bottom: 0;
}
.card.dunkelgrau-box a {
  color: #ffffff;
}

.card.orange-box a:not(.ev_link_row):hover {
  color: #521a00 !important;
}

.card.dunkelgrau-box a:not(.ev_link_row):hover {
  color: rgba(168, 192, 78, 0.8) !important;
}

.card.green-box a:not(.ev_link_row):hover {
  color: #2b3d0c !important;
}

/* alle cards - abstand überschriften */
.card > .card-header {
  padding-top: 30px;
}

/* events sollen unten keinen weißen rand haben */
.mod_events_latest_table tr,
.mod_events_latest_table td {
  border-bottom: 0 !important;
}
