/*
 * goetheg2026 Custom CSS
 * Nur noch Effekte, die theme.json nicht abdecken kann:
 * Texturen, Gradienten, Animationen, Layout-Feinheiten.
 *
 * Inhaltsverzeichnis:
 *   01. Basis & Globales
 *   02. Navigationsleiste
 *   03. Header-Logo
 *   04. Hauptnavigation
 *   05. Mobile-Menue
 *   06. Header-Suche
 *   07. Header-Cover
 *   08. Buttons & Paging
 *   09. Formular-Elemente
 *   10. Utility-Klassen & Listen
 *   11. Veranstaltungen
 *   12. Slider & Galerien
 *   13. Alt-Text-Einblendung
 *   14. Jahresfilter-Archiv
 *   15. Anker-Scroll & Sidenav
 *   16. Back-to-Top
 */

/* ============================================
   01. Basis & Globales
   ============================================ */
body {
  background-color: var(--wp--preset--color--base);
}

/* Screenreader-only (versteckte Blog-H1, Such-Label) */
.screen-reader-text {
  border: 0;
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
}

/* Fokus nur bei Tastaturnavigation (:focus-visible) */
a:focus-visible,
button:focus-visible,
.wp-element-button:focus-visible,
.wp-block-button__link:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary-dark);
  outline-offset: 2px;
}

/* ============================================
   02. Navigationsleiste
   ============================================ */
.navigation-bar {
  position: relative;
  z-index: 200;
  box-shadow: 0 3px 12px rgba(0,0,0,.5);
  background: linear-gradient(to bottom, #ffffff, #EFF19E);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  @media (max-width: 781px) {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 8px;
    padding-block: 5px;
  }
}

.navigation-bar .main-navigation {
  grid-column: 2;
}

/* ============================================
   03. Header-Logo
   ============================================ */
/* GGG-Siegel als Startseiten-Link in der Navigationsleiste */
.header-logo {
  display: block;
  width: 40px;
  height: 40px;
  aspect-ratio: 320.1 / 306.42;
  filter: drop-shadow(0px 0px 5px #FFF);

  /* Mobil: zentriert zwischen Menue-Toggle (links) und Such-Toggle (rechts).
     Absolut im relativ positionierten .navigation-bar, damit die Zentrierung
     von der Breite der Toggles unabhraengig bleibt */
  @media (max-width: 781px) {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
  }
}

.header-logo svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: var(--wp--custom--logo--color);
  transition: fill 0.15s ease;
}

.header-logo:hover svg,
.header-logo:focus-visible svg {
  fill: var(--wp--custom--logo--color-hover);
}

/* ============================================
   04. Hauptnavigation
   ============================================ */
/* Ginko-Blatt vor Hauptnavigations-Links (Mask-Technik wie slider.css) */
.main-navigation ul.wp-block-navigation__container > li.wp-block-navigation-item > a.wp-block-navigation-item__content::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.58em;
  margin-right: 0.22em;
  vertical-align: baseline;
  background-color: currentColor;
  transition: background-color 0.15s ease, transform 0.15s ease;
  -webkit-mask-image: url("../images/ginko.svg");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url("../images/ginko.svg");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.main-navigation ul.wp-block-navigation__container > li.wp-block-navigation-item > a.wp-block-navigation-item__content:hover::before,
.main-navigation ul.wp-block-navigation__container > li.wp-block-navigation-item > a.wp-block-navigation-item__content:focus-visible::before {
  transform: scale(1.15);
}

.main-navigation ul.wp-block-navigation__container > li.wp-block-navigation-item > a.wp-block-navigation-item__content {
  padding-block-start: 5px;
  color: var(--wp--preset--color--primary-dark);

  @media (min-width: 782px) {
    &:hover,
    &:focus-visible {
      color: var(--wp--preset--color--footer-bg);
    }
  }
}

