/* Theme slider (footer): Hell / Dunkel. */
.footer-utilities {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.15rem;
}

.theme-slider {
  --slider-index: 0;
  position: relative;
  isolation: isolate;
  width: 108px;
  min-height: 44px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--paper) 76%, transparent);
  box-shadow: var(--shadow-sm);
}

.theme-slider[data-active-index="0"] { --slider-index: 0; }
.theme-slider[data-active-index="1"] { --slider-index: 1; }

.theme-slider-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: -1;
  width: calc((100% - 8px) / 2);
  height: calc(100% - 8px);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 4px 14px rgba(31, 48, 40, 0.14);
  transform: translateX(calc(var(--slider-index) * 100%));
  transition:
    transform 420ms var(--ease-smooth),
    background-color var(--motion-base) var(--ease-smooth),
    box-shadow var(--motion-base) var(--ease-smooth);
}

.theme-slider-option {
  position: relative;
  min-width: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.38rem;
  padding: 0.42rem 0.45rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--green-soft) 76%, transparent);
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition:
    color var(--motion-fast) ease,
    transform var(--motion-base) var(--ease-smooth);
}

.theme-slider-option:hover {
  color: var(--green-deep);
}

.theme-slider-option:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
}

.theme-slider-option[aria-checked="true"] {
  color: var(--green-deep);
}

.theme-slider-option:active {
  transform: scale(0.94);
  transition-duration: var(--motion-fast);
}

.site-footer .theme-slider {
  border-color: rgba(226, 239, 229, 0.2);
  background: rgba(5, 16, 11, 0.46);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.site-footer .theme-slider-thumb {
  background: rgba(10, 24, 17, 0.94);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.32);
}

.site-footer .theme-slider-option,
.site-footer .theme-slider-option:hover,
.site-footer .theme-slider-option[aria-checked="true"] {
  color: #fffaf1;
}

.theme-slider-option svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