/* Untermenues */
.wp-block-navigation-item.has-child .wp-block-navigation__submenu-container {
  @media (min-width: 781px) {
    background: #EFF19E;
    border-radius: 0 0 6px 6px;
    border-top: 0;
    box-shadow: 0 5px 5px rgba(0,0,0,.25);
  }
}

.wp-block-navigation:not(.has-text-color) .wp-block-navigation__submenu-container {
  min-width: 150px !important;
  color: var(--wp--preset--color--primary-dark);
}

.wp-block-navigation-item.has-child .wp-block-navigation__submenu-container .wp-block-navigation-item {
  background: none !important;
}

.wp-block-navigation-item.has-child .wp-block-navigation__submenu-container .wp-block-navigation-item .wp-block-navigation-item__content {
  padding: 10px;
}

/* Untermenue-Chevron (aus SVG-Sprite) */
.wp-block-navigation__submenu-icon svg {
  width: 12px;
  height: 12px;
}

/* ============================================
   05. Mobile-Menue
   ============================================ */
/* Toggle-Knopf als Ginko-Blatt im Kreis, Close-Knopf im Kreis (wie Such-Button) */
.main-navigation .wp-block-navigation__responsive-container-open svg {
  display: none;
}

.main-navigation .wp-block-navigation__responsive-container-open,
.main-navigation .wp-block-navigation__responsive-container-close {
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--wp--preset--color--primary-dark);
  border-radius: 50%;
  background: transparent;
  color: var(--wp--preset--color--primary-dark);
}

.main-navigation .wp-block-navigation__responsive-container-open:hover,
.main-navigation .wp-block-navigation__responsive-container-close:hover {
  background: rgba(0, 0, 0, 0.07);
}

.main-navigation .wp-block-navigation__responsive-container-open,
.main-navigation .wp-block-navigation__responsive-container-close {
  display: flex;
  justify-content: center;
  align-items: center;

  @media (min-width: 782px) {
    display: none;
  }
}

.main-navigation .wp-block-navigation__responsive-container-open::before {
  content: "";
  width: 24px;
  height: 27px;
  background-color: currentColor;
  -webkit-mask-image: url("../images/ginko.svg");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url("../images/ginko.svg");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.main-navigation .wp-block-navigation__responsive-container-close {
  top: 14px;
  right: 14px;
}

/* Overlay: heller Hintergrund wie Desktop-Navi, Links linksbuendig und groesser */
@media (max-width: 781px) {
  .main-navigation .wp-block-navigation__responsive-container.is-menu-open {
    background: linear-gradient(to bottom, #ffffff, #eff19e);
    padding-top: 20px;
  }

  /* WP dupliziert .wp-block-navigation aufs Overlay-ul und setzt dort die fluid
     Schriftgroesse direkt – Direktzuweisung schlaegt Vererbung vom Container */
  .main-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content ul.wp-block-navigation__container {
    font-size: 1.8rem;
  }

  .main-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    padding-top: calc(1.5rem + 40px);
  }

  .main-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
  .main-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list,
  .main-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container,
  .main-navigation .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item {
    width: 100%;
    align-items: flex-start;
    text-align: left;
    gap: 5px;
  }

  .main-navigation .wp-block-navigation__responsive-container.is-menu-open .has-child .wp-block-navigation__submenu-container {
    padding-top: 0;
    padding-left: 1.25em;
    padding-right: 0;
  }

  .wp-block-navigation .has-child .wp-block-navigation__submenu-container > .wp-block-navigation-item>.wp-block-navigation-item__content {
    padding: 0;
  }
}

/* Ginko-Toggle bis zum Desktop-Menue (ab 782px) sichtbar halten */
@media (min-width: 600px) and (max-width: 781px) {
  .main-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) {
    display: none;
  }

  .main-navigation .wp-block-navigation__responsive-container-open {
    display: flex;
  }
}

/* ============================================
   06. Header-Suche
   ============================================ */
/* Trigger-Button + einblendendes Suchfeld (mobil unterhalb, Desktop als Karte unter der Navi) */
.header-search {
  grid-column: 3;
  justify-self: end;

  @media (max-width: 781px) {
    justify-self: stretch;
  }

  @media (min-width: 782px) {
    position: relative;
  }
}

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--wp--preset--color--primary-dark);
  border-radius: 50%;
  background: transparent;
  color: var(--wp--preset--color--primary-dark);
  cursor: pointer;
}

.search-toggle:hover {
  background: rgba(0, 0, 0, 0.07);
}

.search-toggle:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary-dark);
  outline-offset: 2px;
}

.search-toggle svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.header-search-form {
  position: absolute;
  top: 100%;
  transform: translateY(10px);
  width: 0;
  padding: 8px;
  opacity: 0;
  overflow: hidden;
  background-color: var(--wp--preset--color--base);
  border-radius: 10px;
  box-shadow: 0 3px 12px #000000;
  z-index: 300;
  transition: width 0.3s ease, opacity 0.2s ease;
}

.header-search.is-open .header-search-form {
  width: 250px;
  opacity: 1;

  @media (min-width: 782px) {
    width: 340px;
  }

  @media (max-width: 480px) {
    width: calc(100% - 20px);
    left: 10px;
    box-sizing: border-box;
  }
}

.header-search-form .wp-block-search__inside-wrapper {
  width: 100%;
  gap: 10px;
}

.header-search-form .wp-block-search__input {
  width: 100%;
  border-radius: 8px 0 0 8px;
}

.header-search-form .wp-block-search__button {
  flex-shrink: 0;
}

/* ============================================
   07. Header-Cover
   ============================================ */
/* Header-Bereich mit Clip-Maske */
.header-cover {
  position: relative;
  min-height: 250px;
  margin-top: 0;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg,rgba(176, 186, 97, 1) 0%, rgba(239, 241, 158, 1) 100%);
  -webkit-mask-image: url("../images/header-mask_3.svg?v=3");
  mask-image: url("../images/header-mask_3.svg?v=3");
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;

  @media (max-width: 768px) {
    min-height: 200px !important;
    padding-top: 16px;
    padding-bottom: 24px;
  }
}

.header-cover .header-inner {
  width: 100%;
}

.header-cover .header-inner .header-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

.logo-container {
  flex: 0 1 auto;
  width: clamp(150px, 38%, 240px);
  aspect-ratio: 326 / 335;
  background: url("../images/goethe_header_3.svg") no-repeat center / contain;

  @media (max-width: 768px) {
    align-self: start;
    padding-top: 25px;
    width: 130px;
  }
}

.quote-container {
  flex: 1;
  margin: 0;
  color: var(--wp--preset--color--primary-dark);
  font-family:var(--wp--preset--font-family--heading);
  font-weight: 700;
  line-height: 1.2;
  font-size: 1.4rem;
  text-shadow: 1px 1px 0px #fff;

  @media (max-width: 768px) {
    font-size: 1.35rem !important;
  }

  @media (max-width: 480px) {
    position: absolute;
    top: 5px;
    right: 20px;
  }
}

.quote-container .header-quote {
  padding: 30px 50px 30% 0;

  @media (max-width: 768px) {
    padding: 25px 0 30%;
    font-size: 1.15rem !important;
    text-align: center !important;
  }

  @media (max-width: 480px) {
    padding: 0;
    font-size: 1rem !important;
  }
}

/* ============================================
   08. Buttons & Paging
   ============================================ */