@media (max-width: 760px) {
  .footer-utilities {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .theme-slider {
    width: 108px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .theme-slider-thumb,
  .theme-slider-option {
    transition: none;
  }
}

/* Floating Instagram button: fixed bottom-right, subtle hover response only
   (no rotation, no label). Opens Katja's profile in a new tab. */
.floating-instagram {
  position: fixed;
  right: clamp(16px, 3vw, 26px);
  bottom: calc(clamp(16px, 3vw, 26px) + env(safe-area-inset-bottom, 0px));
  z-index: 950;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 30%;
  background: var(--green);
  color: var(--cream);
  box-shadow:
    0 4px 12px rgba(26, 22, 20, 0.18),
    0 14px 30px rgba(175, 100, 60, 0.26);
  transition:
    transform var(--motion-base) var(--ease-spring),
    box-shadow var(--motion-base) var(--ease-smooth),
    background-color var(--motion-fast) ease;
}

.floating-instagram svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (min-width: 761px) {
  .floating-instagram {
    width: 62px;
    height: 62px;
  }

  .floating-instagram svg {
    width: 40px;
    height: 40px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .floating-instagram:hover {
    transform: translateY(-4px) scale(1.055);
    box-shadow:
      0 6px 16px rgba(26, 22, 20, 0.2),
      0 20px 40px rgba(175, 100, 60, 0.3);
  }
}

.floating-instagram:active {
  transform: translateY(0) scale(0.94);
}

.floating-instagram:focus-visible {
  outline: 3px solid var(--warm);
  outline-offset: 4px;
}

/* Keep the footer's bottom row clear of the floating button. */
.footer-utilities {
  padding-right: 78px;
}

@media (max-width: 760px) {
  .floating-instagram {
    display: none;
  }

  .footer-utilities {
    padding-right: 0;
  }

  .site-footer {
    padding-bottom: 1.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .floating-instagram {
    transition: none;
  }

  .floating-instagram:hover,
  .floating-instagram:active {
    transform: none;
  }
}

/* Cookie banner: bottom-left so it never fights the floating Instagram
   button sitting bottom-right.
   Ablehnen und Annehmen sind bewusst gleich gross und gleich prominent:
   ein versteckter oder abgeschwaechter Ablehnen-Weg gilt als Dark Pattern
   und macht die Einwilligung angreifbar. Marketing ist per Default AUS
   (Opt-in), der Schalter wird erst durch eine aktive Entscheidung gesetzt. */
.cookie-banner {
  position: fixed;
  z-index: 1200;
  left: clamp(14px, 2.5vw, 22px);
  bottom: calc(clamp(14px, 2.5vw, 22px) + env(safe-area-inset-bottom, 0px));
  width: min(calc(100% - 28px), 356px);
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner-title {
  margin: 0 0 0.3rem;
  color: var(--green-deep);
  font-family: "Lora", Georgia, serif;
  font-size: 0.95rem;
}

.cookie-banner p {
  margin: 0 0 0.85rem;
  color: var(--green-soft);
  font-size: 0.79rem;
  line-height: 1.55;
}

.cookie-banner a {
  color: var(--warm);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 42%, transparent);
  text-underline-offset: 0.2em;
}

.cookie-banner a:hover,
.cookie-banner a:focus-visible {
  text-decoration-color: currentColor;
}

/* Detailebene: zugeklappt, damit der Banner klein bleibt. grid-template-rows
   statt max-height, weil die reale Hoehe (Textumbruch, Breakpoint) nicht
   geraten werden muss - 0fr/1fr animiert exakt auf die Inhaltshoehe. */
.cookie-banner-detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--motion-base) var(--ease-smooth);
}

.cookie-banner-detail-inner {
  overflow: hidden;
}

.cookie-banner[data-expanded="true"] .cookie-banner-detail {
  grid-template-rows: 1fr;
}

.cookie-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
}

.cookie-category:first-child {
  margin-top: 0.1rem;
  border-top: 0;
}

.cookie-category:last-child {
  margin-bottom: 0.7rem;
}

/* Eigener Save-Weg fuer den Schalterstand - unabhaengig von den zwei
   Haupt-Buttons, die immer nur "alles" oder "nichts" speichern. */
.cookie-banner-save {
  width: 100%;
  min-height: 34px;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(47, 81, 67, 0.28);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  color: var(--green-deep);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color var(--motion-base) var(--ease-smooth),
    background-color var(--motion-base) var(--ease-smooth);
}

.cookie-banner-save:hover {
  border-color: var(--green-soft);
  background: #fff;
}

.cookie-category-copy strong {
  display: block;
  margin-bottom: 0.12rem;
  color: var(--green-deep);
  font-size: 0.79rem;
}

.cookie-category-copy span {
  color: var(--green-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.cookie-switch {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 21px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--green-soft) 34%, transparent);
  cursor: pointer;
  transition: background-color var(--motion-base) var(--ease-smooth);
}

.cookie-switch[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

.cookie-switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform var(--motion-base) var(--ease-spring);
  content: "";
}

.cookie-switch[data-on="true"] {
  background: var(--green-deep);
}

.cookie-switch[data-on="true"]::after {
  transform: translateX(15px);
}

.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Beide Buttons teilen sich die Breite - kein optisches Gefaelle. */
.cookie-banner-actions .button {
  flex: 1 1 0;
  min-height: 38px;
  padding-inline: 0.9rem;
  font-size: 0.78rem;
}

.cookie-banner-settings {
  margin: 0.6rem 0 0;
  text-align: center;
}

.cookie-banner-settings button {
  border: 0;
  background: none;
  color: var(--green-soft);
  font-family: inherit;
  font-size: 0.73rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.cookie-banner-settings button:hover {
  color: var(--green-deep);
}

/* Scroll-entrance reveal: driven by assets/js/reveal.js (IntersectionObserver
   adds .is-visible once, then disconnects). Restrained on purpose, applied to
   section-level beats and card-grid children, not every paragraph. */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--motion-slow) var(--ease-smooth),
    transform var(--motion-slow) var(--ease-smooth);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

.reveal-delay-1.is-visible { transition-delay: 90ms; }
.reveal-delay-2.is-visible { transition-delay: 180ms; }
.reveal-delay-3.is-visible { transition-delay: 270ms; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