/* Primaerer Button (generisch): Such-Buttons, Rueckblick-Paging, Editor-Stil */
.btn-primary,
.is-style-primary .wp-block-button__link,
.wp-block-search__button,
.wpcf7-submit,
.wp-pagenavi a,
.wp-pagenavi span.current {
  display: inline-block;
  padding: 0.45rem 1rem;
  border: 0;
  border-radius: 5px;
  background-color: var(--wp--preset--color--primary-dark);
  color: var(--wp--preset--color--base);
  font-size: var(--wp--preset--font-size--small);
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary:hover,
.is-style-primary .wp-block-button__link:hover,
.wp-block-search__button:hover,
.wpcf7-submit:hover,
.wp-pagenavi a:hover {
  background-color: var(--wp--preset--color--footer-bg);
  text-decoration: none;
}

.wp-pagenavi span.current {
  background-color: var(--wp--preset--color--secondary);
  color: var(--wp--preset--color--contrast);
  cursor: default;
}

/* Paging (WP-PageNavi, z. B. Rueckblick) */
.wp-pagenavi {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 25px 0;
}

.wp-pagenavi .pages,
.wp-pagenavi .extend {
  color: var(--wp--preset--color--muted);
}

/* ============================================
   09. Formular-Elemente
   ============================================ */
/* Einheitlich wie Suchfeld im Header
   (Such-Inputs ausgenommen: eigene Kette ueber theme.json/WP-Core,
   identische Tokens, aber abweichender Radius beim Button-inside-Variant) */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
select,
textarea {
  padding: 8px;
  border: 1px solid var(--wp--preset--color--secondary);
  border-radius: 8px;
  background-color: var(--wp--preset--color--base);
  color: var(--wp--preset--color--contrast);
  font-family: inherit;
  font-size: var(--wp--preset--font-size--small);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  border-color: var(--wp--preset--color--primary-dark);
  outline: none;
}

/* ============================================
   10. Utility-Klassen & Listen
   ============================================ */
/* Fuer Bestandsinhalte */
.highlighted {
  background: var(--wp--preset--color--secondary);
  border-radius: 3px;
  color: #FFFFFF;
  font-weight: bold;
  padding: 3px 5px;
  text-decoration: none;
}

.textblock1 {
  text-align: justify;
}

.img-float-left {
  width: 300px;
  float: left;
  margin-right: 10px;
}

.img-float-right {
  width: 300px;
  float: right;
  margin-left: 10px;
}

/* Liste mit Ginko-Blatt als Aufzaehlungszeichen (Block-Stil "Ginko") */
ul {
  list-style: none;
  padding-inline-start: 2rem;
}

ul li.is-style-ginko-list {
  position: relative;
  padding-inline-start: 1.7em;
  margin-bottom: 15px;
}

ul li.is-style-ginko-list::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.15em;
  width: 1em;
  height: 1.16em;
  background-color: var(--wp--preset--color--primary-dark);
  -webkit-mask-image: url("../images/ginko.svg");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: url("../images/ginko.svg");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

/* ============================================
   11. Veranstaltungen
   ============================================ */
/* Styling wie im alten goetheg-Theme */
.events-list .events {
  display: flex;
  flex-direction: column;
  gap: 25px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.events-list .entry {
  position: relative;
  list-style: none;
  border-radius: 0 10px 0 10px;
  background: var(--wp--preset--color--entry-bg);
  border: 1px solid rgba(0, 0, 0, 0);
  padding: 5px 25px 15px;
}

.events-list .date {
  font-size: 0.8rem;
  position: absolute;
  top: -10px;
  text-align: right;
  display: block;
  width: calc(100% - 20px);
  right: 20px;

  @media (max-width: 480px) {
    position: relative;
    width: auto;
    top: 0;
    right: 0;
  }
}

.events-list h3 {
  margin: 15px 0 10px;
  font-family: var(--wp--preset--font-family--heading);
  font-size: 20pt;
  font-weight: bold;
  text-decoration: none;
}

.events-list p {
  margin: 3px 0;
  font-size: 14px;
}

/* ============================================
   12. Slider & Galerien
   ============================================ */
/* Startseiten-Slider: breiter als die Content-Spalte */
.site-main .wp-block-shortcode:has(.ggg-slider),
.site-main .ggg-slider {
  max-width: min(960px, 100%);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 50px;
}

/* Foto-Galerien (NextGEN/Slick): gleiche Optik wie der Startseiten-Slider */
.ngg-galleryoverview.ngg-slideshow {
  max-width: min(960px, 100%) !important;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 781px) {
  .ngg-galleryoverview.ngg-slideshow {
    min-height: auto !important;
  }
}

.ngg-slideshow .slick-list {
  border-radius: 0 10px 0 10px;
  background: var(--wp--preset--color--entry-bg)
}

/* Best-Fit: Slide-Box mit festem Seitenverhaeltnis, Bild fuellt sie via object-fit.
   Modded-Slick kapselt jeden Anker in <div><a style="display:inline-block"> –
   daher Kette Slide -> Div -> Anker auf volle Hoehe bringen. */
.ngg-slideshow.slick-slider .slick-slide {
  height: auto;
  aspect-ratio: 3 / 2;
}

.ngg-slideshow.slick-slider .slick-slide > div {
  height: 100%;
}

.ngg-slideshow.slick-slider .slick-slide > div > a {
  display: block !important;
  height: 100%;
}

.ngg-slideshow .slick-slide img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover;
}

.ngg-slideshow .slick-prev,
.ngg-slideshow .slick-next {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.5s ease, background-color 0.15s ease;

  @media (hover: none) {
    display: none;
  }
}

.ngg-slideshow:hover .slick-prev,
.ngg-slideshow:hover .slick-next,
.ngg-slideshow:has(.slick-prev:focus-visible, .slick-next:focus-visible) .slick-prev,
.ngg-slideshow:has(.slick-prev:focus-visible, .slick-next:focus-visible) .slick-next {
  opacity: 1;
}

.ngg-slideshow .slick-prev {
  left: 12px;
}

.ngg-slideshow .slick-next {
  right: 12px;
}

.ngg-slideshow .slick-prev:hover,
.ngg-slideshow .slick-next:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.ngg-slideshow .slick-prev:before,
.ngg-slideshow .slick-next:before {
  content: none;
}

/* Pfeil-Icons Startseiten-Slider (ueber SVG-Sprite) */
.ggg-slider__arrow {
  color: #ffffff;
}

.ggg-slider__arrow svg {
  display: block;
  width: 18px;
  height: 18px;
}

/* Pfeil-Icons NextGEN-Slider (Slick, Plugin-Markup): Data-URI */
.ngg-slideshow .slick-prev,
.ngg-slideshow .slick-next {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
}

.ngg-slideshow .slick-prev {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3C/svg%3E");
  left: 12px !important
}

.ngg-slideshow .slick-next {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
  right: 12px !important
}

.ngg-slideshow .slick-arrow:focus-visible {
  outline: 2px solid var(--wp--preset--color--primary-dark);
  outline-offset: 2px;
}

/* ============================================
   13. Alt-Text-Einblendung
   ============================================ */
/* Fly-in von oben fuer beide Slider */
.ggg-slider,
.ngg-galleryoverview.ngg-slideshow {
  position: relative;
  overflow: hidden;
}

.ggg-slider__title {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 6px 16px;
  border-radius: 0 10px 0 0;
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-100% - 10px));
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.is-title-visible > .ggg-slider__title {
  opacity: 1;
  transform: translateY(0);
}

.ggg-slider__alt {
  flex: 1 1 auto;
  min-width: 0;
}

.ggg-slider__count {
  flex-shrink: 0;
  padding: 1px 9px;
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
}

/* ============================================
   14. Jahresfilter-Archiv
   ============================================ */
.goetheg-year-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 5px;
  margin-bottom: 30px;
  background: var(--wp--preset--color--button-bg);
  border-radius: 6px;
}

.goetheg-year-filter label {
  font-weight: 600;
}

.goetheg-year-filter select {
  padding: 5px 12px;
}

.goetheg-year-filter select:focus-visible {
  outline-offset: 2px;
}

.goetheg-year-archive.is-layout-liste .goetheg-year-entry :is(h2, h3) {
  margin: 2em 0.5em 0.5em;
  text-align: center;
}

/* Galerietitel der Archiveintraege (inc/year-archive.php) */
.gallery-title {
  margin: 50px 0 0 0;
  text-align: center;
}

.goetheg-has-js .goetheg-year-entry.is-hidden {
  display: none;
}

.goetheg-show-more {
  display: none;
  margin-top: 40px;
}

.goetheg-has-js .goetheg-show-more:not([hidden]) {
  display: inline-block;
}

/* Lange Eintraege kuerzen (nur Listen-Layout, per JS gemessen) */
.goetheg-has-js .goetheg-year-archive.is-layout-liste .goetheg-year-entry__content {
  --goetheg-truncate-lines: 50;
  max-height: calc(var(--goetheg-truncate-lines, 100) * 1lh);
  overflow: hidden;
}

.goetheg-year-archive.is-layout-liste .goetheg-year-entry.is-expanded .goetheg-year-entry__content {
  max-height: none;
}

.goetheg-year-archive.is-layout-liste .goetheg-year-entry.is-truncated:not(.is-expanded) .goetheg-year-entry__content {
  position: relative;
}

.goetheg-year-archive.is-layout-liste .goetheg-year-entry.is-truncated:not(.is-expanded) .goetheg-year-entry__content::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 6em;
  background: linear-gradient(rgba(255, 255, 255, 0),rgba(255, 255, 255, 1));
  pointer-events: none;
}

.goetheg-read-more {
  margin-top: 20px;
}

/* ============================================
   15. Anker-Scroll & Sidenav
   ============================================ */
/* Sanftes Scrollen zu Anker-Zielen (Sidenav, Back-to-Top) */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

.goetheg-year-entry[id] {
  scroll-margin-top: 20px;
}

/* Sidenav: Anker-Sprungliste der Beitraege (Foto-Galerien, Rueckblick) */
.goetheg-sidenav {
  z-index: 80;
}

.goetheg-sidenav ul {
  margin: 0;
  padding: 0;
}

/* In der Sidenav ausgeblendete Beitraege erst mit JS verbergen (Sync mit Archiv) */
.goetheg-has-js .goetheg-sidenav li.is-hidden {
  display: none;
}

/* Mobil/Tablet: kompakte Punkte-Navigation am rechten Rand */
@media (max-width: 1079px) {
  .goetheg-sidenav {
    position: fixed;
    top: 50%;
    right: 4px;
    transform: translateY(-50%);
    font-size: var(--wp--preset--font-size--small);
  }

  .goetheg-sidenav__title {
    display: none;
  }

  .goetheg-sidenav ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    max-height: 72vh;
    padding: 3px 5px;
    overflow-y: auto;
  }

  .goetheg-sidenav a {
    display: block;
    width: 12px;
    height: 12px;
    padding: 0;
    border: 1px solid var(--wp--preset--color--muted);
    border-radius: 50%;
    background-color: var(--wp--preset--color--base);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    font-size: 0;
    line-height: 0;
  }

  .goetheg-sidenav a:hover,
  .goetheg-sidenav a:focus-visible {
    background-color: var(--wp--preset--color--tertiary);
    outline-offset: 3px;
  }

  .goetheg-sidenav a.is-active {
    border-color: var(--wp--preset--color--primary-dark);
    background-color: var(--wp--preset--color--primary-dark);
    transform: scale(1.3);
  }

  .goetheg-has-js .goetheg-sidenav .goetheg-show-more {
    display: block;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    padding: 0;
    border: 1px dashed var(--wp--preset--color--muted);
    border-radius: 50%;
    background-color: var(--wp--preset--color--base);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    font-size: 0;
    line-height: 0;
    cursor: pointer;
  }

  .goetheg-has-js .goetheg-sidenav .goetheg-show-more::before {
    content: "+";
    display: block;
    font-size: 11px;
    line-height: 12px;
    font-weight: 700;
    color: var(--wp--preset--color--primary-dark);
  }

  .goetheg-has-js .goetheg-sidenav .goetheg-show-more:hover,
  .goetheg-has-js .goetheg-sidenav .goetheg-show-more:focus-visible {
    background-color: var(--wp--preset--color--tertiary);
  }

  .goetheg-has-js .goetheg-sidenav .goetheg-show-more:focus-visible {
    outline-offset: 3px;
  }

  .goetheg-sidenav .goetheg-sidenav__top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    padding: 0;
    border: 1px dashed var(--wp--preset--color--muted);
    border-radius: 50%;
    background-color: var(--wp--preset--color--base);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    cursor: pointer;
  }

  .goetheg-sidenav .goetheg-sidenav__top-btn span {
    display: none;
  }

  .goetheg-sidenav .goetheg-sidenav__top-btn svg {
    width: 9px;
    height: 9px;
    fill: var(--wp--preset--color--primary-dark);
  }

  .goetheg-sidenav .goetheg-sidenav__top-btn:hover,
  .goetheg-sidenav .goetheg-sidenav__top-btn:focus-visible {
    background-color: var(--wp--preset--color--tertiary);
  }

  .goetheg-sidenav .goetheg-sidenav__top-btn:focus-visible {
    outline-offset: 3px;
  }
}

/* Ab 1080px: feste Spaltenleiste rechts neben der Content-Spalte */
@media (min-width: 1080px) {
  .goetheg-sidenav {
    position: fixed;
    top: 50%;
    transform:translateY(-50%);
    right: max(16px, calc((100vw - 660px) / 2 - 265px));
    display: flex;
    flex-direction: column;
    width: 200px;
    max-height: calc(100vh - 48px);
    margin: 0;
    padding: 12px;
    background: var(--wp--preset--color--base);
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
    font-size: var(--wp--preset--font-size--small);
  }

  .goetheg-sidenav ul {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--wp--preset--color--muted) transparent;
  }

  .goetheg-sidenav ul::-webkit-scrollbar {
    width: 4px;
  }

  .goetheg-sidenav ul::-webkit-scrollbar-thumb {
    border-radius: 2px;
    background-color: var(--wp--preset--color--muted);
  }

  .goetheg-sidenav__title {
    flex-shrink: 0;
    margin: 0;
    padding: 0 10px 8px;
    font-weight: 700;
    color: var(--wp--preset--color--primary-dark);
  }

  .goetheg-sidenav a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    padding: 7px 10px;
    border-left: 3px solid var(--wp--preset--color--secondary);
    color: var(--wp--preset--color--contrast);
    line-height: 1.35;
    text-decoration: none;
  }

  .goetheg-sidenav a:hover,
  .goetheg-sidenav a:focus-visible {
    background: var(--wp--preset--color--tertiary);
  }

  .goetheg-sidenav a.is-active {
    background: var(--wp--preset--color--tertiary);
    border-left-color: var(--wp--preset--color--primary-dark);
    font-weight: 700;
  }

  .goetheg-has-js .goetheg-sidenav .goetheg-show-more {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 7px 10px;
    border: 0;
    background: transparent;
    color: var(--wp--preset--color--primary-dark);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
  }

  .goetheg-has-js .goetheg-sidenav .goetheg-show-more:hover,
  .goetheg-has-js .goetheg-sidenav .goetheg-show-more:focus-visible {
    background: var(--wp--preset--color--tertiary);
  }

  .goetheg-sidenav .goetheg-sidenav__top-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 7px 10px;
    border: 0;
    background: transparent;
    color: var(--wp--preset--color--primary-dark);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
  }

  .goetheg-sidenav .goetheg-sidenav__top-btn svg {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    fill: currentColor;
  }

  .goetheg-sidenav .goetheg-sidenav__top-btn:hover,
  .goetheg-sidenav .goetheg-sidenav__top-btn:focus-visible {
    background: var(--wp--preset--color--tertiary);
  }
}

/* ============================================
   16. Back-to-Top
   ============================================ */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--wp--preset--color--button-bg);
  color: var(--wp--preset--color--primary-dark);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s, background-color 0.15s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background-color: var(--wp--preset--color--tertiary);
}

.back-to-top svg {
  display: block;
  width: 24px;
  height: 24px;
}

@media (max-width: 480px) {
  .back-to-top {
    right: 12px;
    bottom: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transform: none;
    transition: background-color 0.15s ease;
  }
}
